(window.webpackJsonp_name_=window.webpackJsonp_name_||[]).push([[0],{1:function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return o})),n.d(e,"__assign",(function(){return i})),n.d(e,"__rest",(function(){return u})),n.d(e,"__decorate",(function(){return a})),n.d(e,"__param",(function(){return c})),n.d(e,"__metadata",(function(){return s})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return f})),n.d(e,"__createBinding",(function(){return d})),n.d(e,"__exportStar",(function(){return m})),n.d(e,"__values",(function(){return g})),n.d(e,"__read",(function(){return h})),n.d(e,"__spread",(function(){return p})),n.d(e,"__spreadArrays",(function(){return v})),n.d(e,"__spreadArray",(function(){return b})),n.d(e,"__await",(function(){return y})),n.d(e,"__asyncGenerator",(function(){return w})),n.d(e,"__asyncDelegator",(function(){return x})),n.d(e,"__asyncValues",(function(){return C})),n.d(e,"__makeTemplateObject",(function(){return S})),n.d(e,"__importStar",(function(){return O})),n.d(e,"__importDefault",(function(){return T})),n.d(e,"__classPrivateFieldGet",(function(){return _})),n.d(e,"__classPrivateFieldSet",(function(){return E}));
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function u(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function a(t,e,n,r){var o,i=arguments.length,u=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(u=(i<3?o(u):i>3?o(e,n,u):o(e,n))||u);return i>3&&u&&Object.defineProperty(e,n,u),u}function c(t,e){return function(n,r){e(n,r,t)}}function s(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}c((r=r.apply(t,e||[])).next())}))}function f(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var d=Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function m(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||d(e,t,n)}function g(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function p(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h(arguments[e]));return t}function v(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}function b(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function w(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(t,e||[]),i=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(t){o[t]&&(r[t]=function(e){return new Promise((function(n,r){i.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=o[t](e)).value instanceof y?Promise.resolve(n.value.v).then(c,s):l(i[0][2],n)}catch(t){l(i[0][3],t)}var n}function c(t){a("next",t)}function s(t){a("throw",t)}function l(t,e){t(e),i.shift(),i.length&&a(i[0][0],i[0][1])}}function x(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,o){e[r]=t[r]?function(e){return(n=!n)?{value:y(t[r](e)),done:"return"===r}:o?o(e):e}:o}}function C(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=g(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,o){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,o,(e=t[n](e)).done,e.value)}))}}}function S(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var k=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function O(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&d(e,t,n);return k(e,t),e}function T(t){return t&&t.__esModule?t:{default:t}}function _(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function E(t,e,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(t,n):o?o.value=n:e.set(t,n),n}},267:function(t,e,n){"use strict";var r=n(373),o=n(377),i=n(268);t.exports=function(t){var e,n=r(t);return n.space?((e=Array(3))[0]=i(n.values[0],0,255),e[1]=i(n.values[1],0,255),e[2]=i(n.values[2],0,255),"h"===n.space[0]&&(e=o.rgb(e)),e.push(i(n.alpha,0,1)),e):[]}},268:function(t,e){t.exports=function(t,e,n){return e<n?t<e?e:t>n?n:t:t<n?n:t>e?e:t}},270:function(t,e,n){var r;void 0===(r=function(){return function(t){function e(t,e){var n,r;for(n=-1,r=t.length;++n<r;)e(t[n],n,t)}function n(t,n){var r;return r=Array(t.length),e(t,(function(t,e,o){r[e]=n(t,e,o)})),r}function r(t,n,r){return e(t,(function(t,e,o){r=n(t,e,o)})),r}function o(t,n){var r,o,i;return i=this._matrix=[],t==n?this.distance=0:""==t?this.distance=n.length:""==n?this.distance=t.length:(r=[0],e(t,(function(t,e){e++,r[e]=e})),i[0]=r,e(n,(function(u,a){o=[++a],e(t,(function(e,i){i++,t.charAt(i-1)==n.charAt(a-1)?o[i]=r[i-1]:o[i]=Math.min(r[i]+1,o[i-1]+1,r[i-1]+1)})),r=o,i[i.length]=r})),this.distance=o[o.length-1])}return o.prototype.toString=o.prototype.inspect=function(t){var e,o,i,u;for(o=r(e=this.getMatrix(),(function(t,e){return Math.max(t,r(e,Math.max,0))}),0),i=Array((o+"").length).join(" "),u=[];u.length<(e[0]&&e[0].length||0);)u[u.length]=Array(i.length+1).join("-");return u=u.join("-+")+"-",n(e,(function(t){return n(t,(function(t){return(i+t).slice(-i.length)})).join(" |")+" "})).join("\n"+u+"\n")},o.prototype.getMatrix=function(){return this._matrix.slice()},o.prototype.valueOf=function(){return this.distance},o}()}.call(e,n,e,t))||(t.exports=r)},28:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},340:function(t,e,n){(function(e){!function(){"use strict";var n=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},r=function(t){return{eq:t}},o=r((function(t,e){return t===e})),i=function(t){return r((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))},u=function(t,e){return function(t,e){return r((function(n,r){return t.eq(e(n),e(r))}))}(i(t),(function(t){return function(t,e){return Array.prototype.slice.call(t).sort(e)}(t,e)}))},a=function(t){return r((function(e,n){var r=Object.keys(e),i=Object.keys(n);if(!u(o).eq(r,i))return!1;for(var a=r.length,c=0;c<a;c++){var s=r[c];if(!t.eq(e[s],n[s]))return!1}return!0}))},c=r((function(t,e){if(t===e)return!0;var r=n(t);return r===n(e)&&(function(t){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(t)}(r)?t===e:"array"===r?i(c).eq(t,e):"object"===r&&a(c).eq(t,e))})),s=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},l=function(t){return function(e){return typeof e===t}},f=function(t){return function(e){return t===e}},d=s("string"),m=s("object"),g=s("array"),h=f(null),p=l("boolean"),v=f(void 0),b=function(t){return null==t},y=function(t){return!b(t)},w=l("function"),x=l("number"),C=function(){},S=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},k=function(t,e){return function(n){return t(e(n))}},O=function(t){return function(){return t}},T=function(t){return t},_=function(t,e){return t===e};function E(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var A=function(t){return function(e){return!t(e)}},D=function(t){return t()},M=function(t){t()},N=O(!1),R=O(!0),z=function(){return B},B=function(){var t=function(t){return t()},e=T;return{fold:function(t,e){return t()},isSome:N,isNone:R,getOr:e,getOrThunk:t,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:O(null),getOrUndefined:O(void 0),or:e,orThunk:t,map:z,each:C,bind:z,exists:N,forall:R,filter:function(){return z()},toArray:function(){return[]},toString:O("none()")}}(),I=function(t){var e=O(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:R,isNone:N,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return I(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:B},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},P={some:I,none:z,from:function(t){return null==t?B:I(t)}},L=Array.prototype.slice,H=Array.prototype.indexOf,F=Array.prototype.push,V=function(t,e){return H.call(t,e)},j=function(t,e){return V(t,e)>-1},U=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},W=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},q=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},G=function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}},$=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},X=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},K=function(t,e,n){return G(t,(function(t,r){n=e(n,t,r)})),n},Y=function(t,e,n){return q(t,(function(t,r){n=e(n,t,r)})),n},J=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return P.some(i);if(n(i,r))break}return P.none()},Q=function(t,e){return J(t,e,N)},Z=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return P.some(n)}return P.none()},tt=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!g(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);F.apply(e,t[n])}return e}(W(t,e))},et=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},nt=function(t){var e=L.call(t,0);return e.reverse(),e},rt=function(t,e){return X(t,(function(t){return!j(e,t)}))},ot=function(t,e){return e>=0&&e<t.length?P.some(t[e]):P.none()},it=function(t){return ot(t,0)},ut=function(t){return ot(t,t.length-1)},at=w(Array.from)?Array.from:function(t){return L.call(t)},ct=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return P.none()},st=Object.keys,lt=Object.hasOwnProperty,ft=function(t,e){for(var n=st(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},dt=function(t,e){return mt(t,(function(t,n){return{k:n,v:e(t,n)}}))},mt=function(t,e){var n={};return ft(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},gt=function(t){return function(e,n){t[n]=e}},ht=function(t,e,n,r){return ft(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},pt=function(t,e){var n={};return ht(t,e,gt(n),C),n},vt=function(t){return function(t,e){var n=[];return ft(t,(function(t,r){n.push(e(t,r))})),n}(t,T)},bt=function(t,e){return yt(t,e)?P.from(t[e]):P.none()},yt=function(t,e){return lt.call(t,e)},wt=function(t,e){return yt(t,e)&&void 0!==t[e]&&null!==t[e]},xt=Array.isArray,Ct=function(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(yt(t,r)&&!1===e.call(n,t[r],r,t))return!1;return!0},St=function(t,e){var n=[];return Ct(t,(function(r,o){n.push(e(r,o,t))})),n},kt=function(t,e){var n=[];return Ct(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},Ot=function(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},Tt=function(t,e,n,r){for(var o=v(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o},_t=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},Et=function(t){return t[t.length-1]},At=function(){return(At=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Dt(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var Mt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Nt=function(){return Rt(0,0)},Rt=function(t,e){return{major:t,minor:e}},zt={nu:Rt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Nt():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Rt(r(1),r(2))}(t,n)},unknown:Nt},Bt=function(t,e){var n=String(e).toLowerCase();return Q(t,(function(t){return t.search(n)}))},It=function(t,e){return-1!==t.indexOf(e)},Pt=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,0)},Lt=function(t){return function(e){return e.replace(t,"")}},Ht=Lt(/^\s+|\s+$/g),Ft=Lt(/^\s+/g),Vt=Lt(/\s+$/g),jt=function(t){return t.length>0},Ut=function(t){return!jt(t)},Wt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,qt=function(t){return function(e){return It(e,t)}},Gt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return It(t,"edge/")&&It(t,"chrome")&&It(t,"safari")&&It(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Wt],search:function(t){return It(t,"chrome")&&!It(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return It(t,"msie")||It(t,"trident")}},{name:"Opera",versionRegexes:[Wt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:qt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:qt("firefox")},{name:"Safari",versionRegexes:[Wt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(It(t,"safari")||It(t,"mobile/"))&&It(t,"applewebkit")}}],$t=[{name:"Windows",search:qt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return It(t,"iphone")||It(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:qt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:qt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:qt("linux"),versionRegexes:[]},{name:"Solaris",search:qt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:qt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:qt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Xt={browsers:O(Gt),oses:O($t)},Kt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},Yt={unknown:function(){return Kt({current:void 0,version:zt.unknown()})},nu:Kt,edge:O("Edge"),chrome:O("Chrome"),ie:O("IE"),opera:O("Opera"),firefox:O("Firefox"),safari:O("Safari")},Jt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},Qt={unknown:function(){return Jt({current:void 0,version:zt.unknown()})},nu:Jt,windows:O("Windows"),ios:O("iOS"),android:O("Android"),linux:O("Linux"),osx:O("OSX"),solaris:O("Solaris"),freebsd:O("FreeBSD"),chromeos:O("ChromeOS")},Zt=function(t,e,n){var r=Xt.browsers(),o=Xt.oses(),i=e.bind((function(t){return function(t,e){return ct(e.brands,(function(e){var n=e.brand.toLowerCase();return Q(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:zt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return Bt(t,e).map((function(t){var n=zt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(Yt.unknown,Yt.nu),u=function(t,e){return Bt(t,e).map((function(t){var n=zt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(Qt.unknown,Qt.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:O(o),isiPhone:O(i),isTablet:O(c),isPhone:O(s),isTouch:O(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:O(l),isDesktop:O(f)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}},te=function(t){return window.matchMedia(t).matches},ee=Mt((function(){return Zt(navigator.userAgent,P.from(navigator.userAgentData),te)})),ne=function(){return ee()},re=navigator.userAgent,oe=ne(),ie=oe.browser,ue=oe.os,ae=oe.deviceType,ce=/WebKit/.test(re)&&!ie.isEdge(),se="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,le=-1!==re.indexOf("Windows Phone"),fe={opera:ie.isOpera(),webkit:ce,ie:!(!ie.isIE()&&!ie.isEdge())&&ie.version.major,gecko:ie.isFirefox(),mac:ue.isOSX()||ue.isiOS(),iOS:ae.isiPad()||ae.isiPhone(),android:ue.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:ie.isIE()?document.documentMode||7:10,fileApi:se,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!ie.isIE(),desktop:ae.isDesktop(),windowsPhone:le,browser:{current:ie.current,version:ie.version,isChrome:ie.isChrome,isEdge:ie.isEdge,isFirefox:ie.isFirefox,isIE:ie.isIE,isOpera:ie.isOpera,isSafari:ie.isSafari},os:{current:ue.current,version:ue.version,isAndroid:ue.isAndroid,isChromeOS:ue.isChromeOS,isFreeBSD:ue.isFreeBSD,isiOS:ue.isiOS,isLinux:ue.isLinux,isOSX:ue.isOSX,isSolaris:ue.isSolaris,isWindows:ue.isWindows},deviceType:{isDesktop:ae.isDesktop,isiPad:ae.isiPad,isiPhone:ae.isiPhone,isPhone:ae.isPhone,isTablet:ae.isTablet,isTouch:ae.isTouch,isWebView:ae.isWebView}},de=/^\s*|\s*$/g,me=function(t){return null==t?"":(""+t).replace(de,"")},ge=function(t,e){return e?!("array"!==e||!xt(t))||typeof t===e:void 0!==t},he=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),Ct(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;he(t,e,n,r)})))},pe={trim:me,isArray:xt,is:ge,toArray:function(t){if(xt(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},makeMap:function(t,e,n){var r;for(e=e||",","string"==typeof(t=t||[])&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:Ct,map:St,grep:kt,inArray:Ot,hasOwn:yt,extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(yt(o,i)){var u=o[i];void 0!==u&&(t[i]=u)}}return t},create:function(t,e,n){var r,o,i,u=0,a=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],c=this.createNS(t[3].replace(/\.\w+$/,""),n);if(!c[a]){if("static"===t[2])return c[a]=e,void(this.onCreate&&this.onCreate(t[2],t[3],c[a]));e[a]||(e[a]=function(){},u=1),c[a]=e[a],this.extend(c[a].prototype,e),t[5]&&(r=this.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=c[a],c[a]=u?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},c[a].prototype[a]=c[a],this.each(r,(function(t,e){c[a].prototype[e]=r[e]})),this.each(e,(function(t,e){r[e]?c[a].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==a&&(c[a].prototype[e]=t)}))),this.each(e.static,(function(t,e){c[a][e]=t}))}},walk:he,createNS:function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)e[r=t[n]]||(e[r]={}),e=e[r];return e},resolve:function(t,e){var n,r;for(e=e||window,n=0,r=(t=t.split(".")).length;n<r&&(e=e[t[n]]);n++);return e},explode:function(t,e){return!t||ge(t,"array")?t:St(t.split(e||","),me)},_addCacheSuffix:function(t){var e=fe.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},ve=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},be={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return ve(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return ve(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return ve(n)},fromDom:ve,fromPoint:function(t,e,n){return P.from(t.dom.elementFromPoint(e,n)).map(ve)}},ye=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},we=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},xe=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Ce=function(t,e){return t.dom===e.dom},Se=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},ke=function(t,e){return ne().browser.isIE()?Se(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)};"undefined"!=typeof window?window:Function("return this;")();var Oe=function(t){return t.dom.nodeName.toLowerCase()},Te=function(t){return t.dom.nodeType},_e=function(t){return function(e){return Te(e)===t}},Ee=_e(1),Ae=_e(3),De=_e(9),Me=_e(11),Ne=function(t){return be.fromDom(t.dom.ownerDocument)},Re=function(t){return De(t)?t:Ne(t)},ze=function(t){return be.fromDom(Re(t).dom.defaultView)},Be=function(t){return P.from(t.dom.parentNode).map(be.fromDom)},Ie=function(t){return P.from(t.dom.previousSibling).map(be.fromDom)},Pe=function(t){return P.from(t.dom.nextSibling).map(be.fromDom)},Le=function(t){return nt(ye(t,Ie))},He=function(t){return ye(t,Pe)},Fe=function(t){return W(t.dom.childNodes,be.fromDom)},Ve=function(t,e){var n=t.dom.childNodes;return P.from(n[e]).map(be.fromDom)},je=function(t){return Ve(t,0)},Ue=function(t){return Ve(t,t.dom.childNodes.length-1)},We=function(t){return t.dom.childNodes.length},qe=function(t){return Me(t)&&y(t.dom.host)},Ge=w(Element.prototype.attachShadow)&&w(Node.prototype.getRootNode),$e=O(Ge),Xe=Ge?function(t){return be.fromDom(t.dom.getRootNode())}:Re,Ke=function(t){return qe(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return be.fromDom(e)}(Re(t))},Ye=function(t){return be.fromDom(t.dom.host)},Je=function(t){return y(t.dom.shadowRoot)},Qe=function(t,e){Be(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Ze=function(t,e){Pe(t).fold((function(){Be(t).each((function(t){en(t,e)}))}),(function(t){Qe(t,e)}))},tn=function(t,e){je(t).fold((function(){en(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},en=function(t,e){t.dom.appendChild(e.dom)},nn=function(t,e){q(e,(function(e){en(t,e)}))},rn=function(t){t.dom.textContent="",q(Fe(t),(function(t){on(t)}))},on=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},un=function(t){var e,n=Fe(t);n.length>0&&(e=t,q(n,(function(t){Qe(e,t)}))),on(t)},an=function(t){var e=Ae(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return function(t){var e=Xe(t);return qe(e)?P.some(e):P.none()}(be.fromDom(e)).fold((function(){return n.body.contains(e)}),k(an,Ye))},cn=function(t,e){return{left:t,top:e,translate:function(n,r){return cn(t+n,e+r)}}},sn=cn,ln=function(t,e){return void 0!==t?t:void 0!==e?e:0},fn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?sn(n.offsetLeft,n.offsetTop):an(t)?function(t){var e=t.getBoundingClientRect();return sn(e.left,e.top)}(e):sn(0,0)},dn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return sn(n,r)},mn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},gn=function(t,e){ne().browser.isSafari()&&w(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},hn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},pn=function(t){var e=void 0===t?window:t,n=e.document,r=dn(be.fromDom(n));return function(t){var e=void 0===t?window:t;return P.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return hn(r.left,r.top,n,o)}),(function(t){return hn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},vn=function(t){return function(e){return!!e&&e.nodeType===t}},bn=function(t){return!!t&&!Object.getPrototypeOf(t)},yn=vn(1),wn=function(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return j(e,n)}return!1}},xn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){if(yn(e))for(var r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},Cn=function(t){return function(e){return yn(e)&&e.hasAttribute(t)}},Sn=function(t){return yn(t)&&t.hasAttribute("data-mce-bogus")},kn=function(t){return yn(t)&&"TABLE"===t.tagName},On=function(t){return function(e){if(yn(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Tn=wn(["textarea","input"]),_n=vn(3),En=vn(8),An=vn(9),Dn=vn(11),Mn=wn(["br"]),Nn=wn(["img"]),Rn=On("true"),zn=On("false"),Bn=wn(["td","th"]),In=wn(["video","audio","object","embed"]),Pn=function(t,e,n){return void 0===n&&(n=_),t.exists((function(t){return n(t,e)}))},Ln=function(t,e,n){return t.isSome()&&e.isSome()?P.some(n(t.getOrDie(),e.getOrDie())):P.none()},Hn=function(t){return void 0!==t.style&&w(t.style.getPropertyValue)},Fn=function(t,e,n){if(!(d(n)||p(n)||x(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Vn=function(t,e,n){Fn(t.dom,e,n)},jn=function(t,e){var n=t.dom;ft(e,(function(t,e){Fn(n,e,t)}))},Un=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Wn=function(t,e){return P.from(Un(t,e))},qn=function(t,e){t.dom.removeAttribute(e)},Gn=function(t,e){var n=t.dom;ft(e,(function(t,e){!function(t,e,n){if(!d(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Hn(t)&&t.style.setProperty(e,n)}(n,e,t)}))},$n=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||an(t)?r:Xn(n,e)},Xn=function(t,e){return Hn(t)?t.style.getPropertyValue(e):""},Kn=function(t,e){var n=t.dom,r=Xn(n,e);return P.from(r).filter((function(t){return t.length>0}))},Yn=function(t){var e={},n=t.dom;if(Hn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},Jn=ne().browser,Qn=function(t){return Q(t,Ee)},Zn=function(t,e){return t.children&&j(t.children,e)},tr=function(t,e,n){var r=0,o=0,i=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===$n(be.fromDom(t),"position")){var u=e.getBoundingClientRect();return{x:r=u.left+(i.documentElement.scrollLeft||t.scrollLeft)-i.documentElement.clientLeft,y:o=u.top+(i.documentElement.scrollTop||t.scrollTop)-i.documentElement.clientTop}}for(var a=e;a&&a!==n&&a.nodeType&&!Zn(a,n);){var c=a;r+=c.offsetLeft||0,o+=c.offsetTop||0,a=c.offsetParent}for(a=e.parentNode;a&&a!==n&&a.nodeType&&!Zn(a,n);)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;o+=function(t){return Jn.isFirefox()&&"table"===Oe(t)?Qn(Fe(t)).filter((function(t){return"caption"===Oe(t)})).bind((function(t){return Qn(He(t)).map((function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(be.fromDom(e))}return{x:r,y:o}},er={},nr={exports:er};!function(t,n,r,o){!function(o){if("object"==typeof n&&void 0!==r)r.exports=o();else if("function"==typeof t&&t.amd)t([],o);else{("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).EphoxContactWrapper=o()}}((function(){return function t(e,n,r){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof o&&o;if(!c&&s)return s(a,!0);if(u)return u(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[a]={exports:{}};e[a][0].call(f.exports,(function(t){return i(e[a][1][t]||t)}),f,f.exports,t,e,n,r)}return n[a].exports}for(var u="function"==typeof o&&o,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var e=l.length;e;){for(s=l,l=[];++d<e;)s&&s[d].run();d=-1,e=l.length}s=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||f||c(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(void 0,er,nr,void 0);var rr=nr.exports.boltExport,or=function(t){var e=P.none(),n=[],r=function(t){o()?u(t):n.push(t)},o=function(){return e.isSome()},i=function(t){q(t,u)},u=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=P.some(t),i(n),n=[])})),{get:r,map:function(t){return or((function(e){r((function(n){e(t(n))}))}))},isReady:o}},ir={nu:or,pure:function(t){return or((function(e){e(t)}))}},ur=function(t){setTimeout((function(){throw t}),0)},ar=function(t){var e=function(e){t().then(e,ur)};return{map:function(e){return ar((function(){return t().then(e)}))},bind:function(e){return ar((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return ar((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return ir.nu(e)},toCached:function(){var e=null;return ar((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},cr=function(t){return ar((function(){return new rr(t)}))},sr=function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):q(t,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))}))}))},lr=function(t){return{isValue:R,isError:N,getOr:O(t),getOrThunk:O(t),getOrDie:O(t),or:function(e){return lr(t)},orThunk:function(e){return lr(t)},fold:function(e,n){return n(t)},map:function(e){return lr(e(t))},mapError:function(e){return lr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return P.some(t)}}},fr=function(t){return{isValue:N,isError:R,getOr:T,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:T,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return fr(t)},mapError:function(e){return fr(e(t))},each:C,bind:function(e){return fr(t)},exists:N,forall:R,toOptional:P.none}},dr={value:lr,error:fr,fromOption:function(t,e){return t.fold((function(){return fr(e)}),lr)}},mr=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 e=[],n={};return q(t,(function(r,o){var i=st(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!g(a))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+i);var c=function(t){var r=st(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!et(e,(function(t){return j(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:c,log:function(t){console.log(t,{constructors:e,constructor:u,params:n})}}}})),n};mr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var gr=function(t){return t.fold(T,T)};function hr(t,e,n,r,o){return t(n,r)?P.some(n):w(o)&&o(n)?P.none():e(n,r,o)}var pr,vr,br,yr,wr,xr,Cr,Sr,kr,Or,Tr,_r,Er,Ar,Dr,Mr,Nr,Rr,zr,Br,Ir=function(t,e,n){for(var r=t.dom,o=w(n)?n:N;r.parentNode;){r=r.parentNode;var i=be.fromDom(r);if(e(i))return P.some(i);if(o(i))break}return P.none()},Pr=function(t,e,n){return hr((function(t,e){return e(t)}),Ir,t,e,n)},Lr=function(t,e){return Q(t.dom.childNodes,(function(t){return e(be.fromDom(t))})).map(be.fromDom)},Hr=function(t,e,n){return Ir(t,(function(t){return we(t,e)}),n)},Fr=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return xe(n)?P.none():P.from(n.querySelector(t)).map(be.fromDom)}(e,t)},Vr=function(t,e,n){return hr((function(t,e){return we(t,e)}),Hr,t,e,n)},jr=window.Promise?window.Promise:function(){var t=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];t.apply(e,n)}},e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(e,t(i,this),t(u,this))},r=n.immediateFn||"function"==typeof setImmediate&&setImmediate||function(t){return setTimeout(t,1)};function o(t){var e=this;null!==this._state?r((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function i(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void s(t(n,e),t(i,this),t(u,this))}this._state=!0,this._value=e,a.call(this)}catch(t){u.call(this,t)}}function u(t){this._state=!1,this._value=t,a.call(this)}function a(){for(var t=0,e=this._deferreds.length;t<e;t++)o.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}var s=function(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}};return n.prototype.catch=function(t){return this.then(null,t)},n.prototype.then=function(t,e){var r=this;return new n((function(n,i){o.call(r,new c(t,e,n,i))}))},n.all=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var o=Array.prototype.slice.call(1===t.length&&e(t[0])?t[0]:t);return new n((function(t,e){if(0===o.length)return t([]);for(var n=o.length,r=function(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){r(i,t)}),e)}o[i]=u,0==--n&&t(o)}catch(t){e(t)}},i=0;i<o.length;i++)r(i,o[i])}))},n.resolve=function(t){return t&&"object"==typeof t&&t.constructor===n?t:new n((function(e){e(t)}))},n.reject=function(t){return new n((function(e,n){n(t)}))},n.race=function(t){return new n((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},n}(),Ur=function(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)},Wr=function(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)},qr=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=Ur((function(){t.apply(this,r)}),e)};return r.stop=function(){clearTimeout(n)},r},Gr={requestAnimationFrame:function(t,e){pr?pr.then(t):pr=new jr((function(t){e||(e=document.body),function(t,e){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];n||(n=function(t){window.setTimeout(t,0)}),n(t,e)}(t,e)})).then(t)},setTimeout:Ur,setInterval:Wr,setEditorTimeout:function(t,e,n){return Ur((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=Wr((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:qr,throttle:qr,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}},$r=function(t,e){void 0===e&&(e={});var n=0,r={},o=be.fromDom(t),i=Re(o),u=e.maxLoadTime||5e3,a=function(a,c,s){var l,f=pe._addCacheSuffix(a),d=function(t){return bt(r,t).getOrThunk((function(){return{id:"mce-u"+n++,passed:[],failed:[],count:0}}))}(f);r[f]=d,d.count++;var m=function(t,e){for(var n=t.length;n--;)t[n]();d.status=e,d.passed=[],d.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},g=function(){return m(d.passed,2)},h=function(){return m(d.failed,3)},p=function(){var e;e=p,function(){for(var e=t.styleSheets,n=e.length;n--;){var r=e[n].ownerNode;if(r&&r.id===l.id)return g(),!0}return!1}()||(Date.now()-y<u?Gr.setTimeout(e):h())};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=be.fromTag("link",i.dom);jn(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();e.contentCssCors&&Vn(v,"crossOrigin","anonymous"),e.referrerPolicy&&Vn(v,"referrerpolicy",e.referrerPolicy),(l=v.dom).onload=p,l.onerror=h,b=v,en(Ke(o),b),Vn(v,"href",f)}else h();else g()},c=function(t){return cr((function(e){a(t,S(e,O(dr.value(t))),S(e,O(dr.error(t))))}))},s=function(t){var e=pe._addCacheSuffix(t);bt(r,e).each((function(t){var n,i;0===--t.count&&(delete r[e],n=t.id,i=Ke(o),Fr(i,"#"+n).each(on))}))};return{load:a,loadAll:function(t,e,n){var r;(r=W(t,c),sr(r,cr)).get((function(t){var r=$(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(gr)):e(r.pass.map(gr))}))},unload:s,unloadAll:function(t){q(t,(function(t){s(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}},Xr=function(){var t=new WeakMap;return{forElement:function(e,n){var r=Xe(e).dom;return P.from(t.get(r)).getOrThunk((function(){var e=$r(r,n);return t.set(r,e),e}))}}}(),Kr=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,u;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(u=o[e];u;u=u[e])if(!u[e])return u;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),Yr=function(t){var e;return function(n){return e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,R),yt(e,Oe(n))}},Jr=Yr(["h1","h2","h3","h4","h5","h6"]),Qr=Yr(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),Zr=function(t){return Ee(t)&&!Qr(t)},to=function(t){return Ee(t)&&"br"===Oe(t)},eo=Yr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),no=Yr(["ul","ol","dl"]),ro=Yr(["li","dd","dt"]),oo=Yr(["thead","tbody","tfoot"]),io=Yr(["td","th"]),uo=Yr(["pre","script","textarea","style"]),ao="\ufeff",co=function(t){return"\ufeff"===t},so=function(t){return t.replace(/\uFEFF/g,"")},lo=yn,fo=_n,mo=function(t){return fo(t)&&(t=t.parentNode),lo(t)&&t.hasAttribute("data-mce-caret")},go=function(t){return fo(t)&&co(t.data)},ho=function(t){return mo(t)||go(t)},po=function(t){return t.firstChild!==t.lastChild||!Mn(t.firstChild)},vo=function(t){var e=t.container();return!!_n(e)&&(e.data.charAt(t.offset())===ao||t.isAtStart()&&go(e.previousSibling))},bo=function(t){var e=t.container();return!!_n(e)&&(e.data.charAt(t.offset()-1)===ao||t.isAtEnd()&&go(e.nextSibling))},yo=function(t,e,n){var r,o=e.ownerDocument.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o},wo=function(t){return fo(t)&&t.data[0]===ao},xo=function(t){return fo(t)&&t.data[t.data.length-1]===ao},Co=function(t){return t&&t.hasAttribute("data-mce-caret")?(e=t.getElementsByTagName("br"),n=e[e.length-1],Sn(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},So=function(t){return mo(t.startContainer)},ko=Rn,Oo=zn,To=Mn,_o=_n,Eo=wn(["script","style","textarea"]),Ao=wn(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Do=wn(["table"]),Mo=ho,No=function(t){return!Mo(t)&&(_o(t)?!Eo(t.parentNode):Ao(t)||To(t)||Do(t)||Ro(t))},Ro=function(t){return!1===function(t){return yn(t)&&"true"===t.getAttribute("unselectable")}(t)&&Oo(t)},zo=function(t,e){return No(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(Ro(t))return!1;if(ko(t))return!0}return!0}(t,e)},Bo=/^[ \t\r\n]*$/,Io=function(t){return Bo.test(t)},Po=function(t,e){var n,r,o,i=be.fromDom(e),u=be.fromDom(t);return n=u,r="pre,code",o=E(Ce,i),Hr(n,r,o).isSome()},Lo=function(t,e){return No(t)&&!1===function(t,e){return _n(t)&&Io(t.data)&&!1===Po(t,e)}(t,e)||function(t){return yn(t)&&"A"===t.nodeName&&!t.hasAttribute("href")&&(t.hasAttribute("name")||t.hasAttribute("id"))}(t)||Ho(t)},Ho=Cn("data-mce-bookmark"),Fo=Cn("data-mce-bogus"),Vo=(vr="data-mce-bogus",br="all",function(t){return yn(t)&&t.getAttribute(vr)===br}),jo=function(t,e){return void 0===e&&(e=!0),function(t,e){var n=0;if(Lo(t,t))return!1;var r=t.firstChild;if(!r)return!0;var o=new Kr(r,t);do{if(e){if(Vo(r)){r=o.next(!0);continue}if(Fo(r)){r=o.next();continue}}if(Mn(r))n++,r=o.next();else{if(Lo(r,t))return!1;r=o.next()}}while(r);return n<=1}(t.dom,e)},Uo=function(t,e){return y(t)&&(Lo(t,e)||Zr(be.fromDom(t)))},Wo=function(t){return function(t){return"span"===t.nodeName.toLowerCase()}(t)&&"bookmark"===t.getAttribute("data-mce-type")},qo=function(t,e){return _n(t)&&t.data.length>0&&function(t,e){var n=new Kr(t,e).prev(!1),r=new Kr(t,e).next(!1),o=v(n)||Uo(n,e),i=v(r)||Uo(r,e);return o&&i}(t,e)},Go=function(t,e,n){var r=n||e;if(yn(e)&&Wo(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)Go(t,o[i],r);if(yn(e)){var u=e.childNodes;1===u.length&&Wo(u[0])&&e.parentNode.insertBefore(u[0],e)}return function(t){return Dn(t)||An(t)}(e)||Lo(e,r)||function(t){return!!yn(t)&&t.childNodes.length>0}(e)||qo(e,r)||t.remove(e),e},$o=pe.makeMap,Xo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ko=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Yo=/[<>&\"\']/g,Jo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Qo={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},Zo={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},ti={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},ei=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),Zo[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},ni=ei("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),ri=function(t,e){return t.replace(e?Xo:Ko,(function(t){return Zo[t]||t}))},oi=function(t,e){return t.replace(e?Xo:Ko,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":Zo[t]||"&#"+t.charCodeAt(0)+";"}))},ii=function(t,e,n){return n=n||ni,t.replace(e?Xo:Ko,(function(t){return Zo[t]||n[t]||t}))},ui={encodeRaw:ri,encodeAllRaw:function(t){return(""+t).replace(Yo,(function(t){return Zo[t]||t}))},encodeNumeric:oi,encodeNamed:ii,getEncodeFunc:function(t,e){var n=ei(e)||ni,r=$o(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?Xo:Ko,(function(t){return void 0!==Zo[t]?Zo[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return ii(t,e,n)}:ii:r.numeric?oi:ri},decode:function(t){return t.replace(Jo,(function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):Qo[e]||String.fromCharCode(e):ti[t]||ni[t]||function(t){var e=be.fromTag("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},ai={},ci={},si=pe.makeMap,li=pe.each,fi=pe.extend,di=pe.explode,mi=pe.inArray,gi=function(t,e){return(t=pe.trim(t))?t.split(e||" "):[]},hi=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),li(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?si(t,/[, ]/):di(t,/[, ]/)}))),n},pi=function(t){var e={},n={},r=[],o={},i={},u=function(e,n,r){var o=t[e];return o?o=si(o,/[, ]/,si(o.toUpperCase(),/[, ]/)):(o=ai[e])||(o=si(n," ",si(n.toUpperCase()," ")),o=fi(o,r),ai[e]=o),o},a=function(t){var e,n,r,o,i,u,a={},c=function(t,n,r){var o,i,u,c=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};n=n||"","string"==typeof(r=r||[])&&(r=gi(r));var s=gi(t);for(o=s.length;o--;)u={attributes:c(i=gi([e,n].join(" "))),attributesOrder:i,children:c(r,ci)},a[s[o]]=u},s=function(t,e){var n,r,o,i,u=gi(t);n=u.length;for(var c=gi(e);n--;)for(r=a[u[n]],o=0,i=c.length;o<i;o++)r.attributes[c[o]]={},r.attributesOrder.push(c[o])};return ai[t]?ai[t]:(e="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",r=[r,u="acronym applet basefont big font strike tt"].join(" "),li(gi(u),(function(t){c(t,"",r)})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),li(gi(i),(function(t){c(t,"",o)}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",r),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==t&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==t&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),li(gi("a form meter progress dfn"),(function(t){a[t]&&delete a[t].children[t]})),delete a.caption.children.table,delete a.script,ai[t]=a,a)}((t=t||{}).schema);!1===t.verify_html&&(t.valid_elements="*[*]");var c=hi(t.valid_styles),s=hi(t.invalid_styles,"map"),l=hi(t.valid_classes,"map"),f=u("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=u("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=u("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=u("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),h=u("non_empty_elements","td th iframe video audio object script code pre",m),p=u("move_caret_before_on_enter_elements","td th iframe video audio object script code table",m),v=u("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),b=u("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",v),y=u("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");li((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")}));var w=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},x=function(t){var n,o,i,u,a,c,s,l,f,d,m,g,h,p,v,b,y,x,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t){var O=gi(t,",");for(e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=O.length;n<o;n++)if(a=C.exec(O[n])){if(p=a[1],f=a[2],v=a[3],l=a[5],c={attributes:g={},attributesOrder:h=[]},"#"===p&&(c.paddEmpty=!0),"-"===p&&(c.removeEmpty=!0),"!"===a[4]&&(c.removeEmptyAttrs=!0),b&&(ft(b,(function(t,e){g[e]=t})),h.push.apply(h,y)),l)for(i=0,u=(l=gi(l,"|")).length;i<u;i++)if(a=S.exec(l[i])){if(s={},m=a[1],d=a[2].replace(/[\\:]:/g,":"),p=a[3],x=a[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],h.splice(mi(h,d),1);continue}p&&("="===p&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:x}),s.defaultValue=x),":"===p&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:x}),s.forcedValue=x),"<"===p&&(s.validValues=si(x,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=w(d),c.attributePatterns.push(s)):(g[d]||h.push(d),g[d]=s)}b||"@"!==f||(b=g,y=h),v&&(c.outputName=f,e[v]=c),k.test(f)?(c.pattern=w(f),r.push(c)):e[f]=c}}},C=function(t){e={},r=[],x(t),li(a,(function(t,e){n[e]=t.children}))},S=function(t){var r=/^(~)?(.+)$/;t&&(ai.text_block_elements=ai.block_elements=null,li(gi(t,","),(function(t){var i=r.exec(t),u="~"===i[1],a=u?"span":"div",c=i[2];if(n[c]=n[a],o[c]=a,u||(b[c.toUpperCase()]={},b[c]={}),!e[c]){var s=e[a];delete(s=fi({},s)).removeEmptyAttrs,delete s.removeEmpty,e[c]=s}li(n,(function(t,e){t[a]&&(n[e]=t=fi({},n[e]),t[c]=t[a])}))})))},k=function(e){var r=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;ai[t.schema]=null,e&&li(gi(e,","),(function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],li(gi(i[3],"|"),(function(t){"-"===o?delete e[t]:e[t]={}})))}))},T=function(t){var n,o=e[t];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(t))return o};t.valid_elements?C(t.valid_elements):(li(a,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&li(gi("strong/b em/i"),(function(t){var n=gi(t,"/");e[n[1]].outputName=n[0]})),li(gi("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),li(gi("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),li(gi("span"),(function(t){e[t].removeEmptyAttrs=!0}))),S(t.custom_elements),k(t.valid_children),x(t.extended_valid_elements),k("+ol[ul|ol],+ul[ul|ol]"),li({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(function(t,n){e[n]&&(e[n].parentsRequired=gi(t))})),t.invalid_elements&&li(di(t.invalid_elements),(function(t){e[t]&&delete e[t]})),T("span")||x("span[!data-mce-type|*]");var _=O(c),E=O(s),A=O(l),D=O(g),M=O(b),N=O(v),R=O(y),z=O(m),B=O(d),I=O(h),P=O(p),L=O(f),H=O(i),F=O(o);return{children:n,elements:e,getValidStyles:_,getValidClasses:A,getBlockElements:M,getInvalidStyles:E,getShortEndedElements:z,getTextBlockElements:N,getTextInlineElements:R,getBoolAttrs:D,getElementRule:T,getSelfClosingElements:B,getNonEmptyElements:I,getMoveCaretBeforeOnEnterElements:P,getWhiteSpaceElements:L,getSpecialElements:H,isValidChild:function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},isValid:function(t,e){var n,r,o=T(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:F,addValidElements:x,setValidElements:C,addCustomElements:S,addValidChildren:k}},vi=function(t,e,n,r){var o=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},bi=function(t,e){var n,r,o,i=this,u=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,a=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,c=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,l={};t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var f="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<f.length;n++)l[f[n]]="\ufeff"+n,l["\ufeff"+n]=f[n];return{toHex:function(t){return t.replace(u,vi)},parse:function(e){var r,o,f,d,m,g,h,p,v={},b=t.url_converter,y=t.url_converter_scope||i,w=function(t,e,r){var o=v[t+"-top"+e];if(o){var i=v[t+"-right"+e];if(i){var u=v[t+"-bottom"+e];if(u){var a=v[t+"-left"+e];if(a){var c=[o,i,u,a];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(v[t+e]=-1===n?c[0]:c.join(" "),delete v[t+"-top"+e],delete v[t+"-right"+e],delete v[t+"-bottom"+e],delete v[t+"-left"+e])}}}}},x=function(t){var e,n=v[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return v[t]=n[0],!0}},C=function(t){return d=!0,l[t]},S=function(t,e){return d&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return l[t]}))),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},k=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},O=function(t){return t.replace(/\\[0-9a-f]+/gi,k)},T=function(e,n,r,o,i,u){if(i=i||u)return"'"+(i=S(i)).replace(/\'/g,"\\'")+"'";if(n=S(n||r||o),!t.allow_script_urls){var a=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return b&&(n=b.call(y,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,C).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,C)}));r=c.exec(e);)if(c.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),f=r[2].replace(s,""),o&&f){if(o=O(o),f=O(f),-1!==o.indexOf("\ufeff")||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(f)))continue;"font-weight"===o&&"700"===f?f="bold":"color"!==o&&"background-color"!==o||(f=f.toLowerCase()),f=(f=f.replace(u,vi)).replace(a,T),v[o]=d?S(f,!0):f}w("border","",!0),w("border","-width"),w("border","-color"),w("border","-style"),w("padding",""),w("margin",""),m="border",h="border-style",p="border-color",x(g="border-width")&&x(h)&&x(p)&&(v[m]=v[g]+" "+v[h]+" "+v[p],delete v[g],delete v[h],delete v[p]),"medium none"===v.border&&delete v.border,"none"===v["border-image"]&&delete v["border-image"]}return v},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var u=0,a=i.length;u<a;u++)e=i[u],(o=t[e])&&(n+=(n.length>0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):ft(t,(function(t,r){!t||o&&!function(t,e){var n=o["*"];return(!n||!n[t])&&!((n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")})),n}}},yi={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},wi=function(t){return t instanceof Event||w(t.initEvent)},xi=function(t,e,n,r){var o,i=function(t,e){var n=null!=e?e:{};for(var r in t)yt(yi,r)||(n[r]=t[r]);return y(n.composedPath)&&(n.composedPath=function(){return t.composedPath()}),n}(e,r);return i.type=t,b(i.target)&&(i.target=null!==(o=i.srcElement)&&void 0!==o?o:n),function(t){return b(t.preventDefault)||wi(t)}(e)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=R,w(e.preventDefault)?e.preventDefault():wi(e)&&(e.returnValue=!1)},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=R,w(e.stopPropagation)?e.stopPropagation():wi(e)&&(e.cancelBubble=!0)},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=R,i.stopPropagation()},function(t){return t.isDefaultPrevented===R||t.isDefaultPrevented===N}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?R:N,i.isPropagationStopped=!0===i.cancelBubble?R:N,i.isImmediatePropagationStopped=N)),i},Ci=/^(?:mouse|contextmenu)|click/,Si=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},ki=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},Oi=function(t,e){var n=xi(t.type,t,document,e);if(function(t){return y(t)&&Ci.test(t.type)}(t)&&v(t.pageX)&&!v(t.clientX)){var r=n.target.ownerDocument||document,o=r.documentElement,i=r.body,u=n;u.pageX=t.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),u.pageY=t.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)}return v(n.metaKey)&&(n.metaKey=!1),n},Ti=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function(){ki(t,"DOMContentLoaded",i),ki(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():Si(t,"DOMContentLoaded",i),n.domLoaded||Si(t,"load",i)}},_i=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}return t.prototype.bind=function(t,e,n,r){var o,i,u,a,c,s,l,f=this,d=window,m=function(t){f.executeHandlers(Oi(t||d.event),o)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?o=t[f.expando]:(o=f.count++,t[f.expando]=o,f.events[o]={}),r=r||t;var g=e.split(" ");for(u=g.length;u--;)s=m,c=l=!1,"DOMContentLoaded"===(a=g[u])&&(a="ready"),f.domLoaded&&"ready"===a&&"complete"===t.readyState?n.call(r,Oi({type:a})):(f.hasMouseEnterLeave||(c=f.mouseEnterLeave[a])&&(s=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=Oi(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,o))}),f.hasFocusIn||"focusin"!==a&&"focusout"!==a||(l=!0,c="focusin"===a?"focus":"blur",s=function(t){(t=Oi(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][a])?"ready"===a&&f.domLoaded?n(Oi({type:a})):i.push({func:n,scope:r}):(f.events[o][a]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=l,i.nativeHandler=s,"ready"===a?Ti(t,s,f):Si(t,c||a,s,l)));return t=i=null,n}},t.prototype.unbind=function(t,e,n){var r,o,i,u,a;if(!t||3===t.nodeType||8===t.nodeType)return this;var c=t[this.expando];if(c){if(a=this.events[c],e){var s=e.split(" ");for(o=s.length;o--;)if(r=a[u=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=l,r.fakeName=f,r.capture=d,a[u]=r}n&&0!==r.length||(delete a[u],ki(t,r.fakeName||u,r.nativeHandler,r.capture))}}else ft(a,(function(e,n){ki(t,e.fakeName||n,e.nativeHandler,e.capture)})),a={};for(u in a)if(yt(a,u))return this;delete this.events[c];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=Oi({type:e,target:t},n);do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var u=r[o];if(u&&!1===u.func.call(u.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),Ei="sizzle"+-new Date,Ai=window.document,Di=0,Mi=0,Ni=su(),Ri=su(),zi=su(),Bi=function(t,e){return t===e&&(Er=!0),0},Ii={}.hasOwnProperty,Pi=[],Li=Pi.pop,Hi=Pi.push,Fi=Pi.push,Vi=Pi.slice,ji=Pi.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},Ui="[\\x20\\t\\r\\n\\f]",Wi="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",qi="\\["+Ui+"*("+Wi+")(?:"+Ui+"*([*^$|!~]?=)"+Ui+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Wi+"))|)"+Ui+"*\\]",Gi=":("+Wi+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+qi+")*)|.*)\\)|)",$i=new RegExp("^"+Ui+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Ui+"+$","g"),Xi=new RegExp("^"+Ui+"*,"+Ui+"*"),Ki=new RegExp("^"+Ui+"*([>+~]|"+Ui+")"+Ui+"*"),Yi=new RegExp("="+Ui+"*([^\\]'\"]*?)"+Ui+"*\\]","g"),Ji=new RegExp(Gi),Qi=new RegExp("^"+Wi+"$"),Zi={ID:new RegExp("^#("+Wi+")"),CLASS:new RegExp("^\\.("+Wi+")"),TAG:new RegExp("^("+Wi+"|[*])"),ATTR:new RegExp("^"+qi),PSEUDO:new RegExp("^"+Gi),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Ui+"*(even|odd|(([+-]|)(\\d*)n|)"+Ui+"*(?:([+-]|)"+Ui+"*(\\d+)|))"+Ui+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+Ui+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Ui+"*((?:-\\d)?\\d*)"+Ui+"*\\)|)(?=[^-]|$)","i")},tu=/^(?:input|select|textarea|button)$/i,eu=/^h\d$/i,nu=/^[^{]+\{\s*\[native \w/,ru=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ou=/[+~]/,iu=/'|\\/g,uu=new RegExp("\\\\([\\da-f]{1,6}"+Ui+"?|("+Ui+")|.)","ig"),au=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Fi.apply(Pi=Vi.call(Ai.childNodes),Ai.childNodes),Pi[Ai.childNodes.length].nodeType}catch(t){Fi={apply:Pi.length?function(t,e){Hi.apply(t,Vi.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var cu=function(t,e,n,r){var o,i,u,a,c,s,l,f,d,m;if((e?e.ownerDocument||e:Ai)!==Dr&&Ar(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(a=(e=e||Dr).nodeType)&&9!==a)return[];if(Nr&&!r){if(o=ru.exec(t))if(u=o[1]){if(9===a){if(!(i=e.getElementById(u))||!i.parentNode)return n;if(i.id===u)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(u))&&Br(e,i)&&i.id===u)return n.push(i),n}else{if(o[2])return Fi.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&yr.getElementsByClassName)return Fi.apply(n,e.getElementsByClassName(u)),n}if(yr.qsa&&(!Rr||!Rr.test(t))){if(f=l=Ei,d=e,m=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(s=Sr(t),(l=e.getAttribute("id"))?f=l.replace(iu,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+hu(s[c]);d=ou.test(t)&&mu(e.parentNode)||e,m=s.join(",")}if(m)try{return Fi.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return Or(t.replace($i,"$1"),e,n,r)};function su(){var t=[];return function e(n,r){return t.push(n+" ")>wr.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function lu(t){return t[Ei]=!0,t}function fu(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||1<<31)-(~t.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function du(t){return lu((function(e){return e=+e,lu((function(n,r){for(var o,i=t([],n.length,e),u=i.length;u--;)n[o=i[u]]&&(n[o]=!(r[o]=n[o]))}))}))}function mu(t){return t&&void 0!==t.getElementsByTagName&&t}function gu(){}function hu(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function pu(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Mi++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,u){var a,c,s=[Di,i];if(u){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,u))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((a=(c=e[Ei]||(e[Ei]={}))[r])&&a[0]===Di&&a[1]===i)return s[2]=a[2];if(c[r]=s,s[2]=t(e,n,u))return!0}}}function vu(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function bu(t,e,n,r,o){for(var i,u=[],a=0,c=t.length,s=null!=e;a<c;a++)(i=t[a])&&(n&&!n(i,r,o)||(u.push(i),s&&e.push(a)));return u}function yu(t,e,n,r,o,i){return r&&!r[Ei]&&(r=yu(r)),o&&!o[Ei]&&(o=yu(o,i)),lu((function(i,u,a,c){var s,l,f,d=[],m=[],g=u.length,h=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)cu(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),p=!t||!i&&e?h:bu(h,d,t,a,c),v=n?o||(i?t:g||r)?[]:u:p;if(n&&n(p,v,a,c),r)for(s=bu(v,m),r(s,[],a,c),l=s.length;l--;)(f=s[l])&&(v[m[l]]=!(p[m[l]]=f));if(i){if(o||t){if(o){for(s=[],l=v.length;l--;)(f=v[l])&&s.push(p[l]=f);o(null,v=[],s,c)}for(l=v.length;l--;)(f=v[l])&&(s=o?ji.call(i,f):d[l])>-1&&(i[s]=!(u[s]=f))}}else v=bu(v===u?v.splice(g,v.length):v),o?o(null,u,v,c):Fi.apply(u,v)}))}function wu(t){for(var e,n,r,o=t.length,i=wr.relative[t[0].type],u=i||wr.relative[" "],a=i?1:0,c=pu((function(t){return t===e}),u,!0),s=pu((function(t){return ji.call(e,t)>-1}),u,!0),l=[function(t,n,r){var o=!i&&(r||n!==Tr)||((e=n).nodeType?c(t,n,r):s(t,n,r));return e=null,o}];a<o;a++)if(n=wr.relative[t[a].type])l=[pu(vu(l),n)];else{if((n=wr.filter[t[a].type].apply(null,t[a].matches))[Ei]){for(r=++a;r<o&&!wr.relative[t[r].type];r++);return yu(a>1&&vu(l),a>1&&hu(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace($i,"$1"),n,a<r&&wu(t.slice(a,r)),r<o&&wu(t=t.slice(r)),r<o&&hu(t))}l.push(n)}return vu(l)}yr=cu.support={},Cr=cu.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},Ar=cu.setDocument=function(t){var e,n=t?t.ownerDocument||t:Ai,r=n.defaultView;return n!==Dr&&9===n.nodeType&&n.documentElement?(Dr=n,Mr=n.documentElement,Nr=!Cr(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){Ar()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){Ar()}))),yr.attributes=!0,yr.getElementsByTagName=!0,yr.getElementsByClassName=nu.test(n.getElementsByClassName),yr.getById=!0,wr.find.ID=function(t,e){if(void 0!==e.getElementById&&Nr){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},wr.filter.ID=function(t){var e=t.replace(uu,au);return function(t){return t.getAttribute("id")===e}},wr.find.TAG=yr.getElementsByTagName?function(t,e){if(void 0!==e.getElementsByTagName)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},wr.find.CLASS=yr.getElementsByClassName&&function(t,e){if(Nr)return e.getElementsByClassName(t)},zr=[],Rr=[],yr.disconnectedMatch=!0,Rr=Rr.length&&new RegExp(Rr.join("|")),zr=zr.length&&new RegExp(zr.join("|")),e=nu.test(Mr.compareDocumentPosition),Br=e||nu.test(Mr.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Bi=e?function(t,e){if(t===e)return Er=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!yr.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===Ai&&Br(Ai,t)?-1:e===n||e.ownerDocument===Ai&&Br(Ai,e)?1:_r?ji.call(_r,t)-ji.call(_r,e):0:4&r?-1:1)}:function(t,e){if(t===e)return Er=!0,0;var r,o=0,i=t.parentNode,u=e.parentNode,a=[t],c=[e];if(!i||!u)return t===n?-1:e===n?1:i?-1:u?1:_r?ji.call(_r,t)-ji.call(_r,e):0;if(i===u)return fu(t,e);for(r=t;r=r.parentNode;)a.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;a[o]===c[o];)o++;return o?fu(a[o],c[o]):a[o]===Ai?-1:c[o]===Ai?1:0},n):Dr},cu.matches=function(t,e){return cu(t,null,null,e)},cu.matchesSelector=function(t,e){if((t.ownerDocument||t)!==Dr&&Ar(t),e=e.replace(Yi,"='$1']"),yr.matchesSelector&&Nr&&(!zr||!zr.test(e))&&(!Rr||!Rr.test(e)))try{var n=(void 0).call(t,e);if(n||yr.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return cu(e,Dr,null,[t]).length>0},cu.contains=function(t,e){return(t.ownerDocument||t)!==Dr&&Ar(t),Br(t,e)},cu.attr=function(t,e){(t.ownerDocument||t)!==Dr&&Ar(t);var n=wr.attrHandle[e.toLowerCase()],r=n&&Ii.call(wr.attrHandle,e.toLowerCase())?n(t,e,!Nr):void 0;return void 0!==r?r:yr.attributes||!Nr?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},cu.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},cu.uniqueSort=function(t){var e,n=[],r=0,o=0;if(Er=!yr.detectDuplicates,_r=!yr.sortStable&&t.slice(0),t.sort(Bi),Er){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return _r=null,t},xr=cu.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=xr(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=xr(e);return n},(wr=cu.selectors={cacheLength:50,createPseudo:lu,match:Zi,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(uu,au),t[3]=(t[3]||t[4]||t[5]||"").replace(uu,au),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||cu.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&cu.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Zi.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&Ji.test(n)&&(e=Sr(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(uu,au).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Ni[t+" "];return e||(e=new RegExp("(^|"+Ui+")"+t+"("+Ui+"|$)"))&&Ni(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=cu.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),u="last"!==t.slice(-4),a="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,l,f,d,m,g,h=i!==u?"nextSibling":"previousSibling",p=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!c&&!a;if(p){if(i){for(;h;){for(f=e;f=f[h];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=h="only"===t&&!g&&"nextSibling"}return!0}if(g=[u?p.firstChild:p.lastChild],u&&b){for(m=(s=(l=p[Ei]||(p[Ei]={}))[t]||[])[0]===Di&&s[1],d=s[0]===Di&&s[2],f=m&&p.childNodes[m];f=++m&&f&&f[h]||(d=m=0)||g.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[Di,m,d];break}}else if(b&&(s=(e[Ei]||(e[Ei]={}))[t])&&s[0]===Di)d=s[1];else for(;(f=++m&&f&&f[h]||(d=m=0)||g.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[Ei]||(f[Ei]={}))[t]=[Di,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=wr.pseudos[t]||wr.setFilters[t.toLowerCase()]||cu.error("unsupported pseudo: "+t);return r[Ei]?r(e):r.length>1?(n=[t,t,"",e],wr.setFilters.hasOwnProperty(t.toLowerCase())?lu((function(t,n){for(var o,i=r(t,e),u=i.length;u--;)t[o=ji.call(t,i[u])]=!(n[o]=i[u])})):function(t){return r(t,0,n)}):r}},pseudos:{not:lu((function(t){var e=[],n=[],r=kr(t.replace($i,"$1"));return r[Ei]?lu((function(t,e,n,o){for(var i,u=r(t,null,o,[]),a=t.length;a--;)(i=u[a])&&(t[a]=!(e[a]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:lu((function(t){return function(e){return cu(t,e).length>0}})),contains:lu((function(t){return t=t.replace(uu,au),function(e){return(e.textContent||e.innerText||xr(e)).indexOf(t)>-1}})),lang:lu((function(t){return Qi.test(t||"")||cu.error("unsupported lang: "+t),t=t.replace(uu,au).toLowerCase(),function(e){var n;do{if(n=Nr?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===Mr},focus:function(t){return t===Dr.activeElement&&(!Dr.hasFocus||Dr.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!wr.pseudos.empty(t)},header:function(t){return eu.test(t.nodeName)},input:function(t){return tu.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:du((function(){return[0]})),last:du((function(t,e){return[e-1]})),eq:du((function(t,e,n){return[n<0?n+e:n]})),even:du((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:du((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:du((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:du((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=wr.pseudos.eq,q(["radio","checkbox","file","password","image"],(function(t){wr.pseudos[t]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(t)})),q(["submit","reset"],(function(t){wr.pseudos[t]=function(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}(t)})),gu.prototype=wr.filters=wr.pseudos,wr.setFilters=new gu,Sr=cu.tokenize=function(t,e){var n,r,o,i,u,a,c,s=Ri[t+" "];if(s)return e?0:s.slice(0);for(u=t,a=[],c=wr.preFilter;u;){for(i in n&&!(r=Xi.exec(u))||(r&&(u=u.slice(r[0].length)||u),a.push(o=[])),n=!1,(r=Ki.exec(u))&&(n=r.shift(),o.push({value:n,type:r[0].replace($i," ")}),u=u.slice(n.length)),wr.filter)wr.filter.hasOwnProperty(i)&&(!(r=Zi[i].exec(u))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),u=u.slice(n.length)));if(!n)break}return e?u.length:u?cu.error(t):Ri(t,a).slice(0)},kr=cu.compile=function(t,e){var n,r=[],o=[],i=zi[t+" "];if(!i){for(e||(e=Sr(t)),n=e.length;n--;)(i=wu(e[n]))[Ei]?r.push(i):o.push(i);(i=zi(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,u,a,c){var s,l,f,d=0,m="0",g=o&&[],h=[],p=Tr,v=o||r&&wr.find.TAG("*",c),b=Di+=null==p?1:Math.random()||.1,y=v.length;for(c&&(Tr=i!==Dr&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(l=0;f=t[l++];)if(f(s,i,u)){a.push(s);break}c&&(Di=b)}n&&((s=!f&&s)&&d--,o&&g.push(s))}if(d+=m,n&&m!==d){for(l=0;f=e[l++];)f(g,h,i,u);if(o){if(d>0)for(;m--;)g[m]||h[m]||(h[m]=Li.call(a));h=bu(h)}Fi.apply(a,h),c&&!o&&h.length>0&&d+e.length>1&&cu.uniqueSort(a)}return c&&(Di=b,Tr=p),g};return n?lu(o):o}(o,r))).selector=t}return i},Or=cu.select=function(t,e,n,r){var o,i,u,a,c,s="function"==typeof t&&t,l=!r&&Sr(t=s.selector||t);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(u=i[0]).type&&yr.getById&&9===e.nodeType&&Nr&&wr.relative[i[1].type]){if(!(e=(wr.find.ID(u.matches[0].replace(uu,au),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=Zi.needsContext.test(t)?0:i.length;o--&&(u=i[o],!wr.relative[a=u.type]);)if((c=wr.find[a])&&(r=c(u.matches[0].replace(uu,au),ou.test(i[0].type)&&mu(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&hu(i)))return Fi.apply(n,r),n;break}}return(s||kr(t,l))(r,e,!Nr,n,ou.test(t)&&mu(e.parentNode)||e),n},yr.sortStable=Ei.split("").sort(Bi).join("")===Ei,yr.detectDuplicates=!!Er,Ar(),yr.sortDetached=!0;var xu=document,Cu=Array.prototype.push,Su=Array.prototype.slice,ku=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Ou=_i.Event,Tu=pe.makeMap("children,contents,next,prev"),_u=function(t){return void 0!==t},Eu=function(t){return"string"==typeof t},Au=function(t,e){var n,r=(e=e||xu).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},Du=function(t,e,n,r){var o;if(Eu(e))e=Au(e,Wu(t[0]));else if(e.length&&!e.nodeType){if(e=Xu.makeArray(e),r)for(o=e.length-1;o>=0;o--)Du(t,e[o],n,r);else for(o=0;o<e.length;o++)Du(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},Mu=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Nu=function(t,e,n){var r,o;return e=Xu(e)[0],t.each((function(){n&&r===this.parentNode?o.appendChild(this):(r=this.parentNode,o=e.cloneNode(!1),this.parentNode.insertBefore(o,this),o.appendChild(this))})),t},Ru=pe.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),zu=pe.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Bu={for:"htmlFor",class:"className",readonly:"readOnly"},Iu={float:"cssFloat"},Pu={},Lu={},Hu=function(t,e){return new Xu.fn.init(t,e)},Fu=/^\s*|\s*$/g,Vu=function(t){return null==t?"":(""+t).replace(Fu,"")},ju=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},Uu=function(t,e){var n=[];return ju(t,(function(t,r){e(r,t)&&n.push(r)})),n},Wu=function(t){return t?9===t.nodeType?t:t.ownerDocument:xu};Hu.fn=Hu.prototype={constructor:Hu,selector:"",context:null,length:0,init:function(t,e){var n,r;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if(e&&e.nodeType)this.context=e;else{if(e)return Xu(t).attr(e);this.context=e=document}if(Eu(t)){if(this.selector=t,!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:ku.exec(t)))return Xu(e).find(t);if(n[1])for(r=Au(t,Wu(e)).firstChild;r;)Cu.call(this,r),r=r.nextSibling;else{if(!(r=Wu(e).getElementById(n[2])))return this;if(r.id!==n[2])return this.find(t);this.length=1,this[0]=r}}else this.add(t,!1);return this},toArray:function(){return pe.toArray(this)},add:function(t,e){var n,r;if(Eu(t))return this.add(Xu(t));if(!1!==e)for(n=Xu.unique(this.toArray().concat(Xu.makeArray(t))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Cu.apply(this,Xu.makeArray(t));return this},attr:function(t,e){var n,r=this;if("object"==typeof t)ju(t,(function(t,e){r.attr(t,e)}));else{if(!_u(e)){if(r[0]&&1===r[0].nodeType){if((n=Pu[t])&&n.get)return n.get(r[0],t);if(zu[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each((function(){var n;if(1===this.nodeType){if((n=Pu[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=Bu[t]||t))ju(t,(function(t,e){n.prop(t,e)}));else{if(!_u(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))},u=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))};if("object"==typeof t)ju(t,(function(t,e){o.css(t,e)}));else if(_u(e))t=i(t),"number"!=typeof e||Ru[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if((r=Lu[t])&&r.set)r.set(this,e);else{try{this.style[Iu[t]||t]=e}catch(t){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(u(t)):n.removeAttribute(t))}}));else{if(n=o[0],(r=Lu[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(u(t))}catch(t){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],Ou.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e;if(_u(t)){e=this.length;try{for(;e--;)this[e].innerHTML=t}catch(n){Xu(this[e]).empty().append(t)}return this}return this[0]?this[0].innerHTML:""},text:function(t){var e;if(_u(t)){for(e=this.length;e--;)"innerText"in this[e]?this[e].innerText=t:this[0].textContent=t;return this}return this[0]?this[0].innerText||this[0].textContent:""},append:function(){return Du(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return Du(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?Du(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?Du(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return Xu(t).append(this),this},prependTo:function(t){return Xu(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return Nu(this,t)},wrapAll:function(t){return Nu(this,t,!0)},wrapInner:function(t){return this.each((function(){Xu(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){Xu(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),Xu(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t?n:(-1!==t.indexOf(" ")?ju(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=Mu(r,t);if(o!==e){var i=r.className;o?r.className=Vu((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}})),n)},hasClass:function(t){return Mu(this[0],t)},each:function(t){return ju(this,t)},on:function(t,e){return this.each((function(){Ou.bind(this,t,e)}))},off:function(t,e){return this.each((function(){Ou.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?Ou.fire(this,t.type,t):Ou.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return Xu(Su.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)Xu.find(t,this[e],r);return Xu(r)},filter:function(t){return Xu("function"==typeof t?Uu(this.toArray(),(function(e,n){return t(n,e)})):Xu.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof Xu&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&Xu(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),Xu(e)},offset:function(t){var e,n,r,o,i=0,u=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,u=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:u})},push:Cu,sort:Array.prototype.sort,splice:Array.prototype.splice},pe.extend(Hu,{extend:pe.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:pe.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:pe.isArray,each:ju,trim:Vu,grep:Uu,find:cu,expr:cu.selectors,unique:cu.uniqueSort,text:cu.getText,contains:cu.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return e=1===e.length?Xu.find.matchesSelector(e[0],t)?[e[0]]:[]:Xu.find.matches(t,e)}});var qu=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof Xu&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&Xu(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},Gu=function(t,e,n,r){var o=[];for(r instanceof Xu&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&Xu(t).is(r))break}o.push(t)}return o},$u=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};ju({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return qu(t,"parentNode")},next:function(t){return $u(t,"nextSibling",1)},prev:function(t){return $u(t,"previousSibling",1)},children:function(t){return Gu(t.firstChild,"nextSibling",1)},contents:function(t){return pe.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){Hu.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(Xu.isArray(t)?r.push.apply(r,t):r.push(t))})),this.length>1&&(Tu[t]||(r=Xu.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=Xu(r);return n?o.filter(n):o}})),ju({parentsUntil:function(t,e){return qu(t,"parentNode",e)},nextUntil:function(t,e){return Gu(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return Gu(t,"previousSibling",1,e).slice(1)}},(function(t,e){Hu.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(Xu.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(o=Xu.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=Xu(o);return r?i.filter(r):i}})),Hu.fn.is=function(t){return!!t&&this.filter(t).length>0},Hu.fn.init.prototype=Hu.fn,Hu.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return Xu.extend(n,this),n},Hu.attrHooks=Pu,Hu.cssHooks=Lu;var Xu=Hu,Ku=pe.each,Yu=pe.grep,Ju=fe.ie,Qu=/^([a-z0-9],?)+$/i,Zu=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},ta=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o},ea=function(t,e){void 0===e&&(e={});var n={},r=window,o={},i=0,u=Xr.forElement(be.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),a=[],c=e.schema?e.schema:pi({}),s=bi({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),l=e.ownEvents?new _i:_i.Event,f=c.getBlockElements(),m=Xu.overrideDefaults((function(){return{context:t,element:U.getRoot()}})),g=function(e){return e&&t&&d(e)?t.getElementById(e):e},h=function(t){return m("string"==typeof t?g(t):t)},p=function(t,e,n){var r,o,i=h(t);return i.length&&(o=(r=W[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},v=function(t){var e=g(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o=h(t),i=o.attr(n);if(o.length){var u=W[n];u&&u.set?u.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},w=function(){return e.root_element||t.body},x=function(e,n){return tr(t.body,g(e),n)},S=function(t,e,n){var r=h(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=fe.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},k=function(t){var e,n;return t=g(t),e=S(t,"width"),n=S(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},T=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(Qu.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return cu(e,i[0].ownerDocument||i[0],null,i).length>0},_=function(t,e,n,r){var o,i=[],u=g(t);for(r=void 0===r,n=n||("BODY"!==w().nodeName?w().parentNode:null),pe.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return T(t,o)});u&&!(u===n||b(u.nodeType)||An(u)||Dn(u));){if(!e||"function"==typeof e&&e(u)){if(!r)return[u];i.push(u)}u=u.parentNode}return r?i:null},E=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return T(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},A=function(t,e,n){var r,o="string"==typeof t?g(t):t;if(!o)return!1;if(pe.isArray(o)&&(o.length||0===o.length))return r=[],Ku(o,(function(t,o){t&&r.push(e.call(n,"string"==typeof t?g(t):t,o))})),r;var i=n||this;return e.call(i,o)},D=function(t,e){h(t).each((function(t,n){Ku(e,(function(t,e){y(n,e,t)}))}))},M=function(t,e){var n=h(t);Ju?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){Xu("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},N=function(e,n,r,o,i){return A(e,(function(e){var u="string"==typeof n?t.createElement(n):n;return D(u,r),o&&("string"!=typeof o&&o.nodeType?u.appendChild(o):"string"==typeof o&&M(u,o)),i?u:e.appendChild(u)}))},R=function(e,n,r){return N(t.createElement(e),e,n,r,!0)},z=ui.encodeAllRaw,B=function(t,e){var n=h(t);return e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})).remove():n.remove(),n.length>1?n.toArray():n[0]},I=function(t,e,n){h(t).toggleClass(e,n).each((function(){""===this.className&&Xu(this).attr("class",null)}))},P=function(t,e,n){return A(e,(function(e){return pe.is(e,"array")&&(t=t.cloneNode(!0)),n&&Ku(Yu(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},L=function(t){if(yn(t)){var e="a"===t.nodeName.toLowerCase()&&!p(t,"href")&&p(t,"id");if(p(t,"name")||p(t,"data-mce-bookmark")||e)return!0}return!1},H=function(){return t.createRange()},F=function(n,o,i,u){if(pe.isArray(n)){for(var c=n.length,s=[];c--;)s[c]=F(n[c],o,i,u);return s}return!e.collect||n!==t&&n!==r||a.push([n,o,i,u]),l.bind(n,o,i,u||U)},V=function(e,n,o){if(pe.isArray(e)){for(var i=e.length,u=[];i--;)u[i]=V(e[i],n,o);return u}if(a.length>0&&(e===t||e===r))for(i=a.length;i--;){var c=a[i];e!==c[0]||n&&n!==c[1]||o&&o!==c[2]||l.unbind(c[0],c[1],c[2])}return l.unbind(e,n,o)},j=function(t){if(t&&yn(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},U={doc:t,settings:e,win:r,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:u,boundEvents:a,styles:s,schema:c,events:l,isBlock:function(t){if("string"==typeof t)return!!f[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!f[t.nodeName])}return!1},$:m,$$:h,root:null,clone:function(e,n){if(!Ju||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return Ku(v(e),(function(t){y(r,t.nodeName,p(e,t.nodeName))})),r},getRoot:w,getViewPort:function(t){var e=pn(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=g(t);var e=x(t),n=k(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:k,getParent:function(t,e,n){var r=_(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:_,get:g,getNext:function(t,e){return E(t,e,"nextSibling")},getPrev:function(t,e){return E(t,e,"previousSibling")},select:function(n,r){return cu(n,g(r)||e.root_element||t,[])},is:T,add:N,create:R,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)wt(e,r)&&(o+=" "+r+'="'+z(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:B,setStyle:function(t,n,r){var o=d(n)?h(t).css(n,r):h(t).css(n);e.update_styles&&Zu(s,o)},getStyle:S,setStyles:function(t,n){var r=h(t).css(n);e.update_styles&&Zu(s,r)},removeAllAttribs:function(t){return A(t,(function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))}))},setAttrib:y,setAttribs:D,getAttrib:p,getPos:x,parseStyle:function(t){return s.parse(t)},serializeStyle:function(t,e){return s.serialize(t,e)},addStyle:function(e){var r,o;if(U!==ea.DOM&&t===document){if(n[e])return;n[e]=!0}(o=t.getElementById("mceDefaultStyles"))||((o=t.createElement("style")).id="mceDefaultStyles",o.type="text/css",(r=t.getElementsByTagName("head")[0]).firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(t.createTextNode(e))},loadCSS:function(t){t||(t=""),q(t.split(","),(function(t){o[t]=!0,u.load(t,C)}))},addClass:function(t,e){h(t).addClass(e)},removeClass:function(t,e){I(t,e,!1)},hasClass:function(t,e){return h(t).hasClass(e)},toggleClass:I,show:function(t){h(t).show()},hide:function(t){h(t).hide()},isHidden:function(t){return"none"===h(t).css("display")},uniqueId:function(t){return(t||"mce_")+i++},setHTML:M,getOuterHTML:function(t){var e="string"==typeof t?g(t):t;return yn(e)?e.outerHTML:Xu("<div></div>").append(Xu(e).clone()).html()},setOuterHTML:function(t,e){h(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}B(Xu(this).html(e),!0)}))},decode:ui.decode,encode:z,insertAfter:function(t,e){var n=g(e);return A(t,(function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t}))},replace:P,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=R(e),Ku(v(t),(function(e){y(n,e.nodeName,p(t,e.nodeName))})),P(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return s.toHex(pe.trim(t))},run:A,getAttribs:v,isEmpty:function(t,e){var n,r,o=0;if(L(t))return!1;if(t=t.firstChild){var i=new Kr(t,t.parentNode),u=c?c.getWhiteSpaceElements():{};e=e||(c?c.getNonEmptyElements():null);do{if(n=t.nodeType,yn(t)){var a=t.getAttribute("data-mce-bogus");if(a){t=i.next("all"===a);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(L(t))return!1}if(8===n)return!1;if(3===n&&!Io(t.nodeValue))return!1;if(3===n&&t.parentNode&&u[t.parentNode.nodeName]&&Io(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:H,nodeIndex:ta,split:function(t,e,n){var r,o,i,u=H();if(t&&e)return u.setStart(t.parentNode,ta(t)),u.setEnd(e.parentNode,ta(e)),r=u.extractContents(),(u=H()).setStart(e.parentNode,ta(e)+1),u.setEnd(t.parentNode,ta(t)+1),o=u.extractContents(),(i=t.parentNode).insertBefore(Go(U,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(Go(U,o),t),B(t),n||e},bind:F,unbind:V,fire:function(t,e,n){return l.fire(t,e,n)},getContentEditable:j,getContentEditableParent:function(t){for(var e=w(),n=null;t&&t!==e&&null===(n=j(t));t=t.parentNode);return n},destroy:function(){if(a.length>0)for(var t=a.length;t--;){var e=a[t];l.unbind(e[0],e[1],e[2])}ft(o,(function(t,e){u.unload(e),delete o[e]})),cu.setDocument&&cu.setDocument()},isChildOf:function(t,e){if(Ju){for(;t;){if(e===t)return!0;t=t.parentNode}return!1}return t===e||e.contains(t)},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},W=function(t,e,n){var r=e.keep_values,o={set:function(t,r,o){e.url_converter&&(r=e.url_converter.call(e.url_converter_scope||n(),r,o,t[0])),t.attr("data-mce-"+o,r).attr(o,r)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=typeof n?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return n=t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(s,e,O(U));return U};ea.DOM=ea(document),ea.nodeIndex=ta;var na=ea.DOM,ra=pe.each,oa=pe.grep,ia=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,n){var r,o=na,i=function(){o.remove(u),r&&(r.onerror=r.onload=r=null)},u=o.uniqueId();(r=document.createElement("script")).id=u,r.type="text/javascript",r.src=pe._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),e()},r.onerror=function(){i(),w(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],u=function(t,e){ra(o.scriptLoadedCallbacks[e],(function(e){w(e[t])&&e[t].call(e.scope)})),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var a=function(){var e=oa(t);if(t.length=0,ra(e,(function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,(function(){o.states[t]=2,o.loading--,u("success",t),a()}),(function(){o.states[t]=3,o.loading--,i.push(t),u("failure",t),a()}))):u("failure",t):u("success",t)})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,ra(n,(function(t){0===i.length?w(t.success)&&t.success.call(t.scope):w(t.failure)&&t.failure.call(t.scope,i)}))}};a()},t.ScriptLoader=new t,t}(),ua=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},aa={},ca=ua("en"),sa=function(){return bt(aa,ca.get())},la={getData:function(){return dt(aa,(function(t){return At({},t)}))},setCode:function(t){t&&ca.set(t)},getCode:function(){return ca.get()},add:function(t,e){var n=aa[t];n||(aa[t]=n={}),ft(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=sa().getOr({}),r=function(t){return w(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return bt(n,e.toLowerCase()).map(r).getOr(e)},u=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(m(e=t)&&yt(e,"raw"))return r(t.raw);if(function(t){return g(t)&&t.length>1}(t)){var a=t.slice(1);return u(i(t[0]).replace(/\{([0-9]+)\}/g,(function(t,e){return yt(a,e)?r(a[e]):t})))}return u(i(t))},isRtl:function(){return sa().bind((function(t){return bt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return yt(aa,t)}},fa=function(){var t=[],e={},n={},r=[],o=function(t,e){var n=X(r,(function(n){return n.name===t&&n.state===e}));q(n,(function(t){return t.callback()}))},i=function(t){var e;return n[t]&&(e=n[t].dependencies),e||[]},u=function(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},a=function(t,r,c,s,l){if(!e[t]){var f="string"==typeof r?r:r.prefix+r.resource+r.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=fa.baseURL+"/"+f),e[t]=f.substring(0,f.lastIndexOf("/"));var d=function(){o(t,"loaded"),function(t,e,n,r){var o=i(t);q(o,(function(t){var n=u(e,t);a(n.resource,n,void 0,void 0)})),n&&(r?n.call(r):n.call(ia))}(t,r,c,s)};n[t]?d():ia.ScriptLoader.add(f,d,s,l)}},c=function(t,o,i){void 0===i&&(i="added"),yt(n,t)&&"added"===i?o():yt(e,t)&&"loaded"===i?o():r.push({name:t,state:i,callback:o})};return{items:t,urls:e,lookup:n,_listeners:r,get:function(t){if(n[t])return n[t].instance},dependencies:i,requireLangPack:function(t,n){!1!==fa.languageLoad&&c(t,(function(){var r=la.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||ia.ScriptLoader.add(e[t]+"/langs/"+r+".js")}),"loaded")},add:function(e,r,i){var u=r;return t.push(u),n[e]={instance:u,dependencies:i},o(e,"added"),u},remove:function(t){delete e[t],delete n[t]},createUrl:u,addComponents:function(t,n){var r=e[t];q(n,(function(t){ia.ScriptLoader.add(r+"/"+t)}))},load:a,waitFor:c}};fa.languageLoad=!0,fa.baseURL="",fa.PluginManager=fa(),fa.ThemeManager=fa();var da=function(){var t=function(t){var e=ua(P.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(P.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(P.some(t))}}}(C);return At(At({},t),{on:function(e){return t.get().each(e)}})},ma=function(t,e){var n=null;return{cancel:function(){h(n)||(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];h(n)&&(n=setTimeout((function(){n=null,t.apply(null,r)}),e))}}},ga=function(t,e){var n=null,r=function(){h(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)}}},ha=function(t,e){var n=Un(t,e);return void 0===n||""===n?[]:n.split(" ")},pa=function(t){return void 0!==t.dom.classList},va=function(t,e){return function(t,e,n){var r=ha(t,e).concat([n]);return Vn(t,e,r.join(" ")),!0}(t,"class",e)},ba=function(t,e){return function(t,e,n){var r=X(ha(t,e),(function(t){return t!==n}));return r.length>0?Vn(t,e,r.join(" ")):qn(t,e),!1}(t,"class",e)},ya=function(t,e){pa(t)?t.dom.classList.add(e):va(t,e)},wa=function(t){0===(pa(t)?t.dom.classList:function(t){return ha(t,"class")}(t)).length&&qn(t,"class")},xa=function(t,e){return pa(t)&&t.dom.classList.contains(e)},Ca=function(t,e){var n=[];return q(Fe(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(Ca(t,e))})),n},Sa=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return xe(n)?[]:W(n.querySelectorAll(t),be.fromDom)}(e,t)},ka=O("mce-annotation"),Oa=O("data-mce-annotation"),Ta=O("data-mce-annotation-uid"),_a=function(t,e){var n=t.selection.getRng(),r=be.fromDom(n.startContainer),o=be.fromDom(t.getBody()),i=e.fold((function(){return"."+ka()}),(function(t){return"["+Oa()+'="'+t+'"]'})),u=Ve(r,n.startOffset).getOr(r),a=Vr(u,i,(function(t){return Ce(t,o)})),c=function(t,e){return function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}(t,e)?P.some(Un(t,e)):P.none()};return a.bind((function(e){return c(e,""+Ta()).bind((function(n){return c(e,""+Oa()).map((function(e){var r=Ea(t,n);return{uid:n,name:e,elements:r}}))}))}))},Ea=function(t,e){var n=be.fromDom(t.getBody());return Sa(n,"["+Ta()+'="'+e+'"]')},Aa=function(t,e){var n=ua({}),r=function(){return{listeners:[],previous:da()}},o=function(t,e){i(t,(function(t){return e(t),t}))},i=function(t,e){var o=n.get(),i=e(bt(o,t).getOrThunk(r));o[t]=i,n.set(o)},u=ga((function(){var e,r,u,a=n.get(),c=(e=st(a),(u=L.call(e,0)).sort(r),u);q(c,(function(e){i(e,(function(n){var r=n.previous.get();return _a(t,P.some(e)).fold((function(){r.isSome()&&(!function(t){o(t,(function(e){q(e.listeners,(function(e){return e(!1,t)}))}))}(e),n.previous.clear())}),(function(t){var e=t.uid,i=t.name,u=t.elements;Pn(r,e)||(!function(t,e,n){o(t,(function(r){q(r.listeners,(function(r){return r(!0,t,{uid:e,nodes:W(n,(function(t){return t.dom}))})}))}))}(i,e,u),n.previous.set(e))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);t.on("remove",(function(){u.cancel()})),t.on("NodeChange",(function(){u.throttle()}));return{addListener:function(t,e){i(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}},Da=function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){q(t,(function(t){(function(t){return P.from(t.attr(Oa())).bind(e.lookup)})(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))},Ma=0,Na=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Ma+String(e)},Ra=function(t,e){var n,r,o=Ne(t).dom,i=be.fromDom(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Fe(be.fromDom(r)));nn(i,u),rn(t),en(t,i)},za=function(t,e){return be.fromDom(t.dom.cloneNode(e))},Ba=function(t){return za(t,!1)},Ia=function(t){return za(t,!0)},Pa=function(t,e,n){void 0===n&&(n=N);var r=new Kr(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!_n(e)&&!n(e));return P.from(e).filter(_n)};return{current:function(){return P.from(r.current()).filter(_n)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},La=function(t,e){var n=e||function(e){return t.isBlock(e)||Mn(e)||zn(e)},r=function(t,e,n,o){if(_n(t)){var i=o(t,e,t.data);if(-1!==i)return P.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var u=Pa(t,i,n);return r(t,e,(function(){return u.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var u=Pa(t,i,n);return r(t,e,(function(){return u.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},Ha=Math.round,Fa=function(t){return t?{left:Ha(t.left),top:Ha(t.top),bottom:Ha(t.bottom),right:Ha(t.right),width:Ha(t.width),height:Ha(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Va=function(t,e){return t=Fa(t),e?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t},ja=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},Ua=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&ja(e.top-t.bottom,t,e)},Wa=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&ja(e.bottom-t.top,t,e)},qa=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},Ga=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},$a=function(t,e){if(yn(t)&&t.hasChildNodes()){var n=t.childNodes;return n[function(t,e,n){return Math.min(Math.max(t,e),n)}(e,0,n.length-1)]}return t},Xa=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︯ﾞ-ﾟ]"),Ka=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&Xa.test(t)},Ya=yn,Ja=No,Qa=xn("display","block table"),Za=xn("float","left right"),tc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(Ya,Ja,A(Za)),ec=A(xn("white-space","pre pre-line pre-wrap")),nc=_n,rc=Mn,oc=ea.nodeIndex,ic=function(t,e){return e<0&&yn(t)&&t.hasChildNodes()?void 0:$a(t,e)},uc=function(t){return"createRange"in t?t.createRange():ea.DOM.createRng()},ac=function(t){return t&&/[\r\n\t ]/.test(t)},cc=function(t){return!!t.setStart&&!!t.setEnd},sc=function(t){var e=t.startContainer,n=t.startOffset;if(ac(t.toString())&&ec(e.parentNode)&&_n(e)){var r=e.data;if(ac(r[n-1])||ac(r[n+1]))return!0}return!1},lc=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},fc=function(t){var e,n=t.getClientRects();return e=n.length>0?Fa(n[0]):Fa(t.getBoundingClientRect()),!cc(t)&&rc(t)&&lc(e)?function(t){var e=t.ownerDocument,n=uc(e),r=e.createTextNode(" "),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=Fa(n.getBoundingClientRect());return o.removeChild(r),i}(t):lc(e)&&cc(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&_n(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),fc(i)}return null}(t):e},dc=function(t,e){var n=Va(t,e);return n.width=1,n.right=n.left+1,n},mc=function(t){var e=[],n=function(t){var n,r;0!==t.height&&(e.length>0&&(n=t,r=e[e.length-1],n.left===r.left&&n.top===r.top&&n.bottom===r.bottom&&n.right===r.right)||e.push(t))},r=function(t,r){var o=uc(t.ownerDocument);if(r<t.data.length){if(Ka(t.data[r]))return e;if(Ka(t.data[r-1])&&(o.setStart(t,r),o.setEnd(t,r+1),!sc(o)))return n(dc(fc(o),!1)),e}r>0&&(o.setStart(t,r-1),o.setEnd(t,r),sc(o)||n(dc(fc(o),!1))),r<t.data.length&&(o.setStart(t,r),o.setEnd(t,r+1),sc(o)||n(dc(fc(o),!0)))},o=t.container(),i=t.offset();if(nc(o))return r(o,i),e;if(Ya(o))if(t.isAtEnd()){var u=ic(o,i);nc(u)&&r(u,u.data.length),tc(u)&&!rc(u)&&n(dc(fc(u),!1))}else{u=ic(o,i);if(nc(u)&&r(u,0),tc(u)&&t.isAtEnd())return n(dc(fc(u),!1)),e;var a=ic(t.container(),t.offset()-1);tc(a)&&!rc(a)&&(Qa(a)||Qa(u)||!tc(u))&&n(dc(fc(a),!1)),tc(u)&&n(dc(fc(u),!0))}return e},gc=function(t,e,n){var r=function(){return n||(n=mc(gc(t,e))),n};return{container:O(t),offset:O(e),toRange:function(){var n=uc(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return nc(t),0===e},isAtEnd:function(){return nc(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return ic(t,n?e-1:e)}}};gc.fromRangeStart=function(t){return gc(t.startContainer,t.startOffset)},gc.fromRangeEnd=function(t){return gc(t.endContainer,t.endOffset)},gc.after=function(t){return gc(t.parentNode,oc(t)+1)},gc.before=function(t){return gc(t.parentNode,oc(t))},gc.isAbove=function(t,e){return Ln(it(e.getClientRects()),ut(t.getClientRects()),Ua).getOr(!1)},gc.isBelow=function(t,e){return Ln(ut(e.getClientRects()),it(t.getClientRects()),Wa).getOr(!1)},gc.isAtStart=function(t){return!!t&&t.isAtStart()},gc.isAtEnd=function(t){return!!t&&t.isAtEnd()},gc.isTextPosition=function(t){return!!t&&_n(t.container())},gc.isElementPosition=function(t){return!1===gc.isTextPosition(t)};var hc,pc=function(t,e){_n(e)&&0===e.data.length&&t.remove(e)},vc=function(t,e,n){Dn(n)?function(t,e,n){var r=P.from(n.firstChild),o=P.from(n.lastChild);e.insertNode(n),r.each((function(e){return pc(t,e.previousSibling)})),o.each((function(e){return pc(t,e.nextSibling)}))}(t,e,n):function(t,e,n){e.insertNode(n),pc(t,n.previousSibling),pc(t,n.nextSibling)}(t,e,n)},bc=_n,yc=Sn,wc=ea.nodeIndex,xc=function(t){var e=t.parentNode;return yc(e)?xc(e):e},Cc=function(t){return t?Tt(t.childNodes,(function(t,e){return yc(e)&&"BR"!==e.nodeName?t=t.concat(Cc(e)):t.push(e),t}),[]):[]},Sc=function(t){return function(e){return t===e}},kc=function(t){return(bc(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=Cc(xc(t)),n=_t(e,Sc(t),t),e=e.slice(0,n+1);var r=Tt(e,(function(t,n,r){return bc(n)&&bc(e[r-1])&&t++,t}),0);return e=kt(e,wn([t.nodeName])),(n=_t(e,Sc(t),t))-r}(t)+"]"},Oc=function(t,e){var n,r,o,i,u,a=[];return n=e.container(),r=e.offset(),bc(n)?o=function(t,e){for(;(t=t.previousSibling)&&bc(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),a.push(kc(n)),u=function(t,e,n){var r=[];for(e=e.parentNode;e!==t&&(!n||!n(e));e=e.parentNode)r.push(e);return r}(t,n),u=kt(u,A(Sn)),(a=a.concat(St(u,(function(t){return kc(t)})))).reverse().join("/")+","+o},Tc=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=Tt(o,(function(t,e){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return n?("text()"===n[1]&&(n[1]="#text"),function(t,e,n){var r=Cc(t);return r=kt(r,(function(t,e){return!bc(t)||!bc(r[e-1])})),(r=kt(r,wn([e])))[n]}(t,n[1],parseInt(n[2],10))):null}),t);return i?bc(i)?function(t,e){for(var n,r=t,o=0;bc(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!bc(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return bc(t)&&e>t.data.length&&(e=t.data.length),gc(t,e)}(i,parseInt(n,10)):(n="after"===n?wc(i)+1:wc(i),gc(i.parentNode,n)):null},_c=zn,Ec=function(t,e,n,r,o){var i,u=r[o?"startContainer":"endContainer"],a=r[o?"startOffset":"endOffset"],c=[],s=0,l=t.getRoot();for(_n(u)?c.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&_n(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,u,a):a):(a>=(i=u.childNodes).length&&i.length&&(s=1,a=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[a],n)+s));u&&u!==l;u=u.parentNode)c.push(t.nodeIndex(u,n));return c},Ac=function(t,e,n){var r=0;return pe.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},Dc=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],yn(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},Mc=function(t){return Dc(t,!0),Dc(t,!1),t},Nc=function(t,e){var n;if(yn(t)&&(t=$a(t,e),_c(t)))return t;if(ho(t)){if(_n(t)&&mo(t)&&(t=t.parentNode),n=t.previousSibling,_c(n))return n;if(n=t.nextSibling,_c(n))return n}},Rc=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(_c(r)||"IMG"===o)return{name:o,index:Ac(n.dom,o,r)};var u=function(t){return Nc(t.startContainer,t.startOffset)||Nc(t.endContainer,t.endOffset)}(i);return u?{name:o=u.tagName,index:Ac(n.dom,o,u)}:function(t,e,n,r){var o=e.dom,i={};return i.start=Ec(o,t,n,r,!0),e.isCollapsed()||(i.end=Ec(o,t,n,r,!1)),So(r)&&(i.isFakeCaret=!0),i}(t,n,e,i)},zc=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,"&#xFEFF;"):t.create("span",r)},Bc=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),u=t.getNode(),a=u.nodeName;if("IMG"===a)return{name:a,index:Ac(n,a,u)};var c=Mc(r.cloneRange());if(!i){c.collapse(!1);var s=zc(n,o+"_end",e);vc(n,c,s)}(r=Mc(r)).collapse(!0);var l=zc(n,o+"_start",e);return vc(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},Ic=function(t,e,n){return 2===e?Rc(so,n,t):3===e?function(t){var e=t.getRng();return{start:Oc(t.dom.getRoot(),gc.fromRangeStart(e)),end:Oc(t.dom.getRoot(),gc.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):Bc(t,!1)},Pc=E(Rc,T,!0),Lc=ea.DOM,Hc=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return bt(o,t.id).getOr(n)}return r},Fc=function(t){return t.getParam("content_security_policy","")},Vc=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},jc=function(t){return t.getParam("forced_root_block_attrs",{})},Uc=function(t){return t.getParam("automatic_uploads",!0,"boolean")},Wc=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},qc=function(t){return t.getParam("icons","","string")},Gc=function(t){return t.getParam("images_upload_url","","string")},$c=function(t){return t.getParam("images_upload_base_path","","string")},Xc=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},Kc=function(t){return t.getParam("images_upload_handler",null,"function")},Yc=function(t){return t.getParam("content_css_cors",!1,"boolean")},Jc=function(t){return t.getParam("referrer_policy","","string")},Qc=function(t){return t.getParam("language","en","string")},Zc=function(t){return t.getParam("indent_use_margin",!1)},ts=function(t){var e=t.getParam("font_css",[]);return g(e)?e:W(e.split(","),Ht)},es=function(t){var e=t.getParam("object_resizing");return!1!==e&&!fe.iOS&&(d(e)?e:"table,img,figure.image,div,video,iframe")},ns=function(t){return t.getParam("event_root")},rs=function(t){return t.getParam("theme")},os=function(t){return t.getParam("validate")},is=function(t){return!1!==t.getParam("inline_boundaries")},us=function(t){return t.getParam("content_css_cors")},as=function(t){return t.getParam("plugins","","string")},cs=yn,ss=_n,ls=function(t){var e=t.parentNode;e&&e.removeChild(t)},fs=function(t){var e=so(t);return{count:t.length-e.length,text:e}},ds=function(t){for(var e;-1!==(e=t.data.lastIndexOf(ao));)t.deleteData(e,1)},ms=function(t,e){return vs(t),e},gs=function(t,e){var n=e.container(),r=function(t,e){var n=V(t,e);return-1===n?P.none():P.some(n)}(at(n.childNodes),t).map((function(t){return t<e.offset()?gc(n,e.offset()-1):e})).getOr(e);return vs(t),r},hs=function(t,e){return ss(t)&&e.container()===t?function(t,e){var n=fs(t.data.substr(0,e.offset())),r=fs(t.data.substr(e.offset()));return(n.text+r.text).length>0?(ds(t),gc(t,e.offset()-n.count)):e}(t,e):ms(t,e)},ps=function(t,e){return gc.isTextPosition(e)?hs(t,e):function(t,e){return e.container()===t.parentNode?gs(t,e):ms(t,e)}(t,e)},vs=function(t){cs(t)&&ho(t)&&(po(t)?t.removeAttribute("data-mce-caret"):ls(t)),ss(t)&&(ds(t),0===t.data.length&&ls(t))},bs=ne().browser,ys=zn,ws=In,xs=Bn,Cs=function(t,e,n){var r,o,i=Va(e.getBoundingClientRect(),n);if("BODY"===t.tagName){var u=t.ownerDocument.documentElement;r=t.scrollLeft||u.scrollLeft,o=t.scrollTop||u.scrollTop}else{var a=t.getBoundingClientRect();r=t.scrollLeft-a.left,o=t.scrollTop-a.top}i.left+=r,i.right+=r,i.top+=o,i.bottom+=o,i.width=1;var c=e.offsetWidth-e.clientWidth;return c>0&&(n&&(c*=-1),i.left+=c,i.right+=c),i},Ss=function(t,e,n,r){var o,i,u=da(),a=Vc(t),c=a.length>0?a:"p",s=function(){!function(t){for(var e=Sa(be.fromDom(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;if(xo(i))1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1);if(i=o.nextSibling,wo(i))1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1)}}(e),i&&(vs(i),i=null),u.on((function(t){Xu(t.caret).remove(),u.clear()})),o&&(Gr.clearInterval(o),o=void 0)},l=function(){o=Gr.setInterval((function(){r()?Xu("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):Xu("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500)};return{show:function(t,r){var o;if(s(),xs(r))return null;if(!n(r))return i=function(t,e){var n=t.ownerDocument.createTextNode(ao),r=t.parentNode;if(e){o=t.previousSibling;if(fo(o)){if(ho(o))return o;if(xo(o))return o.splitText(o.data.length-1)}r.insertBefore(n,t)}else{var o=t.nextSibling;if(fo(o)){if(ho(o))return o;if(wo(o))return o.splitText(1),o}t.nextSibling?r.insertBefore(n,t.nextSibling):r.appendChild(n)}return n}(r,t),o=r.ownerDocument.createRange(),Os(i.nextSibling)?(o.setStart(i,0),o.setEnd(i,0)):(o.setStart(i,1),o.setEnd(i,1)),o;i=yo(c,r,t);var a=Cs(e,r,t);Xu(i).css("top",a.top);var f=Xu('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(At({},a)).appendTo(e)[0];return u.set({caret:f,element:r,before:t}),t&&Xu(f).addClass("mce-visual-caret-before"),l(),(o=r.ownerDocument.createRange()).setStart(i,0),o.setEnd(i,0),o},hide:s,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){u.on((function(t){var n=Cs(e,t.element,t.before);Xu(t.caret).css(At({},n))}))},destroy:function(){return Gr.clearInterval(o)}}},ks=function(){return bs.isIE()||bs.isEdge()||bs.isFirefox()},Os=function(t){return ys(t)||ws(t)},Ts=function(t){return Os(t)||kn(t)&&ks()},_s=zn,Es=In,As=xn("display","block table table-cell table-caption list-item"),Ds=ho,Ms=mo,Ns=yn,Rs=No,zs=function(t){return t>0},Bs=function(t){return t<0},Is=function(t,e){for(var n;n=t(e);)if(!Ms(n))return n;return null},Ps=function(t,e,n,r,o){var i=new Kr(t,r),u=_s(t)||Ms(t);if(Bs(e)){if(u&&n(t=Is(i.prev.bind(i),!0)))return t;for(;t=Is(i.prev.bind(i),o);)if(n(t))return t}if(zs(e)){if(u&&n(t=Is(i.next.bind(i),!0)))return t;for(;t=Is(i.next.bind(i),o);)if(n(t))return t}return null},Ls=function(t,e){for(;t&&t!==e;){if(As(t))return t;t=t.parentNode}return null},Hs=function(t,e,n){return Ls(t.container(),n)===Ls(e.container(),n)},Fs=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return Ns(n)?n.childNodes[r+t]:null},Vs=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},js=function(t,e,n){return Ls(e,t)===Ls(n,t)},Us=function(t,e,n){for(var r=t?"previousSibling":"nextSibling";n&&n!==e;){var o=n[r];if(Ds(o)&&(o=o[r]),_s(o)||Es(o)){if(js(e,o,n))return o;break}if(Rs(o))break;n=n.parentNode}return null},Ws=E(Vs,!0),qs=E(Vs,!1),Gs=function(t,e,n){var r,o=E(Us,!0,e),i=E(Us,!1,e),u=n.startContainer,a=n.startOffset;if(mo(u)){Ns(u)||(u=u.parentNode);var c=u.getAttribute("data-mce-caret");if("before"===c&&(r=u.nextSibling,Ts(r)))return Ws(r);if("after"===c&&(r=u.previousSibling,Ts(r)))return qs(r)}if(!n.collapsed)return n;if(_n(u)){if(Ds(u)){if(1===t){if(r=i(u))return Ws(r);if(r=o(u))return qs(r)}if(-1===t){if(r=o(u))return qs(r);if(r=i(u))return Ws(r)}return n}if(xo(u)&&a>=u.data.length-1)return 1===t&&(r=i(u))?Ws(r):n;if(wo(u)&&a<=1)return-1===t&&(r=o(u))?qs(r):n;if(a===u.data.length)return(r=i(u))?Ws(r):n;if(0===a)return(r=o(u))?qs(r):n}return n},$s=function(t,e){return P.from(Fs(t?0:-1,e)).filter(_s)},Xs=function(t,e,n){var r=Gs(t,e,n);return-1===t?gc.fromRangeStart(r):gc.fromRangeEnd(r)},Ks=function(t){return P.from(t.getNode()).map(be.fromDom)},Ys=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},Js=function(t,e){var n=Hs(t,e);return!(n||!Mn(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(hc||(hc={}));var Qs,Zs=zn,tl=_n,el=yn,nl=Mn,rl=No,ol=function(t){return Ao(t)||function(t){return!!Ro(t)&&!0!==Y(at(t.getElementsByTagName("*")),(function(t,e){return t||ko(e)}),!1)}(t)},il=zo,ul=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},al=function(t,e){if(zs(t)){if(rl(e.previousSibling)&&!tl(e.previousSibling))return gc.before(e);if(tl(e))return gc(e,0)}if(Bs(t)){if(rl(e.nextSibling)&&!tl(e.nextSibling))return gc.after(e);if(tl(e))return gc(e,e.data.length)}return Bs(t)?nl(e)?gc.before(e):gc.after(e):gc.before(e)},cl=function(t,e,n){var r,o,i,u;if(!el(n)||!e)return null;if(e.isEqual(gc.after(n))&&n.lastChild){if(u=gc.after(n.lastChild),Bs(t)&&rl(n.lastChild)&&el(n.lastChild))return nl(n.lastChild)?gc.before(n.lastChild):u}else u=e;var a=u.container(),c=u.offset();if(tl(a)){if(Bs(t)&&c>0)return gc(a,--c);if(zs(t)&&c<a.length)return gc(a,++c);r=a}else{if(Bs(t)&&c>0&&(o=ul(a,c-1),rl(o)))return!ol(o)&&(i=Ps(o,t,il,o))?tl(i)?gc(i,i.data.length):gc.after(i):tl(o)?gc(o,o.data.length):gc.before(o);if(zs(t)&&c<a.childNodes.length&&(o=ul(a,c),rl(o)))return nl(o)?function(t,e){var n=e.nextSibling;return n&&rl(n)?tl(n)?gc(n,0):gc.before(n):cl(hc.Forwards,gc.after(e),t)}(n,o):!ol(o)&&(i=Ps(o,t,il,o))?tl(i)?gc(i,0):gc.before(i):tl(o)?gc(o,0):gc.after(o);r=o||u.getNode()}if((zs(t)&&u.isAtEnd()||Bs(t)&&u.isAtStart())&&(r=Ps(r,t,R,n,!0),il(r,n)))return al(t,r);o=Ps(r,t,il,n);var s=Et(X(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(a,n),Zs));return!s||o&&s.contains(o)?o?al(t,o):null:u=zs(t)?gc.after(s):gc.before(s)},sl=function(t){return{next:function(e){return cl(hc.Forwards,e,t)},prev:function(e){return cl(hc.Backwards,e,t)}}},ll=function(t){return gc.isTextPosition(t)?0===t.offset():No(t.getNode())},fl=function(t){if(gc.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return No(t.getNode(!0))},dl=function(t,e){return!gc.isTextPosition(t)&&!gc.isTextPosition(e)&&t.getNode()===e.getNode(!0)},ml=function(t,e,n){return t?!dl(e,n)&&(r=e,!(!gc.isTextPosition(r)&&Mn(r.getNode())))&&fl(e)&&ll(n):!dl(n,e)&&ll(e)&&fl(n);var r},gl=function(t,e,n){var r=sl(e);return P.from(t?r.next(n):r.prev(n))},hl=function(t,e,n){return gl(t,e,n).bind((function(r){return Hs(n,r,e)&&ml(t,n,r)?gl(t,e,r):P.some(r)}))},pl=function(t,e,n,r){return hl(t,e,n).bind((function(n){return r(n)?pl(t,e,n,r):P.some(n)}))},vl=function(t,e){var n,r=t?e.firstChild:e.lastChild;return _n(r)?P.some(gc(r,t?0:r.data.length)):r?No(r)?P.some(t?gc.before(r):Mn(n=r)?gc.before(n):gc.after(n)):function(t,e,n){var r=t?gc.before(n):gc.after(n);return gl(t,e,r)}(t,e,r):P.none()},bl=E(gl,!0),yl=E(gl,!1),wl=E(vl,!0),xl=E(vl,!1),Cl=function(t){return yn(t)&&"_mce_caret"===t.id},Sl=function(t,e){for(;e&&e!==t;){if("_mce_caret"===e.id)return e;e=e.parentNode}return null},kl=function(t){return pe.isArray(t.start)},Ol=function(t,e){return yn(e)&&t.isBlock(e)&&!e.innerHTML&&!fe.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},Tl=function(t,e){return xl(t).fold(N,(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},_l=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!Sl(t,e))&&(function(t,e){var n=t.ownerDocument.createTextNode(ao);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),!0)},El=function(t,e,n,r){var o,i,u,a,c=n[e?"start":"end"],s=t.getRoot();if(c){for(u=c[0],i=s,o=c.length-1;o>=1;o--){if(a=i.childNodes,_l(s,i,r))return!0;if(c[o]>a.length-1)return!!_l(s,i,r)||Tl(i,r);i=a[c[o]]}3===i.nodeType&&(u=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(u=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,u):r.setEnd(i,u)}return!0},Al=function(t){return _n(t)&&t.data.length>0},Dl=function(t,e,n){var r,o,i,u,a,c,s=t.get(n.id+"_"+e),l=n.keep;if(s){if(r=s.parentNode,"start"===e?(l?s.hasChildNodes()?(r=s.firstChild,o=1):Al(s.nextSibling)?(r=s.nextSibling,o=0):Al(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)+1):o=t.nodeIndex(s),a=r,c=o):(l?s.hasChildNodes()?(r=s.firstChild,o=1):Al(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=t.nodeIndex(s)):o=t.nodeIndex(s),a=r,c=o),!l){for(u=s.previousSibling,i=s.nextSibling,pe.each(pe.grep(s.childNodes),(function(t){_n(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));s=t.get(n.id+"_"+e);)t.remove(s,!0);u&&i&&u.nodeType===i.nodeType&&_n(u)&&!fe.opera&&(o=u.nodeValue.length,u.appendData(i.nodeValue),t.remove(i),a=u,c=o)}return P.some(gc(a,c))}return P.none()},Ml=function(t,e){var n=t.dom;if(e){if(kl(e))return function(t,e){var n=t.createRng();return El(t,!0,e,n)&&El(t,!1,e,n)?P.some(n):P.none()}(n,e);if(function(t){return d(t.start)}(e))return P.some(function(t,e){var n,r=t.createRng();return n=Tc(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=Tc(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(function(t){return yt(t,"id")}(e))return function(t,e){var n=Dl(t,"start",e),r=Dl(t,"end",e);return Ln(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(Ol(t,e.container()),e.offset()),r.setEnd(Ol(t,n.container()),n.offset()),r}))}(n,e);if(function(t){return yt(t,"name")}(e))return function(t,e){return P.from(t.select(e.name)[e.index]).map((function(e){var n=t.createRng();return n.selectNode(e),n}))}(n,e);if(function(t){return yt(t,"rng")}(e))return P.some(e.rng)}return P.none()},Nl=function(t,e,n){return Ic(t,e,n)},Rl=function(t,e){Ml(t,e).each((function(e){t.setRng(e)}))},zl=function(t){return yn(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Bl=(Qs=" ",function(t){return Qs===t}),Il=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Pl=function(t){return!Il(t)&&!Bl(t)},Ll=function(t){return!!t.nodeType},Hl=function(t,e,n){var r=n.startOffset,o=n.startContainer;if((o!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(o.childNodes[r]))&&yn(o)){var i=o.childNodes,u=void 0;r<i.length?(o=i[r],u=new Kr(o,t.getParent(o,t.isBlock))):(o=i[i.length-1],(u=new Kr(o,t.getParent(o,t.isBlock))).next(!0));for(var a=u.current();a;a=u.next())if(_n(a)&&!Ul(a))return n.setStart(a,0),void e.setRng(n)}},Fl=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(yn(t)||!Ul(t))return t}},Vl=function(t,e){return Ll(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},jl=function(t,e,n){return t.schema.isValidChild(e,n)},Ul=function(t,e){if(void 0===e&&(e=!1),y(t)&&_n(t)){var n=e?t.data.replace(/ /g," "):t.data;return Io(n)}return!1},Wl=function(t,e){return w(t)?t=t(e):y(e)&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},ql=function(t,e){return e=e||"",t=""+((t=t||"").nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},Gl=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},$l=function(t,e,n){return Gl(t,t.getStyle(e,n),n)},Xl=function(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n},Kl=function(t,e,n){return t.getParents(e,n,t.getRoot())},Yl=function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return pt(t,(function(t,e){return U(r,(function(t){return t===e}))}))};return U(t.formatter.get(e),(function(e){var r=o(e);return U(t.formatter.get(n),(function(t){var e=o(t);return function(t,e,n){return void 0===n&&(n=c),a(n).eq(t,e)}(r,e)}))}))},Jl=function(t){return wt(t,"block")},Ql=function(t){return wt(t,"selector")},Zl=function(t){return wt(t,"inline")},tf=function(t){return Ql(t)&&!1!==t.expand&&!Zl(t)},ef=zl,nf=Kl,rf=Ul,of=Vl,uf=function(t,e){for(var n=e;n;){if(yn(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},af=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},cf=function(t,e,n){return af(t,e,n,(function(t){return Bl(t)||Il(t)}))},sf=function(t,e,n){return af(t,e,n,Pl)},lf=function(t,e,n,r,o,i){var u,a=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=La(t),c=o?i.backwards:i.forwards;return P.from(c(e,n,(function(t,e){return ef(t.parentNode)?-1:(u=t,r(o,t,e))}),a))};return c(n,r,cf).bind((function(t){return i?c(t.container,t.offset+(o?-1:0),sf):P.some(t)})).orThunk((function(){return u?P.some({container:u,offset:o?0:u.length}):P.none()}))},ff=function(t,e,n,r,o){_n(r)&&Ut(r.data)&&r[o]&&(r=r[o]);for(var i=nf(t,r),u=0;u<i.length;u++)for(var a=0;a<e.length;a++){var c=e[a];if((!y(c.collapsed)||c.collapsed===n.collapsed)&&(Ql(c)&&t.is(i[u],c.selector)))return i[u]}return r},df=function(t,e,n,r){var o=n,i=t.dom,u=i.getRoot(),a=e[0];if(Jl(a)&&!a.wrapper&&(o=i.getParent(n,a.block,u)),!o){var c=i.getParent(n,"LI,TD,TH");o=i.getParent(_n(n)?n.parentNode:n,(function(e){return e!==u&&of(t,e)}),c)}if(o&&Jl(a)&&a.wrapper&&(o=nf(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!ql(o,"br")););return o||n},mf=function(t,e,n,r){var o=n.parentNode;return!y(n[r])&&(!(o!==e&&!b(o)&&!t.isBlock(o))||mf(t,e,o,r))},gf=function(t,e,n,r,o){var i,u=n,a=o?"previousSibling":"nextSibling",c=t.getRoot();if(_n(n)&&!rf(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!e[0].block_expand&&t.isBlock(u))return u;for(var s=u[a];s;s=s[a]){var l=_n(s)&&!mf(t,c,s,a);if(!ef(s)&&(!Mn(i=s)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!rf(s,l))return u}if(u===c||u.parentNode===c){n=u;break}u=u.parentNode}return n},hf=function(t){return ef(t.parentNode)||ef(t)},pf=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,u=e.endContainer,a=e.endOffset,c=t.dom,s=n[0];(yn(o)&&o.hasChildNodes()&&(o=$a(o,i),_n(o)&&(i=0)),yn(u)&&u.hasChildNodes()&&(u=$a(u,e.collapsed?a:a-1),_n(u)&&(a=u.nodeValue.length)),o=uf(c,o),u=uf(c,u),hf(o)&&(o=ef(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,_n(o)&&(i=e.collapsed?o.length:0)),hf(u)&&(u=ef(u)?u:u.parentNode,u=e.collapsed?u.nextSibling||u:u.previousSibling||u,_n(u)&&(a=e.collapsed?0:u.length)),e.collapsed)&&(lf(c,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),lf(c,t.getBody(),u,a,!1,r).each((function(t){var e=t.container,n=t.offset;u=e,a=n})));return(Zl(s)||s.block_expand)&&(Zl(s)&&_n(o)&&0!==i||(o=gf(c,n,o,i,!0)),Zl(s)&&_n(u)&&a!==u.nodeValue.length||(u=gf(c,n,u,a,!1))),tf(s)&&(o=ff(c,n,e,o,"previousSibling"),u=ff(c,n,e,u,"nextSibling")),(Jl(s)||Ql(s))&&(o=df(t,n,o,"previousSibling"),u=df(t,n,u,"nextSibling"),Jl(s)&&(c.isBlock(o)||(o=gf(c,n,o,i,!0)),c.isBlock(u)||(u=gf(c,n,u,a,!1)))),yn(o)&&(i=c.nodeIndex(o),o=o.parentNode),yn(u)&&(a=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:o,startOffset:i,endContainer:u,endOffset:a}},vf=function(t,e,n){var r=e.startOffset,o=$a(e.startContainer,r),i=e.endOffset,u=$a(e.endContainer,i-1),a=function(t){var e=t[0];_n(e)&&e===o&&r>=e.data.length&&t.splice(0,1);var n=t[t.length-1];return 0===i&&t.length>0&&n===u&&_n(n)&&t.splice(t.length-1,1),t},c=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},s=function(e,n){return t.getParent(e,(function(t){return t.parentNode===n}),n)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,u=i.parentNode;i&&i!==e;i=u){u=i.parentNode;var s=c(i===t?i:i[o],o);s.length&&(r||s.reverse(),n(a(s)))}};if(o===u)return n(a([o]));var f=t.findCommonAncestor(o,u);if(t.isChildOf(o,u))return l(o,f,!0);if(t.isChildOf(u,o))return l(u,f);var d=s(o,f)||o,m=s(u,f)||u;l(o,d,!0);var g=c(d===o?d:d.nextSibling,"nextSibling",m===u?m.nextSibling:m);g.length&&n(a(g)),l(u,m)},bf=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},yf=function(t){return X(function(t){return tt(t,(function(t){var e=Ga(t);return e?[be.fromDom(e)]:[]}))}(t),io)},wf=function(t,e){var n=Sa(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:yf(t)},xf=function(t){return wf(bf(t.selection.getSel()),be.fromDom(t.getBody()))},Cf=function(t,e){return Hr(t,"table",e)},Sf=function(t){return je(t).fold(O([t]),(function(e){return[t].concat(Sf(e))}))},kf=function(t){return Ue(t).fold(O([t]),(function(e){return"br"===Oe(e)?Ie(e).map((function(e){return[t].concat(kf(e))})).getOr([]):[t].concat(kf(e))}))},Of=function(t,e){return Ln(function(t){var e=t.startContainer,n=t.startOffset;return _n(e)?0===n?P.some(be.fromDom(e)):P.none():P.from(e.childNodes[n]).map(be.fromDom)}(e),function(t){var e=t.endContainer,n=t.endOffset;return _n(e)?n===e.data.length?P.some(be.fromDom(e)):P.none():P.from(e.childNodes[n-1]).map(be.fromDom)}(e),(function(e,n){var r=Q(Sf(t),E(Ce,e)),o=Q(kf(t),E(Ce,n));return r.isSome()&&o.isSome()})).getOr(!1)},Tf=function(t,e,n,r){var o=n,i=new Kr(n,o),u=pt(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!j(["td","th","table"],e.toLowerCase())}));do{if(_n(n)&&0!==pe.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(u[n.nodeName])return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},_f=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},Ef=function(t,e){var n=xf(t);n.length>0?q(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)},Af=function(t,e,n){var r=Bc(t,e);n(r),t.moveToBookmark(r)},Df=function(t,e){var n=function(e){return t(e)?P.from(e.dom.nodeValue):P.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Ae,"text"),Mf=function(t){return Df.get(t)},Nf=function(t,e,n,r){return Be(e).fold((function(){return"skipping"}),(function(o){return"br"===r||function(t){return Ae(t)&&Mf(t)===ao}(e)?"valid":function(t){return Ee(t)&&xa(t,ka())}(e)?"existing":Cl(e.dom)?"caret":jl(t,n,r)&&jl(t,Oe(o),n)?"valid":"invalid-child"}))},Rf=function(t,e,n,r){var o=e.uid,i=void 0===o?Na("mce-annotation"):o,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),a=be.fromTag("span",t);ya(a,ka()),Vn(a,""+Ta(),i),Vn(a,""+Oa(),n);var c=r(i,u),s=c.attributes,l=void 0===s?{}:s,f=c.classes,d=void 0===f?[]:f;return jn(a,l),function(t,e){q(e,(function(e){ya(t,e)}))}(a,d),a},zf=function(t,e,n,r,o){var i=[],u=Rf(t.getDoc(),o,n,r),a=da(),c=function(){a.clear()},s=function(t){q(t,l)},l=function(e){switch(Nf(t,e,"span",Oe(e))){case"invalid-child":c();var n=Fe(e);s(n),c();break;case"valid":!function(t,e){Qe(t,e),en(e,t)}(e,a.get().getOrThunk((function(){var t=Ba(u);return i.push(t),a.set(t),t})))}};return vf(t.dom,e,(function(t){c(),function(t){var e=W(t,be.fromDom);s(e)}(t)})),i},Bf=function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),u=xf(t).length>0;if(i.collapsed&&!u&&function(t,e){var n=pf(t,e,[{inline:"span"}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!u){var a=Rf(t.getDoc(),r,e,n.decorate);Ra(a," "),o.getRng().insertNode(a.dom),o.select(a.dom)}else Af(o,!1,(function(){Ef(t,(function(o){zf(t,o,e,n.decorate,r)}))}))}))},If=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return bt(e,t).map((function(t){return t.settings}))}});Da(t,n);var r=Aa(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){Bf(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){_a(t,P.some(e)).each((function(t){var e=t.elements;q(e,un)}))},getAll:function(e){var n=function(t,e){var n=be.fromDom(t.getBody()),r=Sa(n,"["+Oa()+'="'+e+'"]'),o={};return q(r,(function(t){var e=Un(t,Ta()),n=bt(o,e).getOr([]);o[e]=n.concat([t])})),o}(t,e);return dt(n,(function(t){return W(t,(function(t){return t.dom}))}))}}},Pf=function(t){return{getBookmark:E(Nl,t),moveToBookmark:E(Rl,t)}};Pf.isBookmarkNode=zl;var Lf=function(t,e){for(;e&&e!==t;){if(Rn(e)||zn(e))return e;e=e.parentNode}return null},Hf=function(t,e,n){if(n.collapsed)return!1;if(fe.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(yn(r))return U(r.getClientRects(),(function(n){return qa(n,t,e)}))}return U(n.getClientRects(),(function(n){return qa(n,t,e)}))},Ff=function(t,e,n){return t.fire(e,n)},Vf=function(t,e,n,r){return t.fire("FormatApply",{format:e,node:n,vars:r})},jf=function(t,e,n,r){return t.fire("FormatRemove",{format:e,node:n,vars:r})},Uf={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||Uf.metaKeyPressed(t)},metaKeyPressed:function(t){return fe.mac?t.metaKey:t.ctrlKey&&!t.altKey}},Wf=zn,qf=function(t,e){var n,r,o,i,u,a,c,s,l,f,d,m,g,h,p,v=e.dom,b=pe.each,w=e.getDoc(),x=document,C=Math.abs,S=Math.round,k=e.getBody(),O={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},T=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},_=function(t){return In(t)||v.hasClass(t,"mce-preview-object")},E=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return T(t.target)&&!Hf(n.clientX,n.clientY,e)}return T(t.target)&&!Hf(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},A=function(t){return v.is(t,"figure.image")?[t.querySelector("img")]:v.hasClass(t,"mce-preview-object")&&y(t.firstElementChild)?[t,t.firstElementChild]:[t]},D=function(t){var n=es(e);return!!n&&("false"!==t.getAttribute("data-mce-resize")&&(t!==e.getBody()&&(v.hasClass(t,"mce-preview-object")?we(be.fromDom(t.firstElementChild),n):we(be.fromDom(t),n))))},M=function(t,n,r){if(y(r)){var o=A(t);q(o,(function(t){t.style[n]||!e.schema.isValid(t.nodeName.toLowerCase(),n)?v.setStyle(t,n,r):v.setAttrib(t,n,""+r)}))}},N=function(t,e,n){M(t,"width",e),M(t,"height",n)},R=function(t){var u,b,y,w;u=t.screenX-a,b=t.screenY-c,m=u*i[2]+s,g=b*i[3]+l,m=m<5?5:m,g=g<5?5:g,((T(n)||_(n))&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!Uf.modifierPressed(t):Uf.modifierPressed(t))&&(C(u)>C(b)?(g=S(m*f),m=S(g/f)):(m=S(g/f),g=S(m*f))),N(r,m,g),y=(y=i.startPos.x+u)>0?y:0,w=(w=i.startPos.y+b)>0?w:0,v.setStyles(o,{left:y,top:w,display:"block"}),o.innerHTML=m+" &times; "+g,i[2]<0&&r.clientWidth<=m&&v.setStyle(r,"left",void 0+(s-m)),i[3]<0&&r.clientHeight<=g&&v.setStyle(r,"top",void 0+(l-g)),(u=k.scrollWidth-h)+(b=k.scrollHeight-p)!==0&&v.setStyles(o,{left:y-u,top:w-b}),d||(!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(e,n,s,l,"corner-"+i.name),d=!0)},z=function(){var t=d;d=!1,t&&(M(n,"width",m),M(n,"height",g)),v.unbind(w,"mousemove",R),v.unbind(w,"mouseup",z),x!==w&&(v.unbind(x,"mousemove",R),v.unbind(x,"mouseup",z)),v.remove(r),v.remove(o),v.remove(u),B(n),t&&(!function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(e,n,m,g,"corner-"+i.name),v.setAttrib(n,"style",v.getAttrib(n,"style"))),e.nodeChanged()},B=function(t){H();var d=v.getPos(t,k),y=d.x,C=d.y,S=t.getBoundingClientRect(),T=S.width||S.right-S.left,E=S.height||S.bottom-S.top;n!==t&&(I(),n=t,m=g=0);var M=e.fire("ObjectSelected",{target:t}),B=v.getAttrib(n,"data-mce-selected","1");D(t)&&!M.isDefaultPrevented()?b(O,(function(t,e){var d,m=function(d){var m,g=A(n)[0];a=d.screenX,c=d.screenY,s=g.clientWidth,l=g.clientHeight,f=l/s,(i=t).name=e,i.startPos={x:T*t[0]+y,y:E*t[1]+C},h=k.scrollWidth,p=k.scrollHeight,u=v.add(k,"div",{class:"mce-resize-backdrop"}),v.setStyles(u,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),r=_(m=n)?v.create("img",{src:fe.transparentSrc}):m.cloneNode(!0),v.addClass(r,"mce-clonedresizable"),v.setAttrib(r,"data-mce-bogus","all"),r.contentEditable="false",v.setStyles(r,{left:y,top:C,margin:0}),N(r,T,E),r.removeAttribute("data-mce-selected"),k.appendChild(r),v.bind(w,"mousemove",R),v.bind(w,"mouseup",z),x!==w&&(v.bind(x,"mousemove",R),v.bind(x,"mouseup",z)),o=v.add(k,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},s+" &times; "+l)};(d=v.get("mceResizeHandle"+e))&&v.remove(d),d=v.add(k,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===fe.ie&&(d.contentEditable=!1),v.bind(d,"mousedown",(function(t){t.stopImmediatePropagation(),t.preventDefault(),m(t)})),t.elm=d,v.setStyles(d,{left:T*t[0]+y-d.offsetWidth/2,top:E*t[1]+C-d.offsetHeight/2})})):I(),v.getAttrib(n,"data-mce-selected")||n.setAttribute("data-mce-selected",B)},I=function(){H(),n&&n.removeAttribute("data-mce-selected"),ft(O,(function(t,e){var n=v.get("mceResizeHandle"+e);n&&(v.unbind(n),v.remove(n))}))},P=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};d||e.removed||(b(v.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute("data-mce-selected")})),r="mousedown"===n.type?n.target:t.getNode(),o(r=v.$(r).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],k)&&(F(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?B(r):I())},L=function(t){return Wf(Lf(e.getBody(),t))},H=function(){ft(O,(function(t){t.elm&&(v.unbind(t.elm),delete t.elm)}))},F=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}};e.on("init",(function(){if(F(),fe.browser.isIE()||fe.browser.isEdge()){e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||L(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())}));var t=function(t){var n=function(t){Gr.setEditorTimeout(e,(function(){return e.selection.select(t)}))};if(L(t.target)||In(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};v.bind(k,"mscontrolselect",t),e.on("remove",(function(){return v.unbind(k,"mscontrolselect",t)}))}var r=Gr.throttle((function(t){e.composing||P(t)}));e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),e.on("keyup compositionend",(function(t){n&&"TABLE"===n.nodeName&&r(t)})),e.on("hide blur",I),e.on("contextmenu longpress",E,!0)})),e.on("remove",H);return{isResizable:D,showResizeRect:B,hideResizeRect:I,updateResizeRect:P,destroy:function(){n=r=u=null}}},Gf=function(t){return Rn(t)||zn(t)},$f=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(i.caretRangeFromPoint)r=i.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=pe.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-(n=Math.abs(Math.max(n.top-e,n.bottom-e)))}))).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return zn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,Gf))?null:t}(r,n.body)}return r},Xf=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},Kf=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},Yf=function(t,e,n){return Kf(t,e,(function(t){return t.nodeName===n}))},Jf=function(t){return t&&"TABLE"===t.nodeName},Qf=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},Zf=function(t,e){return ho(t)&&!1===Kf(t,e,Cl)},td=function(t,e,n){for(var r=new Kr(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(Mn(e))return!0},ed=function(t,e,n,r,o){var i,u,a=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||a;if(r&&Mn(o)&&e&&t.isEmpty(s))return P.some(gc(o.parentNode,t.nodeIndex(o)));for(var l=new Kr(o,s);u=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(u)||Zf(u,a))return P.none();if(_n(u)&&u.nodeValue.length>0)return!1===Yf(u,a,"A")?P.some(gc(u,r?u.nodeValue.length:0)):P.none();if(t.isBlock(u)||c[u.nodeName.toLowerCase()])return P.none();i=u}return n&&i?P.some(gc(i,0)):P.none()},nd=function(t,e,n,r){var o,i,u,a,c=t.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=yn(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(a=n,ho(o))return P.none();if(yn(o)&&i>o.childNodes.length-1&&(a=!1),An(o)&&(o=c,i=0),o===c){if(a&&(u=o.childNodes[i>0?i-1:0])){if(ho(u))return P.none();if(f[u.nodeName]||Jf(u))return P.none()}if(o.hasChildNodes()){if(i=Math.min(!a&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=_n(o)&&l?o.data.length:0,!e&&o===c.lastChild&&Jf(o))return P.none();if(function(t,e){for(;e&&e!==t;){if(zn(e))return!0;e=e.parentNode}return!1}(c,o)||ho(o))return P.none();if(o.hasChildNodes()&&!1===Jf(o)){u=o;var d=new Kr(o,c);do{if(zn(u)||ho(u)){s=!1;break}if(_n(u)&&u.nodeValue.length>0){i=a?0:u.nodeValue.length,o=u,s=!0;break}if(f[u.nodeName.toLowerCase()]&&!Qf(u)){i=t.nodeIndex(u),o=u.parentNode,a||i++,s=!0;break}}while(u=a?d.next():d.prev())}}}return e&&(_n(o)&&0===i&&ed(t,l,e,!0,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),yn(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Mn(u)||function(t,e){return t.previousSibling&&t.previousSibling.nodeName===e}(u,"A")||td(t,u,!1)||td(t,u,!0)||ed(t,l,e,!0,u).each((function(t){o=t.container(),i=t.offset(),s=!0})))),a&&!e&&_n(o)&&i===o.nodeValue.length&&ed(t,l,e,!1,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),s?P.some(gc(o,i)):P.none()},rd=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=gc.fromRangeStart(e);return nd(t,n,!0,r).each((function(t){n&&gc.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||nd(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),Xf(e,r)?P.none():P.some(r)},od=function(t,e){return t.splitText(e)},id=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&_n(e)?n>0&&n<e.nodeValue.length&&(e=(r=od(e,n)).previousSibling,o>n?(e=r=od(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(_n(e)&&n>0&&n<e.nodeValue.length&&(e=od(e,n),n=0),_n(r)&&o>0&&o<r.nodeValue.length&&(o=(r=od(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}},ud=function(t){return{walk:function(e,n){return vf(t,e,n)},split:id,normalize:function(e){return rd(t,e).fold(N,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}};ud.compareRanges=Xf,ud.getCaretRangeFromPoint=$f,ud.getSelectedNode=Ga,ud.getNode=$a;var ad,cd=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=$n(n,t);return parseFloat(o)||0}return r},r=function(t,e){return Y(e,(function(e,n){var r=$n(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!x(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Hn(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}("height",(function(t){var e=t.dom;return an(t)?e.getBoundingClientRect().height:e.offsetHeight})),sd=function(t,e){return t.view(e).fold(O([]),(function(e){var n=t.owner(e),r=sd(t,n);return[e].concat(r)}))},ld=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?P.none():P.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(be.fromDom)},owner:function(t){return Re(t)}}),fd=function(t){var e=be.fromDom(document),n=dn(e),r=function(t,e){var n=e.owner(t);return sd(e,n)}(t,ld),o=fn(t),i=K(r,(function(t,e){var n=fn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return sn(i.left+o.left+n.left,i.top+o.top+n.top)},dd=function(t){return"textarea"===Oe(t)},md=function(t,e){var n=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return sn(n.offsetLeft,n.offsetTop);var i=ln(null==r?void 0:r.pageYOffset,o.scrollTop),u=ln(null==r?void 0:r.pageXOffset,o.scrollLeft),a=ln(o.clientTop,n.clientTop),c=ln(o.clientLeft,n.clientLeft);return fn(t).translate(u-c,i-a)}(t),r=function(t){return cd.get(t)}(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},gd=function(t,e){var n=function(t,e){var n=Fe(t);if(0===n.length||dd(t))return{element:t,offset:e};if(e<n.length&&!dd(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return dd(r)?{element:t,offset:e}:"img"===Oe(r)?{element:r,offset:1}:Ae(r)?{element:r,offset:Mf(r).length}:{element:r,offset:Fe(r).length}}(t,e),r=be.fromHtml('<span data-mce-bogus="all">\ufeff</span>');return Qe(n.element,r),md(r,(function(){return on(r)}))},hd=function(t,e,n,r){yd(t,(function(o,i){return vd(t,e,n,r)}),n)},pd=function(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,dn(e).top,r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},vd=function(t,e,n,r){var o=be.fromDom(t.getBody()),i=be.fromDom(t.getDoc());o.dom.offsetWidth;var u=gd(be.fromDom(n.startContainer),n.startOffset);pd(t,i,e,u,r),u.cleanup()},bd=function(t,e,n,r){var o=be.fromDom(t.getDoc());pd(t,o,n,function(t){return md(be.fromDom(t),C)}(e),r)},yd=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,u=n.endOffset;e(be.fromDom(r),be.fromDom(i));var a=t.dom.createRng();a.setStart(r,o),a.setEnd(i,u),t.selection.setRng(n)},wd=function(t,e,n,r){var o=t.pos;if(n)mn(o.left,o.top,r);else{var i=o.top-e+t.height;mn(o.left,i,r)}},xd=function(t,e,n,r,o){var i=n+e,u=r.pos.top,a=r.bottom,c=a-u>=n;if(u<e)wd(r,n,!1!==o,t);else if(u>i){wd(r,n,c?!1!==o:!0===o,t)}else a>i&&!c&&wd(r,n,!0===o,t)},Cd=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;xd(t,e,o,n,r)},Sd=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;xd(t,e,o,n,r);var i=fd(n.element),u=pn(window);i.top<u.y?gn(n.element,!1!==r):i.top>u.bottom&&gn(n.element,!0===r)},kd=function(t,e,n){return hd(t,Cd,e,n)},Od=function(t,e,n){return bd(t,e,Cd,n)},Td=function(t,e,n){return hd(t,Sd,e,n)},_d=function(t,e,n){return bd(t,e,Sd,n)},Ed=function(t,e,n){(t.inline?kd:Td)(t,e,n)},Ad=function(t){var e=Xe(t).dom;return t.dom===e.activeElement},Dd=function(t){return void 0===t&&(t=be.fromDom(document)),P.from(t.dom.activeElement).map(be.fromDom)},Md=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Nd=mr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Rd=(Nd.before,Nd.on,Nd.after,function(t){return t.fold(T,T,T)}),zd=mr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Bd={domRange:zd.domRange,relative:zd.relative,exact:zd.exact,exactFromRange:function(t){return zd.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return be.fromDom(t.startContainer)},relative:function(t,e){return Rd(t)},exact:function(t,e,n,r){return t}})}(t);return ze(e)},range:Md},Id=ne().browser,Pd=function(t,e){var n=Ae(e)?Mf(e).length:Fe(e).length+1;return t>n?n:t<0?0:t},Ld=function(t){return Bd.range(t.start,Pd(t.soffset,t.start),t.finish,Pd(t.foffset,t.finish))},Hd=function(t,e){return!bn(e.dom)&&(ke(t,e)||Ce(t,e))},Fd=function(t){return function(e){return Hd(t,e.start)&&Hd(t,e.finish)}},Vd=function(t){return!0===t.inline||Id.isIE()},jd=function(t){return Bd.range(be.fromDom(t.startContainer),t.startOffset,be.fromDom(t.endContainer),t.endOffset)},Ud=function(t){return function(t){var e=t.getSelection();return(e&&0!==e.rangeCount?P.from(e.getRangeAt(0)):P.none()).map(jd)}(ze(t).dom).filter(Fd(t))},Wd=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),P.some(e)}catch(t){return P.none()}},qd=function(t){var e=Vd(t)?Ud(be.fromDom(t.getBody())):P.none();t.bookmark=e.isSome()?e:t.bookmark},Gd=function(t){return(t.bookmark?t.bookmark:P.none()).bind((function(e){return function(t,e){return P.from(e).filter(Fd(t)).map(Ld)}(be.fromDom(t.getBody()),e)})).bind(Wd)},$d={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},Xd=function(t,e){ne().browser.isIE()?function(t){t.on("focusout",(function(){qd(t)}))}(t):function(t,e){t.on("mouseup touchend",(function(t){e.throttle()}))}(t,e),t.on("keyup NodeChange",(function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||qd(t)}))},Kd=function(t){var e=ma((function(){qd(t)}),0);t.on("init",(function(){t.inline&&function(t,e){var n=function(){e.throttle()};ea.DOM.bind(document,"mouseup",n),t.on("remove",(function(){ea.DOM.unbind(document,"mouseup",n)}))}(t,e),Xd(t,e)})),t.on("remove",(function(){e.cancel()}))},Yd=ea.DOM,Jd=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==Yd.getParent(e,(function(e){return function(t){return $d.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)}))},Qd=function(t,e){var n=e.editor;Kd(n),n.on("focusin",(function(){var e=t.focusedEditor;e!==n&&(e&&e.fire("blur",{focusedEditor:n}),t.setActive(n),t.focusedEditor=n,n.fire("focus",{blurredEditor:e}),n.focus(!0))})),n.on("focusout",(function(){Gr.setEditorTimeout(n,(function(){var e=t.focusedEditor;Jd(n,function(t){try{var e=Xe(be.fromDom(t.getElement()));return Dd(e).fold((function(){return document.body}),(function(t){return t.dom}))}catch(t){return document.body}}(n))||e!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),ad||(ad=function(e){var n=t.activeEditor;n&&function(t){if($e()&&y(t.target)){var e=be.fromDom(t.target);if(Ee(e)&&Je(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return it(n)}}return P.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||Jd(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},Yd.bind(document,"focusin",ad))},Zd=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(Yd.unbind(document,"focusin",ad),ad=null)},tm=function(t,e){return function(t){return t.collapsed?P.from($a(t.startContainer,t.startOffset)).map(be.fromDom):P.none()}(e).bind((function(e){return oo(e)?P.some(e):!1===ke(t,e)?P.some(t):P.none()}))},em=function(t,e){tm(be.fromDom(t.getBody()),e).bind((function(t){return wl(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},nm=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},rm=function(t){return Ad(t)||(e=t,Dd(Xe(e)).filter((function(t){return e.dom.contains(t.dom)}))).isSome();var e},om=function(t){return t.inline?function(t){var e=t.getBody();return e&&rm(be.fromDom(e))}(t):function(t){return t.iframeElement&&Ad(be.fromDom(t.iframeElement))}(t)},im=function(t){return om(t)||function(t){var e=Xe(be.fromDom(t.getElement()));return Dd(e).filter((function(e){return n=e.dom,!(void 0!==(r=n.classList)&&(r.contains("tox-edit-area")||r.contains("tox-edit-area__iframe")||r.contains("mce-content-body")))&&Jd(t,e.dom);var n,r})).isSome()}(t)},um=function(t){return t.editorManager.setActive(t)},am=function(t,e){t.removed||(e?um(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===om(t)&&Gd(t).each((function(e){t.selection.setRng(e),r=e}));var o=function(t,e){return t.dom.getParent(e,(function(e){return"true"===t.dom.getContentEditable(e)}))}(t,e.getNode());if(t.$.contains(n,o))return nm(o),em(t,r),void um(t);t.inline||(fe.opera||nm(n),t.getWin().focus()),(fe.gecko||t.inline)&&(nm(n),em(t,r)),um(t)}(t))},cm=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,u=n?e.startOffset:e.endOffset;return P.from(i).map(be.fromDom).map((function(t){return r&&e.collapsed?t:Ve(t,o(t,u)).getOr(t)})).bind((function(t){return Ee(t)?P.some(t):Be(t).filter(Ee)})).map((function(t){return t.dom})).getOr(t)},sm=function(t,e,n){return cm(t,e,!0,n,(function(t,e){return Math.min(We(t),e)}))},lm=function(t,e,n){return cm(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},fm=function(t,e){for(var n=t;t&&_n(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},dm=function(t,e){return W(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},mm={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},gm=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var u=t.parent;u&&u!==e;u=u.parent)if(i=u[o])return i}},hm=function(t){if(!Io(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},pm=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},vm=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,mm[e]||1);return n&&ft(n,(function(t,e){r.attr(e,t)})),r},t.prototype.replace=function(t){return t.parent&&t.remove(),this.insert(t,this),this.remove(),this},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&ft(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=new t(this.name,this.type);if(e=this.attributes){var r=[];r.map={};for(var o=0,i=e.length;o<i;o++){var u=e[o];"id"!==u.name&&(r[r.length]={name:u.name,value:u.value},r.map[u.name]=u.value)}n.attributes=r}return n.value=this.value,n.shortEnded=this.shortEnded,n},t.prototype.wrap=function(t){return this.parent.insert(t,this),t.append(this),this},t.prototype.unwrap=function(){for(var t=this.firstChild;t;){var e=t.next;this.insert(t,this,!0),t=e}this.remove()},t.prototype.remove=function(){var t=this.parent,e=this.next,n=this.prev;return t&&(t.firstChild===this?(t.firstChild=e,e&&(e.prev=null)):n.next=e,t.lastChild===this?(t.lastChild=n,n&&(n.next=null)):e.prev=n,this.parent=this.next=this.prev=null),this},t.prototype.append=function(t){t.parent&&t.remove();var e=this.lastChild;return e?(e.next=t,t.prev=e,this.lastChild=t):this.lastChild=this.firstChild=t,t.parent=this,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=gm(n,this))n.name===t&&e.push(n);return e},t.prototype.children=function(){for(var t=[],e=this.firstChild;e;e=e.next)t.push(e);return t},t.prototype.empty=function(){if(this.firstChild){for(var t=[],e=this.firstChild;e;e=gm(e,this))t.push(e);for(var n=t.length;n--;){(e=t[n]).parent=e.firstChild=e.lastChild=e.next=e.prev=null}}return this.firstChild=this.lastChild=null,this},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this.firstChild;if(pm(this))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(t[r.name])return!1;if(pm(r))return!1}if(8===r.type)return!1;if(3===r.type&&!hm(r))return!1;if(3===r.type&&r.parent&&e[r.parent.name]&&Io(r.value))return!1;if(n&&n(r))return!1}while(r=gm(r,this));return!0},t.prototype.walk=function(t){return gm(this,null,t)},t}(),bm=function(t,e){return t.replace(e.re,(function(t){return bt(e.uris,t).getOr(t)}))},ym=["img","video"],wm=pe.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),xm=function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?function(t,e){return!(b(t)?j(ym,e):t)}(t.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))},Cm=function(t,e,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=t.getShortEndedElements(),u=1,a=n;0!==u;)for(r.lastIndex=a;;){var c=r.exec(e);if(null===c)return a;if("!"===c[1]){a=Pt(c[2],"--")?Sm(e,!1,c.index+"!--".length):Sm(e,!0,c.index+1);break}o.lastIndex=r.lastIndex;var s=o.exec(e);if(!h(s)&&s.index===r.lastIndex){"/"===c[1]?u-=1:yt(i,c[2])||(u+=1),a=r.lastIndex+s[0].length;break}}return a},Sm=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(t.substr(e))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var u=/--!?>/g;u.lastIndex=n;var a=u.exec(t);return a?a.index+a[0].length:r.length},km=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null},Om=function(t,e){var n;void 0===e&&(e=pi());var r=null!==(n=(t=t||{}).document)&&void 0!==n?n:document,o=r.createElement("form");!1!==t.fix_self_closing&&(t.fix_self_closing=!0);var i=t.comment?t.comment:C,u=t.cdata?t.cdata:C,a=t.text?t.text:C,c=t.start?t.start:C,s=t.end?t.end:C,l=t.pi?t.pi:C,f=t.doctype?t.doctype:C,d=function(n,d){void 0===d&&(d="html");for(var m,g,h,p,v,b,y,w,x,C,S,k,O,T,_,E,A,D,M,N=n.html,R=0,z=[],B=0,I=ui.decode,P=pe.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),L=/((java|vb)script|mhtml):/i,H="html"===d?0:1,F=function(t){var e,n;for(e=z.length;e--&&z[e].name!==t;);if(e>=0){for(n=z.length-1;n>=e;n--)(t=z[n]).valid&&s(t.name);z.length=e}},V=function(t,e){return a(bm(t,n),e)},j=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),i(bm(e,n)))},U=function(t,e){var n=t||"",r=!Pt(n,"--"),o=Sm(N,r,e);return t=N.substr(e,o-e),j(r?n+t:t),o+1},W=function(e,i,u,a,c){var s,l;if(u=function(t){return bm(t,n)}((i=i.toLowerCase())in K?i:I(u||a||c||"")),Y&&!w&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(i)){if(!(s=T[i])&&_){for(l=_.length;l--&&!(s=_[l]).pattern.test(i););-1===l&&(s=null)}if(!s)return;if(s.validValues&&!(u in s.validValues))return}if(!(("name"===i||"id"===i)&&e in wm&&(u in r||u in o))){if(P[i]&&!t.allow_script_urls){var f=u.replace(/[\s\u0000-\u001F]+/g,"");try{f=decodeURIComponent(f)}catch(t){f=unescape(f)}if(L.test(f))return;if(xm(t,f,e))return}w&&(i in P||0===i.indexOf("on"))||(p.map[i]=u,p.push({name:i,value:u}))}},q=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),G=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,$=e.getShortEndedElements(),X=t.self_closing_elements||e.getSelfClosingElements(),K=e.getBoolAttrs(),Y=t.validate,J=t.remove_internals,Q=t.fix_self_closing,Z=e.getSpecialElements(),tt=N+">";m=q.exec(tt);){var et=m[0];if(R<m.index&&V(I(N.substr(R,m.index-R))),g=m[7])":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),F(g);else if(g=m[8]){if(m.index+et.length>N.length){V(I(N.substr(m.index))),R=m.index+et.length;continue}":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),x=g in $,Q&&X[g]&&z.length>0&&z[z.length-1].name===g&&F(g);var nt=km(G,m[9]);if(null!==nt){if("all"===nt){R=Cm(e,N,q.lastIndex),q.lastIndex=R;continue}S=!1}if(!Y||(C=e.getElementRule(g))){if(S=!0,Y&&(T=C.attributes,_=C.attributePatterns),(O=m[9])?((w=-1!==O.indexOf("data-mce-type"))&&J&&(S=!1),(p=[]).map={},O.replace(G,(function(t,e,n,r,o){return W(g,e,n,r,o),""}))):(p=[]).map={},Y&&!w){if(E=C.attributesRequired,A=C.attributesDefault,D=C.attributesForced,C.removeEmptyAttrs&&!p.length&&(S=!1),D)for(v=D.length;v--;)y=(k=D[v]).name,"{$uid}"===(M=k.value)&&(M="mce_"+B++),p.map[y]=M,p.push({name:y,value:M});if(A)for(v=A.length;v--;)(y=(k=A[v]).name)in p.map||("{$uid}"===(M=k.value)&&(M="mce_"+B++),p.map[y]=M,p.push({name:y,value:M}));if(E){for(v=E.length;v--&&!(E[v]in p.map););-1===v&&(S=!1)}if(k=p.map["data-mce-bogus"]){if("all"===k){R=Cm(e,N,q.lastIndex),q.lastIndex=R;continue}S=!1}}S&&c(g,p,x)}else S=!1;if(h=Z[g]){h.lastIndex=R=m.index+et.length,(m=h.exec(N))?(S&&(b=N.substr(R,m.index-R)),R=m.index+m[0].length):(b=N.substr(R),R=N.length),S&&(b.length>0&&V(b,!0),s(g)),q.lastIndex=R;continue}x||(O&&O.indexOf("/")===O.length-1?S&&s(g):z.push({name:g,valid:S}))}else if(g=m[1])j(g);else if(g=m[2]){if(!(1===H||t.preserve_cdata||z.length>0&&e.isValidChild(z[z.length-1].name,"#cdata"))){R=U("",m.index+2),q.lastIndex=R;continue}u(g)}else if(g=m[3])f(g);else{if((g=m[4])||"<!"===et){R=U(g,m.index+et.length),q.lastIndex=R;continue}if(g=m[5]){if(1!==H){R=U("?",m.index+2),q.lastIndex=R;continue}l(g,m[6])}}R=m.index+et.length}for(R<N.length&&V(I(N.substr(R))),v=z.length-1;v>=0;v--)(g=z[v]).valid&&s(g.name)};return{parse:function(t,e){void 0===e&&(e="html"),d(function(t){for(var e,n=/data:[^;]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=Na("img"),u=0,a=0;e=n.exec(t);){var c=e[0],s=i+"_"+a++;o[s]=c,u<e.index&&r.push(t.substr(u,e.index-u)),r.push(s),u=e.index+c.length}var l=new RegExp(i+"_[0-9]+","g");return 0===u?{prefix:i,uris:o,html:t,re:l}:(u<t.length&&r.push(t.substr(u)),{prefix:i,uris:o,html:r.join(""),re:l})}(t),e)}}};Om.findEndTag=Cm;var Tm=function(t,e){for(var n,r=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,o=t.schema,i=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")}(t.getTempAttrs(),e),u=o.getShortEndedElements();n=r.exec(i);){var a=r.lastIndex,c=n[0].length,s=void 0;s=u[n[1]]?a:Om.findEndTag(o,i,a),i=i.substring(0,a-c)+i.substring(s),r.lastIndex=a-c}return so(i)},_m=Tm,Em=function(t,e,n,r){var o,i=function(t,e){return At(At({},t),{format:e,get:!0,getInner:!0})}(e,n),u=e.no_events?i:t.fire("BeforeGetContent",i);return o="raw"===u.format?pe.trim(_m(t.serializer,r.innerHTML)):"text"===u.format?t.dom.isEmpty(r)?"":so(r.innerText||r.textContent):"tree"===u.format?t.serializer.serialize(r,u):function(t,e){var n=Vc(t),r=new RegExp("^(<"+n+"[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,u)),j(["text","tree"],u.format)||uo(be.fromDom(r))?u.content=o:u.content=pe.trim(o),u.no_events?u.content:t.fire("GetContent",u).content},Am=pe.each,Dm=function(t){return{compare:function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return Am(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n},o=function(t,e){var n,r;for(r in t)if(yt(t,r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(yt(e,r))return!1;return!0};return!!o(r(e),r(n))&&(!!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))&&(!zl(e)&&!zl(n)))}}},Mm=pe.makeMap,Nm=function(t){var e=[],n=(t=t||{}).indent,r=Mm(t.indent_before||""),o=Mm(t.indent_after||""),i=ui.getEncodeFunc(t.entity_encoding||"raw",t.entities),u="html"===t.element_format;return{start:function(t,a,c){var s,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),a)for(s=0,l=a.length;s<l;s++)f=a[s],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!c||u?">":" />",c&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},Rm=function(t,e){void 0===e&&(e=pi());var n=Nm(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{u(t)}while(t=t.next)}};n.reset();var u=function(t){var r=i[t.type];if(r)r(t);else{var a=t.name,c=t.shortEnded,s=t.attributes;if(o&&s&&s.length>1){var l=[];l.map={};var f=e.getElementRule(t.name);if(f){for(var d=0,m=f.attributesOrder.length;d<m;d++){if((h=f.attributesOrder[d])in s.map){var g=s.map[h];l.map[h]=g,l.push({name:h,value:g})}}for(d=0,m=s.length;d<m;d++){var h;if(!((h=s[d].name)in l.map)){g=s.map[h];l.map[h]=g,l.push({name:h,value:g})}}s=l}}if(n.start(t.name,s,c),!c){if(t=t.firstChild)do{u(t)}while(t=t.next);n.end(a)}}};return 1!==r.type||t.inner?i[11](r):u(r),n.getContent()}}},zm=new Set;q(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],(function(t){zm.add(t)}));var Bm=["font","text-decoration","text-emphasis"],Im=function(t,e){return st(t.parseStyle(t.getAttrib(e,"style")))},Pm=function(t,e){return et(Im(t,e),(function(t){return!function(t){return zm.has(t)}(t)}))},Lm=function(t,e,n){var r=Im(t,e),o=Im(t,n),i=function(r){var o=t.getStyle(e,r),i=t.getStyle(n,r);return jt(o)&&jt(i)&&o!==i};return U(r,(function(t){var e=function(e){return U(e,(function(e){return e===t}))};if(!e(o)&&e(Bm)){var n=X(o,(function(t){return U(Bm,(function(e){return Pt(t,e)}))}));return U(n,i)}return i(t)}))},Hm=function(t,e,n){return P.from(n.container()).filter(_n).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},Fm=E(Hm,!0,Il),Vm=E(Hm,!1,Il),jm=function(t){var e=t.container();return _n(e)&&(0===e.data.length||co(e.data)&&Pf.isBookmarkNode(e.parentNode))},Um=function(t,e){return function(n){return P.from(Fs(t?0:-1,n)).filter(e).isSome()}},Wm=function(t){return Nn(t)&&"block"===$n(be.fromDom(t),"display")},qm=function(t){return zn(t)&&!function(t){return yn(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},Gm=Um(!0,Wm),$m=Um(!1,Wm),Xm=Um(!0,In),Km=Um(!1,In),Ym=Um(!0,kn),Jm=Um(!1,kn),Qm=Um(!0,qm),Zm=Um(!1,qm),tg=function(t){var e=Sa(t,"br"),n=X(function(t){for(var e=[],n=t.dom;n;)e.push(be.fromDom(n)),n=n.lastChild;return e}(t).slice(-1),to);e.length===n.length&&q(n,on)},eg=function(t){rn(t),en(t,be.fromHtml('<br data-mce-bogus="1">'))},ng=function(t){Ue(t).each((function(e){Ie(e).each((function(n){Qr(t)&&to(e)&&Qr(n)&&on(e)}))}))},rg=function(t,e,n){return ke(e,t)?function(t,e){for(var n=w(e)?e:N,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=be.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o}(t,(function(t){return n(t)||Ce(t,e)})).slice(0,-1):[]},og=function(t,e){return rg(t,e,N)},ig=function(t,e){return[t].concat(og(t,e))},ug=function(t,e,n){return pl(t,e,n,jm)},ag=function(t,e){return Q(ig(be.fromDom(e.container()),t),Qr)},cg=function(t,e,n){return ug(t,e.dom,n).forall((function(t){return ag(e,n).fold((function(){return!1===Hs(t,n,e.dom)}),(function(r){return!1===Hs(t,n,e.dom)&&ke(r,be.fromDom(t.container()))}))}))},sg=function(t,e,n){return ag(e,n).fold((function(){return ug(t,e.dom,n).forall((function(t){return!1===Hs(t,n,e.dom)}))}),(function(e){return ug(t,e.dom,n).isNone()}))},lg=E(sg,!1),fg=E(sg,!0),dg=E(cg,!1),mg=E(cg,!0),gg=function(t){return Ks(t).exists(to)},hg=function(t,e,n){var r=X(ig(be.fromDom(n.container()),e),Qr),o=it(r).getOr(e);return gl(t,o.dom,n).filter(gg)},pg=function(t,e){return Ks(e).exists(to)||hg(!0,t,e).isSome()},vg=function(t,e){return function(t){return P.from(t.getNode(!0)).map(be.fromDom)}(e).exists(to)||hg(!1,t,e).isSome()},bg=E(hg,!1),yg=E(hg,!0),wg=function(t){return gc.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},xg=function(t,e){var n=X(ig(be.fromDom(e.container()),t),Qr);return it(n).getOr(t)},Cg=function(t,e){return wg(e)?Vm(e):Vm(e)||yl(xg(t,e).dom,e).exists(Vm)},Sg=function(t,e){return wg(e)?Fm(e):Fm(e)||bl(xg(t,e).dom,e).exists(Fm)},kg=function(t){return Ks(t).bind((function(t){return Pr(t,Ee)})).exists((function(t){return function(t){return j(["pre","pre-wrap"],t)}($n(t,"white-space"))}))},Og=function(t,e){return function(t,e){return yl(t.dom,e).isNone()}(t,e)||function(t,e){return bl(t.dom,e).isNone()}(t,e)||lg(t,e)||fg(t,e)||vg(t,e)||pg(t,e)},Tg=function(t,e){return!kg(e)&&(lg(t,e)||dg(t,e)||vg(t,e)||Cg(t,e))},_g=function(t,e){return!kg(e)&&(fg(t,e)||mg(t,e)||pg(t,e)||Sg(t,e))},Eg=function(t,e){return Tg(t,e)||_g(t,function(t){var e=t.container(),n=t.offset();return _n(e)&&n<e.data.length?gc(e,n+1):t}(e))},Ag=function(t,e){return Bl(t.charAt(e))},Dg=function(t){var e=t.container();return _n(e)&&It(e.data," ")},Mg=function(t){var e=t.data,n=function(t){var e=t.split("");return W(e,(function(t,n){return Bl(t)&&n>0&&n<e.length-1&&Pl(e[n-1])&&Pl(e[n+1])?" ":t})).join("")}(e);return n!==e&&(t.data=n,!0)},Ng=function(t,e){return P.some(e).filter(Dg).bind((function(e){var n=e.container();return function(t,e){var n=e.data,r=gc(e,0);return!(!Ag(n,0)||Eg(t,r))&&(e.data=" "+n.slice(1),!0)}(t,n)||Mg(n)||function(t,e){var n=e.data,r=gc(e,n.length-1);return!(!Ag(n,n.length-1)||Eg(t,r))&&(e.data=n.slice(0,-1)+" ",!0)}(t,n)?P.some(e):P.none()}))},Rg=function(t){var e=be.fromDom(t.getBody());t.selection.isCollapsed()&&Ng(e,gc.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},zg=function(t,e,n){if(0!==n){var r=be.fromDom(t),o=Ir(r,Qr).getOr(r),i=t.data.slice(e,e+n),u=e+n>=t.data.length&&_g(o,gc(t,t.data.length)),a=0===e&&Tg(o,gc(t,0));t.replaceData(e,n,function(t,e,n){return Y(t,(function(r,o){return Il(o)||Bl(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+" "}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,a,u))}},Bg=function(t,e){var n=t.data.slice(e),r=n.length-Ft(n).length;zg(t,e,r)},Ig=function(t,e){var n=t.data.slice(0,e),r=n.length-Vt(n).length;zg(t,e-r,r)},Pg=function(t,e,n,r){void 0===r&&(r=!0);var o=Vt(t.data).length,i=r?t:e,u=r?e:t;return r?i.appendData(u.data):i.insertData(0,u.data),on(be.fromDom(u)),n&&Bg(i,o),i},Lg=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===gc.isTextPosition(t)&&n===e.parentNode&&r>gc.before(e).offset()}(e,t)?gc(e.container(),e.offset()-1):e},Hg=function(t){return No(t.previousSibling)?P.some((e=t.previousSibling,_n(e)?gc(e,e.data.length):gc.after(e))):t.previousSibling?xl(t.previousSibling):P.none();var e},Fg=function(t){return No(t.nextSibling)?P.some((e=t.nextSibling,_n(e)?gc(e,0):gc.before(e))):t.nextSibling?wl(t.nextSibling):P.none();var e},Vg=function(t,e){return Hg(e).orThunk((function(){return Fg(e)})).orThunk((function(){return function(t,e){var n=gc.before(e.previousSibling?e.previousSibling:e.parentNode);return yl(t,n).fold((function(){return bl(t,gc.after(e))}),P.some)}(t,e)}))},jg=function(t,e){return Fg(e).orThunk((function(){return Hg(e)})).orThunk((function(){return function(t,e){return bl(t,gc.after(e)).fold((function(){return yl(t,gc.before(e))}),P.some)}(t,e)}))},Ug=function(t,e,n){return function(t,e,n){return t?jg(e,n):Vg(e,n)}(t,e,n).map(E(Lg,n))},Wg=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},qg=function(t,e){return e&&yt(t.schema.getBlockElements(),Oe(e))},Gg=function(t){if(jo(t)){var e=be.fromHtml('<br data-mce-bogus="1">');return rn(t),en(t,e),P.some(gc.before(e.dom))}return P.none()},$g=function(t,e,n){var r,o,i,u,a=Ie(t).filter(Ae),c=Pe(t).filter(Ae);return on(t),(r=a,o=c,i=e,u=function(t,e,r){var o=t.dom,i=e.dom,u=o.data.length;return Pg(o,i,n),r.container()===i?gc(o,u):r},r.isSome()&&o.isSome()&&i.isSome()?P.some(u(r.getOrDie(),o.getOrDie(),i.getOrDie())):P.none()).orThunk((function(){return n&&(a.each((function(t){return Ig(t.dom,t.dom.length)})),c.each((function(t){return Bg(t.dom,0)}))),e}))},Xg=function(t,e,n,r){void 0===r&&(r=!0);var o,i=Ug(e,t.getBody(),n.dom),u=Ir(n,E(qg,t),(o=t.getBody(),function(t){return t.dom===o})),a=$g(n,i,function(t,e){return yt(t.schema.getTextInlineElements(),Oe(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(Gg).fold((function(){r&&Wg(t,e,a)}),(function(n){r&&Wg(t,e,P.some(n))}))},Kg=function(t){return Sa(t,"td,th")},Yg=function(t,e){return{start:t,end:e}},Jg=mr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),Qg=function(t,e){return Vr(be.fromDom(t),"td,th",e)},Zg=function(t){return!Ce(t.start,t.end)},th=function(t,e){return Cf(t.start,e).bind((function(n){return Cf(t.end,e).bind((function(t){return e=Ce(n,t),r=n,e?P.some(r):P.none();var e,r}))}))},eh=function(t){return function(e){return th(e,t).map((function(t){return function(t,e,n){return{rng:t,table:e,cells:n}}(e,t,Kg(t))}))}},nh=function(t,e,n,r){if(n.collapsed||!t.forall(Zg))return P.none();if(e.isSameTable){var o=t.bind(eh(r));return P.some({start:o,end:o})}var i=Qg(n.startContainer,r),u=Qg(n.endContainer,r),a=i.bind(function(t){return function(e){return Cf(e,t).bind((function(t){return ut(Kg(t)).map((function(t){return Yg(e,t)}))}))}}(r)).bind(eh(r)),c=u.bind(function(t){return function(e){return Cf(e,t).bind((function(t){return it(Kg(t)).map((function(t){return Yg(t,e)}))}))}}(r)).bind(eh(r));return P.some({start:a,end:c})},rh=function(t,e){return Z(t,(function(t){return Ce(t,e)}))},oh=function(t){return Ln(rh(t.cells,t.rng.start),rh(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))},ih=function(t,e,n){return t.exists((function(t){return function(t,e){return!Zg(t)&&th(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&Of(t.start,e)}))},uh=function(t,e){var n=e.startTable,r=e.endTable,o=t.cloneRange();return n.each((function(t){return o.setStartAfter(t.dom)})),r.each((function(t){return o.setEndBefore(t.dom)})),o},ah=function(t,e){var n=function(t){return function(e){return Ce(t,e)}}(t),r=function(t,e){var n=Qg(t.startContainer,e),r=Qg(t.endContainer,e);return Ln(n,r,Yg)}(e,n),o=function(t,e){var n=function(t){return Cf(be.fromDom(t),e)},r=n(t.startContainer),o=n(t.endContainer),i=r.isSome(),u=o.isSome(),a=Ln(r,o,Ce).getOr(!1);return{startTable:r,endTable:o,isStartInTable:i,isEndInTable:u,isSameTable:a,isMultiTable:!a&&i&&u}}(e,n);return ih(r,e,n)?r.map((function(t){return Jg.singleCellTable(e,t.start)})):o.isMultiTable?function(t,e,n,r){return nh(t,e,n,r).bind((function(t){var r=t.start,o=t.end,i=r.bind(oh).getOr([]),u=o.bind(oh).getOr([]);if(i.length>0&&u.length>0){var a=uh(n,e);return P.some(Jg.multiTable(i,u,a))}return P.none()}))}(r,o,e,n):function(t,e,n,r){return nh(t,e,n,r).bind((function(t){var e=t.start,n=t.end;return e.or(n)})).bind((function(t){var r=e.isSameTable,o=oh(t).getOr([]);if(r&&t.cells.length===o.length)return P.some(Jg.fullTable(t.table));if(o.length>0){if(r)return P.some(Jg.partialTable(o,P.none()));var i=uh(n,e);return P.some(Jg.partialTable(o,P.some(At(At({},e),{rng:i}))))}return P.none()}))}(r,o,e,n)},ch=function(t){var e;return(8===Te(e=t)||"#comment"===Oe(e)?Ie(t):Ue(t)).bind(ch).orThunk((function(){return P.some(t)}))},sh=function(t){return q(t,(function(t){qn(t,"contenteditable"),eg(t)}))},lh=function(t,e){var n=xf(t);t.selection.setCursorLocation(e.dom,0),n.length>1&&Vn(e,"data-mce-selected","1")},fh=function(t,e,n){return sh(e),n.map((function(e){var n=e.rng,r=e.isStartInTable,o=function(t,e){return P.from(t.dom.getParent(e,t.dom.isBlock)).map(be.fromDom)}(t,r?n.endContainer:n.startContainer);n.deleteContents(),function(t,e,n){n.each((function(n){e?on(n):(eg(n),t.selection.setCursorLocation(n.dom,0))}))}(t,r,o.filter(jo))})),n.forall((function(t){return t.isStartInTable}))?lh(t,e[0]):t.selection.collapse(!0),!0},dh=function(t,e,n,r){return sh(e.concat(n)),r.deleteContents(),lh(t,e[0]),!0},mh=function(t,e,n){e.deleteContents();var r,o=ch(n).getOr(n),i=be.fromDom(t.dom.getParent(o.dom,t.dom.isBlock));if(jo(i)&&(eg(i),t.selection.setCursorLocation(i.dom,0)),!Ce(n,i)){var u=Pn(Be(i),n)?[]:Be(r=i).map(Fe).map((function(t){return X(t,(function(t){return!Ce(r,t)}))})).getOr([]);q(u.concat(Fe(n)),(function(t){Ce(t,i)||ke(t,i)||on(t)}))}return!0},gh=function(t,e){return Xg(t,!1,e),!0},hh=function(t,e,n,r){return vh(e,r).fold((function(){return function(t,e,n){return ah(e,n).map((function(e){return e.fold(E(mh,t),E(gh,t),E(fh,t),E(dh,t))}))}(t,e,n)}),(function(e){return function(t,e){return bh(t,e)}(t,e)})).getOr(!1)},ph=function(t,e){return Q(ig(e,t),io)},vh=function(t,e){return Q(ig(e,t),(n="caption",function(t){return Ee(t)&&Oe(t)===n}));var n},bh=function(t,e){return eg(e),t.selection.setCursorLocation(e.dom,0),P.some(!0)},yh=function(t,e,n,r,o){return hl(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return wl(t.dom).bind((function(o){return xl(t.dom).map((function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(t,e){return bh(t,e)}(t,r):function(t,e,n){return vh(t,be.fromDom(n.getNode())).map((function(t){return!1===Ce(t,e)}))}(e,r,i)})).or(P.some(!0))},wh=function(t,e,n,r){var o=gc.fromRangeStart(t.selection.getRng());return ph(n,r).bind((function(r){return jo(r)?bh(t,r):function(t,e,n,r,o){return hl(n,t.getBody(),o).bind((function(t){return ph(e,be.fromDom(t.getNode())).map((function(t){return!1===Ce(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)},xh=function(t,e){return t?Ym(e):Jm(e)},Ch=function(t,e,n){var r=be.fromDom(t.getBody());return vh(r,n).fold((function(){return wh(t,e,r,n)||function(t,e){var n=gc.fromRangeStart(t.selection.getRng());return xh(e,n)||gl(e,t.getBody(),n).exists((function(t){return xh(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=gc.fromRangeStart(t.selection.getRng());return jo(r)?bh(t,r):yh(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},Sh=function(t,e){var n=be.fromDom(t.selection.getStart(!0)),r=xf(t);return t.selection.isCollapsed()&&0===r.length?Ch(t,e,n):function(t,e,n){var r=be.fromDom(t.getBody()),o=t.selection.getRng();return 0!==n.length?fh(t,n,P.none()):hh(t,r,o,e)}(t,n,r)},kh=function(t){var e=gc.fromRangeStart(t),n=gc.fromRangeEnd(t),r=t.commonAncestorContainer;return gl(!1,r,n).map((function(o){return!Hs(e,n,r)&&Hs(e,o,r)?function(t,e,n,r){var o=document.createRange();return o.setStart(t,e),o.setEnd(n,r),o}(e.container(),e.offset(),o.container(),o.offset()):t})).getOr(t)},Oh=function(t){return t.collapsed?t:kh(t)},Th=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&function(t){return" "===t.data||Mn(t)}(t.firstChild)},_h=function(t){return t.length>0&&(!(e=t[t.length-1]).firstChild||Th(e))?t.slice(0,-1):t;var e},Eh=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Ah=function(t,e){var n=gc.after(t),r=sl(e).prev(n);return r?r.toRange():null},Dh=function(t,e,n){var r=t.parentNode;return pe.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=gc.before(t),r=sl(e).next(n);return r?r.toRange():null}(t,n)},Mh=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),u=Eh(e,n.startContainer),a=_h((o=i.firstChild,X(o.childNodes,(function(t){return"LI"===t.nodeName})))),c=e.getRoot(),s=function(t){var r=gc.fromRangeStart(n),o=sl(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Eh(e,i.getNode())!==u};return s(1)?Dh(u,a,c):s(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Ah(e[0],n)}(u,a,c,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),pe.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),Ah(e[e.length-1],n)}(u,a,c,n)},Nh=Bn,Rh=function(t){var e=t.dom,n=Oh(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,Nh);!function(t,e,n){return null!==n&&(n===t.getParent(e.endContainer,Nh)&&Of(be.fromDom(n),e))}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):mh(t,n,be.fromDom(r))},zh=function(t,e,n){var r,o,i,u=t.selection,a=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=be.fromDom(t.getRoot());return n=Tg(r,gc.fromRangeStart(e))?n.replace(/^ /,"&nbsp;"):n.replace(/^&nbsp;/," "),n=_g(r,gc.fromRangeEnd(e))?n.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):n.replace(/&nbsp;(<br( \/)?>)?$/," ")}(a,u.getRng(),e));var c=t.parser,s=n.merge,l=Rm({validate:os(t)},t.schema),f='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',d=t.fire("BeforeSetContent",{content:e,format:"html",selection:!0,paste:n.paste});if(d.isDefaultPrevented())t.fire("SetContent",{content:d.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=d.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,f);var m=(o=u.getRng()).startContainer||(o.parentElement?o.parentElement():null),g=t.getBody();m===g&&u.isCollapsed()&&a.isBlock(g.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,g.firstChild)&&a.isEmpty(g.firstChild)&&((o=a.createRng()).setStart(g.firstChild,0),o.setEnd(g.firstChild,0),u.setRng(o)),u.isCollapsed()||Rh(t);var h,p={context:(r=u.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},v=c.parse(e,p);if(!0===n.paste&&function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||" "===t.value}(e.firstChild)}(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)}(t.schema,v)&&function(t,e){return!!Eh(t,e)}(a,r))return o=Mh(l,a,u.getRng(),v),u.setRng(o),void t.fire("SetContent",d);if(function(t){for(var e=t;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(v),"mce_marker"===(i=v.lastChild).attr("id")){var b=i;for(i=i.prev;i;i=i.walk(!0))if(3===i.type||!a.isBlock(i.name)){t.schema.isValidChild(i.parent.name,"span")&&i.parent.insert(b,i,"br"===i.name);break}}if(t._selectionOverrides.showBlockCaretContainer(r),p.invalid){t.selection.setContent(f),r=u.getNode();var w=t.getBody();for(9===r.nodeType?r=i=w:i=r;i!==w;)r=i,i=i.parentNode;e=r===w?w.innerHTML:a.getOuterHTML(r),e=l.serialize(c.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return l.serialize(v)})))),r===w?a.setHTML(w,e):a.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):t.selection.setContent(e)}}(t,e=l.serialize(v),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=Dm(r);pe.each(r.select("*[data-mce-fragment]"),(function(t){if(y(n[t.nodeName.toLowerCase()])&&Pm(r,t))for(var e=t.parentNode;y(e)&&e!==o;e=e.parentNode){if(Lm(r,t,e))break;if(i.compare(e,t)){r.remove(t,!0);break}}}))}}(t,s),function(t,e){var n,r=t.dom,o=t.selection;if(e){o.scrollIntoView(e);var i=function(e){for(var n=t.getBody();e&&e!==n;e=e.parentNode)if("false"===r.getContentEditable(e))return e;return null}(e);if(i)return r.remove(e),void o.select(i);var u=r.createRng(),a=e.previousSibling;if(_n(a)){if(u.setStart(a,a.nodeValue.length),!fe.ie){var c=e.nextSibling;_n(c)&&(a.appendData(c.data),c.parentNode.removeChild(c))}}else u.setStartBefore(e),u.setEndBefore(e);var s=r.getParent(e,r.isBlock);r.remove(e),s&&r.isEmpty(s)&&(t.$(s).empty(),u.setStart(s,0),u.setEnd(s,0),Nh(s)||function(t){return!!t.getAttribute("data-mce-fragment")}(s)||!(n=function(e){var n=gc.fromRangeStart(e);if(n=sl(t.getBody()).next(n))return n.toRange()}(u))?r.add(s,r.create("br",{"data-mce-bogus":"1"})):(u=n,r.remove(s))),o.setRng(u)}}(t,a.get("mce_marker")),h=t.getBody(),pe.each(h.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){P.from(t.getParent(e,"td,th")).map(be.fromDom).each(ng)}(a,u.getStart()),t.fire("SetContent",d),t.addVisual()}},Bh=function(t,e){e(t),t.firstChild&&Bh(t.firstChild,e),t.next&&Bh(t.next,e)},Ih=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var u in n.firstChild&&Bh(n.firstChild,(function(n){q(t,(function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})})),q(e,(function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})}))})),r)yt(r,u)&&i.push(r[u]);for(var a in o)yt(o,a)&&i.push(o[a]);return i}(t,e,n);q(r,(function(t){q(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}))},Ph=function(t){return t instanceof vm},Lh=function(t,e,n){t.dom.setHTML(t.getBody(),e),!0!==n&&function(t){om(t)&&wl(t.getBody()).each((function(e){var n=e.getNode(),r=kn(n)?wl(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},Hh=function(t,e,n){var r=function(t,e){return At(At({format:"html"},t),{set:!0,content:Ph(e)?"":e})}(n,e),o=n.no_events?r:t.fire("BeforeSetContent",r);return Ph(e)||(e=o.content),P.from(t.getBody()).fold(O(e),(function(n){return Ph(e)?function(t,e,n,r){Ih(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=Rm({validate:t.validate},t.schema).serialize(n);return r.content=uo(be.fromDom(e))?o:pe.trim(o),Lh(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r),n}(t,n,e,o):function(t,e,n,r){if(0===n.length||/^\s+$/.test(n)){var o='<br data-mce-bogus="1">';"TABLE"===e.nodeName?n="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+o+"</li>");var i=Vc(t);i&&t.schema.isValidChild(e.nodeName.toLowerCase(),i.toLowerCase())?(n=o,n=t.dom.createHTML(i,jc(t),n)):n||(n='<br data-mce-bogus="1">'),Lh(t,n,r.no_selection),t.fire("SetContent",r)}else"raw"!==r.format&&(n=Rm({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=uo(be.fromDom(e))?n:pe.trim(n),Lh(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r);return r.content}(t,n,e,o)}))},Fh=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?Lr(be.fromDom(n.parentNode),(function(n){return!Ce(t,n)&&e(n)})):P.none()}(t,e).isSome()},Vh=function(t){return w(t)?t:N},jh=function(t,e,n){var r=e(t),o=Vh(n);return r.orThunk((function(){return o(t)?P.none():function(t,e,n){for(var r=t.dom,o=Vh(n);r.parentNode;){r=r.parentNode;var i=be.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return P.none()}(t,e,o)}))},Uh=ql,Wh=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(Ql(i)&&!1===i.inherit&&t.dom.is(e,i.selector))return!0}return!1},qh=function(t,e,n,r,o){var i=t.dom.getRoot();return e!==i&&(e=t.dom.getParent(e,(function(e){return!!Wh(t,e,n)||(e.parentNode===i||!!Xh(t,e,n,r,!0))})),!!Xh(t,e,n,r,o))},Gh=function(t,e,n){return!!Uh(e,n.inline)||(!!Uh(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0))},$h=function(t,e,n,r,o,i){var u=n[r];if(w(n.onmatch))return n.onmatch(e,n,r);if(u)if(v(u.length)){for(var a in u)if(yt(u,a)){var c="attributes"===r?t.getAttrib(e,a):$l(t,e,a),s=Wl(u[a],i),l=b(c)||Ut(c);if(l&&b(s))continue;if(o&&l&&!n.exact)return!1;if((!o||n.exact)&&!Uh(c,Gl(t,s,a)))return!1}}else for(var f=0;f<u.length;f++)if("attributes"===r?t.getAttrib(e,u[f]):$l(t,e,u[f]))return!0;return!0},Xh=function(t,e,n,r,o){var i=t.formatter.get(n),u=t.dom;if(i&&e)for(var a=0;a<i.length;a++){var c=i[a];if(Gh(t.dom,e,c)&&$h(u,e,c,"attributes",o,r)&&$h(u,e,c,"styles",o,r)){var s=c.classes;if(s)for(var l=0;l<s.length;l++)if(!t.dom.hasClass(e,Wl(s[l],r)))return;return c}}},Kh=function(t,e,n,r,o){if(r)return qh(t,r,e,n,o);if(r=t.selection.getNode(),qh(t,r,e,n,o))return!0;var i=t.selection.getStart();return!(i===r||!qh(t,i,e,n,o))},Yh=function(t,e){var n=function(e){return Ce(e,be.fromDom(t.getBody()))};return P.from(t.selection.getStart(!0)).bind((function(r){return jh(be.fromDom(r),(function(n){return ct(e,(function(e){return function(e,n){return Xh(t,e.dom,n)?P.some(n):P.none()}(n,e)}))}),n)})).getOrNull()},Jh=function(t,e,n){return Y(n,(function(n,r){var o=function(t,e){return U(t.formatter.get(e),(function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return U(["styles","attributes"],(function(n){return bt(t,n).exists((function(t){var n=g(t)?t:vt(t);return U(n,e)}))}))}))}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},Qh=ao,Zh=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==Qh||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},tp=function(t){if(t){var e=new Kr(t,t);for(t=e.current();t;t=e.next())if(_n(t))return t}return null},ep=function(t){var e=be.fromTag("span");return jn(e,{id:"_mce_caret","data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&en(e,be.fromText(Qh)),e},np=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(Zh(e))Xg(t,!1,be.fromDom(e),n);else{var i=o.getRng(),u=r.getParent(e,r.isBlock),a=i.startContainer,c=i.startOffset,s=i.endContainer,l=i.endOffset,f=function(t){var e=tp(t);return e&&e.nodeValue.charAt(0)===Qh&&e.deleteData(0,1),e}(e);r.remove(e,!0),a===f&&c>0&&i.setStart(f,c-1),s===f&&l>0&&i.setEnd(f,l-1),u&&r.isEmpty(u)&&eg(be.fromDom(u)),o.setRng(i)}},rp=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)np(t,e,n);else if(!(e=Sl(t.getBody(),o.getStart())))for(;e=r.get("_mce_caret");)np(t,e,!1)},op=function(t,e){return t.appendChild(e),e},ip=function(t,e){var n=K(t,(function(t,e){return op(t,e.cloneNode(!1))}),e);return op(n,n.ownerDocument.createTextNode(Qh))},up=function(t,e,n,r){var o,i,u,a=t.dom,c=t.selection,s=[],l=c.getRng(),f=l.startContainer,d=l.startOffset;for(i=f,3===f.nodeType&&(d!==f.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(Xh(t,i,e,n,r)){u=i;break}i.nextSibling&&(o=!0),s.push(i),i=i.parentNode}if(u)if(o){var m=c.getBookmark();l.collapse(!0);var g=pf(t,l,t.formatter.get(e),!0);g=id(g),t.formatter.remove(e,n,g,r),c.moveToBookmark(m)}else{var h=Sl(t.getBody(),u),p=ep(!1).dom;!function(t,e,n){var r=t.dom,o=r.getParent(n,E(Vl,t));o&&r.isEmpty(o)?n.parentNode.replaceChild(e,n):(tg(be.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(e,n):r.insertAfter(e,n))}(t,p,null!==h?h:u);var v=function(t,e,n,r,o,i){var u=t.formatter,a=t.dom,c=X(st(u.get()),(function(t){return t!==r&&!It(t,"removeformat")})),s=Jh(t,n,c);if(X(s,(function(e){return!Yl(t,e,r)})).length>0){var l=n.cloneNode(!1);return a.add(e,l),u.remove(r,o,l,i),a.remove(l),P.some(l)}return P.none()}(t,p,u,e,n,r),b=ip(s.concat(v.toArray()),p);np(t,h,!1),c.setCursorLocation(b,1),a.isEmpty(u)&&a.remove(u)}},ap=function(t){t.on("mouseup keydown",(function(e){!function(t,e){var n=t.selection,r=t.getBody();rp(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==Qh||rp(t,Sl(r,n.getStart())),37!==e&&39!==e||rp(t,Sl(r,n.getStart()))}(t,e.keyCode)}))},cp=function(t,e){var n=t.schema.getTextInlineElements();return yt(n,Oe(e))&&!Cl(e.dom)&&!Sn(e.dom)},sp={},lp=kt,fp=Ct;!function(t,e){sp[t]||(sp[t]=[]),sp[t].push(e)}("pre",(function(t){var e,n=t.selection.getRng(),r=wn(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),fp(lp(lp(e,r),(function(t){return r(t.previousSibling)&&-1!==Ot(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,Xu(n=t).remove(),Xu(e).append("<br><br>").append(n.childNodes)})))}));var dp=pe.each,mp=function(t){return yn(t)&&!zl(t)&&!Cl(t)&&!Sn(t)},gp=function(t,e){for(var n=t;n;n=n[e]){if(_n(n)&&jt(n.data))return t;if(yn(n)&&!zl(n))return n}return t},hp=function(t,e,n){var r=Dm(t);if(e&&n&&(e=gp(e,"previousSibling"),n=gp(n,"nextSibling"),r.compare(e,n))){for(var o=e.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling,e.appendChild(i)}return t.remove(n),pe.each(pe.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},pp=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=hp(t,Fl(r),r);hp(t,o,Fl(o,!0))}},vp=function(t,e,n){dp(t.childNodes,(function(t){mp(t)&&(e(t)&&n(t),t.hasChildNodes()&&vp(t,e,n))}))},bp=function(t,e){return function(n){return!(!n||!$l(t,n,e))}},yp=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)}(t,r)}},wp=mr([{keep:[]},{rename:["name"]},{removed:[]}]),xp=/^(src|href|style)$/,Cp=pe.each,Sp=ql,kp=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Op=function(t,e,n){var r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"];if(yn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return _n(r)&&n&&o>=r.nodeValue.length&&(r=new Kr(r,t.getBody()).next()||r),_n(r)&&!n&&0===o&&(r=new Kr(r,t.getBody()).prev()||r),r},Tp=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},_p=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},Ep=function(t,e,n,r,o){var i=be.fromDom(e),u=be.fromDom(t.create(r,o)),a=n?He(i):Le(i);return nn(u,a),n?(Qe(i,u),tn(u,i)):(Ze(i,u),en(u,i)),u.dom},Ap=function(t,e,n,r){var o=Fl(e,n,r);return b(o)||"BR"===o.nodeName||t.isBlock(o)},Dp=function(t,e,n){var r,o=e.parentNode,i=t.dom,u=Vc(t);Jl(n)&&(u?o===i.getRoot()&&(n.list_block&&Sp(e,n.list_block)||q(at(e.childNodes),(function(e){jl(t,u,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=_p(i,e,u),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=null}))):i.isBlock(e)&&!i.isBlock(o)&&(Ap(i,e,!1)||Ap(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),Ap(i,e,!0)||Ap(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),function(t){return Ql(t)&&Zl(t)&&Pn(bt(t,"mixed"),!0)}(n)&&!Sp(n.inline,e)||i.remove(e,!0)},Mp=function(t,e,n,r,o){var i,u=t.dom;if(!function(t,e,n){return!(!Zl(n)||!Sp(e,n.inline))||(!(!Jl(n)||!Sp(e,n.block))||(Ql(n)?yn(e)&&t.is(e,n.selector):void 0))}(u,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return wp.keep();var a=r;if(Zl(e)&&"all"===e.remove&&g(e.preserve_attributes)){var c=X(u.getAttribs(a),(function(t){return j(e.preserve_attributes,t.name.toLowerCase())}));if(u.removeAllAttribs(a),q(c,(function(t){return u.setAttrib(a,t.name,t.value)})),c.length>0)return wp.rename("span")}if("all"!==e.remove){Cp(e.styles,(function(t,r){t=Gl(u,Wl(t,n),r+""),x(r)&&(r=t,o=null),(e.remove_similar||!o||Sp($l(u,o,r),t))&&u.setStyle(a,r,""),i=!0})),i&&""===u.getAttrib(a,"style")&&(a.removeAttribute("style"),a.removeAttribute("data-mce-style")),Cp(e.attributes,(function(t,r){var i;if(t=Wl(t,n),x(r)&&(r=t,o=null),e.remove_similar||!o||Sp(u.getAttrib(o,r),t)){if("class"===r&&(t=u.getAttrib(a,r))&&(i="",q(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))return void u.setAttrib(a,r,i);if(xp.test(r)&&a.removeAttribute("data-mce-"+r),"style"===r&&wn(["li"])(a)&&"none"===u.getStyle(a,"list-style-type"))return a.removeAttribute(r),void u.setStyle(a,"list-style-type","none");"class"===r&&a.removeAttribute("className"),a.removeAttribute(r)}})),Cp(e.classes,(function(t){t=Wl(t,n),o&&!u.hasClass(o,t)||u.removeClass(a,t)}));for(var s=u.getAttribs(a),l=0;l<s.length;l++){var f=s[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return wp.keep()}}return"none"!==e.remove?(Dp(t,a,e),wp.removed()):wp.keep()},Np=function(t,e,n,r,o){return Mp(t,e,n,r,o).fold(N,(function(e){return t.dom.rename(r,e),!0}),R)},Rp=function(t,e,n,r){return Mp(t,e,n,r,r).fold(O(r),(function(e){return t.dom.createFragment().appendChild(r),t.dom.rename(r,e)}),O(null))},zp=function(t,e,n,r,o){var i=t.formatter.get(e),u=i[0],a=!0,c=t.dom,s=t.selection,l=function(r){var a=function(t,e,n,r,o){var i;return q(Kl(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var u=Xh(t,e,n,r,o);u&&!1!==u.split&&(i=e)}})),i}(t,r,e,n,o);return function(t,e,n,r,o,i,u,a){var c,s,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=f.clone(m,!1);for(var g=0;g<e.length&&null!==(c=Rp(t,e[g],a,c));g++);c&&(s&&c.appendChild(s),l||(l=c),s=c)}!i||u.mixed&&f.isBlock(n)||(r=f.split(n,r)),s&&(o.parentNode.insertBefore(s,o),l.appendChild(o),Zl(u)&&pp(f,u,0,s))}return r}(t,i,a,r,r,!0,u,n)},f=function(e){return U(i,(function(r){return Np(t,r,n,e,e)}))},d=function(e){var n=!0,r=!1;yn(e)&&c.getContentEditable(e)&&(n=a,a="true"===c.getContentEditable(e),r=!0);var o=at(e.childNodes);if(a&&!r){var i=f(e),s=e.parentNode;!i&&y(s)&&tf(u)&&f(s)}if(u.deep&&o.length){for(var l=0;l<o.length;l++)d(o[l]);r&&(a=n)}q(["underline","line-through","overline"],(function(n){yn(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&Xl(c,e.parentNode)===n&&Np(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))},m=function(t){var e=c.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return function(t){return zl(t)&&yn(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),_n(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),c.remove(e,!0),n},g=function(e){var n,r,o=pf(t,e,i,e.collapsed);if(u.split){if(o=id(o),(n=Op(t,o,!0))!==(r=Op(t,o))){if(n=Tp(n,!0),r=Tp(r,!1),kp(c,n,r)){var a=P.from(n.firstChild).getOr(n);return l(Ep(c,a,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void m(!0)}if(kp(c,r,n)){a=P.from(r.lastChild).getOr(r);return l(Ep(c,a,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void m(!1)}n=_p(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=_p(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),vf(c,s,(function(t){q(t,(function(t){zl(t)||zl(t.parentNode)||l(t)}))})),l(n),l(r),n=m(!0),r=m()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}vf(c,o,(function(t){q(t,d)}))};if(r){if(Ll(r)){var h=c.createRng();h.setStartBefore(r),h.setEndAfter(r),g(h)}else g(r);jf(t,e,r,n)}else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&Zl(u)&&!xf(t).length?up(t,e,n,o):(Af(s,!0,(function(){Ef(t,g)})),Zl(u)&&Kh(t,e,n,s.getStart())&&Hl(c,s,s.getRng()),t.nodeChanged()),jf(t,e,r,n);else{r=s.getNode();for(var p=0;p<i.length&&(!i[p].ceFalseOverride||!Np(t,i[p],n,r,r));p++);jf(t,e,r,n)}},Bp=pe.each,Ip=function(t,e,n,r){Bp(e,(function(e){Zl(e)&&Bp(t.dom.select(e.inline,r),(function(r){mp(r)&&Np(t,e,n,r,e.exact?r:null)})),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";dp(t.select(r,n),(function(n){mp(n)&&dp(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}}(t.dom,e,r)}))},Pp=pe.each,Lp=function(t){return yn(t)&&!zl(t)&&!Cl(t)&&!Sn(t)},Hp=function(t,e,n,r){var o=t.formatter.get(e),i=o[0],u=!r&&t.selection.isCollapsed(),a=t.dom,c=t.selection,s=function(t,e){if(void 0===e&&(e=i),w(e.onformat)&&e.onformat(t,e,n,r),Pp(e.styles,(function(e,r){a.setStyle(t,r,Wl(e,n))})),e.styles){var o=a.getAttrib(t,"style");o&&a.setAttrib(t,"data-mce-style",o)}Pp(e.attributes,(function(e,r){a.setAttrib(t,r,Wl(e,n))})),Pp(e.classes,(function(e){e=Wl(e,n),a.hasClass(t,e)||a.addClass(t,e)}))},l=function(t,e){var n=!1;return Pp(t,(function(t){return!!Ql(t)&&(y(t.collapsed)&&t.collapsed!==u?void 0:a.is(e,t.selector)&&!Cl(e)?(s(e,t),n=!0,!1):void 0)})),n},f=function(t){if(d(t)){var e=a.create(t);return s(e),e}return null},m=function(r,u,a){var c=[],d=!0,m=i.inline||i.block,g=f(m);vf(r,u,(function(u){var f,h=function(u){var p=!1,v=d,b=u.nodeName.toLowerCase(),w=u.parentNode,x=w.nodeName.toLowerCase();if(yn(u)&&r.getContentEditable(u)&&(v=d,d="true"===r.getContentEditable(u),p=!0),Mn(u)&&!function(t,e,n,r){if(function(t){return t.getParam("format_empty_lines",!1,"boolean")}(t)&&Zl(e)){var o=At(At({},t.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=Fh(be.fromDom(n),(function(t){return Cl(t.dom)}));return wt(o,r)&&jo(be.fromDom(n.parentNode),!1)&&!i}return!1}(t,i,u,x))return f=null,void(Jl(i)&&r.remove(u));if(Jl(i)&&i.wrapper&&Xh(t,u,e,n))f=null;else{if(d&&!p&&Jl(i)&&!i.wrapper&&Vl(t,b)&&jl(t,x,m)){var C=r.rename(u,m);return s(C),c.push(C),void(f=null)}if(Ql(i)){var S=l(o,u);if(!S&&y(w)&&tf(i)&&(S=l(o,w)),!Zl(i)||S)return void(f=null)}!d||p||!jl(t,m,b)||!jl(t,x,m)||!a&&_n(u)&&co(u.data)||Cl(u)||Zl(i)&&r.isBlock(u)?(f=null,q(at(u.childNodes),h),p&&(d=v),f=null):(f||(f=r.clone(g,!1),u.parentNode.insertBefore(f,u),c.push(f)),f.appendChild(u))}};q(u,h)})),!0===i.links&&q(c,(function(t){var e=function(t){"A"===t.nodeName&&s(t,i),q(at(t.childNodes),e)};e(t)})),q(c,(function(u){var a=function(t){var e=0;return q(t.childNodes,(function(t){(function(t){return y(t)&&_n(t)&&0===t.length})(t)||zl(t)||e++})),e}(u);!(c.length>1)&&r.isBlock(u)||0!==a?(Zl(i)||Jl(i)&&i.wrapper)&&(i.exact||1!==a||(u=function(t){return Q(t.childNodes,Lp).filter((function(t){return Gh(r,t,i)})).map((function(e){var n=r.clone(e,!1);return s(n),r.replace(n,t,!0),r.remove(e,!0),n})).getOr(t)}(u)),Ip(t,o,n,u),function(t,e,n,r,o){Xh(t,o.parentNode,n,r)&&Np(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(Xh(t,i,n,r))return Np(t,e,r,o),!0}))}(t,i,e,n,u),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&vp(r,bp(t,"fontSize"),yp(t,"backgroundColor",Wl(e.styles.backgroundColor,n)))}(r,i,n,u),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=Xl(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(pe.walk(r,o,"childNodes"),o(r))}(r,i,0,u),function(t,e,n,r){!Zl(e)||"sub"!==e.inline&&"sup"!==e.inline||(vp(r,bp(t,"fontSize"),yp(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,i,0,u),pp(r,i,0,u)):r.remove(u,!0)}))};if("false"!==a.getContentEditable(c.getNode())){if(i){if(r)if(Ll(r)){if(!l(o,r)){var g=a.createRng();g.setStartBefore(r),g.setEndAfter(r),m(a,pf(t,g,o),!0)}}else m(a,r,!0);else if(u&&Zl(i)&&!xf(t).length)!function(t,e,n){var r,o,i=t.selection,u=i.getRng(),a=u.startOffset,c=u.startContainer.nodeValue;(r=Sl(t.getBody(),i.getStart()))&&(o=tp(r));var s,l,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&a>0&&a<c.length&&f.test(c.charAt(a))&&f.test(c.charAt(a-1))){var d=i.getBookmark();u.collapse(!0);var m=pf(t,u,t.formatter.get(e));m=id(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&o.nodeValue===Qh?t.formatter.apply(e,n,r):(s=t.getDoc(),l=ep(!0).dom,o=(r=s.importNode(l,!0)).firstChild,u.insertNode(r),a=1,t.formatter.apply(e,n,r)),i.setCursorLocation(o,a)}(t,e,n);else{var h=c.getNode(),p=o[0];t.settings.forced_root_block||!p.defaultBlock||a.getParent(h,a.isBlock)||Hp(t,p.defaultBlock),c.setRng(Oh(c.getRng())),Af(c,!0,(function(){Ef(t,(function(e,n){var r=n?e:pf(t,e,o);m(a,r,!1)}))})),Hl(a,c,c.getRng()),t.nodeChanged()}!function(t,e){fp(sp[t],(function(t){t(e)}))}(e,t)}Vf(t,e,r,n)}else{r=c.getNode();for(var v=0,b=o.length;v<b;v++){var x=o[v];if(x.ceFalseOverride&&Ql(x)&&a.is(r,x.selector)){s(r,x);break}}Vf(t,e,r,n)}},Fp=function(t){return yt(t,"vars")},Vp=function(t){return t.selection.getStart()},jp=function(t,e,n,r,o){return J(e,(function(e){var i=t.formatter.matchNode(e,n,null!=o?o:{},r);return!v(i)}),(function(e){return!!Wh(t,e,n)||!r&&y(t.formatter.matchNode(e,n,o,!0))}))},Up=function(t,e){var n=null!=e?e:Vp(t);return X(Kl(t.dom,n),(function(t){return yn(t)&&!Sn(t)}))},Wp=function(t,e,n){var r=Up(t,e);ft(n,(function(n,o){var i=function(n){var i=jp(t,r,o,n.similar,Fp(n)?n.vars:void 0),u=i.isSome();if(n.state.get()!==u){n.state.set(u);var a=i.getOr(e);Fp(n)?n.callback(u,{node:a,format:o,parents:r}):q(n.callbacks,(function(t){return t(u,{node:a,format:o,parents:r})}))}};q([n.withSimilar,n.withoutSimilar],i),q(n.withVars,i)}))},qp=function(t,e,n,r,o,i){return null===e.get()&&function(t,e){t.set({}),e.on("NodeChange",(function(n){Wp(e,n.element,t.get())})),e.on("FormatApply FormatRemove",(function(n){var r=P.from(n.node).map((function(t){return Ll(t)?t:t.startContainer})).bind((function(t){return yn(t)?P.some(t):P.from(t.parentElement)})).getOrThunk((function(){return Vp(e)}));Wp(e,r,t.get())}))}(e,t),function(t,e,n,r,o,i){var u=e.get();q(n.split(","),(function(e){var n=bt(u,e).getOrThunk((function(){var t={withSimilar:{state:ua(!1),similar:!0,callbacks:[]},withoutSimilar:{state:ua(!1),similar:!1,callbacks:[]},withVars:[]};return u[e]=t,t})),a=function(){var n=Up(t);return jp(t,n,e,o,i).isSome()};if(v(i)){var c=o?n.withSimilar:n.withoutSimilar;c.callbacks.push(r),1===c.callbacks.length&&c.state.set(a())}else n.withVars.push({state:ua(a()),similar:o,vars:i,callback:r})})),e.set(u)}(t,e,n,r,o,i),{unbind:function(){return function(t,e,n){var r=t.get();q(e.split(","),(function(t){return bt(r,t).each((function(e){r[t]={withSimilar:At(At({},e.withSimilar),{callbacks:X(e.withSimilar.callbacks,(function(t){return t!==n}))}),withoutSimilar:At(At({},e.withoutSimilar),{callbacks:X(e.withoutSimilar.callbacks,(function(t){return t!==n}))}),withVars:X(e.withVars,(function(t){return t.callback!==n}))}}))})),t.set(r)}(e,n,r)}}},Gp=function(t,e){var n=(e||document).createDocumentFragment();return q(t,(function(t){n.appendChild(t.dom)})),be.fromDom(n)},$p=function(t,e,n){return{element:t,width:e,rows:n}},Xp=function(t,e){return{element:t,cells:e}},Kp=function(t,e){return{x:t,y:e}},Yp=function(t,e){var n=parseInt(Un(t,e),10);return isNaN(n)?1:n},Jp=function(t,e,n){var r=t.rows;return!!(r[n]?r[n].cells:[])[e]},Qp=function(t){return Y(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)},Zp=function(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Ce(o[i],e))return P.some(Kp(i,r));return P.none()},tv=function(t,e,n,r,o){for(var i=[],u=t.rows,a=n;a<=o;a++){var c=u[a].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(Xp(u[a].element,s))}return i},ev=function(t){var e=$p(Ba(t),0,[]);return q(Sa(t,"tr"),(function(t,n){q(Sa(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=Yp(o,"rowspan"),u=Yp(o,"colspan"),a=t.rows,c=n;c<n+i;c++){a[c]||(a[c]=Xp(Ia(r),[]));for(var s=e;s<e+u;s++){a[c].cells[s]=c===n&&s===e?o:Ba(o)}}}(e,function(t,e,n){for(;Jp(t,e,n);)e++;return e}(e,o,n),n,t,r)}))})),$p(e.element,Qp(e.rows),e.rows)},nv=function(t){return function(t,e){var n=Ba(t.element),r=be.fromTag("tbody");return nn(r,e),en(n,r),n}(t,function(t){return W(t.rows,(function(t){var e=W(t.cells,(function(t){var e=Ia(t);return qn(e,"colspan"),qn(e,"rowspan"),e})),n=Ba(t.element);return nn(n,e),n}))}(t))},rv=function(t,e,n){return Zp(t,e).bind((function(e){return Zp(t,n).map((function(n){return function(t,e,n){var r=e.x,o=e.y,i=n.x,u=n.y,a=o<u?tv(t,r,o,i,u):tv(t,r,u,i,o);return $p(t.element,Qp(a),a)}(t,e,n)}))}))},ov=function(t,e){return Q(t,(function(t){return"li"===Oe(t)&&Of(t,e)})).fold(O([]),(function(e){return function(t){return Q(t,(function(t){return"ul"===Oe(t)||"ol"===Oe(t)}))}(t).map((function(t){var e=be.fromTag(Oe(t)),n=pt(Yn(t),(function(t,e){return Pt(e,"list-style")}));return Gn(e,n),[be.fromTag("li"),e]})).getOr([])}))},iv=function(t,e){var n=be.fromDom(e.commonAncestorContainer),r=ig(n,t),o=X(r,(function(t){return Zr(t)||Jr(t)})),i=ov(r,e),u=o.concat(i.length?i:function(t){return ro(t)?Be(t).filter(no).fold(O([]),(function(e){return[t,e]})):no(t)?[t]:[]}(n));return W(u,Ba)},uv=function(){return Gp([])},av=function(t,e){return n=be.fromDom(e.cloneContents()),r=iv(t,e),o=Y(r,(function(t,e){return en(e,t),e}),n),r.length>0?Gp([o]):o;var n,r,o},cv=function(t,e){return(n=t,r=e[0],Hr(r,"table",E(Ce,n))).bind((function(t){var n=e[0],r=e[e.length-1],o=ev(t);return rv(o,n,r).map((function(t){return Gp([nv(t)])}))})).getOrThunk(uv);var n,r},sv=function(t,e){var n=wf(e,t);return n.length>0?cv(t,n):function(t,e){return e.length>0&&e[0].collapsed?uv():av(t,e[0])}(t,e)},lv=function(t,e){return e>=0&&e<t.length&&Il(t.charAt(e))},fv=function(t,e){var n=so(t.innerText);return e?function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},dv=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return At(At({},t),{format:e,get:!0,selection:!0})}(n,e),o=t.fire("BeforeGetContent",r);if(o.isDefaultPrevented())return t.fire("GetContent",o),o.content;if("text"===o.format)return function(t){return P.from(t.selection.getRng()).map((function(e){var n=P.from(t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock)),r=t.getBody(),o=function(t){return t.map((function(t){return t.nodeName})).getOr("div").toLowerCase()}(n),i=fe.browser.isIE()&&"pre"!==o,u=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=fv(u,i),c=so(u.textContent);if(t.dom.remove(u),lv(c,0)||lv(c,c.length-1)){var s=n.getOr(r),l=fv(s,i),f=l.indexOf(a);return-1===f?a:(lv(l,f-1)?" ":"")+a+(lv(l,f+a.length)?" ":"")}return a})).getOr("")}(t);o.getInner=!0;var i=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=dm(t,bf(o)),u=e.contextual?sv(be.fromDom(t.getBody()),i).dom:n.cloneContents();return u&&r.appendChild(u),t.selection.serializer.serialize(r,e)}(t,o);return"tree"===o.format?i:(o.content=t.selection.isCollapsed()?"":i,t.fire("GetContent",o),o.content)},mv=function(t){return yn(t)?t.outerHTML:_n(t)?ui.encodeRaw(t.data,!1):En(t)?"\x3c!--"+t.data+"--\x3e":""},gv=function(t,e,n){var r=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();for(t&&(n.innerHTML=t);e=n.firstChild;)r.appendChild(e);return r}(e);if(t.hasChildNodes()&&n<t.childNodes.length){var o=t.childNodes[n];o.parentNode.insertBefore(r,o)}else t.appendChild(r)},hv=function(t,e){var n,r,o,i,u,a,c,s,l,f=W(at(e.childNodes),mv);return function(t,e){var n=0;q(t,(function(t){0===t[0]?n++:1===t[0]?(gv(e,t[1],n),n++):2===t[0]&&function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}}(e,n)}))}((r=t,o=(n=f).length+r.length+2,i=new Array(o),u=new Array(o),a=function(t,e,o,i,u){var c=s(t,e,o,i);if(null===c||c.start===e&&c.diag===e-i||c.end===t&&c.diag===t-o)for(var l=t,f=o;l<e||f<i;)l<e&&f<i&&n[l]===r[f]?(u.push([0,n[l]]),++l,++f):e-t>i-o?(u.push([2,n[l]]),++l):(u.push([1,r[f]]),++f);else{a(t,c.start,o,c.start-c.diag,u);for(var d=c.start;d<c.end;++d)u.push([0,n[d]]);a(c.end,e,c.end-c.diag,i,u)}},c=function(t,e,o,i){for(var u=t;u-e<i&&u<o&&n[u]===r[u-e];)++u;return function(t,e,n){return{start:t,end:e,diag:n}}(t,u,e)},s=function(t,e,o,a){var s=e-t,l=a-o;if(0===s||0===l)return null;var f,d,m,g,h,p=s-l,v=l+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=t,u[1+b]=e+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,h=(g=i[m])-t+o-d;g<e&&h<a&&n[g]===r[h];)i[m]=++g,++h;if(p%2!=0&&p-f<=d&&d<=p+f&&u[m-p]<=i[m])return c(u[m-p],d+t-o,e,a)}for(d=p-f;d<=p+f;d+=2){for(m=d+b-p,d===p-f||d!==p+f&&u[m+1]<=u[m-1]?u[m]=u[m+1]-1:u[m]=u[m-1],h=(g=u[m]-1)-t+o-d;g>=t&&h>=o&&n[g]===r[h];)u[m]=g--,h--;if(p%2==0&&-f<=d&&d<=f&&u[m]<=i[m+p])return c(u[m],d+t-o,e,a)}}},l=[],a(0,n.length,0,r.length,l),l),e),e},pv=Mt((function(){return document.implementation.createHTMLDocument("undo")})),vv=function(t){var e,n=(e=t.getBody(),X(W(at(e.childNodes),mv),(function(t){return t.length>0}))),r=tt(n,(function(e){var n=Tm(t.serializer,e);return n.length>0?[n]:[]})),o=r.join("");return-1!==o.indexOf("</iframe>")?function(t){return{type:"fragmented",fragments:t,content:"",bookmark:null,beforeBookmark:null}}(r):function(t){return{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}}(o)},bv=function(t,e,n){var r=n?e.beforeBookmark:e.bookmark;"fragmented"===e.type?hv(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw",no_selection:!y(r)||!kl(r)||!r.isFakeCaret}),t.selection.moveToBookmark(r)},yv=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},wv=function(t){var e=be.fromTag("body",pv());return Ra(e,yv(t)),q(Sa(e,"*[data-mce-bogus]"),un),e.dom.innerHTML},xv=function(t,e){return!(!t||!e)&&(!!function(t,e){return yv(t)===yv(e)}(t,e)||function(t,e){return wv(t)===wv(e)}(t,e))},Cv=function(t){return 0===t.get()},Sv=function(t,e,n){Cv(n)&&(t.typing=e)},kv=function(t,e){t.typing&&(Sv(t,!1,e),t.add())},Ov=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){Cv(e)&&n.set(Pc(t.selection))}(t,e,n)},add:function(e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=vv(t);if(i=i||{},i=pe.extend(i,a),!1===Cv(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:u}).isDefaultPrevented())return null;if(c&&xv(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(s&&e.data.length>s){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=Pc(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:c,originalEvent:u};return n.get()>0?(t.setDirty(!0),t.fire("AddUndo",f),t.fire("change",f)):t.fire("AddUndo",f),i}(t,e,n,r,o,i,u)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,Sv(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],bv(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],bv(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r}(t,e,n)},clear:function(e,n){return function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")}(t,e,n)},reset:function(t){return function(t){t.clear(),t.add()}(t)},hasUndo:function(e,n){return function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!xv(vv(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()<t.data.length-1&&!t.typing}(t,e)},transact:function(t,e,n){return function(t,e,n){return kv(t,e),t.beforeChange(),t.ignore(n),t.add()}(t,e,n)},ignore:function(t,e){return function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}}(t,e)},extra:function(e,n,r,o){return function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,u=e.data[n.get()-1];bv(t,u,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}}(t,e,n,r,o)}},formatter:{match:function(e,n,r,o){return Kh(t,e,n,r,o)},matchAll:function(e,n){return function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,(function(i){for(var u=0;u<e.length;u++){var a=e[u];!o[a]&&Xh(t,i,a,n)&&(o[a]=!0,r.push(a))}}),t.dom.getRoot()),r}(t,e,n)},matchNode:function(e,n,r,o){return Xh(t,e,n,r,o)},canApply:function(e){return function(t,e){var n=t.formatter.get(e),r=t.dom;if(n)for(var o=t.selection.getStart(),i=Kl(r,o),u=n.length-1;u>=0;u--){var a=n[u];if(!Ql(a)||y(a.defaultBlock))return!0;for(var c=i.length-1;c>=0;c--)if(r.is(i[c],a.selector))return!0}return!1}(t,e)},closest:function(e){return Yh(t,e)},apply:function(e,n,r){return Hp(t,e,n,r)},remove:function(e,n,r,o){return zp(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!Kh(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?Hp(t,e,n,r):zp(t,e,n,r)}(t,e,n,r)},formatChanged:function(e,n,r,o,i){return qp(t,e,n,r,o,i)}},editor:{getContent:function(e,n){return function(t,e,n){return P.from(t.getBody()).fold(O("tree"===e.format?new vm("body",11):""),(function(r){return Em(t,e,n,r)}))}(t,e,n)},setContent:function(e,n){return Hh(t,e,n)},insertContent:function(e,n){return zh(t,e,n)},addVisual:function(e){return function(t,e){var n=t.dom,r=y(e)?e:t.getBody();v(t.hasVisual)&&(t.hasVisual=function(t){return t.getParam("visual",!0,"boolean")}(t)),q(n.select("table,a",r),(function(e){switch(e.nodeName){case"TABLE":var r=function(t){return t.getParam("visual_table_class","mce-item-table","string")}(t),o=n.getAttrib(e,"border");o&&"0"!==o||!t.hasVisual?n.removeClass(e,r):n.addClass(e,r);break;case"A":if(!n.getAttrib(e,"href")){var i=n.getAttrib(e,"name")||e.id,u=function(t){return t.getParam("visual_anchor_class","mce-item-anchor","string")}(t);i&&t.hasVisual?n.addClass(e,u):n.removeClass(e,u)}}})),t.fire("VisualAid",{element:e,hasVisual:t.hasVisual})}(t,e)}},selection:{getContent:function(e,n){return dv(t,e,n)}},raw:{getModel:function(){return P.none()}}}},Tv=function(t){return yt(t.plugins,"rtc")},_v=function(t){var e=t;return function(t){return bt(t.plugins,"rtc").bind((function(t){return P.from(t.setup)}))}(t).fold((function(){return e.rtcInstance=Ov(t),P.none()}),(function(t){return e.rtcInstance=function(){var t=O(null),e=O("");return{undoManager:{beforeChange:C,add:t,undo:t,redo:t,clear:C,reset:C,hasUndo:N,hasRedo:N,transact:t,ignore:C,extra:C},formatter:{match:N,matchAll:O([]),matchNode:O(void 0),canApply:N,closest:e,apply:C,remove:C,toggle:C,formatChanged:O({unbind:C})},editor:{getContent:e,setContent:e,insertContent:C,addVisual:C},selection:{getContent:e},raw:{getModel:O(P.none())}}}(),P.some((function(){return t().then((function(t){return e.rtcInstance=function(t){var e=function(t){return m(t)?t:{}},n=t.undoManager,r=t.formatter,o=t.editor,i=t.selection,u=t.raw;return{undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:function(t,e,r){return n.transact(r)},ignore:function(t,e){return n.ignore(e)},extra:function(t,e,r,o){return n.extra(r,o)}},formatter:{match:function(t,n,o,i){return r.match(t,e(n),i)},matchAll:r.matchAll,matchNode:r.matchNode,canApply:function(t){return r.canApply(t)},closest:function(t){return r.closest(t)},apply:function(t,n,o){return r.apply(t,e(n))},remove:function(t,n,o,i){return r.remove(t,e(n))},toggle:function(t,n,o){return r.toggle(t,e(n))},formatChanged:function(t,e,n,o,i){return r.formatChanged(e,n,o,i)}},editor:{getContent:function(t,e){return o.getContent(t)},setContent:function(t,e){return o.setContent(t,e)},insertContent:function(t,e){return o.insertContent(t)},addVisual:o.addVisual},selection:{getContent:function(t,e){return i.getContent(e)}},raw:{getModel:function(){return P.some(u.getRawModel())}}}}(t),t.rtc.isRemote}))}))}))},Ev=function(t){return t.rtcInstance?t.rtcInstance:Ov(t)},Av=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},Dv=function(t,e){return void 0===e&&(e={}),function(t,e,n){return Av(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)},Mv=function(t){return 0===t.dom.length?(on(t),P.none()):P.some(t)},Nv=function(t,e,n,r){t.bind((function(t){return(r?Ig:Bg)(t.dom,r?t.dom.length:0),e.filter(Ae).map((function(e){return function(t,e,n,r){var o=t.dom,i=e.dom,u=r?o.length:i.length;r?(Pg(o,i,!1,!r),n.setStart(i,u)):(Pg(i,o,!1,!r),n.setEnd(i,u))}(t,e,n,r)}))})).orThunk((function(){return function(t,e){return t.filter((function(t){return Pf.isBookmarkNode(t.dom)})).bind(e?Pe:Ie)}(e,r).or(e).filter(Ae).map((function(t){return function(t,e){Be(t).each((function(n){var r=t.dom;e&&Tg(n,gc(r,0))?Bg(r,0):!e&&_g(n,gc(r,r.length))&&Ig(r,r.length)}))}(t,r)}))}))},Rv=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return At(At({format:"html"},t),{set:!0,selection:!0,content:e})}(n,e),o=r;if(!r.no_events){var i=t.fire("BeforeSetContent",r);if(i.isDefaultPrevented())return void t.fire("SetContent",i);o=i}o.content=function(t,e){if("raw"!==e.format){var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,At(At({isRootContent:!0,forced_root_block:!1},o),e));return Rm({validate:t.validate},t.schema).serialize(i)}return e.content}(t,o);var u=t.selection.getRng();!function(t,e){var n=P.from(e.firstChild).map(be.fromDom),r=P.from(e.lastChild).map(be.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(Ie).filter(Ae).bind(Mv),i=r.bind(Pe).filter(Ae).bind(Mv);Nv(o,n,t,!0),Nv(i,r,t,!1),t.collapse(!1)}(u,u.createContextualFragment(o.content)),t.selection.setRng(u),Ed(t,u),o.no_events||t.fire("SetContent",o)},zv=function(t,e,n){if(t&&yt(t,e)){var r=X(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}};var Bv,Iv,Pv=function(t){return!!t.select},Lv=function(t){return!(!t||!t.ownerDocument)&&ke(be.fromDom(t.ownerDocument),be.fromDom(t))},Hv=function(t,e,n,r){var o,i,u=function(t,e){var n,r;return{selectorChangedWithUnbind:function(o,i){return n||(n={},r={},e.on("NodeChange",(function(e){var o=e.element,i=t.getParents(o,null,t.getRoot()),u={};pe.each(n,(function(e,n){pe.each(i,(function(o){if(t.is(o,n))return r[n]||(pe.each(e,(function(t){t(!0,{node:o,selector:n,parents:i})})),r[n]=e),u[n]=e,!1}))})),pe.each(r,(function(t,e){u[e]||(delete r[e],pe.each(t,(function(t){t(!1,{node:o,selector:e,parents:i})})))}))}))),n[o]||(n[o]=[]),n[o].push(i),{unbind:function(){zv(n,o,i),zv(r,o,i)}}}}}(t,r).selectorChangedWithUnbind,a=function(t,e){return Rv(r,t,e)},c=function(t){var e=l();e.collapse(!!t),f(e)},s=function(){return e.getSelection?e.getSelection():e.document.selection},l=function(){var n,u,a,c=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}},l=e.document;if(void 0!==r.bookmark&&!1===om(r)){var f=Gd(r);if(f.isSome())return f.map((function(t){return dm(r,[t])[0]})).getOr(l.createRange())}try{(n=s())&&!bn(n.anchorNode)&&(u=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange(),u=dm(r,[u])[0])}catch(t){}return u||(u=l.createRange?l.createRange():l.body.createTextRange()),u.setStart&&9===u.startContainer.nodeType&&u.collapsed&&(a=t.getRoot(),u.setStart(a,0),u.setEnd(a,0)),o&&i&&(0===c(u.START_TO_START,u,o)&&0===c(u.END_TO_END,u,o)?u=i:(o=null,i=null)),u},f=function(t,e){var n;if(function(t){return!!t&&(!!Pv(t)||Lv(t.startContainer)&&Lv(t.endContainer))}(t)){var u=Pv(t)?t:null;if(u){i=null;try{u.select()}catch(t){}}else{var a=s();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,a){i=t;try{a.removeAllRanges(),a.addRange(t)}catch(t){}!1===e&&a.extend&&(a.collapse(t.endContainer,t.endOffset),a.extend(t.startContainer,t.startOffset)),o=a.rangeCount>0?a.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!a.setBaseAndExtent||fe.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(a.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),a.anchorNode===t.startContainer&&a.focusNode===t.endContainer||a.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=s(),n=null==e?void 0:e.anchorNode,r=null==e?void 0:e.focusNode;if(!e||!n||!r||bn(n)||bn(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:c,setCursorLocation:function(e,n){var o=t.createRng();y(e)&&y(n)?(o.setStart(e,n),o.setEnd(e,n),f(o),c(!1)):(Tf(t,o,r.getBody(),!0),f(o))},getContent:function(t){return Dv(r,t)},setContent:a,getBookmark:function(t,e){return g.getBookmark(t,e)},moveToBookmark:function(t){return g.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return P.from(e).map((function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(Tf(t,o,e,!0),Tf(t,o,e,!1)),o}))}(t,e,n).each(f),e},isCollapsed:function(){var t=l(),e=s();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return a(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,u=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&u-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?fm(r.nextSibling,!0):r.parentNode,o=0===u?fm(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),l())},getSel:s,setRng:f,getRng:l,getStart:function(t){return sm(r.getBody(),l(),t)},getEnd:function(t){return lm(r.getBody(),l(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],u=t.getRoot();if(n=t.getParent(n||sm(u,e,e.collapsed),t.isBlock),r=t.getParent(r||lm(u,e,e.collapsed),t.isBlock),n&&n!==u&&i.push(n),n&&r&&n!==r){o=n;for(var a=new Kr(n,u);(o=a.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==u&&i.push(r),i}(t,l(),e,n)},normalize:function(){var e=l(),n=s();if(!(bf(n).length>1)&&_f(r)){var o=rd(t,e);return o.each((function(t){f(t,d())})),o.getOr(e)}return e},selectorChanged:function(t,e){return u(t,e),m},selectorChangedWithUnbind:u,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){return function(t,e,n){(t.inline?Od:_d)(t,e,n)}(r,t,e)},placeCaretAt:function(t,e){return f($f(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?gc.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,h.destroy()}},g=Pf(m),h=qf(m,r);return m.bookmarkManager=g,m.controlSelection=h,m},Fv=function(t,e,n){t.addNodeFilter("font",(function(t){q(t,(function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),u=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),u&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){q(e,(function(e){t.attr(e,null)}))}(t,["color","face","size"])}))}))},Vv=function(t,e){var n=bi();e.convert_fonts_to_spans&&Fv(t,n,pe.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",(function(t){q(t,(function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))}))}))}(t,n)},jv=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},Uv=function(t,e){var n;try{n=atob(e)}catch(t){return P.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return P.some(new Blob([r],{type:t}))},Wv=function(t){return 0===t.indexOf("blob:")?function(t){return new jr((function(e,n){var r=function(){n("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="blob",o.onload=function(){200===o.status?e(o.response):r()},o.onerror=r,o.send()}catch(t){r()}}))}(t):0===t.indexOf("data:")?(e=t,new jr((function(t){var n=jv(e),r=n.type,o=n.data;Uv(r,o).fold((function(){return t(new Blob([]))}),t)}))):null;var e},qv=0,Gv=function(t){return(t||"blobid")+qv++},$v=function(t,e,n,r){var o,i;if(0!==e.src.indexOf("blob:")){var u=jv(e.src),a=u.data,c=u.type;o=a,(i=t.getByData(o,c))?n({image:e,blobInfo:i}):Wv(e.src).then((function(r){i=t.create(Gv(),r,o),t.add(i),n({image:e,blobInfo:i})}),(function(t){r(t)}))}else(i=t.getByUri(e.src))?n({image:e,blobInfo:i}):Wv(e.src).then((function(r){(function(t){return new jr((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))})(r).then((function(u){o=jv(u).data,i=t.create(Gv(),r,o),t.add(i),n({image:e,blobInfo:i})}))}),(function(t){r(t)}))},Xv=function(t,e){var n={};return{findAll:function(r,o){o||(o=R);var i=X(function(t){return t?at(t.getElementsByTagName("img")):[]}(r),(function(e){var n=e.src;return!!fe.fileApi&&(!e.hasAttribute("data-mce-bogus")&&(!e.hasAttribute("data-mce-placeholder")&&(!(!n||n===fe.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e)))))})),u=W(i,(function(t){if(void 0!==n[t.src])return new jr((function(e){n[t.src].then((function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new jr((function(n,r){$v(e,t,n,r)})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r,r}));return jr.all(u)}}},Kv=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new vm("br",1)).shortEnded=!0:r.empty().append(new vm("#text",3)).value=" "},Yv=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},Jv=function(t,e,n,r){return r.isEmpty(e,n,(function(e){return function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty}(t,e)}))},Qv=function(t,e){var n=e.blob_cache,r=function(t){var r=t.attr("src");(function(t){return t.attr("src")===fe.transparentSrc||y(t.attr("data-mce-placeholder"))})(t)||function(t){return y(t.attr("data-mce-bogus"))}(t)||function(t){var e=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(t);return e?P.some({type:e[1],data:decodeURIComponent(e[2])}):P.none()}(r).filter((function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),ft(t.attributes.map,(function(t,e){n.setAttribute(e,t)})),e.images_dataimg_filter(n)}return!0}(t,e)})).bind((function(t){var e=t.type,r=t.data;return P.from(n.getByData(r,e)).orThunk((function(){return Uv(e,r).map((function(t){var e=n.create(Gv(),t,r);return n.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))};n&&t.addAttributeFilter("src",(function(t){return q(t,r)}))},Zv=pe.makeMap,tb=pe.each,eb=pe.explode,nb=pe.extend,rb=function(t,e){void 0===e&&(e=pi());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var u=function(t){var e=t.name;e in n&&((a=o[e])?a.push(t):o[e]=[t]);for(var u=r.length;u--;){var a,c=r[u].name;if(c in t.attributes.map)(a=i[c])?a.push(t):i[c]=[t]}return t},a={schema:e,addAttributeFilter:function(t,e){tb(eb(t),(function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){tb(eb(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t=[];for(var e in n)yt(n,e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:u,parse:function(a,c){var s,l,f,d,m,g,h,p,v=[];c=c||{},o={},i={};var b=nb(Zv("script,style,head,html,body,title,meta,param"),e.getBlockElements()),y=e.getNonEmptyElements(),w=e.children,x=t.validate,C=function(t){return!1===t?"":!0===t?"p":t}("forced_root_block"in c?c.forced_root_block:t.forced_root_block),S=e.getWhiteSpaceElements(),k=/^[ \t\r\n]+/,O=/[ \t\r\n]+$/,T=/[ \t\r\n]+/g,_=/^[ \t\r\n]+$/,E=yt(S,c.context)||yt(S,t.root_name),A=function(t,e){var r,i=new vm(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},D=function(t){for(var n=e.getBlockElements(),r=t.prev;r&&3===r.type;){var o=r.value.replace(O,"");if(o.length>0)return void(r.value=o);var i=r.next;if(i){if(3===i.type&&i.value.length){r=r.prev;continue}if(!n[i.name]&&"script"!==i.name&&"style"!==i.name){r=r.prev;continue}}var u=r.prev;r.remove(),r=u}},M=Om({validate:x,document:t.document,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e={};for(var n in t)"li"!==n&&"p"!==n&&(e[n]=t[n]);return e}(e.getSelfClosingElements()),cdata:function(t){p.append(A("#cdata",4)).value=t},text:function(t,e){var n;E||(t=t.replace(T," "),function(t,e){return t&&(yt(e,t.name)||"br"===t.name)}(p.lastChild,b)&&(t=t.replace(k,""))),0!==t.length&&((n=A("#text",3)).raw=!!e,p.append(n).value=t)},comment:function(t){p.append(A("#comment",8)).value=t},pi:function(t,e){p.append(A(t,7)).value=e,D(p)},doctype:function(t){p.append(A("#doctype",10)).value=t,D(p)},start:function(t,n,o){var u=x?e.getElementRule(t):{};if(u){var a=A(u.outputName||t,1);a.attributes=n,a.shortEnded=o,p.append(a);var c=w[p.name];c&&w[a.name]&&!c[a.name]&&v.push(a);for(var s=r.length;s--;){var l=r[s].name;l in n.map&&((g=i[l])?g.push(a):i[l]=[a])}b[t]&&D(a),o||(p=a),!E&&S[t]&&(E=!0)}},end:function(n){var r,o,i,u,a=x?e.getElementRule(n):{};if(a){if(b[n]&&!E){if((r=p.firstChild)&&3===r.type)if((o=r.value.replace(k,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||_.test(o))&&(r.remove(),r=i),r=i;if((r=p.lastChild)&&3===r.type)if((o=r.value.replace(O,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||_.test(o))&&(r.remove(),r=i),r=i}if(E&&S[n]&&(E=!1),a.removeEmpty&&Jv(e,y,S,p))return u=p.parent,b[p.name]?p.empty().remove():p.unwrap(),void(p=u);a.paddEmpty&&(function(t){return Yv(t,"#text")&&" "===t.firstChild.value}(p)||Jv(e,y,S,p))&&Kv(t,c,b,p),p=p.parent}}},e),N=p=new vm(c.context||t.root_name,11);if(M.parse(a,c.format),x&&v.length&&(c.context?c.invalid=!0:function(t){for(var n=Zv("tr,td,th,tbody,thead,tfoot,table"),r=e.getNonEmptyElements(),o=e.getWhiteSpaceElements(),i=e.getTextBlockElements(),a=e.getSpecialElements(),c=function(t,n){if(void 0===n&&(n=t.parent),a[t.name])t.empty().remove();else{for(var r=0,o=t.children();r<o.length;r++){var i=o[r];e.isValidChild(n.name,i.name)||c(i,n)}t.unwrap()}},s=0;s<t.length;s++){var l=t[s],f=void 0,d=void 0,m=void 0;if(l.parent&&!l.fixed)if(i[l.name]&&"li"===l.parent.name){for(var g=l.next;g&&i[g.name];)g.name="li",g.fixed=!0,l.parent.insert(g,l.parent),g=g.next;l.unwrap()}else{var h=[l];for(f=l.parent;f&&!e.isValidChild(f.name,l.name)&&!n[f.name];f=f.parent)h.push(f);if(f&&h.length>1)if(e.isValidChild(f.name,l.name)){h.reverse();for(var p=d=u(h[0].clone()),v=0;v<h.length-1;v++){e.isValidChild(p.name,h[v].name)?(m=u(h[v].clone()),p.append(m)):m=p;for(var b=h[v].firstChild;b&&b!==h[v+1];){var y=b.next;m.append(b),b=y}p=m}Jv(e,r,o,d)?f.insert(l,h[0],!0):(f.insert(d,h[0],!0),f.insert(l,d)),f=h[0],(Jv(e,r,o,f)||Yv(f,"br"))&&f.empty().remove()}else c(l);else if(l.parent){if("li"===l.name){if((g=l.prev)&&("ul"===g.name||"ol"===g.name)){g.append(l);continue}if((g=l.next)&&("ul"===g.name||"ol"===g.name)){g.insert(l,g.firstChild,!0);continue}l.wrap(u(new vm("ul",1)));continue}e.isValidChild(l.parent.name,"div")&&e.isValidChild("div",l.name)?l.wrap(u(new vm("div",1))):c(l)}}}}(v)),C&&("body"===N.name||c.isRootContent)&&function(){var n=N.firstChild,r=null,o=function(t){t&&((n=t.firstChild)&&3===n.type&&(n.value=n.value.replace(k,"")),(n=t.lastChild)&&3===n.type&&(n.value=n.value.replace(O,"")))};if(e.isValidChild(N.name,C.toLowerCase())){for(;n;){var i=n.next;3===n.type||1===n.type&&"p"!==n.name&&!b[n.name]&&!n.attr("data-mce-type")?r?r.append(n):((r=A(C,1)).attr(t.forced_root_block_attrs),N.insert(r,n),r.append(n)):(o(r),r=null),n=i}o(r)}}(),!c.invalid){for(h in o)if(yt(o,h)){for(g=n[h],d=(s=o[h]).length;d--;)s[d].parent||s.splice(d,1);for(l=0,f=g.length;l<f;l++)g[l](s,h,c)}for(l=0,f=r.length;l<f;l++)if((g=r[l]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c)}}return N}};return function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,r,o){var i,u,a,c,s,l,f,d,m=t.length,g=pe.extend({},n.getBlockElements()),h=n.getNonEmptyElements(),p=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(a=(u=t[i]).parent,g[u.parent.name]&&u===a.lastChild){for(s=u.prev;s;){if("span"!==(l=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===l&&(u=null);break}s=s.prev}u&&(u.remove(),Jv(n,h,p,a)&&(f=n.getElementRule(a.name))&&(f.removeEmpty?a.remove():f.paddEmpty&&Kv(e,o,g,a)))}else{for(c=u;a&&a.firstChild===c&&a.lastChild===c&&(c=a,!g[a.name]);)a=a.parent;c===a&&!0!==e.padd_empty_with_br&&((d=new vm("#text",3)).value=" ",u.replace(d))}})),t.addAttributeFilter("href",(function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(n=i.attr("rel"),r=void 0,r=n?pe.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(t){return t.split(" ").filter((function(t){return t.length>0})).concat(["noopener"]).sort().join(" ")}(r)))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new vm("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}})),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e=n.getValidClasses(),r=t.length;r--;){for(var o=t[r],i=o.attr("class").split(" "),u="",a=0;a<i.length;a++){var c=i[a],s=!1,l=e["*"];l&&l[c]&&(s=!0),l=e[o.name],!s&&l&&l[c]&&(s=!0),s&&(u&&(u+=" "),u+=c)}u.length||(u=null),o.attr("class",u)}})),Qv(t,e)}(a,t),function(t,e){e.inline_styles&&Vv(t,e)}(a,t),a},ob=function(t,e,n){return function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events}(t,n)?function(t,e,n){var r,o=t.dom,i=e.cloneNode(!0),u=document.implementation;if(u.createHTMLDocument){var a=u.createHTMLDocument("");pe.each("BODY"===i.nodeName?i.childNodes:[i],(function(t){a.body.appendChild(a.importNode(t,!0))})),i="BODY"!==i.nodeName?a.body.firstChild:a.body,r=o.doc,o.doc=a}return function(t,e){t.fire("PreProcess",e)}(t,At(At({},n),{node:i})),r&&(o.doc=r),i}(t,e,n):e},ib=function(t,e,n){-1===pe.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))},ub=function(t,e,n,r,o){return function(t,e,n){return!e.no_events&&t?function(t,e){return t.fire("PostProcess",e)}(t,At(At({},e),{content:n})).content:n}(t,o,function(t,e,n){return Rm(t,e).serialize(n)}(e,n,r))},ab=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:ea.DOM,o=e&&e.schema?e.schema:pi(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=rb(t,o);!function(t,e,n){t.addAttributeFilter("data-mce-tabindex",(function(t,e){for(var n=t.length;n--;){var r=t[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(e,null)}})),t.addAttributeFilter("src,href,style",(function(t,r){for(var o="data-mce-"+r,i=e.url_converter,u=e.url_converter_scope,a=t.length;a--;){var c=t[a],s=c.attr(o);void 0!==s?(c.attr(r,s.length>0?s:null),c.attr(o,null)):(s=c.attr(r),"style"===r?s=n.serializeStyle(n.parseStyle(s),c.name):i&&(s=i.call(u,s,r,c.name)),c.attr(r,s.length>0?s:null))}})),t.addAttributeFilter("class",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("class");r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null))}})),t.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r=t.length;r--;){var o=t[r];if("bookmark"===o.attr("data-mce-type")&&!n.cleanup)P.from(o.firstChild).exists((function(t){return!co(t.value)}))?o.unwrap():o.remove()}})),t.addNodeFilter("noscript",(function(t){for(var e=t.length;e--;){var n=t[e].firstChild;n&&(n.value=ui.decode(n.value))}})),t.addNodeFilter("script,style",(function(t,n){for(var r=function(t){return t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")},o=t.length;o--;){var i=t[o],u=i.firstChild?i.firstChild.value:"";if("script"===n){var a=i.attr("type");a&&i.attr("type","mce-no/type"===a?null:a.replace(/^mce\-/,"")),"xhtml"===e.element_format&&u.length>0&&(i.firstChild.value="// <![CDATA[\n"+r(u)+"\n// ]]>")}else"xhtml"===e.element_format&&u.length>0&&(i.firstChild.value="\x3c!--\n"+r(u)+"\n--\x3e")}})),t.addNodeFilter("#comment",(function(t){for(var r=t.length;r--;){var o=t[r];e.preserve_cdata&&0===o.value.indexOf("[CDATA[")?(o.name="#cdata",o.type=4,o.value=n.decode(o.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===o.value.indexOf("mce:protected ")&&(o.name="#text",o.type=3,o.raw=!0,o.value=unescape(o.value).substr(14))}})),t.addNodeFilter("xml:namespace,input",(function(t,e){for(var n=t.length;n--;){var r=t[n];7===r.type?r.remove():1===r.type&&("input"!==e||r.attr("type")||r.attr("type","text"))}})),t.addAttributeFilter("data-mce-type",(function(e){q(e,(function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())}))})),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}))}(i,t,r);return{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,u){void 0===u&&(u={});var a=At({format:"html"},u),c=ob(e,n,a),s=function(t,e,n){var r=so(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||uo(be.fromDom(e))?r:pe.trim(r)}(r,c,a),l=function(t,e,n){var r=n.selection?At({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=t.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(o),o}(i,s,a);return"tree"===a.format?l:ub(e,t,o,l,a)},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:E(ib,i,n),getTempAttrs:O(n),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},cb=function(t,e){var n=ab(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},sb=function(t,e){return void 0===e&&(e={}),function(t,e,n){return Ev(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")},lb=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return Ev(t).editor.setContent(e,n)}(t,e,n)},fb=ea.DOM,db=function(t){return P.from(t).each((function(t){return t.destroy()}))},mb=function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&fb.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){fb.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),fb.remove(t.getContainer()),db(e),db(n),t.destroy()}},gb=function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),db(n),db(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),fb.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())},hb=(Bv=function(t,e){return m(t)&&m(e)?hb(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)yt(o,i)&&(n[i]=Bv(n[i],o[i]))}return n}),pb=ne().deviceType,vb=pb.isTouch(),bb=pb.isPhone(),yb=pb.isTablet(),wb=["lists","autolink","autosave"],xb={table_grid:!1,object_resizing:!1,resize:!1},Cb=function(t){var e=g(t)?t.join(" "):t,n=W(d(e)?e.split(" "):[],Ht);return X(n,(function(t){return t.length>0}))},Sb=function(t,e){var n,r,o=(r={},ht(e,(function(e,n){return j(t,n)}),gt(n={}),gt(r)),{t:n,f:r});return function(t,e){return{sections:O(t),settings:O(e)}}(o.t,o.f)},kb=function(t,e){return yt(t.sections(),e)},Ob=function(t,e){return bt(t,"toolbar_mode").orThunk((function(){return bt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},Tb=function(t,e){var n={resize:!1,toolbar_mode:Ob(t,"scrolling"),toolbar_sticky:!1};return At(At(At({},xb),n),e?{menubar:!1}:{})},_b=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?pe.extend({},t.external_plugins,n):n},Eb=function(t,e,n,r){return t&&function(t,e,n){var r=t.sections();return kb(t,e)&&r[e].theme===n}(e,"mobile","mobile")?X(r,E(j,wb)):t&&kb(e,"mobile")?r:n},Ab=function(t,e,n,r){var o=Cb(n.forced_plugins),i=Cb(r.plugins),u=function(t,e){return kb(t,e)?t.sections()[e]:{}}(e,"mobile"),a=u.plugins?Cb(u.plugins):i,c=function(t,e){return[].concat(Cb(t)).concat(Cb(e))}(o,Eb(t,e,i,a));if(fe.browser.isIE()&&j(c,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return pe.extend(r,{plugins:c.join(" ")})},Db=function(t,e,n,r,o){var i=t?{mobile:Tb(o.mobile||{},e)}:{},u=Sb(["mobile"],hb(i,o)),a=pe.extend(n,r,u.settings(),function(t,e){return t&&kb(e,"mobile")}(t,u)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=bt(r,e).getOr({});return pe.extend({},n,o)}(u,"mobile"):{},{validate:!0,external_plugins:_b(r,u.settings())});return Ab(t,u,r,a)},Mb=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:Ob(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return At(At({},i),r?xb:{})}(o,e,n,vb,t);return Db(bb||yb,bb,i,r,o)},Nb=function(t,e,n){return P.from(e.settings[n]).filter(t)},Rb=function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?q(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),(function(t){var n=t.split("=");n.length>1?e[pe.trim(n[0])]=pe.trim(n[1]):e[pe.trim(n[0])]=pe.trim(n[0])})):e=t,e}(i):"string"===r?Nb(d,t,e).getOr(n):"number"===r?Nb(x,t,e).getOr(n):"boolean"===r?Nb(p,t,e).getOr(n):"object"===r?Nb(m,t,e).getOr(n):"array"===r?Nb(g,t,e).getOr(n):"string[]"===r?Nb((o=d,function(t){return g(t)&&et(t,o)}),t,e).getOr(n):"function"===r?Nb(w,t,e).getOr(n):i},zb=(Iv={},{add:function(t,e){Iv[t]=e},get:function(t){return Iv[t]?Iv[t]:{icons:{}}},has:function(t){return yt(Iv,t)}}),Bb=function(t,e){return e.dom[t]},Ib=function(t,e){return parseInt($n(e,t),10)},Pb=E(Bb,"clientWidth"),Lb=E(Bb,"clientHeight"),Hb=E(Ib,"margin-top"),Fb=E(Ib,"margin-left"),Vb=function(t,e,n){var r,o=be.fromDom(t.getBody()),i=t.inline?o:(r=o,be.fromDom(Re(r).dom.documentElement)),u=function(t,e,n,r){var o=function(t){return t.dom.getBoundingClientRect()}(e);return{x:n-(t?o.left+e.dom.clientLeft+Fb(e):0),y:r-(t?o.top+e.dom.clientTop+Hb(e):0)}}(t.inline,i,e,n);return function(t,e,n){var r=Pb(t),o=Lb(t);return e>=0&&n>=0&&e<=r&&n<=o}(i,u.x,u.y)},jb=function(t){var e,n=t.inline?t.getBody():t.getContentAreaContainer();return(e=n,P.from(e).map(be.fromDom)).map(an).getOr(!1)},Ub=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},r=function(){return P.from(e[0])},o=function(){e.length>0&&n().reposition(e)},i=function(t){Z(e,(function(e){return e===t})).each((function(t){e.splice(t,1)}))},u=function(u,a){if(void 0===a&&(a=!0),!t.removed&&jb(t))return a&&t.fire("BeforeOpenNotification",{notification:u}),Q(e,(function(t){return e=n().getArgs(t),r=u,!(e.type!==r.type||e.text!==r.text||e.progressBar||e.timeout||r.progressBar||r.timeout);var e,r})).getOrThunk((function(){t.editorManager.setActive(t);var a=n().open(u,(function(){i(a),o(),r().fold((function(){return t.focus()}),(function(t){return be.fromDom(t.getEl()).dom.focus()}))}));return function(t){e.push(t)}(a),o(),t.fire("OpenNotification",{notification:At({},a)}),a}))},a=O(e);return function(t){t.on("SkinLoaded",(function(){var e=function(t){return t.getParam("service_message")}(t);e&&u({text:e,type:"warning",timeout:0},!1)})),t.on("ResizeEditor ResizeWindow NodeChange",(function(){Gr.requestAnimationFrame(o)})),t.on("remove",(function(){q(e.slice(),(function(t){n().close(t)}))}))}(t),{open:u,close:function(){r().each((function(t){n().close(t),i(t),o()}))},getNotifications:a}},Wb=fa.PluginManager,qb=fa.ThemeManager;var Gb=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e?e.apply(t,n):void 0}},o=function(n){e.push(n),function(e){t.fire("OpenWindow",{dialog:e})}(n)},i=function(n){!function(e){t.fire("CloseWindow",{dialog:e})}(n),0===(e=X(e,(function(t){return t!==n}))).length&&t.focus()},u=function(e){t.editorManager.setActive(t),qd(t);var n=e();return o(n),n};return t.on("remove",(function(){q(e,(function(t){n().close(t)}))})),{open:function(t,e){return u((function(){return n().open(t,e,i)}))},openUrl:function(t){return u((function(){return n().openUrl(t,i)}))},alert:function(t,e,o){var i=n();i.alert(t,r(o||i,e))},confirm:function(t,e,o){var i=n();i.confirm(t,r(o||i,e))},close:function(){P.from(e[e.length-1]).each((function(t){n().close(t),i(t)}))}}},$b=function(t,e){t.notificationManager.open({type:"error",text:e})},Xb=function(t,e){t._skinLoaded?$b(t,e):t.on("SkinLoaded",(function(){$b(t,e)}))},Kb=function(t,e,n){Ff(t,e,{message:n}),console.error(n)},Yb=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},Jb=function(t,e,n){Kb(t,"PluginLoadError",Yb("plugin",e,n))},Qb=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,Dt([t],e)):r.log.apply(r,Dt([t],e)))},Zb=function(t){return ty(t,function(t){var e=t.getParam("content_css");return d(e)?W(e.split(","),Ht):g(e)?e:!1===e||t.inline?[]:["default"]}(t))},ty=function(t,e){var n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return W(e,(function(e){return function(t){return/^[a-z0-9\-]+$/i.test(t)}(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)}))},ey=function(t){t.contentCSS=t.contentCSS.concat(Zb(t),function(t){return ty(t,ts(t))}(t))},ny=function(){var t={},e=function(t,e){return{status:t,resultUri:e}},n=function(e){return e in t};return{hasBlobUri:n,getResultUri:function(e){var n=t[e];return n?n.resultUri:null},isPending:function(e){return!!n(e)&&1===t[e].status},isUploaded:function(e){return!!n(e)&&2===t[e].status},markPending:function(n){t[n]=e(1,null)},markUploaded:function(n,r){t[n]=e(2,r)},removeFailed:function(e){delete t[e]},destroy:function(){t={}}}},ry=0,oy=function(t){return t+ry+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e},iy=function(t,e){var n={},r=function(t,n,r,o){var i=new XMLHttpRequest;i.open("POST",e.url),i.withCredentials=e.credentials,i.upload.onprogress=function(t){o(t.loaded/t.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else{var t,o,u=JSON.parse(i.responseText);if(u&&"string"==typeof u.location)n((t=e.basePath,o=u.location,t?t.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o));else r("Invalid JSON: "+i.responseText)}};var u=new FormData;u.append("file",t.blob(),t.filename()),i.send(u)},o=function(t,e){return{url:e,blobInfo:t,status:!0}},i=function(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}},u=function(t,e){pe.each(n[t],(function(t){t(e)})),delete n[t]},a=function(r,a){return r=pe.grep(r,(function(e){return!t.isUploaded(e.blobUri())})),jr.all(pe.map(r,(function(r){return t.isPending(r.blobUri())?function(t){var e=t.blobUri();return new jr((function(t){n[e]=n[e]||[],n[e].push(t)}))}(r):function(e,n,r){return t.markPending(e.blobUri()),new jr((function(a){var c;try{var s=function(){c&&(c.close(),C)};n(e,(function(n){s(),t.markUploaded(e.blobUri(),n),u(e.blobUri(),o(e,n)),a(o(e,n))}),(function(n,r){var o=r||{};s(),t.removeFailed(e.blobUri()),u(e.blobUri(),i(e,n,o)),a(i(e,n,o))}),(function(t){t<0||t>100||P.from(c).orThunk((function(){return P.from(r).map(D)})).each((function(e){c=e,e.progressBar.value(t)}))}))}catch(t){a(i(e,t.message,{}))}}))}(r,e.handler,a)})))};return!1===w(e.handler)&&(e.handler=r),{upload:function(t,n){return e.url||e.handler!==r?a(t,n):new jr((function(t){t([])}))}}},uy=function(t){return function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}},ay=function(t,e){return iy(e,{url:Gc(t),basePath:$c(t),credentials:Xc(t),handler:Kc(t)})},cy=function(t){var e,n,r=function(){var t=[],e=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,n=t.id||oy("blobid"),r=t.name||n,o=t.blob;return{id:O(n),name:O(r),filename:O(t.filename||r+"."+(e=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[e.toLowerCase()]||"dat")),blob:O(o),base64:O(t.base64),blobUri:O(t.blobUri||URL.createObjectURL(o)),uri:O(t.uri)}},n=function(e){return Q(t,e).getOrUndefined()},r=function(t){return n((function(e){return e.id()===t}))};return{create:function(t,n,r,o,i){if(d(t))return e({id:t,name:o,filename:i,blob:n,base64:r});if(m(t))return e(t);throw new Error("Unknown input type")},add:function(e){r(e.id())||t.push(e)},get:r,getByUri:function(t){return n((function(e){return e.blobUri()===t}))},getByData:function(t,e){return n((function(n){return n.base64()===t&&n.blob().type===e}))},findFirst:n,removeByUri:function(e){t=X(t,(function(t){return t.blobUri()!==e||(URL.revokeObjectURL(t.blobUri()),!1)}))},destroy:function(){q(t,(function(t){URL.revokeObjectURL(t.blobUri())})),t=[]}}}(),o=ny(),i=[],u=function(t){var e=ua(null);t.on("change AddUndo",(function(t){e.set(At({},t.level))}));return{fireIfChanged:function(){var n=t.undoManager.data;ut(n).filter((function(t){return!xv(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:ot(n,n.length-2).getOrNull()})}))}}}(t),a=function(e){return function(n){return t.selection?e(n):[]}},c=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},s=function(t,e,n){var r='src="'+n+'"'+(n===fe.transparentSrc?' data-mce-placeholder="1"':"");return t=c(t,'src="'+e+'"',r),t=c(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},l=function(e,n){q(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=W(t.fragments,(function(t){return s(t,e,n)})):t.content=s(t.content,e,n)}))},f=function(n){return e||(e=ay(t,o)),p().then(a((function(o){var i=W(o,(function(t){return t.blobInfo}));return e.upload(i,uy(t)).then(a((function(e){var i=[],a=W(e,(function(e,n){var u=o[n].blobInfo,a=o[n].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(r.removeByUri(a.src),Tv(t)||function(e,n){var r,o=t.convertURL(n,"src");l(e.src,n),t.$(e).attr({src:Wc(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(a,e.url)):e.error&&(e.error.options.remove&&(l(a.getAttribute("src"),fe.transparentSrc),i.push(a)),function(t,e){Xb(t,la.translate(["Failed to upload image: {0}",e]))}(t,e.error.message)),{element:a,status:e.status,uploadUri:e.url,blobInfo:u}}));return a.length>0&&u.fireIfChanged(),i.length>0&&(Tv(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact((function(){q(i,(function(e){t.dom.remove(e),r.removeByUri(e.src)}))}))),n&&n(a),a})))})))},g=function(e){if(Uc(t))return f(e)},h=function(e){return!1!==et(i,(function(t){return t(e)}))&&(0!==e.getAttribute("src").indexOf("data:")||function(t){return t.getParam("images_dataimg_filter",R,"function")}(t)(e))},p=function(){return n||(n=Xv(o,r)),n.findAll(t.getBody(),h).then(a((function(e){return e=X(e,(function(e){return"string"!=typeof e||(Xb(t,e),!1)})),Tv(t)||q(e,(function(t){l(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))},v=function(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var i=o.getResultUri(n);if(i)return'src="'+i+'"';var u=r.getByUri(n);return u||(u=Y(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null)),u?'src="data:'+u.blob().type+";base64,"+u.base64()+'"':e}))};return t.on("SetContent",(function(){Uc(t)?g():p()})),t.on("RawSaveContent",(function(t){t.content=v(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=v(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){q(t,(function(t){var e=t.attr("src");if(!r.getByUri(e)){var n=o.getResultUri(e);n&&t.attr("src",n)}}))}))})),{blobCache:r,addFilter:function(t){i.push(t)},uploadImages:f,uploadImagesAuto:g,scanForImages:p,destroy:function(){r.destroy(),o.destroy(),n=e=null}}},sy=function(t){var e={},n=function(t,r){t&&(d(t)?(g(r)||(r=[r]),q(r,(function(t){v(t.deep)&&(t.deep=!Ql(t)),v(t.split)&&(t.split=!Ql(t)||Zl(t)),v(t.remove)&&Ql(t)&&!Zl(t)&&(t.remove="none"),Ql(t)&&Zl(t)&&(t.mixed=!0,t.block_expand=!0),d(t.classes)&&(t.classes=t.classes.split(/\s+/))})),e[t]=r):ft(t,(function(t,e){n(e,t)})))};return n(function(t){var e={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(t,e,n){return yn(t)&&t.hasAttribute("href")},onformat:function(e,n,r){pe.each(r,(function(n,r){t.setAttrib(e,r,n)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(t){var e;return null!==(e=null==t?void 0:t.customValue)&&void 0!==e?e:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return pe.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(function(t){e[t]={block:t,remove:"all"}})),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return y(t)?e[t]:e},has:function(t){return yt(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}},ly=pe.each,fy=ea.DOM,dy=function(t,e){var n,r,o,i=e&&e.schema||pi({}),u=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=fy.create(r.name);return function(t,e){e.classes.length&&fy.addClass(t,e.classes.join(" ")),fy.setAttribs(t,e.attrs)}(e,r),e},a=function(t,e,n){var r,o,c=e.length>0&&e[0],s=c&&c.name,l=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==pe.inArray(o,e)?e:o[0])}(t,s);if(l)s===l?(o=e[0],e=e.slice(1)):o=l;else if(c)o=e[0],e=e.slice(1);else if(!n)return t;return o&&(r=u(o)).appendChild(t),n&&(r||(r=fy.create("div")).appendChild(t),pe.each(n,(function(e){var n=u(e);r.insertBefore(n,t)}))),a(r,e,o&&o.siblings)};return t&&t.length?(r=t[0],n=u(r),(o=fy.create("div")).appendChild(a(n,t.slice(1),r.siblings)),o):""},my=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=pe.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==pe.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var u=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);u&&(n.attrs[u[1]]=u[2])}return""}))),n.name=e||"div",n},gy=function(t,e){var n,r,o,i="",u=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return d(e)?e:""}(t);if(""===u)return"";var a=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var c=bt(e,"preview");if(Pn(c,!1))return"";u=c.getOr(u)}n=e.block||e.inline||"span";var s,l=(s=e.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),pe.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=pe.map(t.split(/(?:~\+|~|\+)/),my),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=dy(l,t)):r=dy([n],t);var f=fy.select(n,r)[0]||r.firstChild;return ly(e.styles,(function(t,e){var n=a(t);n&&fy.setStyle(f,e,n)})),ly(e.attributes,(function(t,e){var n=a(t);n&&fy.setAttrib(f,e,n)})),ly(e.classes,(function(t){var e=a(t);fy.hasClass(f,e)||fy.addClass(f,e)})),t.fire("PreviewFormats"),fy.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=fy.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,ly(u.split(" "),(function(e){var n=fy.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=fy.getStyle(t.getBody(),e,!0),"#ffffff"===fy.toHex(n).toLowerCase())||"color"===e&&"#000000"===fy.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}})),t.fire("AfterPreviewFormats"),fy.remove(r),i},hy=function(t){var e=sy(t),n=ua(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),ap(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){Av(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){Av(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){Av(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:function(e,n,r,o){return function(t,e,n,r,o){return Av(t).formatter.match(e,n,r,o)}(t,e,n,r,o)},closest:function(e){return function(t,e){return Av(t).formatter.closest(e)}(t,e)},matchAll:function(e,n){return function(t,e,n){return Av(t).formatter.matchAll(e,n)}(t,e,n)},matchNode:function(e,n,r,o){return function(t,e,n,r,o){return Av(t).formatter.matchNode(e,n,r,o)}(t,e,n,r,o)},canApply:function(e){return function(t,e){return Av(t).formatter.canApply(e)}(t,e)},formatChanged:function(e,r,o,i){return function(t,e,n,r,o,i){return Av(t).formatter.formatChanged(e,n,r,o,i)}(t,n,e,r,o,i)},getCssText:E(gy,t)}},py=function(t){switch(t.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return!0;default:return!1}},vy=function(t){var e=da(),n=ua(0),r=ua(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){Av(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,u){return function(t,e,n,r,o,i,u){return Av(t).undoManager.add(e,n,r,o,i,u)}(t,o,r,n,e,i,u)},undo:function(){return function(t,e,n,r){return Av(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return Av(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){Av(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){Av(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return Av(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return Av(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return Av(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){Av(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){Av(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return Tv(t)||function(t,e,n){var r=ua(!1),o=function(t){Sv(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command;py(r)||(kv(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command;py(e)||o(t)})),t.on("ObjectResizeStart cut",(function(){e.beforeChange()})),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===xv(vv(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))})),t.on("keydown",(function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var u=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||u||(e.beforeChange(),Sv(e,!0,n),e.add({},t),r.set(!0))}})),t.on("mousedown",(function(t){e.typing&&o(t)}));t.on("input",(function(t){t.inputType&&("insertReplacementText"===t.inputType||function(t){return"insertText"===t.inputType&&null===t.data}(t)||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)})),t.on("AddUndo Undo Redo ClearUndos",(function(e){e.isDefaultPrevented()||t.nodeChanged()}))}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},by=[9,27,Uf.HOME,Uf.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Uf.DOWN,Uf.UP,Uf.LEFT,Uf.RIGHT].concat(fe.browser.isFirefox()?[224]:[]),yy=function(t){return"keydown"===t.type||"keyup"===t.type},wy=function(t){var e=t.keyCode;return e===Uf.BACKSPACE||e===Uf.DELETE},xy=function(t){var e=t.dom,n=Vc(t),r=function(t){return t.getParam("placeholder",Lc.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,u){if(!function(t){if(yy(t)){var e=t.keyCode;return!wy(t)&&(Uf.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||j(by,e))}return!1}(i)){var a=t.getBody(),c=!function(t){return yy(t)&&!(wy(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(jo(be.fromDom(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,a,n);(""!==e.getAttrib(a,"data-mce-placeholder")!==c||u)&&(e.setAttrib(a,"data-mce-placeholder",c?r:null),e.setAttrib(a,"aria-placeholder",c?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,c),t.on(c?"keydown":"keyup",o),t.off(c?"keyup":"keydown",o))}};r&&t.on("init",(function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",(function(e){return Gr.setEditorTimeout(t,(function(){return o(e)}))}))}))},Cy=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Sy=function(t,e){return we(be.fromDom(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},ky=function(t){return"rtl"===ea.DOM.getStyle(t,"direction",!0)||(e=t.textContent,Cy.test(e));var e},Oy=function(t,e,n){var r=function(t,e,n){return X(ea.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return P.from(r[r.length-1])},Ty=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?go(n)?_n(n.nextSibling)?gc(n.nextSibling,0):gc.after(n):vo(e)?gc(n,r+1):e:go(n)?_n(n.previousSibling)?gc(n.previousSibling,n.previousSibling.data.length):gc.before(n):bo(e)?gc(n,r-1):e},_y=E(Ty,!0),Ey=E(Ty,!1),Ay=function(t){return eo(t)||ro(t)},Dy=function(t,e){return ke(t,e)?Pr(e,Ay,function(t){return function(e){return Ce(t,be.fromDom(e.dom.parentNode))}}(t)):P.none()},My=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},Ny=function(t,e){return{from:t,to:e}},Ry=function(t,e){var n=be.fromDom(t),r=be.fromDom(e.container());return Dy(n,r).map((function(t){return function(t,e){return{block:t,position:e}}(t,e)}))},zy=function(t,e,n){var r=Ry(t,gc.fromRangeStart(n)),o=r.bind((function(n){return gl(e,t,n.position).bind((function(n){return Ry(t,n).map((function(n){return function(t,e,n){return Mn(n.position.getNode())&&!1===jo(n.block)?vl(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?gl(e,t,r).bind((function(e){return Ry(t,e)})):P.some(n)})).getOr(n):n}(t,e,n)}))}))}));return Ln(r,o,Ny).filter((function(t){return function(t){return!1===Ce(t.from.block,t.to.block)}(t)&&function(t){return Be(t.from.block).bind((function(e){return Be(t.to.block).filter((function(t){return Ce(e,t)}))})).isSome()}(t)&&function(t){return!1===zn(t.from.block.dom)&&!1===zn(t.to.block.dom)}(t)}))},By=function(t){var e=Fe(t);return Z(e,Qr).fold(O(e),(function(t){return e.slice(0,t)}))},Iy=function(t){var e=By(t);return q(e,on),e},Py=function(t,e){var n=ig(e,t);return Q(n.reverse(),(function(t){return jo(t)})).each(on)},Ly=function(t,e,n,r){if(jo(n))return eg(n),wl(n.dom);0===X(Le(r),(function(t){return!jo(t)})).length&&jo(e)&&Qe(r,be.fromTag("br"));var o=yl(n.dom,gc.before(r.dom));return q(Iy(e),(function(t){Qe(r,t)})),Py(t,e),o},Hy=function(t,e,n){if(jo(n))return on(n),jo(e)&&eg(e),wl(e.dom);var r=xl(n.dom);return q(Iy(e),(function(t){en(n,t)})),Py(t,e),r},Fy=function(t,e){return ke(e,t)?function(t,e){var n=ig(e,t);return P.from(n[n.length-1])}(e,t):P.none()},Vy=function(t,e){vl(t,e.dom).map((function(t){return t.getNode()})).map(be.fromDom).filter(to).each(on)},jy=function(t,e,n){return Vy(!0,e),Vy(!1,n),Fy(e,n).fold(E(Hy,t,e,n),E(Ly,t,e,n))},Uy=function(t,e,n,r){return e?jy(t,r,n):jy(t,n,r)},Wy=function(t,e){var n=be.fromDom(t.getBody()),r=function(t,e,n){return n.collapsed?zy(t,e,n):P.none()}(n.dom,e,t.selection.getRng()).bind((function(t){return Uy(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},qy=function(t,e){var n=be.fromDom(e),r=E(Ce,t);return Ir(n,io,r).isSome()},Gy=function(t,e){var n=yl(t.dom,gc.fromRangeStart(e)).isNone(),r=bl(t.dom,gc.fromRangeEnd(e)).isNone();return!function(t,e){return qy(t,e.startContainer)||qy(t,e.endContainer)}(t,e)&&n&&r},$y=function(t){var e=be.fromDom(t.getBody()),n=t.selection.getRng();return Gy(e,n)?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Ln(Dy(t,be.fromDom(n.startContainer)),Dy(t,be.fromDom(n.endContainer)),(function(r,o){return!1===Ce(r,o)&&(n.deleteContents(),Uy(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)}(e,t.selection)},Xy=function(t,e){return!t.selection.isCollapsed()&&$y(t)},Ky=Rn,Yy=zn,Jy=function(t,e,n,r,o){return P.from(e._selectionOverrides.showCaret(t,n,r,o))},Qy=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?P.none():P.some(function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e))},Zy=function(t,e,n){var r=Gs(1,t.getBody(),e),o=gc.fromRangeStart(r),i=o.getNode();if(Os(i))return Jy(1,t,i,!o.isAtEnd(),!1);var u=o.getNode(!0);if(Os(u))return Jy(1,t,u,!1,!1);var a=t.dom.getParent(o.getNode(),(function(t){return Yy(t)||Ky(t)}));return Os(a)?Jy(1,t,a,!1,n):P.none()},tw=function(t,e,n){return e.collapsed?Zy(t,e,n).getOr(e):e},ew=function(t){return Qm(t)||Xm(t)},nw=function(t){return Zm(t)||Km(t)},rw=function(t,e,n,r,o,i){return Jy(r,t,i.getNode(!o),o,!0).each((function(n){if(e.collapsed){var r=e.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()}else e.deleteContents();t.selection.setRng(n)})),function(t,e){_n(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},ow=function(t,e){return function(t,e){var n=t.selection.getRng();if(!_n(n.commonAncestorContainer))return!1;var r=e?hc.Forwards:hc.Backwards,o=sl(t.getBody()),i=E(Ys,e?o.next:o.prev),u=e?ew:nw,a=Xs(r,t.getBody(),n),c=Ty(e,i(a));if(!c||!Js(a,c))return!1;if(u(c))return rw(t,n,a.getNode(),r,e,c);var s=i(c);return!!(s&&u(s)&&Js(c,s))&&rw(t,n,a.getNode(),r,e,s)}(t,e)},iw=mr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),uw=function(t,e,n,r){var o=r.getNode(!1===e);return Dy(be.fromDom(t),be.fromDom(n.getNode())).map((function(t){return jo(t)?iw.remove(t.dom):iw.moveToElement(o)})).orThunk((function(){return P.some(iw.moveToElement(o))}))},aw=function(t,e,n){return gl(e,t,n).bind((function(r){return o=r.getNode(),io(be.fromDom(o))||ro(be.fromDom(o))?P.none():function(t,e,n,r){var o=function(e){return Zr(be.fromDom(e))&&!Hs(n,r,t)};return $s(!e,n).fold((function(){return $s(e,r).fold(N,o)}),o)}(t,e,n,r)?P.none():e&&zn(r.getNode())?uw(t,e,n,r):!1===e&&zn(r.getNode(!0))?uw(t,e,n,r):e&&Zm(n)?P.some(iw.moveToPosition(r)):!1===e&&Qm(n)?P.some(iw.moveToPosition(r)):P.none();var o}))},cw=function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return yn(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&zn(e.nextSibling)?P.some(iw.moveToElement(e.nextSibling)):!1===t&&zn(e.previousSibling)?P.some(iw.moveToElement(e.previousSibling)):P.none()}(e,n.getNode(!1===e)).fold((function(){return aw(t,e,n)}),P.some):aw(t,e,n).bind((function(e){return function(t,e,n){return n.fold((function(t){return P.some(iw.remove(t))}),(function(t){return P.some(iw.moveToElement(t))}),(function(n){return Hs(e,n,t)?P.none():P.some(iw.moveToPosition(n))}))}(t,n,e)}))},sw=function(t,e){return P.from(Lf(t.getBody(),e))},lw=function(t,e){var n=t.selection.getNode();return sw(t,n).filter(zn).fold((function(){return function(t,e,n){var r=Gs(e?1:-1,t,n),o=gc.fromRangeStart(r),i=be.fromDom(t);return!1===e&&Zm(o)?P.some(iw.remove(o.getNode(!0))):e&&Qm(o)?P.some(iw.remove(o.getNode())):!1===e&&Qm(o)&&vg(i,o)?bg(i,o).map((function(t){return iw.remove(t.getNode())})):e&&Zm(o)&&pg(i,o)?yg(i,o).map((function(t){return iw.remove(t.getNode())})):cw(t,e,o)}(t.getBody(),e,t.selection.getRng()).exists((function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),Xg(t,e,be.fromDom(n)),!0}}(t,e),function(t,e){return function(n){var r=e?gc.before(n):gc.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))}))}),R)},fw=function(t,e){var n=t.selection.getNode();return!(!zn(n)||Bn(n))&&sw(t,n.parentNode).filter(zn).fold((function(){var n;return n=be.fromDom(t.getBody()),q(Sa(n,".mce-offscreen-selection"),on),Xg(t,e,be.fromDom(t.selection.getNode())),My(t),!0}),R)},dw=function(t){var e=t.dom,n=t.selection,r=Lf(t.getBody(),n.getNode());if(Rn(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(gc.before(o).toRange())}return!0},mw=function(t,e){return t.selection.isCollapsed()?lw(t,e):fw(t,e)},gw=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=gc.fromRangeStart(t.selection.getRng());return gl(e,t.getBody(),n).filter((function(t){return e?Gm(t):$m(t)})).bind((function(t){return P.from(Fs(e?0:-1,t))})).exists((function(e){return t.selection.select(e),!0}))}(t,e)},hw=_n,pw=function(t){return hw(t)&&t.data[0]===ao},vw=function(t){return hw(t)&&t.data[t.data.length-1]===ao},bw=function(t){return t.ownerDocument.createTextNode(ao)},yw=function(t,e){return t?function(t){if(hw(t.previousSibling))return vw(t.previousSibling)?t.previousSibling:(t.previousSibling.appendData(ao),t.previousSibling);if(hw(t))return pw(t)?t:(t.insertData(0,ao),t);var e=bw(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if(hw(t.nextSibling))return pw(t.nextSibling)?t.nextSibling:(t.nextSibling.insertData(0,ao),t.nextSibling);if(hw(t))return vw(t)?t:(t.appendData(ao),t);var e=bw(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},ww=E(yw,!0),xw=E(yw,!1),Cw=function(t,e){return _n(t.container())?yw(e,t.container()):yw(e,t.getNode())},Sw=function(t,e){var n=e.get();return n&&t.container()===n&&go(n)},kw=function(t,e){return e.fold((function(e){vs(t.get());var n=ww(e);return t.set(n),P.some(gc(n,n.length-1))}),(function(e){return wl(e).map((function(e){if(Sw(e,t))return gc(t.get(),1);vs(t.get());var n=Cw(e,!0);return t.set(n),gc(n,1)}))}),(function(e){return xl(e).map((function(e){if(Sw(e,t))return gc(t.get(),t.get().length-1);vs(t.get());var n=Cw(e,!1);return t.set(n),gc(n,n.length-1)}))}),(function(e){vs(t.get());var n=xw(e);return t.set(n),P.some(gc(n,1))}))},Ow=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return P.none()},Tw=mr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),_w=function(t,e){var n=Ls(e,t);return n||t},Ew=function(t,e,n){var r=_y(n),o=_w(e,r.container());return Oy(t,o,r).fold((function(){return bl(o,r).bind(E(Oy,t,o)).map((function(t){return Tw.before(t)}))}),P.none)},Aw=function(t,e){return null===Sl(t,e)},Dw=function(t,e,n){return Oy(t,e,n).filter(E(Aw,e))},Mw=function(t,e,n){var r=Ey(n);return Dw(t,e,r).bind((function(t){return yl(t,r).isNone()?P.some(Tw.start(t)):P.none()}))},Nw=function(t,e,n){var r=_y(n);return Dw(t,e,r).bind((function(t){return bl(t,r).isNone()?P.some(Tw.end(t)):P.none()}))},Rw=function(t,e,n){var r=Ey(n),o=_w(e,r.container());return Oy(t,o,r).fold((function(){return yl(o,r).bind(E(Oy,t,o)).map((function(t){return Tw.after(t)}))}),P.none)},zw=function(t){return!1===ky(Iw(t))},Bw=function(t,e,n){return Ow([Ew,Mw,Nw,Rw],[t,e,n]).filter(zw)},Iw=function(t){return t.fold(T,T,T,T)},Pw=function(t){return t.fold(O("before"),O("start"),O("end"),O("after"))},Lw=function(t){return t.fold(Tw.before,Tw.before,Tw.after,Tw.after)},Hw=function(t){return t.fold(Tw.start,Tw.start,Tw.end,Tw.end)},Fw=function(t,e,n,r,o,i){return Ln(Oy(e,n,r),Oy(e,n,o),(function(e,r){return e!==r&&function(t,e,n){var r=Ls(e,t),o=Ls(n,t);return r&&r===o}(n,e,r)?Tw.after(t?e:r):i})).getOr(i)},Vw=function(t,e){return t.fold(R,(function(t){return r=e,!(Pw(n=t)===Pw(r)&&Iw(n)===Iw(r));var n,r}))},jw=function(t,e){return t?e.fold(S(P.some,Tw.start),P.none,S(P.some,Tw.after),P.none):e.fold(P.none,S(P.some,Tw.before),P.none,S(P.some,Tw.end))},Uw=function(t,e,n,r){var o=Ty(t,r),i=Bw(e,n,o);return Bw(e,n,o).bind(E(jw,t)).orThunk((function(){return function(t,e,n,r,o){var i=Ty(t,o);return gl(t,n,i).map(E(Ty,t)).fold((function(){return r.map(Lw)}),(function(o){return Bw(e,n,o).map(E(Fw,t,e,n,i,o)).filter(E(Vw,r))})).filter(zw)}(t,e,n,i,r)}))};E(Uw,!1),E(Uw,!0);var Ww,qw=function(t,e,n){var r=t?1:-1;return e.setRng(gc(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0},Gw=function(t,e){var n=e.selection.getRng(),r=t?gc.fromRangeEnd(n):gc.fromRangeStart(n);return!!function(t){return w(t.selection.getSel().modify)}(e)&&(t&&vo(r)?qw(!0,e.selection,r):!(t||!bo(r))&&qw(!1,e.selection,r))};!function(t){t[t.Br=0]="Br",t[t.Block=1]="Block",t[t.Wrap=2]="Wrap",t[t.Eol=3]="Eol"}(Ww||(Ww={}));var $w,Xw=function(t,e){return t===hc.Backwards?nt(e):e},Kw=function(t,e,n){return t===hc.Forwards?e.next(n):e.prev(n)},Yw=function(t,e,n,r){return Mn(r.getNode(e===hc.Forwards))?Ww.Br:!1===Hs(n,r)?Ww.Block:Ww.Wrap},Jw=function(t,e,n,r){for(var o=sl(n),i=r,u=[];i;){var a=Kw(e,o,i);if(!a)break;if(Mn(a.getNode(!1)))return e===hc.Forwards?{positions:Xw(e,u).concat([a]),breakType:Ww.Br,breakAt:P.some(a)}:{positions:Xw(e,u),breakType:Ww.Br,breakAt:P.some(a)};if(a.isVisible()){if(t(i,a)){var c=Yw(0,e,i,a);return{positions:Xw(e,u),breakType:c,breakAt:P.some(a)}}u.push(a),i=a}else i=a}return{positions:Xw(e,u),breakType:Ww.Eol,breakAt:P.none()}},Qw=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===hc.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Zw=function(t,e){return Y(t,(function(t,n){return t.fold((function(){return P.some(n)}),(function(r){return Ln(it(r.getClientRects()),it(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),P.none())},tx=function(t,e){return it(e.getClientRects()).bind((function(e){return Zw(t,e.left)}))},ex=E(Jw,gc.isAbove,-1),nx=E(Jw,gc.isBelow,1),rx=E(Qw,-1,ex),ox=E(Qw,1,nx),ix=function(t){var e=function(e){return W(e,(function(e){var n=Fa(e);return n.node=t,n}))};if(yn(t))return e(t.getClientRects());if(_n(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},ux=function(t){return tt(t,ix)};!function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}($w||($w={}));var ax,cx,sx=function(t,e,n,r,o,i){var u=0,a=[],c=function(r){var i=ux([r]);-1===t&&(i=i.reverse());for(var c=0;c<i.length;c++){var l=i[c];if(!n(l,s)){if(a.length>0&&e(l,Et(a))&&u++,l.line=u,o(l))return!0;a.push(l)}}},s=Et(i.getClientRects());if(!s)return a;var l=i.getNode();return c(l),function(t,e,n,r){for(;r=Ps(r,t,zo,e);)if(n(r))return}(t,r,c,l),a},lx=E(sx,$w.Up,Ua,Wa),fx=E(sx,$w.Down,Wa,Ua),dx=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},mx=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},gx=zn,hx=Ps,px=function(t,e){return Math.abs(t.left-e)},vx=function(t,e){return Math.abs(t.right-e)},bx=function(t,e){return t>=e.left&&t<=e.right},yx=function(t,e){return t>=e.top&&t<=e.bottom},wx=function(t,e){return Tt(t,(function(t,n){var r=Math.min(px(t,e),vx(t,e)),o=Math.min(px(n,e),vx(n,e));return bx(e,n)?n:bx(e,t)?t:o===r&&gx(n.node)?n:o<r?n:t}))},xx=function(t,e,n,r,o){var i=hx(r,t,zo,e,!o);do{if(!i||n(i))return}while(i=hx(i,t,zo,e))},Cx=function(t,e,n){var r=ux(function(t){return X(at(t.getElementsByTagName("*")),Ts)}(t)),o=X(r,E(yx,n)),i=wx(o,e);if(i){var u=!kn(i.node)&&!In(i.node);if((i=wx(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=X(ux([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),xx($w.Up,t,E(o,Ua),e.node,n),xx($w.Down,t,E(o,Wa),e.node,n),r}(t,i,u),e))&&Ts(i.node))return function(t,e){return{node:t.node,before:px(t,e)<vx(t,e)}}(i,e)}return null},Sx=function(t,e){t.selection.setRng(e),Ed(t,t.selection.getRng())},kx=function(t,e,n){return P.some(tw(t,e,n))},Ox=function(t,e,n,r,o,i){var u=e===hc.Forwards,a=sl(t.getBody()),c=E(Ys,u?a.next:a.prev),s=u?r:o;if(!n.collapsed){var l=Ga(n);if(i(l))return Jy(e,t,l,e===hc.Backwards,!1)}var f=Xs(e,t.getBody(),n);if(s(f))return Qy(t,f.getNode(!u));var d=Ty(u,c(f)),m=So(n);if(!d)return m?P.some(n):P.none();if(s(d))return Jy(e,t,d.getNode(!u),u,!1);var g=c(d);return g&&s(g)&&Js(d,g)?Jy(e,t,g.getNode(!u),u,!1):m?kx(t,d.toRange(),!1):P.none()},Tx=function(t,e,n,r,o,i){var u=Xs(e,t.getBody(),n),a=Et(u.getClientRects()),c=e===$w.Down;if(!a)return P.none();var s,l=(c?fx:lx)(t.getBody(),dx(1),u),f=X(l,mx(1)),d=a.left,m=wx(f,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),h=Math.abs(d-m.right);return Jy(e,t,m.node,g<h,!1)}if(s=r(u)?u.getNode():o(u)?u.getNode(!0):Ga(n)){var p=function(t,e,n,r){var o,i,u,a,c=sl(e),s=[],l=0,f=function(t){return Et(t.getClientRects())};1===t?(o=c.next,i=Wa,u=Ua,a=gc.after(r)):(o=c.prev,i=Ua,u=Wa,a=gc.before(r));var d=f(a);do{if(a.isVisible()){var m=f(a);if(!u(m,d)){s.length>0&&i(m,Et(s))&&l++;var g=Fa(m);if(g.position=a,g.line=l,n(g))return s;s.push(g)}}}while(a=o(a));return s}(e,t.getBody(),dx(1),s),v=wx(X(p,mx(1)),d);if(v)return kx(t,v.position.toRange(),!1);if(v=Et(X(p,mx(0))))return kx(t,v.position.toRange(),!1)}return 0===f.length?_x(t,c).filter(c?o:r).map((function(e){return tw(t,e.toRange(),!1)})):P.none()},_x=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=gc.fromRangeEnd(n),i=nx(r,o);return ut(i.positions)}o=gc.fromRangeStart(n),i=ex(r,o);return it(i.positions)},Ex=function(t,e,n){return _x(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},Ax=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},Dx=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},Mx=function(t,e,n){return kw(e,n).map((function(e){return Ax(t,e),n}))},Nx=function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=gc.fromRangeStart(t.selection.getRng());gc.isTextPosition(n)&&!1===function(t){return vo(t)||bo(t)}(n)&&(Ax(t,ps(e.get(),n)),e.set(null))}},Rx=function(t,e,n){return!!is(t)&&function(t,e,n){var r=t.getBody(),o=gc.fromRangeStart(t.selection.getRng()),i=E(Sy,t);return Uw(n,i,r,o).bind((function(n){return Mx(t,e,n)}))}(t,e,n).isSome()},zx=function(t,e,n){return!!is(e)&&Gw(t,e)},Bx=function(t){var e=ua(null),n=E(Sy,t);return t.on("NodeChange",(function(r){!is(t)||fe.browser.isIE()&&r.initial||(function(t,e,n){var r=W(Sa(be.fromDom(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),o=X(r,t),i=X(n,t);q(rt(o,i),E(Dx,!1)),q(rt(i,o),E(Dx,!0))}(n,t.dom,r.parents),Nx(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=X(r,t);q(o,(function(r){var o=gc.fromRangeStart(e.selection.getRng());Bw(t,e.getBody(),o).bind((function(t){return Mx(e,n,t)}))}))}}(n,t,e,r.parents))})),e},Ix=E(zx,!0),Px=E(zx,!1),Lx=function(t,e,n){if(is(t)){var r=_x(t,e).getOrThunk((function(){var n=t.selection.getRng();return e?gc.fromRangeEnd(n):gc.fromRangeStart(n)}));return Bw(E(Sy,t),t.getBody(),r).exists((function(e){var r=Lw(e);return kw(n,r).exists((function(e){return Ax(t,e),!0}))}))}return!1},Hx=function(t,e){return function(n){return kw(e,n).exists((function(e){return Ax(t,e),!0}))}},Fx=function(t,e,n,r){var o=t.getBody(),i=E(Sy,t);t.undoManager.ignore((function(){t.selection.setRng(function(t,e){var n=document.createRange();return n.setStart(t.container(),t.offset()),n.setEnd(e.container(),e.offset()),n}(n,r)),t.execCommand("Delete"),Bw(i,o,gc.fromRangeStart(t.selection.getRng())).map(Hw).map(Hx(t,e))})),t.nodeChanged()},Vx=function(t,e,n,r){var o=function(t,e){var n=Ls(e,t);return n||t}(t.getBody(),r.container()),i=E(Sy,t),u=Bw(i,o,r);return u.bind((function(t){return n?t.fold(O(P.some(Hw(t))),P.none,O(P.some(Lw(t))),P.none):t.fold(P.none,O(P.some(Lw(t))),P.none,O(P.some(Hw(t))))})).map(Hx(t,e)).getOrThunk((function(){var a=hl(n,o,r),c=a.bind((function(t){return Bw(i,o,t)}));return Ln(u,c,(function(){return Oy(i,o,r).exists((function(e){return!!function(t){return Ln(wl(t),xl(t),(function(e,n){var r=Ty(!0,e),o=Ty(!1,n);return bl(t,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)}(e)&&(Xg(t,n,be.fromDom(e)),!0)}))})).orThunk((function(){return c.bind((function(o){return a.map((function(o){return n?Fx(t,e,r,o):Fx(t,e,o,r),!0}))}))})).getOr(!1)}))},jx=function(t,e,n){if(t.selection.isCollapsed()&&is(t)){var r=gc.fromRangeStart(t.selection.getRng());return Vx(t,e,n,r)}return!1},Ux=function(t){return 1===We(t)},Wx=function(t,e,n,r){var o=E(cp,e),i=W(X(r,o),(function(t){return t.dom}));if(0===i.length)Xg(e,t,n);else{var u=function(t,e){var n=ep(!1),r=ip(e,n.dom);return Qe(be.fromDom(t),n),on(be.fromDom(t)),gc(r,0)}(n.dom,i);e.selection.setRng(u.toRange())}},qx=function(t,e){var n=be.fromDom(t.getBody()),r=be.fromDom(t.selection.getStart()),o=X(function(t,e){var n=ig(e,t);return Z(n,Qr).fold(O(n),(function(t){return n.slice(0,t)}))}(n,r),Ux);return ut(o).exists((function(n){var r,i=gc.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Ln(wl(n),xl(n),(function(r,o){var i=Ty(!0,r),u=Ty(!1,o),a=Ty(!1,e);return t?bl(n,a).exists((function(t){return t.isEqual(u)&&e.isEqual(i)})):yl(n,a).exists((function(t){return t.isEqual(i)&&e.isEqual(u)}))})).getOr(!0)}(e,i,n.dom)||(r=n,Cl(r.dom)&&Zh(r.dom)))&&(Wx(e,t,n,o),!0)}))},Gx=function(t,e){return!!t.selection.isCollapsed()&&qx(t,e)},$x=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),Xg(t,e,be.fromDom(n)),!0},Xx=function(t,e){return t.selection.isCollapsed()?function(t,e){var n=e?Xm:Km,r=e?hc.Forwards:hc.Backwards,o=Xs(r,t.getBody(),t.selection.getRng());return n(o)?$x(t,e,o.getNode(!e)):P.from(Ty(e,o)).filter((function(t){return n(t)&&Js(o,t)})).exists((function(n){return $x(t,e,n.getNode(!e))}))}(t,e):function(t,e){var n=t.selection.getNode();return!!In(n)&&$x(t,e,n)}(t,e)},Kx=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},Yx=function(t,e){return(t||"table"===Oe(e)?"margin":"padding")+("rtl"===$n(e,"direction")?"-right":"-left")},Jx=function(t){var e=Zx(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return et(e,(function(e){var n=Yx(Zc(t),e),r=Kn(e,n).map(Kx).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&r>0}))}(t,e))},Qx=function(t){return no(t)||ro(t)},Zx=function(t){return X((e=t.selection.getSelectedBlocks(),W(e,be.fromDom)),(function(t){return!Qx(t)&&!function(t){return Be(t).exists(Qx)}(t)&&Pr(t,(function(t){return Rn(t.dom)||zn(t.dom)})).exists((function(t){return Rn(t.dom)}))}));var e},tC=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),u=/[a-z%]+$/i.exec(i)[0],a=parseInt(i,10),c=Zc(t),s=Vc(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),q(Zx(t),(function(t){!function(t,e,n,r,o,i){var u=Yx(n,be.fromDom(i));if("outdent"===e){var a=Math.max(0,Kx(i.style[u])-r);t.setStyle(i,u,a?a+o:"")}else{a=Kx(i.style[u])+r+o;t.setStyle(i,u,a)}}(n,e,c,a,u,t.dom)}))},eC=function(t,e){if(t.selection.isCollapsed()&&Jx(t)){var n=t.dom,r=t.selection.getRng(),o=gc.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&lg(be.fromDom(i),o))return tC(t,"outdent"),!0}return!1},nC=function(t,e){t.getDoc().execCommand(e,!1,null)},rC=function(t,e){t.addCommand("delete",(function(){!function(t,e){eC(t)||mw(t,!1)||ow(t,!1)||jx(t,e,!1)||Wy(t,!1)||Sh(t)||gw(t,!1)||Xx(t,!1)||Xy(t)||Gx(t,!1)||(nC(t,"Delete"),My(t))}(t,e)})),t.addCommand("forwardDelete",(function(){!function(t,e){mw(t,!0)||ow(t,!0)||jx(t,e,!0)||Wy(t,!0)||Sh(t)||gw(t,!0)||Xx(t,!0)||Xy(t)||Gx(t,!0)||nC(t,"ForwardDelete")}(t,e)}))},oC=function(t){return void 0===t.touches||1!==t.touches.length?P.none():P.some(t.touches[0])},iC=function(t){var e=da(),n=ua(!1),r=ga((function(e){t.fire("longpress",At(At({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){oC(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.throttle(t),n.set(!1),e.set(i)}))}),!0),t.on("touchmove",(function(o){r.cancel(),oC(o).each((function(r){e.on((function(o){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(r,o)&&(e.clear(),n.set(!1),t.fire("longpresscancel"))}))}))}),!0),t.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter((function(t){return t.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():t.fire("tap",At(At({},o),{type:"tap"}))}))}),!0)},uC=function(t,e){return yt(t,e.nodeName)},aC=function(t,e){return!!_n(e)||!!yn(e)&&(!uC(t,e)&&!zl(e))},cC=function(t,e){if(_n(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||uC(t,e.nextSibling)))return!0}return!1},sC=function(t){var e,n,r,o=t.dom,i=t.selection,u=t.schema,a=u.getBlockElements(),c=i.getStart(),s=t.getBody(),l=Vc(t);if(c&&yn(c)&&l){var f=s.nodeName.toLowerCase();if(u.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return U(og(be.fromDom(n),be.fromDom(e)),(function(e){return uC(t,e.dom)}))}(a,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,h=d.endContainer,p=d.endOffset,v=om(t);for(c=s.firstChild;c;)if(aC(a,c)){if(cC(a,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(l,jc(t)),c.parentNode.insertBefore(e,c),r=!0),n=c,c=c.nextSibling,e.appendChild(n)}else e=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(h,p),i.setRng(d),t.nodeChanged())}}},lC=function(t,e){e.hasAttribute("data-mce-caret")&&(Co(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},fC=function(t,e){var n=function(t){return Fr(be.fromDom(t.getBody()),"*[data-mce-caret]").map((function(t){return t.dom})).getOrNull()}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void lC(t,n)):void(po(n)&&(lC(t,n),t.undoManager.add()))},dC=zn,mC=function(t,e,n){var r=sl(t.getBody()),o=E(Ys,1===e?r.next:r.prev);if(n.collapsed&&function(t){return""!==Vc(t)}(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(gc.fromRangeStart(n))){var u=function(t){var e=t.dom.create(Vc(t));return(!fe.ie||fe.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e}(t);1===e?t.$(i).after(u):t.$(i).before(u),t.selection.select(u,!0),t.selection.collapse()}}},gC=function(t,e){var n=e?hc.Forwards:hc.Backwards,r=t.selection.getRng();return function(t,e,n){return Ox(e,t,n,Qm,Zm,dC)}(n,t,r).orThunk((function(){return mC(t,n,r),P.none()}))},hC=function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return Tx(e,t,n,(function(t){return Qm(t)||Ym(t)}),(function(t){return Zm(t)||Jm(t)}),dC)}(n,t,r).orThunk((function(){return mC(t,n,r),P.none()}))},pC=function(t,e){return gC(t,e).exists((function(e){return Sx(t,e),!0}))},vC=function(t,e){return hC(t,e).exists((function(e){return Sx(t,e),!0}))},bC=function(t,e){return Ex(t,e,e?Zm:Qm)},yC=function(t){return j(["figcaption"],Oe(t))},wC=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},xC=function(t,e,n){n?en(t,e):tn(t,e)},CC=function(t,e,n,r){return""===e?function(t,e){var n=be.fromTag("br");return xC(t,n,e),wC(n)}(t,r):function(t,e,n,r){var o=be.fromTag(n),i=be.fromTag("br");return jn(o,r),en(o,i),xC(t,o,e),wC(i)}(t,r,e,n)},SC=function(t,e,n){return e?function(t,e){return nx(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return ex(t,e).breakAt.isNone()}(t.dom,n)},kC=function(t,e){var n=be.fromDom(t.getBody()),r=gc.fromRangeStart(t.selection.getRng()),o=Vc(t),i=jc(t);return function(t,e){var n=E(Ce,e);return Pr(be.fromDom(t.container()),Qr,n).filter(yC)}(r,n).exists((function(){if(SC(n,e,r)){var u=CC(n,o,i,e);return t.selection.setRng(u),!0}return!1}))},OC=function(t,e){return!!t.selection.isCollapsed()&&kC(t,e)},TC=function(t,e){return tt(function(t){return W(t,(function(t){return At({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:C},t)}))}(t),(function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]}))},_C=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},EC=function(t,e){return Q(TC(t,e),(function(t){return t.action()}))},AC=function(t,e){var n=e?hc.Forwards:hc.Backwards,r=t.selection.getRng();return Ox(t,n,r,Xm,Km,In).exists((function(e){return Sx(t,e),!0}))},DC=function(t,e){var n=e?1:-1,r=t.selection.getRng();return Tx(t,n,r,Xm,Km,In).exists((function(e){return Sx(t,e),!0}))},MC=function(t,e){return Ex(t,e,e?Km:Xm)},NC=function(t,e,n,r,o){var i=Sa(be.fromDom(n),"td,th,caption").map((function(t){return t.dom}));return function(t,e,n){return Y(t,(function(t,r){return t.fold((function(){return P.some(r)}),(function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return P.some(i<o?r:t)}))}),P.none())}(X(function(t,e){return tt(e,(function(e){var n=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+2*e,bottom:t.bottom+2*e,width:t.width+e,height:t.height+e}}(Fa(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]}))}(t,i),(function(t){return e(t,o)})),r,o).map((function(t){return t.cell}))},RC=E(NC,(function(t){return t.bottom}),(function(t,e){return t.y<e})),zC=E(NC,(function(t){return t.top}),(function(t,e){return t.y>e})),BC=function(t,e){return it(e.getClientRects()).bind((function(e){return RC(t,e.left,e.top)})).bind((function(t){return tx(xl(n=t).map((function(t){return ex(n,t).positions.concat(t)})).getOr([]),e);var n}))},IC=function(t,e){return ut(e.getClientRects()).bind((function(e){return zC(t,e.left,e.top)})).bind((function(t){return tx(wl(n=t).map((function(t){return[t].concat(nx(n,t).positions)})).getOr([]),e);var n}))},PC=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===Ww.Wrap&&0===t.positions.length}(r)||!Mn(n.getNode())&&function(t){return t.breakType===Ww.Br&&1===t.positions.length}(r)?!function(t,e,n){return n.breakAt.exists((function(n){return t(e,n).breakAt.isSome()}))}(t,e,r):r.breakAt.isNone()},LC=E(PC,ex),HC=E(PC,nx),FC=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!ks()||!function(t,e,n){var r=gc.fromRangeStart(e);return vl(!t,n).exists((function(t){return t.isEqual(r)}))}(e,o,n))&&(Jy(i,t,n,!e,!1).each((function(e){Sx(t,e)})),!0)},VC=function(t,e){var n=e.getNode(t);return yn(n)&&"TABLE"===n.nodeName?P.some(n):P.none()},jC=function(t,e,n){var r=VC(!!e,n),o=!1===e;r.fold((function(){return Sx(t,n.toRange())}),(function(r){return vl(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return Sx(t,n.toRange())}),(function(o){return function(t,e,n,r){var o=Vc(e);o?e.undoManager.transact((function(){var r=be.fromTag(o);jn(r,jc(e)),en(r,be.fromTag("br")),t?Ze(be.fromDom(n),r):Qe(be.fromDom(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),Sx(e,i)})):Sx(e,r.toRange())}(e,t,r,n)}))}))},UC=function(t,e,n,r){var o=t.selection.getRng(),i=gc.fromRangeStart(o),u=t.getBody();if(!e&&LC(r,i)){var a=function(t,e,n){return BC(e,n).orThunk((function(){return it(n.getClientRects()).bind((function(n){return Zw(rx(t,gc.before(e)),n.left)}))})).getOr(gc.before(e))}(u,n,i);return jC(t,e,a),!0}if(e&&HC(r,i)){a=function(t,e,n){return IC(e,n).orThunk((function(){return it(n.getClientRects()).bind((function(n){return Zw(ox(t,gc.after(e)),n.left)}))})).getOr(gc.after(e))}(u,n,i);return jC(t,e,a),!0}return!1},WC=function(t,e,n){return P.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return P.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},qC=function(t,e){return WC(t,e,FC)},GC=function(t,e){return WC(t,e,UC)},$C=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=ne().os;EC([{keyCode:Uf.RIGHT,action:_C(pC,t,!0)},{keyCode:Uf.LEFT,action:_C(pC,t,!1)},{keyCode:Uf.UP,action:_C(vC,t,!1)},{keyCode:Uf.DOWN,action:_C(vC,t,!0)},{keyCode:Uf.RIGHT,action:_C(qC,t,!0)},{keyCode:Uf.LEFT,action:_C(qC,t,!1)},{keyCode:Uf.UP,action:_C(GC,t,!1)},{keyCode:Uf.DOWN,action:_C(GC,t,!0)},{keyCode:Uf.RIGHT,action:_C(AC,t,!0)},{keyCode:Uf.LEFT,action:_C(AC,t,!1)},{keyCode:Uf.UP,action:_C(DC,t,!1)},{keyCode:Uf.DOWN,action:_C(DC,t,!0)},{keyCode:Uf.RIGHT,action:_C(Rx,t,e,!0)},{keyCode:Uf.LEFT,action:_C(Rx,t,e,!1)},{keyCode:Uf.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:_C(Ix,t,e)},{keyCode:Uf.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:_C(Px,t,e)},{keyCode:Uf.UP,action:_C(OC,t,!1)},{keyCode:Uf.DOWN,action:_C(OC,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},XC=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){EC([{keyCode:Uf.BACKSPACE,action:_C(eC,t,!1)},{keyCode:Uf.BACKSPACE,action:_C(mw,t,!1)},{keyCode:Uf.DELETE,action:_C(mw,t,!0)},{keyCode:Uf.BACKSPACE,action:_C(ow,t,!1)},{keyCode:Uf.DELETE,action:_C(ow,t,!0)},{keyCode:Uf.BACKSPACE,action:_C(jx,t,e,!1)},{keyCode:Uf.DELETE,action:_C(jx,t,e,!0)},{keyCode:Uf.BACKSPACE,action:_C(Sh,t,!1)},{keyCode:Uf.DELETE,action:_C(Sh,t,!0)},{keyCode:Uf.BACKSPACE,action:_C(gw,t,!1)},{keyCode:Uf.DELETE,action:_C(gw,t,!0)},{keyCode:Uf.BACKSPACE,action:_C(Xx,t,!1)},{keyCode:Uf.DELETE,action:_C(Xx,t,!0)},{keyCode:Uf.BACKSPACE,action:_C(Xy,t,!1)},{keyCode:Uf.DELETE,action:_C(Xy,t,!0)},{keyCode:Uf.BACKSPACE,action:_C(Wy,t,!1)},{keyCode:Uf.DELETE,action:_C(Wy,t,!0)},{keyCode:Uf.BACKSPACE,action:_C(Gx,t,!1)},{keyCode:Uf.DELETE,action:_C(Gx,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&function(t,e){EC([{keyCode:Uf.BACKSPACE,action:_C(dw,t)},{keyCode:Uf.DELETE,action:_C(dw,t)}],e)}(t,e)}))},KC=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var u=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);u&&/^(UL|OL|DL)$/.test(u.nodeName)&&e.insertBefore(o.doc.createTextNode(" "),e.firstChild)}var a=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var c=new Kr(e,e);n=c.current();){if(_n(n)){a.setStart(n,0),a.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){a.setStartBefore(n),a.setEndBefore(n);break}r=n,n=c.next()}n||(a.setStart(r,0),a.setEnd(r,0))}else Mn(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(a.setStartBefore(e),a.setEndBefore(e)):(a.setStartAfter(e),a.setEndAfter(e)):(a.setStart(e,0),a.setEnd(e,0));t.selection.setRng(a),Ed(t,a)}},YC=function(t){return P.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},JC=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},QC=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},ZC=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},tS=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!yn(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},eS=function(t,e,n,r,o){var i=t.dom,u=t.selection.getRng();if(n!==t.getBody()){var a;QC(a=n)&&QC(a.parentNode)&&(o="LI");var c=o?e(o):i.create("BR");if(tS(n,r,!0)&&tS(n,r,!1))if(JC(n,"LI")){var s=ZC(n);i.insertAfter(c,s),!function(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.firstChild)===t}(n)?i.remove(n):i.remove(s)}else i.replace(c,n);else if(tS(n,r,!0))JC(n,"LI")?(i.insertAfter(c,ZC(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n),i.remove(r);else if(tS(n,r,!1))i.insertAfter(c,ZC(n)),i.remove(r);else{n=ZC(n);var l=u.cloneRange();l.setStartAfter(r),l.setEndAfter(n);var f=l.extractContents();"LI"===o&&function(t,e){return t.firstChild&&t.firstChild.nodeName===e}(f,"LI")?(c=f.firstChild,i.insertAfter(f,n)):(i.insertAfter(f,n),i.insertAfter(c,n)),i.remove(r)}KC(t,c)}},nS=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},rS=function(t){t.innerHTML='<br data-mce-bogus="1">'},oS=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},iS=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},uS=function(t,e,n){return!1===_n(e)?n:t?1===n&&e.data.charAt(n-1)===ao?0:n:n===e.data.length-1&&e.data.charAt(n)===ao?e.data.length:n},aS=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},cS=function(t,e){var n=Vc(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;P.from(n.style).map(r.parseStyle).each((function(t){var n=Yn(be.fromDom(e)),o=At(At({},n),t);r.setStyles(e,o)}));var o=P.from(n.class).map((function(t){return t.split(/\s+/)})),i=P.from(e.className).map((function(t){return X(t.split(/\s+/),(function(t){return""!==t}))}));Ln(o,i,(function(t,n){var o=X(n,(function(e){return!j(t,e)})),i=Dt(Dt([],t),o);r.setAttrib(e,"class",i.join(" "))}));var u=["style","class"],a=pt(n,(function(t,e){return!j(u,e)}));r.setAttribs(e,a)}(t,e,jc(t))},sS=function(t,e){var n,r,o,i,u,a,c,s,l,f,d=t.dom,m=t.schema,g=m.getNonEmptyElements(),h=t.selection.getRng(),p=function(e){var n,o,u,a=r,c=m.getTextInlineElements();if(u=n=e||"TABLE"===s||"HR"===s?d.create(e||l):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[a.nodeName]){if(Cl(a)||zl(a))continue;o=a.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(u=o,n.appendChild(o))}}while((a=a.parentNode)&&a!==x);return cS(t,n),rS(u),n},v=function(t){var e,n,u=uS(t,r,o);if(_n(r)&&(t?u>0:u<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&yn(r)&&r===i.firstChild)return!0;if(oS(r,"TABLE")||oS(r,"HR"))return f&&!t||!f&&t;var a=new Kr(r,i);for(_n(r)&&(t&&0===u?a.prev():t||u!==r.nodeValue.length||a.next());e=a.current();){if(yn(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(_n(e)&&!Io(e.nodeValue))return!1;t?a.prev():a.next()}return!0},b=function(){u=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==C?p(l):p(),function(t){return t.getParam("end_container_on_empty_block",!1)}(t)&&iS(d,c)&&d.isEmpty(i)?u=d.split(c,i):d.insertAfter(u,i),KC(t,u)};rd(d,h).each((function(t){h.setStart(t.startContainer,t.startOffset),h.setEnd(t.endContainer,t.endOffset)})),r=h.startContainer,o=h.startOffset,l=Vc(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);yn(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&_n(r)?r.nodeValue.length:0);var x=aS(d,r);if(x){(l&&!y||!l&&y)&&(r=function(t,e,n,r,o){var i,u,a,c,s,l,f=e||"P",d=t.dom,m=aS(d,r);if(!(u=d.getParent(r,d.isBlock))||!iS(d,u)){if(l=(u=u||m)===t.getBody()||function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)}(u)?u.nodeName.toLowerCase():u.parentNode.nodeName.toLowerCase(),!u.hasChildNodes())return i=d.create(f),cS(t,i),u.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==u;)c=c.parentNode;for(;c&&!d.isBlock(c);)a=c,c=c.previousSibling;if(a&&t.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),cS(t,i),a.parentNode.insertBefore(i,a),c=a;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,l,h,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var C=c?c.nodeName.toUpperCase():"";"LI"!==C||w||(i=c,c=c.parentNode,s=C),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?eS(t,p,c,i,l):l&&i===t.getBody()||(l=l||"P",mo(i)?(u=Co(i),d.isEmpty(i)&&rS(i),cS(t,u),KC(t,u)):v()?b():v(!0)?(u=i.parentNode.insertBefore(p(),i),KC(t,oS(i,"HR")?u:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,uS(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,uS(!1,t.endContainer,t.endOffset)),e}(h).cloneRange()).setEndAfter(i),function(t){q(Ca(be.fromDom(t),Ae),(function(t){var e=t.dom;e.nodeValue=so(e.nodeValue)}))}(a=n.extractContents()),function(t){do{_n(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(a),u=a.firstChild,d.insertAfter(a,i),function(t,e,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;yn(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?t.remove(o):nS(t,o)&&t.remove(o)}}(d,g,u),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&rS(i),u.normalize(),d.isEmpty(u)?(d.remove(u),b()):(cS(t,u),KC(t,u))),d.setAttrib(u,"id",""),t.fire("NewBlock",{newBlock:u}))}},lS=function(t,e,n){var r=t.dom.createRng();n?(r.setStartBefore(e),r.setEndBefore(e)):(r.setStartAfter(e),r.setEndAfter(e)),t.selection.setRng(r),Ed(t,r)},fS=function(t,e){var n,r,o=t.selection,i=t.dom,u=o.getRng();rd(i,u).each((function(t){u.setStart(t.startContainer,t.startOffset),u.setEnd(t.endContainer,t.endOffset)}));var a=u.startOffset,c=u.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=a>c.childNodes.length-1;c=c.childNodes[Math.min(a,c.childNodes.length-1)]||c,a=s&&3===c.nodeType?c.nodeValue.length:0}var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&a>=c.nodeValue.length&&(function(t,e,n){for(var r,o=new Kr(e,n),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema,c,l)||(n=i.create("br"),u.insertNode(n),u.setStartAfter(n),u.setEndAfter(n),r=!0)),n=i.create("br"),vc(i,u,n),lS(t,n,r),t.undoManager.add()},dS=function(t,e){var n=be.fromTag("br");Qe(be.fromDom(e),n),t.undoManager.add()},mS=function(t,e){gS(t.getBody(),e)||Ze(be.fromDom(e),be.fromTag("br"));var n=be.fromTag("br");Ze(be.fromDom(e),n),lS(t,n.dom,!1),t.undoManager.add()},gS=function(t,e){return n=gc.after(e),!!Mn(n.getNode())||bl(t,gc.after(e)).map((function(t){return Mn(t.getNode())})).getOr(!1);var n},hS=function(t){return t&&"A"===t.nodeName&&"href"in t},pS=function(t){return t.fold(N,hS,hS,N)},vS=function(t,e){e.fold(C,E(dS,t),E(mS,t),C)},bS=function(t,e){var n=function(t){var e=E(Sy,t),n=gc.fromRangeStart(t.selection.getRng());return Bw(e,t.getBody(),n).filter(pS)}(t);n.isSome()?n.each(E(vS,t)):fS(t,e)},yS=function(t,e){return YC(t).filter((function(t){return e.length>0&&we(be.fromDom(t),e)})).isSome()},wS=mr([{br:[]},{block:[]},{none:[]}]),xS=function(t,e){return function(t){return yS(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},CS=function(t){return function(e,n){return""===Vc(e)===t}},SS=function(t){return function(e,n){return function(t){return YC(t).filter((function(t){return ro(be.fromDom(t))})).isSome()}(e)===t}},kS=function(t,e){return function(n,r){return function(t){return YC(t).fold(O(""),(function(t){return t.nodeName.toUpperCase()}))}(n)===t.toUpperCase()===e}},OS=function(t){return kS("pre",t)},TS=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},_S=function(t,e){return function(t){return yS(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},ES=function(t,e){return e},AS=function(t){var e=Vc(t),n=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},DS=function(t,e){return function(n,r){return Y(t,(function(t,e){return t&&e(n,r)}),!0)?P.some(e):P.none()}},MS=function(t,e){(function(t,e){return Ow([DS([xS],wS.none()),DS([kS("summary",!0)],wS.br()),DS([OS(!0),TS(!1),ES],wS.br()),DS([OS(!0),TS(!1)],wS.block()),DS([OS(!0),TS(!0),ES],wS.block()),DS([OS(!0),TS(!0)],wS.br()),DS([SS(!0),ES],wS.br()),DS([SS(!0)],wS.block()),DS([CS(!0),ES,AS],wS.block()),DS([CS(!0)],wS.br()),DS([_S],wS.br()),DS([CS(!1),ES],wS.br()),DS([AS],wS.block())],[t,!(!e||!e.shiftKey)]).getOr(wS.none())})(t,e).fold((function(){bS(t,e)}),(function(){sS(t,e)}),C)},NS=function(t){t.on("keydown",(function(e){e.keyCode===Uf.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact((function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),MS(t,e)})))}(t,e)}))},RS=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){EC([{keyCode:Uf.END,action:_C(bC,t,!0)},{keyCode:Uf.HOME,action:_C(bC,t,!1)},{keyCode:Uf.END,action:_C(MC,t,!0)},{keyCode:Uf.HOME,action:_C(MC,t,!1)},{keyCode:Uf.END,action:_C(Lx,t,!0,e)},{keyCode:Uf.HOME,action:_C(Lx,t,!1,e)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},zS=ne().browser,BS=function(t){!function(t){var e=ma((function(){t.composing||Rg(t)}),0);zS.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))}(t),t.on("input",(function(e){!1===e.isComposing&&Rg(t)}))},IS=ne(),PS=function(t){return t.stopImmediatePropagation()},LS=function(t){return t.keyCode===Uf.PAGE_UP||t.keyCode===Uf.PAGE_DOWN},HS=function(t,e,n){n&&!t.get()?e.on("NodeChange",PS,!0):!n&&t.get()&&e.off("NodeChange",PS),t.set(n)},FS=function(t,e){if(!IS.os.isOSX()){var n=ua(!1);t.on("keydown",(function(e){LS(e)&&HS(n,t,!0)})),t.on("keyup",(function(r){!1===r.isDefaultPrevented()&&function(t,e,n){EC([{keyCode:Uf.PAGE_UP,action:_C(Lx,t,!1,e)},{keyCode:Uf.PAGE_DOWN,action:_C(Lx,t,!0,e)}],n)}(t,e,r),LS(r)&&n.get()&&(HS(n,t,!1),t.nodeChanged())}))}},VS=function(t,e){var n=e.container(),r=e.offset();return _n(n)?(n.insertData(r,t),P.some(gc(n,r+t.length))):Ks(e).map((function(n){var r=be.fromText(t);return e.isAtEnd()?Ze(n,r):Qe(n,r),gc(r.dom,t.length)}))},jS=E(VS," "),US=E(VS," "),WS=function(t,e){return function(n){return function(t,e){return!kg(e)&&(Og(t,e)||Cg(t,e)||Sg(t,e))}(t,n)?jS(e):US(e)}},qS=function(t){var e=gc.fromRangeStart(t.selection.getRng()),n=be.fromDom(t.getBody());if(t.selection.isCollapsed()){var r=E(Sy,t),o=gc.fromRangeStart(t.selection.getRng());return Bw(r,t.getBody(),o).bind(function(t){return function(e){return e.fold((function(e){return yl(t.dom,gc.before(e))}),(function(t){return wl(t)}),(function(t){return xl(t)}),(function(e){return bl(t.dom,gc.after(e))}))}}(n)).bind(WS(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},GS=function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){EC([{keyCode:Uf.SPACEBAR,action:_C(qS,t)}],e).each((function(t){e.preventDefault()}))}(t,e)}))},$S=function(t){var e=Bx(t);return function(t){t.on("keyup compositionstart",E(fC,t))}(t),$C(t,e),XC(t,e),NS(t),GS(t),BS(t),RS(t,e),FS(t,e),e},XS=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&Xf(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!fe.range&&t.selection.isCollapsed()||_f(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&_f(t)&&("IMG"===t.selection.getNode().nodeName?Gr.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){if(t===r)return!0;n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),KS=function(t){!function(t){t.on("click",(function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}))}(t),function(t){t.parser.addNodeFilter("details",(function(t){q(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),t.serializer.addNodeFilter("details",(function(t){q(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",d(e)?e:null),t.attr("data-mce-open",null)}))}))}(t)},YS=function(t){return yn(t)&&eo(be.fromDom(t))},JS=function(t){t.on("click",(function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=gc.fromRangeStart(e),r=gc.fromRangeEnd(e);if(gc.isElementPosition(n)){var o=n.container();YS(o)&&wl(o).each((function(t){return e.setStart(t.container(),t.offset())}))}if(gc.isElementPosition(r)){o=n.container();YS(o)&&xl(o).each((function(t){return e.setEnd(t.container(),t.offset())}))}t.selection.setRng(Oh(e))}(t)}))},QS=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},ZS=function(t,e){return function(t,e,n){return{pageX:n.left-t.left+e.left,pageY:n.top-t.top+e.top}}(function(t){return t.inline?QS(t.getBody()):{left:0,top:0}}(t),function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=QS(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e))},tk=zn,ek=Rn,nk=function(t,e,n,r){var o=t.dom,i=e.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var u=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(u,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),u.appendChild(i),u},rk=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},ok=function(t,e){return function(n){if(function(t){return 0===t.button}(n)){var r=Q(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(tk,ek)).getOr(null);if(a=e.getBody(),tk(c=r)&&c!==a){var o=e.dom.getPos(r),i=e.getBody(),u=e.getDoc().documentElement;t.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(e.inline?i.scrollWidth:u.offsetWidth)-2,maxY:(e.inline?i.scrollHeight:u.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:nk(e,r,r.offsetWidth,r.offsetHeight)})}}var a,c}},ik=function(t,e){return function(n){t.on((function(t){if(t.dragging&&function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!tk(e)}(e,(u=e.selection,3===(a=u.getSel().getRangeAt(0).startContainer).nodeType?a.parentNode:a),t.element)){var r=(o=t.element,(i=o.cloneNode(!0)).removeAttribute("data-mce-selected"),i);e.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||e.undoManager.transact((function(){rk(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))}var o,i,u,a})),uk(t)}},uk=function(t){t.on((function(t){rk(t.ghost)})),t.clear()},ak=function(t){var e=da(),n=ea.DOM,r=document,o=ok(e,t),i=function(t,e){var n=Gr.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return e.on("remove",n.stop),function(r){return t.on((function(t){var o,i,u=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&u>10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var a=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,ZS(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var u=0,a=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(u=e.pageX+n-o),e.pageY+r>i&&(a=e.pageY+r-i),t.style.width=n-u+"px",t.style.height=r-a+"px"}(t.ghost,a,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}))}}(e,t),u=ik(e,t),a=function(t,e){return function(){t.on((function(t){t.dragging&&e.fire("dragend")})),uk(t)}}(e,t);t.on("mousedown",o),t.on("mousemove",i),t.on("mouseup",u),n.bind(r,"mousemove",i),n.bind(r,"mouseup",a),t.on("remove",(function(){n.unbind(r,"mousemove",i),n.unbind(r,"mouseup",a)}))},ck=function(t){ak(t),function(t){t.on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(tk(n)||"false"===t.dom.getContentEditableParent(n))&&e.preventDefault()}))}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(e){if(!e.isDefaultPrevented()){var n=e.dataTransfer;n&&(j(n.types,"Files")||n.files.length>0)&&(e.preventDefault(),"drop"===e.type&&Xb(t,"Dropped file type is not supported"))}},n=function(n){Jd(t,n.target)&&e(n)},r=function(){var r=ea.DOM,o=t.dom,i=document,u=t.inline?t.getBody():t.getDoc(),a=["drop","dragover"];q(a,(function(t){r.bind(i,t,n),o.bind(u,t,e)})),t.on("remove",(function(){q(a,(function(t){r.unbind(i,t,n),o.unbind(u,t,e)}))}))};t.on("init",(function(){Gr.setEditorTimeout(t,r,0)}))}(t)},sk=Rn,lk=zn,fk=function(t,e){return Lf(t.getBody(),e)},dk=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),u=Ss(t,i,o,(function(){return om(t)})),a="sel-"+r.uniqueId(),c=function(t){return t!==i&&(lk(t)||In(t))&&r.isChildOf(t,i)},s=function(t){t&&n.setRng(t)},l=n.getRng,f=function(e,r,o,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:r,direction:e,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===e),u.show(o,r))},d=function(t){return ho(t)||wo(t)||xo(t)},m=function(t){return d(t.startContainer)||d(t.endContainer)},g=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,u=e.startOffset,a=e.endContainer,c=e.endOffset;return yt(n,i.nodeName.toLowerCase())?0===u?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,u),yt(n,a.nodeName.toLowerCase())?0===c?o.setEndBefore(a):o.setEndAfter(a):o.setEnd(a,c),o},h=function(o){var i=o.cloneNode(!0),u=t.fire("ObjectSelected",{target:o,targetClone:i});if(u.isDefaultPrevented())return null;var c=function(e,o,i){var u=t.$,c=Fr(be.fromDom(t.getBody()),"#"+a).fold((function(){return u([])}),(function(t){return u([t.dom])}));0===c.length&&(c=u('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",a)).appendTo(t.getBody());var s=r.createRng();o===i&&fe.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(" ").append(o).append(" "),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(e,t.getBody()).y}),c[0].focus();var l=n.getSel();return l.removeAllRanges(),l.addRange(s),s}(o,u.targetClone,i),s=be.fromDom(o);return q(Sa(be.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Ce(s,t)||qn(t,"data-mce-selected")})),r.getAttrib(o,"data-mce-selected")||o.setAttribute("data-mce-selected","1"),e=o,b(),c},p=function(t,e){if(!t)return null;if(t.collapsed){if(!m(t)){var n=e?1:-1,o=Xs(n,i,t),u=o.getNode(!e);if(Ts(u))return f(n,u,!!e&&!o.isAtEnd(),!1);var a=o.getNode(e);if(Ts(a))return f(n,a,!e&&!o.isAtEnd(),!1)}return null}var s=t.startContainer,l=t.startOffset,d=t.endOffset;if(3===s.nodeType&&0===l&&lk(s.parentNode)&&(s=s.parentNode,l=r.nodeIndex(s),s=s.parentNode),1!==s.nodeType)return null;if(d===l+1&&s===t.endContainer){var g=s.childNodes[l];if(c(g))return h(g)}return null},v=function(){e&&e.removeAttribute("data-mce-selected"),Fr(be.fromDom(t.getBody()),"#"+a).each(on),e=null},b=function(){u.hide()};return fe.ceFalse&&!Tv(t)&&function(){t.on("mouseup",(function(e){var n=l();n.collapsed&&Vb(t,e.clientX,e.clientY)&&Zy(t,n,!1).each(s)})),t.on("click",(function(e){var o=fk(t,e.target);o&&(lk(o)&&(e.preventDefault(),t.focus()),sk(o)&&r.isChildOf(o,n.getNode())&&v())})),t.on("blur NewBlock",v),t.on("ResizeWindow FullscreenStateChanged",u.reposition);var d=function(t){var e=sl(t);if(!t.firstChild)return!1;var n,r=gc.before(t.firstChild),o=e.next(r);return o&&!(Qm(n=o)||Zm(n)||Xm(n)||Km(n))},h=function(e,n){var i,u,a=r.getParent(e,o),c=r.getParent(n,o);return!(!a||e===c||!r.isChildOf(a,c)||!1!==lk(fk(t,a)))||a&&(i=a,u=c,!(r.getParent(i,o)===r.getParent(u,o)))&&d(a)};t.on("tap",(function(e){var n=e.target,r=fk(t,n);lk(r)?(e.preventDefault(),Qy(t,r).each(p)):c(n)&&Qy(t,n).each(p)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==Vb(t,e.clientX,e.clientY)){var u=fk(t,o);if(u)lk(u)?(e.preventDefault(),Qy(t,u).each(p)):(v(),sk(u)&&e.shiftKey||Hf(e.clientX,e.clientY,n.getRng())||(b(),n.placeCaretAt(e.clientX,e.clientY)));else if(c(o))Qy(t,o).each(p);else if(!1===Ts(o)){v(),b();var a=Cx(i,e.clientX,e.clientY);if(a&&!h(o,a.node)){e.preventDefault();var l=f(1,a.node,a.before,!1);t.getBody().focus(),s(l)}}}})),t.on("keypress",(function(t){Uf.modifierPressed(t)||lk(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=g(t.range);var e=p(t.range,t.forward);e&&(t.range=e)}));t.on("AfterSetSelectionRange",(function(t){var e=t.range,n=e.startContainer.parentNode;m(e)||"mcepastebin"===n.id||b(),function(t){return r.hasClass(t,"mce-offscreen-selection")}(n)||v()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!fe.ie){var o=(e=r.get(a))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),ck(t),function(t){var e=ma((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=tw(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(In(n)){var r=Lf(t.getBody(),n),o=zn(r)?r:n;t.selection.getNode()!==o&&Qy(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:f,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(Co(t),s(l()),n.scrollIntoView(t))},hideFakeCaret:b,destroy:function(){u.destroy(),e=null}}},mk=function(t){var e,n,r=pe.each,o=Uf.BACKSPACE,i=Uf.DELETE,u=t.dom,a=t.selection,c=t.parser,s=fe.gecko,l=fe.ie,f=fe.webkit,d=l?"Text":"URL",m=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},g=function(t){return t.isDefaultPrevented()},h=function(){var e=function(t){var e=u.create("body"),n=t.cloneContents();return e.appendChild(n),a.serializer.serialize(e,{format:"html"})};t.on("keydown",(function(n){var r,a,c=n.keyCode;if(!g(n)&&(c===i||c===o)){if(r=t.selection.isCollapsed(),a=t.getBody(),r&&!u.isEmpty(a))return;if(!r&&!function(n){var r=e(n),o=u.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),a.firstChild&&u.isBlock(a.firstChild)?t.selection.setCursorLocation(a.firstChild,0):t.selection.setCursorLocation(a,0),t.nodeChanged()}}))},p=function(){t.shortcuts.add("meta+a",null,"SelectAll")},v=function(){t.inline||u.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=a.getRng(),t.getBody().focus(),"mousedown"===e.type){if(ho(n.startContainer))return;a.placeCaretAt(e.clientX,e.clientY)}else a.setRng(n)}))},b=function(){Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!g(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),Gr.setEditorTimeout(t,(function(){n.focus()}))}}))},y=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==u.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&u.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),a.select(n))}))},w=function(){t.on("keydown",(function(t){if(!g(t)&&t.keyCode===o&&a.isCollapsed()&&0===a.getRng().startOffset){var e=a.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},x=function(){(function(t){return t.getParam("readonly")})(t)||t.on("BeforeExecCommand mousedown",(function(){m("StyleWithCSS",!1),m("enableInlineTableEditing",!1),es(t)||m("enableObjectResizing",!1)}))},S=function(){t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||r(u.select("a"),(function(t){var e=t.parentNode,n=u.getRoot();if(e.lastChild===t){for(;e&&!u.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}u.add(e,"br",{"data-mce-bogus":1})}}))}))},k=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},O=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},T=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(fe.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},_=function(){fe.mac&&t.on("keydown",(function(e){!Uf.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))},E=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},A=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},D=function(){t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&a.select(e.target),(n=t.selection.getContent()).length>0&&(r="data:text/mce-internal,"+escape(t.id)+","+escape(n),e.dataTransfer.setData(d,r)))}(e)})),t.on("drop",(function(e){if(!g(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(d))&&e.indexOf("data:text/mce-internal,")>=0?(e=e.substr("data:text/mce-internal,".length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=$f(e.x,e.y,t.getDoc());a.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i}))},M=C;return Tv(t)?(f&&(v(),y(),A(),p(),fe.iOS&&(O(),T(),E())),s&&(b(),x(),k(),_())):(t.on("keydown",(function(e){var n,r;if(!g(e)&&e.keyCode===Uf.BACKSPACE){var o=(n=a.getRng()).startContainer,i=n.startOffset,c=u.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==c;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=u.createRng()).setStart(o,0),n.setEnd(o,0),a.setRng(n))}}})),h(),fe.windowsPhone||t.on("keyup focusin mouseup",(function(t){Uf.modifierPressed(t)||a.normalize()}),!0),f&&(v(),y(),Vc(t)&&t.on("init",(function(){m("DefaultParagraphSeparator",Vc(t))})),A(),w(),c.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),fe.iOS?(O(),T(),E()):p()),fe.ie>=11&&(T(),w()),fe.ie&&(p(),m("AutoUrlDetect",!1),D()),s&&(t.on("keydown",(function(e){if(!g(e)&&e.keyCode===o){if(!t.getBody().getElementsByTagName("hr").length)return;if(a.isCollapsed()&&0===a.getRng().startOffset){var n=a.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return u.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(u.remove(r),e.preventDefault())}}})),b(),e=function(){var e=u.getAttribs(a.getStart().cloneNode(!1));return function(){var n=a.getStart();n!==t.getBody()&&(u.setAttrib(n,"style",null),r(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},n=function(){return!a.isCollapsed()&&u.getParent(a.getStart(),u.isBlock)!==u.getParent(a.getEnd(),u.isBlock)},t.on("keypress",(function(r){var o;if(!g(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=e(),t.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),u.bind(t.getDoc(),"cut",(function(r){var o;!g(r)&&n()&&(o=e(),Gr.setEditorTimeout(t,(function(){o()})))})),x(),S(),k(),_(),w())),{refreshContentEditable:M,isHidden:function(){if(!s||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},gk=ea.DOM,hk=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},pk=function(t){return pt(t,(function(t){return!1===v(t)}))},vk=function(t){var e=t.settings,n=t.editorUpload.blobCache;return pk({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:hk(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},bk=function(t){var e=t.dom.getRoot();t.inline||_f(t)&&t.selection.getStart(!0)!==e||wl(e).each((function(e){var n=e.getNode(),r=kn(n)?wl(n).getOr(e):e;fe.browser.isIE()?function(t,e){var n=be.fromDom(t.getBody()),r=(Vd(t)?P.from(e):P.none()).map(jd).filter(Fd(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},yk=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),bk(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&Gr.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},wk=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},xk=function(t){var e=wk(t),n=ts(t),r=t.contentCSS,o=function(){e.unloadAll(r),t.inline||t.ui.styleSheetLoader.unloadAll(n)},i=function(){t.removed?o():t.on("remove",o)};if(t.contentStyles.length>0){var u="";pe.each(t.contentStyles,(function(t){u+=t+"\r\n"})),t.dom.addStyle(u)}var a=jr.all(function(t,e,n){var r=[new jr((function(n,r){return wk(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new jr((function(e,r){return t.ui.styleSheetLoader.loadAll(n,e,r)}))])}(t,r,n)).then(i).catch(i);return t.settings.content_style&&function(t,e){var n=be.fromDom(t.getBody()),r=Ke(Xe(n)),o=be.fromTag("style");Vn(o,"type","text/css"),en(o,be.fromText(e)),en(r,o),t.on("remove",(function(){on(o)}))}(t,t.settings.content_style),a},Ck=function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();!function(t){t.fire("PreInit")}(t),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,gk.setAttrib(r,"spellcheck","false")),t.quirks=mk(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",la.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){pe.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))},Sk=function(t){!0!==t.removed&&(!function(t){Tv(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),yk(t))},kk=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(gk.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===gk.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=cy(t),t.schema=pi(n),t.dom=ea(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:Yc(t),referrerPolicy:Jc(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=rb(vk(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,u=t.dom,a="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(a)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=u.serializeStyle(u.parseStyle(o),r.name)).length||(o=null),r.attr(a,o),r.attr(n,o)):"tabindex"===n?(r.attr(a,o),r.attr(n,null)):r.attr(a,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new vm("br",1)).shortEnded=!0)}})),e}(t),t.serializer=cb(function(t){var e=t.settings;return At(At({},vk(t)),pk({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before,block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements}))}(t),t),t.selection=Hv(t.dom,t.getWin(),t.serializer,t),t.annotator=If(t),t.formatter=hy(t),t.undoManager=vy(t),t._nodeChangeDispatcher=new XS(t),t._selectionOverrides=dk(t),iC(t),KS(t),Tv(t)||JS(t);var u=function(t){return Tv(t)?ua(null):$S(t)}(t);rC(t,u),function(t){Vc(t)&&t.on("NodeChange",E(sC,t))}(t),xy(t);var a=_v(t);Ck(t),a.fold((function(){xk(t).then((function(){return Sk(t)}))}),(function(e){t.setProgressState(!0),xk(t).then((function(){e().then((function(e){t.setProgressState(!1),Sk(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),Sk(t)}))}))}))},Ok=ea.DOM,Tk=function(t){var e=function(t){return t.getParam("doctype","<!DOCTYPE html>")}(t)+"<html><head>";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(t){return Hc(t,"body_id","tinymce")}(t),r=function(t){return Hc(t,"body_class","")}(t);return Fc(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+Fc(t)+'" />'),e+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>'},_k=function(t,e){var n,r,o,i,u=t.translate(function(t){return t.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string")}(t)),a=(n=t.id,r=u,e.height,o=function(t){return t.getParam("iframe_attrs",{})}(t),i=be.fromTag("iframe"),jn(i,o),jn(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),ya(i,"tox-edit-area__iframe"),i).dom;a.onload=function(){a.onload=null,t.fire("load")};var c=function(t,e){if(document.domain!==window.location.hostname&&fe.browser.isIE()){var n=oy("mce");t[n]=function(){kk(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return Ok.setAttrib(e,"src",r),!0}return!1}(t,a);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=a,t.iframeHTML=Tk(t),Ok.add(e.iframeContainer,a),c},Ek=ea.DOM,Ak=function(t,e,n){var r=Wb.get(n),o=Wb.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=pe.trim(n),r&&-1===pe.inArray(e,n)){if(pe.each(Wb.dependencies(n),(function(n){Ak(t,e,n)})),t.plugins[n])return;try{var i=new r(t,o,t.$);t.plugins[n]=i,i.init&&(i.init(t,o),e.push(n))}catch(e){!function(t,e,n){var r=la.translate(["Failed to initialize plugin: {0}",e]);Ff(t,"PluginLoadError",{message:r}),Qb(r,n),Xb(t,r)}(t,n,e)}}},Dk=function(t){return t.replace(/^\-/,"")},Mk=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},Nk=function(t){var e=t.getElement();return t.inline?Mk(null):function(t){var e=Ek.create("div");return Ek.insertAfter(e,t),Mk(e)}(e)},Rk=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,d(rs(t))?function(t){return t.theme.renderUI()}(t):w(rs(t))?function(t){var e=t.getElement(),n=rs(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):Nk(t)},zk=function(t){t.fire("ScriptsLoaded"),function(t){var e=pe.trim(qc(t)),n=t.ui.registry.getAll().icons,r=At(At({},zb.get("default").icons),zb.get(e).icons);ft(r,(function(e,r){yt(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=rs(t);if(d(e)){t.settings.theme=Dk(e);var n=qb.get(e);t.theme=new n(t,qb.urls[e]),t.theme.init&&t.theme.init(t,qb.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];pe.each(as(t).split(/[ ,]/),(function(n){Ak(t,e,Dk(n))}))}(t);var e=Rk(t);!function(t,e){var n={show:P.from(e.show).getOr(C),hide:P.from(e.hide).getOr(C),disable:P.from(e.disable).getOr(C),isDisabled:P.from(e.isDisabled).getOr(N),enable:function(){t.mode.isReadOnly()||P.from(e.enable).map(M)}};t.ui=At(At({},t.ui),n)}(t,P.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,ey(t),t.inline?kk(t):function(t,e){var n=_k(t,e);e.editorContainer&&(Ok.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=Ok.isHidden(e.editorContainer)),t.getElement().style.display="none",Ok.setAttrib(t.id,"aria-hidden","true"),n||kk(t)}(t,n)},Bk=ea.DOM,Ik=function(t){return"-"===t.charAt(0)},Pk=function(t,e){var n=Qc(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===la.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,C,void 0,(function(){!function(t,e,n){Kb(t,"LanguageLoadError",Yb("language",e,n))}(e,o,n)}))}},Lk=function(t,e,n){return P.from(e).filter((function(t){return t.length>0&&!zb.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:P.some(e)}}))},Hk=function(t,e,n){var r=Lk(e,"default",n),o=function(t){return P.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:P.none()}}))}(e).orThunk((function(){return Lk(e,qc(e),"")}));q(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([r,o]),(function(n){t.add(n.url,C,void 0,(function(){!function(t,e,n){Kb(t,"IconsLoadError",Yb("icons",e,n))}(e,n.url,n.name.getOrUndefined())}))}))},Fk=function(t,e){var n=ia.ScriptLoader;!function(t,e,n,r){var o=rs(e);if(d(o)){if(!Ik(o)&&!yt(qb.urls,o)){var i=function(t){return t.getParam("theme_url")}(e);i?qb.load(o,e.documentBaseURI.toAbsolute(i)):qb.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){qb.waitFor(o,r)}))}else r()}(n,t,e,(function(){Pk(n,t),Hk(n,t,e),function(t,e){pe.each(function(t){return t.getParam("external_plugins")}(t),(function(e,n){Wb.load(n,e,C,void 0,(function(){Jb(t,e,n)})),t.settings.plugins+=" "+n})),pe.each(as(t).split(/[ ,]/),(function(n){if((n=pe.trim(n))&&!Wb.urls[n])if(Ik(n)){n=n.substr(1,n.length);var r=Wb.dependencies(n);pe.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=Wb.createUrl(r,n);Wb.load(o.resource,o,C,void 0,(function(){Jb(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};Wb.load(n,o,C,void 0,(function(){Jb(t,o.prefix+o.resource+o.suffix,n)}))}}))}(t,e),n.loadQueue((function(){t.removed||zk(t)}),t,(function(){t.removed||zk(t)}))}))},Vk=function(t){var e=t.id;la.setCode(Qc(t));var n=function(){Bk.unbind(window,"ready",n),t.render()};if(_i.Event.domLoaded){if(t.getElement()&&fe.contentEditable){var r=be.fromDom(t.getElement()),o=function(t){return Y(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})}(r);t.on("remove",(function(){G(r.dom.attributes,(function(t){return qn(r,t.name)})),jn(r,o)})),t.ui.styleSheetLoader=function(t,e){return Xr.forElement(t,{contentCssCors:us(e),referrerPolicy:Jc(e)})}(r,t),!function(t){return t.getParam("inline")}(t)?(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden"):t.inline=!0;var i=t.getElement().form||Bk.getParent(e,"form");i&&(t.formElement=i,function(t){return t.getParam("hidden_input")}(t)&&!Tn(t.getElement())&&(Bk.insertAfter(Bk.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},Bk.bind(i,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!function(t){return t.getParam("submit_patch")}(t)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=Gb(t),t.notificationManager=Ub(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",(function(t){t.save&&(t.content=Bk.encode(t.content))})),function(t){return t.getParam("add_form_submit_trigger")}(t)&&t.on("submit",(function(){t.initialized&&t.save()})),function(t){return t.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),Fk(t,t.suffix)}}else Bk.bind(window,"ready",n)},jk=function(t,e){return function(t,e){return Av(t).editor.addVisual(e)}(t,e)},Uk={"font-size":"size","font-family":"face"},Wk=function(t,e,n){return jh(be.fromDom(n),(function(e){return function(e){return Kn(e,t).orThunk((function(){return"font"===Oe(e)?bt(Uk,t).bind((function(t){return Wn(e,t)})):P.none()}))}(e)}),(function(t){return Ce(be.fromDom(e),t)}))},qk=function(t){return function(e,n){return P.from(n).map(be.fromDom).filter(Ee).bind((function(n){return Wk(t,e,n.dom).or(function(t,e){return P.from(ea.DOM.getStyle(e,t,!0))}(t,n.dom))})).getOr("")}},Gk=qk("font-size"),$k=S((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),qk("font-family")),Xk=function(t){return wl(t.getBody()).map((function(t){var e=t.container();return _n(e)?e.parentNode:e}))},Kk=function(t,e){return function(t){return P.from(t.selection.getRng()).bind((function(e){var n=t.getBody();return e.startContainer===n&&0===e.startOffset?P.none():P.from(t.selection.getStart(!0))}))}(t).orThunk(E(Xk,t)).map(be.fromDom).filter(Ee).bind(e)},Yk=function(t,e){return Kk(t,k(P.some,e))},Jk=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return pe.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return pe.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},Qk=function(t){var e=t.split(/\s*,\s*/);return W(e,(function(t){return-1===t.indexOf(" ")||Pt(t,'"')||Pt(t,"'")?t:"'"+t+"'"})).join(",")},Zk=function(t,e){var n=function(t){if("string"!=typeof t){var e=pe.extend({paste:t.paste,data:{paste:t.paste}},t);return{content:t.content,details:e}}return{content:t,details:{}}}(e);!function(t,e,n){Ev(t).editor.insertContent(e,n)}(t,n.content,n.details)},tO=pe.each,eO=pe.map,nO=pe.inArray,rO=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,u=this;if(!u.editor.removed){var a;if("mcefocus"!==t.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(a=u.editor,Gd(a).each((function(t){return a.selection.setRng(t)}))):u.editor.focus()),(r=u.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var c=t.toLowerCase();if(o=u.commands.exec[c])return o(c,e,n),u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(tO(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1})),i)return i;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=u.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!i&&(u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},t.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;tO(t,(function(t,r){tO(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,u){return e.call(n||r.editor,o,i,u)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":C,"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},mceFocus:function(e,n,r){am(t,r)},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");fe.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),tO("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,{value:r})},FontName:function(e,n,r){!function(t,e){var n=Jk(t,e);t.formatter.toggle("fontname",{value:Qk(n)}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:Jk(t,e)}),t.nodeChanged()}(t,r)},LineHeight:function(e,n,r){!function(t,e){t.formatter.toggle("lineheight",{value:String(e)}),t.nodeChanged()}(t,r)},Lang:function(t,n,r){e.toggleFormat(t,{value:r.code,customValue:r.customCode})},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){Zk(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){MS(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){tC(t,e)},mceRepaint:C,InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),Rn);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return bS(t,r),!0}});var n=function(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=eO(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==nO(o,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return Jx(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return function(t){return Yk(t,(function(e){return $k(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return Yk(t,(function(e){return Gk(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return Yk(t,(function(e){var n=be.fromDom(t.getBody());return jh(e,(function(t){return Kn(t,"line-height")}),E(Ce,n)).getOrThunk((function(){var t=parseFloat($n(e,"line-height")),n=parseFloat($n(e,"font-size"));return String(t/n)}))})).getOr("")}(t)}),this)},t}(),oO=function(t,e,n){xa(t,e)&&!1===n?function(t,e){pa(t)?t.dom.classList.remove(e):ba(t,e);wa(t)}(t,e):n&&ya(t,e)},iO=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},uO=function(t,e){t.dom.contentEditable=e?"true":"false"},aO=function(t,e){var n=be.fromDom(t.getBody());oO(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){P.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,uO(n,!1),q(Sa(n,'*[contenteditable="true"]'),(function(t){Vn(t,"data-mce-contenteditable","true"),uO(t,!1)}))):(t.readonly=!1,uO(n,!0),function(t){q(Sa(t,'*[data-mce-contenteditable="true"]'),(function(t){qn(t,"data-mce-contenteditable"),uO(t,!0)}))}(n),iO(t,"StyleWithCSS",!1),iO(t,"enableInlineTableEditing",!1),iO(t,"enableObjectResizing",!1),im(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},cO=function(t){return t.readonly},sO=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){cO(t)&&q(e,(function(t){t.attr("data-mce-contenteditable",t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter("data-mce-contenteditable",(function(e){cO(t)&&q(e,(function(t){t.attr("contenteditable",t.attr("data-mce-contenteditable"))}))})),t.serializer.addTempAttr("data-mce-contenteditable")},lO=function(t,e){if(function(t){return"click"===t.type}(e)&&!Uf.metaKeyPressed(e)){var n=be.fromDom(e.target);(function(t,e){return Vr(e,"a",(function(e){return Ce(e,be.fromDom(t.getBody()))})).bind((function(t){return Wn(t,"href")}))})(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+(Pt(o=n,i="#")?function(t,e){return t.substring(e)}(o,i.length):o)+'"]');r.length&&t.selection.scrollIntoView(r[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o,i}))}},fO=pe.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),dO=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||N}return t.isNative=function(t){return!!fO[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=xi(n,e||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,u=o.length;i<u;i++){var a=o[i];if(!a.removed){if(a.once&&this.off(n,a.func),r.isImmediatePropagationStopped())return r;if(!1===a.func.call(this.scope,r))return r.preventDefault(),r}}return r},t.prototype.on=function(t,e,n,r){if(!1===e&&(e=N),e){var o={func:e,removed:!1};r&&pe.extend(o,r);for(var i=t.toLowerCase().split(" "),u=i.length;u--;){var a=i[u],c=this.bindings[a];c||(c=[],this.toggleEvent(a,!0)),c=n?Dt([o],c):Dt(Dt([],c),[o]),this.bindings[a]=c}}return this},t.prototype.off=function(t,e){var n=this;if(t)for(var r=t.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],u=this.bindings[i];if(!i)return ft(this.bindings,(function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]})),this;if(u){if(e){var a=$(u,(function(t){return t.func===e}));u=a.fail,this.bindings[i]=u,q(a.pass,(function(t){t.removed=!0}))}else u.length=0;u.length||(this.toggleEvent(t,!1),delete this.bindings[i])}}else ft(this.bindings,(function(t,e){n.toggleEvent(e,!1)})),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),mO=function(t){return t._eventDispatcher||(t._eventDispatcher=new dO({scope:t,toggleEvent:function(e,n){dO.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},gO={fire:function(t,e,n){if(this.removed&&"remove"!==t&&"detach"!==t)return e;var r=mO(this).fire(t,e);if(!1!==n&&this.parent)for(var o=this.parent();o&&!r.isPropagationStopped();)o.fire(t,r,!1),o=o.parent();return r},on:function(t,e,n){return mO(this).on(t,e,n)},off:function(t,e){return mO(this).off(t,e)},once:function(t,e){return mO(this).once(t,e)},hasEventListeners:function(t){return mO(this).has(t)}},hO=ea.DOM,pO=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=ns(t);return n?(t.eventRoot||(t.eventRoot=hO.select(n)[0]),t.eventRoot):t.getBody()},vO=function(t,e,n){!function(t){return!t.hidden&&!cO(t)}(t)?cO(t)&&lO(t,n):t.fire(e,n)},bO=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=pO(t,e);if(ns(t)){if(ax||(ax={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||ax&&(ft(ax,(function(e,n){t.dom.unbind(pO(t,n))})),ax=null)}))),ax[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var u=o[i].getBody();(u===r||hO.isChildOf(r,u))&&vO(o[i],e,n)}},ax[e]=n,hO.bind(r,e,n)}else n=function(n){vO(t,e,n)},hO.bind(r,e,n),t.delegates[e]=n}},yO=At(At({},gO),{bindPendingEventDelegates:function(){var t=this;pe.each(t._pendingNativeEvents,(function(e){bO(t,e)}))},toggleNativeEvent:function(t,e){"focus"!==t&&"blur"!==t&&(this.removed||(e?this.initialized?bO(this,t):this._pendingNativeEvents?this._pendingNativeEvents.push(t):this._pendingNativeEvents=[t]:this.initialized&&(this.dom.unbind(pO(this,t),t,this.delegates[t]),delete this.delegates[t])))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(ft(t.delegates,(function(e,n){t.dom.unbind(pO(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),wO=["design","readonly"],xO=function(t,e,n,r){var o=n[e.get()],i=n[r];try{i.activate()}catch(t){return void console.error("problem while activating editor mode "+r+":",t)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&aO(t,i.editorReadOnly),e.set(r),function(t,e){t.fire("SwitchMode",{mode:e})}(t,r)},CO=function(t){var e=ua("design"),n=ua({design:{activate:C,deactivate:C,editorReadOnly:!1},readonly:{activate:C,deactivate:C,editorReadOnly:!0}});return function(t){t.serializer?sO(t):t.on("PreInit",(function(){sO(t)}))}(t),function(t){t.on("ShowCaret",(function(e){cO(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){cO(t)&&e.preventDefault()}))}(t),{isReadOnly:function(){return cO(t)},set:function(r){return function(t,e,n,r){if(r!==n.get()){if(!yt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?xO(t,n,e,r):t.on("init",(function(){return xO(t,n,e,r)}))}}(t,n.get(),e,r)},get:function(){return e.get()},register:function(t,e){n.set(function(t,e,n){var r;if(j(wO,e))throw new Error("Cannot override default mode "+e);return At(At({},t),((r={})[e]=At(At({},n),{deactivate:function(){try{n.deactivate()}catch(t){console.error("problem while deactivating editor mode "+e+":",t)}}}),r))}(n.get(),t,e))}}},SO=pe.each,kO=pe.explode,OO={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},TO=pe.makeMap("alt,ctrl,shift,meta,access"),_O=function(t){var e,n={};SO(kO(t.toLowerCase(),"+"),(function(t){t in TO?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=OO[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in TO)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,fe.mac?n.ctrl=!0:n.shift=!0),n.meta&&(fe.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},EO=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(SO(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}return t.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return SO(kO(pe.trim(t)),(function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n})),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"==typeof n?function(){e.editor.execCommand(n,!1,null)}:pe.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},t.prototype.createShortcut=function(t,e,n,r){var o=pe.map(kO(t,">"),_O);return o[o.length-1]=pe.extend(o[o.length-1],{func:n,scope:r||this.editor}),pe.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&(e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&(e.alt===t.altKey&&e.shift===t.shiftKey&&(!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0))))},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),AO=function(){var t=function(){var t={},e={},n={},r={},o={},i={},u={},a=function(t,e){return function(n,r){return t[n.toLowerCase()]=At(At({},r),{type:e})}};return{addButton:a(t,"button"),addGroupToolbarButton:a(t,"grouptoolbarbutton"),addToggleButton:a(t,"togglebutton"),addMenuButton:a(t,"menubutton"),addSplitButton:a(t,"splitbutton"),addMenuItem:a(e,"menuitem"),addNestedMenuItem:a(e,"nestedmenuitem"),addToggleMenuItem:a(e,"togglemenuitem"),addAutocompleter:a(n,"autocompleter"),addContextMenu:a(o,"contextmenu"),addContextToolbar:a(i,"contexttoolbar"),addContextForm:a(i,"contextform"),addSidebar:a(u,"sidebar"),addIcon:function(t,e){return r[t.toLowerCase()]=e},getAll:function(){return{buttons:t,menuItems:e,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:u}}}}();return{addAutocompleter:t.addAutocompleter,addButton:t.addButton,addContextForm:t.addContextForm,addContextMenu:t.addContextMenu,addContextToolbar:t.addContextToolbar,addIcon:t.addIcon,addMenuButton:t.addMenuButton,addMenuItem:t.addMenuItem,addNestedMenuItem:t.addNestedMenuItem,addSidebar:t.addSidebar,addSplitButton:t.addSplitButton,addToggleButton:t.addToggleButton,addGroupToolbarButton:t.addGroupToolbarButton,addToggleMenuItem:t.addToggleMenuItem,getAll:t.getAll}},DO=pe.each,MO=pe.trim,NO="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),RO={ftp:21,http:80,https:443,mailto:25},zO=function(){function t(e,n){e=MO(e),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))o.source=e;else{var i=0===e.indexOf("//");if(0!==e.indexOf("/")||i||(e=(r&&r.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+o.toAbsPath(u,e);else{var a=/([^#?]*)([#?]?.*)/.exec(e);e=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(u,a[1])+a[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);DO(NO,(function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[t]=n})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="")}}return t.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=RO[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",u=t.substring(0,t.lastIndexOf("/")).split("/"),a=e.split("/");if(u.length>=a.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||u[n]!==a[n]){o=n+1;break}if(u.length<a.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||u[n]!==a[n]){o=n+1;break}if(1===o)return e;for(n=0,r=u.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=a.length;n<r;n++)i+=n!==o-1?"/"+a[n]:a[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],u=/\/$/.test(e)?"/":"",a=t.split("/"),c=e.split("/");for(DO(a,(function(t){t&&i.push(t)})),a=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=a.length-o)<=0?nt(i).join("/"):a.slice(0,n).join("/")+"/"+nt(i).join("/")).indexOf("/")&&(r="/"+r),u&&r.lastIndexOf("/")!==r.length-1&&(r+=u),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),BO=ea.DOM,IO=pe.extend,PO=pe.each,LO=pe.resolve,HO=fe.ie,FO=function(){function t(t,e,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,IO(this,yO),this.settings=Mb(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(ia.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),ea.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),fa.languageLoad=this.settings.language_load,fa.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new zO(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new EO(this),this.editorCommands=new rO(this),this.settings.cache_suffix&&(fe.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:AO(),styleSheetLoader:void 0,show:C,hide:C,enable:C,disable:C,isDisabled:N};var o=CO(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Xu.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}return t.prototype.render=function(){Vk(this)},t.prototype.focus=function(t){this.execCommand("mceFocus",!1,t)},t.prototype.hasFocus=function(){return om(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?LO(r):0,i=LO(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return la.translate(t)},t.prototype.getParam=function(t,e,n){return Rb(this,t,e,n)},t.prototype.hasPlugin=function(t,e){return!!j(as(this).split(/[ ,]/),t)&&(!e||void 0!==Wb.get(t))},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable="true":(BO.show(this.getContainer()),BO.hide(this.id)),this.load(),this.fire("show"))},t.prototype.hide=function(){var t=this.getDoc();this.hidden||(HO&&t&&!this.inline&&t.execCommand("SelectAll"),this.save(),this.inline?(this.getBody().contentEditable="false",this===this.editorManager.focusedEditor&&(this.editorManager.focusedEditor=null)):(BO.hide(this.getContainer()),BO.setStyle(this.id,"display",this.orgDisplay)),this.hidden=!0,this.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this.getElement();if(this.removed)return"";if(n){(t=t||{}).load=!0;var r=Tn(n)?n.value:n.innerHTML;return e=this.setContent(r,t),t.element=n,t.no_events||this.fire("LoadContent",t),t.element=n=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,Tn(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=BO.getParent(r.id,"form"))&&PO(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return lb(this,t,e)},t.prototype.getContent=function(t){return sb(this,t)},t.prototype.insertContent=function(t,e){e&&(t=IO({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?lb(this,this.startContent,{format:"raw"}):lb(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){return this.container||(this.container=BO.get(this.editorContainer||this.id+"_parent")),this.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=BO.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t;return this.contentWindow||(t=this.iframeElement)&&(this.contentWindow=t.contentWindow),this.contentWindow},t.prototype.getDoc=function(){var t;return this.contentDocument||(t=this.getWin())&&(this.contentDocument=t.document),this.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",t,n,!0,e):!r.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:r.relative_urls?this.documentBaseURI.toRelative(t):t=this.documentBaseURI.toAbsolute(t,r.remove_script_host)},t.prototype.addVisual=function(t){jk(this,t)},t.prototype.remove=function(){mb(this)},t.prototype.destroy=function(t){gb(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),VO=ea.DOM,jO=pe.explode,UO=pe.each,WO=pe.extend,qO=0,GO=!1,$O=[],XO=[],KO=function(t){var e=t.type;UO(ZO.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))},YO=function(t){t!==GO&&(t?Xu(window).on("resize scroll",KO):Xu(window).off("resize scroll",KO),GO=t)},JO=function(t){var e=XO;delete $O[t.id];for(var n=0;n<$O.length;n++)if($O[n]===t){$O.splice(n,1);break}return XO=X(XO,(function(e){return t!==e})),ZO.activeEditor===t&&(ZO.activeEditor=XO.length>0?XO[0]:null),ZO.focusedEditor===t&&(ZO.focusedEditor=null),e.length!==XO.length},QO="CSS1Compat"!==document.compatMode,ZO=At(At({},gO),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Xu,majorVersion:"5",minorVersion:"9.2",releaseDate:"2021-09-08",editors:$O,i18n:la,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n="";e=zO.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var r,o=window.tinymce||window.tinyMCEPreInit;if(o)t=o.base||o.baseURL,n=o.suffix;else{for(var i=document.getElementsByTagName("script"),u=0;u<i.length;u++){var a;if(""!==(a=i[u].src||"")){var c=a.substring(a.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!==c.indexOf(".min")&&(n=".min"),t=a.substring(0,a.lastIndexOf("/"));break}}}if(!t&&document.currentScript)-1!==(a=document.currentScript.src).indexOf(".min")&&(n=".min"),t=a.substring(0,a.lastIndexOf("/"))}this.baseURL=new zO(e).toAbsolute(t),this.documentBaseURL=e,this.baseURI=new zO(this.baseURL),this.suffix=n,(r=this).on("AddEditor",E(Qd,r)),r.on("RemoveEditor",E(Zd,r))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&ft(r,(function(t,e){fa.PluginManager.urls[e]=t}))},init:function(t){var e,n=this,r=pe.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),o=function(t){var e=t.id;return e||(e=bt(t,"name").filter((function(t){return!VO.get(t)})).getOrThunk(VO.uniqueId),t.setAttribute("id",e)),e},i=function(t,e){return e.constructor===RegExp?e.test(t.className):VO.hasClass(t,e)},u=function(t){e=t},a=function(){var e,c=0,s=[],l=function(t,r,o){var i=new FO(t,r,n);s.push(i),i.on("init",(function(){++c===e.length&&u(s)})),i.targetElm=i.targetElm||o,i.render()};VO.unbind(window,"ready",a),function(e){var r=t[e];if(r)r.apply(n,[])}("onpageload"),e=Xu.unique(function(t){var e=[];if(fe.browser.isIE()&&fe.browser.version.major<11)return Qb("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(QO)return Qb("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return UO(t.types,(function(t){e=e.concat(VO.select(t.selector))})),e;if(t.selector)return VO.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";n.length>0&&UO(jO(n),(function(t){var n=VO.get(t);n?e.push(n):UO(document.forms,(function(n){UO(n.elements,(function(n){n.name===t&&(t="mce_editor_"+qO++,VO.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":UO(VO.select("textarea"),(function(n){t.editor_deselector&&i(n,t.editor_deselector)||t.editor_selector&&!i(n,t.editor_selector)||e.push(n)}))}return e}(t)),t.types?UO(t.types,(function(n){pe.each(e,(function(e){return!VO.is(e,n.selector)||(l(o(e),WO({},t,n),e),!1)}))})):(pe.each(e,(function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(JO(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=pe.grep(e,(function(t){return!n.get(t.id)}))).length?u([]):UO(e,(function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in r}(t,e)?l(o(e),t,e):Qb("Could not initialize inline editor on invalid inline target element",e)})))};return n.settings=t,VO.bind(window,"ready",a),new jr((function(t){e?t(e):u=function(e){t(e)}}))},get:function(t){return 0===arguments.length?XO.slice(0):d(t)?Q(XO,(function(e){return e.id===t})).getOr(null):x(t)&&XO[t]?XO[t]:null},add:function(t){var e=this;return $O[t.id]===t?t:(null===e.get(t.id)&&("length"!==t.id&&($O[t.id]=t),$O.push(t),XO.push(t)),YO(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),cx||(cx=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",cx)),t)},createEditor:function(t,e){return this.add(new FO(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!d(t))return n=t,h(r.get(n.id))?null:(JO(n)&&r.fire("RemoveEditor",{editor:n}),0===XO.length&&window.removeEventListener("beforeunload",cx),n.remove(),YO(XO.length>0),n);UO(VO.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=XO.length-1;e>=0;e--)r.remove(XO[e])},execCommand:function(t,e,n){var r=this.get(n);switch(t){case"mceAddEditor":return this.get(n)||new FO(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?(r.isHidden()?r.show():r.hide(),!0):(this.execCommand("mceAddEditor",!1,n),!0)}return!!this.activeEditor&&this.activeEditor.execCommand(t,e,n)},triggerSave:function(){UO(XO,(function(t){t.save()}))},addI18n:function(t,e){la.add(t,e)},translate:function(t){return la.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new zO(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new zO(this.baseURL)}});ZO.setup();var tT,eT,nT,rT,oT=Math.min,iT=Math.max,uT=Math.round,aT=function(t,e,n){var r=e.x,o=e.y,i=t.w,u=t.h,a=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=a),"c"===s[0]&&(o+=uT(c/2)),"c"===s[1]&&(r+=uT(a/2)),"b"===s[3]&&(o-=u),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=uT(u/2)),"c"===s[4]&&(r-=uT(i/2)),cT(r,o,i,u)},cT=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},sT={inflate:function(t,e,n){return cT(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:aT,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=aT(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=iT(t.x,e.x),r=iT(t.y,e.y),o=oT(t.x+t.w,e.x+e.w),i=oT(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:cT(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,u=t.y+t.h,a=e.x+e.w,c=e.y+e.h,s=iT(0,e.x-r),l=iT(0,e.y-o),f=iT(0,i-a),d=iT(0,u-c);return r+=s,o+=l,n&&(i+=s,u+=l,r-=f,o-=d),cT(r,o,(i-=f)-r,(u-=d)-o)},create:cT,fromClientRect:function(t){return cT(t.left,t.top,t.width,t.height)}},lT=(tT={},eT={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==tT[t])return tT[t];var o=new jr((function(o,i){var u=function(t,e,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),t.apply(null,e))}},u=i(t),a=i(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r||null!==o||(o=setTimeout((function(){return a.apply(null,t)}),n))},resolve:u,reject:a}}(o,i);eT[t]=u.resolve,ia.ScriptLoader.loadScript(e,(function(){return u.start(r)}),(function(){return u.reject(n)}))}));return tT[t]=o,o},add:function(t,e){void 0!==eT[t]&&(eT[t](e),delete eT[t]),tT[t]=jr.resolve(e)}}),fT=pe.each,dT=pe.extend,mT=function(){};mT.extend=nT=function(t){var e=this.prototype,n=function(){var t,e,n,r=this;if(!rT&&(r.init&&r.init.apply(r,arguments),e=r.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(r,arguments)},r=function(){return this};rT=!0;var o=new this;return rT=!1,t.Mixins&&(fT(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&fT(t.Methods.split(","),(function(e){t[e]=r})),t.Properties&&fT(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){return void 0!==t?(this[n]=t,this):this[n]}})),t.Statics&&fT(t.Statics,(function(t,e){n[e]=t})),t.Defaults&&e.Defaults&&(t.Defaults=dT({},e.Defaults,t.Defaults)),ft(t,(function(t,n){"function"==typeof t&&e[n]?o[n]=function(t,n){return function(){var r=this,o=r._super;r._super=e[t];var i=n.apply(r,arguments);return r._super=o,i}}(n,t):o[n]=t})),n.prototype=o,n.constructor=n,n.extend=nT,n};var gT,hT=Math.min,pT=Math.max,vT=Math.round,bT={serialize:function(t){var e=JSON.stringify(t);return d(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},yT={callbacks:{},count:0,send:function(t){var e=this,n=ea.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},wT=At(At({},gO),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||n++>1e4?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,n>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):Gr.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",wT.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&pe.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=wT.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();Gr.setTimeout(r,10)}}),xT=pe.extend,CT=function(){function t(t){this.settings=xT({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=xT(this.settings,t);r.success=function(t,o){void 0===(t=bT.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=bT.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",wT.send(r)},t}();try{var ST="__storage_test__";(gT=window.localStorage).setItem(ST,ST),gT.removeItem(ST)}catch(t){gT=function(){var t={},e=[],n={getItem:function(e){var n=t[e];return n||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter((function(t){return t===n})),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()}var kT={geom:{Rect:sT},util:{Promise:jr,Delay:Gr,Tools:pe,VK:Uf,URI:zO,Class:mT,EventDispatcher:dO,Observable:gO,I18n:la,XHR:wT,JSON:bT,JSONRequest:CT,JSONP:yT,LocalStorage:gT,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==typeof t?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=pT(0,hT(e,1)),i=pT(0,hT(i,1)),0!==e){var u=t/60,a=i*e,c=a*(1-Math.abs(u%2-1)),s=i-a;switch(Math.floor(u)){case 0:n=a,r=c,o=0;break;case 1:n=c,r=a,o=0;break;case 2:n=0,r=a,o=c;break;case 3:n=0,r=c,o=a;break;case 4:n=c,r=0,o=a;break;case 5:n=a,r=0,o=c;break;default:n=r=o=0}n=vT(255*(n+s)),r=vT(255*(r+s)),o=vT(255*(o+s))}else n=r=o=vT(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=hT(t/=255,hT(e/=255,n/=255)),u=pT(t,pT(e,n));return i===u?{h:0,s:0,v:100*(o=i)}:(r=(u-i)/u,o=u,{h:vT(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(u-i))),s:vT(100*r),v:vT(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e},ImageUploader:function(t){var e=ny(),n=ay(t,e);return{upload:function(e,r){return void 0===r&&(r=!0),n.upload(e,r?uy(t):void 0)}}}},dom:{EventUtils:_i,Sizzle:cu,DomQuery:Xu,TreeWalker:Kr,TextSeeker:La,DOMUtils:ea,ScriptLoader:ia,RangeUtils:ud,Serializer:cb,StyleSheetLoader:$r,ControlSelection:qf,BookmarkManager:Pf,Selection:Hv,Event:_i.Event},html:{Styles:bi,Entities:ui,Node:vm,Schema:pi,SaxParser:Om,DomParser:rb,Writer:Nm,Serializer:Rm},Env:fe,AddOnManager:fa,Annotator:If,Formatter:hy,UndoManager:vy,EditorCommands:rO,WindowManager:Gb,NotificationManager:Ub,EditorObservable:yO,Shortcuts:EO,Editor:FO,FocusManager:$d,EditorManager:ZO,DOM:ea.DOM,ScriptLoader:ia.ScriptLoader,PluginManager:Wb,ThemeManager:qb,IconManager:zb,Resource:lT,trim:pe.trim,isArray:pe.isArray,is:pe.is,toArray:pe.toArray,makeMap:pe.makeMap,each:pe.each,map:pe.map,grep:pe.grep,inArray:pe.inArray,extend:pe.extend,create:pe.create,walk:pe.walk,createNS:pe.createNS,resolve:pe.resolve,explode:pe.explode,_addCacheSuffix:pe._addCacheSuffix,isOpera:fe.opera,isWebKit:fe.webkit,isIE:fe.ie,isGecko:fe.gecko,isMac:fe.mac},OT=pe.extend(ZO,kT);!function(t){window.tinymce=t,window.tinyMCE=t}(OT),function(e){try{t.exports=e}catch(t){}}(OT)}()}).call(this,n(28))},341:function(t,e,n){n(620)},342:function(t,e,n){n(621)},343:function(t,e,n){n(622)},344:function(t,e,n){n(623)},345:function(t,e,n){n(624)},346:function(t,e,n){n(625)},347:function(t,e,n){n(626)},348:function(t,e,n){n(627)},349:function(t,e,n){n(628)},350:function(t,e,n){n(629)},351:function(t,e,n){n(630)},352:function(t,e,n){n(631)},373:function(t,e,n){"use strict";(function(e){var r=n(374),o=n(375),i=n(376);t.exports=function(t){var n,a,c=[],s=1;if("string"==typeof t)if(r[t])c=r[t].slice(),a="rgb";else if("transparent"===t)s=0,a="rgb",c=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var l=(m=t.slice(1)).length;s=1,l<=4?(c=[parseInt(m[0]+m[0],16),parseInt(m[1]+m[1],16),parseInt(m[2]+m[2],16)],4===l&&(s=parseInt(m[3]+m[3],16)/255)):(c=[parseInt(m[0]+m[1],16),parseInt(m[2]+m[3],16),parseInt(m[4]+m[5],16)],8===l&&(s=parseInt(m[6]+m[7],16)/255)),c[0]||(c[0]=0),c[1]||(c[1]=0),c[2]||(c[2]=0),a="rgb"}else if(n=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=n[1],d="rgb"===f,m=f.replace(/a$/,"");a=m;l="cmyk"===m?4:"gray"===m?1:3;c=n[2].trim().split(/\s*,\s*/).map((function(t,e){if(/%$/.test(t))return e===l?parseFloat(t)/100:"rgb"===m?255*parseFloat(t)/100:parseFloat(t);if("h"===m[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==u[t])return u[t]}return parseFloat(t)})),f===m&&c.push(1),s=d?1:void 0===c[l]?1:c[l],c=c.slice(0,l)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(c=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),a=t.match(/([a-z])/gi).join("").toLowerCase());else if(isNaN(t))if(o(t)){var g=i(t.r,t.red,t.R,null);null!==g?(a="rgb",c=[g,i(t.g,t.green,t.G),i(t.b,t.blue,t.B)]):(a="hsl",c=[i(t.h,t.hue,t.H),i(t.s,t.saturation,t.S),i(t.l,t.lightness,t.L,t.b,t.brightness)]),s=i(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(s/=100)}else(Array.isArray(t)||e.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(c=[t[0],t[1],t[2]],a="rgb",s=4===t.length?t[3]:1);else a="rgb",c=[t>>>16,(65280&t)>>>8,255&t];return{space:a,values:c,alpha:s}};var u={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,n(28))},374:function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},375:function(t,e,n){"use strict";var r=Object.prototype.toString;t.exports=function(t){var e;return"[object Object]"===r.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},376:function(t,e){t.exports=function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}},377:function(t,e,n){"use strict";var r=n(378);t.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,n,r,o,i,u=t[0]/360,a=t[1]/100,c=t[2]/100;if(0===a)return[i=255*c,i,i];e=2*c-(n=c<.5?c*(1+a):c+a-c*a),o=[0,0,0];for(var s=0;s<3;s++)(r=u+1/3*-(s-1))<0?r++:r>1&&r--,i=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,o[s]=255*i;return o}},r.hsl=function(t){var e,n,r=t[0]/255,o=t[1]/255,i=t[2]/255,u=Math.min(r,o,i),a=Math.max(r,o,i),c=a-u;return a===u?e=0:r===a?e=(o-i)/c:o===a?e=2+(i-r)/c:i===a&&(e=4+(r-o)/c),(e=Math.min(60*e,360))<0&&(e+=360),n=(u+a)/2,[e,100*(a===u?0:n<=.5?c/(a+u):c/(2-a-u)),100*n]}},378:function(t,e,n){"use strict";t.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},39:function(t,e,n){"use strict";n.r(e);var r="top",o="bottom",i="right",u="left",a=[r,o,i,u],c=a.reduce((function(t,e){return t.concat([e+"-start",e+"-end"])}),[]),s=[].concat(a,["auto"]).reduce((function(t,e){return t.concat([e,e+"-start",e+"-end"])}),[]),l=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function f(t){return t?(t.nodeName||"").toLowerCase():null}function d(t){if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function m(t){return t instanceof d(t).Element||t instanceof Element}function g(t){return t instanceof d(t).HTMLElement||t instanceof HTMLElement}var h={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},o=e.elements[t];g(o)&&f(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(t){var e=r[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var r=e.elements[t],o=e.attributes[t]||{},i=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});g(r)&&f(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]};function p(t){return t.split("-")[0]}function v(t){return{x:t.offsetLeft,y:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}}function b(t,e){var n,r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&((n=r)instanceof d(n).ShadowRoot||n instanceof ShadowRoot)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function y(t){return d(t).getComputedStyle(t)}function w(t){return["table","td","th"].indexOf(f(t))>=0}function x(t){return((m(t)?t.ownerDocument:t.document)||window.document).documentElement}function C(t){return"html"===f(t)?t:t.assignedSlot||t.parentNode||t.host||x(t)}function S(t){if(!g(t)||"fixed"===y(t).position)return null;var e=t.offsetParent;if(e){var n=x(e);if("body"===f(e)&&"static"===y(e).position&&"static"!==y(n).position)return n}return e}function k(t){for(var e=d(t),n=S(t);n&&w(n)&&"static"===y(n).position;)n=S(n);return n&&"body"===f(n)&&"static"===y(n).position?e:n||function(t){for(var e=C(t);g(e)&&["html","body"].indexOf(f(e))<0;){var n=y(e);if("none"!==n.transform||"none"!==n.perspective||n.willChange&&"auto"!==n.willChange)return e;e=e.parentNode}return null}(t)||e}function O(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function T(t,e,n){return Math.max(t,Math.min(e,n))}function _(t){return Object.assign(Object.assign({},{top:0,right:0,bottom:0,left:0}),t)}function E(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}var A={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,a=t.name,c=n.elements.arrow,s=n.modifiersData.popperOffsets,l=p(n.placement),f=O(l),d=[u,i].indexOf(l)>=0?"height":"width";if(c&&s){var m=n.modifiersData[a+"#persistent"].padding,g=v(c),h="y"===f?r:u,b="y"===f?o:i,y=n.rects.reference[d]+n.rects.reference[f]-s[f]-n.rects.popper[d],w=s[f]-n.rects.reference[f],x=k(c),C=x?"y"===f?x.clientHeight||0:x.clientWidth||0:0,S=y/2-w/2,_=m[h],E=C-g[d]-m[b],A=C/2-g[d]/2+S,D=T(_,A,E),M=f;n.modifiersData[a]=((e={})[M]=D,e.centerOffset=D-A,e)}},effect:function(t){var e=t.state,n=t.options,r=t.name,o=n.element,i=void 0===o?"[data-popper-arrow]":o,u=n.padding,c=void 0===u?0:u;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&b(e.elements.popper,i)&&(e.elements.arrow=i,e.modifiersData[r+"#persistent"]={padding:_("number"!=typeof c?c:E(c,a))})},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},D={top:"auto",right:"auto",bottom:"auto",left:"auto"};function M(t){var e,n=t.popper,a=t.popperRect,c=t.placement,s=t.offsets,l=t.position,f=t.gpuAcceleration,m=t.adaptive,g=t.roundOffsets?function(t){var e=t.x,n=t.y,r=window.devicePixelRatio||1;return{x:Math.round(e*r)/r||0,y:Math.round(n*r)/r||0}}(s):s,h=g.x,p=void 0===h?0:h,v=g.y,b=void 0===v?0:v,y=s.hasOwnProperty("x"),w=s.hasOwnProperty("y"),C=u,S=r,O=window;if(m){var T=k(n);T===d(n)&&(T=x(n)),c===r&&(S=o,b-=T.clientHeight-a.height,b*=f?1:-1),c===u&&(C=i,p-=T.clientWidth-a.width,p*=f?1:-1)}var _,E=Object.assign({position:l},m&&D);return f?Object.assign(Object.assign({},E),{},((_={})[S]=w?"0":"",_[C]=y?"0":"",_.transform=(O.devicePixelRatio||1)<2?"translate("+p+"px, "+b+"px)":"translate3d("+p+"px, "+b+"px, 0)",_)):Object.assign(Object.assign({},E),{},((e={})[S]=w?b+"px":"",e[C]=y?p+"px":"",e.transform="",e))}var N={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,u=void 0===i||i,a=n.roundOffsets,c=void 0===a||a,s={placement:p(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign(Object.assign({},e.styles.popper),M(Object.assign(Object.assign({},s),{},{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:u,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign(Object.assign({},e.styles.arrow),M(Object.assign(Object.assign({},s),{},{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign(Object.assign({},e.attributes.popper),{},{"data-popper-placement":e.placement})},data:{}},R={passive:!0};var z={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=void 0===o||o,u=r.resize,a=void 0===u||u,c=d(e.elements.popper),s=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&s.forEach((function(t){t.addEventListener("scroll",n.update,R)})),a&&c.addEventListener("resize",n.update,R),function(){i&&s.forEach((function(t){t.removeEventListener("scroll",n.update,R)})),a&&c.removeEventListener("resize",n.update,R)}},data:{}},B={left:"right",right:"left",bottom:"top",top:"bottom"};function I(t){return t.replace(/left|right|bottom|top/g,(function(t){return B[t]}))}var P={start:"end",end:"start"};function L(t){return t.replace(/start|end/g,(function(t){return P[t]}))}function H(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function F(t){var e=d(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function V(t){return H(x(t)).left+F(t).scrollLeft}function j(t){var e=y(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function U(t,e){void 0===e&&(e=[]);var n=function t(e){return["html","body","#document"].indexOf(f(e))>=0?e.ownerDocument.body:g(e)&&j(e)?e:t(C(e))}(t),r="body"===f(n),o=d(n),i=r?[o].concat(o.visualViewport||[],j(n)?n:[]):n,u=e.concat(i);return r?u:u.concat(U(C(i)))}function W(t){return Object.assign(Object.assign({},t),{},{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function q(t,e){return"viewport"===e?W(function(t){var e=d(t),n=x(t),r=e.visualViewport,o=n.clientWidth,i=n.clientHeight,u=0,a=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(u=r.offsetLeft,a=r.offsetTop)),{width:o,height:i,x:u+V(t),y:a}}(t)):g(e)?function(t){var e=H(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):W(function(t){var e=x(t),n=F(t),r=t.ownerDocument.body,o=Math.max(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),i=Math.max(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),u=-n.scrollLeft+V(t),a=-n.scrollTop;return"rtl"===y(r||e).direction&&(u+=Math.max(e.clientWidth,r?r.clientWidth:0)-o),{width:o,height:i,x:u,y:a}}(x(t)))}function G(t,e,n){var r="clippingParents"===e?function(t){var e=U(C(t)),n=["absolute","fixed"].indexOf(y(t).position)>=0&&g(t)?k(t):t;return m(n)?e.filter((function(t){return m(t)&&b(t,n)&&"body"!==f(t)})):[]}(t):[].concat(e),o=[].concat(r,[n]),i=o[0],u=o.reduce((function(e,n){var r=q(t,n);return e.top=Math.max(r.top,e.top),e.right=Math.min(r.right,e.right),e.bottom=Math.min(r.bottom,e.bottom),e.left=Math.max(r.left,e.left),e}),q(t,i));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function $(t){return t.split("-")[1]}function X(t){var e,n=t.reference,a=t.element,c=t.placement,s=c?p(c):null,l=c?$(c):null,f=n.x+n.width/2-a.width/2,d=n.y+n.height/2-a.height/2;switch(s){case r:e={x:f,y:n.y-a.height};break;case o:e={x:f,y:n.y+n.height};break;case i:e={x:n.x+n.width,y:d};break;case u:e={x:n.x-a.width,y:d};break;default:e={x:n.x,y:n.y}}var m=s?O(s):null;if(null!=m){var g="y"===m?"height":"width";switch(l){case"start":e[m]=e[m]-(n[g]/2-a[g]/2);break;case"end":e[m]=e[m]+(n[g]/2-a[g]/2)}}return e}function K(t,e){void 0===e&&(e={});var n=e,u=n.placement,c=void 0===u?t.placement:u,s=n.boundary,l=void 0===s?"clippingParents":s,f=n.rootBoundary,d=void 0===f?"viewport":f,g=n.elementContext,h=void 0===g?"popper":g,p=n.altBoundary,v=void 0!==p&&p,b=n.padding,y=void 0===b?0:b,w=_("number"!=typeof y?y:E(y,a)),C="popper"===h?"reference":"popper",S=t.elements.reference,k=t.rects.popper,O=t.elements[v?C:h],T=G(m(O)?O:O.contextElement||x(t.elements.popper),l,d),A=H(S),D=X({reference:A,element:k,strategy:"absolute",placement:c}),M=W(Object.assign(Object.assign({},k),D)),N="popper"===h?M:A,R={top:T.top-N.top+w.top,bottom:N.bottom-T.bottom+w.bottom,left:T.left-N.left+w.left,right:N.right-T.right+w.right},z=t.modifiersData.offset;if("popper"===h&&z){var B=z[c];Object.keys(R).forEach((function(t){var e=[i,o].indexOf(t)>=0?1:-1,n=[r,o].indexOf(t)>=0?"y":"x";R[t]+=B[n]*e}))}return R}var Y={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,l=t.name;if(!e.modifiersData[l]._skip){for(var f=n.mainAxis,d=void 0===f||f,m=n.altAxis,g=void 0===m||m,h=n.fallbackPlacements,v=n.padding,b=n.boundary,y=n.rootBoundary,w=n.altBoundary,x=n.flipVariations,C=void 0===x||x,S=n.allowedAutoPlacements,k=e.options.placement,O=p(k),T=h||(O===k||!C?[I(k)]:function(t){if("auto"===p(t))return[];var e=I(t);return[L(t),e,L(e)]}(k)),_=[k].concat(T).reduce((function(t,n){return t.concat("auto"===p(n)?function(t,e){void 0===e&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,u=n.padding,l=n.flipVariations,f=n.allowedAutoPlacements,d=void 0===f?s:f,m=$(r),g=m?l?c:c.filter((function(t){return $(t)===m})):a,h=g.filter((function(t){return d.indexOf(t)>=0}));0===h.length&&(h=g);var v=h.reduce((function(e,n){return e[n]=K(t,{placement:n,boundary:o,rootBoundary:i,padding:u})[p(n)],e}),{});return Object.keys(v).sort((function(t,e){return v[t]-v[e]}))}(e,{placement:n,boundary:b,rootBoundary:y,padding:v,flipVariations:C,allowedAutoPlacements:S}):n)}),[]),E=e.rects.reference,A=e.rects.popper,D=new Map,M=!0,N=_[0],R=0;R<_.length;R++){var z=_[R],B=p(z),P="start"===$(z),H=[r,o].indexOf(B)>=0,F=H?"width":"height",V=K(e,{placement:z,boundary:b,rootBoundary:y,altBoundary:w,padding:v}),j=H?P?i:u:P?o:r;E[F]>A[F]&&(j=I(j));var U=I(j),W=[];if(d&&W.push(V[B]<=0),g&&W.push(V[j]<=0,V[U]<=0),W.every((function(t){return t}))){N=z,M=!1;break}D.set(z,W)}if(M)for(var q=function(t){var e=_.find((function(e){var n=D.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return N=e,"break"},G=C?3:1;G>0;G--){if("break"===q(G))break}e.placement!==N&&(e.modifiersData[l]._skip=!0,e.placement=N,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function J(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Q(t){return[r,i,o,u].some((function(e){return t[e]>=0}))}var Z={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,u=K(e,{elementContext:"reference"}),a=K(e,{altBoundary:!0}),c=J(u,r),s=J(a,o,i),l=Q(c),f=Q(s);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:s,isReferenceHidden:l,hasPopperEscaped:f},e.attributes.popper=Object.assign(Object.assign({},e.attributes.popper),{},{"data-popper-reference-hidden":l,"data-popper-escaped":f})}};var tt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,o=t.name,a=n.offset,c=void 0===a?[0,0]:a,l=s.reduce((function(t,n){return t[n]=function(t,e,n){var o=p(t),a=[u,r].indexOf(o)>=0?-1:1,c="function"==typeof n?n(Object.assign(Object.assign({},e),{},{placement:t})):n,s=c[0],l=c[1];return s=s||0,l=(l||0)*a,[u,i].indexOf(o)>=0?{x:l,y:s}:{x:s,y:l}}(n,e.rects,c),t}),{}),f=l[e.placement],d=f.x,m=f.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=m),e.modifiersData[o]=l}};var et={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=X({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};var nt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,a=t.name,c=n.mainAxis,s=void 0===c||c,l=n.altAxis,f=void 0!==l&&l,d=n.boundary,m=n.rootBoundary,g=n.altBoundary,h=n.padding,b=n.tether,y=void 0===b||b,w=n.tetherOffset,x=void 0===w?0:w,C=K(e,{boundary:d,rootBoundary:m,padding:h,altBoundary:g}),S=p(e.placement),_=$(e.placement),E=!_,A=O(S),D="x"===A?"y":"x",M=e.modifiersData.popperOffsets,N=e.rects.reference,R=e.rects.popper,z="function"==typeof x?x(Object.assign(Object.assign({},e.rects),{},{placement:e.placement})):x,B={x:0,y:0};if(M){if(s){var I="y"===A?r:u,P="y"===A?o:i,L="y"===A?"height":"width",H=M[A],F=M[A]+C[I],V=M[A]-C[P],j=y?-R[L]/2:0,U="start"===_?N[L]:R[L],W="start"===_?-R[L]:-N[L],q=e.elements.arrow,G=y&&q?v(q):{width:0,height:0},X=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Y=X[I],J=X[P],Q=T(0,N[L],G[L]),Z=E?N[L]/2-j-Q-Y-z:U-Q-Y-z,tt=E?-N[L]/2+j+Q+J+z:W+Q+J+z,et=e.elements.arrow&&k(e.elements.arrow),nt=et?"y"===A?et.clientTop||0:et.clientLeft||0:0,rt=e.modifiersData.offset?e.modifiersData.offset[e.placement][A]:0,ot=M[A]+Z-rt-nt,it=M[A]+tt-rt,ut=T(y?Math.min(F,ot):F,H,y?Math.max(V,it):V);M[A]=ut,B[A]=ut-H}if(f){var at="x"===A?r:u,ct="x"===A?o:i,st=M[D],lt=T(st+C[at],st,st-C[ct]);M[D]=lt,B[D]=lt-st}e.modifiersData[a]=B}},requiresIfExists:["offset"]};function rt(t,e,n){void 0===n&&(n=!1);var r,o,i=x(e),u=H(t),a=g(e),c={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(a||!a&&!n)&&(("body"!==f(e)||j(i))&&(c=(r=e)!==d(r)&&g(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:F(r)),g(e)?((s=H(e)).x+=e.clientLeft,s.y+=e.clientTop):i&&(s.x=V(i))),{x:u.left+c.scrollLeft-s.x,y:u.top+c.scrollTop-s.y,width:u.width,height:u.height}}function ot(t){var e=new Map,n=new Set,r=[];return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||function t(o){n.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var o=e.get(r);o&&t(o)}})),r.push(o)}(t)})),r}var it={placement:"bottom",modifiers:[],strategy:"absolute"};function ut(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function at(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,r=void 0===n?[]:n,o=e.defaultOptions,i=void 0===o?it:o;return function(t,e,n){void 0===n&&(n=i);var o,u,a={placement:"bottom",orderedModifiers:[],options:Object.assign(Object.assign({},it),i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],s=!1,f={state:a,setOptions:function(n){d(),a.options=Object.assign(Object.assign(Object.assign({},i),a.options),n),a.scrollParents={reference:m(t)?U(t):t.contextElement?U(t.contextElement):[],popper:U(e)};var o=function(t){var e=ot(t);return l.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}(function(t){var e=t.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign(Object.assign(Object.assign({},n),e),{},{options:Object.assign(Object.assign({},n.options),e.options),data:Object.assign(Object.assign({},n.data),e.data)}):e,t}),{});return Object.keys(e).map((function(t){return e[t]}))}([].concat(r,a.options.modifiers)));return a.orderedModifiers=o.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,r=void 0===n?{}:n,o=t.effect;if("function"==typeof o){var i=o({state:a,name:e,instance:f,options:r});c.push(i||function(){})}})),f.update()},forceUpdate:function(){if(!s){var t=a.elements,e=t.reference,n=t.popper;if(ut(e,n)){a.rects={reference:rt(e,k(n),"fixed"===a.options.strategy),popper:v(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var o=a.orderedModifiers[r],i=o.fn,u=o.options,c=void 0===u?{}:u,l=o.name;"function"==typeof i&&(a=i({state:a,options:c,name:l,instance:f})||a)}else a.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(t){f.forceUpdate(),t(a)}))},function(){return u||(u=new Promise((function(t){Promise.resolve().then((function(){u=void 0,t(o())}))}))),u}),destroy:function(){d(),s=!0}};if(!ut(t,e))return f;function d(){c.forEach((function(t){return t()})),c=[]}return f.setOptions(n).then((function(t){!s&&n.onFirstUpdate&&n.onFirstUpdate(t)})),f}}var ct=at(),st=at({defaultModifiers:[z,et,N,h,tt,Y,nt,A,Z]}),lt=at({defaultModifiers:[z,et,N,h]});n.d(e,"top",(function(){return r})),n.d(e,"bottom",(function(){return o})),n.d(e,"right",(function(){return i})),n.d(e,"left",(function(){return u})),n.d(e,"auto",(function(){return"auto"})),n.d(e,"basePlacements",(function(){return a})),n.d(e,"start",(function(){return"start"})),n.d(e,"end",(function(){return"end"})),n.d(e,"clippingParents",(function(){return"clippingParents"})),n.d(e,"viewport",(function(){return"viewport"})),n.d(e,"popper",(function(){return"popper"})),n.d(e,"reference",(function(){return"reference"})),n.d(e,"variationPlacements",(function(){return c})),n.d(e,"placements",(function(){return s})),n.d(e,"beforeRead",(function(){return"beforeRead"})),n.d(e,"read",(function(){return"read"})),n.d(e,"afterRead",(function(){return"afterRead"})),n.d(e,"beforeMain",(function(){return"beforeMain"})),n.d(e,"main",(function(){return"main"})),n.d(e,"afterMain",(function(){return"afterMain"})),n.d(e,"beforeWrite",(function(){return"beforeWrite"})),n.d(e,"write",(function(){return"write"})),n.d(e,"afterWrite",(function(){return"afterWrite"})),n.d(e,"modifierPhases",(function(){return l})),n.d(e,"applyStyles",(function(){return h})),n.d(e,"arrow",(function(){return A})),n.d(e,"computeStyles",(function(){return N})),n.d(e,"eventListeners",(function(){return z})),n.d(e,"flip",(function(){return Y})),n.d(e,"hide",(function(){return Z})),n.d(e,"offset",(function(){return tt})),n.d(e,"popperOffsets",(function(){return et})),n.d(e,"preventOverflow",(function(){return nt})),n.d(e,"popperGenerator",(function(){return at})),n.d(e,"detectOverflow",(function(){return K})),n.d(e,"createPopperBase",(function(){return ct})),n.d(e,"createPopper",(function(){return st})),n.d(e,"createPopperLite",(function(){return lt}))},620:function(t,e,n){(function(t){!function(){"use strict";var e=function(t){return function(e){return function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(e)===t}},n=function(t){return function(e){return typeof e===t}},r=function(t){return function(e){return t===e}},o=e("string"),i=e("object"),u=e("array"),a=r(null),c=n("boolean"),s=r(void 0),l=function(t){return null==t},f=function(t){return!l(t)},d=n("function"),m=n("number"),g=function(t,e){if(u(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},h=function(){},p=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},v=function(t){return function(){return t}},b=function(t){return t},y=function(t,e){return t===e};function w(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var x=function(t){return function(e){return!t(e)}},C=function(t){return function(){throw new Error(t)}},S=v(!1),k=v(!0),O=tinymce.util.Tools.resolve("tinymce.ThemeManager"),T=function(){return(T=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function _(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function E(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var A,D,M,N=function(){return R},R={fold:function(t,e){return t()},isSome:S,isNone:k,getOr:D=b,getOrThunk:A=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(void 0),or:D,orThunk:A,map:N,each:h,bind:N,exists:S,forall:k,filter:function(){return N()},toArray:function(){return[]},toString:v("none()")},z=function(t){var e=v(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:k,isNone:S,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return z(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:R},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},B={some:z,none:N,from:function(t){return null==t?R:z(t)}},I=Array.prototype.slice,P=Array.prototype.indexOf,L=Array.prototype.push,H=function(t,e){return P.call(t,e)},F=function(t,e){return H(t,e)>-1},V=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},j=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},U=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=I.call(t,r,r+e);n.push(o)}return n},W=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},q=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},G=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},$=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},X=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}}(t,(function(t,r){n=e(n,t,r)})),n},K=function(t,e,n){return q(t,(function(t,r){n=e(n,t,r)})),n},Y=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return B.some(i);if(n(i,r))break}return B.none()}(t,e,S)},J=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return B.some(n)}return B.none()},Q=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!u(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);L.apply(e,t[n])}return e},Z=function(t,e){return Q(W(t,e))},tt=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},et=function(t){var e=I.call(t,0);return e.reverse(),e},nt=function(t,e){return $(t,(function(t){return!F(e,t)}))},rt=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},ot=function(t){return[t]},it=function(t,e){var n=I.call(t,0);return n.sort(e),n},ut=function(t,e){return e>=0&&e<t.length?B.some(t[e]):B.none()},at=function(t){return ut(t,0)},ct=function(t){return ut(t,t.length-1)},st=d(Array.from)?Array.from:function(t){return I.call(t)},lt=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return B.none()},ft=function(t){return{isValue:k,isError:S,getOr:v(t),getOrThunk:v(t),getOrDie:v(t),or:function(e){return ft(t)},orThunk:function(e){return ft(t)},fold:function(e,n){return n(t)},map:function(e){return ft(e(t))},mapError:function(e){return ft(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return B.some(t)}}},dt=function(t){return{isValue:S,isError:k,getOr:b,getOrThunk:function(t){return t()},getOrDie:function(){return C(String(t))()},or:b,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return dt(t)},mapError:function(e){return dt(e(t))},each:h,bind:function(e){return dt(t)},exists:S,forall:k,toOptional:B.none}},mt={value:ft,error:dt,fromOption:function(t,e){return t.fold((function(){return dt(e)}),ft)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(M||(M={}));var gt=function(t,e,n){return t.stype===M.Error?e(t.serror):n(t.svalue)},ht=function(t){return{stype:M.Value,svalue:t}},pt=function(t){return{stype:M.Error,serror:t}},vt=function(t){return t.fold(pt,ht)},bt=function(t){return gt(t,mt.error,mt.value)},yt=ht,wt=function(t){var e=[],n=[];return q(t,(function(t){gt(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},xt=pt,Ct=function(t,e){return t.stype===M.Value?e(t.svalue):t},St=function(t,e){return t.stype===M.Error?e(t.serror):t},kt=function(t,e){return t.stype===M.Value?{stype:M.Value,svalue:e(t.svalue)}:t},Ot=function(t,e){return t.stype===M.Error?{stype:M.Error,serror:e(t.serror)}:t},Tt=gt,_t=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},Et=function(t,e,n){switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);case"custom":return n(t.newKey,t.instantiator)}},At=Object.keys,Dt=Object.hasOwnProperty,Mt=function(t,e){for(var n=At(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Nt=function(t,e){return Rt(t,(function(t,n){return{k:n,v:e(t,n)}}))},Rt=function(t,e){var n={};return Mt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},zt=function(t,e){var n={};return function(t,e,n,r){Mt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),h),n},Bt=function(t,e){var n=[];return Mt(t,(function(t,r){n.push(e(t,r))})),n},It=function(t,e){for(var n=At(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return B.some(u)}return B.none()},Pt=function(t){return Bt(t,b)},Lt=function(t,e){return Ht(t,e)?B.from(t[e]):B.none()},Ht=function(t,e){return Dt.call(t,e)},Ft=function(t,e){return Ht(t,e)&&void 0!==t[e]&&null!==t[e]},Vt=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var u in i)Ht(i,u)&&(r[u]=t(r[u],i[u]))}return r}},jt=Vt((function(t,e){return i(t)&&i(e)?jt(t,e):e})),Ut=Vt((function(t,e){return e})),Wt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},qt=function(t){return{tag:"defaultedThunk",process:t}},Gt=function(t){return qt(v(t))},$t=function(t){return{tag:"mergeWithThunk",process:t}},Xt=function(t){return p(xt,Q)(t)},Kt=function(t){var e=wt(t);return e.errors.length>0?Xt(e.errors):yt(e.values)},Yt=function(t){return i(t)&&At(t).length>100?" removed due to size":JSON.stringify(t,null,2)},Jt=function(t,e){return xt([{path:t,getErrorInfo:e}])},Qt=function(t){return{extract:function(e,n){return St(t(n),(function(t){return function(t,e){return Jt(t,v(e))}(e,t)}))},toString:v("val")}},Zt=Qt(yt),te=function(t,e,n,r){return Lt(e,n).fold((function(){return function(t,e,n){return Jt(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+Yt(n)}))}(t,n,e)}),r)},ee=function(t,e,n,r){return r(Lt(t,e).getOrThunk((function(){return n(t)})))},ne=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},u=function(t){return t.fold((function(){return yt(B.none())}),(function(t){var n=o.extract(e.concat([r]),t);return kt(n,B.some)}))};switch(t.tag){case"required":return te(e,n,r,i);case"defaultedThunk":return ee(n,r,t.process,i);case"option":return function(t,e,n){return n(Lt(t,e))}(n,r,u);case"defaultedOptionThunk":return function(t,e,n,r){return r(Lt(t,e).map((function(e){return!0===e?n(t):e})))}(n,r,t.process,u);case"mergeWithThunk":return ee(n,r,v({}),(function(e){var r=jt(t.process(n),e);return i(r)}))}},re=function(t){return{extract:function(e,n){return t().extract(e,n)},toString:function(){return t().toString()}}},oe=function(t){return At(zt(t,f))},ie=function(t){var e=ue(t),n=X(t,(function(t,e){return Et(e,(function(e){var n;return jt(t,((n={})[e]=!0,n))}),v(t))}),{});return{extract:function(t,r){var o=c(r)?[]:oe(r),i=$(o,(function(t){return!Ft(n,t)}));return 0===i.length?e.extract(t,r):function(t,e){return Jt(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,i)},toString:e.toString}},ue=function(t){return{extract:function(e,n){return function(t,e,n){for(var r={},o=[],i=0,u=n;i<u.length;i++){var a=u[i];Et(a,(function(n,i,u,a){var c=ne(u,t,e,n,a);Tt(c,(function(t){o.push.apply(o,t)}),(function(t){r[i]=t}))}),(function(t,n){r[t]=n(e)}))}return o.length>0?xt(o):yt(r)}(e,n,t)},toString:function(){return"obj{\n"+W(t,(function(t){return Et(t,(function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},ae=function(t){return{extract:function(e,n){var r=W(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return Kt(r)},toString:function(){return"array("+t.toString()+")"}}},ce=function(t){return{extract:function(e,n){for(var r=[],o=0,i=t;o<i.length;o++){var u=i[o].extract(e,n);if(u.stype===M.Value)return u;r.push(u)}return Kt(r)},toString:function(){return"oneOf("+W(t,(function(t){return t.toString()})).join(", ")+")"}}},se=function(t,e){return{extract:function(n,r){var o=At(r),i=function(e,n){return ae(Qt(t)).extract(e,n)}(n,o);return Ct(i,(function(t){var o=W(t,(function(t){return _t(t,t,{tag:"required",process:{}},e)}));return ue(o).extract(n,r)}))},toString:function(){return"setOf("+e.toString()+")"}}},le=p(ae,ue),fe=v(Zt),de=function(t,e){return Qt((function(n){var r=typeof n;return t(n)?yt(n):xt("Expected type: "+e+" but got: "+r)}))},me=de(m,"number"),ge=de(o,"string"),he=de(c,"boolean"),pe=de(d,"function"),ve=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(e){return ve(t[e])}));default:return!1}},be=Qt((function(t){return ve(t)?yt(t):xt("Expected value to be acceptable for sending via postMessage")})),ye=function(t,e,n,r){return Lt(n,r).fold((function(){return function(t,e,n){return Jt(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Yt(e)}))}(t,n,r)}),(function(n){return n.extract(t.concat(["branch: "+r]),e)}))},we=function(t,e){return{extract:function(n,r){return Lt(r,t).fold((function(){return function(t,e){return Jt(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return ye(n,r,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+At(e)}}},xe=function(t){return Qt((function(e){return t(e).fold(xt,yt)}))},Ce=function(t,e){return se((function(e){return vt(t(e))}),e)},Se=function(t,e,n){return bt(function(t,e,n){var r=e.extract([t],n);return Ot(r,(function(t){return{input:n,errors:t}}))}(t,e,n))},ke=function(t){return t.fold((function(t){throw new Error(Te(t))}),b)},Oe=function(t,e,n){return ke(Se(t,e,n))},Te=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:v("... (only showing first ten failures)")}]):e,W(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+Yt(t.input);var e,n},_e=function(t,e){return we(t,Nt(e,ue))},Ee=_t,Ae=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},De=function(t){return xe((function(e){return F(t,e)?mt.value(e):mt.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},Me=function(t){return Ee(t,t,{tag:"required",process:{}},fe())},Ne=function(t,e){return Ee(t,t,{tag:"required",process:{}},e)},Re=function(t){return Ne(t,me)},ze=function(t){return Ne(t,ge)},Be=function(t,e){return Ee(t,t,{tag:"required",process:{}},De(e))},Ie=function(t){return Ne(t,pe)},Pe=function(t,e){return Ee(t,t,{tag:"required",process:{}},ue(e))},Le=function(t,e){return Ee(t,t,{tag:"required",process:{}},le(e))},He=function(t,e){return Ee(t,t,{tag:"required",process:{}},ae(e))},Fe=function(t){return Ee(t,t,{tag:"option",process:{}},fe())},Ve=function(t,e){return Ee(t,t,{tag:"option",process:{}},e)},je=function(t){return Ve(t,me)},Ue=function(t){return Ve(t,ge)},We=function(t){return Ve(t,pe)},qe=function(t,e){return Ve(t,ae(e))},Ge=function(t,e){return Ve(t,ue(e))},$e=function(t,e){return Ee(t,t,Gt(e),fe())},Xe=function(t,e,n){return Ee(t,t,Gt(e),n)},Ke=function(t,e){return Xe(t,e,me)},Ye=function(t,e){return Xe(t,e,ge)},Je=function(t,e,n){return Xe(t,e,De(n))},Qe=function(t,e){return Xe(t,e,he)},Ze=function(t,e){return Xe(t,e,pe)},tn=function(t,e,n){return Xe(t,e,ae(n))},en=function(t,e,n){return Xe(t,e,ue(n))},nn=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},rn=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},on={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return rn(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return rn(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return rn(n)},fromDom:rn,fromPoint:function(t,e,n){return B.from(t.dom.elementFromPoint(e,n)).map(rn)}},un=function(){return an(0,0)},an=function(t,e){return{major:t,minor:e}},cn={nu:an,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?un():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return an(r(1),r(2))}(t,n)},unknown:un},sn=function(t,e){var n=String(e).toLowerCase();return Y(t,(function(t){return t.search(n)}))},ln=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},fn=function(t,e){return-1!==t.indexOf(e)},dn=function(t,e){return ln(t,e,0)},mn=function(t,e){return ln(t,e,t.length-e.length)},gn=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),hn=function(t){return t.length>0},pn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,vn=function(t){return function(e){return fn(e,t)}},bn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return fn(t,"edge/")&&fn(t,"chrome")&&fn(t,"safari")&&fn(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,pn],search:function(t){return fn(t,"chrome")&&!fn(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return fn(t,"msie")||fn(t,"trident")}},{name:"Opera",versionRegexes:[pn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:vn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:vn("firefox")},{name:"Safari",versionRegexes:[pn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(fn(t,"safari")||fn(t,"mobile/"))&&fn(t,"applewebkit")}}],yn=[{name:"Windows",search:vn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return fn(t,"iphone")||fn(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:vn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:vn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:vn("linux"),versionRegexes:[]},{name:"Solaris",search:vn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:vn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:vn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],wn={browsers:v(bn),oses:v(yn)},xn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},Cn={unknown:function(){return xn({current:void 0,version:cn.unknown()})},nu:xn,edge:v("Edge"),chrome:v("Chrome"),ie:v("IE"),opera:v("Opera"),firefox:v("Firefox"),safari:v("Safari")},Sn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},kn={unknown:function(){return Sn({current:void 0,version:cn.unknown()})},nu:Sn,windows:v("Windows"),ios:v("iOS"),android:v("Android"),linux:v("Linux"),osx:v("OSX"),solaris:v("Solaris"),freebsd:v("FreeBSD"),chromeos:v("ChromeOS")},On=function(t,e,n){var r=wn.browsers(),o=wn.oses(),i=e.bind((function(t){return function(t,e){return lt(e.brands,(function(e){var n=e.brand.toLowerCase();return Y(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:cn.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return sn(t,e).map((function(t){var n=cn.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(Cn.unknown,Cn.nu),u=function(t,e){return sn(t,e).map((function(t){var n=cn.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(kn.unknown,kn.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:v(o),isiPhone:v(i),isTablet:v(c),isPhone:v(s),isTouch:v(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:v(l),isDesktop:v(f)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}},Tn=function(t){return window.matchMedia(t).matches},_n=Wt((function(){return On(navigator.userAgent,B.from(navigator.userAgentData),Tn)})),En=function(){return _n()},An=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Dn=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Mn=function(t,e){return t.dom===e.dom},Nn=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)}(t.dom,e.dom)},Rn=function(t,e){return En().browser.isIE()?Nn(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},zn=function(t){if(!u(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return q(t,(function(r,o){var i=At(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!u(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);var u=function(t){var r=At(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!tt(e,(function(t){return F(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:u,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}})),n};zn([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Bn=function(t,e){return function(t,e){var n={};return Mt(t,(function(t,r){F(e,r)||(n[r]=t)})),n}(t,e)},In=function(t,e){return function(t,e){var n;return(n={})[t]=e,n}(t,e)},Pn=function(t){return function(t){var e={};return q(t,(function(t){e[t.key]=t.value})),e}(t)},Ln=function(t,e){var n,r=function(t){var e=[],n=[];return q(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(t);return r.errors.length>0?(n=r.errors,mt.error(Q(n))):function(t,e){return 0===t.length?mt.value(e):mt.value(jt(e,Ut.apply(void 0,t)))}(r.values,e)},Hn=function(t){return d(t)?t:S},Fn=function(t,e,n){for(var r=t.dom,o=Hn(n);r.parentNode;){r=r.parentNode;var i=on.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return B.none()},Vn=function(t,e,n){var r=e(t),o=Hn(n);return r.orThunk((function(){return o(t)?B.none():Fn(t,e,o)}))},jn=function(t,e){return Mn(t.element,e.event.target)},Un={can:k,abort:S,run:h},Wn=function(t){if(!Ft(t,"can")&&!Ft(t,"abort")&&!Ft(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return T(T({},Un),t)},qn=function(t){return{can:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return K(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),abort:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return K(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort})),run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];q(t,(function(t){t.run.apply(void 0,e)}))}}},Gn=v,$n=Gn("touchstart"),Xn=Gn("touchmove"),Kn=Gn("touchend"),Yn=Gn("touchcancel"),Jn=Gn("mousedown"),Qn=Gn("mousemove"),Zn=Gn("mouseout"),tr=Gn("mouseup"),er=Gn("mouseover"),nr=Gn("focusin"),rr=Gn("focusout"),or=Gn("keydown"),ir=Gn("keyup"),ur=Gn("input"),ar=Gn("change"),cr=Gn("click"),sr=Gn("transitioncancel"),lr=Gn("transitionend"),fr=Gn("transitionstart"),dr=Gn("selectstart"),mr=function(t){return v("alloy."+t)},gr={tap:mr("tap")},hr=mr("focus"),pr=mr("blur.post"),vr=mr("paste.post"),br=mr("receive"),yr=mr("execute"),wr=mr("focus.item"),xr=gr.tap,Cr=mr("longpress"),Sr=mr("sandbox.close"),kr=mr("typeahead.cancel"),Or=mr("system.init"),Tr=mr("system.touchmove"),_r=mr("system.touchend"),Er=mr("system.scroll"),Ar=mr("system.resize"),Dr=mr("system.attached"),Mr=mr("system.detached"),Nr=mr("system.dismissRequested"),Rr=mr("system.repositionRequested"),zr=mr("focusmanager.shifted"),Br=mr("slotcontainer.visibility"),Ir=mr("change.tab"),Pr=mr("dismiss.tab"),Lr=mr("highlight"),Hr=mr("dehighlight"),Fr=function(t,e){Wr(t,t.element,e,{})},Vr=function(t,e,n){Wr(t,t.element,e,n)},jr=function(t){Fr(t,yr())},Ur=function(t,e,n){Wr(t,e,n,{})},Wr=function(t,e,n,r){var o=T({target:e},r);t.getSystem().triggerEvent(n,e,o)},qr=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},Gr=function(t){return Pn(t)},$r=function(t,e){return{key:t,value:Wn({abort:e})}},Xr=function(t){return{key:t,value:Wn({run:function(t,e){e.event.prevent()}})}},Kr=function(t,e){return{key:t,value:Wn({run:e})}},Yr=function(t,e,n){return{key:t,value:Wn({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Jr=function(t){return function(e){return{key:t,value:Wn({run:function(t,n){jn(t,n)&&e(t,n)}})}}},Qr=function(t,e,n){return function(t,e){return Kr(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){qr(e,e.element,t,r)}))}))}(t,e.partUids[n])},Zr=function(t,e){return Kr(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).getOrThunk((function(){return Vn(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),S).getOr(t)}));e(t,o,n)}))},to=function(t){return Kr(t,(function(t,e){e.cut()}))},eo=function(t){return Kr(t,(function(t,e){e.stop()}))},no=function(t,e){return Jr(t)(e)},ro=Jr(Dr()),oo=Jr(Mr()),io=Jr(Or()),uo=function(t){return function(e){return Kr(t,e)}}(yr());"undefined"!=typeof window?window:Function("return this;")();var ao,co=function(t){return t.dom.nodeName.toLowerCase()},so=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},lo=so(1),fo=so(3),mo=so(9),go=so(11),ho=function(t){return on.fromDom(t.dom.ownerDocument)},po=function(t){return mo(t)?t:ho(t)},vo=function(t){return on.fromDom(po(t).dom.documentElement)},bo=function(t){return on.fromDom(po(t).dom.defaultView)},yo=function(t){return B.from(t.dom.parentNode).map(on.fromDom)},wo=function(t){return B.from(t.dom.offsetParent).map(on.fromDom)},xo=function(t){return W(t.dom.childNodes,on.fromDom)},Co=function(t,e){var n=t.dom.childNodes;return B.from(n[e]).map(on.fromDom)},So=function(t,e){return{element:t,offset:e}},ko=function(t,e){var n=xo(t);return n.length>0&&e<n.length?So(n[e],0):So(t,e)},Oo=function(t){return go(t)&&f(t.dom.host)},To=d(Element.prototype.attachShadow)&&d(Node.prototype.getRootNode),_o=v(To),Eo=To?function(t){return on.fromDom(t.dom.getRootNode())}:po,Ao=function(t){return Oo(t)?t:on.fromDom(po(t).dom.body)},Do=function(t){var e=Eo(t);return Oo(e)?B.some(e):B.none()},Mo=function(t){return on.fromDom(t.dom.host)},No=function(t){return f(t.dom.shadowRoot)},Ro=function(t,e){yo(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},zo=function(t,e){(function(t){return B.from(t.dom.nextSibling).map(on.fromDom)})(t).fold((function(){yo(t).each((function(t){Io(t,e)}))}),(function(t){Ro(t,e)}))},Bo=function(t,e){(function(t){return Co(t,0)})(t).fold((function(){Io(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Io=function(t,e){t.dom.appendChild(e.dom)},Po=function(t,e){q(e,(function(e){Io(t,e)}))},Lo=function(t){t.dom.textContent="",q(xo(t),(function(t){Ho(t)}))},Ho=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Fo=function(t){var e,n=xo(t);n.length>0&&(e=t,q(n,(function(t){Ro(e,t)}))),Ho(t)},Vo=function(t){return t.dom.innerHTML},jo=function(t,e){var n,r,o=ho(t).dom,i=on.fromDom(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,xo(on.fromDom(r)));Po(i,u),Lo(t),Io(t,i)},Uo=function(t,e,n){if(!(o(n)||c(n)||m(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Wo=function(t,e,n){Uo(t.dom,e,n)},qo=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Go=function(t,e){return B.from(qo(t,e))},$o=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Xo=function(t,e){t.dom.removeAttribute(e)},Ko=function(t){return function(t,e){return on.fromDom(t.dom.cloneNode(e))}(t,!1)},Yo=function(t){return Oo(t)?"#shadow-root":function(t){var e=on.fromTag("div"),n=on.fromDom(t.dom.cloneNode(!0));return Io(e,n),Vo(e)}(Ko(t))},Jo=function(t){return Yo(t)},Qo=Gr([function(t,e){return{key:t,value:Wn({can:e})}}(hr(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return Mn(e,t.element)&&!Mn(e,n)}(t,r,o)||(console.warn(hr()+" did not get interpreted by the desired target. \nOriginator: "+Jo(r)+"\nTarget: "+Jo(o)+"\nCheck the "+hr()+" event handlers"),!1)}))]),Zo=Object.freeze({__proto__:null,events:Qo}),ti=0,ei=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++ti+String(e)},ni=v("alloy-id-"),ri=v("data-alloy-id"),oi=ni(),ii=ri(),ui=function(t,e){Object.defineProperty(t.dom,ii,{value:e,writable:!0})},ai=function(t){var e=lo(t)?t.dom[ii]:null;return B.from(e)},ci=function(t){return ei(t)},si=b,li=function(t){var e=function(e){return"The component must be in a context to execute: "+e+(t?"\n"+Jo(t().element)+" is not in context.":"")},n=function(t){return function(){throw new Error(e(t))}},r=function(t){return function(){console.warn(e(t))}};return{debugInfo:v("fake"),triggerEvent:r("triggerEvent"),triggerFocus:r("triggerFocus"),triggerEscape:r("triggerEscape"),broadcast:r("broadcast"),broadcastOn:r("broadcastOn"),broadcastEvent:r("broadcastEvent"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),isConnected:S}},fi=li(),di=function(t){return W(t,(function(t){return mn(t,"/*")?t.substring(0,t.length-"/*".length):t}))},mi=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:di(i)}},t},gi=ei("alloy-premade"),hi=function(t){return In(gi,t)},pi=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:di(i.slice(1))}},t}((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,E([e.getApis(),e],n))}),t)},vi={init:function(){return bi({readState:v("No State required")})}},bi=function(t){return t},yi=function(t,e){var n={};return Mt(t,(function(t,r){Mt(t,(function(t,o){var i=Lt(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},wi=function(t){return{classes:s(t.classes)?[]:t.classes,attributes:s(t.attributes)?{}:t.attributes,styles:s(t.styles)?{}:t.styles}},xi=function(t){return t.cHandler},Ci=function(t,e){return{name:t,handler:e}},Si=function(t,e,n){var r=T(T({},n),function(t,e){var n={};return q(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return yi(r,Ci)},ki=function(t){var e=function(t){return d(t)?{can:k,abort:S,run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},Oi=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=it(n,(function(n,o){var i=n[e],u=o[e],a=r.indexOf(i),c=r.indexOf(u);if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+u+".\nOrder specified: "+JSON.stringify(r,null,2));return a<c?-1:c<a?1:0}));return mt.value(o)}catch(t){return mt.error([t])}}("Event: "+n,"name",t,r).map((function(t){var e=W(t,(function(t){return t.handler}));return qn(e)})):function(t,e){return mt.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(W(e,(function(t){return t.name})),null,2)])}(n,t)},Ti=function(t,e){var n=Bt(t,(function(t,n){return(1===t.length?mt.value(t[0].handler):Oi(t,e,n)).map((function(r){var o=ki(r),i=t.length>1?$(e[n],(function(e){return V(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return In(n,function(t,e){return{handler:t,purpose:e}}(o,i))}))}));return Ln(n,{})},_i="alloy.base.behaviour",Ei=ue([Ee("dom","dom",{tag:"required",process:{}},ue([Me("tag"),$e("styles",{}),$e("classes",[]),$e("attributes",{}),Fe("value"),Fe("innerHtml")])),Me("components"),Me("uid"),$e("events",{}),$e("apis",{}),Ee("eventOrder","eventOrder",function(t){return $t(v(t))}((ao={},ao[yr()]=["disabling",_i,"toggling","typeaheadevents"],ao[hr()]=[_i,"focusing","keying"],ao[Or()]=[_i,"disabling","toggling","representing"],ao[ur()]=[_i,"representing","streaming","invalidating"],ao[Mr()]=[_i,"representing","item-events","tooltipping"],ao[Jn()]=["focusing",_i,"item-type-events"],ao[$n()]=["focusing",_i,"item-type-events"],ao[er()]=["item-type-events","tooltipping"],ao[br()]=["receiving","reflecting","tooltipping"],ao)),fe()),Fe("domModification")]),Ai=function(t){return t.events},Di=function(t,e){var n=qo(t,e);return void 0===n||""===n?[]:n.split(" ")},Mi=function(t){return void 0!==t.dom.classList},Ni=function(t,e){return function(t,e,n){var r=Di(t,e).concat([n]);return Wo(t,e,r.join(" ")),!0}(t,"class",e)},Ri=function(t,e){return function(t,e,n){var r=$(Di(t,e),(function(t){return t!==n}));return r.length>0?Wo(t,e,r.join(" ")):Xo(t,e),!1}(t,"class",e)},zi=function(t,e){Mi(t)?t.dom.classList.add(e):Ni(t,e)},Bi=function(t){0===(Mi(t)?t.dom.classList:function(t){return Di(t,"class")}(t)).length&&Xo(t,"class")},Ii=function(t,e){Mi(t)?t.dom.classList.remove(e):Ri(t,e);Bi(t)},Pi=function(t,e){return Mi(t)&&t.dom.classList.contains(e)},Li=function(t,e){q(e,(function(e){zi(t,e)}))},Hi=function(t,e){q(e,(function(e){Ii(t,e)}))},Fi=function(t,e,n){return void 0===n&&(n=y),t.exists((function(t){return n(t,e)}))},Vi=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},ji=function(t,e,n){return t.isSome()&&e.isSome()?B.some(n(t.getOrDie(),e.getOrDie())):B.none()},Ui=function(t,e){return t?B.some(e):B.none()},Wi=function(t){return void 0!==t.style&&d(t.style.getPropertyValue)},qi=function(t){var e=fo(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return Do(on.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=qi,r=Mo,function(t){return n(r(t))}))},Gi=function(){return $i(on.fromDom(document))},$i=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return on.fromDom(e)},Xi=function(t,e,n){if(!o(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Wi(t)&&t.style.setProperty(e,n)},Ki=function(t,e){Wi(t)&&t.style.removeProperty(e)},Yi=function(t,e,n){var r=t.dom;Xi(r,e,n)},Ji=function(t,e){var n=t.dom;Mt(e,(function(t,e){Xi(n,e,t)}))},Qi=function(t,e){var n=t.dom;Mt(e,(function(t,e){t.fold((function(){Ki(n,e)}),(function(t){Xi(n,e,t)}))}))},Zi=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||qi(t)?r:tu(n,e)},tu=function(t,e){return Wi(t)?t.style.getPropertyValue(e):""},eu=function(t,e){var n=t.dom,r=tu(n,e);return B.from(r).filter((function(t){return t.length>0}))},nu=function(t){var e={},n=t.dom;if(Wi(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},ru=function(t,e,n){var r=on.fromTag(t);return Yi(r,e,n),eu(r,e).isSome()},ou=function(t,e){var n=t.dom;Ki(n,e),Fi(Go(t,"style").map(gn),"")&&Xo(t,"style")},iu=function(t){return t.dom.offsetWidth},uu=function(t){return t.dom.value},au=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},cu=function(t){var e=on.fromTag(t.tag);!function(t,e){var n=t.dom;Mt(e,(function(t,e){Uo(n,e,t)}))}(e,t.attributes),Li(e,t.classes),Ji(e,t.styles),t.innerHtml.each((function(t){return jo(e,t)}));var n=t.domChildren;return Po(e,n),t.value.each((function(t){au(e,t)})),t.uid,ui(e,t.uid),e},su=function(t,e){return function(t,e){var n=W(e,(function(t){return Ge(t.name(),[Me("config"),$e("state",vi)])})),r=Se("component.behaviours",ue(n),t.behaviours).fold((function(e){throw new Error(Te(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),b);return{list:e,data:Nt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return v(e)}))}}(t,e)},lu=function(t){var e=function(t){var e=Lt(t,"behaviours").getOr({}),n=$(At(e),(function(t){return void 0!==e[t]}));return W(n,(function(t){return e[t].me}))}(t);return su(t,e)},fu=function(t,e,n){var r,o,i,u=T(T({},(r=t).dom),{uid:r.uid,domChildren:W(r.components,(function(t){return t.element}))}),a=function(t){return t.domModification.fold((function(){return wi({})}),wi)}(t),c={"alloy.base.modification":a},s=e.length>0?function(t,e,n,r){var o=T({},e);q(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=yi(o,(function(t,e){return{name:t,modification:e}})),u=function(t){return X(t,(function(t,e){return T(T({},e.modification),t)}),{})},a=X(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=u(i.attributes),s=u(i.styles);return wi({classes:a,attributes:c,styles:s})}(n,c,e,u):a;return i=s,T(T({},o=u),{attributes:T(T({},o.attributes),i.attributes),styles:T(T({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},du=function(t,e,n){var r={"alloy.base.behaviour":Ai(t)};return function(t,e,n,r){var o=Si(t,n,r);return Ti(o,e)}(n,t.eventOrder,e,r).getOrDie()},mu=function(t){var e=function(){return f},n=nn(fi),r=ke(function(t){return Se("custom.definition",Ei,t)}(t)),o=lu(t),i=function(t){return t.list}(o),u=function(t){return t.data}(o),a=fu(r,i,u),c=cu(a),s=du(r,i,u),l=nn(r.components),f={uid:t.uid,getSystem:n.get,config:function(e){var n=u;return(d(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return d(u[t.name()])},spec:t,readState:function(t){return u[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(li(e))},element:c,syncComponents:function(){var t=xo(c),e=Z(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),ot)}));l.set(e)},components:l.get,events:s};return f},gu=function(t){var e=si(t),n=e.events,r=_(e,["events"]),o=function(t){var e=Lt(t,"components").getOr([]);return W(e,bu)}(r),i=T(T({},r),{events:T(T({},Zo),n),components:o});return mt.value(mu(i))},hu=function(t){var e=on.fromText(t);return pu({element:e})},pu=function(t){var e=Oe("external.component",ie([Me("element"),Fe("uid")]),t),n=nn(li()),r=e.uid.getOrThunk((function(){return ci("external")}));ui(e.element,r);var o={uid:r,getSystem:n.get,config:B.none,hasConfigured:S,connect:function(t){n.set(t)},disconnect:function(){n.set(li((function(){return o})))},getApis:function(){return{}},element:e.element,spec:t,readState:v("No state"),syncComponents:h,components:v([]),events:{}};return hi(o)},vu=ci,bu=function(t){return function(t){return Lt(t,gi)}(t).getOrThunk((function(){var e=function(t){return Ht(t,"uid")}(t)?t:T({uid:vu("")},t);return gu(e).getOrDie()}))},yu=hi,wu=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Zi(n,t);return parseFloat(o)||0}return r},r=function(t,e){return K(e,(function(e,n){var r=Zi(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!m(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Wi(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},xu=wu("height",(function(t){var e=t.dom;return qi(t)?e.getBoundingClientRect().height:e.offsetHeight})),Cu=function(t){return xu.get(t)},Su=function(t){return xu.getOuter(t)},ku=function(t,e){return{left:t,top:e,translate:function(n,r){return ku(t+n,e+r)}}},Ou=ku,Tu=function(t,e){return void 0!==t?t:void 0!==e?e:0},_u=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return Ou(n.offsetLeft,n.offsetTop);var i=Tu(null==r?void 0:r.pageYOffset,o.scrollTop),u=Tu(null==r?void 0:r.pageXOffset,o.scrollLeft),a=Tu(o.clientTop,n.clientTop),c=Tu(o.clientLeft,n.clientLeft);return Eu(t).translate(u-c,i-a)},Eu=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?Ou(n.offsetLeft,n.offsetTop):qi(t)?function(t){var e=t.getBoundingClientRect();return Ou(e.left,e.top)}(e):Ou(0,0)},Au=wu("width",(function(t){return t.dom.offsetWidth})),Du=function(t){return Au.get(t)},Mu=function(t){return Au.getOuter(t)},Nu=function(t){var e=on.fromDom(function(t){if(_o()&&f(t.target)){var e=on.fromDom(t.target);if(lo(e)&&No(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return at(n)}}return B.from(t.target)}(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=p(r,n);return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(e,t.clientX,t.clientY,n,r,o,t)},Ru=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(Nu(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:w(zu,t,e,i,o)}},zu=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Bu=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return Ou(n,r)},Iu=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},Pu=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Lu=function(t){var e=void 0===t?window:t,n=e.document,r=Bu(on.fromDom(n));return function(t){var e=void 0===t?window:t;return B.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Pu(r.left,r.top,n,o)}),(function(t){return Pu(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Hu=function(t,e){return t.view(e).fold(v([]),(function(e){var n=t.owner(e),r=Hu(t,n);return[e].concat(r)}))},Fu=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?B.none():B.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(on.fromDom)},owner:function(t){return ho(t)}}),Vu=function(t){var e=on.fromDom(document),n=Bu(e);return function(t,e){var n=e.owner(t),r=Hu(e,n);return B.some(r)}(t,Fu).fold(w(_u,t),(function(e){var r=Eu(t),o=X(e,(function(t,e){var n=Eu(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return Ou(o.left+r.left+n.left,o.top+r.top+n.top)}))},ju=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Uu=function(t){var e=_u(t),n=Mu(t),r=Su(t);return ju(e.left,e.top,n,r)},Wu=function(t){var e=Vu(t),n=Mu(t),r=Su(t);return ju(e.left,e.top,n,r)},qu=function(){return Lu(window)};function Gu(t,e,n,r,o){return t(n,r)?B.some(n):d(o)&&o(n)?B.none():e(n,r,o)}var $u,Xu=function(t,e,n){for(var r=t.dom,o=d(n)?n:S;r.parentNode;){r=r.parentNode;var i=on.fromDom(r);if(e(i))return B.some(i);if(o(i))break}return B.none()},Ku=function(t,e,n){return Gu((function(t,e){return e(t)}),Xu,t,e,n)},Yu=function(t,e,n){return Ku(t,e,n).isSome()},Ju=function(t,e,n){return Xu(t,(function(t){return An(t,e)}),n)},Qu=function(t,e){return function(t,e){return Y(t.dom.childNodes,(function(t){return e(on.fromDom(t))})).map(on.fromDom)}(t,(function(t){return An(t,e)}))},Zu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Dn(n)?B.none():B.from(n.querySelector(t)).map(on.fromDom)}(e,t)},ta=function(t,e,n){return Gu((function(t,e){return An(t,e)}),Ju,t,e,n)},ea=function(){var t=ei("aria-owns");return{id:t,link:function(e){Wo(e,"aria-owns",t)},unlink:function(t){Xo(t,"aria-owns")}}},na=function(t,e){return function(t){return Ku(t,(function(t){if(!lo(t))return!1;var e=qo(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=qo(t,"id"),n=Eo(t);return Zu(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return ra(t,e)}))},ra=function(t,e){return Yu(e,(function(e){return Mn(e,t.element)}),S)||na(t,e)};!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}($u||($u={}));var oa=nn({}),ia=function(t,e,n){switch(Lt(oa.get(),t).orThunk((function(){var e=At(oa.get());return lt(e,(function(e){return t.indexOf(e)>-1?B.some(oa.get()[e]):B.none()}))})).getOr($u.NORMAL)){case $u.NORMAL:return n(ca());case $u.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();F(["mousemove","mouseover","mouseout",Or()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:W(n,(function(t){return F(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Jo(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case $u.STOP:return!0}},ua=["alloy/data/Fields","alloy/debugging/Debugging"],aa=function(t,e,n){return ia(t,e,n)},ca=v({logEventCut:h,logEventStopped:h,logNoParent:h,logEventNoHandlers:h,logEventResponse:h,write:h}),sa=v([Me("menu"),Me("selectedMenu")]),la=v([Me("item"),Me("selectedItem")]);v(ue(la().concat(sa())));var fa=v(ue(la())),da=Pe("initSize",[Me("numColumns"),Me("numRows")]),ma=function(){return Pe("markers",[Me("backgroundMenu")].concat(sa()).concat(la()))},ga=function(t){return Pe("markers",W(t,Me))},ha=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return Y(e,(function(t){return t.indexOf("alloy")>0&&!V(ua,(function(e){return t.indexOf(e)>-1}))})).getOr("unknown")}}(),Ee(e,e,n,xe((function(t){return mt.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},pa=function(t){return ha(0,t,Gt(h))},va=function(t){return ha(0,t,Gt(B.none))},ba=function(t){return ha(0,t,{tag:"required",process:{}})},ya=function(t){return ha(0,t,{tag:"required",process:{}})},wa=function(t,e){return Ae(t,v(e))},xa=function(t){return Ae(t,b)},Ca=v(da),Sa=function(t,e,n,r,o,i,u,a){return void 0===a&&(a=!1),{x:t,y:e,bubble:n,direction:r,placement:o,restriction:i,label:u+"-"+o,alwaysFit:a}},ka=zn([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Oa=ka.southeast,Ta=ka.southwest,_a=ka.northeast,Ea=ka.northwest,Aa=ka.south,Da=ka.north,Ma=ka.east,Na=ka.west,Ra=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},za=function(t,e,n){return Math.min(Math.max(t,e),n)},Ba=function(t,e){return rt(["left","right","top","bottom"],(function(n){return Lt(e,n).map((function(e){return function(t,e){switch(e){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,e)}))}))},Ia=function(t){return t.x},Pa=function(t,e){return t.x+t.width/2-e.width/2},La=function(t,e){return t.x+t.width-e.width},Ha=function(t,e){return t.y-e.height},Fa=function(t){return t.y+t.height},Va=function(t,e){return t.y+t.height/2-e.height/2},ja=function(t,e,n){return Sa(Ia(t),Fa(t),n.southeast(),Oa(),"southeast",Ba(t,{left:1,top:3}),"layout")},Ua=function(t,e,n){return Sa(La(t,e),Fa(t),n.southwest(),Ta(),"southwest",Ba(t,{right:0,top:3}),"layout")},Wa=function(t,e,n){return Sa(Ia(t),Ha(t,e),n.northeast(),_a(),"northeast",Ba(t,{left:1,bottom:2}),"layout")},qa=function(t,e,n){return Sa(La(t,e),Ha(t,e),n.northwest(),Ea(),"northwest",Ba(t,{right:0,bottom:2}),"layout")},Ga=function(t,e,n){return Sa(Pa(t,e),Ha(t,e),n.north(),Da(),"north",Ba(t,{bottom:2}),"layout")},$a=function(t,e,n){return Sa(Pa(t,e),Fa(t),n.south(),Aa(),"south",Ba(t,{top:3}),"layout")},Xa=function(t,e,n){return Sa(function(t){return t.x+t.width}(t),Va(t,e),n.east(),Ma(),"east",Ba(t,{left:0}),"layout")},Ka=function(t,e,n){return Sa(function(t,e){return t.x-e.width}(t,e),Va(t,e),n.west(),Na(),"west",Ba(t,{right:1}),"layout")},Ya=function(){return[ja,Ua,Wa,qa,$a,Ga,Xa,Ka]},Ja=function(){return[Ua,ja,qa,Wa,$a,Ga,Xa,Ka]},Qa=function(){return[Wa,qa,ja,Ua,Ga,$a]},Za=function(){return[qa,Wa,Ua,ja,Ga,$a]},tc=function(){return[ja,Ua,Wa,qa,$a,Ga]},ec=function(){return[Ua,ja,qa,Wa,$a,Ga]},nc=Object.freeze({__proto__:null,events:function(t){return Gr([Kr(br(),(function(e,n){var r=t.channels,o=At(r),i=n,u=function(t,e){return e.universal?t:$(t,(function(t){return F(e.channels,t)}))}(o,i);q(u,(function(t){var n=r[t],o=n.schema,u=Oe("channel["+t+"] data\nReceiver: "+Jo(e.element),o,i.data);n.onReceive(e,u)}))}))])}}),rc=[Ne("channels",Ce(mt.value,ie([ba("onReceive"),$e("schema",fe())])))],oc=function(t,e,n){return io((function(r,o){n(r,t,e)}))},ic=function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),u=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:di(u.slice(0,1).concat(u.slice(3)))}},t}((function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var u=[r].concat(o);return r.config({name:v(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(u,1);return e.apply(void 0,[r,t.config,t.state].concat(n))}))}),n,e)},uc=function(t){return{key:t,value:void 0}},ac=function(t,e,n,r,o,i,u){var a=function(t){return Ft(t,n)?t[n]():B.none()},c=Nt(o,(function(t,e){return ic(n,t,e)})),s=Nt(i,(function(t,e){return mi(t,e)})),l=T(T(T({},s),c),{revoke:w(uc,n),config:function(e){var r=Oe(n+"-config",t,e);return{key:n,value:{config:r,me:l,configAsRaw:Wt((function(){return Oe(n+"-config",t,e)})),initialConfig:e,state:u}}},schema:v(e),exhibit:function(t,e){return ji(a(t),Lt(r,"exhibit"),(function(t,n){return n(e,t.config,t.state)})).getOrThunk((function(){return wi({})}))},name:v(n),handlers:function(t){return a(t).map((function(t){return Lt(r,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return l},cc=function(t){return Pn(t)},sc=ie([Me("fields"),Me("name"),$e("active",{}),$e("apis",{}),$e("state",vi),$e("extra",{})]),lc=function(t){var e=Oe("Creating behaviour: "+t.name,sc,t);return function(t,e,n,r,o,i){var u,a,c=ie(t),s=Ge(e,[(u="config",a=t,Ve(u,ie(a)))]);return ac(c,s,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},fc=ie([Me("branchKey"),Me("branches"),Me("name"),$e("active",{}),$e("apis",{}),$e("state",vi),$e("extra",{})]),dc=function(t){var e=Oe("Creating behaviour: "+t.name,fc,t);return function(t,e,n,r,o,i){var u=t,a=Ge(e,[Ve("config",t)]);return ac(u,a,e,n,r,o,i)}(_e(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},mc=v(void 0),gc=lc({fields:rc,name:"receiving",active:nc}),hc=Object.freeze({__proto__:null,exhibit:function(t,e){return wi({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),pc=function(t){return t.dom.focus()},vc=function(t){var e=Eo(t).dom;return t.dom===e.activeElement},bc=function(t){return void 0===t&&(t=on.fromDom(document)),B.from(t.dom.activeElement).map(on.fromDom)},yc=function(t){return bc(Eo(t)).filter((function(e){return t.dom.contains(e.dom)}))},wc=function(t,e){var n=Eo(e),r=bc(n).bind((function(t){var n,r,o=function(e){return Mn(t,e)};return o(e)?B.some(e):(n=o,(r=function(t){for(var e=0;e<t.childNodes.length;e++){var o=on.fromDom(t.childNodes[e]);if(n(o))return B.some(o);var i=r(t.childNodes[e]);if(i.isSome())return i}return B.none()})(e.dom))})),o=t(e);return r.each((function(t){bc(n).filter((function(e){return Mn(e,t)})).fold((function(){pc(t)}),h)})),o},xc=function(t,e,n,r,o){var i=function(t){return t+"px"};return{position:t,left:e.map(i),top:n.map(i),right:r.map(i),bottom:o.map(i)}},Cc=function(t,e){Qi(t,function(t){return T(T({},t),{position:B.some(t.position)})}(e))},Sc=zn([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),kc=function(t,e,n,r,o,i){var u=e.rect,a=u.x-n,c=u.y-r,s=o-(a+u.width),l=i-(c+u.height),f=B.some(a),d=B.some(c),m=B.some(s),g=B.some(l),h=B.none();return function(t,e,n,r,o,i,u,a,c){return t.fold(e,n,r,o,i,u,a,c)}(e.direction,(function(){return xc(t,f,d,h,h)}),(function(){return xc(t,h,d,m,h)}),(function(){return xc(t,f,h,h,g)}),(function(){return xc(t,h,h,m,g)}),(function(){return xc(t,f,d,h,h)}),(function(){return xc(t,f,h,h,g)}),(function(){return xc(t,f,d,h,h)}),(function(){return xc(t,h,d,m,h)}))},Oc=function(t,e){return t.fold((function(){var t=e.rect;return xc("absolute",B.some(t.x),B.some(t.y),B.none(),B.none())}),(function(t,n,r,o){return kc("absolute",e,t,n,r,o)}),(function(t,n,r,o){return kc("fixed",e,t,n,r,o)}))},Tc=function(t,e){var n=w(Vu,e),r=t.fold(n,n,(function(){var t=Bu();return Vu(e).translate(-t.left,-t.top)})),o=Mu(e),i=Su(e);return ju(r.left,r.top,o,i)},_c=function(t,e){return e.fold((function(){return t.fold(qu,qu,ju)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=Ec(t,n.x,n.y);return ju(r.left,r.top,n.width,n.height)}))}))},Ec=function(t,e,n){var r=Ou(e,n);return t.fold(v(r),v(r),(function(){var t=Bu();return r.translate(-t.left,-t.top)}))};Sc.none;var Ac,Dc=Sc.relative,Mc=Sc.fixed,Nc=function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)},Rc=function(t){return Go(t,"data-alloy-placement")},zc=zn([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Bc=function(t,e,n,r){var o=t.bubble,i=o.offset,u=function(t,e,n){var r=function(r,o){return e[r].map((function(e){var i="top"===r||"bottom"===r,u=i?n.top:n.left,a=("left"===r||"top"===r?Math.max:Math.min)(e,o)+u;return i?za(a,t.y,t.bottom):za(a,t.x,t.right)})).getOr(o)},o=r("left",t.x),i=r("top",t.y),u=r("right",t.right),a=r("bottom",t.bottom);return ju(o,i,u-o,a-i)}(r,t.restriction,i),a=t.x+i.left,c=t.y+i.top,s=ju(a,c,e,n),l=function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,u=t.x,a=t.y,c=t.right,s=t.bottom,l=t.width,f=t.height;return{originInBounds:u>=n&&u<=o&&(a>=r&&a<=i),sizeInBounds:c<=o&&c>=n&&(s<=i&&s>=r),visibleW:Math.min(l,u>=n?o-u:c-n),visibleH:Math.min(f,a>=r?i-a:s-r)}}(s,u),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,h=f&&d,p=h?s:function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,u=t.x,a=t.y,c=t.width,s=t.height,l=Math.max(n,o-c),f=Math.max(r,i-s),d=za(u,n,l),m=za(a,r,f),g=Math.min(d+c,o)-d,h=Math.min(m+s,i)-m;return ju(d,m,g,h)}(s,u),b=p.width>0&&p.height>0,y=function(t,e,n){var r=v(e.bottom-n.y),o=v(n.bottom-e.y),i=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t,o,o,r),u=v(e.right-n.x),a=v(n.right-e.x);return{maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t,a,a,u),maxHeight:i}}(t.direction,p,r),w=y.maxWidth,x={rect:p,maxHeight:y.maxHeight,maxWidth:w,direction:t.direction,placement:t.placement,classes:{on:o.classesOn,off:o.classesOff},layout:t.label,testY:c};return h||t.alwaysFit?zc.fit(x):zc.nofit(x,m,g,b)},Ic=function(t){var e=nn(B.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(B.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(B.some(t))}}},Pc=function(){return Ic((function(t){return t.unbind()}))},Lc=function(){var t=Ic(h);return T(T({},t),{on:function(e){return t.get().each(e)}})},Hc=k,Fc=function(t,e,n){return function(t,e,n,r){return Ru(t,e,n,r,!1)}(t,e,Hc,n)},Vc=function(t,e,n){return function(t,e,n,r){return Ru(t,e,n,r,!0)}(t,e,Hc,n)},jc=Nu,Uc=["top","bottom","right","left"],Wc="data-alloy-transition-timer",qc=function(t,e){return function(t,e){return tt(e,(function(e){return Pi(t,e)}))}(t,e.classes)},Gc=function(t,e){var n=function(t){return parseFloat(t).toPrecision(3)};return It(e,(function(e,r){var o,i,u,a=t[r].map(n),c=e.map(n);return void 0===u&&(u=y),!ji(o=a,i=c,u).getOr(o.isNone()&&i.isNone())})).isSome()},$c=function(t,e){var n,r=Pc(),i=Pc(),u=function(e){var n,r=null!==(n=e.raw.pseudoElement)&&void 0!==n?n:"";return Mn(e.target,t)&&!hn(r)&&F(Uc,e.raw.propertyName)},a=function(o){if(l(o)||u(o)){r.clear(),i.clear();var a=null==o?void 0:o.raw.type;(l(a)||a===lr())&&(clearTimeout(n),Xo(t,Wc),Hi(t,e.classes))}},c=function(){r.set(Fc(t,lr(),a)),i.set(Fc(t,sr(),a))};if("ontransitionstart"in t.dom)var s=Fc(t,fr(),(function(t){u(t)&&(s.unbind(),c())}));else c();var f=function(t){var e=function(e){var n=Zi(t,e),r=o(n)?n.split(/\s*,\s*/):[];return $(r,hn)},n=function(t){if(o(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return mn(t,"ms")?e:1e3*e}return 0},r=e("transition-delay"),i=e("transition-duration");return K(i,(function(t,e,o){var i=n(r[o])+n(e);return Math.max(t,i)}),0)}(t);requestAnimationFrame((function(){n=setTimeout(a,f+17),Wo(t,Wc,n)}))},Xc=function(t,e,n,r,o,i){var u=function(t,e,n){return n.exists((function(n){var r=t.mode;return"all"===r||n[r]!==e[r]}))}(r,o,i);if(u||qc(t,r)){Yi(t,"position",n.position);var a=Tc(e,t),c=Oc(e,T(T({},o),{rect:a})),s=rt(Uc,(function(t){return c[t]}));Gc(n,s)&&(Qi(t,s),u&&function(t,e){Li(t,e.classes),Go(t,Wc).each((function(e){clearTimeout(parseInt(e,10)),Xo(t,Wc)})),$c(t,e)}(t,r),iu(t))}else Hi(t,r.classes)},Kc=function(t,e,n,r){ou(e,"max-height"),ou(e,"max-width");var o,i={width:Mu(o=e),height:Su(o)};return function(t,e,n,r,o,i){var u=r.width,a=r.height,c=function(e,c,s,l,f){var d=e(n,r,o,t,i),m=Bc(d,u,a,i);return m.fold(v(m),(function(t,e,n,r){return(f===r?n>l||e>s:!f&&r)?m:zc.nofit(c,s,l,f)}))};return K(e,(function(t,e){var n=w(c,e);return t.fold(v(t),n)}),zc.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:Oa(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1)).fold(b,b)}(e,r.preference,t,i,n,r.bounds)},Yc=function(t,e){!function(t,e){Wo(t,"data-alloy-placement",e)}(t,e.placement)},Jc=function(t,e){!function(t,e){var n=xu.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Yi(t,"max-height",n+"px")}(t,Math.floor(e))},Qc=v((function(t,e){Jc(t,e),Ji(t,{"overflow-x":"hidden","overflow-y":"auto"})})),Zc=v((function(t,e){Jc(t,e)})),ts=function(t,e,n){return void 0===t[e]?n:t[e]},es=function(t,e,n,r){var o=Kc(t,e,n,r);return function(t,e,n){var r=Oc(n.origin,e);n.transition.each((function(o){Xc(t,n.origin,r,o,e,n.lastPlacement)})),Cc(t,r)}(e,o,r),Yc(e,o),function(t,e){var n=e.classes;Hi(t,n.off),Li(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r),{layout:o.layout,placement:o.placement}},ns=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],rs=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,u=function(t){return Lt(n,t).getOr([])},a=function(t,e,n){var r=nt(ns,n);return{offset:Ou(t,e),classesOn:Z(n,u),classesOff:Z(r,u)}};return{southeast:function(){return a(-t,e,["top","alignLeft"])},southwest:function(){return a(t,e,["top","alignRight"])},south:function(){return a(-t/2,e,["top","alignCentre"])},northeast:function(){return a(-t,-e,["bottom","alignLeft"])},northwest:function(){return a(t,-e,["bottom","alignRight"])},north:function(){return a(-t/2,-e,["bottom","alignCentre"])},east:function(){return a(t,-e/2,["valignCentre","left"])},west:function(){return a(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return a(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return a(-o,i,["top","alignRight","inset"])},insetNorth:function(){return a(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return a(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return a(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return a(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return a(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return a(o,-i/2,["valignCentre","left","inset"])}}},os=function(){return rs(0,0,{})},is=b,us=function(t,e){return function(n){return"rtl"===as(n)?e:t}},as=function(t){return"rtl"===Zi(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(Ac||(Ac={}));var cs="data-alloy-vertical-dir",ss=function(t){return Yu(t,(function(t){return lo(t)&&qo(t,"data-alloy-vertical-dir")===Ac.BottomToTop}))},ls=function(){return Ge("layouts",[Me("onLtr"),Me("onRtl"),Fe("onBottomLtr"),Fe("onBottomRtl")])},fs=function(t,e,n,r,o,i,u){var a=u.map(ss).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=a?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=a?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r);return us(l,f)(t)},ds=[Me("hotspot"),Fe("bubble"),$e("overrides",{}),ls(),wa("placement",(function(t,e,n){var r=e.hotspot,o=Tc(n,r.element),i=fs(t.element,e,tc(),ec(),Qa(),Za(),B.some(e.hotspot.element));return B.some(is({anchorBox:o,bubble:e.bubble.getOr(os()),overrides:e.overrides,layouts:i,placer:B.none()}))}))],ms=[Me("x"),Me("y"),$e("height",0),$e("width",0),$e("bubble",os()),$e("overrides",{}),ls(),wa("placement",(function(t,e,n){var r=Ec(n,e.x,e.y),o=ju(r.left,r.top,e.width,e.height),i=fs(t.element,e,Ya(),Ja(),Ya(),Ja(),B.none());return B.some(is({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:B.none()}))}))],gs=zn([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),hs=function(t){return t.fold(b,(function(t,e,n){return t.translate(-e,-n)}))},ps=function(t){return t.fold(b,b)},vs=function(t){return K(t,(function(t,e){return t.translate(e.left,e.top)}),Ou(0,0))},bs=function(t){var e=W(t,ps);return vs(e)},ys=gs.screen,ws=gs.absolute,xs=function(t,e,n){var r=ho(t.element),o=Bu(r),i=function(t,e,n){var r=bo(n.root).dom;return B.from(r.frameElement).map(on.fromDom).filter((function(e){var n=ho(e),r=ho(t.element);return Mn(n,r)})).map(_u)}(t,0,n).getOr(o);return ws(i,o.left,o.top)},Cs=function(t,e,n,r){var o=ys(Ou(t,e));return B.some(function(t,e,n){return{point:t,width:e,height:n}}(o,n,r))},Ss=function(t,e,n,r,o){return t.map((function(t){var i,u,a,c=[e,t.point],s=(i=function(){return bs(c)},u=function(){return bs(c)},a=function(){return function(t){var e=W(t,hs);return vs(e)}(c)},r.fold(i,u,a)),l=function(t,e,n,r){return{x:t,y:e,width:n,height:r}}(s.left,s.top,t.width,t.height),f=n.showAbove?Qa():tc(),d=n.showAbove?Za():ec(),m=fs(o,n,f,d,f,d,B.none());return is({anchorBox:l,bubble:n.bubble.getOr(os()),overrides:n.overrides,layouts:m,placer:B.none()})}))},ks=[Me("node"),Me("root"),Fe("bubble"),ls(),$e("overrides",{}),$e("showAbove",!1),wa("placement",(function(t,e,n){var r=xs(t,0,e);return e.node.filter(qi).bind((function(o){var i=o.dom.getBoundingClientRect(),u=Cs(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return Ss(u,r,e,n,a)}))}))],Os=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Ts=zn([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),_s=(Ts.before,Ts.on,Ts.after,function(t){return t.fold(b,b,b)}),Es=zn([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),As={domRange:Es.domRange,relative:Es.relative,exact:Es.exact,exactFromRange:function(t){return Es.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return on.fromDom(t.startContainer)},relative:function(t,e){return _s(t)},exact:function(t,e,n,r){return t}})}(t);return bo(e)},range:Os},Ds=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Ms=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Ns=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Rs=zn([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),zs=function(t,e,n){return e(on.fromDom(n.startContainer),n.startOffset,on.fromDom(n.endContainer),n.endOffset)},Bs=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return Rs.rtl(on.fromDom(t.endContainer),t.endOffset,on.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return zs(0,Rs.ltr,n)})):zs(0,Rs.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:v(t),rtl:B.none}},relative:function(e,n){return{ltr:Wt((function(){return Ds(t,e,n)})),rtl:Wt((function(){return B.some(Ds(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:Wt((function(){return Ms(t,e,n,r,o)})),rtl:Wt((function(){return B.some(Ms(t,r,o,e,n))}))}}})}(t,e))},Is=function(t,e){return Bs(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Rs.ltr,Rs.rtl;var Ps,Ls=function(t,e){var n=function(e){return t(e)?B.from(e.dom.nodeValue):B.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(fo,"text"),Hs=function(t){return Ls.getOption(t)},Fs=["img","br"],Vs=function(t){return Hs(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||F(Fs,co(t))},js=function(t,e){var n=function(t){for(var r=xo(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return B.some(i);var u=n(i);if(u.isSome())return u}return B.none()};return n(t)},Us=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Dn(n)?[]:W(n.querySelectorAll(t),on.fromDom)}(e,t)},Ws=function(t,e,n,r){var o=function(t,e,n,r){var o=ho(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=Mn(t,n)&&e===r;return o.collapsed&&!i},qs=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return B.some(Os(on.fromDom(e.startContainer),e.startOffset,on.fromDom(n.endContainer),n.endOffset))}return B.none()},Gs=function(t){if(null===t.anchorNode||null===t.focusNode)return qs(t);var e=on.fromDom(t.anchorNode),n=on.fromDom(t.focusNode);return Ws(e,t.anchorOffset,n,t.focusOffset)?B.some(Os(e,t.anchorOffset,n,t.focusOffset)):qs(t)},$s=function(t){return function(t){return B.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind(Gs)},Xs=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?B.some(n).map(Ns):B.none()}(Is(t,e))},Ks=function(t,e){return function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?B.some(e).map(Ns):B.none()}(Is(t,e))},Ys=function(t,e){return{element:t,offset:e}},Js=function(t,e){var n=xo(t);if(0===n.length)return Ys(t,e);if(e<n.length)return Ys(n[e],0);var r=n[n.length-1],o=fo(r)?function(t){return Ls.get(t)}(r).length:xo(r).length;return Ys(r,o)},Qs=function(t,e){return fo(t)?Ys(t,e):Js(t,e)},Zs=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return $s(t)}}))().map((function(t){var e=Qs(t.start,t.soffset),n=Qs(t.finish,t.foffset);return As.range(e.element,e.offset,n.element,n.offset)}))},tl=[Fe("getSelection"),Me("root"),Fe("bubble"),ls(),$e("overrides",{}),$e("showAbove",!1),wa("placement",(function(t,e,n){var r=bo(e.root).dom,o=xs(t,0,e),i=Zs(r,e).bind((function(t){return Ks(r,As.exactFromRange(t)).orThunk((function(){var e=on.fromText("\ufeff");Ro(t.start,e);var n=Xs(r,As.exact(e,0,e,1));return Ho(e),n})).bind((function(t){return Cs(t.left,t.top,t.width,t.height)}))})),u=Zs(r,e).bind((function(t){return lo(t.start)?B.some(t.start):function(t){return yo(t)}(t.start)})).getOr(t.element);return Ss(i,o,e,n,u)}))],el=function(t){return t.x+t.width},nl=function(t,e){return t.x-e.width},rl=function(t,e){return t.y-e.height+t.height},ol=function(t){return t.y},il=function(t,e,n){return Sa(el(t),ol(t),n.southeast(),Oa(),"southeast",Ba(t,{left:0,top:2}),"link-layout")},ul=function(t,e,n){return Sa(nl(t,e),ol(t),n.southwest(),Ta(),"southwest",Ba(t,{right:1,top:2}),"link-layout")},al=function(t,e,n){return Sa(el(t),rl(t,e),n.northeast(),_a(),"northeast",Ba(t,{left:0,bottom:3}),"link-layout")},cl=function(t,e,n){return Sa(nl(t,e),rl(t,e),n.northwest(),Ea(),"northwest",Ba(t,{right:1,bottom:3}),"link-layout")},sl=function(){return[il,ul,al,cl]},ll=function(){return[ul,il,cl,al]},fl=[Me("item"),ls(),$e("overrides",{}),wa("placement",(function(t,e,n){var r=Tc(n,e.item.element),o=fs(t.element,e,sl(),ll(),sl(),ll(),B.none());return B.some(is({anchorBox:r,bubble:os(),overrides:e.overrides,layouts:o,placer:B.none()}))}))],dl=_e("type",{selection:tl,node:ks,hotspot:ds,submenu:fl,makeshift:ms}),ml=[He("classes",ge),Je("mode","all",["all","layout","placement"])],gl=[$e("useFixed",S),Fe("getBounds")],hl=[Ne("anchor",dl),Ge("transition",ml)],pl=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u,a){var c=ts(u,"maxHeightFunction",Qc()),s=ts(u,"maxWidthFunction",h),l=t.anchorBox,f=t.origin,d={bounds:_c(f,i),origin:f,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:a};return es(l,e,n,d)}(Nc(n.anchorBox,e),o.element,n.bubble,n.layouts,i,r,n.overrides,u)},vl=function(t,e,n,r,o,i){var u=i.map(Uu);return bl(t,e,n,r,o,u)},bl=function(t,e,n,r,o,i){var u=Oe("placement.info",ue(hl),o),a=u.anchor,c=r.element,s=n.get(r.uid);wc((function(){Yi(c,"position","fixed");var o=eu(c,"visibility");Yi(c,"visibility","hidden");var l,f=e.useFixed()?(l=document.documentElement,Mc(0,0,l.clientWidth,l.clientHeight)):function(t){var e=_u(t.element),n=t.element.dom.getBoundingClientRect();return Dc(e.left,e.top,n.width,n.height)}(t),d=a.placement,m=i.map(v).or(e.getBounds);d(t,a,f).each((function(e){var o=e.placer.getOr(pl)(t,f,e,m,r,s,u.transition);n.set(r.uid,o)})),o.fold((function(){ou(c,"visibility")}),(function(t){Yi(c,"visibility",t)})),eu(c,"left").isNone()&&eu(c,"top").isNone()&&eu(c,"right").isNone()&&eu(c,"bottom").isNone()&&Fi(eu(c,"position"),"fixed")&&ou(c,"position")}),c)},yl=Object.freeze({__proto__:null,position:function(t,e,n,r,o){vl(t,e,n,r,o,B.none())},positionWithin:vl,positionWithinBounds:bl,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"},reset:function(t,e,n,r){var o=r.element;q(["position","left","right","top","bottom"],(function(t){return ou(o,t)})),function(t){Xo(t,"data-alloy-placement")}(o),n.clear(r.uid)}}),wl=Object.freeze({__proto__:null,init:function(){var t={};return bi({readState:function(){return t},clear:function(e){f(e)?delete t[e]:t={}},set:function(e,n){t[e]=n},get:function(e){return Lt(t,e)}})}}),xl=lc({fields:gl,name:"positioning",active:hc,apis:yl,state:wl}),Cl=function(t){Fr(t,Mr());var e=t.components();q(e,Cl)},Sl=function(t){var e=t.components();q(e,Sl),Fr(t,Dr())},kl=function(t,e){Io(t.element,e.element)},Ol=function(t,e){var n=t.components();!function(t){q(t.components(),(function(t){return Ho(t.element)})),Lo(t.element),t.syncComponents()}(t);var r=nt(n,e);q(r,(function(e){Cl(e),t.getSystem().removeFromWorld(e)})),q(e,(function(e){e.getSystem().isConnected()?kl(t,e):(t.getSystem().addToWorld(e),kl(t,e),qi(t.element)&&Sl(e)),t.syncComponents()}))},Tl=function(t,e){_l(t,e,Io)},_l=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),qi(t.element)&&Sl(e),t.syncComponents()},El=function(t){Cl(t),Ho(t.element),t.getSystem().removeFromWorld(t)},Al=function(t){var e=yo(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));El(t),e.each((function(t){t.syncComponents()}))},Dl=function(t){var e=t.components();q(e,El),Lo(t.element),t.syncComponents()},Ml=function(t,e){Nl(t,e,Io)},Nl=function(t,e,n){n(t,e.element);var r=xo(e.element);q(r,(function(t){e.getByDom(t).each(Sl)}))},Rl=function(t){var e=xo(t.element);q(e,(function(e){t.getByDom(e).each(Cl)})),Ho(t.element)},zl=function(t,e,n,r){n.get().each((function(e){Dl(t)}));var o=e.getAttachPoint(t);Tl(o,t);var i=t.getSystem().build(r);return Tl(t,i),n.set(i),i},Bl=function(t,e,n,r){var o=zl(t,e,n,r);return e.onOpen(t,o),o},Il=function(t,e,n){n.get().each((function(r){Dl(t),Al(t),e.onClose(t,r),n.clear()}))},Pl=function(t,e,n){return n.isOpen()},Ll=function(t,e,n){var r=e.getAttachPoint(t);Yi(t.element,"position",xl.getMode(r)),function(t,e,n,r){eu(t.element,e).fold((function(){Xo(t.element,n)}),(function(e){Wo(t.element,n,e)})),Yi(t.element,e,r)}(t,"visibility",e.cloakVisibilityAttr,"hidden")},Hl=function(t,e,n){(function(t){return V(["top","left","right","bottom"],(function(e){return eu(t,e).isSome()}))})(t.element)||ou(t.element,"position"),function(t,e,n){Go(t.element,n).fold((function(){return ou(t.element,e)}),(function(n){return Yi(t.element,e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},Fl=Object.freeze({__proto__:null,cloak:Ll,decloak:Hl,open:Bl,openWhileCloaked:function(t,e,n,r,o){Ll(t,e),Bl(t,e,n,r),o(),Hl(t,e)},close:Il,isOpen:Pl,isPartOf:function(t,e,n,r){return Pl(0,0,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map((function(){return zl(t,e,n,r)}))}}),Vl=Object.freeze({__proto__:null,events:function(t,e){return Gr([Kr(Sr(),(function(n,r){Il(n,t,e)}))])}}),jl=[pa("onOpen"),pa("onClose"),Me("isPartOf"),Me("getAttachPoint"),$e("cloakVisibilityAttr","data-precloak-visibility")],Ul=lc({fields:jl,name:"sandboxing",active:Vl,apis:Fl,state:Object.freeze({__proto__:null,init:function(){var t=Lc(),e=v("not-implemented");return bi({readState:e,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}})}),Wl=v("dismiss.popups"),ql=v("reposition.popups"),Gl=v("mouse.released"),$l=ie([$e("isExtraPart",S),Ge("fireEventInstead",[$e("event",Nr())])]),Xl=function(t){var e,n=Oe("Dismissal",$l,t);return(e={})[Wl()]={schema:ie([Me("target")]),onReceive:function(t,e){Ul.isOpen(t)&&(Ul.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return Ul.close(t)}),(function(e){return Fr(t,e.event)})))}},e},Kl=ie([Ge("fireEventInstead",[$e("event",Rr())]),Ie("doReposition")]),Yl=function(t){var e,n=Oe("Reposition",Kl,t);return(e={})[ql()]={onReceive:function(t){Ul.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return Fr(t,e.event)}))}},e},Jl=function(t,e,n){e.store.manager.onLoad(t,e,n)},Ql=function(t,e,n){e.store.manager.onUnload(t,e,n)},Zl=Object.freeze({__proto__:null,onLoad:Jl,onUnload:Ql,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),tf=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[ro((function(n,r){Jl(n,t,e)})),oo((function(n,r){Ql(n,t,e)}))]:[oc(t,e,Jl)];return Gr(n)}}),ef=function(){var t=nn(null);return bi({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()}}})},nf=function(){var t=nn({}),e=nn({});return bi({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return Lt(t.get(),n).orThunk((function(){return Lt(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},u={};q(n,(function(t){i[t.value]=t,Lt(t,"meta").each((function(e){Lt(e,"text").each((function(e){u[e]=t}))}))})),t.set(T(T({},r),i)),e.set(T(T({},o),u))},clear:function(){t.set({}),e.set({})}})},rf=Object.freeze({__proto__:null,memory:ef,dataset:nf,manual:function(){return bi({readState:h})},init:function(t){return t.store.manager.state(t)}}),of=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},uf=[Fe("initialValue"),Me("getFallbackEntry"),Me("getDataKey"),Me("setValue"),wa("manager",{setValue:of,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).getOrThunk((function(){return r.getFallbackEntry(o)}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){of(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:nf})],af=[Me("getValue"),$e("setValue",h),Fe("initialValue"),wa("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:h,state:vi.init})],cf=[Fe("initialValue"),wa("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:ef})],sf=[Xe("store",{mode:"memory"},_e("mode",{memory:cf,manual:af,dataset:uf})),pa("onSetValue"),$e("resetOnDom",!1)],lf=lc({fields:sf,name:"representing",active:tf,apis:Zl,extra:{setValueFrom:function(t,e){var n=lf.getValue(e);lf.setValue(t,n)}},state:rf}),ff=function(t,e){return en(t,{},W(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,Ee(n,n,{tag:"option",process:{}},Qt((function(t){return xt("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([Ae("dump",b)]))},df=function(t){return t.dump},mf=function(t,e){return T(T({},t.dump),cc(e))},gf=ff,hf=mf,pf=zn([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),vf=function(t){return Ht(t,"uiType")},bf=function(t,e,n,r){return vf(n)&&"placeholder"===n.uiType?function(t,e,n,r){return t.exists((function(t){return t!==n.owner}))?pf.single(!0,v(n)):Lt(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+At(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,r):pf.single(!1,v(n))},yf=function(t,e,n,r){return bf(t,0,n,r).fold((function(o,i){var u=vf(n)?i(e,n.config,n.validated):i(e),a=Lt(u,"components").getOr([]),c=Z(a,(function(n){return yf(t,e,n,r)}));return[T(T({},u),{components:c})]}),(function(t,r){if(vf(n)){var o=r(e,n.config,n.validated);return n.validated.preprocess.getOr(b)(o)}return r(e)}))},wf=function(t,e,n,r){var o=Nt(r,(function(t,e){return r=t,o=!1,{name:v(n=e),required:function(){return r.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return o},replace:function(){if(o)throw new Error("Trying to use the same placeholder more than once: "+n);return o=!0,r}};var n,r,o})),i=function(t,e,n,r){return Z(n,(function(n){return yf(t,e,n,r)}))}(t,e,n,o);return Mt(o,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),i},xf=pf.single,Cf=pf.multiple,Sf=v("placeholder"),kf=zn([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Of=$e("factory",{sketch:b}),Tf=$e("schema",[]),_f=Me("name"),Ef=Ee("pname","pname",qt((function(t){return"<alloy."+ei(t.name)+">"})),fe()),Af=Ae("schema",(function(){return[Fe("preprocess")]})),Df=$e("defaults",v({})),Mf=$e("overrides",v({})),Nf=ue([Of,Tf,_f,Ef,Df,Mf]),Rf=ue([Of,Tf,_f,Df,Mf]),zf=ue([Of,Tf,_f,Ef,Df,Mf]),Bf=ue([Of,Af,_f,Me("unit"),Ef,Df,Mf]),If=function(t){return t.fold(B.some,B.none,B.some,B.some)},Pf=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Lf=function(t,e){return function(n){var r=Oe("Converting part type",e,n);return t(r)}},Hf=Lf(kf.required,Nf),Ff=Lf(kf.external,Rf),Vf=Lf(kf.optional,zf),jf=Lf(kf.group,Bf),Uf=v("entirety"),Wf=Object.freeze({__proto__:null,required:Hf,external:Ff,optional:Vf,group:jf,asNamedPart:If,name:Pf,asCommon:function(t){return t.fold(b,b,b,b)},original:Uf}),qf=function(t,e,n,r){return jt(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},Gf=function(t,e){var n={};return q(e,(function(e){If(e).each((function(e){var r=$f(t,e.pname);n[e.name]=function(n){var o=Oe("Part: "+e.name+" in "+t,ue(e.schema),n);return T(T({},r),{config:n,validated:o})}}))})),n},$f=function(t,e){return{uiType:Sf(),owner:t,name:e}},Xf=function(t,e,n){return{uiType:Sf(),owner:t,name:e,config:n,validated:{}}},Kf=function(t){return Z(t,(function(t){return t.fold(B.none,B.some,B.none,B.none).map((function(t){return Pe(t.name,t.schema.concat([xa(Uf())]))})).toArray()}))},Yf=function(t){return W(t,Pf)},Jf=function(t,e,n){return function(t,e,n){var r={},o={};return q(n,(function(t){t.fold((function(t){r[t.pname]=xf(!0,(function(e,n,r){return t.factory.sketch(qf(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=v(t.factory.sketch(qf(e,t,n[Uf()]),n))}),(function(t){r[t.pname]=xf(!1,(function(e,n,r){return t.factory.sketch(qf(e,t,n,r))}))}),(function(t){r[t.pname]=Cf(!0,(function(e,n,r){var o=e[t.name];return W(o,(function(n){return t.factory.sketch(jt(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:v(r),externals:v(o)}}(0,e,n)},Qf=function(t,e,n){return wf(B.some(t),e,e.components,n)},Zf=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},td=function(t,e,n){return Zf(t,e,n).getOrDie("Could not find part: "+n)},ed=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return q(n,(function(t){r[t]=v(i.getByUid(o[t]))})),r},nd=function(t,e){var n=t.getSystem();return Nt(e.partUids,(function(t,e){return v(n.getByUid(t))}))},rd=function(t){return At(t.partUids)},od=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return q(n,(function(t){r[t]=v(i.getByUid(o[t]).getOrDie())})),r},id=function(t,e){var n=Yf(e);return Pn(W(n,(function(e){return{key:e,value:t+"-"+e}})))},ud=function(t){return Ee("partUids","partUids",$t((function(e){return id(e.uid,t)})),fe())},ad=Object.freeze({__proto__:null,generate:Gf,generateOne:Xf,schemas:Kf,names:Yf,substitutes:Jf,components:Qf,defaultUids:id,defaultUidsSchema:ud,getAllParts:nd,getAllPartNames:rd,getPart:Zf,getPartOrDie:td,getParts:ed,getPartsOrDie:od}),cd=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[Pe("parts",t)]:[]).concat([Me("uid"),$e("dom",{}),$e("components",[]),xa("originalSpec"),$e("debug.sketcher",{})]).concat(e)}(r,o);return Oe(t+" [SpecSchema]",ie(i.concat(e)),n)},sd=function(t,e,n,r,o){var i=ld(o),u=Kf(n),a=ud(n),c=cd(t,e,i,u,[a]),s=Jf(0,c,n);return r(c,Qf(t,c,s.internals()),i,s.externals())},ld=function(t){return function(t){return Ht(t,"uid")}(t)?t:T(T({},t),{uid:ci("uid")})},fd=ie([Me("name"),Me("factory"),Me("configFields"),$e("apis",{}),$e("extraApis",{})]),dd=ie([Me("name"),Me("factory"),Me("configFields"),Me("partFields"),$e("apis",{}),$e("extraApis",{})]),md=function(t){var e=Oe("Sketcher for "+t.name,fd,t),n=Nt(e.apis,pi),r=Nt(e.extraApis,(function(t,e){return mi(t,e)}));return T(T({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=ld(r);return n(cd(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},gd=function(t){var e=Oe("Sketcher for "+t.name,dd,t),n=Gf(e.name,e.partFields),r=Nt(e.apis,pi),o=Nt(e.extraApis,(function(t,e){return mi(t,e)}));return T(T({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return sd(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},hd=function(t){return"input"===co(t)&&"radio"!==qo(t,"type")||"textarea"===co(t)},pd=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),vd=[Me("find")],bd=lc({fields:vd,name:"composing",apis:pd}),yd=["input","button","textarea","select"],wd=function(t,e,n){(e.disabled()?Td:_d)(t,e)},xd=function(t,e){return!0===e.useNative&&F(yd,co(t.element))},Cd=function(t){Wo(t.element,"disabled","disabled")},Sd=function(t){Xo(t.element,"disabled")},kd=function(t){Wo(t.element,"aria-disabled","true")},Od=function(t){Wo(t.element,"aria-disabled","false")},Td=function(t,e,n){e.disableClass.each((function(e){zi(t.element,e)})),(xd(t,e)?Cd:kd)(t),e.onDisabled(t)},_d=function(t,e,n){e.disableClass.each((function(e){Ii(t.element,e)})),(xd(t,e)?Sd:Od)(t),e.onEnabled(t)},Ed=function(t,e){return xd(t,e)?function(t){return $o(t.element,"disabled")}(t):function(t){return"true"===qo(t.element,"aria-disabled")}(t)},Ad=Object.freeze({__proto__:null,enable:_d,disable:Td,isDisabled:Ed,onLoad:wd,set:function(t,e,n,r){(r?Td:_d)(t,e)}}),Dd=Object.freeze({__proto__:null,exhibit:function(t,e){return wi({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return Gr([$r(yr(),(function(e,n){return Ed(e,t)})),oc(t,e,wd)])}}),Md=[Ze("disabled",S),$e("useNative",!0),Fe("disableClass"),pa("onDisabled"),pa("onEnabled")],Nd=lc({fields:Md,name:"disabling",active:Dd,apis:Ad}),Rd=function(t,e,n,r){var o=Us(t.element,"."+e.highlightClass);q(o,(function(n){V(r,(function(t){return t.element===n}))||(Ii(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Fr(n,Hr())})))}))},zd=function(t,e,n,r){Rd(t,e,0,[r]),Bd(t,e,n,r)||(zi(r.element,e.highlightClass),e.onHighlight(t,r),Fr(r,Lr()))},Bd=function(t,e,n,r){return Pi(r.element,e.highlightClass)},Id=function(t,e,n,r){var o=Us(t.element,"."+e.itemClass);return B.from(o[r]).fold((function(){return mt.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},Pd=function(t,e,n){return Zu(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Ld=function(t,e,n){var r=Us(t.element,"."+e.itemClass);return(r.length>0?B.some(r[r.length-1]):B.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Hd=function(t,e,n,r){var o=Us(t.element,"."+e.itemClass);return J(o,(function(t){return Pi(t,e.highlightClass)})).bind((function(e){var n=Ra(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},Fd=function(t,e,n){var r=Us(t.element,"."+e.itemClass);return Vi(W(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},Vd=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Rd(t,e,0,[])},dehighlight:function(t,e,n,r){Bd(t,e,n,r)&&(Ii(r.element,e.highlightClass),e.onDehighlight(t,r),Fr(r,Hr()))},highlight:zd,highlightFirst:function(t,e,n){Pd(t,e).each((function(r){zd(t,e,n,r)}))},highlightLast:function(t,e,n){Ld(t,e).each((function(r){zd(t,e,n,r)}))},highlightAt:function(t,e,n,r){Id(t,e,n,r).fold((function(t){throw t}),(function(r){zd(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=Fd(t,e);Y(o,r).each((function(r){zd(t,e,n,r)}))},isHighlighted:Bd,getHighlighted:function(t,e,n){return Zu(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:Pd,getLast:Ld,getPrevious:function(t,e,n){return Hd(t,e,0,-1)},getNext:function(t,e,n){return Hd(t,e,0,1)},getCandidates:Fd}),jd=[Me("highlightClass"),Me("itemClass"),pa("onHighlight"),pa("onDehighlight")],Ud=lc({fields:jd,name:"highlighting",apis:Vd}),Wd=[8],qd=[9],Gd=[13],$d=[27],Xd=[32],Kd=[37],Yd=[38],Jd=[39],Qd=[40],Zd=function(t,e,n){var r=et(t.slice(0,e)),o=et(t.slice(e+1));return Y(r.concat(o),n)},tm=function(t,e,n){var r=et(t.slice(0,e));return Y(r,n)},em=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return Y(o.concat(r),n)},nm=function(t,e,n){var r=t.slice(e+1);return Y(r,n)},rm=function(t){return function(e){var n=e.raw;return F(t,n.which)}},om=function(t){return function(e){return tt(t,(function(t){return t(e)}))}},im=function(t){return!0===t.raw.shiftKey},um=function(t){return!0===t.raw.ctrlKey},am=x(im),cm=function(t,e){return{matches:t,classification:e}},sm=function(t,e,n){e.exists((function(t){return n.exists((function(e){return Mn(e,t)}))}))||Vr(t,zr(),{prevFocus:e,newFocus:n})},lm=function(){var t=function(t){return yc(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);sm(e,r,o)}}},fm=function(){var t=function(t){return Ud.getHighlighted(t).map((function(t){return t.element}))};return{get:t,set:function(e,n){var r=t(e);e.getSystem().getByDom(n).fold(h,(function(t){Ud.highlight(e,t)}));var o=t(e);sm(e,r,o)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Ps||(Ps={}));var dm,mm=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,u,a=n(t,e,r,o);return(i=a,u=e.event,Y(i,(function(t){return t.matches(u)})).map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},u={schema:function(){return t.concat([$e("focusManager",lm()),Xe("focusInside","onFocus",xe((function(t){return F(["onFocus","onEnterOrSpace","onApi"],t)?mt.value(t):mt.error("Invalid value for focusInside")}))),wa("handler",u),wa("state",e),wa("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var u=t.focusInside!==Ps.OnFocusMode?B.none():o(t).map((function(n){return Kr(hr(),(function(r,o){n(r,t,e),o.stop()}))})),a=[Kr(or(),(function(r,u){i(r,u,n,t,e).fold((function(){!function(n,r){var i=rm(Xd.concat(Gd))(r.event);t.focusInside===Ps.OnEnterOrSpaceMode&&i&&jn(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,u)}),(function(t){u.stop()}))})),Kr(ir(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return Gr(u.toArray().concat(a))}};return u},gm=function(t){var e=[Fe("onEscape"),Fe("onEnter"),$e("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),$e("firstTabstop",0),$e("useTabstopAt",k),Fe("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return ta(e,t)})).getOr(e);return Cu(n)>0},r=function(t,e,r){(function(t,e){var r=Us(t.element,e.selector),o=$(r,(function(t){return n(e,t)}));return B.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},o=function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?B.some(!0):B.none()}),(function(e){return o.focusManager.set(t,e),B.some(!0)}))},i=function(t,e,n,r){var i=Us(t.element,n.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return ta(t,e.selector)}))}(t,n).bind((function(e){return J(i,w(Mn,e)).bind((function(e){return o(t,i,e,n,r)}))}))},u=v([cm(om([im,rm(qd)]),(function(t,e,n){var r=n.cyclic?Zd:tm;return i(t,0,n,r)})),cm(rm(qd),(function(t,e,n){var r=n.cyclic?em:nm;return i(t,0,n,r)})),cm(rm($d),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),cm(om([am,rm(Gd)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),a=v([]);return mm(e,vi.init,u,a,(function(){return B.some(r)}))},hm=gm(Ae("cyclic",S)),pm=gm(Ae("cyclic",k)),vm=function(t,e,n){return hd(n)&&rm(Xd)(e.event)?B.none():function(t,e,n){return Ur(t,n,yr()),B.some(!0)}(t,0,n)},bm=function(t,e){return B.some(!0)},ym=[$e("execute",vm),$e("useSpace",!1),$e("useEnter",!0),$e("useControlEnter",!1),$e("useDown",!1)],wm=function(t,e,n){return n.execute(t,e,t.element)},xm=mm(ym,vi.init,(function(t,e,n,r){var o=n.useSpace&&!hd(t.element)?Xd:[],i=n.useEnter?Gd:[],u=n.useDown?Qd:[],a=o.concat(i).concat(u);return[cm(rm(a),wm)].concat(n.useControlEnter?[cm(om([um,rm(Gd)]),wm)]:[])}),(function(t,e,n,r){return n.useSpace&&!hd(t.element)?[cm(rm(Xd),bm)]:[]}),(function(){return B.none()})),Cm=function(){var t=Lc();return bi({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set({numRows:e,numColumns:n})},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},Sm=Object.freeze({__proto__:null,flatgrid:Cm,init:function(t){return t.state(t)}}),km=function(t){return function(e,n,r,o){var i=t(e.element);return Em(i,e,n,r,o)}},Om=function(t,e){var n=us(t,e);return km(n)},Tm=function(t,e){var n=us(e,t);return km(n)},_m=function(t){return function(e,n,r,o){return Em(t,e,n,r,o)}},Em=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},Am=_m,Dm=_m,Mm=_m,Nm=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},Rm=function(t,e,n){var r=Us(t,n);return function(t,e){return J(t,e).map((function(e){return{index:e,candidates:t}}))}($(r,Nm),(function(t){return Mn(t,e)}))},zm=function(t,e){return J(t,(function(t){return Mn(e,t)}))},Bm=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?B.some(t[r]):B.none()}))},Im=function(t,e,n,r,o){return Bm(t,e,r,(function(e,i){var u=e===n-1?t.length-e*r:r,a=Ra(i,o,0,u-1);return B.some({row:e,column:a})}))},Pm=function(t,e,n,r,o){return Bm(t,e,r,(function(e,i){var u=Ra(e,o,0,n-1),a=u===n-1?t.length-u*r:r,c=za(i,0,a-1);return B.some({row:u,column:c})}))},Lm=[Me("selector"),$e("execute",vm),va("onEscape"),$e("captureTab",!1),Ca()],Hm=function(t,e,n){Zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Fm=function(t){return function(e,n,r,o){return Rm(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},Vm=function(t,e,n){return n.captureTab?B.some(!0):B.none()},jm=Fm((function(t,e,n,r){return Im(t,e,n,r,-1)})),Um=Fm((function(t,e,n,r){return Im(t,e,n,r,1)})),Wm=Fm((function(t,e,n,r){return Pm(t,e,n,r,-1)})),qm=Fm((function(t,e,n,r){return Pm(t,e,n,r,1)})),Gm=v([cm(rm(Kd),Om(jm,Um)),cm(rm(Jd),Tm(jm,Um)),cm(rm(Yd),Am(Wm)),cm(rm(Qd),Dm(qm)),cm(om([im,rm(qd)]),Vm),cm(om([am,rm(qd)]),Vm),cm(rm($d),(function(t,e,n){return n.onEscape(t,e)})),cm(rm(Xd.concat(Gd)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return ta(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),$m=v([cm(rm(Xd),bm)]),Xm=mm(Lm,Cm,Gm,$m,(function(){return B.some(Hm)})),Km=function(t,e,n,r){var o=function(t,e,n){var i,u=Ra(e,r,0,n.length-1);return u===t?B.none():(i=n[u],"button"===co(i)&&"disabled"===qo(i,"disabled")?o(t,u,n):B.from(n[u]))};return Rm(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},Ym=[Me("selector"),$e("getInitial",B.none),$e("execute",vm),va("onEscape"),$e("executeOnMove",!1),$e("allowVertical",!0)],Jm=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return ta(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},Qm=function(t,e,n){e.getInitial(t).orThunk((function(){return Zu(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},Zm=function(t,e,n){return Km(t,n.selector,e,-1)},tg=function(t,e,n){return Km(t,n.selector,e,1)},eg=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?Jm(e,n,r):B.some(!0)}))}},ng=function(t,e,n){return n.onEscape(t,e)},rg=v([cm(rm(Xd),bm)]),og=mm(Ym,vi.init,(function(t,e,n,r){var o=Kd.concat(n.allowVertical?Yd:[]),i=Jd.concat(n.allowVertical?Qd:[]);return[cm(rm(o),eg(Om(Zm,tg))),cm(rm(i),eg(Tm(Zm,tg))),cm(rm(Gd),Jm),cm(rm(Xd),Jm),cm(rm($d),ng)]}),rg,(function(){return B.some(Qm)})),ig=function(t,e,n){return B.from(t[e]).bind((function(t){return B.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},ug=function(t,e,n,r){var o=t[e].length,i=Ra(n,r,0,o-1);return ig(t,e,i)},ag=function(t,e,n,r){var o=Ra(n,r,0,t.length-1),i=t[o].length,u=za(e,0,i-1);return ig(t,o,u)},cg=function(t,e,n,r){var o=t[e].length,i=za(n+r,0,o-1);return ig(t,e,i)},sg=function(t,e,n,r){var o=za(n+r,0,t.length-1),i=t[o].length,u=za(e,0,i-1);return ig(t,o,u)},lg=[Pe("selectors",[Me("row"),Me("cell")]),$e("cycles",!0),$e("previousSelector",B.none),$e("execute",vm)],fg=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return Zu(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},dg=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return ta(r,o.selectors.row).bind((function(t){var e=Us(t,o.selectors.cell);return zm(e,r).bind((function(e){var r=Us(n,o.selectors.row);return zm(r,t).bind((function(t){var n=function(t,e){return W(t,(function(t){return Us(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},mg=dg((function(t,e,n){return ug(t,e,n,-1)}),(function(t,e,n){return cg(t,e,n,-1)})),gg=dg((function(t,e,n){return ug(t,e,n,1)}),(function(t,e,n){return cg(t,e,n,1)})),hg=dg((function(t,e,n){return ag(t,n,e,-1)}),(function(t,e,n){return sg(t,n,e,-1)})),pg=dg((function(t,e,n){return ag(t,n,e,1)}),(function(t,e,n){return sg(t,n,e,1)})),vg=v([cm(rm(Kd),Om(mg,gg)),cm(rm(Jd),Tm(mg,gg)),cm(rm(Yd),Am(hg)),cm(rm(Qd),Dm(pg)),cm(rm(Xd.concat(Gd)),(function(t,e,n){return yc(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),bg=v([cm(rm(Xd),bm)]),yg=mm(lg,vi.init,vg,bg,(function(){return B.some(fg)})),wg=[Me("selector"),$e("execute",vm),$e("moveOnTab",!1)],xg=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},Cg=function(t,e,n){Zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Sg=function(t,e,n){return Km(t,n.selector,e,-1)},kg=function(t,e,n){return Km(t,n.selector,e,1)},Og=v([cm(rm(Yd),Mm(Sg)),cm(rm(Qd),Mm(kg)),cm(om([im,rm(qd)]),(function(t,e,n,r){return n.moveOnTab?Mm(Sg)(t,e,n,r):B.none()})),cm(om([am,rm(qd)]),(function(t,e,n,r){return n.moveOnTab?Mm(kg)(t,e,n,r):B.none()})),cm(rm(Gd),xg),cm(rm(Xd),xg)]),Tg=v([cm(rm(Xd),bm)]),_g=mm(wg,vi.init,Og,Tg,(function(){return B.some(Cg)})),Eg=[va("onSpace"),va("onEnter"),va("onShiftEnter"),va("onLeft"),va("onRight"),va("onTab"),va("onShiftTab"),va("onUp"),va("onDown"),va("onEscape"),$e("stopSpaceKeyup",!1),Fe("focusIn")],Ag=mm(Eg,vi.init,(function(t,e,n){return[cm(rm(Xd),n.onSpace),cm(om([am,rm(Gd)]),n.onEnter),cm(om([im,rm(Gd)]),n.onShiftEnter),cm(om([im,rm(qd)]),n.onShiftTab),cm(om([am,rm(qd)]),n.onTab),cm(rm(Yd),n.onUp),cm(rm(Qd),n.onDown),cm(rm(Kd),n.onLeft),cm(rm(Jd),n.onRight),cm(rm(Xd),n.onSpace),cm(rm($d),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[cm(rm(Xd),bm)]:[]}),(function(t){return t.focusIn})),Dg=hm.schema(),Mg=pm.schema(),Ng=og.schema(),Rg=Xm.schema(),zg=yg.schema(),Bg=xm.schema(),Ig=_g.schema(),Pg=Ag.schema(),Lg=dc({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Dg,cyclic:Mg,flow:Ng,flatgrid:Rg,matrix:zg,execution:Bg,menu:Ig,special:Pg}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return Ft(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:Sm}),Hg=function(t,e,n,r){var o=t.getSystem().build(r);_l(t,o,n)},Fg=function(t,e,n,r){var o=Vg(t);Y(o,(function(t){return Mn(r.element,t.element)})).each(Al)},Vg=function(t,e){return t.components()},jg=function(t,e,n,r,o){var i=Vg(t);return B.from(i[r]).map((function(e){return Fg(t,0,0,e),o.each((function(e){Hg(t,0,(function(t,e){!function(t,e,n){Co(t,n).fold((function(){Io(t,e)}),(function(t){Ro(t,e)}))}(t,e,r)}),e)})),e}))},Ug=lc({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){Hg(t,0,Io,r)},prepend:function(t,e,n,r){Hg(t,0,Bo,r)},remove:Fg,replaceAt:jg,replaceBy:function(t,e,n,r,o){var i=Vg(t);return J(i,r).bind((function(e){return jg(t,0,0,e,o)}))},set:function(t,e,n,r){wc((function(){var e=W(r,t.getSystem().build);Ol(t,e)}),t.element)},contents:Vg})}),Wg=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=Gr(e);return lc({fields:[Me("enabled")],name:t,active:{events:v(n)}})}(t,e),configAsRaw:v({}),initialConfig:{},state:vi}}},qg=function(t,e){e.ignore||(pc(t.element),e.onFocus(t))},Gg=Object.freeze({__proto__:null,focus:qg,blur:function(t,e){e.ignore||function(t){t.dom.blur()}(t.element)},isFocused:function(t){return vc(t.element)}}),$g=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return wi(n)},events:function(t){return Gr([Kr(hr(),(function(e,n){qg(e,t),n.stop()}))].concat(t.stopMousedown?[Kr(Jn(),(function(t,e){e.event.prevent()}))]:[]))}}),Xg=[pa("onFocus"),$e("stopMousedown",!1),$e("ignore",!1)],Kg=lc({fields:Xg,name:"focusing",active:$g,apis:Gg}),Yg=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},Jg=function(t,e,n){e.toggleClass.each((function(e){n.get()?zi(t.element,e):Ii(t.element,e)}))},Qg=function(t,e,n){eh(t,e,n,!n.get())},Zg=function(t,e,n){n.set(!0),Jg(t,e,n),Yg(t,e,n)},th=function(t,e,n){n.set(!1),Jg(t,e,n),Yg(t,e,n)},eh=function(t,e,n,r){(r?Zg:th)(t,e,n)},nh=function(t,e,n){eh(t,e,n,e.selected)},rh=Object.freeze({__proto__:null,onLoad:nh,toggle:Qg,isOn:function(t,e,n){return n.get()},on:Zg,off:th,set:eh}),oh=Object.freeze({__proto__:null,exhibit:function(){return wi({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=Qg,uo((function(t){o(t,n,r)}))),u=oc(t,e,nh);return Gr(Q([t.toggleOnExecute?[i]:[],[u]]))}}),ih=function(t,e,n){Wo(t.element,"aria-expanded",n)},uh=[$e("selected",!1),Fe("toggleClass"),$e("toggleOnExecute",!0),Xe("aria",{mode:"none"},_e("mode",{pressed:[$e("syncWithExpanded",!1),wa("update",(function(t,e,n){Wo(t.element,"aria-pressed",n),e.syncWithExpanded&&ih(t,e,n)}))],checked:[wa("update",(function(t,e,n){Wo(t.element,"aria-checked",n)}))],expanded:[wa("update",ih)],selected:[wa("update",(function(t,e,n){Wo(t.element,"aria-selected",n)}))],none:[wa("update",h)]}))],ah=lc({fields:uh,name:"toggling",active:oh,apis:rh,state:(dm=!1,{init:function(){var t=nn(dm);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(dm)},readState:function(){return t.get()}}}})}),ch=function(){var t=function(t,e){e.stop(),jr(t)};return[Kr(cr(),t),Kr(xr(),t),to($n()),to(Jn())]},sh=function(t){return Gr(Q([t.map((function(t){return uo((function(e,n){t(e),n.stop()}))})).toArray(),ch()]))},lh=function(t){(yc(t.element).isNone()||Kg.isFocused(t))&&(Kg.isFocused(t)||Kg.focus(t),Vr(t,"alloy.item-hover",{item:t}))},fh=function(t){Vr(t,"alloy.item-focus",{item:t})},dh=v("alloy.item-hover"),mh=v("alloy.item-focus"),gh=[Me("data"),Me("components"),Me("dom"),$e("hasSubmenu",!1),Fe("toggling"),gf("itemBehaviours",[ah,Kg,Lg,lf]),$e("ignoreFocus",!1),$e("domModification",{}),wa("builder",(function(t){return{dom:t.dom,domModification:T(T({},t.domModification),{attributes:T(T(T({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:hf(t.itemBehaviours,[t.toggling.fold(ah.revoke,(function(t){return ah.config(T({aria:{mode:"checked"}},t))})),Kg.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){fh(t)}}),Lg.config({mode:"execution"}),lf.config({store:{mode:"memory",initialValue:t.data}}),Wg("item-type-events",E(E([],ch()),[Kr(er(),lh),Kr(wr(),Kg.focus)]))]),components:t.components,eventOrder:t.eventOrder}})),$e("eventOrder",{})],hh=[Me("dom"),Me("components"),wa("builder",(function(t){return{dom:t.dom,components:t.components,events:Gr([eo(wr())])}}))],ph=v("item-widget"),vh=v([Hf({name:"widget",overrides:function(t){return{behaviours:cc([lf.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:h}})])}}})]),bh=[Me("uid"),Me("data"),Me("components"),Me("dom"),$e("autofocus",!1),$e("ignoreFocus",!1),gf("widgetBehaviours",[lf,Kg,Lg]),$e("domModification",{}),ud(vh()),wa("builder",(function(t){var e=Jf(ph(),t,vh()),n=Qf(ph(),t,e.internals()),r=function(e){return Zf(e,t,"widget").map((function(t){return Lg.focusIn(t),t}))},o=function(e,n){return hd(n.event.target)?B.none():t.autofocus?(n.setSource(e.element),B.none()):B.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:Gr([uo((function(t,e){r(t).each((function(t){e.stop()}))})),Kr(er(),lh),Kr(wr(),(function(e,n){t.autofocus?r(e):Kg.focus(e)}))]),behaviours:hf(t.widgetBehaviours,[lf.config({store:{mode:"memory",initialValue:t.data}}),Kg.config({ignore:t.ignoreFocus,onFocus:function(t){fh(t)}}),Lg.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:mc(),onLeft:o,onRight:o,onEscape:function(e,n){return Kg.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),B.none()):B.none():(Kg.focus(e),B.some(!0))}})])}}))],yh=_e("type",{widget:bh,item:gh,separator:hh}),wh=v([jf({factory:{sketch:function(t){var e=Oe("menu.spec item",yh,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return Ht(e,"uid")?e:T(T({},e),{uid:ci("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),xh=v([Me("value"),Me("items"),Me("dom"),Me("components"),$e("eventOrder",{}),ff("menuBehaviours",[Ud,lf,bd,Lg]),Xe("movement",{mode:"menu",moveOnTab:!0},_e("mode",{grid:[Ca(),wa("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[wa("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),Me("rowSelector")],menu:[$e("moveOnTab",!0),wa("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Ne("markers",fa()),$e("fakeFocus",!1),$e("focusManager",lm()),pa("onHighlight")]),Ch=v("alloy.menu-focus"),Sh=gd({name:"Menu",configFields:xh(),partFields:wh(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:mf(t.menuBehaviours,[Ud.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),lf.config({store:{mode:"memory",initialValue:t.value}}),bd.config({find:B.some}),Lg.config(t.movement.config(t,t.movement))]),events:Gr([Kr(mh(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){Ud.highlight(t,n),e.stop(),Vr(t,Ch(),{menu:t,item:n})}))})),Kr(dh(),(function(t,e){var n=e.event.item;Ud.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),kh=function(t,e,n,r){return Lt(n,r).bind((function(r){return Lt(t,r).bind((function(r){var o=kh(t,e,n,r);return B.some([r].concat(o))}))})).getOr([])},Oh=function(t,e){var n={};Mt(t,(function(t,e){q(t,(function(t){n[t]=e}))}));var r=e,o=Rt(e,(function(t,e){return{k:t,v:e}})),i=Nt(o,(function(t,e){return[e].concat(kh(n,r,o,e))}));return Nt(n,(function(t){return Lt(i,t).getOr([t])}))},Th=function(t){return"prepared"===t.type?B.some(t.menu):B.none()},_h={init:function(){var t=nn({}),e=nn({}),n=nn({}),r=Lc(),o=nn({}),i=function(e,n,r){return u(e).bind((function(o){return function(e){return It(t.get(),(function(t,n){return t===e}))}(e).bind((function(t){return n(t).map((function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}}))}))}))},u=function(t){return a(t).bind(Th)},a=function(t){return Lt(e.get(),t)},c=function(e){return Lt(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(T(T({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,u,a,c){r.set(i),t.set(a),e.set(u),o.set(c);var s=Oh(c,a);n.set(s)},expand:function(e){return Lt(t.get(),e).map((function(t){var r=Lt(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return Lt(n.get(),t)},collapse:function(t){return Lt(n.get(),t).bind((function(t){return t.length>1?B.some(t.slice(1)):B.none()}))},lookupMenu:a,lookupItem:c,otherMenus:function(t){var e=o.get();return nt(At(e),t)},getPrimary:function(){return r.get().bind(u)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.clear()},isClear:function(){return r.get().isNone()},getTriggeringPath:function(t,e){var o=$(c(t).toArray(),(function(t){return u(t).isSome()}));return Lt(n.get(),t).bind((function(t){var n=et(o.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return B.none();e.push(r.getOrDie())}return B.some(e)}(Z(n,(function(t,o){return i(t,e,n.slice(0,o+1)).fold((function(){return Fi(r.get(),t)?[]:[B.none()]}),(function(t){return[B.some(t)]}))})))}))}}},extractPreparedMenu:Th},Eh=v("collapse-item"),Ah=md({name:"TieredMenu",configFields:[ya("onExecute"),ya("onEscape"),ba("onOpenMenu"),ba("onOpenSubmenu"),pa("onRepositionMenu"),pa("onCollapseMenu"),$e("highlightImmediately",!0),Pe("data",[Me("primary"),Me("menus"),Me("expansions")]),$e("fakeFocus",!1),pa("onHighlight"),pa("onHover"),ma(),Me("dom"),$e("navigateOnHover",!0),$e("stayInDom",!1),ff("tmenuBehaviours",[Lg,Ud,bd,Ug]),$e("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=Lc(),o=_h.init(),i=function(e){var n=function(e,n,r){return Nt(r,(function(r,o){var i=function(){return Sh.sketch(T(T({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?fm():lm()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(e,t.data.primary,t.data.menus),r=a();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()},u=function(t){return lf.getValue(t).value},a=function(e){return Nt(t.data.menus,(function(t,e){return Z(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},c=function(t,e){Ud.highlight(t,e),Ud.getHighlighted(e).orThunk((function(){return Ud.getFirst(e)})).each((function(e){Ur(t,e.element,wr())}))},s=function(t,e){return Vi(W(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?B.some(t.menu):B.none()}))})))},l=function(e,n,r){var o=s(n,n.otherMenus(r));q(o,(function(n){Hi(n.element,[t.markers.backgroundMenu]),t.stayInDom||Ug.remove(e,n)}))},f=function(e,n){var o=function(e){return r.get().getOrThunk((function(){var n={},o=Us(e.element,"."+t.markers.item),i=$(o,(function(t){return"true"===qo(t,"aria-haspopup")}));return q(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=u(t);n[e]=t}))})),r.set(n),n}))}(e);Mt(o,(function(t,e){var r=F(n,e);Wo(t.element,"aria-expanded",r)}))},d=function(e,n,r){return B.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return B.none();var i=o.menu,u=s(n,r.slice(1));return q(u,(function(e){zi(e.element,t.markers.backgroundMenu)})),qi(i.element)||Ug.append(e,yu(i)),Hi(i.element,[t.markers.backgroundMenu]),c(e,i),l(e,n,r),B.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var m=function(e,r,i){if(void 0===i&&(i=n.HighlightSubmenu),r.hasConfigured(Nd)&&Nd.isDisabled(r))return B.some(r);var a=u(r);return o.expand(a).bind((function(u){return f(e,u),B.from(u[0]).bind((function(a){return o.lookupMenu(a).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,a,c);return qi(s.element)||Ug.append(e,yu(s)),t.onOpenSubmenu(e,r,s,et(u)),i===n.HighlightSubmenu?(Ud.highlightFirst(s),d(e,o,u)):(Ud.dehighlightAll(s),B.some(r))}))}))}))},g=function(e,n){var r=u(n);return o.collapse(r).bind((function(r){return f(e,r),d(e,o,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},p=function(e){return function(n,r){return ta(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map(k)}))}))}},v=Gr([Kr(Ch(),(function(t,e){var n=e.event.item;o.lookupItem(u(n)).each((function(){var n=e.event.menu;Ud.highlight(t,n);var r=u(e.event.item);o.refresh(r).each((function(e){return l(t,o,e)}))}))})),uo((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){0===u(r).indexOf("collapse-item")&&g(e,r),m(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),h)}))})),ro((function(e,n){i(e).each((function(n){Ug.append(e,yu(n)),t.onOpenMenu(e,n),t.highlightImmediately&&c(e,n)}))}))].concat(t.navigateOnHover?[Kr(dh(),(function(e,r){var i=r.event.item;!function(t,e){var n=u(e);o.refresh(n).bind((function(e){return f(t,e),d(t,o,e)}))}(e,i),m(e,i,n.HighlightParent),t.onHover(e,i)}))]:[])),b=function(t){return Ud.getHighlighted(t).bind(Ud.getHighlighted)},y={collapseMenu:function(t){b(t).each((function(e){g(t,e)}))},highlightPrimary:function(t){o.getPrimary().each((function(e){c(t,e)}))},repositionMenus:function(e){o.getPrimary().bind((function(t){return b(e).bind((function(t){var e=u(t),n=Pt(o.getMenus()),r=Vi(W(n,_h.extractPreparedMenu));return o.getTriggeringPath(e,(function(t){return function(t,e,n){return lt(e,(function(t){if(!t.getSystem().isConnected())return B.none();var e=Ud.getCandidates(t);return Y(e,(function(t){return u(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))})).fold((function(){(function(t){return B.from(t.components()[0]).filter((function(t){return"menu"===qo(t.element,"role")}))})(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:mf(t.tmenuBehaviours,[Lg.config({mode:"special",onRight:p((function(t,e){return hd(e.element)?B.none():m(t,e,n.HighlightSubmenu)})),onLeft:p((function(t,e){return hd(e.element)?B.none():g(t,e)})),onEscape:p((function(e,n){return g(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(t,e){o.getPrimary().each((function(e){Ur(t,e.element,wr())}))}}),Ud.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),bd.config({find:function(t){return Ud.getHighlighted(t)}}),Ug.config({})]),eventOrder:t.eventOrder,apis:y,events:v}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:In(t,e),expansions:{}}},collapseItem:function(t){return{value:ei(Eh()),meta:{text:t}}}}}),Dh=md({name:"InlineView",configFields:[Me("lazySink"),pa("onShow"),pa("onHide"),We("onEscape"),ff("inlineBehaviours",[Ul,lf,gc]),Ge("fireDismissalEventInstead",[$e("event",Nr())]),Ge("fireRepositionEventInstead",[$e("event",Rr())]),$e("getRelated",B.none),$e("isExtraPart",S),$e("eventOrder",B.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return Uu(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();Ul.openWhileCloaked(e,n,(function(){return xl.positionWithinBounds(i,e,r,o())})),lf.setValue(e,B.some({mode:"position",config:r,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},u="horizontal"===r.type?{layouts:{onLtr:function(){return tc()},onRtl:function(){return ec()}}}:{},a=function(t){return function(t){return 2===t.length}(t)?u:{}};return Ah.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return Ul.close(e),t.onEscape.map((function(t){return t(e)})),B.some(!0)},onExecute:function(){return B.some(!0)},onOpenMenu:function(t,e){xl.positionWithinBounds(i().getOrDie(),e,n,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();xl.position(o,n,{anchor:T({type:"submenu",item:e},a(r))})},onRepositionMenu:function(t,e,r){var u=i().getOrDie();xl.positionWithinBounds(u,e,n,o()),q(r,(function(t){var e=a(t.triggeringPath);xl.position(u,t.triggeredMenu,{anchor:T({type:"submenu",item:t.triggeringItem},e)})}))}})}(t,e,n,r,o);Ul.open(e,i),lf.setValue(e,B.some({mode:"menu",menu:i}))},i=function(e){Ul.isOpen(e)&&lf.getValue(e).each((function(n){switch(n.mode){case"menu":Ul.getState(e).each(Ah.repositionMenus);break;case"position":var r=t.lazySink(e).getOrDie();xl.positionWithinBounds(r,e,n.config,n.getBounds())}}))},u={setContent:function(t,e){Ul.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,B.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,B.none)},showMenuWithinBounds:o,hide:function(t){Ul.isOpen(t)&&(lf.setValue(t,B.none()),Ul.close(t))},getContent:function(t){return Ul.getState(t)},reposition:i,isOpen:Ul.isOpen};return{uid:t.uid,dom:t.dom,behaviours:mf(t.inlineBehaviours,[Ul.config({isPartOf:function(e,n,r){return ra(n,r)||function(e,n){return t.getRelated(e).exists((function(t){return ra(t,n)}))}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),lf.config({store:{mode:"memory",initialValue:B.none()}}),gc.config({channels:T(T({},Xl(T({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Yl(T(T({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:u}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),Mh=function(t){return t.x},Nh=function(t,e){return t.x+t.width/2-e.width/2},Rh=function(t,e){return t.x+t.width-e.width},zh=function(t){return t.y},Bh=function(t,e){return t.y+t.height-e.height},Ih=function(t,e){return t.y+t.height/2-e.height/2},Ph=function(t,e,n){return Sa(Rh(t,e),Bh(t,e),n.insetSouthwest(),Ea(),"southwest",Ba(t,{right:0,bottom:3}),"layout-inset")},Lh=function(t,e,n){return Sa(Mh(t),Bh(t,e),n.insetSoutheast(),_a(),"southeast",Ba(t,{left:1,bottom:3}),"layout-inset")},Hh=function(t,e,n){return Sa(Rh(t,e),zh(t),n.insetNorthwest(),Ta(),"northwest",Ba(t,{right:0,top:2}),"layout-inset")},Fh=function(t,e,n){return Sa(Mh(t),zh(t),n.insetNortheast(),Oa(),"northeast",Ba(t,{left:1,top:2}),"layout-inset")},Vh=function(t,e,n){return Sa(Nh(t,e),zh(t),n.insetNorth(),Aa(),"north",Ba(t,{top:2}),"layout-inset")},jh=function(t,e,n){return Sa(Nh(t,e),Bh(t,e),n.insetSouth(),Da(),"south",Ba(t,{bottom:3}),"layout-inset")},Uh=function(t,e,n){return Sa(Rh(t,e),Ih(t,e),n.insetEast(),Na(),"east",Ba(t,{right:0}),"layout-inset")},Wh=function(t,e,n){return Sa(Mh(t),Ih(t,e),n.insetWest(),Ma(),"west",Ba(t,{left:1}),"layout-inset")},qh=function(t){switch(t){case"north":return Vh;case"northeast":return Fh;case"northwest":return Hh;case"south":return jh;case"southeast":return Lh;case"southwest":return Ph;case"east":return Uh;case"west":return Wh}},Gh=function(t,e,n,r,o){return Rc(r).map(qh).getOr(Vh)(t,e,n,r,o)},$h=function(t){switch(t){case"north":return jh;case"northeast":return Lh;case"northwest":return Ph;case"south":return Vh;case"southeast":return Fh;case"southwest":return Hh;case"east":return Wh;case"west":return Uh}},Xh=function(t,e,n,r,o){return Rc(r).map($h).getOr(Vh)(t,e,n,r,o)},Kh=tinymce.util.Tools.resolve("tinymce.util.Delay"),Yh=md({name:"Button",factory:function(t){var e=sh(t.action),n=t.dom.tag,r=function(e){return Lt(t.dom,"attributes").bind((function(t){return Lt(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:hf(t.buttonBehaviours,[Kg.config({}),Lg.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return T({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[$e("uid",void 0),Me("dom"),$e("components",[]),gf("buttonBehaviours",[Kg,Lg]),Fe("action"),Fe("role"),$e("eventOrder",{})]}),Jh=function(t){var e=function(t){return void 0!==t.uid}(t)&&Ft(t,"uid")?t.uid:ci("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return T(T({},t),{uid:e})}}},Qh=tinymce.util.Tools.resolve("tinymce.util.I18n"),Zh={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},tp=function(t){return function(){return Lt(t,"temporary-placeholder").getOr("!not found!")}},ep=function(t,e){var n=t.toLowerCase();if(Qh.isRtl()){var r=function(t,e){return mn(t,e)?t:function(t,e){return t+e}(t,e)}(n,"-rtl");return Ht(e,r)?r:n}return n},np=function(t,e){return Lt(e,ep(t,e))},rp=function(t,e){var n=e();return np(t,n).getOrThunk(tp(n))},op=function(){return Wg("add-focusable",[ro((function(t){Qu(t.element,"svg").each((function(t){return Wo(t,"focusable","false")}))}))])},ip=function(t,e,n,r){var o,i,u=function(t){return!!Qh.isRtl()&&Ht(Zh,t)}(e)?["tox-icon--flip"]:[],a=Lt(n,ep(e,n)).or(r).getOrThunk(tp(n));return{dom:{tag:t.tag,attributes:null!==(o=t.attributes)&&void 0!==o?o:{},classes:t.classes.concat(u),innerHtml:a},behaviours:cc(E(E([],null!==(i=t.behaviours)&&void 0!==i?i:[]),[op()]))}},up=function(t,e,n,r){return void 0===r&&(r=B.none()),ip(e,t,n(),r)},ap={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},cp=md({name:"Notification",factory:function(t){var e,n,r,o,i,u=Jh({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:cc([Ug.config({})])}),a=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},c=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},s=Jh({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[a(0)]},c(0)],behaviours:cc([Ug.config({})])}),l={updateProgress:function(t,e){t.getSystem().isConnected()&&s.getOpt(t).each((function(t){Ug.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[a(e)]},c(e)])}))},updateText:function(t,e){if(t.getSystem().isConnected()){var n=u.get(t);Ug.set(n,[hu(e)])}}},f=Q([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return B.from(ap[t])})).toArray()]),d=Jh(Yh.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[up("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":t.translationProvider("Close")}},t.iconProvider)],action:function(e){t.onAction(e)}})),m=[(e=f,n={tag:"div",classes:["tox-notification__icon"]},r=t.iconProvider,o=r(),i=Y(e,(function(t){return Ht(o,ep(t,o))})),ip(n,i.getOr("temporary-placeholder"),o,B.none())),{dom:{tag:"div",classes:["tox-notification__body"]},components:[u.asSpec()],behaviours:cc([Ug.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:cc([Kg.config({}),Wg("notification-events",[Kr(nr(),(function(t){d.getOpt(t).each(Kg.focus)}))])]),components:m.concat(t.progress?[s.asSpec()]:[]).concat(t.closeButton?[d.asSpec()]:[]),apis:l}},configFields:[Fe("level"),Me("progress"),Me("icon"),Me("onAction"),Me("text"),Me("iconProvider"),Me("translationProvider"),Qe("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function sp(t,e,n){var r=e.backstage.shared;return{open:function(t,e){var o=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),i=function(){e(),Dh.hide(a)},u=bu(cp.sketch({text:t.text,level:F(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:B.from(t.icon),closeButton:!o,onAction:i,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),a=bu(Dh.sketch(T({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return n.add(a),t.timeout>0&&Kh.setTimeout((function(){i()}),t.timeout),{close:i,moveTo:function(t,e){Dh.showAt(a,yu(u),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){if("banner"!==e){var n=function(t){switch(t){case"bc-bc":return jh;case"tc-tc":return Vh;case"tc-bc":return Ga;case"bc-tc":default:return $a}}(e),o={type:"node",root:Gi(),node:B.some(on.fromDom(t)),layouts:{onRtl:function(){return[n]},onLtr:function(){return[n]}}};Dh.showAt(a,yu(u),{anchor:o})}else Dh.showAt(a,yu(u),{anchor:r.anchors.banner()})},text:function(t){cp.updateText(u,t)},settings:t,getEl:function(){return u.element.dom},progressBar:{value:function(t){cp.updateProgress(u,t)}}}},close:function(t){t.close()},reposition:function(t){!function(t){q(t,(function(t){return t.moveTo(0,0)}))}(t),function(t){t.length>0&&(at(t).each((function(t){return t.moveRel(null,"banner")})),q(t,(function(e,n){n>0&&e.moveRel(t[n-1].getEl(),"bc-tc")})))}(t)},getArgs:function(t){return t.settings}}}var lp,fp=function(t,e){var n=null,r=function(){a(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)}}},dp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),mp=function(t,e,n,r,o){var i=dp(t,(function(e){return function(t,e){return t.isBlock(e)||F(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return B.from(i.backwards(e,n,r,o))},gp=function(t,e){return hp(on.fromDom(t.selection.getNode())).getOrThunk((function(){var n=on.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return Io(n,on.fromDom(e.extractContents())),e.insertNode(n.dom),yo(n).each((function(t){return t.dom.normalize()})),function(t){return js(t,Vs)}(n).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===co(t)?1:Hs(t).fold((function(){return xo(t).length}),(function(t){return t.length}))}(e))})),n}))},hp=function(t){return ta(t,"[data-mce-autocompleter]")},pp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},vp=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},bp=function(t,e){return t.substring(e.length)},yp=function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return B.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return mp(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(vp(o))return B.none();if(o===n)break}return B.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return B.none();var i=pp(o);return 0!==i.lastIndexOf(n)||bp(i,n).length<r?B.none():B.some({text:bp(i,n),range:o,triggerChar:n})}))},wp=function(t,e,n,r){return void 0===r&&(r=0),hp(on.fromDom(e.startContainer)).fold((function(){return yp(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=pp(r);return B.some({range:r,text:bp(o,n),triggerChar:n})}))},xp=function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){Vr(t,or(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(Ud.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(jr),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(Ud.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&hp(on.fromDom(e.element)).isNone()&&t.cancelIfNecessary()}))},Cp=tinymce.util.Tools.resolve("tinymce.util.Promise"),Sp=function(t,e){return{container:t,offset:e}},kp=function(t){if(function(t){return 3===t.nodeType}(t))return Sp(t,t.data.length);var e=t.childNodes;return e.length>0?kp(e[e.length-1]):Sp(t,e.length)},Op=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?Op(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?kp(n[n.length-1]):Sp(t,e)},Tp=function(t){return function(e){var n=Op(e.startContainer,e.startOffset);return!function(t,e){return mp(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!vp(e)})).isSome()}(t,n)}},_p=function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return lt(n.triggerChars,(function(n){return wp(t,e,n)}))}(t.dom,r,n).bind((function(n){return Ep(t,e,n)}))},Ep=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,u=$(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return Tp(t.dom)}))(n.range,i,n.text)}));if(0===u.length)return B.none();var a=Cp.all(W(u,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return B.some({lookupData:a,context:n})},Ap=ue([ze("type"),Ue("text")]),Dp=ue([$e("type","autocompleteitem"),$e("active",!1),$e("disabled",!1),$e("meta",{}),ze("value"),Ue("text"),Ue("icon")]),Mp=ue([ze("type"),ze("ch"),Ke("minChars",1),$e("columns",1),Ke("maxResults",10),We("matches"),Ie("fetch"),Ie("onAction"),tn("highlightOn",[],ge)]),Np=[Qe("disabled",!1),Ue("tooltip"),Ue("icon"),Ue("text"),Ze("onSetup",(function(){return h}))],Rp=ue([ze("type"),Ie("onAction")].concat(Np)),zp=function(t){return Se("toolbarbutton",Rp,t)},Bp=[Qe("active",!1)].concat(Np),Ip=ue(Bp.concat([ze("type"),Ie("onAction")])),Pp=function(t){return Se("ToggleButton",Ip,t)},Lp=[Ze("predicate",S),Je("scope","node",["node","editor"]),Je("position","selection",["node","selection","line"])],Hp=Np.concat([$e("type","contextformbutton"),$e("primary",!1),Ie("onAction"),Ae("original",b)]),Fp=Bp.concat([$e("type","contextformbutton"),$e("primary",!1),Ie("onAction"),Ae("original",b)]),Vp=Np.concat([$e("type","contextformbutton")]),jp=Bp.concat([$e("type","contextformtogglebutton")]),Up=_e("type",{contextformbutton:Hp,contextformtogglebutton:Fp}),Wp=ue([$e("type","contextform"),Ze("initValue",v("")),Ue("label"),He("commands",Up),Ve("launch",_e("type",{contextformbutton:Vp,contextformtogglebutton:jp}))].concat(Lp)),qp=ue([$e("type","contexttoolbar"),ze("items")].concat(Lp)),Gp=function(t){var e=t.ui.registry.getAll().popups,n=Nt(e,(function(t){return(e=t,Se("Autocompleter",Mp,e)).fold((function(t){throw new Error(Te(t))}),b);var e})),r=function(t){var e={};return q(t,(function(t){e[t]={}})),At(e)}(Bt(n,(function(t){return t.ch}))),o=Pt(n);return{dataset:n,triggerChars:r,lookupByChar:function(t){return $(o,(function(e){return e.ch===t}))}}};!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(lp||(lp={}));var $p,Xp=lp,Kp="tox-menu-nav__js",Yp={normal:Kp,color:"tox-swatch"},Jp="tox-collection__item-label",Qp="tox-collection__item--active",Zp=function(t){return Lt(Yp,t).getOr(Kp)},tv=function(t){return"color"===t?"tox-swatches":"tox-menu"},ev=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:tv(t),tieredMenu:"tox-tiered-menu"}},nv=function(t){var e=ev(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Zp(t)}},rv=function(t,e,n){var r=ev(n);return{tag:"div",classes:Q([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},ov=[Sh.parts.items({})],iv=function(t,e,n){var r=ev(n);return{dom:{tag:"div",classes:Q([[r.tieredMenu]])},markers:nv(n)}},uv=function(t,e){return function(n){var r=U(n,e);return W(r,(function(e){return{dom:t,components:e}}))}},av=function(t,e){var n=[],r=[];return q(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],Ht(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),W(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},cv=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Sh.parts.items({preprocess:function(n){return"auto"!==t&&t>1?uv({tag:"div",classes:["tox-collection__group"]},t)(n):av(n,(function(t,n){return"separator"===e[n].type}))}})]}},sv=function(t){return V(t,(function(t){return"icon"in t&&void 0!==t.icon}))},lv=function(t){return console.error(Te(t)),console.log(t),B.none()},fv=function(t,e,n,r,o){var i,u=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Sh.parts.items({preprocess:function(t){return av(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:u.dom,components:u.components,items:n}},dv=function(t,e,n,r,o){var i;return"color"===o?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Sh.parts.items({preprocess:"auto"!==t?uv({tag:"div",classes:["tox-swatches__row"]},t):b})]}]}}(r)).dom,components:i.components,items:n}:"normal"===o&&"auto"===r?{value:t,dom:(i=cv(r,n)).dom,components:i.components,items:n}:"normal"===o&&1===r?{value:t,dom:(i=cv(1,n)).dom,components:i.components,items:n}:"normal"===o?{value:t,dom:(i=cv(r,n)).dom,components:i.components,items:n}:"listpreview"===o&&"auto"!==r?{value:t,dom:(i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Sh.parts.items({preprocess:uv({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:i.components,items:n}:{value:t,dom:rv(e,r,o),components:ov,items:n}},mv=[ze("type"),ze("src"),Ue("alt"),tn("classes",[],ge)],gv=ue(mv),hv=[ze("type"),ze("text"),Ue("name"),tn("classes",["tox-collection__item-label"],ge)],pv=ue(hv),vv=re((function(){return we("type",{cardimage:gv,cardtext:pv,cardcontainer:bv})})),bv=ue([ze("type"),Ye("direction","horizontal"),Ye("align","left"),Ye("valign","middle"),He("items",vv)]),yv=[Qe("disabled",!1),Ue("text"),Ue("shortcut"),Ee("value","value",qt((function(){return ei("menuitem-value")})),fe()),$e("meta",{})],wv=ue([ze("type"),Ue("label"),He("items",vv),Ze("onSetup",(function(){return h})),Ze("onAction",h)].concat(yv)),xv=ue([ze("type"),Qe("active",!1),Ue("icon")].concat(yv)),Cv=[ze("type"),ze("fancytype"),Ze("onAction",h)],Sv=[$e("initData",{})].concat(Cv),kv=[en("initData",{},[Qe("allowCustomColors",!0),qe("colors",fe())])].concat(Cv),Ov=_e("fancytype",{inserttable:Sv,colorswatch:kv}),Tv=ue([ze("type"),Ze("onSetup",(function(){return h})),Ze("onAction",h),Ue("icon")].concat(yv)),_v=ue([ze("type"),Ie("getSubmenuItems"),Ze("onSetup",(function(){return h})),Ue("icon")].concat(yv)),Ev=ue([ze("type"),Ue("icon"),Qe("active",!1),Ze("onSetup",(function(){return h})),Ie("onAction")].concat(yv)),Av=function(t,e,n){var r=Us(t.element,"."+n);if(r.length>0){var o=J(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return B.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return B.none()},Dv=function(t,e){return cc([Wg(t,e)])},Mv=function(t){return Dv(ei("unnamed-events"),t)},Nv=ei("tooltip.exclusive"),Rv=ei("tooltip.show"),zv=ei("tooltip.hide"),Bv=function(t,e,n){t.getSystem().broadcastOn([Nv],{})},Iv=Object.freeze({__proto__:null,hideAllExclusive:Bv,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&Ug.set(t,r)}))}}),Pv=Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){Al(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return Gr(Q([[Kr(Rv,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){Bv(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:Gr("normal"===t.mode?[Kr(er(),(function(t){Fr(n,Rv)})),Kr(Zn(),(function(t){Fr(n,zv)}))]:[]),behaviours:cc([Ug.config({})])});e.setTooltip(o),Tl(r,o),t.onShow(n,o),xl.position(r,o,{anchor:t.anchor(n)})}}(n)}),t.delay)})),Kr(zv,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Kr(br(),(function(t,e){var r=e;r.universal||F(r.channels,Nv)&&n(t)})),oo((function(t){n(t)}))],"normal"===t.mode?[Kr(nr(),(function(t){Fr(t,Rv)})),Kr(pr(),(function(t){Fr(t,zv)})),Kr(er(),(function(t){Fr(t,Rv)})),Kr(Zn(),(function(t){Fr(t,zv)}))]:[Kr(Lr(),(function(t,e){Fr(t,Rv)})),Kr(Hr(),(function(t){Fr(t,zv)}))]]))}}),Lv=[Me("lazySink"),Me("tooltipDom"),$e("exclusive",!0),$e("tooltipComponents",[]),$e("delay",300),Je("mode","normal",["normal","follow-highlight"]),$e("anchor",(function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:v([$a,Ga,ja,Wa,Ua,qa]),onRtl:v([$a,Ga,ja,Wa,Ua,qa])}}})),pa("onHide"),pa("onShow")],Hv=lc({fields:Lv,name:"tooltipping",active:Pv,state:Object.freeze({__proto__:null,init:function(){var t=Lc(),e=Lc(),n=function(){t.on(clearTimeout)},r=v("not-implemented");return bi({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:n,resetTimer:function(e,r){n(),t.set(setTimeout(e,r))},readState:r})}}),apis:Iv}),Fv=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Vv=tinymce.util.Tools.resolve("tinymce.EditorManager"),jv=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},Uv=function(t){return t.getParam("width",Fv.DOM.getStyle(t.getElement(),"width"))},Wv=function(t){return B.from(t.getParam("min_width")).filter(m)},qv=function(t){return B.from(t.getParam("min_height")).filter(m)},Gv=function(t){return B.from(t.getParam("max_width")).filter(m)},$v=function(t){return B.from(t.getParam("max_height")).filter(m)},Xv=function(t){return!1!==t.getParam("menubar",!0,"boolean")},Kv=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=o(e),i=u(e)&&e.length>0;return!Jv(t)&&(i||r||n)},Yv=function(t){var e=j(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=$(e,(function(t){return"string"==typeof t}));return n.length>0?B.some(n):B.none()},Jv=function(t){return Yv(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),k)};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}($p||($p={}));var Qv,Zv=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(Qv||(Qv={}));var tb,eb,nb=function(t){return t.getParam("toolbar_location",Qv.auto,"string")},rb=function(t){return nb(t)===Qv.bottom},ob=function(t){if(!t.inline)return B.none();var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);if(e.length>0)return Zu(Gi(),e);var n=function(t){return t.getParam("fixed_toolbar_container_target")}(t);return f(n)?B.some(on.fromDom(n)):B.none()},ib=function(t){return t.inline&&ob(t).isSome()},ub=function(t){return ob(t).getOrThunk((function(){return Ao(Eo(on.fromDom(t.getElement())))}))},ab=function(t){return t.inline&&!Xv(t)&&!Kv(t)&&!Jv(t)},cb=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!ib(t)&&!ab(t)},sb=function(t){var e=t.getParam("menu");return e?Nt(e,(function(t){return T(T({},t),{items:t.items})})):{}},lb=function(t){return t.getParam("menubar")},fb=function(t){return t.getParam("anchor_top","#top")},db=function(t){return t.getParam("anchor_bottom","#bottom")},mb=ue([(tb="readonly",Ne(tb,he))]),gb=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([Wl()],{target:n}),t.uiMothership.broadcastOn([Wl()],{target:n})),t.mothership.broadcastOn(["silver.readonly"],{readonly:e}),t.uiMothership.broadcastOn(["silver.readonly"],{readonly:e})},hb=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&gb(e,!0)})),t.on("SwitchMode",(function(){return gb(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},pb=function(){var t;return gc.config({channels:(t={},t["silver.readonly"]={schema:mb,onReceive:function(t,e){Nd.set(t,e.readonly)}},t)})},vb=function(t){return Nd.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},bb=function(t){return Nd.config({disabled:t})},yb=function(t){return Nd.config({disabled:t,disableClass:"tox-tbtn--disabled"})},wb=function(t){return Nd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},xb=function(t,e){var n=t.getApi(e);return function(t){t(n)}},Cb=function(t,e){return ro((function(n){xb(t,n)((function(n){var r=t.onSetup(n);d(r)&&e.set(r)}))}))},Sb=function(t,e){return oo((function(n){return xb(t,n)(e.get())}))},kb=function(t,e){return uo((function(n,r){xb(t,n)(t.onAction),t.triggersSubmenu||e!==Xp.CLOSE_ON_EXECUTE||(Fr(n,Sr()),r.stop())}))},Ob=((eb={})[yr()]=["disabling","alloy.base.behaviour","toggling","item-events"],eb),Tb=Vi,_b=function(t,e,n,r){var o=nn(h);return{type:"item",dom:e.dom,components:Tb(e.optComponents),data:t.data,eventOrder:Ob,hasSubmenu:t.triggersSubmenu,itemBehaviours:cc([Wg("item-events",[kb(t,n),Cb(t,o),Sb(t,o)]),vb((function(){return t.disabled||r.isDisabled()})),pb(),Ug.config({})].concat(t.itemBehaviours))}},Eb=function(t){return{value:t.value,meta:T({text:t.text.getOr("")},t.meta)}},Ab=tinymce.util.Tools.resolve("tinymce.Env"),Db=function(t){var e=Ab.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=W(n,(function(t){var n=t.toLowerCase().trim();return Ht(e,n)?e[n]:t}));return Ab.mac?r.join(""):r.join("+")},Mb=function(t,e,n){return void 0===n&&(n=["tox-collection__item-icon"]),up(t,{tag:"div",classes:n},e)},Nb=function(t){return{dom:{tag:"div",classes:[Jp]},components:[hu(Qh.translate(t))]}},Rb=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},zb=function(t,e){return{dom:{tag:"div",classes:[Jp]},components:[{dom:{tag:t.tag,styles:t.styles},components:[hu(Qh.translate(e))]}]}},Bb=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:Db(t)}}},Ib=function(t){return Mb("checkmark",t,["tox-collection__item-checkmark"])},Pb=function(t,e,n){var r,o,i=t.ariaLabel,u=t.value,a=t.iconContent.map((function(t){return function(t,e,n){var r=e();return np(t,r).or(n).getOrThunk(tp(r))}(t,e.icons,n)}));return{dom:(r=a.getOr(""),o={tag:"div",attributes:i.map((function(t){return{title:e.translate(t)}})).getOr({}),classes:["tox-swatch"]},T(T({},o),"custom"===u?{tag:"button",classes:E(E([],o.classes),["tox-swatches__picker-btn"]),innerHtml:r}:"remove"===u?{classes:E(E([],o.classes),["tox-swatch--remove"]),innerHtml:r}:{attributes:T(T({},o.attributes),{"data-mce-color":u}),styles:{"background-color":u}})),optComponents:[]}},Lb=function(t){var e=t.map((function(t){return{attributes:{title:Qh.translate(t)}}})).getOr({});return T({tag:"div",classes:[Kp,"tox-collection__item"]},e)},Hb=function(t,e,n,r){return void 0===r&&(r=B.none()),"color"===t.presets?Pb(t,e,r):function(t,e,n,r){var o={tag:"div",classes:["tox-collection__item-icon"]},i=n?t.iconContent.map((function(t){return up(t,o,e.icons,r)})).orThunk((function(){return B.some({dom:o})})):B.none(),u=t.checkMark,a=B.from(t.meta).fold((function(){return Nb}),(function(t){return Ht(t,"style")?w(zb,t.style):Nb})),c=t.htmlContent.fold((function(){return t.textContent.map(a)}),(function(t){return B.some(Rb(t,[Jp]))}));return{dom:Lb(t.ariaLabel),optComponents:[i,c,t.shortcutContent.map(Bb),u,t.caret]}}(t,e,n,r)},Fb=function(t,e){return Lt(t,"tooltipWorker").map((function(t){return[Hv.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:Zc}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){Hv.setComponents(e,[pu({element:on.fromDom(t)})])}))}})]})).getOr([])},Vb=function(t,e){var n=function(t){return Fv.DOM.encode(t)}(Qh.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return n},jb=function(t,e){return W(t,(function(t){switch(t.type){case"cardcontainer":return function(t,e){return{dom:{tag:"div",classes:["tox-collection__item-container","vertical"===t.direction?"tox-collection__item-container--column":"tox-collection__item-container--row","left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right",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:e}}(t,jb(t.items,e));case"cardimage":return function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return F(e.cardText.highlightOn,t)}))?B.from(e.cardText.matchText).getOr(""):"";return Rb(Vb(t.text,n),t.classes)}}))},Ub=Gf(ph(),vh()),Wb=function(t){return{value:t}},qb=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Gb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,$b=function(t){return qb.test(t)||Gb.test(t)},Xb=function(t){return function(t,e){return dn(t,e)?function(t,e){return t.substring(e)}(t,e.length):t}(t,"#").toUpperCase()},Kb=function(t){var e=function(t){return{value:t.value.replace(qb,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),n=Gb.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},Yb=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Jb=function(t){var e=Yb(t.red)+Yb(t.green)+Yb(t.blue);return Wb(e)},Qb=Math.min,Zb=Math.max,ty=Math.round,ey=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,ny=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,ry=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},oy=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},iy=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=Zb(0,Qb(i,1)),u=Zb(0,Qb(u,1)),0===i)return e=n=r=ty(255*u),ry(e,n,r,1);var a=o/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=ty(255*(e+l)),n=ty(255*(n+l)),r=ty(255*(r+l)),ry(e,n,r,1)},uy=function(t){var e=Kb(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return ry(n,r,o,1)},ay=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return ry(o,i,u,a)},cy=function(t){if("transparent"===t)return B.some(ry(0,0,0,0));var e=ey.exec(t);if(null!==e)return B.some(ay(e[1],e[2],e[3],"1"));var n=ny.exec(t);return null!==n?B.some(ay(n[1],n[2],n[3],n[4])):B.none()},sy=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},ly=ry(255,0,0,1),fy=function(t,e){return t.fire("ResizeContent",e)},dy=function(t,e,n){return{hue:t,saturation:e,value:n}},my=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(o,Math.min(i,u)),c=Math.max(o,Math.max(i,u));return a===c?dy(0,0,100*(r=a)):(n=60*((n=o===a?3:u===a?1:5)-(o===a?i-u:u===a?o-i:u-o)/(c-a)),e=(c-a)/c,r=c,dy(Math.round(n),Math.round(100*e),Math.round(100*r)))},gy=function(t){return Jb(iy(t))},hy=function(t){return(e=t,$b(e)?B.some({value:Xb(e)}):B.none()).orThunk((function(){return cy(t).map(Jb)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],u=r[2],a=r[3];return Jb(ry(o,i,u,a))}));var e},py=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");var vy,by="choiceitem",yy=[{type:by,text:"Light Green",value:"#BFEDD2"},{type:by,text:"Light Yellow",value:"#FBEEB8"},{type:by,text:"Light Red",value:"#F8CAC6"},{type:by,text:"Light Purple",value:"#ECCAFA"},{type:by,text:"Light Blue",value:"#C2E0F4"},{type:by,text:"Green",value:"#2DC26B"},{type:by,text:"Yellow",value:"#F1C40F"},{type:by,text:"Red",value:"#E03E2D"},{type:by,text:"Purple",value:"#B96AD9"},{type:by,text:"Blue",value:"#3598DB"},{type:by,text:"Dark Turquoise",value:"#169179"},{type:by,text:"Orange",value:"#E67E23"},{type:by,text:"Dark Red",value:"#BA372A"},{type:by,text:"Dark Purple",value:"#843FA1"},{type:by,text:"Dark Blue",value:"#236FA1"},{type:by,text:"Light Gray",value:"#ECF0F1"},{type:by,text:"Medium Gray",value:"#CED4D9"},{type:by,text:"Gray",value:"#95A5A6"},{type:by,text:"Dark Gray",value:"#7E8C8D"},{type:by,text:"Navy Blue",value:"#34495E"},{type:by,text:"Black",value:"#000000"},{type:by,text:"White",value:"#ffffff"}],wy=function(t){void 0===t&&(t=10);var e,n=py.getItem("tinymce-custom-colors"),r=o(n)?JSON.parse(n):[],i=t-(e=r).length<0?e.slice(0,t):e,u=function(t){i.splice(t,1)};return{add:function(e){(function(t,e){var n=H(t,e);return-1===n?B.none():B.some(n)})(i,e).each(u),i.unshift(e),i.length>t&&i.pop(),py.setItem("tinymce-custom-colors",JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),xy=function(t){return!1!==t.getParam("custom_colors")},Cy=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){for(var e=[],n=0;n<t.length;n+=2)e.push({text:t[n+1],value:"#"+hy(t[n]).value,type:"choiceitem"});return e}(e):yy},Sy=function(t){wy.add(t)},ky=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))}(Cy(t).length))},Oy=function(t){var e={type:"choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[e,{type:"choiceitem",text:"Custom color",icon:"color-picker",value:"custom"}]:[e]},Ty=function(t,e,n,r){"custom"===n?Ny(t)((function(n){n.each((function(n){Sy(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},_y=function(t,e){return t.concat(W(wy.state(),(function(t){return{type:by,text:t,value:t}})).concat(Oy(e)))},Ey=function(t,e){return function(n){n(_y(t,e))}},Ay=function(t,e,n){var r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";t.setIconFill(r,n)},Dy=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return B.from(function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),n}(t,n)).bind((function(t){return cy(t).map((function(t){var n=Jb(t).value;return fn(e.toLowerCase(),n)}))})).getOr(!1)},columns:ky(t),fetch:Ey(Cy(t),xy(t)),onAction:function(e){null!==o.get()&&Ty(t,n,o.get(),h)},onItemAction:function(r,i){Ty(t,n,i,(function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})}))},onSetup:function(n){null!==o.get()&&Ay(n,e,o.get());var r=function(t){t.name===e&&Ay(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},My=function(t,e,n,r){t.ui.registry.addNestedMenuItem(e,{text:r,icon:"forecolor"===e?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(e){Ty(t,n,e.value,h)}}]}})},Ny=function(t){return function(e,n){var r=!1,o={colorpicker:n};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:o,onAction:function(t,e){"hex-valid"===e.name&&(r=e.value)},onSubmit:function(n){var o=n.getData().colorpicker;r?(e(B.from(o)),n.close()):t.windowManager.alert(t.translate(["Invalid hex color code: {0}",o]))},onClose:h,onCancel:function(){e(B.none())}})}},Ry=function(t,e,n,r,o,i,u,a){var c=sv(e),s=zy(e,n,r,"color"!==o?"normal":"color",i,u,a);return dv(t,c,s,r,o)},zy=function(t,e,n,r,o,i,u){return Vi(W(t,(function(a){return"choiceitem"===a.type?(c=a,Se("choicemenuitem",xv,c)).fold(lv,(function(c){return B.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=Hb({presets:n,textContent:e?t.text:B.none(),htmlContent:B.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:B.none(),checkMark:e?B.some(Ib(u.icons)):B.none(),caret:B.none(),value:t.value},u,a);return jt(_b({data:Eb(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){ah.set(t,e)},isActive:function(){return ah.isOn(t)},isDisabled:function(){return Nd.isDisabled(t)},setDisabled:function(e){return Nd.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),h},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:"tox-collection__item--enabled",toggleOnExecute:!1,selected:t.active}})}(c,1===n,r,e,i(a.value),o,u,sv(t)))})):B.none();var c})))},By=function(t,e){var n=nv(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}},Iy=function(t,e){var n=t.initData.allowCustomColors&&e.colorinput.hasCustomColors();return t.initData.colors.fold((function(){return _y(e.colorinput.getColors(),n)}),(function(t){return t.concat(Oy(n))}))},Py=ei("cell-over"),Ly=ei("cell-execute"),Hy=function(t,e,n){var r,o=function(n){return Vr(n,Ly,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return bu({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:cc([Wg("insert-table-picker-cell",[Kr(er(),Kg.focus),Kr(yr(),o),Kr(cr(),i),Kr(xr(),i)]),ah.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Kg.config({onFocus:function(n){return Vr(n,Py,{row:t,col:e})}})])})},Fy=function(t){return Z(t,(function(t){return W(t,yu)}))},Vy=function(t,e){return hu(e+1+"x"+(t+1))},jy={inserttable:function(t){var e=ei("size-label"),n=function(t,e,n){for(var r=[],o=0;o<e;o++){for(var i=[],u=0;u<n;u++)i.push(Hy(o,u,t));r.push(i)}return r}(e,10,10),r=Jh({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[hu("0x0")],behaviours:cc([Ug.config({})])});return{type:"widget",data:{value:ei("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Ub.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:Fy(n).concat(r.asSpec()),behaviours:cc([Wg("insert-table-picker",[Zr(Py,(function(t,e,o){var i=o.event.row,u=o.event.col;!function(t,e,n,r,o){for(var i=0;i<r;i++)for(var u=0;u<o;u++)ah.set(t[i][u],i<=e&&u<=n)}(n,i,u,10,10),Ug.set(r.get(t),[Vy(i,u)])})),Zr(Ly,(function(e,n,r){t.onAction({numRows:r.event.row+1,numColumns:r.event.col+1}),Fr(e,Sr())}))]),Lg.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=Iy(t,e),r=e.colorinput.getColorCols(),o=Ry(ei("menu-value"),n,(function(e){t.onAction({value:e})}),r,"color",Xp.CLOSE_ON_EXECUTE,S,e.shared.providers),i=T(T({},o),{markers:nv("color"),movement:By(r,"color")});return{type:"widget",data:{value:ei("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Ub.widget(Sh.sketch(i))]}}},Uy=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=Hb({presets:r,textContent:B.none(),htmlContent:n?t.text.map((function(t){return Vb(t,e)})):B.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:B.none(),checkMark:B.none(),caret:B.none(),value:t.value},u.providers,a,t.icon);return _b({data:Eb(t),disabled:t.disabled,getApi:v({}),onAction:function(e){return o(t.value,t.meta)},onSetup:v(h),triggersSubmenu:!1,itemBehaviours:Fb(t.meta,u)},c,i,u.providers)},Wy=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:T({tag:"div",classes:["tox-collection__item","tox-collection__group-heading"]},e),components:[]}},qy=function(t,e,n,r){void 0===r&&(r=!0);var o=Hb({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:B.none(),ariaLabel:t.text,caret:B.none(),checkMark:B.none(),shortcutContent:t.shortcut},n,r);return _b({data:Eb(t),getApi:function(t){return{isDisabled:function(){return Nd.isDisabled(t)},setDisabled:function(e){return Nd.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)},Gy=function(t,e,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var i,u=o?(i=n.icons,Mb("chevron-down",i,["tox-collection__item-caret"])):function(t){return Mb("chevron-right",t,["tox-collection__item-caret"])}(n.icons),a=Hb({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:B.none(),ariaLabel:t.text,caret:B.some(u),checkMark:B.none(),shortcutContent:t.shortcut},n,r);return _b({data:Eb(t),getApi:function(t){return{isDisabled:function(){return Nd.isDisabled(t)},setDisabled:function(e){return Nd.set(t,e)}}},disabled:t.disabled,onAction:h,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},a,e,n)},$y=function(t,e,n,r){void 0===r&&(r=!0);var o=Hb({iconContent:t.icon,textContent:t.text,htmlContent:B.none(),ariaLabel:t.text,checkMark:B.some(Ib(n.icons)),caret:B.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return jt(_b({data:Eb(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){ah.set(t,e)},isActive:function(){return ah.isOn(t)},isDisabled:function(){return Nd.isDisabled(t)},setDisabled:function(e){return Nd.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:"tox-collection__item--enabled",toggleOnExecute:!1,selected:t.active}})},Xy=function(t,e){return Lt(jy,t.fancytype).map((function(n){return n(t,e)}))},Ky=function(t,e,n,r){var o={dom:Lb(t.label),optComponents:[B.some({dom:{tag:"div",classes:["tox-collection__item-container","tox-collection__item-container--row"]},components:jb(t.items,r)})]};return _b({data:Eb(T({text:B.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return Nd.isDisabled(t)},setDisabled:function(e){Nd.set(t,e),q(Us(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(Nd)&&Nd.set(t,e)}))}))}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:B.from(r.itemBehaviours).getOr([])},o,e,n.providers)};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(vy||(vy={}));var Yy=function(t,e,n,r,o){var i,u=n.shared.providers,a=function(t){return o?T(T({},t),{shortcut:B.none(),icon:t.text.isSome()?B.none():t.icon}):t};switch(t.type){case"menuitem":return(i=t,Se("menuitem",Tv,i)).fold(lv,(function(t){return B.some(qy(a(t),e,u,r))}));case"nestedmenuitem":return function(t){return Se("nestedmenuitem",_v,t)}(t).fold(lv,(function(t){return B.some(Gy(a(t),e,u,r,o))}));case"togglemenuitem":return function(t){return Se("togglemenuitem",Ev,t)}(t).fold(lv,(function(t){return B.some($y(a(t),e,u,r))}));case"separator":return function(t){return Se("separatormenuitem",Ap,t)}(t).fold(lv,(function(t){return B.some(Wy(t))}));case"fancymenuitem":return function(t){return Se("fancymenuitem",Ov,t)}(t).fold(lv,(function(t){return Xy(a(t),n)}));default:return console.error("Unknown item in general menu",t),B.none()}},Jy=function(t,e,n,r,o,i,u){var a=1===r,c=!a||sv(t);return Vi(W(t,(function(t){switch(t.type){case"separator":return(r=t,Se("Autocompleter.Separator",Ap,r)).fold(lv,(function(t){return B.some(Wy(t))}));case"cardmenuitem":return function(t){return Se("cardmenuitem",wv,t)}(t).fold(lv,(function(t){return B.some(Ky(T(T({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:Fb(t.meta,i),cardText:{matchText:e,highlightOn:u}}))}));case"autocompleteitem":default:return function(t){return Se("Autocompleter.Item",Dp,t)}(t).fold(lv,(function(t){return B.some(Uy(t,e,a,"normal",n,o,i,c))}))}var r})))},Qy=function(t,e,n,r,o){var i=sv(e),u=Vi(W(e,(function(t){var e=function(t){return Yy(t,n,r,function(t){return o?!Ht(t,"text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(T(T({},t),{disabled:!0})):e(t)})));return(o?fv:dv)(t,i,u,1,"normal")},Zy=function(t){return Ah.singleData(t.value,t)},tw=function(t,e){var n=Lc(),r=nn(!1),o=bu(Dh.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:cc([Wg("dismissAutocompleter",[Kr(Nr(),(function(){return a()}))])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},u=function(){i()&&Dh.hide(o)},a=function(){if(i()){var e=n.get().map((function(t){return t.element}));hp(e.getOr(on.fromDom(t.selection.getNode()))).each(Fo),u(),n.clear(),r.set(!1)}},c=Wt((function(){return Gp(t)})),s=function(e,n,r,i){e.matchLength=n.text.length;var u=lt(r,(function(t){return B.from(t.columns)})).getOr(1);Dh.showAt(o,Sh.sketch(function(t,e,n,r){var o=n===vy.ContentFocus?fm():lm(),i=By(e,r),u=nv(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:n===vy.ContentFocus,focusManager:o,menuBehaviours:Mv("auto"!==e?[]:[ro((function(t,e){Av(t,4,u.item).each((function(e){var n=e.numColumns,r=e.numRows;Lg.setGridSize(t,r,n)}))}))])}}(dv("autocompleter-value",!0,i,u,"normal"),u,vy.ContentFocus,"normal")),{anchor:{type:"node",root:on.fromDom(t.getBody()),node:B.from(e.element)}}),Dh.getContent(o).each(Ud.highlightFirst)},l=function(o){(function(e){return n.get().map((function(n){return wp(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return Ep(t,c,n,e)}))})).getOrThunk((function(){return _p(t,c)}))})(o).fold(a,(function(o){!function(e){if(!i()){var o=gp(t,e.range);n.set({triggerChar:e.triggerChar,element:o,matchLength:e.text.length}),r.set(!1)}}(o.context),o.lookupData.then((function(i){n.get().map((function(n){var c,f,d,m=o.context;if(n.triggerChar===m.triggerChar){var g=(c=m.triggerChar,d=lt(f=i,(function(t){return B.from(t.columns)})).getOr(1),Z(f,(function(n){var o=n.items;return Jy(o,n.matchText,(function(e,o){var i=t.selection.getRng();wp(t.dom,i,c).fold((function(){return console.error("Lost context. Cursor probably moved")}),(function(t){var i=t.range,c={hide:function(){a()},reload:function(t){u(),l(t)}};r.set(!0),n.onAction(c,i,e,o),r.set(!1)}))}),d,Xp.BUBBLE_TO_SANDBOX,e,n.highlightOn)})));g.length>0?s(n,m,i,g):m.text.length-n.matchLength>=10?a():u()}}))}))}))},f={onKeypress:fp((function(t){27!==t.which&&l()}),50),cancelIfNecessary:a,isMenuOpen:function(){return Dh.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return Dh.getContent(o)}};!1===t.hasPlugin("rtc")&&xp(f,t)},ew=function(t,e,n){return ta(t,e,n).isSome()},nw=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},rw=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?B.none():B.some(e.touches[0])},ow=function(t){var e=Lc(),n=nn(!1),r=nw((function(e){t.triggerEvent(Cr(),e),n.set(!0)}),400),o=Pn([{key:$n(),value:function(t){return rw(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(i)})),B.none()}},{key:Xn(),value:function(t){return r.cancel(),rw(t).each((function(t){e.on((function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.clear()}))})),B.none()}},{key:Kn(),value:function(o){r.cancel();return e.get().filter((function(t){return Mn(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(xr(),o)}))}}]);return{fireIfReady:function(t,e){return Lt(o,e).bind((function(e){return e(t)}))}}},iw=function(){return En().browser.isFirefox()},uw=ie([Ie("triggerEvent"),$e("stopBackspace",!0)]),aw=function(t,e){var n=Oe("Getting GUI events settings",uw,e),r=ow(n),o=W(["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(e){return Fc(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=Lc(),u=Fc(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(setTimeout((function(){n.triggerEvent(vr(),t)}),0))})),a=Fc(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():!0===n.stopBackspace&&function(t){return t.raw.which===Wd[0]&&!F(["input","textarea"],co(t.target))&&!ew(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return iw()?Vc(t,"focus",e):Fc(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=Lc(),l=function(t,e){return iw()?Vc(t,"blur",e):Fc(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(setTimeout((function(){n.triggerEvent(pr(),t)}),0))}));return{unbind:function(){q(o,(function(t){t.unbind()})),a.unbind(),c.unbind(),l.unbind(),u.unbind(),i.on(clearTimeout),s.on(clearTimeout)}}},cw=function(t,e){var n=Lt(t,"target").getOr(e);return nn(n)},sw=zn([{stopped:[]},{resume:["element"]},{complete:[]}]),lw=function(t,e,n,r,o,i){var u=t(e,r),a=function(t,e){var n=nn(!1),r=nn(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return u.fold((function(){return i.logEventNoHandlers(e,r),sw.complete()}),(function(t){var n=t.descHandler;return xi(n)(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),sw.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),sw.complete()):yo(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),sw.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),sw.resume(r)}))}))},fw=function(t,e,n,r,o,i){return lw(t,e,n,r,o,i).fold(k,(function(r){return fw(t,e,n,r,o,i)}),S)},dw=function(t,e,n){var r=function(t){var e=nn(!1);return{stop:function(){e.set(!0)},cut:h,isStopped:e.get,isCut:S,event:t,setSource:C("Cannot set source of a broadcasted event"),getSource:C("Cannot get source of a broadcasted event")}}(e);return q(t,(function(t){var e=t.descHandler;xi(e)(r)})),r.isStopped()},mw=function(t,e,n,r,o){var i=cw(n,r);return fw(t,e,n,r,i,o)},gw=function(){var t={};return{registerId:function(e,n,r){Mt(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=function(t,e){return n=w.apply(void 0,[t.handler].concat(e)),r=t.purpose,{cHandler:n,purpose:r};var n,r}(r,e),t[o]=i}))},unregisterId:function(e){Mt(t,(function(t,n){Ht(t,e)&&delete t[e]}))},filterByType:function(e){return Lt(t,e).map((function(t){return Bt(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){var o=Lt(t,n);return Vn(r,(function(t){return function(t,e){return ai(e).fold((function(){return B.none()}),(function(n){return t.bind((function(t){return Lt(t,n)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}))}(o,t)}),e)}}},hw=function(){var t=gw(),e={},n=function(t){var e=t.element;return ai(e).getOrThunk((function(){return function(t,e){var n=ei(oi+t);return ui(e,n),n}("uid-",t.element)}))},r=function(n){ai(n.element).each((function(n){delete e[n],t.unregisterId(n)}))};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(o){var i=n(o);Ft(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+Jo(o.element)+"\nCannot use it for: "+Jo(t.element)+"\nThe conflicting element is"+(qi(o.element)?" ":" not ")+"already in the DOM");r(t)}(o,i);var u=[o];t.registerId(u,i,o.events),e[i]=o},unregister:r,getById:function(t){return Lt(e,t)}}},pw=md({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=_(e,["attributes"]);return{uid:t.uid,dom:T({tag:"div",attributes:T({role:"presentation"},n)},r),components:t.components,behaviours:df(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[$e("components",[]),ff("containerBehaviours",[]),$e("events",{}),$e("domModification",{}),$e("eventOrder",{})]}),vw=function(t){var e=function(e){return yo(t.element).fold(k,(function(t){return Mn(e,t)}))},n=hw(),r=function(t,r){return n.find(e,t,r)},o=aw(t.element,{triggerEvent:function(t,e){return aa(t,e.target,(function(n){return function(t,e,n,r){return mw(t,e,n,n.target,r)}(r,t,e,n)}))}}),i={debugInfo:v("real"),triggerEvent:function(t,e,n){aa(t,e,(function(o){return mw(r,t,n,e,o)}))},triggerFocus:function(t,e){ai(t).fold((function(){pc(t)}),(function(n){aa(hr(),t,(function(n){return function(t,e,n,r,o){var i=cw(n,r);lw(t,e,n,r,i,o)}(r,hr(),{originator:e,kill:h,prevent:h,target:t},t,n),!1}))}))},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:bu,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,e){d(t,e)},broadcastEvent:function(t,e){m(t,e)},isConnected:k},u=function(t){t.connect(i),fo(t.element)||(n.register(t),q(t.components(),u),i.triggerEvent(Or(),t.element,{target:t.element}))},a=function(t){fo(t.element)||(q(t.components(),a),n.unregister(t)),t.disconnect()},c=function(e){Tl(t,e)},s=function(t){Al(t)},l=function(t){var e=n.filter(br());q(e,(function(e){var n=e.descHandler;xi(n)(t)}))},f=function(t){l({universal:!0,data:t})},d=function(t,e){l({universal:!1,channels:t,data:e})},m=function(t,e){var r=n.filter(t);return dw(r,e)},g=function(t){return n.getById(t).fold((function(){return mt.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),mt.value)},p=function(t){var e=ai(t).getOr("not found");return g(e)};return u(t),{root:t,element:t.element,destroy:function(){o.unbind(),Ho(t.element)},add:c,remove:s,getByUid:g,getByDom:p,addToWorld:u,removeFromWorld:a,broadcast:f,broadcastOn:d,broadcastEvent:m}},bw=v([$e("prefix","form-field"),ff("fieldBehaviours",[bd,lf])]),yw=v([Vf({schema:[Me("dom")],name:"label"}),Vf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Me("text")],name:"aria-descriptor"}),Hf({factory:{sketch:function(t){var e=Bn(t,["factory"]);return t.factory.sketch(e)}},schema:[Me("factory")],name:"field"})]),ww=gd({name:"FormField",configFields:bw(),partFields:yw(),factory:function(t,e,n,r){var o=mf(t.fieldBehaviours,[bd.config({find:function(e){return Zf(e,t,"field")}}),lf.config({store:{mode:"manual",getValue:function(t){return bd.getCurrent(t).bind(lf.getValue)},setValue:function(t,e){bd.getCurrent(t).each((function(t){lf.setValue(t,e)}))}}})]),i=Gr([ro((function(e,n){var r=ed(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=ei(t.prefix);r.label().each((function(t){Wo(t.element,"for",n),Wo(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=ei(t.prefix);Wo(n.element,"id",r),Wo(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return Zf(e,t,"field")},getLabel:function(e){return Zf(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:u}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),xw=Object.freeze({__proto__:null,exhibit:function(t,e){return wi({attributes:Pn([{key:e.tabAttr,value:"true"}])})}}),Cw=[$e("tabAttr","data-alloy-tabstop")],Sw=lc({fields:Cw,name:"tabstopping",active:xw}),kw=tinymce.util.Tools.resolve("tinymce.html.Entities"),Ow=function(t,e,n,r){var o=Tw(t,e,n,r);return ww.sketch(o)},Tw=function(t,e,n,r){return{dom:_w(n),components:t.toArray().concat([e]),fieldBehaviours:cc(r)}},_w=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},Ew=function(t,e){return ww.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},Aw=ei("form-component-change"),Dw=ei("form-close"),Mw=ei("form-cancel"),Nw=ei("form-action"),Rw=ei("form-submit"),zw=ei("form-block"),Bw=ei("form-unblock"),Iw=ei("form-tabchange"),Pw=ei("form-resize"),Lw=function(t,e){var n,r,o,i=t.label.map((function(t){return Ew(t,e)})),u=function(t){return function(e,n){ta(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,qo(r,"data-collection-item-value"))}))}},a=u((function(n,r,o,i){r.stop(),e.isDisabled()||Vr(n,Nw,{name:t.name,value:i})})),c=[Kr(er(),u((function(t,e,n){pc(n)}))),Kr(cr(),a),Kr(xr(),a),Kr(nr(),u((function(t,e,n){Zu(t.element,"."+Qp).each((function(t){Ii(t,Qp)})),zi(n,Qp)}))),Kr(rr(),u((function(t){Zu(t.element,"."+Qp).each((function(t){Ii(t,Qp)}))}))),uo(u((function(e,n,r,o){Vr(e,Nw,{name:t.name,value:o})})))],s=function(t,e){return W(Us(t.element,".tox-collection__item"),e)},l=ww.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:b},behaviours:cc([Nd.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){zi(t,"tox-collection__item--state-disabled"),Wo(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){Ii(t,"tox-collection__item--state-disabled"),Xo(t,"aria-disabled")}))}}),pb(),Ug.config({}),lf.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=W(r,(function(n){var r=Qh.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",u={_:" "," - ":" ","-":" "},a=r.replace(/\_| \- |\-/g,(function(t){return u[t]}));return'<div class="tox-collection__item'+(e.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+kw.encodeAllRaw(n.value)+'" title="'+a+'" aria-label="'+a+'">'+i+o+"</div>"})),i="auto"!==t.columns&&t.columns>1?U(o,t.columns):[o],u=W(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));jo(n.element,u.join(""))}(n,r),"auto"===t.columns&&Av(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;Lg.setGridSize(n,e,r)})),Fr(n,Pw)}}),Sw.config({}),Lg.config((r=t.columns,o="normal",1===r?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===r?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===o?".tox-swatches__row":".tox-collection__group",cell:"color"===o?".tox-swatch":".tox-collection__item"}})),Wg("collection-events",c)]),eventOrder:(n={},n[yr()]=["disabling","alloy.base.behaviour","collection-events"],n)});return Ow(i,l,["tox-form__group--collection"],[])},Hw=v([Fe("data"),$e("inputAttributes",{}),$e("inputStyles",{}),$e("tag","input"),$e("inputClasses",[]),pa("onSetValue"),$e("styles",{}),$e("eventOrder",{}),ff("inputBehaviours",[lf,Kg]),$e("selectOnFocus",!0)]),Fw=function(t){return cc([Kg.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=uu(e);e.dom.setSelectionRange(0,n.length)}:h})])},Vw=function(t){return T(T({},Fw(t)),mf(t.inputBehaviours,[lf.config({store:T(T({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return uu(t.element)},setValue:function(t,e){uu(t.element)!==e&&au(t.element,e)}}),onSetValue:t.onSetValue})]))},jw=function(t){return{tag:t.tag,attributes:T({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Uw=md({name:"Input",configFields:Hw(),factory:function(t,e){return{uid:t.uid,dom:jw(t),components:[],behaviours:Vw(t),eventOrder:t.eventOrder}}}),Ww={},qw={exports:Ww};!function(e,n,r,o){!function(o){if("object"==typeof n&&void 0!==r)r.exports=o();else if("function"==typeof e&&e.amd)e([],o);else{("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).EphoxContactWrapper=o()}}((function(){return function t(e,n,r){function i(a,c){if(!n[a]){if(!e[a]){var s="function"==typeof o&&o;if(!c&&s)return s(a,!0);if(u)return u(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[a]={exports:{}};e[a][0].call(f.exports,(function(t){return i(e[a][1][t]||t)}),f,f.exports,t,e,n,r)}return n[a].exports}for(var u="function"==typeof o&&o,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e,n){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var e=l.length;e;){for(s=l,l=[];++d<e;)s&&s[d].run();d=-1,e=l.length}s=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new h(t,e)),1!==l.length||f||c(g)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function u(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void c(e.promise,t)}a(e.promise,r)}else(1===t._state?a:c)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)u(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return u(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),n)}e[i]=u,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n.setImmediate="function"==typeof e?e:function(t){var e=c++,r=!(arguments.length<2)&&u.call(arguments,1);return a[e]=!0,o((function(){a[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))})),e},n.clearImmediate="function"==typeof r?r:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)}))}(void 0,Ww,qw,void 0);var Gw,$w=qw.exports.boltExport,Xw=function(t){var e=B.none(),n=[],r=function(t){o()?u(t):n.push(t)},o=function(){return e.isSome()},i=function(t){q(t,u)},u=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=B.some(t),i(n),n=[])})),{get:r,map:function(t){return Xw((function(e){r((function(n){e(t(n))}))}))},isReady:o}},Kw={nu:Xw,pure:function(t){return Xw((function(e){e(t)}))}},Yw=function(t){setTimeout((function(){throw t}),0)},Jw=function(t){var e=function(e){t().then(e,Yw)};return{map:function(e){return Jw((function(){return t().then(e)}))},bind:function(e){return Jw((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return Jw((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return Kw.nu(e)},toCached:function(){var e=null;return Jw((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Qw=function(t){return Jw((function(){return new $w(t)}))},Zw=function(t){return Jw((function(){return $w.resolve(t)}))},tx=["input","textarea"],ex=function(t){var e=co(t);return F(tx,e)},nx=function(t,e){var n=e.getRoot(t).getOr(t.element);Ii(n,e.invalidClass),e.notify.each((function(e){ex(t.element)&&Wo(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){jo(t,e.validHtml)})),e.onValid(t)}))},rx=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);zi(o,e.invalidClass),e.notify.each((function(e){ex(t.element)&&Wo(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){jo(t,r)})),e.onInvalid(t,r)}))},ox=function(t,e,n){return e.validator.fold((function(){return Zw(mt.value(!0))}),(function(e){return e.validate(t)}))},ix=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),ox(t,e).map((function(n){return t.getSystem().isConnected()?n.fold((function(n){return rx(t,e,0,n),mt.error(n)}),(function(n){return nx(t,e),mt.value(n)})):mt.error("No longer in system")}))},ux=Object.freeze({__proto__:null,markValid:nx,markInvalid:rx,query:ox,run:ix,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element);return Pi(n,e.invalidClass)}}),ax=Object.freeze({__proto__:null,events:function(t,e){return t.validator.map((function(e){return Gr([Kr(e.onEvent,(function(e){ix(e,t).get(b)}))].concat(e.validateOnLoad?[ro((function(e){ix(e,t).get(h)}))]:[]))})).getOr({})}}),cx=[Me("invalidClass"),$e("getRoot",B.none),Ge("notify",[$e("aria","alert"),$e("getContainer",B.none),$e("validHtml",""),pa("onValid"),pa("onInvalid"),pa("onValidate")]),Ge("validator",[Me("validate"),$e("onEvent","input"),$e("validateOnLoad",!0)])],sx=lc({fields:cx,name:"invalidating",active:ax,apis:ux,extra:{validation:function(t){return function(e){var n=lf.getValue(e);return Zw(t(n))}}}}),lx=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),fx=[Ne("others",Ce(mt.value,fe()))],dx=lc({fields:fx,name:"coupling",apis:lx,state:Object.freeze({__proto__:null,init:function(){var t={},e=v({});return bi({readState:e,getOrCreate:function(e,n,r){var o=At(n.others);if(o)return Lt(t,r).getOrThunk((function(){var o=Lt(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),mx=v("sink"),gx=v(Vf({name:mx(),overrides:v({dom:{tag:"div"},behaviours:cc([xl.config({useFixed:k})]),events:Gr([to(or()),to(Jn()),to(cr())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}(Gw||(Gw={}));var hx,px,vx,bx=function(t,e){var n=t.getHotspot(e).getOr(e),r=t.getAnchorOverrides();return t.layouts.fold((function(){return{type:"hotspot",hotspot:n,overrides:r}}),(function(t){return{type:"hotspot",hotspot:n,overrides:r,layouts:t}}))},yx=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),c=Sx(r,t);return a.map((function(t){return t.bind((function(t){return B.from(Ah.sketch(T(T({},i.menu()),{uid:ci(""),data:t,highlightImmediately:u===Gw.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();xl.position(r,e,{anchor:n}),Ul.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();xl.position(r,n,{anchor:{type:"submenu",item:e}}),Ul.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();xl.position(o,e,{anchor:n}),q(r,(function(t){xl.position(o,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})}))},onEscape:function(){return Kg.focus(r),Ul.close(o),B.some(!0)}})))}))}))}(t,e,bx(t,n),n,r,o,u).map((function(t){return t.fold((function(){Ul.isOpen(r)&&Ul.close(r)}),(function(t){Ul.cloak(r),Ul.open(r,t),i(r)})),r}))},wx=function(t,e,n,r,o,i,u){return Ul.close(r),Zw(r)},xx=function(t,e,n,r,o,i){var u=dx.getCoupled(n,"sandbox");return(Ul.isOpen(u)?wx:yx)(t,e,n,u,r,o,i)},Cx=function(t,e,n){var r=bd.getCurrent(e).getOr(e),o=Du(t.element);n?Yi(r.element,"min-width",o+"px"):function(t,e){Au.set(t,e)}(r.element,o)},Sx=function(t,e){return t.getSystem().getByUid(e.uid+"-"+mx()).map((function(t){return function(){return mt.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return mt.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},kx=function(t){Ul.getState(t).each((function(t){Ah.repositionMenus(t)}))},Ox=function(t,e,n){var r=ea(),o=Sx(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:hf(t.sandboxBehaviours,[lf.config({store:{mode:"memory",initialValue:e}}),Ul.config({onOpen:function(o,i){var u=bx(t,e);r.link(e.element),t.matchWidth&&Cx(u.hotspot,i,t.useMinWidth),t.onOpen(u,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return ra(n,r)||ra(e,r)},getAttachPoint:function(){return o().getOrDie()}}),bd.config({find:function(t){return Ul.getState(t).bind((function(t){return bd.getCurrent(t)}))}}),gc.config({channels:T(T({},Xl({isExtraPart:S})),Yl({doReposition:kx}))})])}},Tx=function(t){var e=dx.getCoupled(t,"sandbox");kx(e)},_x=function(){return[$e("sandboxClasses",[]),gf("sandboxBehaviours",[bd,gc,Ul,lf])]},Ex=v([Me("dom"),Me("fetch"),pa("onOpen"),va("onExecute"),$e("getHotspot",B.some),$e("getAnchorOverrides",v({})),ls(),ff("dropdownBehaviours",[ah,dx,Lg,Kg]),Me("toggleClass"),$e("eventOrder",{}),Fe("lazySink"),$e("matchWidth",!1),$e("useMinWidth",!1),Fe("role")].concat(_x())),Ax=v([Ff({schema:[ma()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),gx()]),Dx=gd({name:"Dropdown",configFields:Ex(),partFields:Ax(),factory:function(t,e,n,r){var o,i,u=function(t){Ul.getState(t).each((function(t){Ah.highlightPrimary(t)}))},a={expand:function(e){ah.isOn(e)||xx(t,b,e,r,h,Gw.HighlightNone).get(h)},open:function(e){ah.isOn(e)||xx(t,b,e,r,h,Gw.HighlightFirst).get(h)},isOpen:ah.isOn,close:function(e){ah.isOn(e)&&xx(t,b,e,r,h,Gw.HighlightFirst).get(h)},repositionMenus:function(t){ah.isOn(t)&&Tx(t)}},c=function(t,e){return jr(t),B.some(!0)};return{uid:t.uid,dom:t.dom,components:e,behaviours:mf(t.dropdownBehaviours,[ah.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),dx.config({others:{sandbox:function(e){return Ox(t,e,{onOpen:function(){return ah.on(e)},onClose:function(){return ah.off(e)}})}}}),Lg.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(Dx.isOpen(t)){var n=dx.getCoupled(t,"sandbox");u(n)}else Dx.open(t);return B.some(!0)},onEscape:function(t,e){return Dx.isOpen(t)?(Dx.close(t),B.some(!0)):B.none()}}),Kg.config({})]),events:sh(B.some((function(e){xx(t,b,e,r,u,Gw.HighlightFirst).get(h)}))),eventOrder:T(T({},t.eventOrder),(o={},o[yr()]=["disabling","toggling","alloy.base.behaviour"],o)),apis:a,domModification:{attributes:T(T({"aria-haspopup":"true"},t.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===t.dom.tag?{type:(i="type",Lt(t.dom,"attributes").bind((function(t){return Lt(t,i)}))).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),Mx=Object.freeze({__proto__:null,events:function(){return Gr([$r(dr(),k)])},exhibit:function(){return wi({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),Nx=lc({fields:[],name:"unselecting",active:Mx}),Rx=ei("color-input-change"),zx=ei("color-swatch-change"),Bx=ei("color-picker-cancel"),Ix=function(t,e,n){var r=ww.parts.field({factory:Uw,inputClasses:["tox-textfield"],onSetValue:function(t){return sx.run(t).get(h)},inputBehaviours:cc([Nd.config({disabled:e.providers.isDisabled}),pb(),Sw.config({}),sx.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return yo(t.element)},notify:{onValid:function(t){var e=lf.getValue(t);Vr(t,Rx,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=lf.getValue(t);if(0===e.length)return Zw(mt.value(!0));var n=on.fromTag("span");Yi(n,"background-color",e);var r=eu(n,"background-color").fold((function(){return mt.error("blah")}),(function(t){return mt.value(e)}));return Zw(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return Ew(t,e.providers)})),i=function(t,e){Vr(t,zx,{value:e})},u=Jh(function(t,e){return Dx.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:cc([bb(e.providers.isDisabled),pb(),Nx.config({}),Sw.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return Qw((function(e){return t.fetch(e)})).map((function(r){return B.from(Zy(jt(Ry(ei("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,Xp.CLOSE_ON_EXECUTE,S,e.providers),{movement:By(t.columns,t.presets)})))}))},parts:{menu:iv(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[Ua,ja,$a]},onLtr:function(){return[ja,Ua,$a]}},components:[],fetch:Ey(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){u.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return Fr(t,Bx)}),(function(e){i(t,e),Sy(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))}},e));return ww.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,u.asSpec()]}]),fieldBehaviours:cc([Wg("form-field-events",[Kr(Rx,(function(e,n){u.getOpt(e).each((function(t){Yi(t.element,"background-color",n.event.color)})),Vr(e,Aw,{name:t.name})})),Kr(zx,(function(t,e){ww.getField(t).each((function(n){lf.setValue(n,e.event.value),bd.getCurrent(t).each(Kg.focus)}))})),Kr(Bx,(function(t,e){ww.getField(t).each((function(e){bd.getCurrent(t).each(Kg.focus)}))}))])])})},Px=Vf({schema:[Me("dom")],name:"label"}),Lx=function(t){return Vf({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:Gr([Yr($n(),(function(e,n,r){return t(e,r)}),[e]),Yr(Jn(),(function(e,n,r){return t(e,r)}),[e]),Yr(Qn(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},Hx=Lx("top-left"),Fx=Lx("top"),Vx=Lx("top-right"),jx=Lx("right"),Ux=Lx("bottom-right"),Wx=Lx("bottom"),qx=Lx("bottom-left"),Gx=Lx("left"),$x=Hf({name:"thumb",defaults:v({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Gr([Qr($n(),t,"spectrum"),Qr(Xn(),t,"spectrum"),Qr(Kn(),t,"spectrum"),Qr(Jn(),t,"spectrum"),Qr(Qn(),t,"spectrum"),Qr(tr(),t,"spectrum")])}}}),Xx=Hf({schema:[Ae("mouseIsDown",(function(){return nn(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:cc([Lg.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),Kg.config({})]),events:Gr([Kr($n(),n),Kr(Xn(),n),Kr(Jn(),n),Kr(Qn(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}}),Kx=[Px,Gx,jx,Fx,Wx,Hx,Vx,qx,Ux,$x,Xx],Yx=v("slider.change.value"),Jx=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?B.some(n.touches[0]).map((function(t){return Ou(t.clientX,t.clientY)})):B.none()}var r=e;return void 0!==r.clientX?B.some(r).map((function(t){return Ou(t.clientX,t.clientY)})):B.none()},Qx=function(t){return t.model.minX},Zx=function(t){return t.model.minY},tC=function(t){return t.model.minX-1},eC=function(t){return t.model.minY-1},nC=function(t){return t.model.maxX},rC=function(t){return t.model.maxY},oC=function(t){return t.model.maxX+1},iC=function(t){return t.model.maxY+1},uC=function(t,e,n){return e(t)-n(t)},aC=function(t){return uC(t,nC,Qx)},cC=function(t){return uC(t,rC,Zx)},sC=function(t){return aC(t)/2},lC=function(t){return cC(t)/2},fC=function(t){return t.stepSize},dC=function(t){return t.snapToGrid},mC=function(t){return t.snapStart},gC=function(t){return t.rounded},hC=function(t,e){return void 0!==t[e+"-edge"]},pC=function(t){return hC(t,"left")},vC=function(t){return hC(t,"right")},bC=function(t){return hC(t,"top")},yC=function(t){return hC(t,"bottom")},wC=function(t){return t.model.value.get()},xC=function(t){return{x:t}},CC=function(t){return{y:t}},SC=function(t,e){return{x:t,y:e}},kC=function(t,e){Vr(t,Yx(),{value:e})},OC=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},TC=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},_C=function(t,e,n){return Math.max(e,Math.min(n,t))},EC=function(t){var e=t.min,n=t.max,r=t.range,o=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?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=_C(p/m*r+e,g,h);return u&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return _C(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),u=Math.floor((t-e)/r),a=Math.floor((n-e)/r),c=e+Math.min(a,u+i)*r;return Math.max(e,c)}))}(v,e,n,i,a):c?Math.round(v):v},AC=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?u?a:l:(o-e)/r*c},DC=function(t){return t.element.dom.getBoundingClientRect()},MC=function(t,e){return t[e]},NC=function(t){var e=DC(t);return MC(e,"left")},RC=function(t){var e=DC(t);return MC(e,"right")},zC=function(t){var e=DC(t);return MC(e,"top")},BC=function(t){var e=DC(t);return MC(e,"bottom")},IC=function(t){var e=DC(t);return MC(e,"width")},PC=function(t){var e=DC(t);return MC(e,"height")},LC=function(t,e,n){return(t+e)/2-n},HC=function(t,e){var n=DC(t),r=DC(e),o=MC(n,"left"),i=MC(n,"right"),u=MC(r,"left");return LC(o,i,u)},FC=function(t,e){var n=DC(t),r=DC(e),o=MC(n,"top"),i=MC(n,"bottom"),u=MC(r,"top");return LC(o,i,u)},VC=function(t,e){Vr(t,Yx(),{value:e})},jC=function(t){return{x:t}},UC=function(t,e,n){var r={min:Qx(e),max:nC(e),range:aC(e),value:n,step:fC(e),snap:dC(e),snapStart:mC(e),rounded:gC(e),hasMinEdge:pC(e),hasMaxEdge:vC(e),minBound:NC(t),maxBound:RC(t),screenRange:IC(t)};return EC(r)},WC=function(t){return function(e,n){return function(t,e,n){var r=(t>0?TC:OC)(wC(n).x,Qx(n),nC(n),fC(n));return VC(e,jC(r)),B.some(r)}(t,e,n).map(k)}},qC=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=IC(t),u=r.bind((function(e){return B.some(HC(e,t))})).getOr(0),a=o.bind((function(e){return B.some(HC(e,t))})).getOr(i),c={min:Qx(e),max:nC(e),range:aC(e),value:n,hasMinEdge:pC(e),hasMaxEdge:vC(e),minBound:NC(t),minOffset:0,maxBound:RC(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return AC(c)}(e,i,n,r,o);return NC(e)-NC(t)+u},GC=WC(-1),$C=WC(1),XC=B.none,KC=B.none,YC={"top-left":B.none(),top:B.none(),"top-right":B.none(),right:B.some((function(t,e){kC(t,xC(oC(e)))})),"bottom-right":B.none(),bottom:B.none(),"bottom-left":B.none(),left:B.some((function(t,e){kC(t,xC(tC(e)))}))},JC=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=UC(t,e,n),o=jC(r);return VC(t,o),r},setToMin:function(t,e){var n=Qx(e);VC(t,jC(n))},setToMax:function(t,e){var n=nC(e);VC(t,jC(n))},findValueOfOffset:UC,getValueFromEvent:function(t){return Jx(t).map((function(t){return t.left}))},findPositionOfValue:qC,setPositionFromValue:function(t,e,n,r){var o=wC(n),i=qC(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=Du(e.element)/2;Yi(e.element,"left",i-u+"px")},onLeft:GC,onRight:$C,onUp:XC,onDown:KC,edgeActions:YC}),QC=function(t,e){Vr(t,Yx(),{value:e})},ZC=function(t){return{y:t}},tS=function(t,e,n){var r={min:Zx(e),max:rC(e),range:cC(e),value:n,step:fC(e),snap:dC(e),snapStart:mC(e),rounded:gC(e),hasMinEdge:bC(e),hasMaxEdge:yC(e),minBound:zC(t),maxBound:BC(t),screenRange:PC(t)};return EC(r)},eS=function(t){return function(e,n){return function(t,e,n){var r=(t>0?TC:OC)(wC(n).y,Zx(n),rC(n),fC(n));return QC(e,ZC(r)),B.some(r)}(t,e,n).map(k)}},nS=function(t,e,n,r,o,i){var u=function(t,e,n,r,o){var i=PC(t),u=r.bind((function(e){return B.some(FC(e,t))})).getOr(0),a=o.bind((function(e){return B.some(FC(e,t))})).getOr(i),c={min:Zx(e),max:rC(e),range:cC(e),value:n,hasMinEdge:bC(e),hasMaxEdge:yC(e),minBound:zC(t),minOffset:0,maxBound:BC(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return AC(c)}(e,i,n,r,o);return zC(e)-zC(t)+u},rS=B.none,oS=B.none,iS=eS(-1),uS=eS(1),aS={"top-left":B.none(),top:B.some((function(t,e){kC(t,CC(eC(e)))})),"top-right":B.none(),right:B.none(),"bottom-right":B.none(),bottom:B.some((function(t,e){kC(t,CC(iC(e)))})),"bottom-left":B.none(),left:B.none()},cS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=tS(t,e,n),o=ZC(r);return QC(t,o),r},setToMin:function(t,e){var n=Zx(e);QC(t,ZC(n))},setToMax:function(t,e){var n=rC(e);QC(t,ZC(n))},findValueOfOffset:tS,getValueFromEvent:function(t){return Jx(t).map((function(t){return t.top}))},findPositionOfValue:nS,setPositionFromValue:function(t,e,n,r){var o=wC(n),i=nS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=Cu(e.element)/2;Yi(e.element,"top",i-u+"px")},onLeft:rS,onRight:oS,onUp:iS,onDown:uS,edgeActions:aS}),sS=function(t,e){Vr(t,Yx(),{value:e})},lS=function(t,e){return{x:t,y:e}},fS=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?TC:OC,i=e?wC(r).x:o(wC(r).x,Qx(r),nC(r),fC(r)),u=e?o(wC(r).y,Zx(r),rC(r),fC(r)):wC(r).y;return sS(n,lS(i,u)),B.some(i)}(t,e,n,r).map(k)}},dS=fS(-1,!1),mS=fS(1,!1),gS=fS(-1,!0),hS=fS(1,!0),pS={"top-left":B.some((function(t,e){kC(t,SC(tC(e),eC(e)))})),top:B.some((function(t,e){kC(t,SC(sC(e),eC(e)))})),"top-right":B.some((function(t,e){kC(t,SC(oC(e),eC(e)))})),right:B.some((function(t,e){kC(t,SC(oC(e),lC(e)))})),"bottom-right":B.some((function(t,e){kC(t,SC(oC(e),iC(e)))})),bottom:B.some((function(t,e){kC(t,SC(sC(e),iC(e)))})),"bottom-left":B.some((function(t,e){kC(t,SC(tC(e),iC(e)))})),left:B.some((function(t,e){kC(t,SC(tC(e),lC(e)))}))},vS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=UC(t,e,n.left),o=tS(t,e,n.top),i=lS(r,o);return sS(t,i),i},setToMin:function(t,e){var n=Qx(e),r=Zx(e);sS(t,lS(n,r))},setToMax:function(t,e){var n=nC(e),r=rC(e);sS(t,lS(n,r))},getValueFromEvent:function(t){return Jx(t)},setPositionFromValue:function(t,e,n,r){var o=wC(n),i=qC(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),u=nS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=Du(e.element)/2,c=Cu(e.element)/2;Yi(e.element,"left",i-a+"px"),Yi(e.element,"top",u-c+"px")},onLeft:dS,onRight:mS,onUp:gS,onDown:hS,edgeActions:pS}),bS=gd({name:"Slider",configFields:[$e("stepSize",1),$e("onChange",h),$e("onChoose",h),$e("onInit",h),$e("onDragStart",h),$e("onDragEnd",h),$e("snapToGrid",!1),$e("rounded",!0),Fe("snapStart"),Ne("model",_e("mode",{x:[$e("minX",0),$e("maxX",100),Ae("value",(function(t){return nn(t.mode.minX)})),Me("getInitialValue"),wa("manager",JC)],y:[$e("minY",0),$e("maxY",100),Ae("value",(function(t){return nn(t.mode.minY)})),Me("getInitialValue"),wa("manager",cS)],xy:[$e("minX",0),$e("maxX",100),$e("minY",0),$e("maxY",100),Ae("value",(function(t){return nn({x:t.mode.minX,y:t.mode.minY})})),Me("getInitialValue"),wa("manager",vS)]})),ff("sliderBehaviours",[Lg,lf]),Ae("mouseIsDown",(function(){return nn(!1)}))],partFields:Kx,factory:function(t,e,n,r){var o,i=function(e){return td(e,t,"thumb")},u=function(e){return td(e,t,"spectrum")},a=function(e){return Zf(e,t,"left-edge")},c=function(e){return Zf(e,t,"right-edge")},s=function(e){return Zf(e,t,"top-edge")},l=function(e){return Zf(e,t,"bottom-edge")},f=t.model,d=f.manager,m=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:a,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:u})},g=function(t,e){f.value.set(e);var n=i(t);m(t,n)},h=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&Zf(e,t,"thumb").each((function(n){var r=f.value.get();t.onChoose(e,n,r)}))},p=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},v=function(e,n){n.stop(),t.onDragEnd(e,i(e)),h(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:mf(t.sliderBehaviours,[Lg.config({mode:"special",focusIn:function(e){return Zf(e,t,"spectrum").map(Lg.focusIn).map(k)}}),lf.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),gc.config({channels:(o={},o[Gl()]={onReceive:h},o)})]),events:Gr([Kr(Yx(),(function(e,n){!function(e,n){g(e,n);var r=i(e);t.onChange(e,r,n),B.some(!0)}(e,n.event.value)})),ro((function(e,n){var r=f.getInitialValue();f.value.set(r);var o=i(e);m(e,o);var a=u(e);t.onInit(e,o,a,f.value.get())})),Kr($n(),p),Kr(Kn(),v),Kr(Jn(),p),Kr(tr(),v)]),apis:{resetToMin:function(e){d.setToMin(e,t)},resetToMax:function(e){d.setToMax(e,t)},setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,e,n){t.setValue(e,n)},resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),yS=ei("rgb-hex-update"),wS=ei("slider-update"),xS=ei("palette-update"),CS=[ff("formBehaviours",[lf])],SS=function(t){return"<alloy.field."+t+">"},kS=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:mf(t.formBehaviours,[lf.config({store:{mode:"manual",getValue:function(e){var n=nd(e,t);return Nt(n,(function(t,e){return t().bind((function(t){var n,r,o=bd.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Jo(t.element)),n.fold((function(){return mt.error(r)}),mt.value)})).map(lf.getValue)}))},setValue:function(e,n){Mt(n,(function(n,r){Zf(e,t,r).each((function(t){bd.getCurrent(t).each((function(t){lf.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return Zf(e,t,n).bind(bd.getCurrent)}}}},OS={getField:pi((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),Xf("form",SS(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=W(r,(function(t){return Hf({name:t,pname:SS(t)})}));return sd("form",CS,o,kS,n)}},TS=ei("valid-input"),_S=ei("invalid-input"),ES=ei("validating-input"),AS=function(t,e,n,r){var o=function(n,r){return sx.config({invalidClass:e("invalid"),notify:{onValidate:function(t){Vr(t,ES,{type:n})},onValid:function(t){Vr(t,TS,{type:n,value:lf.getValue(t)})},onInvalid:function(t){Vr(t,_S,{type:n,value:lf.getValue(t)})}},validator:{validate:function(e){var n=lf.getValue(e),o=r(n)?mt.value(!0):mt.error(t("aria.input.invalid"));return Zw(o)},validateOnLoad:!1}})},i=function(n,r,i,u,a){var c=t("colorcustom.rgb.range"),s=[ww.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":u}}}),ww.parts.field({data:a,factory:Uw,inputAttributes:T({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:cc([o(r,n),Sw.config({})]),onSetValue:function(t){sx.isInvalid(t)&&sx.run(t).get(h)}})],l="hex"!==r?[ww.parts["aria-descriptor"]({text:c})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:s.concat(l)}},u=function(t,e){var n=e.red,r=e.green,o=e.blue;lf.setValue(t,{red:n,green:r,blue:o})},a=Jh({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),c=function(t,e){a.getOpt(t).each((function(t){Yi(t.element,"background-color","#"+e.value)}))};return md({factory:function(){var o={red:nn(B.some(255)),green:nn(B.some(255)),blue:nn(B.some(255)),hex:nn(B.some("ffffff"))},s=function(t){return o[t].get()},l=function(t,e){o[t].set(e)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",B.some(e)),l("green",B.some(n)),l("blue",B.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,B.none()):r(t)},m=function(t,e,n){var r=parseInt(n,10);l(e,B.some(r)),s("red").bind((function(t){return s("green").bind((function(e){return s("blue").map((function(n){return ry(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=Jb(e);return OS.getField(t,"hex").each((function(e){Kg.isFocused(e)||lf.setValue(t,{hex:n.value})})),n}(t,e);Vr(t,yS,{hex:n}),c(t,n)}))},g=function(t,e){var r=e.event;!function(t){return"hex"===t.type}(r)?m(t,r.type,r.value):function(t,e){n(t);var r=Wb(e);l("hex",B.some(e));var o=uy(r);u(t,o),f(o),Vr(t,yS,{hex:r}),c(t,r)}(t,r.value)},h=function(e){return{label:t("colorcustom.rgb."+e+".label"),description:t("colorcustom.rgb."+e+".description")}},p=h("red"),v=h("green"),b=h("blue"),y=h("hex");return jt(OS.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",ww.sketch(i(oy,"red",p.label,p.description,255))),n.field("green",ww.sketch(i(oy,"green",v.label,v.description,255))),n.field("blue",ww.sketch(i(oy,"blue",b.label,b.description,255))),n.field("hex",ww.sketch(i($b,"hex",y.label,y.description,"ffffff"))),a.asSpec()],formBehaviours:cc([sx.config({invalidClass:e("form-invalid")}),Wg("rgb-form-events",[Kr(TS,g),Kr(_S,d),Kr(ES,d)])])}})),{apis:{updateHex:function(t,e){lf.setValue(t,{hex:e.value}),function(t,e){var n=uy(e);u(t,n),f(n)}(t,e),c(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},DS=function(t,e){var n=bS.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=bS.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),o=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var u=o.createLinearGradient(0,0,0,r);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=u,o.fillRect(0,0,n,r)}};return md({factory:function(t){var i=v({x:0,y:0}),u=cc([bd.config({find:B.some}),Kg.config({})]);return bS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:function(t,e,n){Vr(t,xS,{value:n})},onInit:function(t,e,n,r){o(n.element.dom,sy(ly))},sliderBehaviours:u})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom,r=dy(e,100,100),i=iy(r);o(n,sy(i))}(e,n)},setThumb:function(t,e,n){!function(t,e){var n=my(uy(e));bS.setValue(t,{x:n.saturation,y:100-n.value})}(e,n)}},extraApis:{}})},MS=function(t,e){return md({name:"ColourPicker",configFields:[Me("dom"),$e("onValidHex",h),$e("onInvalidHex",h)],factory:function(n){var r,o=AS(t,e,n.onValidHex,n.onInvalidHex),i=DS(0,e),u=function(t){return 100-t/360*100},a={paletteRgba:nn(ly),paletteHue:nn(0)},c=Jh(function(t,e){var n=bS.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=bS.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return bS.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:v({y:0})},components:[n,r],sliderBehaviours:cc([Kg.config({})]),onChange:function(t,e,n){Vr(t,wS,{value:n})}})}(0,e)),s=Jh(i.sketch({})),l=Jh(o.sketch({})),f=function(t,e,n){s.getOpt(t).each((function(t){i.setHue(t,n)}))},d=function(t,e){l.getOpt(t).each((function(t){o.updateHex(t,e)}))},m=function(t,e,n){c.getOpt(t).each((function(t){bS.setValue(t,{y:u(n)})}))},g=function(t,e){s.getOpt(t).each((function(t){i.setThumb(t,e)}))},h=function(t,e,n,r){!function(t,e){var n=uy(t);a.paletteRgba.set(n),a.paletteHue.set(e)}(e,n),q(r,(function(r){r(t,e,n)}))};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),l.asSpec()],behaviours:cc([Wg("colour-picker-events",[Kr(yS,(r=[f,m,g],function(t,e){var n=e.event.hex,o=function(t){return my(uy(t))}(n);h(t,n,o.hue,r)})),Kr(xS,function(){var t=[d];return function(e,n){var r=n.event.value,o=a.paletteHue.get(),i=dy(o,r.x,100-r.y),u=gy(i);h(e,u,o,t)}}()),Kr(wS,function(){var t=[f,d];return function(e,n){var r=function(t){return(100-t)/100*360}(n.event.value.y),o=a.paletteRgba.get(),i=my(o),u=dy(r,i.saturation,i.value),c=gy(u);h(e,c,r,t)}}())]),bd.config({find:function(t){return l.getOpt(t)}}),Lg.config({mode:"acyclic"})])}}})},NS=function(){return bd.config({find:B.some})},RS=function(t){return bd.config({find:t.getOpt})},zS=function(t){return bd.config({find:function(e){return Co(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},BS={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},IS=function(t){return function(t){return BS[t]}(t)},PS=tinymce.util.Tools.resolve("tinymce.Resource"),LS=tinymce.util.Tools.resolve("tinymce.util.Tools"),HS=ue([$e("preprocess",b),$e("postprocess",b)]),FS=function(t,e,n){return lf.config(jt({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},VS=function(t,e,n){return FS(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},jS=function(t,e){var n=Oe("RepresentingConfigs.memento processors",HS,e);return lf.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=lf.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);lf.setValue(i,o)}}})},US=FS,WS=function(t){return VS(t,Vo,jo)},qS=function(t){return lf.config({store:{mode:"memory",initialValue:t}})},GS=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){q(t,(function(t){t(e,n)}))}},o=function(t,e){if(!Nd.isDisabled(t)){var n=e.event.raw;u(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;u(t,n.files)},u=function(n,r){lf.setValue(n,function(t,e){var n=LS.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return $(st(t),(function(t){return V(n,(function(e){return mn(t.name.toLowerCase(),"."+e.toLowerCase())}))}))}(r,e)),Vr(n,Aw,{name:t.name})},a=Jh({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:cc([Wg("input-file-events",[to(cr()),to(xr())])])}),c=t.label.map((function(t){return Ew(t,e)})),s=ww.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:cc([qS([]),NS(),Nd.config({}),ah.config({toggleClass:"dragenter",toggleOnExecute:!1}),Wg("dropzone-events",[Kr("dragenter",r([n,ah.toggle])),Kr("dragleave",r([n,ah.toggle])),Kr("dragover",n),Kr("drop",r([n,o])),Kr(ar(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Yh.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(t){a.get(t).element.dom.click()},buttonBehaviours:cc([Sw.config({}),bb(e.isDisabled),pb()])})]}]}}}});return Ow(c,s,["tox-form__group--stretched"],[])},$S=ei("alloy-fake-before-tabstop"),XS=ei("alloy-fake-after-tabstop"),KS=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:cc([Kg.config({ignore:!0}),Sw.config({})])}},YS=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[KS([$S]),t,KS([XS])],behaviours:cc([zS(1)])}},JS=function(t,e){Vr(t,or(),{raw:{which:9,shiftKey:e}})},QS=function(t,e){var n=e.element;Pi(n,$S)?JS(t,!0):Pi(n,XS)&&JS(t,!1)},ZS=function(t){return ew(t,["."+$S,"."+XS].join(","),S)},tk=!(En().browser.isIE()||En().browser.isEdge()),ek=function(t,e){var n=tk&&t.sandboxed,r=T(T({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=nn("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)Wo(n.element,"srcdoc",r);else{Wo(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return Ew(t,e)})),u=ww.parts.field({factory:{sketch:function(t){return YS({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:cc([Sw.config({}),Kg.config({}),US(B.none(),o.getValue,o.setValue)])})}}});return Ow(i,u,["tox-form__group--stretched"],[])},nk=function(t,e){return ik(document.createElement("canvas"),t,e)},rk=function(t){var e=nk(t.width,t.height);return ok(e).drawImage(t,0,0),e},ok=function(t){return t.getContext("2d")},ik=function(t,e,n){return t.width=e,t.height=n,t},uk=function(t){return t.naturalWidth||t.width},ak=function(t){return t.naturalHeight||t.height},ck=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){return setTimeout(t,1)},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.apply(e,n)}},o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(t){a.call(this,t)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}var l=function(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}};return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);for(var n=r.length,o=function(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(t){e(t)}},i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++){o[r].then(t,n)}}))},t}(),sk=function(t){return new ck((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return B.none();for(var r=n[1],o=e[1],i=atob(o),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var l=1024*s,f=Math.min(l+1024,u),d=new Array(f-l),m=l,g=0;m<f;++g,++m)d[g]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return B.some(new Blob(c,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))},lk=function(t,e,n){return e=e||"image/png",d(HTMLCanvasElement.prototype.toBlob)?new ck((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):sk(t.toDataURL(e,n))},fk=function(t){return function(t){return new ck((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)},u=function(){i(),e(o)},a=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(u,0)}))}(t).then((function(t){dk(t);var e=nk(uk(t),ak(t));return ok(e).drawImage(t,0,0),e}))},dk=function(t){URL.revokeObjectURL(t.src)},mk=function(t,e,n){var r=e.type,o=v(r),i=v(n),u=function(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))};return{getType:o,toBlob:function(){return ck.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return lk(t,e,n)}))},toAdjustedDataURL:u,toAdjustedBase64:function(t,e){return u(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(rk)}}},gk=function(t){return function(t){return new ck((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return mk(fk(t),t,e)}))},hk=function(t,e){return lk(t,e).then((function(e){return mk(ck.resolve(t),e,t.toDataURL())}))},pk=function(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r},vk=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],bk=function(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)r[u]=e[u+5*i];for(u=0;u<5;u++){n=0;for(var a=0;a<5;a++)n+=t[u+5*a]*r[a];o[u+5*i]=n}}return o},yk=function(t,e){return t.toCanvas().then((function(n){return wk(n,t.getType(),e)}))},wk=function(t,e,n){var r=ok(t),o=function(t,e){for(var n,r,o,i,u=t.data,a=e[0],c=e[1],s=e[2],l=e[3],f=e[4],d=e[5],m=e[6],g=e[7],h=e[8],p=e[9],v=e[10],b=e[11],y=e[12],w=e[13],x=e[14],C=e[15],S=e[16],k=e[17],O=e[18],T=e[19],_=0;_<u.length;_+=4)n=u[_],r=u[_+1],o=u[_+2],i=u[_+3],u[_]=n*a+r*c+o*s+i*l+f,u[_+1]=n*d+r*m+o*g+i*h+p,u[_+2]=n*v+r*b+o*y+i*w+x,u[_+3]=n*C+r*S+o*k+i*O+T;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),hk(t,e)},xk=function(t,e,n){var r=ok(t),o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){for(var r=function(t,e,n){return t>n?t=n:t<e&&(t=e),t},o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),u=t.data,a=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=4*(r(l+h-i,0,s-1)*c+v),y=n[h*o+p];d+=u[b]*y,m+=u[b+1]*y,g+=u[b+2]*y}var w=4*(l*c+f);a[w]=r(d,0,255),a[w+1]=r(m,0,255),a[w+2]=r(g,0,255)}return e}(o,i,n),r.putImageData(i,0,0),hk(t,e)},Ck=function(t){return function(e,n){return yk(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}},Sk=function(t){return function(e){return yk(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),kk=Ck((function(t,e){return e=pk(255*e,-255,255),bk(t,[1,0,0,0,e,0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])})),Ok=Ck((function(t,e){var n;return e=pk(e,-1,1),n=(e*=100)<0?127+e/100*127:127*(n=0===(n=e%1)?vk[e]:vk[Math.floor(e)]*(1-n)+vk[Math.floor(e)+1]*n)+127,bk(t,[n/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),Tk=function(t,e,n,r){return yk(t,function(t,e,n,r){return e=pk(e,0,2),n=pk(n,0,2),r=pk(r,0,2),bk(t,[e,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,0,0,1])}([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],e,n,r))},_k=(hx=[0,-1,0,-1,5,-1,0,-1,0],function(t){return function(t,e){return t.toCanvas().then((function(n){return xk(n,t.getType(),e)}))}(t,hx)}),Ek=(px=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){for(var r=ok(t),o=new Array(256),i=0;i<o.length;i++)o[i]=px(i,n);var u=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(u,0,0),hk(t,e)}(n,t.getType(),e)}))}),Ak=function(t,e,n){var r=uk(t),o=ak(t),i=e/r,u=n/o,a=!1;(i<.5||i>2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=Dk(t,i,u);return a?c.then((function(t){return Ak(t,e,n)})):c},Dk=function(t,e,n){return new ck((function(r){var o=uk(t),i=ak(t),u=Math.floor(o*e),a=Math.floor(i*n),c=nk(u,a);ok(c).drawImage(t,0,0,o,i,0,0,u,a),r(c)}))},Mk=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},Nk=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,u=Math.sin(r),a=Math.cos(r),c=Mk(Math.abs(o*a)+Math.abs(i*u)),s=Mk(Math.abs(o*u)+Math.abs(i*a)),l=nk(c,s),f=ok(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),hk(l,e)},Rk=function(t,e,n){var r=nk(t.width,t.height),o=ok(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),hk(r,e)},zk=function(t,e,n,r,o,i){var u=nk(o,i);return ok(u).drawImage(t,-n,-r),hk(u,e)},Bk=function(t){return Sk(t)},Ik=function(t){return _k(t)},Pk=function(t,e){return Ek(t,e)},Lk=function(t,e){return kk(t,e)},Hk=function(t,e){return Ok(t,e)},Fk=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return Rk(n,t.getType(),e)}))}(t,e)},Vk=function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then((function(i){return zk(i,t.getType(),e,n,r,o)}))}(t,e,n,r,o)},jk=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return Ak(r,e,n).then((function(e){return hk(e,t.getType())}))}))}(t,e,n)},Uk=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return Nk(n,t.getType(),e)}))}(t,e)},Wk=function(t,e,n){return up(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},qk=function(t,e){return Wk(t,e,[])},Gk=function(t,e){return Wk(t,e,[Ug.config({})])},$k=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:cc([Ug.config({})])}},Xk=ei("toolbar.button.execute"),Kk=((vx={})[yr()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],vx),Yk=ei("update-menu-text"),Jk=ei("update-menu-icon"),Qk=function(t,e,n){var r=nn(h),o=t.text.map((function(t){return Jh($k(t,e,n.providers))})),i=t.icon.map((function(t){return Jh(Gk(t,n.providers.icons))})),u=function(t,e){var n=lf.getValue(t);return Kg.focus(n),Vr(n,"keydown",{raw:e.event.raw}),Dx.close(n),B.some(!0)},a=t.role.fold((function(){return{}}),(function(t){return{role:t}})),c=t.tooltip.fold((function(){return{}}),(function(t){var e=n.providers.translate(t);return{title:e,"aria-label":e}})),s=up("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons);return Jh(Dx.sketch(T(T(T({},t.uid?{uid:t.uid}:{}),a),{dom:{tag:"button",classes:[e,e+"--select"].concat(W(t.classes,(function(t){return e+"--"+t}))),attributes:T({},c)},components:Tb([i.map((function(t){return t.asSpec()})),o.map((function(t){return t.asSpec()})),B.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:cc(E(E([],t.dropdownBehaviours),[bb((function(){return t.disabled||n.providers.isDisabled()})),pb(),Nx.config({}),Ug.config({}),Wg("dropdown-events",[Cb(t,r),Sb(t,r)]),Wg("menubutton-update-display-text",[Kr(Yk,(function(t,e){o.bind((function(e){return e.getOpt(t)})).each((function(t){Ug.set(t,[hu(n.providers.translate(e.event.text))])}))})),Kr(Jk,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){Ug.set(t,[Gk(e.event.icon,n.providers.icons)])}))}))])])),eventOrder:jt(Kk,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:cc([Lg.config({mode:"special",onLeft:u,onRight:u})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:iv(0,t.columns,t.presets)},fetch:function(e){return Qw(w(t.fetch,e))}}))).asSpec()},Zk=function(t){return"separator"===t.type},tO={type:"separator"},eO=function(t,e){var n=K(t,(function(t,n){return function(t){return o(t)}(n)?""===n?t:"|"===n?t.length>0&&!Zk(t[t.length-1])?t.concat([tO]):t:Ht(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&Zk(n[n.length-1])&&n.pop(),n},nO=function(t,e){return function(t){return Ht(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=rO(n,e);return{item:t,menus:jt(r.menus,In(t.value,r.items)),expansions:jt(r.expansions,In(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}},rO=function(t,e){var n=eO(o(t)?t.split(" "):t,e);return X(n,(function(t,n){var r=function(t){if(Zk(t))return t;var e=Lt(t,"value").getOrThunk((function(){return ei("generated-menu-item")}));return jt({value:e},t)}(n),o=nO(r,e);return{menus:jt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:jt(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},oO=function(t,e,n,r){var o=ei("primary-menu"),i=rO(t,n.shared.providers.menuItems());if(0===i.items.length)return B.none();var u=Qy(o,i.items,e,n,r),a=Nt(i.menus,(function(t,r){return Qy(r,t,e,n,!1)})),c=jt(a,In(o,u));return B.from(Ah.tieredData(o,c,i.expansions))},iO=function(t){return{isDisabled:function(){return Nd.isDisabled(t)},setDisabled:function(e){return Nd.set(t,e)},setActive:function(e){var n=t.element;e?(zi(n,"tox-tbtn--enabled"),Wo(n,"aria-pressed",!0)):(Ii(n,"tox-tbtn--enabled"),Xo(n,"aria-pressed"))},isActive:function(){return Pi(t.element,"tox-tbtn--enabled")}}},uO=function(t,e,n,r){return Qk({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(oO(t,Xp.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:iO,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Sw.config({})]},e,n.shared)},aO=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){pc(e.element),Vr(e,Nw,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(W(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return T(T({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},cO=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=T({buttonBehaviours:cc([bb((function(){return t.disabled||i.isDisabled()})),pb(),Sw.config({}),Wg("button press",[Xr("click"),Xr("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=jt(a,{dom:r});return jt(c,{components:o})},sO=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return qk(t,n.icons)})),u=Tb([i]);return cO(t,e,r,o,u,n)},lO=function(t,e,n,r){void 0===r&&(r=[]);var o=sO(t,B.some(e),n,r);return Yh.sketch(o)},fO=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),u=t.icon?t.icon.map((function(t){return qk(t,n.icons)})):B.none(),a=u.isSome()?Tb([u]):[],c=u.isSome()?{}:{innerHtml:i},s=E(E(E(E([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"]),u.isSome()?["tox-button--icon"]:[]),t.borderless?["tox-button--naked"]:[]),o),l=T(T({tag:"button",classes:s},c),{attributes:{title:i}});return cO(t,e,r,l,a,n)},dO=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=fO(t,B.some(e),n,r,o);return Yh.sketch(i)},mO=function(t,e){return function(n){"custom"===e?Vr(n,Nw,{name:t,value:{}}):"submit"===e?Fr(n,Rw):"cancel"===e?Fr(n,Mw):console.error("Unknown button type: ",e)}},gO=function(t,e,n){if(function(t,e){return"menu"===e}(0,e)){var r=t,o=T(T({},t),{onSetup:function(e){return e.setDisabled(t.disabled),h},fetch:aO(r.items,(function(){return i}),n)}),i=Jh(uO(o,"tox-tbtn",n,B.none()));return i.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,e)){var u=mO(t.name,e),a=T(T({},t),{borderless:!1});return dO(a,u,n.shared.providers,[])}console.error("Unknown footer button type: ",e)},hO=function(t,e){var n,r,o=mO(t.name,"custom");return n=B.none(),r=ww.parts.field(T({factory:Yh},fO(t,B.some(o),e,[qS(""),NS()]))),Ow(n,r,[],[])},pO=v([$e("field1Name","field1"),$e("field2Name","field2"),ba("onLockedChange"),ga(["lockClass"]),$e("locked",!1),gf("coupledFieldBehaviours",[bd,lf])]),vO=function(t,e){return Hf({factory:ww,name:t,overrides:function(t){return{fieldBehaviours:cc([Wg("coupled-input-behaviour",[Kr(ur(),(function(n){(function(t,e,n){return Zf(t,e,n).bind(bd.getCurrent)})(n,t,e).each((function(e){Zf(n,t,"lock").each((function(r){ah.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},bO=v([vO("field1","field2"),vO("field2","field1"),Hf({factory:Yh,schema:[Me("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:cc([ah.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),yO=gd({name:"FormCoupledInputs",configFields:pO(),partFields:bO(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:hf(t.coupledFieldBehaviours,[bd.config({find:B.some}),lf.config({store:{mode:"manual",getValue:function(e){var n,r=od(e,t,["field1","field2"]);return(n={})[t.field1Name]=lf.getValue(r.field1()),n[t.field2Name]=lf.getValue(r.field2()),n},setValue:function(e,n){var r=od(e,t,["field1","field2"]);Ft(n,t.field1Name)&&lf.setValue(r.field1(),n[t.field1Name]),Ft(n,t.field2Name)&&lf.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return Zf(e,t,"field1")},getField2:function(e){return Zf(e,t,"field2")},getLock:function(e){return Zf(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),wO=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return mt.value({value:n,unit:r})}return mt.error(t)},xO=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Ht(n,t)};return t.unit===e?B.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?B.some(t.value):B.some(t.value/n[t.unit]*n[e]):B.none()},CO=function(t){return B.none()},SO=function(t,e){var n=wO(t).toOptional(),r=wO(e).toOptional();return ji(n,r,(function(t,e){return xO(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return xO(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(CO)})).getOr(CO)},kO=function(t,e){var n=CO,r=ei("ratio-event"),o=function(t){return up(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=yO.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[o("lock"),o("unlock")],buttonBehaviours:cc([Nd.config({disabled:function(){return t.disabled||e.isDisabled()}}),pb(),Sw.config({})])}),u=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},a=function(n){return ww.parts.field({factory:Uw,inputClasses:["tox-textfield"],inputBehaviours:cc([Nd.config({disabled:function(){return t.disabled||e.isDisabled()}}),pb(),Sw.config({}),Wg("size-input-events",[Kr(nr(),(function(t,e){Vr(t,r,{isField1:n})})),Kr(ar(),(function(e,n){Vr(e,Aw,{name:t.name})}))])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=yO.parts.field1(u([ww.parts.label(c("Width")),a(!0)])),l=yO.parts.field2(u([ww.parts.label(c("Height")),a(!1)]));return yO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,l,u([c("&nbsp;"),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){wO(lf.getValue(t)).each((function(t){n(t).each((function(t){lf.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:cc([Nd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){yO.getField1(t).bind(ww.getField).each(Nd.disable),yO.getField2(t).bind(ww.getField).each(Nd.disable),yO.getLock(t).each(Nd.disable)},onEnabled:function(t){yO.getField1(t).bind(ww.getField).each(Nd.enable),yO.getField2(t).bind(ww.getField).each(Nd.enable),yO.getLock(t).each(Nd.enable)}}),pb(),Wg("size-input-events2",[Kr(r,(function(t,e){var r=e.event.isField1,o=r?yO.getField1(t):yO.getField2(t),i=r?yO.getField2(t):yO.getField1(t),u=o.map(lf.getValue).getOr(""),a=i.map(lf.getValue).getOr("");n=SO(u,a)}))])])})},OO={undo:v(ei("undo")),redo:v(ei("redo")),zoom:v(ei("zoom")),back:v(ei("back")),apply:v(ei("apply")),swap:v(ei("swap")),transform:v(ei("transform")),tempTransform:v(ei("temp-transform")),transformApply:v(ei("transform-apply"))},TO=v("save-state"),_O=v("disable"),EO=v("enable"),AO={formActionEvent:Nw,saveState:TO,disable:_O,enable:EO},DO=function(t,e){var n=function(t,n,r,o){return Jh(dO({name:t,text:t,disabled:r,primary:o,icon:B.none(),borderless:!1},n,e))},r=function(t,n,r,o){return Jh(lO({name:t,icon:B.some(t),tooltip:B.some(n),disabled:o,primary:!1,borderless:!1},r,e))},o=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Nd)&&Nd.disable(n)}))},i=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Nd)&&Nd.enable(n)}))},u={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},a=h,c=function(t,e,n){Vr(t,e,n)},s=function(t){return Fr(t,AO.disable())},l=function(t){return Fr(t,AO.enable())},f=function(t,e){s(t),c(t,OO.transform(),{transform:e}),l(t)},d=function(t){return function(){tt.getOpt(t).each((function(t){Ug.set(t,[Q])}))}},m=function(t,e){s(t),c(t,OO.transformApply(),{transform:e,swap:d(t)}),l(t)},g=function(){return n("Back",(function(t){return c(t,OO.back(),{swap:d(t)})}),!1,!1)},p=function(){return Jh({dom:{tag:"div",classes:["tox-spacer"]},behaviours:cc([Nd.config({})])})},b=function(){return n("Apply",(function(t){return c(t,OO.apply(),{swap:d(t)})}),!0,!0)},y=[g(),p(),n("Apply",(function(e){m(e,(function(e){var n=t.getRect();return Vk(e,n.x,n.y,n.w,n.h)})),t.hideCrop()}),!1,!0)],w=pw.sketch({dom:u,components:y.map((function(t){return t.asSpec()})),containerBehaviours:cc([Wg("image-tools-crop-buttons-events",[Kr(AO.disable(),(function(t,e){o(y,t)})),Kr(AO.enable(),(function(t,e){i(y,t)}))])])}),x=Jh(kO({name:"size",label:B.none(),constrain:!0,disabled:!1},e)),C=[g(),p(),x,p(),n("Apply",(function(t){x.getOpt(t).each((function(e){var n=lf.getValue(e),r=function(t,e){return function(n){return jk(n,t,e)}}(parseInt(n.width,10),parseInt(n.height,10));m(t,r)}))}),!1,!0)],S=pw.sketch({dom:u,components:C.map((function(t){return t.asSpec()})),containerBehaviours:cc([Wg("image-tools-resize-buttons-events",[Kr(AO.disable(),(function(t,e){o(C,t)})),Kr(AO.enable(),(function(t,e){i(C,t)}))])])}),k=function(t,e){return function(n){return t(n,e)}},O=k(Fk,"h"),T=k(Fk,"v"),_=k(Uk,-90),E=k(Uk,90),A=function(t,e){!function(t,e){s(t),c(t,OO.tempTransform(),{transform:e}),l(t)}(t,e)},D=[g(),p(),r("flip-horizontally","Flip horizontally",(function(t){A(t,O)}),!1),r("flip-vertically","Flip vertically",(function(t){A(t,T)}),!1),r("rotate-left","Rotate counterclockwise",(function(t){A(t,_)}),!1),r("rotate-right","Rotate clockwise",(function(t){A(t,E)}),!1),p(),b()],M=pw.sketch({dom:u,components:D.map((function(t){return t.asSpec()})),containerBehaviours:cc([Wg("image-tools-fliprotate-buttons-events",[Kr(AO.disable(),(function(t,e){o(D,t)})),Kr(AO.enable(),(function(t,e){i(D,t)}))])])}),N=function(t,n,r,o,i){var u=bS.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),a=bS.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=bS.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Jh(bS.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:v({x:o})},components:[u,a,c],sliderBehaviours:cc([Kg.config({})]),onChoose:n}))},R=function(t,e,n,r,o){return N(t,(function(t,n,r){var o=k(e,r.x/100);f(t,o)}),n,r,o)},z=function(t,e,n,r,a){var c=function(t,e,n,r,o){return[g(),R(t,e,n,r,o),b()]}(t,e,n,r,a);return pw.sketch({dom:u,components:c.map((function(t){return t.asSpec()})),containerBehaviours:cc([Wg("image-tools-filter-panel-buttons-events",[Kr(AO.disable(),(function(t,e){o(c,t)})),Kr(AO.enable(),(function(t,e){i(c,t)}))])])})},I=[g(),p(),b()],P=pw.sketch({dom:u,components:I.map((function(t){return t.asSpec()}))}),L=z("Brightness",Lk,-100,0,100),H=z("Contrast",Hk,-100,0,100),F=z("Gamma",Pk,-100,0,100),V=function(t,e,n){return function(r){return function(t,e,n,r){return Tk(t,e,n,r)}(r,t,e,n)}},j=function(t){return N(t,(function(t,e,n){var r=U.getOpt(t),o=q.getOpt(t),i=W.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=lf.getValue(e).x/100,i=lf.getValue(r).x/100,u=lf.getValue(n).x/100,a=V(o,i,u);f(t,a)}))}))}))}),0,100,200)},U=j("R"),W=j("G"),q=j("B"),G=[g(),U,W,q,b()],$=pw.sketch({dom:u,components:G.map((function(t){return t.asSpec()}))}),X=function(t,e,n){return function(r){c(r,OO.swap(),{transform:e,swap:function(){tt.getOpt(r).each((function(e){Ug.set(e,[t]),n(e)}))}})}},K=B.some(Ik),Y=B.some(Bk),J=[r("crop","Crop",X(w,B.none(),(function(e){t.showCrop()})),!1),r("resize","Resize",X(S,B.none(),(function(e){x.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;lf.setValue(e,{width:r,height:o})}))})),!1),r("orientation","Orientation",X(M,B.none(),a),!1),r("brightness","Brightness",X(L,B.none(),a),!1),r("sharpen","Sharpen",X(P,K,a),!1),r("contrast","Contrast",X(H,B.none(),a),!1),r("color-levels","Color levels",X($,B.none(),a),!1),r("gamma","Gamma",X(F,B.none(),a),!1),r("invert","Invert",X(P,Y,a),!1)],Q=pw.sketch({dom:u,components:J.map((function(t){return t.asSpec()}))}),Z=pw.sketch({dom:{tag:"div"},components:[Q],containerBehaviours:cc([Ug.config({})])}),tt=Jh(Z);return{memContainer:tt,getApplyButton:function(t){return tt.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},MO=tinymce.util.Tools.resolve("tinymce.geom.Rect"),NO=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),RO=tinymce.util.Tools.resolve("tinymce.util.Observable"),zO=tinymce.util.Tools.resolve("tinymce.util.VK"),BO=function(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]};function IO(t,e){var n,r,o,i,u=e.document||document,a=u.getElementById(e.handle||t),c=function(t){if(BO(t),t.button!==r)return s(t);t.deltaX=t.screenX-o,t.deltaY=t.screenY-i,t.preventDefault(),e.drag(t)},s=function(t){BO(t),NO(u).off("mousemove touchmove",c).off("mouseup touchend",s),n.remove(),e.stop&&e.stop(t)};return NO(a).on("mousedown touchstart",(function(t){var l,f=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),u=e(n.offsetWidth,r.offsetWidth),a=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight);return{width:o<u?i:o,height:a<e(n.offsetHeight,r.offsetHeight)?c:a}}(u);BO(t),t.preventDefault(),r=t.button;var d=a;o=t.screenX,i=t.screenY,l=window.getComputedStyle?window.getComputedStyle(d,null).getPropertyValue("cursor"):d.runtimeStyle.cursor,n=NO("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(u.body),NO(u).on("mousemove touchmove",c).on("mouseup touchend",s),e.start(t)})),{destroy:function(){NO(a).off()}}}var PO=0,LO=function(t,e,n,r,o){var i,u="tox-crid-"+PO++,a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],c=["top","right","bottom","left"],s=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}},l=function(e,r,o,i){var u,a,c,l,f;u=r.x,a=r.y,c=r.w,l=r.h,u+=o*e.deltaX,a+=i*e.deltaY,(c+=o*e.deltaW)<20&&(c=20),(l+=i*e.deltaH)<20&&(l=20),f=t=MO.clamp({x:u,y:a,w:c,h:l},n,"move"===e.name),f=s(n,f),g.fire("updateRect",{rect:f}),m(f)},f=function(t){var n=function(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),NO("#"+u+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})};LS.each(a,(function(e){NO("#"+u+"-"+e.name,r).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)},d=function(e){f(t=e)},m=function(t){var e,r;d((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))};NO('<div id="'+u+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),LS.each(c,(function(t){NO("#"+u,r).append('<div id="'+u+"-"+t+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')})),LS.each(a,(function(t){NO("#"+u,r).append('<div id="'+u+"-"+t.name+'" class="tox-croprect-handle tox-croprect-handle-'+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')})),i=LS.map(a,(function(e){var n;return IO(u,{document:r.ownerDocument,handle:u+"-"+e.name,start:function(){n=t},drag:function(t){l(e,n,t.deltaX,t.deltaY)}})})),f(t),NO(r).on("focusin focusout",(function(t){NO(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")})),NO(r).on("keydown",(function(e){var n;LS.each(a,(function(t){if(e.target.id===u+"-"+t.name)return n=t,!1}));var r=function(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),l(n,r,o,i)};switch(e.keyCode){case zO.LEFT:r(e,0,t,-10,0);break;case zO.RIGHT:r(e,0,t,10,0);break;case zO.UP:r(e,0,t,0,-10);break;case zO.DOWN:r(e,0,t,0,10);break;case zO.ENTER:case zO.SPACEBAR:e.preventDefault(),o()}}));var g=LS.extend({toggleVisibility:function(t){var e=LS.map(a,(function(t){return"#"+u+"-"+t.name})).concat(LS.map(c,(function(t){return"#"+u+"-"+t}))).join(",");t?NO(e,r).show():NO(e,r).hide()},setClampRect:function(e){n=e,f(t)},setRect:d,getInnerRect:function(){return s(n,t)},setInnerRect:m,setViewPortRect:function(n){e=n,f(t)},destroy:function(){LS.each(i,(function(t){t.destroy()})),i=[]}},RO);return g},HO=function(t){var e=Jh({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=nn(1),r=Lc(),o=nn({x:0,y:0,w:1,h:1}),i=nn({x:0,y:0,w:1,h:1}),u=function(t,i){s.getOpt(t).each((function(t){var u=n.get(),a=Du(t.element),c=Cu(t.element),s=i.dom.naturalWidth*u,l=i.dom.naturalHeight*u,f=Math.max(0,a/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};Ji(i,m),e.getOpt(t).each((function(t){Ji(t.element,m)})),r.on((function(t){var e=o.get();t.setRect({x:e.x*u+f,y:e.y*u+d,w:e.w*u,h:e.h*u}),t.setClampRect({x:f,y:d,w:s,h:l}),t.setViewPortRect({x:0,y:0,w:a,h:c})}))}))},a=function(t,e){var r,a=on.fromTag("img");return Wo(a,"src",e),(r=a.dom,new Cp((function(t){var e=function(){r.removeEventListener("load",e),t(r)};r.complete?t(r):r.addEventListener("load",e)}))).then((function(){t.getSystem().isConnected()&&s.getOpt(t).map((function(t){var e=pu({element:a});Ug.replaceAt(t,1,B.some(e));var r=i.get(),c={x:0,y:0,w:a.dom.naturalWidth,h:a.dom.naturalHeight};i.set(c);var l=MO.inflate(c,-20,-20);o.set(l),r.w===c.w&&r.h===c.h||function(t,e){s.getOpt(t).each((function(t){var r=Du(t.element),o=Cu(t.element),i=e.dom.naturalWidth,u=e.dom.naturalHeight,a=Math.min(r/i,o/u);a>=1?n.set(1):n.set(a)}))}(t,a),u(t,a)}))}))},c=pw.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:cc([Wg("image-panel-crop-events",[ro((function(t){s.getOpt(t).each((function(t){var e=t.element.dom,i=LO({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,h);i.toggleVisibility(!1),i.on("updateRect",(function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)})),r.set(i)}))}))])])}],containerBehaviours:cc([Ug.config({}),Wg("image-panel-events",[ro((function(e){a(e,t)}))])])}),s=Jh(c);return{memContainer:s,updateSrc:a,zoom:function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),s.getOpt(t).each((function(t){var e=t.components()[1].element;u(t,e)}))},showCrop:function(){r.on((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){r.on((function(t){t.toggleVisibility(!1)}))},getRect:function(){return o.get()},getMeasurements:function(){var t=i.get();return{width:t.w,height:t.h}}}},FO=function(t,e,n,r,o){return lO({name:t,icon:B.some(e),disabled:n,tooltip:B.some(t),primary:!1,borderless:!1},r,o)},VO=function(t,e){e?Nd.enable(t):Nd.disable(t)};var jO,UO=function(t){var e,n,r,o,i=nn(t),u=Lc(),a=(n=-1,{data:e=[],add:function(t){var r=e.splice(++n);return e.push(t),{state:t,removed:r}},undo:function(){if(r())return e[--n]},redo:function(){if(o())return e[++n]},canUndo:r=function(){return n>0},canRedo:o=function(){return-1!==n&&n<e.length-1}});a.add(t);var c=function(t){i.set(t)},s=function(t){return{blob:t,url:URL.createObjectURL(t)}},l=function(t){URL.revokeObjectURL(t.url)},f=function(){u.on(l),u.clear()},d=function(t){var e=s(t);c(e);var n,r=a.add(e).removed;return n=r,LS.each(n,l),e.url};return{getBlobState:function(){return i.get()},setBlobState:c,addBlobState:d,getTempState:function(){return u.get().getOrThunk(i.get)},updateTempState:function(t){var e=s(t);return f(),u.set(e),e.url},addTempState:function(t){var e=s(t);return u.set(e),e.url},applyTempState:function(t){return u.get().fold(h,(function(e){d(e.blob),t()}))},destroyTempState:f,undo:function(){var t=a.undo();return c(t),t.url},redo:function(){var t=a.redo();return c(t),t.url},getHistoryStates:function(){return{undoEnabled:a.canUndo(),redoEnabled:a.canRedo()}}}},WO=function(t,e){var n=UO(t.currentState),r=function(t){var e=n.getHistoryStates();d.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),Vr(t,AO.formActionEvent,{name:AO.saveState(),value:e.undoEnabled})},o=function(t){return t.toBlob()},i=function(t){Vr(t,AO.formActionEvent,{name:AO.disable(),value:{}})},u=function(t){m.getApplyButton(t).each((function(t){Nd.enable(t)})),Vr(t,AO.formActionEvent,{name:AO.enable(),value:{}})},a=function(t,e){return i(t),f.updateSrc(t,e)},c=function(t,e,n,c,s){i(t),function(t){return gk(t)}(e).then(n).then(o).then(c).then((function(e){return a(t,e)})).then((function(){r(t),s(),u(t)})).catch((function(e){console.log(e),t.getSystem().isConnected()&&u(t)}))},s=function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,(function(t){return n.updateTempState(t)}),r)},l=function(t){var e=n.getBlobState().url;return n.destroyTempState(),r(t),e},f=HO(t.currentState.url),d=function(t){var e=Jh(FO("Undo","undo",!0,(function(t){Vr(t,OO.undo(),{direction:1})}),t)),n=Jh(FO("Redo","redo",!0,(function(t){Vr(t,OO.redo(),{direction:1})}),t));return{container:pw.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),FO("Zoom in","zoom-in",!1,(function(t){Vr(t,OO.zoom(),{direction:1})}),t),FO("Zoom out","zoom-out",!1,(function(t){Vr(t,OO.zoom(),{direction:-1})}),t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){VO(t,r)})),n.getOpt(t).each((function(t){VO(t,o)}))}}}(e),m=DO(f,e);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[m.memContainer.asSpec(),f.memContainer.asSpec(),d.container],behaviours:cc([lf.config({store:{mode:"manual",getValue:function(){return n.getBlobState()}}}),Wg("image-tools-events",[Kr(OO.undo(),(function(t,e){var o=n.undo();a(t,o).then((function(e){u(t),r(t)}))})),Kr(OO.redo(),(function(t,e){var o=n.redo();a(t,o).then((function(e){u(t),r(t)}))})),Kr(OO.zoom(),(function(t,e){var n=e.event.direction;f.zoom(t,n)})),Kr(OO.back(),(function(t,e){!function(t){var e=l(t);a(t,e).then((function(e){u(t)}))}(t),(0,e.event.swap)(),f.hideCrop()})),Kr(OO.apply(),(function(t,e){n.applyTempState((function(){l(t),(0,e.event.swap)()}))})),Kr(OO.transform(),(function(t,e){return s(t,e.event.transform,h)})),Kr(OO.tempTransform(),(function(t,e){return function(t,e){var r=n.getTempState().blob;c(t,r,e,(function(t){return n.addTempState(t)}),h)}(t,e.event.transform)})),Kr(OO.transformApply(),(function(t,e){return function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,(function(e){var r=n.addBlobState(e);return l(t),r}),r)}(t,e.event.transform,e.event.swap)})),Kr(OO.swap(),(function(t,e){!function(t){d.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event.transform,r=e.event.swap;n.fold((function(){r()}),(function(e){s(t,e,r)}))}))]),NS()])}},qO=function(t){return!Ht(t,"items")},GO=function(t,e,n,r){return W(n,(function(n){return qO(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){lf.setValue(t,n.value),Vr(t,Aw,{name:e}),Kg.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return GO(t,e,n.items,r)}}}))},$O=function(t,e){return lt(t,(function(t){return qO(t)?Ui(t.value===e,t):$O(t.items,e)}))},XO=md({name:"HtmlSelect",configFields:[Me("options"),ff("selectBehaviours",[Kg,lf]),$e("selectClasses",[]),$e("selectAttributes",{}),Fe("data")],factory:function(t,e){var n=W(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return In("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:mf(t.selectBehaviours,[Kg.config({}),lf.config({store:T({mode:"manual",getValue:function(t){return uu(t.element)},setValue:function(e,n){Y(t.options,(function(t){return t.value===n})).isSome()&&au(e.element,n)}},r)})])}}}),KO=function(t,e){var n=t.label.map((function(t){return Ew(t,e)})),r=[Nd.config({disabled:function(){return t.disabled||e.isDisabled()}}),pb(),Lg.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Fr(t,Rw),B.some(!0)}}),Wg("textfield-change",[Kr(ur(),(function(e,n){Vr(e,Aw,{name:t.name})})),Kr(vr(),(function(e,n){Vr(e,Aw,{name:t.name})}))]),Sw.config({})],o=t.validation.map((function(t){return sx.config({getRoot:function(t){return yo(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=lf.getValue(e),r=t.validator(n);return Zw(!0===r?mt.value(n):mt.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),i=t.placeholder.fold(v({}),(function(t){return{placeholder:e.translate(t)}})),u=t.inputMode.fold(v({}),(function(t){return{inputmode:t}})),a=T(T({},i),u),c=ww.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:a,inputClasses:[t.classname],inputBehaviours:cc(Q([r,o])),selectOnFocus:!1,factory:Uw}),s=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),l=[Nd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){ww.getField(t).each(Nd.disable)},onEnabled:function(t){ww.getField(t).each(Nd.enable)}}),pb()];return Ow(n,c,s,l)},YO=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return Gr([Kr(t.event,n),oo((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Kr(t,(function(){return e.cancel()}))]})).getOr([])))}}),JO=function(t){var e=nn(null);return bi({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},QO=Object.freeze({__proto__:null,throttle:JO,init:function(t){return t.stream.streams.state(t)}}),ZO=[Ne("stream",_e("mode",{throttle:[Me("delay"),$e("stopEvent",!0),wa("streams",{setup:function(t,e){var n=t.stream,r=fp(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:JO})]})),$e("event","input"),Fe("cancelEvent"),ba("onStream")],tT=lc({fields:ZO,name:"streaming",active:YO,state:QO}),eT=function(t,e,n){var r=lf.getValue(n);lf.setValue(e,r),rT(e)},nT=function(t,e){var n=t.element,r=uu(n),o=n.dom;"number"!==qo(n,"type")&&e(o,r)},rT=function(t){nT(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},oT=function(t,e,n){if(t.selectsOver){var r=lf.getValue(e),o=t.getDisplayText(r),i=lf.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?B.some((function(){eT(0,e,n),function(t,e){nT(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):B.none()}return B.none()},iT=v("alloy.typeahead.itemexecute"),uT=v([Fe("lazySink"),Me("fetch"),$e("minChars",5),$e("responseTime",1e3),pa("onOpen"),$e("getHotspot",B.some),$e("getAnchorOverrides",v({})),$e("layouts",B.none()),$e("eventOrder",{}),en("model",{},[$e("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),$e("selectsOver",!0),$e("populateFromBrowse",!0)]),pa("onSetValue"),va("onExecute"),pa("onItemExecute"),$e("inputClasses",[]),$e("inputAttributes",{}),$e("inputStyles",{}),$e("matchWidth",!0),$e("useMinWidth",!1),$e("dismissOnBlur",!0),ga(["openClass"]),Fe("initialData"),ff("typeaheadBehaviours",[Kg,lf,tT,Lg,ah,dx]),Ae("previewing",(function(){return nn(!0)}))].concat(Hw()).concat(_x())),aT=v([Ff({schema:[ma()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){oT(t.model,r,n).fold((function(){return Ud.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&eT(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return Vr(t,iT(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&eT(t.model,e,n)}))}}}})]),cT=gd({name:"Typeahead",configFields:uT(),partFields:aT(),factory:function(t,e,n,r){var o=function(e,n,o){t.previewing.set(!1);var i=dx.getCoupled(e,"sandbox");if(Ul.isOpen(i))bd.getCurrent(i).each((function(t){Ud.getHighlighted(t).fold((function(){o(t)}),(function(){qr(i,t.element,"keydown",n)}))}));else{yx(t,u(e),e,i,r,(function(t){bd.getCurrent(t).each(o)}),Gw.HighlightFirst).get(h)}},i=Fw(t),u=function(t){return function(e){return e.map((function(e){var n=Pt(e.menus),r=Z(n,(function(t){return $(t.items,(function(t){return"item"===t.type}))}));return lf.getState(t).update(W(r,(function(t){return t.data}))),e}))}},a=[Kg.config({}),lf.config({onSetValue:t.onSetValue,store:T({mode:"dataset",getDataKey:function(t){return uu(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){au(e.element,t.model.getDisplayText(n))}},t.initialData.map((function(t){return In("initialValue",t)})).getOr({}))}),tT.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,n){var o=dx.getCoupled(e,"sandbox");if(Kg.isFocused(e)&&uu(e.element).length>=t.minChars){var i=bd.getCurrent(o).bind((function(t){return Ud.getHighlighted(t).map(lf.getValue)}));t.previewing.set(!0);yx(t,u(e),e,o,r,(function(e){bd.getCurrent(o).each((function(e){i.fold((function(){t.model.selectsOver&&Ud.highlightFirst(e)}),(function(t){Ud.highlightBy(e,(function(e){return lf.getValue(e).value===t.value})),Ud.getHighlighted(e).orThunk((function(){return Ud.highlightFirst(e),B.none()}))}))}))}),Gw.HighlightFirst).get(h)}},cancelEvent:kr()}),Lg.config({mode:"special",onDown:function(t,e){return o(t,e,Ud.highlightFirst),B.some(!0)},onEscape:function(t){var e=dx.getCoupled(t,"sandbox");return Ul.isOpen(e)?(Ul.close(e),B.some(!0)):B.none()},onUp:function(t,e){return o(t,e,Ud.highlightLast),B.some(!0)},onEnter:function(e){var n=dx.getCoupled(e,"sandbox"),r=Ul.isOpen(n);if(r&&!t.previewing.get())return bd.getCurrent(n).bind((function(t){return Ud.getHighlighted(t)})).map((function(t){return Vr(e,iT(),{item:t}),!0}));var o=lf.getValue(e);return Fr(e,kr()),t.onExecute(n,e,o),r&&Ul.close(n),B.some(!0)}}),ah.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),dx.config({others:{sandbox:function(e){return Ox(t,e,{onOpen:function(){return ah.on(e)},onClose:function(){return ah.off(e)}})}}}),Wg("typeaheadevents",[uo((function(e){var n=h;xx(t,u(e),e,r,n,Gw.HighlightFirst).get(h)})),Kr(iT(),(function(e,n){var r=dx.getCoupled(e,"sandbox");eT(t.model,e,n.event.item),Fr(e,kr()),t.onItemExecute(e,r,n.event.item,lf.getValue(e)),Ul.close(r),rT(e)}))].concat(t.dismissOnBlur?[Kr(pr(),(function(t){var e=dx.getCoupled(t,"sandbox");yc(e.element).isNone()&&Ul.close(e)}))]:[]))];return{uid:t.uid,dom:jw(jt(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:T(T({},i),mf(t.typeaheadBehaviours,a)),eventOrder:t.eventOrder}}}),sT=function(t){return T(T({},t),{toCached:function(){return sT(t.toCached())},bindFuture:function(e){return sT(t.bind((function(t){return t.fold((function(t){return Zw(mt.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return sT(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return sT(t.map((function(t){return t.map(e)})))},mapError:function(e){return sT(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(e,n){return sT(Qw((function(r){var o=!1,i=setTimeout((function(){o=!0,r(mt.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},lT=function(t){return sT(Qw(t))},fT=lT,dT={type:"separator"},mT=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:h}},gT=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:h}},hT=function(t,e){return function(t){return W(t,mT)}(function(t,e){return $(e,(function(e){return e.type===t}))}(t,e))},pT=function(t){return hT("header",t.targets)},vT=function(t){return hT("anchor",t.targets)},bT=function(t){return B.from(t.anchorTop).map((function(t){return gT("<top>",t)})).toArray()},yT=function(t){return B.from(t.anchorBottom).map((function(t){return gT("<bottom>",t)})).toArray()},wT=function(t,e){var n=t.toLowerCase();return $(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return fn(e.toLowerCase(),n)||fn(t.value.toLowerCase(),n)}))},xT=function(t,e,n){var r=lf.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=wT(o,function(t){return W(t,(function(t){return gT(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,wT(o,pT(e)),wT(o,Q([bT(e),vT(e),yT(e)]))],K(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(dT,e)}),[])):i}))},CT=ei("aria-invalid"),ST=function(t){return function(e,n,r){return Lt(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},kT={bar:ST((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:W(t.items,e.interpreter)}}(t,e.shared)})),collection:ST((function(t,e){return Lw(t,e.shared.providers)})),alertbanner:ST((function(t,e){return function(t,e){return pw.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Yh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:rp(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Vr(e,Nw,{name:"alert-banner",value:t.url})},buttonBehaviours:cc([op()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:ST((function(t,e){return function(t,e){return KO({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:B.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:ST((function(t,e){return function(t,e){return KO({name:t.name,multiline:!0,label:t.label,inputMode:B.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:B.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:ST((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=W(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:cc([NS(),Ug.config({}),WS(B.none()),Lg.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=jt(n,{source:"dynamic"});return ST(t)(e,o,r)}}((function(t,e){return ek(t,e.shared.providers)})),button:ST((function(t,e){return hO(t,e.shared.providers)})),checkbox:ST((function(t,e){return function(t,e){var n=lf.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),r=function(t){return t.element.dom.click(),B.some(!0)},o=ww.parts.field({factory:{sketch:b},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:cc([NS(),Nd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Sw.config({}),Kg.config({}),n,Lg.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Wg("checkbox-events",[Kr(ar(),(function(e,n){Vr(e,Aw,{name:t.name})}))])])}),i=ww.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:cc([Nx.config({})])}),u=function(t){return up("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},a=Jh({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[u("checked"),u("unchecked")]});return ww.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,a.asSpec(),i],fieldBehaviours:cc([Nd.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){ww.getField(t).each(Nd.disable)},onEnabled:function(t){ww.getField(t).each(Nd.enable)}}),pb()])})}(t,e.shared.providers)})),colorinput:ST((function(t,e){return Ix(t,e.shared,e.colorinput)})),colorpicker:ST((function(t){var e=function(t){return"tox-"+t},n=MS(IS,e),r=Jh(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Vr(t,Nw,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Vr(t,Nw,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:cc([lf.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return bd.getCurrent(e).bind((function(t){return lf.getValue(t).hex})).map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);bd.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){lf.setValue(t,{hex:B.from(n[1]).getOr("")}),OS.getField(t,"hex").each((function(t){Fr(t,ur())}))}))}}}),NS()])}})),dropzone:ST((function(t,e){return GS(t,e.shared.providers)})),grid:ST((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:W(t.items,e.interpreter)}}(t,e.shared)})),listbox:ST((function(t,e){return function(t,e){var n=e.shared.providers,r=at(t.items).filter(qO),o=t.label.map((function(t){return Ew(t,n)})),i={dom:{tag:"div",classes:["tox-listboxfield"]},components:[ww.parts.field({dom:{},factory:{sketch:function(n){return Qk({uid:n.uid,text:r.map((function(t){return t.text})),icon:B.none(),tooltip:t.label,role:B.none(),fetch:function(n,r){var o=GO(n,t.name,t.items,lf.getValue(n));r(oO(o,Xp.CLOSE_ON_EXECUTE,e,!1))},onSetup:v(h),getApi:v({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Sw.config({}),lf.config({store:{mode:"manual",initialValue:r.map((function(t){return t.value})).getOr(""),getValue:function(t){return qo(t.element,"data-value")},setValue:function(e,n){$O(t.items,n).each((function(t){Wo(e.element,"data-value",t.value),Vr(e,Yk,{text:t.text})}))}}})]},"tox-listbox",e.shared)}}})]};return ww.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Q([o.toArray(),[i]]),fieldBehaviours:cc([Nd.config({disabled:v(t.disabled),onDisabled:function(t){ww.getField(t).each(Nd.disable)},onEnabled:function(t){ww.getField(t).each(Nd.enable)}})])})}(t,e)})),selectbox:ST((function(t,e){return function(t,e){var n=W(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return Ew(t,e)})),o=ww.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:XO,selectBehaviours:cc([Nd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Sw.config({}),Wg("selectbox-change",[Kr(ar(),(function(e,n){Vr(e,Aw,{name:t.name})}))])])}),i=t.size>1?B.none():B.some(up("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),u={dom:{tag:"div",classes:["tox-selectfield"]},components:Q([[o],i.toArray()])};return ww.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Q([r.toArray(),[u]]),fieldBehaviours:cc([Nd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){ww.getField(t).each(Nd.disable)},onEnabled:function(t){ww.getField(t).each(Nd.enable)}}),pb()])})}(t,e.shared.providers)})),sizeinput:ST((function(t,e){return kO(t,e.shared.providers)})),urlinput:ST((function(t,e){return function(t,e,n){var r,o=e.shared.providers,i=function(e){var r=lf.getValue(e);n.addToHistory(r.value,t.filetype)},u=ww.parts.field({factory:cT,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":CT,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=xT(t.filetype,r,n),i=oO(o,Xp.BUBBLE_TO_SANDBOX,e,!1);return Zw(i)},getHotspot:function(t){return d.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(sx)&&sx.run(t).get(h)},typeaheadBehaviours:cc(Q([n.getValidationHandler().map((function(e){return sx.config({getRoot:function(t){return yo(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){c.getOpt(t).each((function(t){Wo(t.element,"title",o.translate(e))}))}},validator:{validate:function(n){var r=lf.getValue(n);return fT((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=mt.error(t.message);n(e)}else{var r=mt.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[Nd.config({disabled:function(){return t.disabled||o.isDisabled()}}),Sw.config({}),Wg("urlinput-events",Q(["file"===t.filetype?[Kr(ur(),(function(e){Vr(e,Aw,{name:t.name})}))]:[],[Kr(ar(),(function(e){Vr(e,Aw,{name:t.name}),i(e)})),Kr(vr(),(function(e){Vr(e,Aw,{name:t.name}),i(e)}))]]))]])),eventOrder:(r={},r[ur()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:iv(0,0,"normal")},onExecute:function(t,e,n){Vr(e,Rw,{})},onItemExecute:function(e,n,r,o){i(e),Vr(e,Aw,{name:t.name})}}),a=t.label.map((function(t){return Ew(t,o)})),c=Jh(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),up(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:T({title:o.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))},o.icons)}("invalid",B.some(CT),"warning")),s=Jh({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),l=n.getUrlPicker(t.filetype),f=ei("browser.url.event"),d=Jh({dom:{tag:"div",classes:["tox-control-wrap"]},components:[u,s.asSpec()],behaviours:cc([Nd.config({disabled:function(){return t.disabled||o.isDisabled()}})])}),m=Jh(dO({name:t.name,icon:B.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return Fr(t,f)}),o,[],["tox-browse-url"]));return ww.sketch({dom:_w([]),components:a.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Q([[d.asSpec()],l.map((function(){return m.asSpec()})).toArray()])}]),fieldBehaviours:cc([Nd.config({disabled:function(){return t.disabled||o.isDisabled()},onDisabled:function(t){ww.getField(t).each(Nd.disable),m.getOpt(t).each(Nd.disable)},onEnabled:function(t){ww.getField(t).each(Nd.enable),m.getOpt(t).each(Nd.enable)}}),pb(),Wg("url-input-events",[Kr(f,(function(e){bd.getCurrent(e).each((function(n){var r=lf.getValue(n),o=T({fieldname:t.name},r);l.each((function(r){r(o).get((function(r){lf.setValue(n,r),Vr(e,Aw,{name:t.name})}))}))}))}))])])})}(t,e,e.urlinput)})),customeditor:ST((function(t){var e=Lc(),n=Jh({dom:{tag:t.tag}}),r=Lc();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:cc([Wg("custom-editor-events",[ro((function(o){n.getOpt(o).each((function(n){(!function(t){return Ht(t,"init")}(t)?PS.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)})):t.init(n.element.dom)).then((function(t){r.on((function(e){t.setValue(e)})),r.clear(),e.set(t)}))}))}))]),lf.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(n)}),(function(t){return t.setValue(n)}))}}}),NS()]),components:[n.asSpec()]}})),htmlpanel:ST((function(t){return"presentation"===t.presets?pw.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):pw.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:cc([Sw.config({}),Kg.config({})])})})),imagetools:ST((function(t,e){return WO(t,e.shared.providers)})),table:ST((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},u=function(t){return{dom:{tag:"tr"},components:W(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:W(r,o)}]}),(n=t.cells,{dom:{tag:"tbody"},components:W(n,u)})],behaviours:cc([Sw.config({}),Kg.config({})])}}(t,e.shared.providers)})),panel:ST((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:W(t.items,e.shared.interpreter)}}(t,e)}))},OT={field:function(t,e){return e}},TT=function(t,e,n){var r=jt(n,{shared:{interpreter:function(e){return _T(t,e,r)}}});return _T(t,e,r)},_T=function(t,e,n){return Lt(kT,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},ET={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},AT=function(t,e,n){var r={maxHeightFunction:Zc()};return function(){return n()?{type:"node",root:Ao(t()),node:B.from(t()),bubble:rs(12,12,ET),layouts:{onRtl:function(){return[Fh]},onLtr:function(){return[Hh]}},overrides:r}:{type:"hotspot",hotspot:e(),bubble:rs(-12,12,ET),layouts:{onRtl:function(){return[ja]},onLtr:function(){return[Ua]}},overrides:r}}},DT=function(t,e,n){return function(){return n()?{type:"node",root:Ao(t()),node:B.from(t()),layouts:{onRtl:function(){return[Vh]},onLtr:function(){return[Vh]}}}:{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[$a]},onLtr:function(){return[$a]}}}}},MT=function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return B.some(As.range(on.fromDom(e.startContainer),e.startOffset,on.fromDom(e.endContainer),e.endOffset))}}}},NT=function(t){return function(e){return{type:"node",root:t(),node:e}}},RT=function(t,e,n){var r=ib(t),o=function(){return on.fromDom(t.getBody())},i=function(){return on.fromDom(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:AT(i,e,u),banner:DT(i,e,u),cursor:MT(t,o),node:NT(o)}},zT=function(t){return function(e,n){Ny(t)(e,n)}},BT=function(t){return function(){return xy(t)}},IT=function(t){return function(){return Cy(t)}},PT=function(t){return function(){return ky(t)}},LT=function(t){return{colorPicker:zT(t),hasCustomColors:BT(t),getColors:IT(t),getColorCols:PT(t)}},HT=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},FT=function(t){return{isDraggableModal:HT(t)}},VT=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],jT=function(t){return K(t,(function(t,e){if(Ht(e,"items")){var n=jT(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(function(t){return Ht(t,"inline")}(e)||function(t){return Ht(t,"block")}(e)||function(t){return Ht(t,"selector")}(e)){var r="custom-"+(o(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:r,format:e}]),formats:t.formats.concat([{title:e.title,format:r,icon:e.icon}])}}return T(T({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},UT=function(t){return function(t){return B.from(t.getParam("style_formats")).filter(u)}(t).map((function(e){var n=function(t,e){var n=jT(e),r=function(e){q(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?VT.concat(n):n})).getOr(VT)},WT=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return jt(t,r)},qT=function(t,e,n,r){var i=function(e){return W(e,(function(e){var u=At(e);if(Ft(e,"items")){var a=i(e.items);return jt(function(t){return jt(t,{type:"submenu"})}(e),{getStyleItems:v(a)})}return Ft(e,"format")?function(t){return WT(t,n,r)}(e):1===u.length&&F(u,"title")?jt(e,{type:"separator"}):function(e){var i=o(e.name)?e.name:ei(e.title),u="custom-"+i,a={type:"formatter",format:u,isSelected:n(u),getStylePreview:r(u)},c=jt(e,a);return t.formatter.register(i,c),c}(e)}))};return i(e)},GT=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?B.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):B.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?Z(e,r):[t.format]},o=nn([]),i=nn([]),u=nn([]),a=nn([]),c=nn(!1);t.on("PreInit",(function(u){var a=UT(t),c=qT(t,a,e,n);o.set(c),i.set(Z(c,r))})),t.on("addStyleModifications",(function(o){var i=qT(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(Z(i,r))}));return{getData:function(){var t=c.get()?[]:o.get(),e=u.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=a.get();return t.concat(e)}}},$T=LS.trim,XT=function(t){return function(e){if(function(t){return f(t)&&1===t.nodeType}(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},KT=XT("true"),YT=XT("false"),JT=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},QT=function(t){return t.innerText||t.textContent},ZT=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&e_(t)},t_=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},e_=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return KT(t)}return!1}(t)&&!YT(t)},n_=function(t){return t_(t)&&e_(t)},r_=function(t){var e=function(t){return t.id?t.id:ei("h")}(t);return JT("header",QT(t),"#"+e,function(t){return t_(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},o_=function(t){var e=t.id||t.name,n=QT(t);return JT("anchor",n||"#"+e,"#"+e,0,h)},i_=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,W(Us(on.fromDom(n),e),(function(t){return t.dom}))},u_=function(t){return $T(t.title).length>0},a_=function(t){var e=i_(t);return $(function(t){return W($(t,n_),r_)}(e).concat(function(t){return W($(t,ZT),o_)}(e)),u_)},c_="tinymce-url-history",s_=function(t){return o(t)&&/^https?/.test(t)},l_=function(t){return i(t)&&It(t,(function(t){return!(u(e=t)&&e.length<=5&&tt(e,s_));var e})).isNone()},f_=function(){var t,e=py.getItem(c_);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+c_+" was not valid JSON",t),{};throw t}return l_(t)?t:(console.log("Local storage "+c_+" was not valid format",t),{})},d_=function(t){var e=f_();return Lt(e,t).getOr([])},m_=function(t,e){if(s_(t)){var n=f_(),r=Lt(n,e).getOr([]),o=$(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!l_(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));py.setItem(c_,JSON.stringify(t))}(n)}},g_=function(t){return!!t},h_=function(t){return Nt(LS.makeMap(t,/[, ]/),g_)},p_=function(t){return B.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(d)},v_=function(t,e){var n=function(t){var e=B.some(function(t){return t.getParam("file_picker_types")}(t)).filter(g_),n=B.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(g_),r=e.or(n).map(h_);return p_(t).fold(S,(function(t){return r.fold(k,(function(t){return At(t).length>0&&t}))}))}(t);return c(n)?n?p_(t):B.none():n[e]?p_(t):B.none()},b_=function(t){return B.from(t).filter(o).getOrUndefined()},y_=function(t){return{getHistory:d_,addToHistory:m_,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?B.none():B.some({targets:a_(t.getBody()),anchorTop:b_(fb(t)),anchorBottom:b_(db(t))})}(t)},getValidationHandler:function(){return function(t){return B.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return v_(t,e).map((function(n){return function(r){return Qw((function(u){var a=T({filetype:e,fieldname:r.fieldname},B.from(r.meta).getOr({}));n.call(t,(function(t,e){if(!o(t))throw new Error("Expected value to be string");if(void 0!==e&&!i(e))throw new Error("Expected meta to be a object");u({value:t,meta:e})}),r.value,a)}))}}))}(t,e)}}},w_=function(t,e,n){var r=nn(!1),o=function(t){var e=nn(rb(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:Qh.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return _T(OT,t,e)}(t,i)},anchors:RT(e,n,o.isPositionedAtTop),header:o,getSink:function(){return mt.value(t)}},urlinput:y_(e),styleselect:GT(e),colorinput:LT(e),dialog:FT(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},x_=ad,C_=Wf,S_=v([$e("shell",!1),Me("makeItem"),$e("setupItem",h),gf("listBehaviours",[Ug])]),k_=Vf({name:"items",overrides:function(){return{behaviours:cc([Ug.config({})])}}}),O_=v([k_]),T_=v("CustomList"),__=gd({name:T_(),configFields:S_(),partFields:O_(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[Ug.config({})],components:[]}:{behaviours:[],components:e},i=function(e){return t.shell?B.some(e):Zf(e,t,"items")};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:mf(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){i(e).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(r){var o=Ug.contents(r),i=n.length,u=i-o.length,a=u>0?j(u,(function(){return t.makeItem()})):[],c=o.slice(i);q(c,(function(t){return Ug.remove(r,t)})),q(a,(function(t){return Ug.append(r,t)}));var s=Ug.contents(r);q(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),E_=v([Me("dom"),$e("shell",!0),ff("toolbarBehaviours",[Ug])]),A_=v([Vf({name:"groups",overrides:function(){return{behaviours:cc([Ug.config({})])}}})]),D_=gd({name:"Toolbar",configFields:E_(),partFields:A_(),factory:function(t,e,n,r){var o=function(e){return t.shell?B.some(e):Zf(e,t,"groups")},i=t.shell?{behaviours:[Ug.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:mf(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){o(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){Ug.set(t,e)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),M_=h,N_=S,R_=v([]),z_=Object.freeze({__proto__:null,setup:M_,isDocked:N_,getBehaviours:R_}),B_=function(t){return(Fi(eu(t,"position"),"fixed")?B.none():wo(t)).orThunk((function(){var e=on.fromTag("span");return yo(t).bind((function(t){Io(t,e);var n=wo(e);return Ho(e),n}))}))},I_=function(t){return B_(t).map(_u).getOrThunk((function(){return Ou(0,0)}))},P_=zn([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),L_=function(t,e){var n=t.element;zi(n,e.transitionClass),Ii(n,e.fadeOutClass),zi(n,e.fadeInClass),e.onShow(t)},H_=function(t,e){var n=t.element;zi(n,e.transitionClass),Ii(n,e.fadeInClass),zi(n,e.fadeOutClass),e.onHide(t)},F_=function(t,e,n){return tt(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},V_=function(t,e){return e.getInitialPos().map((function(e){return ju(e.bounds.x,e.bounds.y,Du(t),Cu(t))}))},j_=function(t,e,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return B.some(P_.static());case"absolute":var o=B_(t).map(Uu).getOrThunk((function(){return Uu(Gi())}));return B.some(P_.absolute(xc("absolute",Lt(r.style,"left").map((function(t){return e.x-o.x})),Lt(r.style,"top").map((function(t){return e.y-o.y})),Lt(r.style,"right").map((function(t){return o.right-e.right})),Lt(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return B.none()}}))},U_=function(t,e,n){var r=Uu(t);if(F_(n.getModes(),r,e))return B.none();!function(t,e,n){n.setInitialPos({style:nu(t),position:Zi(t,"position")||"static",bounds:e})}(t,r,n);var o=qu(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return B.some(P_.fixed(xc("fixed",B.some(i),c?B.some(u):B.none(),B.none(),c?B.none():B.some(a))))},W_=function(t,e,n){var r=t.element;return Fi(eu(r,"position"),"fixed")?function(t,e,n){return V_(t,n).filter((function(t){return F_(n.getModes(),t,e)})).bind((function(e){return j_(t,e,n)}))}(r,e,n):U_(r,e,n)},q_=function(t,e){q(["left","right","top","bottom","position"],(function(e){return ou(t.element,e)})),e.onUndocked(t)},G_=function(t,e,n){Cc(t.element,n),("fixed"===n.position?e.onDocked:e.onUndocked)(t)},$_=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var u=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);u!==n.isVisible()&&(n.setVisible(u),o&&!u?(Li(t.element,[e.fadeOutClass]),e.onHide(t)):(u?L_:H_)(t,e))}))}))},X_=function(t,e,n){var r=t.element;n.setDocked(!1),function(t,e){var n=t.element;return V_(n,e).bind((function(t){return j_(n,t,e)}))}(t,n).each((function(n){n.fold((function(){return q_(t,e)}),(function(n){return G_(t,e,n)}),h)})),n.setVisible(!0),e.contextual.each((function(e){Hi(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),K_(t,e,n)},K_=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&$_(t,e,n,r),W_(t,r,n).each((function(i){n.setDocked(!o),i.fold((function(){return q_(t,e)}),(function(n){return G_(t,e,n)}),(function(o){$_(t,e,n,r,!0),G_(t,e,o)}))}))}(t,e,n)},Y_=function(t,e,n){n.isDocked()&&X_(t,e,n)},J_=Object.freeze({__proto__:null,refresh:K_,reset:Y_,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),Q_=Object.freeze({__proto__:null,events:function(t,e){return Gr([no(lr(),(function(n,r){t.contextual.each((function(t){Pi(n.element,t.transitionClass)&&(Hi(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n));r.stop()}))})),Kr(Er(),(function(n,r){K_(n,t,e)})),Kr(Ar(),(function(n,r){Y_(n,t,e)}))])}}),Z_=[Ge("contextual",[ze("fadeInClass"),ze("fadeOutClass"),ze("transitionClass"),Ie("lazyContext"),pa("onShow"),pa("onShown"),pa("onHide"),pa("onHidden")]),Ze("lazyViewport",qu),tn("modes",["top","bottom"],ge),pa("onDocked"),pa("onUndocked")],tE=lc({fields:Z_,name:"docking",active:Q_,apis:J_,state:Object.freeze({__proto__:null,init:function(t){var e=nn(!1),n=nn(!0),r=Lc(),o=nn(t.modes);return bi({isDocked:e.get,setDocked:e.set,getInitialPos:r.get,setInitialPos:r.set,clearInitialPos:r.clear,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked:  "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),eE=v(ei("toolbar-height-change")),nE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},rE=function(t,e){return F(tE.getModes(t),e)},oE=function(t){var e=t.element;yo(e).each((function(n){var r="padding-"+tE.getModes(t)[0];if(tE.isDocked(t)){var o=Du(n);Yi(e,"width",o+"px"),Yi(n,r,function(t){return Su(t)+(parseInt(Zi(t,"margin-top"),10)||0)+(parseInt(Zi(t,"margin-bottom"),10)||0)}(e)+"px")}else ou(e,"width"),ou(n,r)}))},iE=function(t,e){e?(Ii(t,nE.fadeOutClass),Li(t,[nE.transitionClass,nE.fadeInClass])):(Ii(t,nE.fadeInClass),Li(t,[nE.fadeOutClass,nE.transitionClass]))},uE=function(t,e){var n=on.fromDom(t.getContainer());e?(zi(n,"tox-tinymce--toolbar-sticky-on"),Ii(n,"tox-tinymce--toolbar-sticky-off")):(zi(n,"tox-tinymce--toolbar-sticky-off"),Ii(n,"tox-tinymce--toolbar-sticky-on"))},aE=function(t,e){var n=Lc(),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||oE(e),uE(t,tE.isDocked(e)),e.getSystem().broadcastOn([ql()],{}),r().each((function(t){return t.getSystem().broadcastOn([ql()],{})}))},u=t.inline?[]:function(){var t;return[gc.config({channels:(t={},t[eE()]={onReceive:oE},t)})]}();return E([Kg.config({}),tE.config({contextual:T({lazyContext:function(e){var n=Su(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=Uu(on.fromDom(r)),i=o.height-n,u=o.y+(rE(e,"top")?0:n);return B.some(ju(o.x,u,o.width,i))},onShow:function(){o((function(t){return iE(t,!0)}))},onShown:function(t){o((function(t){return Hi(t,[nE.transitionClass,nE.fadeInClass])})),n.get().each((function(e){var r,o,i;r=t.element,i=ho(o=e),bc(i).filter((function(t){return!Mn(o,t)})).filter((function(t){return Mn(t,on.fromDom(i.dom.body))||Rn(r,t)})).each((function(){return pc(o)})),n.clear()}))},onHide:function(t){(function(t,e){return yc(t).orThunk((function(){return e().toOptional().bind((function(t){return yc(t.element)}))}))})(t.element,r).fold(n.clear,n.set),o((function(t){return iE(t,!1)}))},onHidden:function(){o((function(t){return Hi(t,[nE.transitionClass])}))}},nE),lazyViewport:function(e){var n=qu(),r=function(t){return t.getParam("toolbar_sticky_offset",0,"number")}(t),o=n.y+(rE(e,"top")?r:0),i=n.height-(rE(e,"bottom")?r:0);return ju(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],u)},cE=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(tE.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(oE)})),t.on("SkinLoaded",(function(){n().each((function(t){tE.isDocked(t)?tE.reset(t):tE.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(tE.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){tE.refresh(e);var n=e.element;Nm(n)&&function(t,e){var n=ho(e),r=n.dom.defaultView.innerHeight,o=Bu(n),i=on.fromDom(t.elm),u=Wu(i),a=Cu(i),c=u.y,s=c+a,l=_u(e),f=Cu(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&c<m)Iu(o.left,c-f,n);else if(h&&s>d){var p=c-r+a+f;Iu(o.left,p,n)}}(t,n)}))})),t.on("PostRender",(function(){uE(t,!1)}))},isDocked:function(t){return t().map(tE.isDocked).getOr(!1)},getBehaviours:aE}),sE=ue([ze("type"),Ne("items",ce([le([ze("name"),He("items",ge)]),ge]))].concat(Np)),lE=[Ue("text"),Ue("tooltip"),Ue("icon"),Ie("fetch"),Ze("onSetup",(function(){return h}))],fE=ue(E([ze("type")],lE)),dE=function(t){return Se("menubutton",fE,t)},mE=ue([ze("type"),Ue("tooltip"),Ue("icon"),Ue("text"),We("select"),Ie("fetch"),Ze("onSetup",(function(){return h})),Je("presets","normal",["normal","color","listpreview"]),$e("columns",1),Ie("onAction"),Ie("onItemAction")]),gE=md({factory:function(t,e){var n={focus:Lg.focusIn,setMenus:function(t,n){var r=W(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=dE(n).mapError((function(t){return Te(t)})).getOrDie();return uO(r,"tox-mbtn",e.backstage,B.some("menuitem"))}));Ug.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:cc([Ug.config({}),Wg("menubar-events",[ro((function(e){t.onSetup(e)})),Kr(er(),(function(t,e){Zu(t.element,".tox-mbtn--active").each((function(n){ta(e.event.target,".tox-mbtn").each((function(e){Mn(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){Dx.expand(t),Dx.close(n),Kg.focus(t)}))}))}))}))})),Kr(zr(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){Dx.isOpen(n)&&(Dx.expand(t),Dx.close(n))}))}))}))]),Lg.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),B.some(!0)}}),Sw.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Me("dom"),Me("uid"),Me("onEscape"),Me("backstage"),$e("onSetup",h)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),hE=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},pE=function(t){return t.dimension.property},vE=function(t,e){return t.dimension.getDimension(e)},bE=function(t,e){var n=hE(t,e);Hi(n,[e.shrinkingClass,e.growingClass])},yE=function(t,e){Ii(t.element,e.openClass),zi(t.element,e.closedClass),Yi(t.element,pE(e),"0px"),iu(t.element)},wE=function(t,e){Ii(t.element,e.closedClass),zi(t.element,e.openClass),ou(t.element,pE(e))},xE=function(t,e,n,r){n.setCollapsed(),Yi(t.element,pE(e),vE(e,t.element)),iu(t.element),bE(t,e),yE(t,e),e.onStartShrink(t),e.onShrunk(t)},CE=function(t,e,n,r){var o=r.getOrThunk((function(){return vE(e,t.element)}));n.setCollapsed(),Yi(t.element,pE(e),o),iu(t.element);var i=hE(t,e);Ii(i,e.growingClass),zi(i,e.shrinkingClass),yE(t,e),e.onStartShrink(t)},SE=function(t,e,n){var r=vE(e,t.element);("0px"===r?xE:CE)(t,e,n,B.some(r))},kE=function(t,e,n){var r=hE(t,e),o=Pi(r,e.shrinkingClass),i=vE(e,t.element);wE(t,e);var u=vE(e,t.element);(o?function(){Yi(t.element,pE(e),i),iu(t.element)}:function(){yE(t,e)})(),Ii(r,e.shrinkingClass),zi(r,e.growingClass),wE(t,e),Yi(t.element,pE(e),u),n.setExpanded(),e.onStartGrow(t)},OE=function(t,e,n){var r=hE(t,e);return!0===Pi(r,e.growingClass)},TE=function(t,e,n){var r=hE(t,e);return!0===Pi(r,e.shrinkingClass)},_E=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){ou(t.element,pE(e));var r=vE(e,t.element);Yi(t.element,pE(e),r)}},grow:function(t,e,n){n.isExpanded()||kE(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&SE(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&xE(t,e,n)},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:OE,isShrinking:TE,isTransitioning:function(t,e,n){return OE(t,e)||TE(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?SE:kE)(t,e,n)},disableTransitions:bE}),EE=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return wi(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:In(e.dimension.property,"0px")})},events:function(t,e){return Gr([no(lr(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(bE(n,t),e.isExpanded()&&ou(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),AE=[Me("closedClass"),Me("openClass"),Me("shrinkingClass"),Me("growingClass"),Fe("getAnimationRoot"),pa("onShrunk"),pa("onStartShrink"),pa("onGrown"),pa("onStartGrow"),$e("expanded",!1),Ne("dimension",_e("property",{width:[wa("property","width"),wa("getDimension",(function(t){return Du(t)+"px"}))],height:[wa("property","height"),wa("getDimension",(function(t){return Cu(t)+"px"}))]}))],DE=lc({fields:AE,name:"sliding",active:EE,apis:_E,state:Object.freeze({__proto__:null,init:function(t){var e=nn(t.expanded);return bi({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:w(e.set,!1),setExpanded:w(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),ME=[ff("slotBehaviours",[])],NE=function(t){return"<alloy.field."+t+">"},RE=function(t,e){var n,r=function(e){return rd(t)},o=function(e,n){return function(r,o){return Zf(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==qo(t.element,"aria-hidden")},u=o(i,!1),a=o((function(t,e){if(i(t)){var n=t.element;Yi(n,"display","none"),Wo(n,"aria-hidden","true"),Vr(t,Br(),{name:e,visible:!1})}})),c=(n=a,function(t,e){q(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;ou(n,"display"),Xo(n,"aria-hidden"),Vr(t,Br(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return Zf(e,t,n)},isShowing:u,hideSlot:a,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:df(t.slotBehaviours),apis:l}},zE=Nt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return pi(t)})),BE=T(T({},zE),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),Xf("container",NE(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=W(r,(function(t){return Hf({name:t,pname:NE(t)})}));return sd("container",ME,o,RE,n)}}),IE=ue([Ue("icon"),Ue("tooltip"),Ze("onShow",h),Ze("onHide",h),Ze("onSetup",(function(){return h}))]),PE=function(t){return{element:function(){return t.element.dom}}},LE=function(t,e){var n=W(At(e),(function(t){var n=e[t],r=ke(function(t){return Se("sidebar",IE,t)}(n));return{name:t,getApi:PE,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return W(n,(function(e){var r=nn(h);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Mv([Cb(e,r),Sb(e,r),Kr(Br(),(function(t,e){var r=e.event;Y(n,(function(t){return t.name===r.name})).each((function(e){(r.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},HE=function(t){return BE.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:LE(e,t),slotBehaviours:Mv([ro((function(t){return BE.hideAllSlots(t)}))])}}))},FE=function(t){return bd.getCurrent(t).bind((function(t){return DE.isGrowing(t)||DE.hasGrown(t)?bd.getCurrent(t).bind((function(t){return Y(BE.getSlotNames(t),(function(e){return BE.isShowing(t,e)}))})):B.none()}))},VE=ei("FixSizeEvent"),jE=ei("AutoSizeEvent"),UE=Object.freeze({__proto__:null,block:function(t,e,n,r){Wo(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=cc([Lg.config({mode:"special",onTab:function(){return B.some(!0)},onShiftTab:function(){return B.some(!0)}}),Kg.config({})]),u=r(o,i),a=o.getSystem().build(u);Ug.append(o,yu(a)),a.hasConfigured(Lg)&&e.focus&&Lg.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return Ug.remove(o,a)}))},unblock:function(t,e,n){Xo(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),WE=[Ze("getRoot",B.none),Qe("focus",!0),pa("onBlock"),pa("onUnblock")],qE=lc({fields:WE,name:"blocking",apis:UE,state:Object.freeze({__proto__:null,init:function(){var t=Ic((function(t){return t.destroy()}));return bi({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),GE=function(t){var e=on.fromHtml(t),n=xo(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return K(e,(function(t,e){var n;return"class"===e.name?t:T(T({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:Vo(e)};return T({tag:co(e),classes:o,attributes:r},i)},$E=function(t){return bd.getCurrent(t).each((function(t){return pc(t.element)}))},XE=function(t,e,n,r){var o=e.element;if(function(t,e){B.from(t.iframeElement).map(on.fromDom).each((function(t){e?(Go(t,"tabindex").each((function(e){return Wo(t,"data-mce-tabindex",e)})),Wo(t,"tabindex",-1)):(Xo(t,"tabindex"),Go(t,"data-mce-tabindex").each((function(e){Wo(t,"tabindex",e),Xo(t,"data-mce-tabindex")})))}))}(t,n),n)qE.block(e,function(t){return function(e,n){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:GE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}}(r)),ou(o,"display"),Xo(o,"aria-hidden"),t.hasFocus()&&$E(e);else{var i=bd.getCurrent(e).exists((function(t){return vc(t.element)}));qE.unblock(e),Yi(o,"display","none"),Wo(o,"aria-hidden","true"),i&&t.focus()}},KE=function(t,e,n){var r=nn(!1),o=Lc(),i=function(n){var o;!r.get()||function(t){return"focusin"===t.type}(o=n)&&(o.composed?at(o.composedPath()):B.from(o.target)).map(on.fromDom).filter(lo).exists((function(t){return Pi(t,"mce-pastebin")}))||(n.preventDefault(),$E(e()),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(o){o!==r.get()&&(r.set(o),XE(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",(function(e){if(o.on(Kh.clearTimeout),m(e.time)){var n=Kh.setEditorTimeout(t,(function(){return u(e.state)}),e.time);o.set(n)}else u(e.state),o.clear()}))},YE=function(t,e,n){return{within:t,extra:e,withinWidth:n}},JE=function(t,e,n){var r,o=(r=function(t,e){var r=n(t);return B.some({element:t,start:e,finish:e+r,width:r})},K(t,(function(t,e){return r(e,t.len).fold(v(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),{len:0,list:[]}).list),i=$(o,(function(t){return t.finish<=e})),u=X(i,(function(t,e){return t+e.width}),0);return{within:i,extra:o.slice(i.length),withinWidth:u}},QE=function(t){return W(t,(function(t){return t.element}))},ZE=function(t,e,n,r){var o=function(t,e,n){var r=JE(e,t,n);return 0===r.extra.length?B.some(r):B.none()}(t,e,n).getOrThunk((function(){return JE(e,t-n(r),n)})),i=o.within,u=o.extra,a=o.withinWidth;return 1===u.length&&u[0].width<=n(r)?function(t,e,n){var r=QE(t.concat(e));return YE(r,[],n)}(i,u,a):u.length>=1?function(t,e,n,r){var o=QE(t).concat([n]);return YE(o,QE(e),r)}(i,u,r,a):function(t,e,n){return YE(QE(t),[],n)}(i,0,a)},tA=function(t,e){var n=W(e,(function(t){return yu(t)}));D_.setGroups(t,n)},eA=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=td(t,e,"primary"),i=dx.getCoupled(t,"overflowGroup");Yi(o.element,"visibility","hidden");var u=r.concat([i]),a=lt(u,(function(t){return yc(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),tA(o,u);var c=Du(o.element),s=ZE(c,e.builtGroups.get(),(function(t){return Du(t.element)}),i);0===s.extra.length?(Ug.remove(o,i),n([])):(tA(o,s.within),n(s.extra)),ou(o.element,"visibility"),iu(o.element),a.each(Kg.focus)}},nA=v([ff("splitToolbarBehaviours",[dx]),Ae("builtGroups",(function(){return nn([])}))]),rA=v([ga(["overflowToggledClass"]),We("getOverflowBounds"),Me("lazySink"),Ae("overflowGroups",(function(){return nn([])}))].concat(nA())),oA=v([Hf({factory:D_,schema:E_(),name:"primary"}),Ff({schema:E_(),name:"overflow"}),Ff({name:"overflow-button"}),Ff({name:"overflow-group"})]),iA=v((function(t,e){!function(t,e){var n=Au.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Yi(t,"max-width",n+"px")}(t,Math.floor(e))})),uA=v([ga(["toggledClass"]),Me("lazySink"),Ie("fetch"),We("getBounds"),Ge("fireDismissalEventInstead",[$e("event",Nr())]),ls()]),aA=v([Ff({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:cc([ah.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Ff({factory:D_,schema:E_(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:cc([Lg.config({mode:"cyclic",onEscape:function(e){return Zf(e,t,"button").each(Kg.focus),B.none()}})])}}})]),cA=function(t,e){var n=dx.getCoupled(t,"toolbarSandbox");Ul.isOpen(n)?Ul.close(n):Ul.open(n,e.toolbar())},sA=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();xl.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:iA()}}},o)},lA=function(t,e,n,r,o){D_.setGroups(e,o),sA(t,e,n,r),ah.on(t)},fA=gd({name:"FloatingToolbarButton",factory:function(t,e,n,r){return T(T({},Yh.sketch(T(T({},r.button()),{action:function(t){cA(t,r)},buttonBehaviours:hf({dump:r.button().buttonBehaviours},[dx.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=ea();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:cc([Lg.config({mode:"special",onEscape:function(t){return Ul.close(t),B.some(!0)}}),Ul.config({onOpen:function(o,i){n.fetch().get((function(o){lA(t,i,n,e.layouts,o),r.link(t.element),Lg.focusIn(i)}))},onClose:function(){ah.off(t),Kg.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return ra(n,r)||ra(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),gc.config({channels:T(T({},Xl(T({isExtraPart:S},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Yl({doReposition:function(){Ul.getState(dx.getCoupled(t,"toolbarSandbox")).each((function(r){sA(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){Ul.getState(dx.getCoupled(e,"toolbarSandbox")).each((function(o){lA(e,o,t,n.layouts,r)}))},reposition:function(e){Ul.getState(dx.getCoupled(e,"toolbarSandbox")).each((function(r){sA(e,r,t,n.layouts)}))},toggle:function(t){cA(t,r)},getToolbar:function(t){return Ul.getState(dx.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return Ul.isOpen(dx.getCoupled(t,"toolbarSandbox"))}}})},configFields:uA(),partFields:aA(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),dA=v([Me("items"),ga(["itemSelector"]),ff("tgroupBehaviours",[Lg])]),mA=v([jf({name:"items",unit:"item"})]),gA=gd({name:"ToolbarGroup",configFields:dA(),partFields:mA(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:mf(t.tgroupBehaviours,[Lg.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),hA=function(t){return W(t,(function(t){return yu(t)}))},pA=function(t,e,n){eA(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){fA.setGroups(t,hA(r))}))}))},vA=gd({name:"SplitFloatingToolbar",configFields:rA(),partFields:oA(),factory:function(t,e,n,r){var o=Jh(fA.sketch({fetch:function(){return Qw((function(e){e(hA(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[Ua,ja]},onRtl:function(){return[ja,Ua]},onBottomLtr:function(){return[qa,Wa]},onBottomRtl:function(){return[Wa,qa]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:mf(t.splitToolbarBehaviours,[dx.config({others:{overflowGroup:function(){return gA.sketch(T(T({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(W(n,e.getSystem().build)),pA(e,o,t)},refresh:function(e){return pA(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){fA.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(fA.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){fA.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(fA.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),bA=v([ga(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),pa("onOpened"),pa("onClosed")].concat(nA())),yA=v([Hf({factory:D_,schema:E_(),name:"primary"}),Hf({factory:D_,schema:E_(),name:"overflow",overrides:function(t){return{toolbarBehaviours:cc([DE.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){Zf(e,t,"overflow-button").each((function(t){ah.off(t),Kg.focus(t)})),t.onClosed(e)},onGrown:function(e){Lg.focusIn(e),t.onOpened(e)},onStartGrow:function(e){Zf(e,t,"overflow-button").each(ah.on)}}),Lg.config({mode:"acyclic",onEscape:function(e){return Zf(e,t,"overflow-button").each(Kg.focus),B.some(!0)}})])}}}),Ff({name:"overflow-button",overrides:function(t){return{buttonBehaviours:cc([ah.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Ff({name:"overflow-group"})]),wA=function(t,e){Zf(t,e,"overflow-button").bind((function(){return Zf(t,e,"overflow")})).each((function(n){xA(t,e),DE.toggleGrow(n)}))},xA=function(t,e){Zf(t,e,"overflow").each((function(n){eA(t,e,(function(t){var e=W(t,(function(t){return yu(t)}));D_.setGroups(n,e)})),Zf(t,e,"overflow-button").each((function(t){DE.hasGrown(n)&&ah.on(t)})),DE.refresh(n)}))},CA=gd({name:"SplitSlidingToolbar",configFields:bA(),partFields:yA(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:mf(t.splitToolbarBehaviours,[dx.config({others:{overflowGroup:function(t){return gA.sketch(T(T({},r["overflow-group"]()),{items:[Yh.sketch(T(T({},r["overflow-button"]()),{action:function(e){Fr(t,"alloy.toolbar.toggle")}}))]}))}}}),Wg("toolbar-toggle-events",[Kr("alloy.toolbar.toggle",(function(e){wA(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=W(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),xA(e,t)},refresh:function(e){return xA(e,t)},toggle:function(e){return wA(e,t)},isOpen:function(e){return function(t,e){return Zf(t,e,"overflow").map(DE.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),SA=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:T({tag:"div",classes:["tox-toolbar__group"]},e),components:[gA.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:cc([Sw.config({}),Kg.config({})])}},kA=function(t){return gA.sketch(SA(t))},OA=function(t,e){var n=ro((function(e){var n=W(t.initGroups,kA);D_.setGroups(e,n)}));return cc([wb(t.providers.isDisabled),pb(),Lg.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Wg("toolbar-events",[n])])},TA=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":SA({title:B.none(),items:[]}),"overflow-button":sO({name:"more",icon:B.some("more-drawer"),disabled:!1,tooltip:B.some("More..."),primary:!1,borderless:!1},B.none(),t.providers)},splitToolbarBehaviours:OA(t,e)}},_A=function(t){var e=TA(t),n=vA.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return vA.sketch(T(T({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=Wu(e),r=vo(e),o=Wu(r),i=Math.max(r.dom.scrollHeight,o.height);return ju(n.x+4,o.y,n.width-8,i)},parts:T(T({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},EA=function(t){var e=CA.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=CA.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=TA(t);return CA.sketch(T(T({},r),{components:[e,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([eE()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([eE()],{type:"closed"})}}))},AA=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return D_.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===$p.scrolling?["tox-toolbar--scrolling"]:[])},components:[D_.parts.groups({})],toolbarBehaviours:OA(t,e)})},DA=C_.optional({factory:gE,name:"menubar",schema:[Me("backstage")]}),MA=C_.optional({factory:{sketch:function(t){return __.sketch({uid:t.uid,dom:t.dom,listBehaviours:cc([Lg.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return AA({type:t.type,uid:ei("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),B.some(!0)}})},setupItem:function(t,e,n,r){D_.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Me("dom"),Me("onEscape")]}),NA=C_.optional({factory:{sketch:function(t){return function(t){return t.type===$p.sliding?EA:t.type===$p.floating?_A:AA}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),B.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[Me("dom"),Me("onEscape"),Me("getSink")]}),RA=C_.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?aE:R_;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:cc(n(e,t.sharedBackstage))}}},name:"header",schema:[Me("dom")]}),zA=C_.optional({name:"socket",schema:[Me("dom")]}),BA=C_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:cc([Sw.config({}),Kg.config({}),DE.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){bd.getCurrent(t).each(BE.hideAllSlots),Fr(t,jE)},onGrown:function(t){Fr(t,jE)},onStartGrow:function(t){Vr(t,VE,{width:eu(t.element,"width").getOr("")})},onStartShrink:function(t){Vr(t,VE,{width:Du(t.element)+"px"})}}),Ug.config({}),bd.config({find:function(t){var e=Ug.contents(t);return at(e)}})])}],behaviours:cc([zS(0),Wg("sidebar-sliding-events",[Kr(VE,(function(t,e){Yi(t.element,"width",e.event.width)})),Kr(jE,(function(t,e){ou(t.element,"width")}))])])}}},name:"sidebar",schema:[Me("dom")]}),IA=C_.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:cc([Ug.config({}),qE.config({focus:!1}),bd.config({find:function(t){return at(t.components())}})]),components:[]}}},name:"throbber",schema:[Me("dom")]}),PA=gd({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return x_.getPart(e,t,"socket")},setSidebar:function(e,n){x_.getPart(e,t,"sidebar").each((function(t){return function(t,e){bd.getCurrent(t).each((function(t){return Ug.set(t,[HE(e)])}))}(t,n)}))},toggleSidebar:function(e,n){x_.getPart(e,t,"sidebar").each((function(t){return function(t,e){bd.getCurrent(t).each((function(t){bd.getCurrent(t).each((function(n){DE.hasGrown(t)?BE.isShowing(n,e)?DE.shrink(t):(BE.hideAllSlots(n),BE.showSlot(n,e)):(BE.hideAllSlots(n),BE.showSlot(n,e),DE.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return x_.getPart(e,t,"sidebar").bind(FE).getOrNull()},getHeader:function(e){return x_.getPart(e,t,"header")},getToolbar:function(e){return x_.getPart(e,t,"toolbar")},setToolbar:function(e,n){x_.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){x_.getPart(e,t,"multiple-toolbar").each((function(t){__.setItems(t,n)}))},refreshToolbar:function(e){x_.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){x_.getPart(e,t,"toolbar").each((function(t){var e,n;e=t.getApis().toggle,n=function(e){return e(t)},null!=e?B.some(n(e)):B.none()}))},isToolbarDrawerToggled:function(e){return x_.getPart(e,t,"toolbar").bind((function(t){return B.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return x_.getPart(e,t,"throbber")},focusToolbar:function(e){x_.getPart(e,t,"toolbar").orThunk((function(){return x_.getPart(e,t,"multiple-toolbar")})).each((function(t){Lg.focusIn(t)}))},setMenubar:function(e,n){x_.getPart(e,t,"menubar").each((function(t){gE.setMenus(t,n)}))},focusMenubar:function(e){x_.getPart(e,t,"menubar").each((function(t){gE.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[Me("dom"),Me("behaviours")],partFields:[RA,DA,NA,MA,zA,BA,IA],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=W(n,(function(t){return kA(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=W(n,(function(t){return W(t,kA)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),LA={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},HA=function(t){return"string"==typeof t?t.split(" "):t},FA=function(t,e){var n=T(T({},LA),e.menus),r=At(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?HA("file edit view insert format tools table help"):HA(!1===e.menubar?"":e.menubar),i=$(o,(function(t){var n=Ht(LA,t);return r?n||Lt(e.menus,t).exists((function(t){return Ht(t,"items")})):n})),u=W(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return Z(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length?[]:V(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:HA(o.items)},e,t)}));return $(u,(function(t){return t.getItems().length>0&&V(t.getItems(),(function(t){return"separator"!==t.type}))}))},VA=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},jA=function(t,e,n){return new Cp((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},UA=function(t,e){return jA(t,e+"/skin.min.css",t.ui.styleSheetLoader)},WA=function(t,e){var n;return(n=on.fromDom(t.getElement()),Do(n).isSome())?jA(t,e+"/skin.shadowdom.min.css",Fv.DOM.styleSheetLoader):Cp.resolve()},qA=function(t,e){var n=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):Vv.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&o(n)?Cp.all([UA(e,n),WA(e,n)]).then(VA(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:e})}}(e,"Skin could not be loaded")):VA(e)()},GA=w(qA,!1),$A=w(qA,!0),XA=function(t,e){return function(n){var r=Pc(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.once("init",o),function(){t.off("init",o),r.clear()}}},KA=function(t,e,n){return function(r){var o=function(){return n(r)},i=function(){n(r),t.on(e,o)};return t.initialized?i():t.once("init",i),function(){t.off("init",i),t.off(e,o)}}},YA=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},JA=function(t,e){return function(){return t.execCommand(e)}},QA=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return B.some({type:"separator",text:a});if("submenu"===t.type){var c=Z(t.getStyleItems(),(function(t){return o(t,r,u)}));return 0===r&&c.length<=0?B.none():B.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return Z(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return B.some(T({type:"togglemenuitem",text:a,icon:t.icon,active:t.isSelected(u),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return Z(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),u=i(o);r(oO(u,Xp.CLOSE_ON_EXECUTE,t,!1))}}}},ZA=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return W(r.data,(function(t){return WT(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:QA(0,e,n),getStyleItems:o}},tD=function(t,e,n){var r=ZA(0,e,n),o=r.items,i=r.getStyleItems,u=KA(t,"NodeChange",(function(t){var e=t.getComponent();n.updateText(e)}));return Qk({text:n.icon.isSome()?B.none():n.text,icon:n.icon,tooltip:B.from(n.tooltip),role:B.none(),fetch:o.getFetch(e,i),onSetup:u,getApi:function(t){return{getComponent:v(t)}},columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(jO||(jO={}));var eD,nD,rD,oD=function(t,e,n,r){return{type:"basic",data:function(t){return W(t,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}}))}(function(t,e){return e===jO.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r))}},iD=[{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"}],uD=function(t){var e={type:"basic",data:iD};return{tooltip:"Align",text:B.none(),icon:B.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:B.none,getPreviewFor:function(t){return B.none},onAction:function(e){return function(){return Y(iD,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},updateText:function(e){var n=Y(iD,(function(e){return t.formatter.match(e.format)})).fold(v("left"),(function(t){return t.title.toLowerCase()}));Vr(e,Jk,{icon:"align-"+n})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},aD=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],cD=function(t){var e=t.split(/\s*,\s*/);return W(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},sD=function(t){var e=function(){var e=function(t){return t?cD(t)[0]:""},r=t.queryCommandValue("FontName"),o=n.data,i=r?r.toLowerCase():"";return{matchOpt:Y(o,(function(t){var n=t.format;return n.toLowerCase()===i||e(n).toLowerCase()===e(i).toLowerCase()})).orThunk((function(){return Ui(function(t){var e;return 0===t.indexOf("-apple-system")&&(e=cD(t.toLowerCase()),tt(aD,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(i),{title:"System Font",format:i})})),font:r}},n=oD(t,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",jO.SemiColon);return{tooltip:"Fonts",text:B.some("System Font"),icon:B.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return e().matchOpt},getPreviewFor:function(t){return function(){return B.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},updateText:function(t){var n=e(),r=n.matchOpt,o=n.font,i=r.fold(v(o),(function(t){return t.title}));Vr(t,Yk,{text:i})},dataset:n,shouldHide:!1,isInvalid:S}},lD={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},fD={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},dD=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":Lt(fD,t).getOr(t)},mD=function(t){var e=function(){var e=B.none(),n=r.data,o=t.queryCommandValue("FontSize");if(o)for(var i=function(t){var r=dD(o,t),i=function(t){return Lt(lD,t).getOr("")}(r);e=Y(n,(function(t){return t.format===o||t.format===r||t.format===i}))},u=3;e.isNone()&&u>=0;u--)i(u);return{matchOpt:e,size:o}},n=v(B.none),r=oD(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",jO.Space);return{tooltip:"Font sizes",text:B.some("12pt"),icon:B.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},updateText:function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(v(o),(function(t){return t.title}));Vr(t,Yk,{text:i})},dataset:r,shouldHide:!1,isInvalid:S}},gD=function(t,e){var n=e(),r=W(n,(function(t){return t.format}));return B.from(t.formatter.closest(r)).bind((function(t){return Y(n,(function(e){return e.format===t}))})).orThunk((function(){return Ui(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},hD=function(t){var e=oD(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",jO.SemiColon);return{tooltip:"Blocks",text:B.some("Paragraph"),icon:B.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:B.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return B.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:YA(t),updateText:function(n){var r=gD(t,(function(){return e.data})).fold(v("Paragraph"),(function(t){return t.title}));Vr(n,Yk,{text:r})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},pD=function(t,e){return{tooltip:"Formats",text:B.some("Paragraph"),icon:B.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:B.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?B.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):B.none()}},onAction:YA(t),updateText:function(e){var n=function(t){var e=t.items;return void 0!==e&&e.length>0?Z(e,n):[{title:t.title,format:t.format}]},r=Z(UT(t),n),o=gD(t,v(r)).fold(v("Paragraph"),(function(t){return t.title}));Vr(e,Yk,{text:o})},shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},vD=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=W(o,n.getSystem().build);Ol(n,i)}))};return Gr([Kr(br(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;F(o.channels,i)&&n(e,o.data)}})),ro((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),bD=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),yD=[Me("channel"),Fe("renderComponents"),Fe("updateState"),Fe("initialData")],wD=Object.freeze({__proto__:null,init:function(){var t=nn(B.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(B.none())}}}}),xD=lc({fields:yD,name:"reflecting",active:vD,apis:bD,state:wD}),CD=v([Me("toggleClass"),Me("fetch"),ba("onExecute"),$e("getHotspot",B.some),$e("getAnchorOverrides",v({})),ls(),ba("onItemExecute"),Fe("lazySink"),Me("dom"),pa("onOpen"),ff("splitDropdownBehaviours",[dx,Lg,Kg]),$e("matchWidth",!1),$e("useMinWidth",!1),$e("eventOrder",{}),Fe("role")].concat(_x())),SD=Hf({factory:Yh,schema:[Me("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:cc([Kg.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(jr)},buttonBehaviours:cc([ah.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),kD=Hf({factory:Yh,schema:[Me("dom")],name:"button",defaults:function(){return{buttonBehaviours:cc([Kg.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),OD=v([SD,kD,Vf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Me("text")],name:"aria-descriptor"}),Ff({schema:[ma()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),gx()]),TD=gd({name:"SplitDropdown",configFields:CD(),partFields:OD(),factory:function(t,e,n,r){var o,i=function(t){bd.getCurrent(t).each((function(t){Ud.highlightFirst(t),Lg.focusIn(t)}))},u=function(e){xx(t,b,e,r,i,Gw.HighlightFirst).get(h)},a=function(e){var n=td(e,t,"button");return jr(n),B.some(!0)},c=T(T({},Gr([ro((function(e,n){Zf(e,t,"aria-descriptor").each((function(t){var n=ei("aria");Wo(t.element,"id",n),Wo(e.element,"aria-describedby",n)}))}))])),sh(B.some(u))),s={repositionMenus:function(t){ah.isOn(t)&&Tx(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:s,eventOrder:T(T({},t.eventOrder),(o={},o[yr()]=["disabling","toggling","alloy.base.behaviour"],o)),events:c,behaviours:mf(t.splitDropdownBehaviours,[dx.config({others:{sandbox:function(e){var n=td(e,t,"arrow");return Ox(t,e,{onOpen:function(){ah.on(n),ah.on(e)},onClose:function(){ah.off(n),ah.off(e)}})}}}),Lg.config({mode:"special",onSpace:a,onEnter:a,onDown:function(t){return u(t),B.some(!0)}}),Kg.config({}),ah.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),_D=function(t){return{isDisabled:function(){return Nd.isDisabled(t)},setDisabled:function(e){return Nd.set(t,e)}}},ED=function(t){return{setActive:function(e){ah.set(t,e)},isActive:function(){return ah.isOn(t)},isDisabled:function(){return Nd.isDisabled(t)},setDisabled:function(e){return Nd.set(t,e)}}},AD=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},DD=ei("focus-button"),MD=function(t,e,n,r,o,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:AD(n,i)},components:Tb([t.map((function(t){return qk(t,i.icons)})),e.map((function(t){return $k(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[Jn()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:cc([wb(i.isDisabled),pb(),Wg("common-button-display-events",[Kr(Jn(),(function(t,e){e.event.prevent(),Fr(t,DD)}))])].concat(r.map((function(n){return xD.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return Tb([t.icon.map((function(t){return qk(t,i.icons)})),t.text.map((function(t){return $k(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},ND=function(t,e,n){var r,o=nn(h),i=MD(t.icon,t.text,t.tooltip,B.none(),B.none(),n);return Yh.sketch({dom:i.dom,components:i.components,eventOrder:Kk,buttonBehaviours:cc([Wg("toolbar-button-events",[(r={onAction:t.onAction,getApi:e.getApi},uo((function(t,e){xb(r,t)((function(e){Vr(t,Xk,{buttonApi:e}),r.onAction(e)}))}))),Cb(e,o),Sb(e,o)]),wb((function(){return t.disabled||n.isDisabled()})),pb()].concat(e.toolbarButtonBehaviours))})},RD=function(t,e,n){return ND(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Wg("toolbarButtonWith",n)]:[]),getApi:_D,onSetup:t.onSetup},e)},zD=function(t,e,n){return jt(ND(t,{toolbarButtonBehaviours:[Ug.config({}),ah.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Wg("toolbarToggleButtonWith",n)]:[]),getApi:ED,onSetup:t.onSetup},e))},BD=function(t,e,n){return function(r){return Qw((function(t){return e.fetch(t)})).map((function(o){return B.from(Zy(jt(Ry(ei("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,Xp.CLOSE_ON_EXECUTE,e.select.getOr(S),n),{movement:By(e.columns,e.presets),menuBehaviours:Mv("auto"!==e.columns?[]:[ro((function(t,n){Av(t,4,Zp(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;Lg.setGridSize(t,n,r)}))}))])})))}))}},ID=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],PD=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return Te(t)})).getOrDie();return e(i,r,o)}},LD={button:PD(zp,(function(t,e){return n=t,r=e.backstage.shared.providers,RD(n,r,[]);var n,r})),togglebutton:PD(Pp,(function(t,e){return n=t,r=e.backstage.shared.providers,zD(n,r,[]);var n,r})),menubutton:PD(dE,(function(t,e){return uO(t,"tox-tbtn",e.backstage,B.none())})),splitbutton:PD((function(t){return Se("SplitButton",mE,t)}),(function(t,e){return function(t,e){var n,r=ei("channel-update-split-dropdown-display"),o=function(t){return{isDisabled:function(){return Nd.isDisabled(t)},setDisabled:function(e){return Nd.set(t,e)},setIconFill:function(e,n){Zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Wo(t,"fill",n)}))},setIconStroke:function(e,n){Zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Wo(t,"stroke",n)}))},setActive:function(e){Wo(t.element,"aria-pressed",e),Zu(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return ah.set(t,e)}))}))},isActive:function(){return Zu(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(ah.isOn)}))}}},i=nn(h),u={getApi:o,onSetup:t.onSetup};return TD.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:T({"aria-pressed":!1},AD(t.tooltip,e.providers))},onExecute:function(e){t.onAction(o(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:cc([yb(e.providers.isDisabled),pb(),Wg("split-dropdown-events",[Kr(DD,Kg.focus),Cb(u,i),Sb(u,i)]),Nx.config({})]),eventOrder:(n={},n[Dr()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:BD(o,t,e.providers),parts:{menu:iv(0,t.columns,t.presets)},components:[TD.parts.button(MD(t.icon,t.text,B.none(),B.some(r),B.some([ah.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),TD.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:rp("chevron-down",e.providers.icons)},buttonBehaviours:cc([yb(e.providers.isDisabled),pb(),op()])}),TD.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})}(t,e.backstage.shared)})),grouptoolbarbutton:PD((function(t){return Se("GroupToolbarButton",sE,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[cs]=e.backstage.shared.header.isPositionedAtTop()?Ac.TopToBottom:Ac.BottomToTop,r);switch(Zv(n)){case $p.floating:return function(t,e,n,r){var o=e.shared;return fA.sketch({lazySink:o.getSink,fetch:function(){return Qw((function(e){e(W(n(t.items),kA))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:MD(t.icon,t.text,t.tooltip,B.none(),B.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return jD(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,B.none())}),i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(t,e){return function(t,e){var n=T({type:"advanced"},e.styleselect);return tD(t,e,pD(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return tD(t,e,mD(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return tD(t,e,sD(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return tD(t,e,hD(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return tD(t,e,uD(t))}(t,e.backstage)}},HD={styleselect:LD.styleSelectButton,fontsizeselect:LD.fontsizeSelectButton,fontselect:LD.fontSelectButton,formatselect:LD.formatButton,align:LD.alignMenuButton},FD=function(t){var e,n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=W(ID,(function(e){var n=$(e.items,(function(e){return Ht(t,e)||Ht(HD,e)}));return{name:e.name,items:n}}));return $(e,(function(t){return t.items.length>0}))}(r):o(n)?(e=n.split("|"),W(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return g(t,(function(t){return Ht(t,"name")&&Ht(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},VD=function(t,e,n,r,o,i){return Lt(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return lt(t,(function(t){return Lt(e,t+n.toLowerCase())}))}))})).fold((function(){return Lt(HD,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return B.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return Lt(LD,t.type).fold((function(){return console.error("skipping button defined by",t),B.none()}),(function(r){return B.some(r(t,e,n))}))}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),B.none())}))},jD=function(t,e,n,r){var o=FD(e),i=W(o,(function(o){var i=Z(o.items,(function(o){return 0===o.trim().length?[]:VD(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:B.from(t.translate(o.name)),items:i}}));return $(i,(function(t){return t.items.length>0}))},UD=function(t,e,n,r){var i=e.outerContainer,u=n.toolbar,a=n.buttons;if(g(u,o)){var c=u.map((function(e){var o={toolbar:e,buttons:a,allowToolbarGroups:n.allowToolbarGroups};return jD(t,o,{backstage:r},B.none())}));PA.setToolbars(i,c)}else PA.setToolbar(i,jD(t,n,{backstage:r},B.none()))},WD=En(),qD=WD.os.isiOS()&&WD.os.version.major<=12,GD=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=nn(0),u=e.outerContainer;GA(t);var c=on.fromDom(o.targetNode),s=Ao(Eo(c));!function(t,e){Nl(t,e,zo)}(c,e.mothership),Ml(s,e.uiMothership),t.on("PostRender",(function(){UD(t,e,n,r),i.set(t.getWin().innerWidth),PA.setMenubar(u,FA(t,n)),PA.setSidebar(u,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=nn(Ou(r.innerWidth,r.innerHeight)),u=nn(Ou(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(Ou(r.innerWidth,r.innerHeight)),fy(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(Ou(e.offsetWidth,e.offsetHeight)),fy(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",a),n.bind(r,"scroll",s);var l=Vc(on.fromDom(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Yi(f,"display","none")})),t.on("show",(function(){ou(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",a),n.unbind(r,"scroll",s),r=null}))}(t,e)}));var l,f,d,m=PA.getSocket(u).getOrDie("Could not find expected socket element");if(qD){Ji(m.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var g=(l=function(){t.fire("ScrollContent")},f=20,d=null,{cancel:function(){a(d)||(clearTimeout(d),d=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a(d)&&(d=setTimeout((function(){d=null,l.apply(null,t)}),f))}}),h=Fc(m.element,"scroll",g.throttle);t.on("remove",h.unbind)}hb(t,e),t.addCommand("ToggleSidebar",(function(e,n){PA.toggleSidebar(u,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return PA.whichSidebar(u)}));var p=Zv(t);p!==$p.sliding&&p!==$p.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var n=t.getWin().innerWidth;n!==i.get()&&(PA.refreshToolbar(e.outerContainer),i.set(n))}));var v={enable:function(){gb(e,!1)},disable:function(){gb(e,!0)},isDisabled:function(){return Nd.isDisabled(u)}};return{iframeContainer:m.element.dom,editorContainer:u.element.dom,api:v}}}),$D=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?B.some(parseInt(""+t,10)):B.none()},XD=function(t){return m(t)?t+"px":t},KD=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},YD=function(t){return function(t){var e=jv(t),n=qv(t),r=$v(t);return $D(e).map((function(t){return KD(t,n,r)}))}(t).getOr(jv(t))},JD=function(t){var e=Uv(t),n=Wv(t),r=Gv(t);return $D(e).map((function(t){return KD(t,n,r)}))},QD=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=Fv.DOM,c=ib(t),s=cb(t),l=Gv(t).or(JD(t)),f=r.shared.header,d=f.isPositionedAtTop,m=Zv(t),g=m===$p.sliding||m===$p.floating,h=nn(!1),p=function(){return h.get()&&!t.removed},b=function(t){return g?t.fold(v(0),(function(t){return t.components().length>1?Cu(t.components()[1].element):0})):0},y=function(){i.broadcastOn([ql()],{})},w=function(t){if(void 0===t&&(t=!1),p()){var n;if(c||(n=l.getOrThunk((function(){var t=$D(Zi(Gi(),"margin-left")).getOr(0);return Du(Gi())-_u(e).left+t})),Yi(o.get().element,"max-width",n+"px")),g&&PA.refreshToolbar(u),c||function(){var t=PA.getToolbar(u),n=b(t),r=Uu(e),i=d()?Math.max(r.y-Cu(o.get().element)+n,0):r.bottom;Ji(u.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();t?tE.reset(r):tE.refresh(r)}y()}},x=function(n){if(void 0===n&&(n=!0),!c&&s&&p()){var r=f.getDockingMode(),i=function(n){switch(nb(t)){case Qv.auto:var r=PA.getToolbar(u),o=b(r),i=Cu(n.element)-o,a=Uu(e);if(a.y>i)return"top";var c=vo(e),s=Math.max(c.dom.scrollHeight,Cu(c));return a.bottom<s-i?"bottom":qu().bottom<a.bottom-i?"bottom":"top";case Qv.bottom:return"bottom";case Qv.top:default:return"top"}}(o.get());i!==r&&(!function(t){var e=o.get();tE.setModes(e,[t]),f.setDockingMode(t);var n=d()?Ac.TopToBottom:Ac.BottomToTop;Wo(e.element,cs,n)}(i),n&&w(!0))}};return{isVisible:p,isPositionedAtTop:d,show:function(){h.set(!0),Yi(u.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),ou(i.element,"display"),x(!1),w()},hide:function(){h.set(!1),n.outerContainer&&(Yi(u.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus")),Yi(i.element,"display","none")},update:w,updateMode:x,repositionPopups:y}},ZD=function(t,e){var n=Uu(t);return{pos:e?n.y:n.bottom,bounds:n}},tM=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=nn(null),s=on.fromDom(o.targetNode),l=QD(t,s,e,r,c),f=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);$A(t);var d=function(){if(c.get())l.show();else{c.set(PA.getHeader(a).getOrDie());var o=ub(t);Ml(o,i),Ml(o,u),UD(t,e,n,r),PA.setMenubar(a,FA(t,n)),l.show(),function(t,e,n,r){var o=nn(ZD(e,n.isPositionedAtTop())),i=function(r){var i=ZD(e,n.isPositionedAtTop()),u=i.pos,a=i.bounds,c=o.get(),s=c.pos,l=c.bounds,f=a.height!==l.height||a.width!==l.width;o.set({pos:u,bounds:a}),f&&fy(t,r),n.isVisible()&&(s!==u?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){Kh.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var u=Pc();u.set(Vc(on.fromDom(t.getBody()),"load",i)),t.on("remove",(function(){u.clear()}))}(t,s,l,f),t.nodeChanged()}},m=function(){return Kh.setEditorTimeout(t,d,0)};t.on("show",d),t.on("hide",l.hide),f||(t.on("focus",m),t.on("blur",l.hide)),t.on("init",(function(){(t.hasFocus()||f)&&m()})),hb(t,e);var g={show:function(){l.show()},hide:function(){l.hide()},enable:function(){gb(e,!1)},disable:function(){gb(e,!0)},isDisabled:function(){return Nd.isDisabled(a)}};return{editorContainer:a.element.dom,api:g}}}),eM=function(t,e){return Kr(Xk,(function(n,r){var o=function(t){return{hide:function(){return Fr(t,Sr())},getValue:function(){return lf.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)}))},nM=function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original;r.primary;var o=_(r,["primary"]),i=ke(Pp(T(T({},o),{type:"togglebutton",onAction:h})));return zD(i,n.backstage.shared.providers,[eM(t,e)])}(t,e,r):function(t,e,n){var r=e.original;r.primary;var o=_(r,["primary"]),i=ke(zp(T(T({},o),{type:"button",onAction:h})));return RD(i,n.backstage.shared.providers,[eM(t,e)])}(t,e,r)},rM=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=Jh(Uw.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:cc([Lg.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return jr(t),!0}))},onLeft:function(t,e){return e.cut(),B.none()},onRight:function(t,e){return e.cut(),B.none()}})])})),o=function(t,e,n){var r=W(e,(function(e){return Jh(nM(t,e,n))}));return{asSpecs:function(){return W(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return lt(e,(function(e,n){return e.primary?B.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(x(Nd.isDisabled)):B.none()}))}}}(r,t.commands,e);return[{title:B.none(),items:[r.asSpec()]},{title:B.none(),items:o.asSpecs()}]},oM=rM,iM=function(t,e,n){return void 0===n&&(n=.01),e.bottom-t.y>=n&&t.bottom-e.y>=n},uM=function(t){var e=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=ko(on.fromDom(t.startContainer),t.startOffset).element;return(fo(n)?yo(n):B.some(n)).filter(lo).map((function(t){return t.dom.getBoundingClientRect()})).getOr(e)}return e}(t.selection.getRng());if(t.inline){var n=Bu();return ju(n.left+e.left,n.top+e.top,e.width,e.height)}var r=Wu(on.fromDom(t.getBody()));return ju(r.x+e.left,r.y+e.top,e.width,e.height)},aM=function(t,e,n,r){void 0===r&&(r=0);var o=Lu(window),i=Uu(on.fromDom(t.getContentAreaContainer())),u=Xv(t)||Kv(t)||Jv(t),a=function(t,e,n){var r=Math.max(t.x+n,e.x);return{x:r,width:Math.min(t.right-n,e.right)-r}}(i,o,r),c=a.x,s=a.width;if(t.inline&&!u)return ju(c,o.y,s,o.height);var l=function(t,e,n,r,o,i){var u=on.fromDom(t.getContainer()),a=Zu(u,".tox-editor-header").getOr(u),c=Uu(a),s=c.y>=e.bottom,l=r&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!l)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var f="line"===o?Uu(u):e;return l?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(f.bottom-i,n.bottom)}:{y:Math.max(f.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}}(t,i,o,e.header.isPositionedAtTop(),n,r),f=l.y,d=l.bottom;return ju(c,f,s,d-f)},cM={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"]},sM={maxHeightFunction:Zc(),maxWidthFunction:iA()},lM=function(t){return"node"===t},fM=function(t,e,n,r,o){var i=uM(t),u=r.lastElement().exists((function(t){return Mn(n,t)}));return function(t,e){var n=t.selection.getRng(),r=ko(on.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&Mn(r.element,e)}(t,n)?u?Gh:Vh:u?function(t,e,n){var r=eu(t,"position");Yi(t,"position",e);var o=n(t);return r.each((function(e){return Yi(t,"position",e)})),o}(e,r.getMode(),(function(){return iM(i,Uu(e))&&!r.isReposition()?Xh:Gh})):("fixed"===r.getMode()?o.y+Bu().top:o.y)+(Cu(e)+12)<=i.y?Vh:jh},dM=function(t,e,n,r){var o=function(e){return function(r,o,i,u,a){var c=fM(t,u,e,n,a),s=T(T({},r),{y:a.y,height:a.height});return T(T({},c(s,o,i,u,a)),{alwaysFit:!0})}},i=function(t){return lM(r)?[o(t)]:[]};return e?{onLtr:function(t){return[$a,ja,Ua,Wa,qa,Ga].concat(i(t))},onRtl:function(t){return[$a,Ua,ja,qa,Wa,Ga].concat(i(t))}}:{onLtr:function(t){return[Ga,$a,Wa,ja,qa,Ua].concat(i(t))},onRtl:function(t){return[Ga,$a,qa,Ua,Wa,ja].concat(i(t))}}},mM=function(t,e){var n=$(e,(function(e){return e.predicate(t.dom)})),r=G(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},gM=function(t,e,n){var r=mM(t,e);if(r.contextForms.length>0)return B.some({elem:t,toolbars:[r.contextForms[0]]});var o=mM(t,n);if(o.contextForms.length>0)return B.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return V(t,(function(t){return t.position===e}))},n=function(e){return $(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=W(n("selection"),(function(t){return T(T({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return B.some({elem:t,toolbars:i})}return B.none()},hM=function(t,e,n){return t(e)?B.none():Fn(e,(function(t){if(lo(t)){var e=mM(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return Y(t,(function(t){return t.position===e}))};return e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position})).fold((function(){return[]}),(function(e){return $(t,(function(t){return t.position===e}))}))}(r);return i.length>0?B.some({elem:t,toolbars:i}):B.none()}return B.none()}),t)},pM=function(t,e){var n={},r=[],o=[],i={},u={},a=function(t,a){var c=ke(Se("ContextForm",Wp,a));n[t]=c,c.launch.map((function(n){i["form:"+t]=T(T({},a.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),u[t]=c},c=function(t,e){var n;(n=e,Se("ContextToolbar",qp,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))},s=At(t);return q(s,(function(e){var n=t[e];"contextform"===n.type?a(e,n):"contexttoolbar"===n.type&&c(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:u,formNavigators:i}},vM=ei("forward-slide"),bM=ei("backward-slide"),yM=ei("change-slide-event"),wM=function(t,e,n,r){var o,i,u=r.backstage,a=u.shared,c=En().deviceType.isTouch,s=Lc(),l=Lc(),f=Lc(),d=bu((o={sink:n,onEscape:function(){return t.focus(),B.some(!0)}},i=nn([]),Dh.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),Dh.getContent(t).each((function(t){ou(t.element,"visibility")})),Ii(t.element,"tox-pop--resizing"),ou(t.element,"width")},inlineBehaviours:cc([Wg("context-toolbar-events",[no(lr(),(function(t,e){"width"===e.event.raw.propertyName&&(Ii(t.element,"tox-pop--resizing"),ou(t.element,"width"))})),Kr(yM,(function(t,e){var n=t.element;ou(n,"width");var r=Du(n);Dh.setContent(t,e.event.contents),zi(n,"tox-pop--resizing");var o=Du(n);Yi(n,"width",r+"px"),Dh.getContent(t).each((function(t){e.event.focus.bind((function(t){return pc(t),yc(n)})).orThunk((function(){return Lg.focusIn(t),bc(Eo(n))}))})),Kh.setTimeout((function(){Yi(t.element,"width",o+"px")}),0)})),Kr(vM,(function(t,e){Dh.getContent(t).each((function(e){i.set(i.get().concat([{bar:e,focus:bc(Eo(t.element))}]))})),Vr(t,yM,{contents:e.event.forwardContents,focus:B.none()})})),Kr(bM,(function(t,e){ct(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),Vr(t,yM,{contents:yu(e.bar),focus:e.focus})}))}))]),Lg.config({mode:"special",onEscape:function(t){return ct(i.get()).fold((function(){return o.onEscape()}),(function(e){return Fr(t,bM),B.some(!0)}))}})]),lazySink:function(){return mt.value(o.sink)}}))),m=function(){var e=f.get().getOr("node"),n=lM(e)?1:0;return aM(t,a,e,n)},g=function(){return!(t.removed||c()&&u.isContextMenuOpen())},p=function(){if(g()){var e=m(),n=Fi(f.get(),"node")?function(t,e){return e.filter(qi).map(Wu).getOrThunk((function(){return uM(t)}))}(t,s.get()):uM(t);return e.height<=0||!iM(n,e)}return!0},v=function(){s.clear(),l.clear(),f.clear(),Dh.hide(d)},b=function(){if(Dh.isOpen(d)){var t=d.element;ou(t,"display"),p()?Yi(t,"display","none"):(l.set(0),Dh.reposition(d))}},y=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:cc([Lg.config({mode:"acyclic"}),Wg("pop-dialog-wrap-events",[ro((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return Lg.focusIn(e)}))})),oo((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},w=Wt((function(){return pM(e,(function(t){var e=x([t]);Vr(d,vM,{forwardContents:y(e)})}))})),x=function(e){var n=t.ui.registry.getAll().buttons,o=w(),i=T(T({},n),o.formNavigators),u=Zv(t)===$p.scrolling?$p.scrolling:$p.default,c=Q(W(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return jD(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,B.some(["form:"]))}(i,e):function(t,e){return oM(t,e)}(e,a.providers)})));return AA({type:u,uid:ei("context-toolbar"),initGroups:c,onEscape:B.none,cyclicKeying:!0,providers:a.providers})},C=function(e,r){var o="node"===e?a.anchors.node(r):a.anchors.cursor(),i=function(t,e,n,r){return"line"===e?{bubble:rs(12,0,cM),layouts:{onLtr:function(){return[Xa]},onRtl:function(){return[Ka]}},overrides:sM}:{bubble:rs(0,12,cM,1/12),layouts:dM(t,n,r,e),overrides:sM}}(t,e,c(),{lastElement:s.get,isReposition:function(){return Fi(l.get(),0)},getMode:function(){return xl.getMode(n)}});return jt(o,i)},S=function(t,e){if(k.cancel(),g()){var r=x(t),o=t[0].position,i=C(o,e);f.set(o),l.set(1);var u=d.element;ou(u,"display"),function(t){return Fi(ji(t,s.get(),Mn),!0)}(e)||(Ii(u,"tox-pop--transition"),xl.reset(n,d)),Dh.showWithinBounds(d,y(r),{anchor:i,transition:{classes:["tox-pop--transition"],mode:"placement"}},(function(){return B.some(m())})),e.fold(s.clear,s.set),p()&&Yi(u,"display","none")}},k=fp((function(){t.hasFocus()&&!t.removed&&(Pi(d.element,"tox-pop--transition")?k.throttle():function(t,e){var n=on.fromDom(e.getBody()),r=function(t){return Mn(t,n)},o=on.fromDom(e.selection.getNode());return function(t){return!r(t)&&!Rn(n,t)}(o)?B.none():gM(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return hM(r,o,t)}))}(w(),t).fold(v,(function(t){S(t.toolbars,B.some(t.elem))})))}),17);t.on("init",(function(){t.on("remove",v),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",b),t.on("click keyup focus SetContent",k.throttle),t.on("contexttoolbar-hide",v),t.on("contexttoolbar-show",(function(e){var n=w();Lt(n.lookupTable,e.toolbarKey).each((function(n){S([n],Ui(e.target!==t,e.target)),Dh.getContent(d).each(Lg.focusIn)}))})),t.on("focusout",(function(e){Kh.setEditorTimeout(t,(function(){yc(n.element).isNone()&&yc(d.element).isNone()&&v()}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&v()})),t.on("AfterProgressState",(function(e){e.state?v():t.hasFocus()&&k.throttle()})),t.on("NodeChange",(function(t){yc(d.element).fold(k.throttle,h)}))}))},xM={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:[""]},CM=(nD=["Infinity","[0-9]+\\."+(eD=function(t){return"(?:"+t+")?"})("[0-9]+")+eD("[eE][+-]?[0-9]+"),"\\.[0-9]+"+eD("[eE][+-]?[0-9]+"),"[0-9]+"+eD("[eE][+-]?[0-9]+")].join("|"),new RegExp("^([+-]?(?:"+nD+"))(.*)$")),SM=function(t,e){return B.from(CM.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return V(e,(function(e){return V(xM[e],(function(e){return t===e}))}))}(r,e)?B.some({value:n,unit:r}):B.none()}))},kM=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=Lc();return W(n,(function(n){return{type:"togglemenuitem",text:e.display(n),onSetup:function(i){var u=function(t){t&&(o.on((function(t){return t.setActive(!1)})),o.set(i)),i.setActive(t)};u(Fi(r,e.hash(n)));var a=e.watcher(t,n,u);return function(){o.clear(),a()}},onAction:function(){return e.setCurrent(t,n)}}}))};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:function(t){return t(n())},onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:n,onSetup:e.onMenuSetup})},OM={name:"lineheight",text:"Line height",icon:"line-height",getOptions:function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},hash:function(t){return function(t,e){return SM(t,e).map((function(t){return t.value+t.unit}))}(t,["fixed","relative","empty"]).getOr(t)},display:b,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return B.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},TM=function(t){kM(t,OM),function(t){return B.from(function(t){return t.getParam("content_langs",void 0,"array")}(t)).map((function(e){return{name:"language",text:"Language",icon:"language",getOptions:v(e),hash:function(t){return s(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,e,n){return t.formatter.formatChanged("lang",n,!1,{value:e.code,customValue:e.customCode}).unbind},getCurrent:function(t){var e=on.fromDom(t.selection.getNode());return Vn(e,(function(t){return B.some(t).filter(lo).bind((function(t){return Go(t,"lang").map((function(e){return{code:e,customCode:Go(t,"data-mce-lang").getOrUndefined(),title:""}}))}))}))},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(e){var n=Pc();return e.setActive(t.formatter.match("lang",{},void 0,!0)),n.set(t.formatter.formatChanged("lang",e.setActive,!0)),n.clear}}}))}(t).each((function(e){return kM(t,e)}))},_M=function(t,e){!function(t,e){var n=ZA(0,e,uD(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=ZA(0,e,sD(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=T({type:"advanced"},e.styleselect),r=ZA(0,e,pD(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=ZA(0,e,hD(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=ZA(0,e,mD(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)},EM=function(t){return KA(t,"NodeChange",(function(e){e.setDisabled(!t.queryCommandState("outdent"))}))},AM=function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:EM(t),onAction:JA(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:JA(t,"indent")})}(t)},DM=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},MM=function(t){!function(t){LS.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:XA(t,e.name),onAction:DM(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:XA(t,n),onAction:DM(t,n)})}}(t),function(t){LS.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:JA(t,e.action)})}))}(t),function(t){LS.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:JA(t,e.action),onSetup:XA(t,e.name)})}))}(t)},NM=function(t){MM(t),function(t){LS.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:JA(t,e.action)})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:DM(t,"code")})}(t)},RM=function(t,e){return KA(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())}))},zM=function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:RM(t,"hasUndo"),onAction:JA(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:RM(t,"hasRedo"),onAction:JA(t,"redo")})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:RM(t,"hasUndo"),onAction:JA(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:RM(t,"hasRedo"),onAction:JA(t,"redo")})}(t)},BM=function(t){return KA(t,"VisualAid",(function(e){e.setActive(t.hasVisual)}))},IM=function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:JA(t,"mceToggleVisualAid")})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:BM(t),onAction:JA(t,"mceToggleVisualAid")})}(t)},PM=function(t,e){!function(t){q([{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(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:JA(t,e.cmd),onSetup:XA(t,e.name)})})),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:JA(t,"JustifyNone")})}(t),NM(t),_M(t,e),zM(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=nn(null),n=nn(null);Dy(t,"forecolor","forecolor","Text color",e),Dy(t,"backcolor","hilitecolor","Background color",n),My(t,"forecolor","forecolor","Text color"),My(t,"backcolor","hilitecolor","Background color")}(t),IM(t),AM(t),TM(t)},LM=function(t,e){return{type:"makeshift",x:t,y:e}},HM=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},FM=function(t,e){var n=Fv.DOM.getPos(t);return function(t,e,n){return LM(t.x+e,t.y+n)}(e,n.x,n.y)},VM=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(HM(t)){var e=t.touches[0];return LM(e.pageX,e.pageY)}return LM(t.pageX,t.pageY)}(e):FM(t.getContentAreaContainer(),function(t){if(HM(t)){var e=t.touches[0];return LM(e.clientX,e.clientY)}return LM(t.clientX,t.clientY)}(e)):jM(t)},jM=function(t){return{type:"selection",root:on.fromDom(t.selection.getNode())}},UM=function(t,e,n){switch(n){case"node":return function(t){return{type:"node",node:B.some(on.fromDom(t.selection.getNode())),root:on.fromDom(t.getBody())}}(t);case"point":return VM(t,e);case"selection":return jM(t)}},WM=function(t,e,n,r,o,i){var u=n(),a=UM(t,e,i);oO(u,Xp.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),Dh.showMenuAt(o,{anchor:a},{menu:{markers:nv("normal")},data:t})}))},qM={onLtr:function(){return[$a,ja,Ua,Wa,qa,Ga,Vh,jh,Fh,Lh,Hh,Ph]},onRtl:function(){return[$a,Ua,ja,qa,Wa,Ga,Vh,jh,Hh,Ph,Fh,Lh]}},GM={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"]},$M=function(t,e,n,r,o,i,u){var a=function(t,e,n){var r=UM(t,e,n);return T({bubble:rs(0,"point"===n?12:0,GM),layouts:qM,overrides:{maxWidthFunction:iA(),maxHeightFunction:Zc()}},r)}(t,e,i);oO(n,Xp.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),Dh.showMenuWithinBounds(o,{anchor:a},{menu:{markers:nv("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return B.some(aM(t,r.shared,"node"===i?"node":"selection"))})),t.fire("contexttoolbar-hide")}))},XM=function(t,e,n,r,o,i){var u=En(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),l=u.deviceType.isTouch(),f=function(){var u=n();$M(t,e,u,r,o,i,!(s||a||c&&l))};if((c||a)&&"node"!==i){var d=function(){!function(t){var e=t.selection.getRng(),n=function(){Kh.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),f()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return Xs(t.getWin(),As.domRange(o)).exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))}(t,e)?(t.once("selectionchange",d),t.once("touchend",(function(){return t.off("selectionchange",d)}))):d()}else f()},KM=function(t){return"string"==typeof t?t.split(/[ ,]/):t},YM=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},JM=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return B.from(t.getParam(e)).map(KM).getOrThunk((function(){return $(KM(n),(function(t){return Ht(r,t)}))}))}(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},QM=function(t){return o(t)?"|"===t:"separator"===t.type},ZM={type:"separator"},tN=function(t){var e,n=function(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}};if(o(t))return t;switch(t.type){case"separator":return ZM;case"submenu":return T(T({type:"nestedmenuitem"},n(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return o(e)?e:W(e,tN)}});default:return T(T({type:"menuitem"},n(t)),{onAction:(e=t.onAction,function(){return e()})})}},eN=function(t,e){if(0===e.length)return t;var n=ct(t).filter((function(t){return!QM(t)})).fold((function(){return[]}),(function(t){return[ZM]}));return t.concat(n).concat(e).concat([ZM])},nN=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},rN=function(t,e){return nN(t,e)?t.selection.getStart(!0):e.target},oN=function(t,e,n){var r=En().deviceType.isTouch,i=bu(Dh.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:cc([Wg("dismissContextMenu",[Kr(Nr(),(function(e,n){Ul.close(e),t.focus()}))])])})),u=function(t){return Dh.hide(i)},a=function(e){if(YM(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!YM(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var u=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t),r=nN(t,e)?"selection":"point";if(hn(n)){var o=rN(t,e);return ew(on.fromDom(o),n)?"node":r}return r}(t,e);(r()?XM:WM)(t,e,(function(){var n=rN(t,e),r=t.ui.registry.getAll(),i=JM(t);return function(t,e,n){var r=K(e,(function(e,r){return Lt(t,r.toLowerCase()).map((function(t){var r=t.update(n);if(o(r))return eN(e,r.split(" "));if(r.length>0){var i=W(r,tN);return eN(e,i)}return e})).getOrThunk((function(){return e.concat([r])}))}),[]);return r.length>0&&QM(r[r.length-1])&&r.pop(),r}(r.contextMenus,i,n)}),n,i,u)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,u),t.on("longpress contextmenu",a)}))},iN=zn([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),uN=function(t){return function(e){return e.translate(-t.left,-t.top)}},aN=function(t){return function(e){return e.translate(t.left,t.top)}},cN=function(t){return function(e,n){return K(t,(function(t,e){return e(t)}),Ou(e,n))}},sN=function(t,e,n){return t.fold(cN([aN(n),uN(e)]),cN([uN(e)]),cN([]))},lN=function(t,e,n){return t.fold(cN([aN(n)]),cN([]),cN([aN(e)]))},fN=function(t,e,n){return t.fold(cN([]),cN([uN(n)]),cN([aN(e),uN(n)]))},dN=function(t,e,n){var r=t.fold((function(t,e){return{position:B.some("absolute"),left:B.some(t+"px"),top:B.some(e+"px")}}),(function(t,e){return{position:B.some("absolute"),left:B.some(t-n.left+"px"),top:B.some(e-n.top+"px")}}),(function(t,e){return{position:B.some("fixed"),left:B.some(t+"px"),top:B.some(e+"px")}}));return T({right:B.none(),bottom:B.none()},r)},mN=function(t,e,n,r){var o=function(t,o){return function(i,u){var a=t(e,n,r);return o(i.getOr(a.left),u.getOr(a.top))}};return t.fold(o(fN,gN),o(lN,hN),o(sN,pN))},gN=iN.offset,hN=iN.absolute,pN=iN.fixed,vN=function(t,e){var n=qo(t,e);return s(n)?NaN:parseInt(n,10)},bN=function(t,e,n,r){return function(t,e){var n=t.element,r=vN(n,e.leftAttr),o=vN(n,e.topAttr);return isNaN(r)||isNaN(o)?B.none():B.some(Ou(r,o))}(t,e).fold((function(){return n}),(function(t){return pN(t.left+r.left,t.top+r.top)}))},yN=function(t,e,n,r,o,i){var u=bN(t,e,n,r),a=e.mustSnap?CN(t,e,u,o,i):SN(t,e,u,o,i),c=sN(u,o,i);return function(t,e,n){var r=t.element;Wo(r,e.leftAttr,n.left+"px"),Wo(r,e.topAttr,n.top+"px")}(t,e,c),a.fold((function(){return{coord:pN(c.left,c.top),extra:B.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},wN=function(t,e){!function(t,e){var n=t.element;Xo(n,e.leftAttr),Xo(n,e.topAttr)}(t,e)},xN=function(t,e,n,r){return lt(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var u=lN(t,o,i),a=lN(e,o,i);return Math.abs(u.left-a.left)<=n&&Math.abs(u.top-a.top)<=r}(e,o,t.range.left,t.range.top,n,r)?B.some({output:mN(t.output,e,n,r),extra:t.extra}):B.none()}))},CN=function(t,e,n,r,o){var i=e.getSnapPoints(t);return xN(i,n,r,o).orThunk((function(){return K(i,(function(t,e){var i=e.sensor,u=function(t,e,n,r,o,i){var u=lN(t,o,i),a=lN(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return Ou(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:B.some(u),snap:B.some(e)}}),(function(n){return(u.left+u.top)/2<=(n.left+n.top)/2?{deltas:B.some(u),snap:B.some(e)}:t}))}),{deltas:B.none(),snap:B.none()}).snap.map((function(t){return{output:mN(t.output,n,r,o),extra:t.extra}}))}))},SN=function(t,e,n,r,o){var i=e.getSnapPoints(t);return xN(i,n,r,o)},kN=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=ho(t.element),u=Bu(i),a=I_(o),c=function(t,e,n){return{coord:mN(t.output,t.output,e,n),extra:t.extra}}(r,u,a),s=dN(c.coord,0,a);Qi(o,s)}}}),ON=function(t,e){t.getSystem().addToGui(e),function(t){yo(t.element).filter(lo).each((function(e){eu(e,"z-index").each((function(t){Wo(e,"data-initial-z-index",t)})),Yi(e,"z-index",Zi(t.element,"z-index"))}))}(e)},TN=function(t){!function(t){yo(t.element).filter(lo).each((function(t){Go(t,"data-initial-z-index").fold((function(){return ou(t,"z-index")}),(function(e){return Yi(t,"z-index",e)})),Xo(t,"data-initial-z-index")}))}(t),t.getSystem().removeFromGui(t)},_N=function(t,e,n){return t.getSystem().build(pw.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},EN=Ge("snaps",[Me("getSnapPoints"),pa("onSensor"),Me("leftAttr"),Me("topAttr"),$e("lazyViewport",qu),$e("mustSnap",!1)]),AN=[$e("useFixed",S),Me("blockerClass"),$e("getTarget",b),$e("onDrag",h),$e("repositionTarget",!0),$e("onDrop",h),Ze("getBounds",qu),EN],DN=function(t){return(e=eu(t,"left"),n=eu(t,"top"),r=eu(t,"position"),o=function(t,e,n){return("fixed"===n?pN:gN)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?B.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):B.none()).getOrThunk((function(){var e=_u(t);return hN(e.left,e.top)}));var e,n,r,o},MN=function(t,e,n,r,o,i,u){return function(t,e,n,r,o){var i=o.bounds,u=lN(e,n,r),a=za(u.left,i.x,i.x+i.width-o.width),c=za(u.top,i.y,i.y+i.height-o.height),s=hN(a,c);return e.fold((function(){var t=fN(s,n,r);return gN(t.left,t.top)}),v(s),(function(){var t=sN(s,n,r);return pN(t.left,t.top)}))}(0,e.fold((function(){var t,e,u,a=(t=n,e=i.left,u=i.top,t.fold((function(t,n){return gN(t+e,n+u)}),(function(t,n){return hN(t+e,n+u)}),(function(t,n){return pN(t+e,n+u)}))),c=sN(a,r,o);return pN(c.left,c.top)}),(function(e){var u=yN(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord})),r,o,u)},NN=function(t,e){return{bounds:t.getBounds(),height:Su(e.element),width:Mu(e.element)}},RN=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return NN(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=ho(t.element),u=Bu(i),a=I_(o),c=DN(o),s=MN(t,e.snaps,c,u,a,r,n),l=dN(s,0,a);Qi(o,l)}e.onDrag(t,o,r)}(t,e,u,n)}))},zN=function(t,e,n,r){e.each(TN),n.snaps.each((function(e){wN(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},BN=function(t){return function(e,n){var r=function(t){n.setStartData(NN(e,t))};return Gr(E([Kr(Er(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r)))}},IN=Object.freeze({__proto__:null,getData:function(t){return B.from(Ou(t.x,t.y))},getDelta:function(t,e){return Ou(e.left-t.left,e.top-t.top)}}),PN=function(t,e,n){return[Kr(Jn(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return zN(r,B.some(c),t,e)},u=nw(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(n){u.cancel(),RN(r,t,e,IN,n)}},c=_N(r,t.blockerClass,function(t){return Gr([Kr(Jn(),t.forceDrop),Kr(tr(),t.drop),Kr(Qn(),(function(e,n){t.move(n.event)})),Kr(Zn(),t.delayDrop)])}(a));n(r),ON(r,c)}}))]},LN=E(E([],AN),[wa("dragger",{handlers:BN(PN)})]),HN=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return B.some(Ou(e.clientX,e.clientY))}(e):B.none()},getDelta:function(t,e){return Ou(e.left-t.left,e.top-t.top)}}),FN=function(t,e,n){var r=Lc(),o=function(n){zN(n,r.get(),t,e),r.clear()};return[Kr($n(),(function(i,u){u.stop();var a=function(){return o(i)},c={drop:a,delayDrop:h,forceDrop:a,move:function(n){RN(i,t,e,HN,n)}},s=_N(i,t.blockerClass,function(t){return Gr([Kr($n(),t.forceDrop),Kr(Kn(),t.drop),Kr(Yn(),t.drop),Kr(Xn(),(function(e,n){t.move(n.event)}))])}(c));r.set(s);n(i),ON(i,s)})),Kr(Xn(),(function(n,r){r.stop(),RN(n,t,e,HN,r.event)})),Kr(Kn(),(function(t,e){e.stop(),o(t)})),Kr(Yn(),o)]},VN=LN,jN=E(E([],AN),[wa("dragger",{handlers:BN(FN)})]),UN=E(E([],AN),[wa("dragger",{handlers:BN((function(t,e,n){return E(E([],PN(t,e,n)),FN(t,e,n))}))})]),WN=dc({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:VN,touch:jN,mouseOrTouch:UN}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:B.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=B.none(),e=B.none(),n=v({});return bi({readState:n,reset:function(){t=B.none(),e=B.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=B.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=B.some(t)}})}}),apis:kN}),qN=function(t,e,n,r,o,i){return t.fold((function(){return WN.snap({sensor:hN(n-20,r-20),range:Ou(o,i),output:hN(B.some(n),B.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,u=t.element.dom.getBoundingClientRect();return WN.snap({sensor:hN(o,i),range:Ou(40,40),output:hN(B.some(n-u.width/2),B.some(r-u.height/2)),extra:{td:e}})}))},GN=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return Mn(t,e)}))})(e.get(),o)||(e.set(o),n(o))},mustSnap:!0}},$N=function(t){return Jh(Yh.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:cc([WN.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),Nx.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},XN=function(t,e){var n=nn([]),r=nn([]),o=nn(!1),i=Lc(),u=Lc(),a=function(t){var n=Wu(t);return qN(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=Wu(t);return qN(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=GN((function(){return W(n.get(),(function(t){return a(t)}))}),i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=GN((function(){return W(r.get(),(function(t){return c(t)}))}),u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=$N(s),d=$N(l),m=bu(f.asSpec()),g=bu(d.asSpec()),h=function(e,n,r,o){var i=r(n);WN.snapTo(e,i);!function(e,n,r,o){var i=n.dom.getBoundingClientRect();ou(e.element,"display");var u=bo(on.fromDom(t.getBody())).dom.innerHeight,a=r(i),c=o(i,u);(a||c)&&Yi(e.element,"display","none")}(e,n,(function(t){return t[o]<0}),(function(t,e){return t[o]>e}))},p=function(t){return h(m,t,a,"top")},v=function(t){return h(g,t,c,"bottom")};En().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(Tl(e,m),Tl(e,g),o.set(!0)),i.set(t.start),u.set(t.finish),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),p(t.start),v(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(p),u.get().each(v)})),t.on("TableSelectionClear",(function(){o.get()&&(Al(m),Al(g),o.set(!1)),i.clear(),u.clear()})))},KN=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},YN=function(t,e,n){e.delimiter||(e.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:cc([Lg.config({mode:"flow",selector:"div[role=button]"}),Nd.config({disabled:n.isDisabled}),pb(),Sw.config({}),Ug.config({}),Wg("elementPathEvents",[ro((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return Lg.focusIn(r)})),t.on("NodeChange",(function(o){var i,u,a=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!KN(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);a.length>0?Ug.set(r,(i=W(a||[],(function(e,r){return Yh.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:cc([bb(n.isDisabled),pb()])})})),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},K(i.slice(1),(function(t,e){var n=t;return n.push(u),n.push(e),n}),[i[0]]))):Ug.set(r,[])}))}))])]),components:[]}};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(rD||(rD={}));var JN=function(t,e,n){var r=on.fromDom(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=KD(r+e.top,qv(t),$v(t)),n===rD.Both&&(i.width=KD(o+e.left,Wv(t),Gv(t))),i}(t,e,n,Cu(r),Du(r));Mt(o,(function(t,e){return Yi(r,e,XD(t))})),function(t){t.fire("ResizeEditor")}(t)},QN=function(t,e,n,r){var o=Ou(20*n,20*r);return JN(t,o,e),B.some(!0)},ZN=function(t,e){var n=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?rD.None:"both"===n?rD.Both:rD.Vertical}(t);return n===rD.None?B.none():B.some(up("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize")},behaviours:[WN.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){return JN(t,o,n)},blockerClass:"tox-blocker"}),Lg.config({mode:"special",onLeft:function(){return QN(t,n,-1,0)},onRight:function(){return QN(t,n,1,0)},onUp:function(){return QN(t,n,0,-1)},onDown:function(){return QN(t,n,0,1)}}),Sw.config({}),Kg.config({})]},e.icons))},tR=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(YN(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return Ug.set(t,[hu(e.translate(["{0} "+r,n[r]]))])};return Yh.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:cc([bb(e.isDisabled),pb(),Sw.config({}),Ug.config({}),lf.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Wg("wordcount-events",[uo((function(t){var e=lf.getValue(t),n="words"===e.mode?"characters":"words";lf.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),ro((function(e){t.on("wordCountUpdate",(function(t){var n=lf.getValue(e).mode;lf.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[yr()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=Qh.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=ZN(t,e);return r.concat(o.toArray())}()}},eR=function(t){var e,n,r,o,i=t.inline,u=i?tM:GD,a=cb(t)?cE:z_,c=B.none(),s=En(),l=s.browser.isIE()?["tox-platform-ie"]:[],f=s.deviceType.isTouch()?["tox-platform-touch"]:[],d=rb(t),m=ub(t),g=Qh.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[cs]=d?Ac.BottomToTop:Ac.TopToBottom,e)},v=function(){return c.bind(PA.getHeader)},b=function(){Yi(G.element,"width",document.body.clientWidth+"px")},y=bu((n=Mn(Gi(),m)&&"grid"===Zi(m,"display"),r={dom:T({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(f)},g),behaviours:cc([xl.config({useFixed:function(){return a.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:Gr([Kr(Ar(),b)])},jt(r,n?o:{}))),w=function(){return mt.value(y)},x=Jh({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(t){return PA.getThrobber(t)})).getOrDie("Could not find throbber element")},S=w_(y,t,(function(){return c.bind((function(t){return x.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),k=PA.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){t.focus()}}),O=Zv(t),_=PA.parts.toolbar(T({dom:{tag:"div",classes:["tox-toolbar"]},getSink:w,providers:S.shared.providers,onEscape:function(){t.focus()},type:O,lazyToolbar:function(){return c.bind((function(t){return PA.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),E=PA.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){t.focus()},type:O}),A=PA.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),D=PA.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),M=PA.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),N=t.getParam("statusbar",!0,"boolean")&&!i?B.some(tR(t,S.shared.providers)):B.none(),R={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[A,D]},z=Jv(t),I=Kv(t),P=Xv(t),L=PA.parts.header({dom:T({tag:"div",classes:["tox-editor-header"]},p),components:Q([P?[k]:[],z?[E]:I?[_]:[],ib(t)?[]:[x.asSpec()]]),sticky:cb(t),editor:t,sharedBackstage:S.shared}),H=Q([d?[]:[L],i?[]:[R],d?[L]:[]]),F=Q([[{dom:{tag:"div",classes:["tox-editor-container"]},components:H}],i?[]:N.toArray(),[M]]),V=ab(t),j=T(T({role:"application"},Qh.isRtl()?{dir:"rtl"}:{}),V?{"aria-hidden":"true"}:{}),U=bu(PA.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(f).concat(l),styles:T({visibility:"hidden"},V?{opacity:"0",border:"0"}:{}),attributes:j},components:F,behaviours:cc([pb(),Nd.config({disableClass:"tox-tinymce--disabled"}),Lg.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"})])}));c=B.some(U),t.shortcuts.add("alt+F9","focus menubar",(function(){PA.focusMenubar(U)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){PA.focusToolbar(U)})),t.addCommand("ToggleToolbarDrawer",(function(){PA.toggleToolbarDrawer(U)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return PA.isToolbarDrawerToggled(U)}));var W=vw(U),G=vw(y);!function(t,e,n){var r=function(t,r){q([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){q([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(Wl(),{target:t.target})},u=Fc(on.fromDom(document),"touchstart",i),a=Fc(on.fromDom(document),"touchmove",(function(t){return r(Tr(),t)})),c=Fc(on.fromDom(document),"touchend",(function(t){return r(_r(),t)})),s=Fc(on.fromDom(document),"mousedown",i),l=Fc(on.fromDom(document),"mouseup",(function(t){0===t.raw.button&&o(Gl(),{target:t.target})})),f=function(t){return o(Wl(),{target:on.fromDom(t.target)})},d=function(t){0===t.button&&o(Gl(),{target:on.fromDom(t.target)})},m=function(){q(t.editorManager.get(),(function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})}))},g=function(t){return r(Er(),jc(t))},h=function(t){o(ql(),{}),r(Ar(),jc(t))},p=function(){return o(ql(),{})},v=function(e){e.state&&o(Wl(),{target:on.fromDom(t.getContainer())})},b=function(t){o(Wl(),{target:on.fromDom(t.relatedTarget.getContainer())})};t.on("PostRender",(function(){t.on("click",f),t.on("tap",f),t.on("mouseup",d),t.on("mousedown",m),t.on("ScrollWindow",g),t.on("ResizeWindow",h),t.on("ResizeEditor",p),t.on("AfterProgressState",v),t.on("DismissPopups",b)})),t.on("remove",(function(){t.off("click",f),t.off("tap",f),t.off("mouseup",d),t.off("mousedown",m),t.off("ScrollWindow",g),t.off("ResizeWindow",h),t.off("ResizeEditor",p),t.off("AfterProgressState",v),t.off("DismissPopups",b),s.unbind(),u.unbind(),a.unbind(),c.unbind(),l.unbind()})),t.on("detach",(function(){Rl(e),Rl(n),e.destroy(),n.destroy()}))}(t,W,G);var $=function(){var e=XD(YD(t)),n=XD(function(t){return JD(t).getOr(Uv(t))}(t));return t.inline||(ru("div","width",n)&&Yi(U.element,"width",n),ru("div","height",e)?Yi(U.element,"height",e):Yi(U.element,"height","200px")),e};return{mothership:W,uiMothership:G,backstage:S,renderUI:function(){a.setup(t,S.shared,v),PM(t,S),oN(t,w,S),function(t){var e=t.ui.registry.getAll().sidebars;q(At(e),(function(n){var r=e[n],o=function(){return Fi(B.from(t.queryCommandValue("ToggleSidebar")),n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))}(t),KE(t,C,S.shared),Nt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=Yv(t),s={menuItems:r,menus:sb(t),menubar:lb(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:O===$p.floating,buttons:n,sidebar:i};wM(t,o,y,{backstage:S}),XN(t,y);var l=t.getElement(),f=$(),d={mothership:W,uiMothership:G,outerContainer:U},m={targetNode:l,height:f};return u.render(t,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:G.broadcast,broadcastOn:G.broadcastOn,register:h}}}}},nR=v([Me("lazySink"),Fe("dragBlockClass"),Ze("getBounds",qu),$e("useTabstopAt",k),$e("eventOrder",{}),ff("modalBehaviours",[Lg]),va("onExecute"),ya("onEscape")]),rR={sketch:b},oR=v([Vf({name:"draghandle",overrides:function(t,e){return{behaviours:cc([WN.config({mode:"mouse",getTarget:function(t){return Ju(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(e,null,2)).message),getBounds:t.getDragBounds})])}}}),Hf({schema:[Me("dom")],name:"title"}),Hf({factory:rR,schema:[Me("dom")],name:"close"}),Hf({factory:rR,schema:[Me("dom")],name:"body"}),Vf({factory:rR,schema:[Me("dom")],name:"footer"}),Ff({factory:{sketch:function(t,e){return T(T({},t),{dom:e.dom,components:e.components})}},schema:[$e("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),$e("components",[])],name:"blocker"})]),iR=gd({name:"ModalDialog",configFields:nR(),partFields:oR(),factory:function(t,e,n,r){var o,i=Lc(),u=ei("modal-events"),a=T(T({},t.eventOrder),((o={})[Dr()]=[u].concat(t.eventOrder["alloy.system.attached"]||[]),o));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){i.set(e);var n=t.lazySink(e).getOrDie(),o=r.blocker(),u=n.getSystem().build(T(T({},o),{components:o.components.concat([yu(e)]),behaviours:cc([Kg.config({}),Wg("dialog-blocker-events",[no(nr(),(function(){Lg.focusIn(e)}))])])}));Tl(n,u),Lg.focusIn(e)},hide:function(t){i.clear(),yo(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){Al(t)}))}))},getBody:function(e){return td(e,t,"body")},getFooter:function(e){return td(e,t,"footer")},setIdle:function(t){qE.unblock(t)},setBusy:function(t,e){qE.block(t,e)}},eventOrder:a,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:mf(t.modalBehaviours,[Ug.config({}),Lg.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),qE.config({getRoot:i.get}),Wg(u,[ro((function(e){var n,r,o,i,u,a;n=e.element,r=td(e,t,"title").element,o=Go(n,"id").fold((function(){var t=ei("dialog-label");return Wo(r,"id",t),t}),b),Wo(n,"aria-labelledby",o),i=e.element,u=td(e,t,"body").element,a=B.from(qo(i,"id")).fold((function(){var t=ei("dialog-describe");return Wo(u,"id",t),t}),b),Wo(i,"aria-describedby",a)}))])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),uR=ue([ze("type"),ze("name")].concat(yv)),aR=he,cR=[Ee("name","name",qt((function(){return ei("button-name")})),ge),Ue("icon"),Je("align","end",["start","end"]),Qe("primary",!1),Qe("disabled",!1)],sR=E(E([],cR),[ze("text")]),lR=E([Be("type",["submit","cancel","custom"])],sR),fR=E([Be("type",["menu"]),Ue("text"),Ue("tooltip"),Ue("icon"),He("items",uR)],cR),dR=_e("type",{submit:lR,cancel:lR,custom:lR,menu:fR}),mR=[ze("type"),ze("text"),Be("level",["info","warn","error","success"]),ze("icon"),$e("url","")],gR=ue(mR),hR=[ze("type"),ze("text"),Qe("disabled",!1),Qe("primary",!1),Ee("name","name",qt((function(){return ei("button-name")})),ge),Ue("icon"),Qe("borderless",!1)],pR=ue(hR),vR=[ze("type"),ze("name"),ze("label"),Qe("disabled",!1)],bR=ue(vR),yR=he,wR=[ze("type"),ze("name")],xR=wR.concat([Ue("label")]),CR=xR.concat([$e("columns","auto")]),SR=ue(CR),kR=le([ze("value"),ze("text"),ze("icon")]),OR=ue(xR),TR=ge,_R=ue(xR),ER=ge,AR=wR.concat([Ye("tag","textarea"),ze("scriptId"),ze("scriptUrl"),function(t,e){return Xe(t,e,be)}("settings",void 0)]),DR=wR.concat([Ye("tag","textarea"),Ie("init")]),MR=xe((function(t){return Se("customeditor.old",ie(DR),t).orThunk((function(){return Se("customeditor.new",ie(AR),t)}))})),NR=ge,RR=ue(xR),zR=ae(Zt),BR=function(t){return[ze("type"),Re("columns"),t]},IR=[ze("type"),ze("html"),Je("presets","presentation",["presentation","document"])],PR=ue(IR),LR=xR.concat([Qe("sandboxed",!0)]),HR=ue(LR),FR=ge,VR=xR.concat([Ne("currentState",ue([Me("blob"),ze("url")]))]),jR=ue(VR),UR=xR.concat([Ue("inputMode"),Ue("placeholder"),Qe("maximized",!1),Qe("disabled",!1)]),WR=ue(UR),qR=ge,GR=function(t){return[ze("type"),ze("label"),t]},$R=[ze("text"),ze("value")],XR=[ze("text"),He("items",function(t,e){return n=Wt(e),{extract:function(t,e){return n().extract(t,e)},toString:function(){return n().toString()}};var n}(0,(function(){return KR})))],KR=ce([ue($R),ue(XR)]),YR=xR.concat([He("items",KR),Qe("disabled",!1)]),JR=ue(YR),QR=ge,ZR=xR.concat([Le("items",[ze("text"),ze("value")]),Ke("size",1),Qe("disabled",!1)]),tz=ue(ZR),ez=ge,nz=xR.concat([Qe("constrain",!0),Qe("disabled",!1)]),rz=ue(nz),oz=ue([ze("width"),ze("height")]),iz=[ze("type"),He("header",ge),He("cells",ae(ge))],uz=ue(iz),az=xR.concat([Ue("placeholder"),Qe("maximized",!1),Qe("disabled",!1)]),cz=ue(az),sz=ge,lz=xR.concat([Je("filetype","file",["image","media","file"]),$e("disabled",!1)]),fz=ue(lz),dz=ue([ze("value"),$e("meta",{})]),mz=function(t){return Ee("items","items",{tag:"required",process:{}},ae(xe((function(e){return Se("Checking item of "+t,gz,e).fold((function(t){return mt.error(Te(t))}),(function(t){return mt.value(t)}))}))))},gz=re((function(){return we("type",{alertbanner:gR,bar:ue((t=mz("bar"),[ze("type"),t])),button:pR,checkbox:bR,colorinput:OR,colorpicker:_R,dropzone:RR,grid:ue(BR(mz("grid"))),iframe:HR,input:WR,listbox:JR,selectbox:tz,sizeinput:rz,textarea:cz,urlinput:fz,customeditor:MR,htmlpanel:PR,imagetools:jR,collection:SR,label:ue(GR(mz("label"))),table:uz,panel:pz});var t})),hz=[ze("type"),$e("classes",[]),He("items",gz)],pz=ue(hz),vz=[Ee("name","name",qt((function(){return ei("tab-name")})),ge),ze("title"),He("items",gz)],bz=[ze("type"),Le("tabs",vz)],yz=ue(bz),wz=sR,xz=dR,Cz=ue([ze("title"),Ne("body",we("type",{panel:pz,tabpanel:yz})),Ye("size","normal"),He("buttons",xz),$e("initialData",{}),Ze("onAction",h),Ze("onChange",h),Ze("onSubmit",h),Ze("onClose",h),Ze("onCancel",h),$e("onTabChange",h)]),Sz=ue(E([Be("type",["cancel","custom"])],wz)),kz=ue([ze("title"),ze("url"),je("height"),je("width"),qe("buttons",Sz),Ze("onAction",h),Ze("onCancel",h),Ze("onClose",h),Ze("onMessage",h)]),Oz=function(t){return i(t)?[t].concat(Z(Pt(t),Oz)):u(t)?Z(t,Oz):[]},Tz=function(t){return o(t.type)&&o(t.name)},_z={checkbox:yR,colorinput:TR,colorpicker:ER,dropzone:zR,input:qR,iframe:FR,sizeinput:oz,selectbox:ez,listbox:QR,size:oz,textarea:sz,urlinput:dz,customeditor:NR,collection:kR,togglemenuitem:aR},Ez=function(t){var e=function(t){return $(Oz(t),Tz)}(t),n=Z(e,(function(t){return function(t){return B.from(_z[t.type])}(t).fold((function(){return[]}),(function(e){return[Ne(t.name,e)]}))}));return ue(n)},Az=function(t){return{internalDialog:ke(Se("dialog",Cz,t)),dataValidator:Ez(t),initialData:t.initialData}},Dz={open:function(t,e){var n=Az(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(ke(Se("dialog",kz,e)))},redial:function(t){return Az(t)}},Mz=function(t){var e=[],n={};return Mt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?mt.error(e):mt.value(n)},Nz=function(t,e){var n=Jh(OS.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:W(t.items,(function(t){return TT(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:cc([Lg.config({mode:"acyclic",useTabstopAt:x(ZS)}),RS(n),jS(n,{postprocess:function(t){return Mz(t).fold((function(t){return console.error(t),{}}),b)}})])}},Rz=md({name:"TabButton",configFields:[$e("uid",void 0),Me("value"),Ee("dom","dom",$t((function(){return{attributes:{role:"tab",id:ei("aria"),"aria-selected":"false"}}})),fe()),Fe("action"),$e("domModification",{}),ff("tabButtonBehaviours",[Kg,Lg,lf]),Me("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:sh(t.action),behaviours:mf(t.tabButtonBehaviours,[Kg.config({}),Lg.config({mode:"execution",useSpace:!0,useEnter:!0}),lf.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),zz=v([Me("tabs"),Me("dom"),$e("clickToDismiss",!1),ff("tabbarBehaviours",[Ud,Lg]),ga(["tabClass","selectedClass"])]),Bz=jf({factory:Rz,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){Ud.dehighlight(t,e),Vr(t,Pr(),{tabbar:t,button:e})},n=function(t,e){Ud.highlight(t,e),Vr(t,Ir(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=Ud.isHighlighted(o,r);(i&&t.clickToDismiss?e:i?h:n)(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),Iz=v([Bz]),Pz=gd({name:"Tabbar",configFields:zz(),partFields:Iz(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:mf(t.tabbarBehaviours,[Ud.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){Wo(e.element,"aria-selected","true")},onDehighlight:function(t,e){Wo(e.element,"aria-selected","false")}}),Lg.config({mode:"flow",getInitial:function(t){return Ud.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),Lz=md({name:"Tabview",configFields:[ff("tabviewBehaviours",[Ug])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:mf(t.tabviewBehaviours,[Ug.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),Hz=v([$e("selectFirst",!0),pa("onChangeTab"),pa("onDismissTab"),$e("tabs",[]),ff("tabSectionBehaviours",[])]),Fz=Hf({factory:Pz,schema:[Me("dom"),Pe("markers",[Me("tabClass"),Me("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),Vz=Hf({factory:Lz,name:"tabview"}),jz=v([Fz,Vz]),Uz=gd({name:"TabSection",configFields:Hz(),partFields:jz(),factory:function(t,e,n,r){var o=function(e,n){Zf(e,t,"tabbar").each((function(t){n(t).each(jr)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:df(t.tabSectionBehaviours),events:Gr(Q([t.selectFirst?[ro((function(t,e){o(t,Ud.getFirst)}))]:[],[Kr(Ir(),(function(e,n){!function(e){var n=lf.getValue(e);Zf(e,t,"tabview").each((function(r){Y(t.tabs,(function(t){return t.value===n})).each((function(n){var o=n.view();Go(e.element,"id").each((function(t){Wo(r.element,"aria-labelledby",t)})),Ug.set(r,o),t.onChangeTab(r,e,o)}))}))}(n.event.button)})),Kr(Pr(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return Zf(e,t,"tabview").map((function(t){return Ug.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=Ud.getCandidates(t);return Y(n,(function(t){return lf.getValue(t)===e})).filter((function(e){return!Ud.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),Wz=function(t,e){Yi(t,"height",e+"px"),En().browser.isIE()?ou(t,"flex-basis"):Yi(t,"flex-basis",e+"px")},qz=function(t,e,n){Ju(t,'[role="dialog"]').each((function(t){Zu(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Yi(e,"height","0"),Yi(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=vo(t).dom,i=Ju(t,".tox-dialog-wrap").getOr(t);r="fixed"===Zi(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var u=Cu(e),a=e.dom.offsetLeft>=n.dom.offsetLeft+Du(n)?Math.max(Cu(n),u):u,c=parseInt(Zi(t,"margin-top"),10)||0,s=parseInt(Zi(t,"margin-bottom"),10)||0;return r-(Cu(t)+c+s-a)}(t,e,r))})).each((function(t){Wz(e,t)}))}))}))},Gz=function(t){return Zu(t,'[role="tabpanel"]')},$z=function(t){var e;return{smartTabHeight:(e=Lc(),{extraEvents:[ro((function(n){var r=n.element;Gz(r).each((function(o){Yi(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){(function(t){return at(it(t,(function(t,e){return t>e?-1:t<e?1:0})))})(function(t,e,n){return W(t,(function(r,o){Ug.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return Ug.set(n,[]),i.height}))}(t,o,n)).fold(e.clear,e.set)})),qz(r,o,e),ou(o,"visibility"),function(t,e){at(t).each((function(t){return Uz.showTab(e,t.value)}))}(t,n),Kh.requestAnimationFrame((function(){qz(r,o,e)}))}))})),Kr(Ar(),(function(t){var n=t.element;Gz(n).each((function(t){qz(n,t,e)}))})),Kr(Pw,(function(t,n){var r=t.element;Gz(r).each((function(t){var n=bc(Eo(t));Yi(t,"visibility","hidden");var o=eu(t,"height").map((function(t){return parseInt(t,10)}));ou(t,"height"),ou(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(i),qz(r,t,e)):o.each((function(e){Wz(t,e)})),ou(t,"visibility"),n.each(pc)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},Xz=function(t,e){var n=nn({}),r=function(t){var e=lf.getValue(t),r=Mz(e).getOr({}),o=n.get(),i=jt(o,r);n.set(i)},o=function(t){var e=n.get();lf.setValue(t,e)},i=nn(null),u=W(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[OS.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:W(t.items,(function(t){return TT(n,t,e)})),formBehaviours:cc([Lg.config({mode:"acyclic",useTabstopAt:x(ZS)}),Wg("TabView.form.events",[ro(o),oo(r)]),gc.config({channels:Pn([{key:"send-data-to-section",value:{onReceive:r}},{key:"send-data-to-view",value:{onReceive:o}}])})])}}))]}}})),a=$z(u).smartTabHeight;return Uz.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=lf.getValue(e);Vr(t,Iw,{name:r,oldName:i.get()}),i.set(r)},tabs:u,components:[Uz.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[Pz.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:cc([Sw.config({})])}),Uz.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:a.selectFirst,tabSectionBehaviours:cc([Wg("tabpanel",a.extraEvents),Lg.config({mode:"acyclic"}),bd.config({find:function(t){return at(Uz.getViewItems(t))}}),lf.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn(["send-data-to-section"],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn(["send-data-to-view"],{})}}})])})},Kz=ei("update-dialog"),Yz=ei("update-title"),Jz=ei("update-body"),Qz=ei("update-footer"),Zz=ei("body-send-message"),tB=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:T(T({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:cc([zS(0),xD.config({channel:Jz,updateState:function(t,e){return B.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[Xz(t.body,n)];default:return[Nz(t.body,n)]}},initialData:t})])}},eB=Ab.deviceType.isTouch(),nB=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},rB=function(t,e){return iR.parts.close(Yh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:cc([Sw.config({})])}))},oB=function(){return iR.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},iB=function(t,e){return iR.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:GE("<p>"+e.translate(t)+"</p>")}]}]})},uB=function(t){return iR.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},aB=function(t,e){return[pw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),pw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},cB=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return iR.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),B.some(!0)},useTabstopAt:function(t){return!ZS(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:T({position:"relative"},t.extraStyles)},components:E([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:GE('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:eB?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:cc(E([Kg.config({}),Wg("dialog-events",t.dialogEvents.concat([no(nr(),(function(t,e){Lg.focusIn(t)}))])),Wg("scroll-lock",[ro((function(){zi(Gi(),i)})),oo((function(){Ii(Gi(),i)}))])],t.extraBehaviours)),eventOrder:T((e={},e[yr()]=["dialog-events"],e[Dr()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[Mr()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},sB=function(t){return Yh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[up("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){Fr(t,Mw)}})},lB=function(t,e,n){var r=function(t){return[hu(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:T({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:cc([xD.config({channel:Yz,renderComponents:r})])}},fB=function(){return{dom:GE('<div class="tox-dialog__draghandle"></div>')}},dB=function(t,e){return function(t,e){var n=iR.parts.title(lB(t,B.none(),e)),r=iR.parts.draghandle(fB()),o=iR.parts.close(sB(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return pw.sketch({dom:GE('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},mB=function(t,e,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:GE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},gB=function(t,e,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){iR.setBusy(t(),(function(t,r){return mB(n.message,r,e)}))},onUnblock:function(){iR.setIdle(t())}}},hB=function(t,e,n,r){var o;return bu(cB(T(T({},t),{lazySink:r.shared.getSink,extraBehaviours:E([xD.config({channel:Kz,updateState:function(t,e){return B.some(e)},initialData:e}),qS({})],t.extraBehaviours),onEscape:function(t){Fr(t,Mw)},dialogEvents:n,eventOrder:(o={},o[br()]=[xD.name(),gc.name()],o[Dr()]=["scroll-lock",xD.name(),"messages","dialog-events","alloy.base.behaviour"],o[Mr()]=["alloy.base.behaviour","dialog-events","messages",xD.name(),"scroll-lock"],o)})))},pB=function(t){return W(t,(function(t){return"menu"===t.type?function(t){var e=W(t.items,(function(t){var e=nn(!1);return T(T({},t),{storage:e})}));return T(T({},t),{items:e})}(t):t}))},vB=function(t){return K(t,(function(t,e){return"menu"===e.type?K(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},bB=function(t,e){return[Zr(nr(),QS),t(Dw,(function(t,n){e.onClose(),n.onClose()})),t(Mw,(function(t,e,n,r){e.onCancel(t),Fr(r,Dw)})),Kr(Bw,(function(t,n){return e.onUnblock()})),Kr(zw,(function(t,n){return e.onBlock(n.event)}))]},yB=function(t,e){var n=function(e,n){return Kr(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event,e)}))}))},r=function(t,e){xD.getState(t).get().each((function(n){e(n,t)}))};return E(E([],bB(n,e)),[n(Nw,(function(t,e,n){e.onAction(t,{name:n.name})}))])},wB=function(t,e,n){var r=function(e,n){return Kr(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){xD.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return E(E([],bB(r,e)),[r(Rw,(function(t,e){return e.onSubmit(t)})),r(Aw,(function(t,e,n){e.onChange(t,{name:n.name})})),r(Nw,(function(t,e,r,o){var i=function(){return Lg.focusIn(o)},u=function(t){return $o(t,"disabled")||Go(t,"aria-disabled").exists((function(t){return"true"===t}))},a=Eo(o.element),c=bc(a);e.onAction(t,{name:r.name,value:r.value}),bc(a).fold(i,(function(t){u(t)?i():c.exists((function(e){return Rn(t,e)&&u(e)}))?i():n().toOptional().filter((function(e){return!Rn(e.element,t)})).each(i)}))})),r(Iw,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),oo((function(e){var n=t();lf.setValue(e,n.getData())}))])},xB=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=G(n,(function(t){return"start"===t.align})),o=function(t,e){return pw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:W(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},CB=function(t,e){return{dom:GE('<div class="tox-dialog__footer"></div>'),components:[],behaviours:cc([xD.config({channel:Qz,initialData:t,updateState:function(t,n){var r=W(n.buttons,(function(t){var n=Jh(function(t,e){return gO(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return B.some({lookupByName:function(t,e){return function(t,e,n){return Y(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:xB})])}},SB=function(t,e){return iR.parts.footer(CB(t,e))},kB=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=bd.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return OS.getField(n,e).fold((function(){var r=t.getFooter();return xD.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return B.some(t)}))}return B.none()},OB=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},i={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=lf.getValue(r),i=Nt(n,(function(t){return t.get()}));return T(T({},o),i)},setData:function(e){r((function(r){var o=i.getData(),u=T(T({},o),e),a=function(t,e){var n=t.getRoot();return xD.getState(n).get().map((function(t){return ke(Se("data",t.dataValidator,e))})).getOr(e)}(t,u),c=t.getFormWrapper();lf.setValue(c,a),Mt(n,(function(t,e){Ht(u,e)&&t.set(u[e])}))}))},disable:function(e){kB(t,e).each(Nd.disable)},enable:function(e){kB(t,e).each(Nd.enable)},focus:function(e){kB(t,e).each(Kg.focus)},block:function(t){if(!o(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(e){Vr(e,zw,{message:t})}))},unblock:function(){r((function(t){Fr(t,Bw)}))},showTab:function(e){r((function(n){var r=t.getBody();xD.getState(r).get().exists((function(t){return t.isTabPanel()}))&&bd.getCurrent(r).each((function(t){Uz.showTab(t,e)}))}))},redial:function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([Kz],r),n.getSystem().broadcastOn([Yz],r.internalDialog),n.getSystem().broadcastOn([Jz],r.internalDialog),n.getSystem().broadcastOn([Qz],r.internalDialog),i.setData(r.initialData)}))},close:function(){r((function(t){Fr(t,Dw)}))}};return i},TB=function(t,e,n){var r=dB(t.internalDialog.title,n),o=function(t,e){var n=tB(t,B.none(),e,!1);return iR.parts.body(n)}({body:t.internalDialog.body},n),i=pB(t.internalDialog.buttons),u=vB(i),a=SB({buttons:i},n),c=wB((function(){return m}),gB((function(){return f}),n.shared.providers,e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),l={header:r,body:o,footer:B.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=hB(l,t,c,n),d={getRoot:v(f),getBody:function(){return iR.getBody(f)},getFooter:function(){return iR.getFooter(f)},getFormWrapper:function(){var t=iR.getBody(f);return bd.getCurrent(t).getOr(t)}},m=OB(d,e.redial,u);return{dialog:f,instanceApi:m}},_B=function(t,e,n,r){var o,i,u,a,c,s=ei("dialog-label"),l=ei("dialog-content"),f=Jh((u={title:t.internalDialog.title,draggable:!0},a=s,c=n.shared.providers,pw.sketch({dom:GE('<div class="tox-dialog__header"></div>'),components:[lB(u,B.some(a),c),fB(),sB(c)],containerBehaviours:cc([WN.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return ta(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=Jh(function(t,e,n,r){return tB(t,B.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=pB(t.internalDialog.buttons),g=vB(m),h=Jh(function(t,e){return CB(t,e)}({buttons:m},n)),p=wB((function(){return y}),{onBlock:function(t){qE.block(b,(function(e,r){return mB(t.message,r,n.shared.providers)}))},onUnblock:function(){qE.unblock(b)},onClose:function(){return e.closeWindow()}},n.shared.getSink),b=bu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=l,o)},eventOrder:(i={},i[br()]=[xD.name(),gc.name()],i[yr()]=["execute-on-form"],i[Dr()]=["reflecting","execute-on-form"],i),behaviours:cc([Lg.config({mode:"cyclic",onEscape:function(t){return Fr(t,Dw),B.some(!0)},useTabstopAt:function(t){return!ZS(t)&&("button"!==co(t)||"disabled"!==qo(t,"disabled"))}}),xD.config({channel:Kz,updateState:function(t,e){return B.some(e)},initialData:t}),Kg.config({}),Wg("execute-on-form",p.concat([no(nr(),(function(t,e){Lg.focusIn(t)}))])),qE.config({getRoot:function(){return B.some(b)}}),Ug.config({}),qS({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),y=OB({getRoot:v(b),getFooter:function(){return h.get(b)},getBody:function(){return d.get(b)},getFormWrapper:function(){var t=d.get(b);return bd.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:b,instanceApi:y}},EB=tinymce.util.Tools.resolve("tinymce.util.URI"),AB=["insertContent","setContent","execCommand","close","block","unblock"],DB=function(t){return i(t)&&-1!==AB.indexOf(t.mceAction)},MB=function(t,e,n,r){var u,a,s,l=dB(t.title,r),f=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[YS({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:cc([Sw.config({}),Kg.config({})])})]}],behaviours:cc([Lg.config({mode:"acyclic",useTabstopAt:x(ZS)})])};return iR.parts.body(e)}(t),d=t.buttons.bind((function(t){return 0===t.length?B.none():B.some(SB({buttons:t},r))})),m=yB((function(){return C}),gB((function(){return w}),r.shared.providers,e)),g=T(T({},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"}}))),h=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],p=new EB(t.url,{base_uri:new EB(window.location.href)}),v=p.protocol+"://"+p.host+(p.port?":"+p.port:""),b=Pc(),y=[Wg("messages",[ro((function(){var e=Fc(on.fromDom(window),"message",(function(e){if(p.isSameOrigin(new EB(e.raw.origin))){var r=e.raw.data;DB(r)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!c(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(n,C,r):function(t){return!DB(t)&&i(t)&&Ht(t,"mceAction")}(r)&&t.onMessage(C,r)}}));b.set(e)})),oo(b.clear)]),gc.config({channels:(u={},u[Zz]={onReceive:function(t,e){Zu(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,v)}))}},u)})],w=hB({header:l,body:f,footer:d,extraClasses:h,extraBehaviours:y,extraStyles:g},t,m,r),C=(a=w,s=function(t){a.getSystem().isConnected()&&t(a)},{block:function(t){if(!o(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");s((function(e){Vr(e,zw,{message:t})}))},unblock:function(){s((function(t){Fr(t,Bw)}))},close:function(){s((function(t){Fr(t,Dw)}))},sendMessage:function(t){s((function(e){e.getSystem().broadcastOn([Zz],t)}))}});return{dialog:w,instanceApi:C}},NB=function(t,e,n){return e&&n?[]:[tE.config({contextual:{lazyContext:function(){return B.some(Uu(on.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},RB=function(t){var e=t.backstage,n=t.editor,r=cb(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){iR.hide(c),r()},i=Jh(gO({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:B.none()},"cancel",t.backstage)),u=oB(),a=rB(o,e.providers),c=bu(cB({lazySink:function(){return e.getSink()},header:nB(u,a),body:iB(n,e.providers),footer:B.some(uB(aB([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Kr(Mw,o)],eventOrder:{}}));iR.show(c);var s=i.get(c);Kg.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){iR.hide(s),r(t)},i=Jh(gO({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:B.none()},"submit",t.backstage)),u=gO({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:B.none()},"cancel",t.backstage),a=oB(),c=rB((function(){return o(!1)}),e.providers),s=bu(cB({lazySink:function(){return e.getSink()},header:nB(a,c),body:iB(n,e.providers),footer:B.some(uB(aB([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Kr(Mw,(function(){return o(!1)})),Kr(Rw,(function(){return o(!0)}))],eventOrder:{}}));iR.show(s);var l=i.get(s);Kg.focus(l)}}}(t),u=function(t,r){return Dz.openUrl((function(t){var o=MB(t,{closeWindow:function(){iR.hide(o.dialog),r(o.instanceApi)}},n,e);return iR.show(o.dialog),o.instanceApi}),t)},a=function(t,n){return Dz.open((function(t,r,o){var i=r,u=TB({dataValidator:o,initialData:i,internalDialog:t},{redial:Dz.redial,closeWindow:function(){iR.hide(u.dialog),n(u.instanceApi)}},e);return iR.show(u.dialog),u.instanceApi.setData(i),u.instanceApi}),t)},c=function(t,o,i,u){return Dz.open((function(t,a,c){var s=ke(Se("data",c,a)),l=Lc(),f=e.shared.header.isPositionedAtTop(),d=function(){return l.on((function(t){Dh.reposition(t),tE.refresh(t)}))},m=_B({dataValidator:c,initialData:s,internalDialog:t},{redial:Dz.redial,closeWindow:function(){l.on(Dh.hide),n.off("ResizeEditor",d),l.clear(),i(m.instanceApi)}},e,u),g=bu(Dh.sketch(T(T({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:cc(E([Wg("window-manager-inline-events",[Kr(Nr(),(function(t,e){Fr(m.dialog,Mw)}))])],NB(n,r,f))),isExtraPart:function(t,e){return function(t){return ew(t,".tox-alert-dialog")||ew(t,".tox-confirm-dialog")}(e)}})));return l.set(g),Dh.showWithin(g,yu(m.dialog),{anchor:o},B.some(Gi())),r&&f||(tE.refresh(g),n.on("ResizeEditor",d)),m.instanceApi.setData(s),Lg.focusIn(m.dialog),m.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?c(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?c(t,e.shared.anchors.cursor(),r,n.ariaAttrs):a(t,r)},openUrl:function(t,e){return u(t,e)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};O.add("silver",(function(t){var e=eR(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;tw(t,r.shared);var u=RB({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:v(u),getNotificationManagerImpl:function(){return sp(0,{backstage:r},n)},ui:i()}}))}()}).call(this,n(28))},621:function(t,e){tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" fill-rule="nonzero"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-1.4-1.4L12 13.6 5.7 7.3z"/></svg>',"action-prev":'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 001.4-1.4L12 6.6l-7.7 7.7a1 1 0 001.4 1.4L12 9.4l6.3 6.3z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 110-2h9.2zm4 0h.8a1 1 0 010 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h6.8zm4 0H19a1 1 0 010 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h4.4zm4 0H19a1 1 0 010 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 010-2h2zm4 0h8a1 1 0 010 2H9.8l1.2-2zm5.2-13.5l1.3.7-9.7 16.3-1.3-.7 9.7-16.3z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 001.4-1V6a1 1 0 00-1.4-.9l-12 6a1 1 0 000 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 1.8z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 01-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 00-1 1z" fill-rule="nonzero"/></svg>',"border-style":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="2" x="3" y="6" rx="1"/><rect width="2.8" height="2" x="3" y="16" rx="1"/><rect width="2.8" height="2" x="6.8" y="16" rx="1"/><rect width="2.8" height="2" x="10.6" y="16" rx="1"/><rect width="2.8" height="2" x="14.4" y="16" rx="1"/><rect width="2.8" height="2" x="18.2" y="16" rx="1"/><rect width="8" height="2" x="3" y="11" rx="1"/><rect width="8" height="2" x="13" y="11" rx="1"/></g></svg>',"border-width":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="5" x="3" y="5" rx="1"/><rect width="18" height="3.5" x="3" y="11.5" rx="1"/><rect width="18" height="2" x="3" y="17" rx="1"/></g></svg>',brightness:'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7zm10 3.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 8zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7z" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-18zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7z" fill-rule="nonzero"/></svg>',"cell-background-color":'<svg width="24" height="24"><path d="M15.7 2l1.6 1.6-2.7 2.6 5.9 5.8c.7.7.7 1.7 0 2.4l-6.3 6.1a1.7 1.7 0 01-2.4 0l-6.3-6.1c-.7-.7-.7-1.7 0-2.4L15.7 2zM18 12l-4.5-4L9 12h9zM4 16s2 2.4 2 3.8C6 21 5.1 22 4 22s-2-1-2-2.2C2 18.4 4 16 4 16z"/></svg>',"cell-border-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M5 13v5h2v2H5a2 2 0 01-2-2v-5h2zm8-7V4h6a2 2 0 012 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1l.1-.1.1.1.2.3.2.2.2.2c.4.6.8 1.2.8 1.7 0 .8-.7 1.5-1.5 1.5S9 21.3 9 20.5c0-.5.4-1.1.8-1.7l.2-.2.2-.2.2-.3z"/><path d="M13 11l-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="M18.4 8l1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 01-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8zm1.6 7l-3-3-3 3h6z"/></g></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 01-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1zm4.8-6.8V10H7.7V5.8h-1v-1h2zM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1zM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1z" fill-rule="evenodd"/></svg>',"checklist-rtl":'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8a1 1 0 010 2h-8a1 1 0 010-2zM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 010-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 011.6 1.2l-8 12a1 1 0 01-1.5.1l-5-5a1 1 0 111.4-1.4l4.1 4.1 7.4-11z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 010-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 010-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 010-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 010-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 010-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2L13.4 12l3.9 3.8a1 1 0 01-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 01-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 011.5-1.5l3.8 3.9 3.8-3.9a1 1 0 011.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 01-.8 2 2.8 2.8 0 01.8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 01-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 01-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 01.8-2 2.8 2.8 0 01-.8-2zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2zM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 01-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 01-.5-.5V17a3 3 0 001-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0118 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 01-3.7 3 5.7 5.7 0 01-3.2 0A5.9 5.9 0 017.6 18a6.2 6.2 0 01-1.4-2.6 6.7 6.7 0 010-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 012.3-4A20 20 0 0112 4a26.4 26.4 0 013.2 3.4 18.2 18.2 0 012.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 00-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 01-1.3 3 5.3 5.3 0 01-2.3 1.5 4.9 4.9 0 01-2 .1 4.3 4.3 0 002.4.8 4 4 0 002-.6 4 4 0 001.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 000 18 1.5 1.5 0 001.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 005-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3-4a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm5 0a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3 4a1.5 1.5 0 110-3 1.5 1.5 0 010 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',"comment-add":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2V8a1 1 0 012 0v2z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7zm0 12V9h-7v10h7z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 01-1-1v-2H7V9H5a1 1 0 110-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3zM9 9v5l5-5H9zm1 6h5v-5l-5 5z" fill-rule="evenodd"/></svg>',"cut-column":'<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 017 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7zm12.3 5h-3v10h3v-10zM8 13.8h-.3l-.4.2a2.8 2.8 0 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.5-.2H8zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zM7 5.8h-.4a1 1 0 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.7 6l-.4-.1H7z"/></svg>',"cut-row":'<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3h-.3zM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zm8.5-7.1h-11v2h11v-2z"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 01-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8zm-8.5 2.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-1zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4zm5.4 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.8.5l.4.1h.7l.5-.2z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5zm0 4h2v2h-2V9zM9 9h2v2H9V9zm4 4h2v2h-2v-2zm-4 0h2v2H9v-2zm0 4h2v2H9v-2zm4 0h2v2h-2v-2zM9 5h2v2H9V5z" fill-rule="evenodd"/></svg>',"duplicate-column":'<svg width="24" height="24"><path d="M17 6v16h-7V6h7zm-2 2h-3v12h3V8zm-2-6v2H8v15H6V2h7z"/></svg>',"duplicate-row":'<svg width="24" height="24"><path d="M22 11v7H6v-7h16zm-2 2H8v3h12v-3zm-1-6v2H4v5H2V7h17z"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10zm3 8h-2V9h-7v10h9a2 2 0 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5zm-2-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5z"/></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.3 2 3-4.7 3.7 6H7l2-3.3z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0119 6zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-5 4h2.2z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.8-.4z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-1 1c0 .6.4 1 1 1zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5zM12 4a8 8 0 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3L18 7v1h-5V5H7v14h9a1 1 0 012 0c0 1-.8 2-1.9 2H7c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h7.5z"/><path d="M18.1 12c.5 0 .9.4.9 1 0 .5-.3 1-.8 1h-7.3c-.5 0-.9-.4-.9-1 0-.5.3-1 .8-1h7.3z"/><path d="M16.4 9.2a1 1 0 011.4.2l2.4 3.6-2.4 3.6a1 1 0 01-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 01.2-1.4z"/></g></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-2c0-1.3-2-3.5-2-3.5z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2zm4-8h2V9h-2v2zM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 00-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3z" fill-rule="nonzero"/></svg>',format:'<svg width="24" height="24"><path fill-rule="evenodd" d="M17 5a1 1 0 010 2h-4v11a1 1 0 01-2 0V7H7a1 1 0 110-2h10z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 110-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 11-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 111.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 110-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 110 1.7H5a.9.9 0 01-.9-.9v-4.4a.9.9 0 111.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 01-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 010 1.8H7l3 2.9-1.3 1.2z" fill-rule="nonzero"/></svg>',gallery:'<svg width="24" height="24"><path fill-rule="nonzero" d="M5 15.7l2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7zM5 18V19h3l1.8-1.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 01-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 110-4 2 2 0 010 4zM4.5 4h15a.5.5 0 110 1h-15a.5.5 0 010-1zm2-2h11a.5.5 0 110 1h-11a.5.5 0 010-1z"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 00-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 01.6.5l.1.3a8.5 8.5 0 01.3.6l1.9 4.6 2-5.2a1 1 0 011-.6.5.5 0 01.5.6L13 14v2.8a.7.7 0 01-1.4 0z" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 00-6 9 6.3 6.3 0 001.4 2l1 1a6.3 6.3 0 003.6 1 6.5 6.5 0 006-9 6.3 6.3 0 00-1.4-2l-1-1a6.3 6.3 0 00-3.6-1zM12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4z"/><path d="M9.6 9.7a.7.7 0 01-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 00-.8.8.8.8 0 01-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 012.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7zM5 18V19h3l2.8-2.9-2-2L5 17.9zm14-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 100-4 2 2 0 000 4z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-1 3v2h2V7h-2zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 001.8-2.9 6.3 6.3 0 00-.1-4.1 5.8 5.8 0 00-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 00-3.9 1.8 6.3 6.3 0 00-1.3 6 6.2 6.2 0 001.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 014 11c0-1 .2-1.9.6-2.7A7 7 0 016.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 015.7 2 7 7 0 011.7 2.3 6 6 0 01.2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 01-3.6 2.5v.5z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 5.4c.6 1.2 1 2.4 1 3.6z" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8z" fill-rule="evenodd"/></svg>',language:'<svg width="24" height="24"><path d="M12 3a9 9 0 110 18 9 9 0 010-18zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 003.2-2.1l-.2-.2a6 6 0 00-1-.6zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 01-2-2.8zm3.6-.8c-.8 0-1.6.1-2.2.3.5 1 1.2 1.9 2.1 2.7zm1.5 0v3c.9-.8 1.6-1.7 2.1-2.7-.6-.2-1.4-.3-2.1-.3zm-6-2.7H4.5c.2 1 .5 2.1 1 3h.3l1.3-1a10 10 0 01-.3-2zm12.7 0h-2.3c0 .7-.1 1.4-.3 2l1.6 1.1c.5-1 .9-2 1-3.1zm-3.8 0h-3V14c1 0 2 .1 2.7.4.2-.5.3-1 .3-1.6zm-4.4 0h-3l.3 1.6c.8-.3 1.7-.4 2.7-.4v-1.3zm-5.5-5c-.7 1-1.1 2.2-1.3 3.5h2.3c0-1 .2-1.8.5-2.6l-1.5-1zm2.9 1.4v.1c-.2.6-.4 1.3-.4 2h3V9.4c-1 0-1.8-.1-2.6-.3zm6.6 0h-.1l-2.4.3v1.8h3l-.5-2.1zm3-1.4l-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 00-1.3-3.5zm-9 0l2 .2V5.5a9 9 0 00-2 2.2zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 00-2-2.3zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 011.9-2.5zm4.4 0l.1.1a10 10 0 011.8 2.4l1.1-.7a7.5 7.5 0 00-3-1.8z"/></svg>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zM7 3.6l3.7 3.7a1 1 0 01-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 011.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 011.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 01-1.3 0h-.1a1 1 0 010-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1zM4 18h16v2H4v-2z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-lower-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6zM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3zM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4zM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3zM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zM37.1 34.6L34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3zM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2zm.7 1a2 2 0 00-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33zm0 10v-1.2h-1.3V26H33zm0 10v-1.2h-1.3V36H33z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15zm0 10v-1.2h1.3V26H15zm0 10v-1.2h1.3V36H15z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M39.3 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.7 2.3h1.6l-.8-2.3zM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26zM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M12.6 17l-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3zM11 12.3l-.7 2.3h1.6l-.8-2.3zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7zM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7zM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-upper-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3zm0 10v-1.2H33V27h-1.3zm0 10v-1.2H33V37h-1.3z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15zm0 10v-1.2h1.3V27H15zm0 10v-1.2h1.3V37H15z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3zM10 8v3h4V8a1 1 0 00-.3-.7A1 1 0 0013 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 017.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-2v8H5V7h8l-2 2H7v8h8v-4zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 110-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 01-1-1v-3zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 110-2zm13-1v3.5a.5.5 0 11-1 0V5h-.5a.5.5 0 110-1H19zm-1 8.8l.2.2h1.3a.5.5 0 110 1h-1.6a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2h-1.3a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 010-1h1.2a.3.3 0 100-.6h-1.3a.4.4 0 110-.8h1.3a.3.3 0 000-.6h-1.2a.5.5 0 110-1H19c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3zM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 13l6.4 6.5 6.5-6.5-6.5-6.5zM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7zM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 010-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 11-4.3 16.9l1.5-1.5A7 7 0 1013 6h-1z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.2 1.6L6.8 12l1.8 1.2z" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-1-1v-5H7v5c0 .6-.4 1-1 1z"/></g></svg>',paragraph:'<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-2.8 0l-.1-.1z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><path d="M12 4c.5 0 1 .4 1 .9V11h6a1 1 0 01.1 2H13v6a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H11V5c0-.6.4-1 1-1z"/></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 01-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 01-1.4 0l-1.5-1.2a6.2 6.2 0 01-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 01-1-.9l-.2-1.9a5.8 5.8 0 01-1.5-.6l-1.5 1.2a1 1 0 01-1.4 0l-.7-.7a1 1 0 010-1.4l1.2-1.5a6.2 6.2 0 01-.6-1.5l-1.9-.2a1 1 0 01-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 01.6-1.5L5.2 7.3a1 1 0 010-1.4l.7-.7a1 1 0 011.4 0l1.5 1.2a6.2 6.2 0 011.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 011.5.6l1.5-1.2a1 1 0 011.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 01.6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 100-6 3 3 0 000 6z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 002.1-2.8 15.7 15.7 0 00-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 00-6.7 3.2A16.2 16.2 0 003.2 12c0 .2.2.3.3.5zm-2.4-1l.7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 012.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 01-2.8-3.7 1 1 0 010-1zm12-3.3a2 2 0 102.7 2.6 4 4 0 11-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 00-3 3v6h2v3h14v-3h2v-6a3 3 0 00-3-3zm-1 10H7v-4h10v4zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5zm.5-8H6v2h12V5z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 11-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 111.4-1.4l5 5a1 1 0 010 1.4l-5 5a1 1 0 01-1.4-1.4l3.3-3.3z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M5 22.1l-1.2-4.7v-.2a1 1 0 011-1l5 .4a1 1 0 11-.2 2l-2.2-.2a7.8 7.8 0 008.4.2 7.5 7.5 0 003.5-6.4 1 1 0 112 0 9.5 9.5 0 01-4.5 8 9.9 9.9 0 01-10.2 0l.4 1.4a1 1 0 11-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 00-9.5-1 7.5 7.5 0 00-3.6 7 1 1 0 01-2 0 9.5 9.5 0 014.5-8.6 10 10 0 0110.9.3l-.3-1a1 1 0 012-.5l1.1 4.8a1 1 0 01-1 1.2l-5-.4a1 1 0 01-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 010 .2l-2.6 10a1 1 0 01-1 .8h-.2a.8.8 0 01-.8-1l2.6-10H8a1 1 0 110-2h9a1 1 0 010 2h-3.8zM5 18h7a1 1 0 010 2H5a1 1 0 010-2zm13 1.5L16.5 18 15 19.5a.7.7 0 01-1-1l1.5-1.5-1.5-1.5a.7.7 0 011-1l1.5 1.5 1.5-1.5a.7.7 0 011 1L17.5 17l1.5 1.5a.7.7 0 01-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 010 2h-1v9a3 3 0 01-3 3H9a3 3 0 01-3-3V9H5a1 1 0 110-2h3V6a3 3 0 013-3h2a3 3 0 013 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 00-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 012 0v4a1 1 0 01-2 0v-4zm4 0a1 1 0 012 0v4a1 1 0 01-2 0v-4z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 119 2l-7 7A.5.5 0 111 8l7-7zM8.1 5.1A.5.5 0 119 6l-3 3A.5.5 0 115 8l3-3z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-6a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3A1 1 0 014 11V5z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1z"/><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 012 0v6c0 .6-.4 1-1 1h-6a1 1 0 010-2h4.3L16 7A7.2 7.2 0 007.7 6a7 7 0 003 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 011.4 1.5A9.2 9.2 0 012.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 014.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L8 5zm12 11.2a1 1 0 11-1 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 111 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 10-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 10-1.4-1.4L13 11.6V4a1 1 0 00-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 00-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 00-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 002-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-1 0l-7.4 7.3z"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V8H5a1 1 0 110-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6zM8 8h2V6H8v2zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V13H5a1 1 0 010-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6zM14 13h2v-2h-2v2zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6V18H5a1 1 0 010-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6zM8 18h2v-2H8v2z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path d="M16 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2z" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 010-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7zM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 00-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6zm0-3v2h2V5H6zm13 0h-3v5h3v1h-3a1 1 0 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 017 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1z"/><path d="M5 11h14a1 1 0 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10zM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 00-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11z" fill-rule="nonzero"/></svg>',"table-caption":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="12" height="2" x="3" y="4" rx="1"/><path d="M19 8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2v-8c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></g></svg>',"table-cell-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M13 4v9H3V6c0-1.1.9-2 2-2h8zm-2 2H5v5h6V6z"/><path fill-rule="nonzero" d="M13 4h6a2 2 0 012 2v7h-8v-2h6V6h-6V4z" opacity=".2"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/><path fill-rule="nonzero" d="M3 13v5c0 1.1.9 2 2 2h8v-7h-2v5H5v-5H3z" opacity=".2"/></g></svg>',"table-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8 0h-6v5h6v-5zm-8-7H5v5h6V6z"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z" opacity=".2"/></g></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v12h14V6z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2z"/></g></svg>',"table-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v7h-8v7H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8-7h-6v5h6V6zm-8 0H5v5h6V6z"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5z"/></svg>',"table-delete-row":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3z"/></svg>',"table-delete-table":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-1-1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',"table-insert-column-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M20 4c.6 0 1 .4 1 1v2a1 1 0 01-2 0V6h-8v12h8v-1a1 1 0 012 0v2c0 .5-.4 1-.9 1H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H17v2a1 1 0 01-2 .1V13h-2a1 1 0 01-.1-2H15V9c0-.6.4-1 1-1zM9 6H5v5h4V6z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H4a1 1 0 01-1-1v-2a1 1 0 012 0v1h8V6H5v1a1 1 0 11-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H9v2a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H7V9c0-.6.4-1 1-1zm11-2h-4v5h4V6z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4a1 1 0 110 2H5v6h14V6h-1a1 1 0 010-2h2c.6 0 1 .4 1 1v13a2 2 0 01-2 2H5a2 2 0 01-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 010 2h-2v2a1 1 0 01-2 .1V8H9a1 1 0 010-2h2V4c0-.6.4-1 1-1z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 9h-4v5h4v-5zm-6 0H9v5h4v-5zm0-7H9v5h4V6zm6 0h-4v5h4V6z"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15.5V18h3v-2.5H5zm14-5h-9V18h9v-7.5zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6zm-8 7.5h3v-3H5v3z"/></svg>',"table-row-numbering-rtl":'<svg width="24" height="24"><path d="M6 4a2 2 0 00-2 2v13c0 1.1.9 2 2 2h12a2 2 0 002-2V6a2 2 0 00-2-2H6zm0 12h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 11h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 6h8v3H6V6zm11 0c.6 0 1 .4 1 1v1a1 1 0 11-2 0V7c0-.6.4-1 1-1z"/></svg>',"table-row-numbering":'<svg width="24" height="24"><path d="M18 4a2 2 0 012 2v13a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2h12zm0 12h-8v3h8v-3zM7 16a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8v-3zM7 11a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8V6zM7 6a1 1 0 00-1 1v1a1 1 0 102 0V7c0-.6-.4-1-1-1z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-9h-6v3h6V6zM5 9h6V6H5v3z"/></svg>',"table-split-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2zm-8.5-1H5v3h3v-3zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6z"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 11H5v3h6v-3zm8 0h-6v3h6v-3zm0-5h-6v3h6v-3zM5 13h6v-3H5v3z"/></svg>',table:'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 14v4h6v-4H5zm14 0h-6v4h6v-4zm0-6h-6v4h6V8zM5 12h6V8H5v4z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14zM9 16v-4a5 5 0 116 0v4h4a2 2 0 012 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 10-3.6 0l.8.6v5h2z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 111 0V6H15v1.6a8 8 0 11-6 0zm-2.6 5.3a.5.5 0 00.3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 013.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 00-4.1 3.7z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"/></g></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 010-1l3.1-3A12.4 12.4 0 016.7 9H8a10.1 10.1 0 001.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 110-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 01-1 2.4 13.5 13.5 0 01-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 01-.4.7 1 1 0 01-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 01-1 .7.5.5 0 01-.4-.7l2.7-7.4a1 1 0 012 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 01-.4 1.8l-1 1.4a5.3 5.3 0 01-5.5 1 5 5 0 01-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 01-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 002.2.8 3.4 3.4 0 002.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1zM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 01-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 11-1.4 1.4l-5-5a1 1 0 010-1.4l5-5a1 1 0 011.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2 2a2 2 0 102.6 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2.1-2a2 2 0 10-2.7-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 1.5H19z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6z"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7zM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13z" fill-rule="nonzero"/></svg>',"vertical-align":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="18" height="2" x="3" y="11" rx="1"/><path d="M12 2c.6 0 1 .4 1 1v4l2-1.3a1 1 0 011.2 1.5l-.1.1-4.1 3-4-3a1 1 0 011-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8l4 2.9a1 1 0 01-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 01-1-1v-4l-2 1.3a1 1 0 01-1.2-.1l-.1-.1a1 1 0 01.1-1.3l.1-.1 4.1-3z"/></g></svg>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2zm-4 0v2a2 2 0 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.2-5H15zM5 15v2H3v-2h2zm16 0v2h-2v-2h2zM5 11v2H3v-2h2zm16 0v2h-2v-2h2zM5 7v2H3V7h2zm16 0v2h-2V7h2zM5 3v2H3c0-1.1.9-2 2-2zm8 0v2h-2V3h2zm6 0a2 2 0 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z" fill-rule="evenodd"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6zM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-1-9a1 1 0 012 0v6a1 1 0 01-2 0V8zm-2 4a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-3-5a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>'}})},622:function(t,e){!function(){"use strict";var t,e,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},o=function(t){return function(e){return typeof e===t}},i=r("string"),u=r("object"),a=r("array"),c=o("boolean"),s=o("function"),l=o("number"),f=function(){},d=function(t){return function(){return t}},m=function(t){return t},g=function(t,e){return t===e},h=function(t){return function(e){return!t(e)}},p=d(!1),v=d(!0),b=function(){return y},y={fold:function(t,e){return t()},isSome:p,isNone:v,getOr:e=m,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:e,orThunk:t,map:b,each:f,bind:b,exists:p,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:d("none()")},w=function(t){var e=d(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Array.prototype.slice,S=Array.prototype.push,k=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},O=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},T=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},_=function(t,e,n){return O(t,(function(t,r){n=e(n,t,r)})),n},E=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return x.some(i);if(n(i,r))break}return x.none()},A=function(t,e){return E(t,e,p)},D=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!a(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e}(k(t,e))},M=function(t){var e=C.call(t,0);return e.reverse(),e},N=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},R=function(t){return N(t,0)},z=function(t){return N(t,t.length-1)},B=function(){return(B=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};var I,P=function(){return L(0,0)},L=function(t,e){return{major:t,minor:e}},H={nu:L,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?P():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return L(r(1),r(2))}(t,n)},unknown:P},F=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()}(e.brands,(function(e){var n=e.brand.toLowerCase();return A(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:H.nu(parseInt(e.version,10),0)}}))}))},V=function(t,e){var n=String(e).toLowerCase();return A(t,(function(t){return t.search(n)}))},j=function(t,e){return-1!==t.indexOf(e)},U=(I=/^\s+|\s+$/g,function(t){return t.replace(I,"")}),W=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,q=function(t){return function(e){return j(e,t)}},G=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return j(t,"edge/")&&j(t,"chrome")&&j(t,"safari")&&j(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,W],search:function(t){return j(t,"chrome")&&!j(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return j(t,"msie")||j(t,"trident")}},{name:"Opera",versionRegexes:[W,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:q("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:q("firefox")},{name:"Safari",versionRegexes:[W,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(j(t,"safari")||j(t,"mobile/"))&&j(t,"applewebkit")}}],$=[{name:"Windows",search:q("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return j(t,"iphone")||j(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:q("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:q("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:q("linux"),versionRegexes:[]},{name:"Solaris",search:q("sunos"),versionRegexes:[]},{name:"FreeBSD",search:q("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:q("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],X={browsers:d(G),oses:d($)},K=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},Y={unknown:function(){return K({current:void 0,version:H.unknown()})},nu:K,edge:d("Edge"),chrome:d("Chrome"),ie:d("IE"),opera:d("Opera"),firefox:d("Firefox"),safari:d("Safari")},J=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},Q={unknown:function(){return J({current:void 0,version:H.unknown()})},nu:J,windows:d("Windows"),ios:d("iOS"),android:d("Android"),linux:d("Linux"),osx:d("OSX"),solaris:d("Solaris"),freebsd:d("FreeBSD"),chromeos:d("ChromeOS")},Z=function(t,e,n){var r=X.browsers(),o=X.oses(),i=e.bind((function(t){return F(r,t)})).orThunk((function(){return function(t,e){return V(t,e).map((function(t){var n=H.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(Y.unknown,Y.nu),u=function(t,e){return V(t,e).map((function(t){var n=H.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(Q.unknown,Q.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:d(o),isiPhone:d(i),isTablet:d(c),isPhone:d(s),isTouch:d(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:d(l),isDesktop:d(f)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}},tt=function(t){return window.matchMedia(t).matches},et=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}((function(){return Z(navigator.userAgent,x.from(navigator.userAgentData),tt)})),nt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},rt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return nt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return nt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return nt(n)},fromDom:nt,fromPoint:function(t,e,n){return x.from(t.dom.elementFromPoint(e,n)).map(nt)}},ot=function(t,e){return t.dom===e.dom},it=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},ut=function(t,e){return et().browser.isIE()?it(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},at=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},ct=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),st=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),lt=tinymce.util.Tools.resolve("tinymce.util.VK"),ft=Object.keys,dt=function(t,e){for(var n=ft(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},mt=function(t,e){var n={};return function(t,e,n,r){dt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),f),n};"undefined"!=typeof window?window:Function("return this;")();var gt,ht=function(t){return t.dom.nodeName.toLowerCase()},pt=(gt=1,function(t){return function(t){return t.dom.nodeType}(t)===gt}),vt=function(t){return function(e){return pt(e)&&ht(e)===t}},bt=function(t,e){var n=t.dom;dt(e,(function(t,e){!function(t,e,n){if(!(i(n)||c(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(n,e,t)}))},yt=function(t){return _(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},wt=function(t){return x.from(t.dom.parentNode).map(rt.fromDom)},xt=function(t){return k(t.dom.childNodes,rt.fromDom)},Ct=function(t,e){var n=t.dom.childNodes;return x.from(n[e]).map(rt.fromDom)},St=function(t){return Ct(t,0)},kt=function(t){return Ct(t,t.dom.childNodes.length-1)},Ot=function(t,e){wt(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Tt=function(t,e){t.dom.appendChild(e.dom)},_t=function(t,e){O(e,(function(e){Tt(t,e)}))},Et=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},At=function(t){return function(t,e){return rt.fromDom(t.dom.cloneNode(e))}(t,!0)},Dt=function(t,e){var n=function(t,e){var n=rt.fromTag(e),r=yt(t);return bt(n,r),n}(t,e);Ot(t,n);var r=xt(t);return _t(n,r),Et(t),n},Mt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Nt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Rt=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},zt=function(t){return function(e){return e&&t.test(e.nodeName)}},Bt=function(t){return t&&3===t.nodeType},It=zt(/^(OL|UL|DL)$/),Pt=zt(/^(OL|UL)$/),Lt=Rt("ol"),Ht=zt(/^(LI|DT|DD)$/),Ft=zt(/^(DT|DD)$/),Vt=zt(/^(TH|TD)$/),jt=Rt("br"),Ut=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},Wt=function(t,e){return t&&t.nodeName in e},qt=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},Gt=function(t,e){return t.isChildOf(e,t.getRoot())},$t=function(t,e){var n,r,o,i=t.dom,u=t.schema.getBlockElements(),a=i.createFragment(),c=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}(t);if(c&&((r=i.create(c)).tagName===c.toUpperCase()&&i.setAttribs(r,function(t){return t.getParam("forced_root_block_attrs",{})}(t)),Wt(e.firstChild,u)||a.appendChild(r)),e)for(;n=e.firstChild;){var s=n.nodeName;o||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),Wt(n,u)?(a.appendChild(n),r=null):c?(r||(r=i.create(c),a.appendChild(r)),r.appendChild(n)):a.appendChild(n)}return c?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):a.appendChild(i.create("br")),a},Xt=Mt.DOM,Kt=vt("dd"),Yt=vt("dt"),Jt=function(t,e){Kt(e)?Dt(e,"dt"):Yt(e)&&wt(e).each((function(n){return function(t,e,n){var r=Xt.select('span[data-mce-type="bookmark"]',e),o=$t(t,n),i=Xt.createRng();i.setStartAfter(n),i.setEndAfter(e);for(var u,a=i.extractContents(),c=a.firstChild;c;c=c.firstChild)if("LI"===c.nodeName&&t.dom.isEmpty(c)){Xt.remove(c);break}t.dom.isEmpty(a)||Xt.insertAfter(a,e),Xt.insertAfter(o,e),qt(t.dom,n.parentNode)&&(u=n.parentNode,Nt.each(r,(function(t){u.parentNode.insertBefore(t,n.parentNode)})),Xt.remove(u)),Xt.remove(n),qt(t.dom,e)&&Xt.remove(e)}(t,n.dom,e.dom)}))},Qt=function(t){Yt(t)&&Dt(t,"dd")},Zt=function(t,e){if(Bt(t))return{container:t,offset:e};var n=ct.getNode(t,e);return Bt(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&Bt(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Bt(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},te=function(t){var e=t.cloneRange(),n=Zt(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=Zt(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},ee=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),ne=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",ie(t,n))},re=function(t){var e=ne(t),n=t.selection.getSelectedBlocks();return function(t,e){return t&&1===e.length&&e[0]===t}(e,n)?function(t){return T(t.querySelectorAll("ol,ul,dl"),It)}(e):T(n,(function(t){return It(t)&&e!==t}))},oe=function(t){var e=t.selection.getSelectedBlocks();return T(function(t,e){var n=Nt.map(e,(function(e){var n=t.dom.getParent(e,"li,dd,dt",ie(t,e));return n||e}));return ee.unique(n)}(t,e),Ht)},ie=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},ue=function(t,e){var n=t.dom.getParents(e,"ol,ul",ie(t,e));return z(n)},ae=function(t){var e=function(t){var e=ue(t,t.selection.getStart()),n=T(t.selection.getSelectedBlocks(),Pt);return e.toArray().concat(n)}(t);return ce(t,e)},ce=function(t,e){var n=k(e,(function(e){return ue(t,e).getOr(e)}));return ee.unique(n)},se=function(t,e,n){return void 0===n&&(n=g),t.exists((function(t){return n(t,e)}))},le=function(t,e,n){return t.isSome()&&e.isSome()?x.some(n(t.getOrDie(),e.getOrDie())):x.none()},fe=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},de=function(t,e,n){if(!i(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);(function(t){return void 0!==t.style&&s(t.style.getPropertyValue)})(t)&&t.style.setProperty(e,n)},me=function(t,e){Tt(t.item,e.list)},ge=function(t,e){var n={list:rt.fromTag(e,t),item:rt.fromTag("li",t)};return Tt(n.list,n.item),n},he=function(t,e,n){var r=e.slice(0,n.depth);return z(r).each((function(e){!function(t,e){Tt(t.list,e),t.item=e}(e,function(t,e,n){var r=rt.fromTag("li",t);return bt(r,e),_t(r,n),r}(t,n.itemAttributes,n.content)),function(t,e){ht(t.list)!==e.listType&&(t.list=Dt(t.list,e.listType)),bt(t.list,e.listAttributes)}(e,n)})),r},pe=function(t,e,n){var r,o=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(ge(t,e.listType));return r}(t,n,n.depth-e.length);return function(t){for(var e=1;e<t.length;e++)me(t[e-1],t[e])}(o),function(t,e){for(var n=0;n<t.length-1;n++)r=t[n].item,o="list-style-type",i="none",u=void 0,u=r.dom,de(u,o,i);var r,o,i,u;z(t).each((function(t){bt(t.list,e.listAttributes),bt(t.item,e.itemAttributes),_t(t.item,e.content)}))}(o,n),r=o,le(z(e),R(r),me),e.concat(o)},ve=function(t){return at(t,"OL,UL")},be=function(t){return St(t).exists(ve)},ye=function(t){return t.depth>0},we=function(t){return t.isSelected},xe=function(t){var e=xt(t),n=kt(t).exists(ve)?e.slice(0,-1):e;return k(n,At)},Ce=function(t){return O(t,(function(e,n){(function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return E(M(t.slice(0,e)),r,o).orThunk((function(){return E(t.slice(e+1),r,o)}))})(t,n).fold((function(){e.dirty&&function(t){t.listAttributes=mt(t.listAttributes,(function(t,e){return"start"!==e}))}(e)}),(function(t){return r=t,(n=e).listType=r.listType,void(n.listAttributes=B({},r.listAttributes));var n,r}))})),t},Se=function(t,e,n,r){return St(r).filter(ve).fold((function(){e.each((function(t){ot(t.start,r)&&n.set(!0)}));var o=function(t,e,n){return wt(t).filter(pt).map((function(r){return{depth:e,dirty:!1,isSelected:n,content:xe(t),itemAttributes:yt(t),listAttributes:yt(r),listType:ht(r)}}))}(r,t,n.get());e.each((function(t){ot(t.end,r)&&n.set(!1)}));var i=kt(r).filter(ve).map((function(r){return ke(t,e,n,r)})).getOr([]);return o.toArray().concat(i)}),(function(r){return ke(t,e,n,r)}))},ke=function(t,e,n,r){return D(xt(r),(function(r){return(ve(r)?ke:Se)(t+1,e,n,r)}))},Oe=function(t,e){var n=Ce(e);return k(n,(function(e){var n,r,o,i=(n=e.content,o=(r||document).createDocumentFragment(),O(n,(function(t){o.appendChild(t.dom)})),rt.fromDom(o));return rt.fromDom($t(t,i.dom))}))},Te=function(t,e){var n=Ce(e);return function(t,e){var n=_(e,(function(e,n){return n.depth>e.length?pe(t,e,n):he(t,e,n)}),[]);return R(n).map((function(t){return t.list}))}(t.contentDocument,n).toArray()},_e=function(t,e,n){var r=function(t,e){var n,r=(n=!1,{get:function(){return n},set:function(t){n=t}});return k(t,(function(t){return{sourceList:t,entries:ke(0,e,r,t)}}))}(e,function(t){var e=k(oe(t),rt.fromDom);return le(A(e,h(be)),A(M(e),h(be)),(function(t,e){return{start:t,end:e}}))}(t));O(r,(function(e){!function(t,e){O(T(t,we),(function(t){return function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e,t)}))}(e.entries,n);var r,o=function(t,e){return D(function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}(e,ye),(function(e){return R(e).exists(ye)?Te(t,e):Oe(t,e)}))}(t,e.entries);O(o,(function(e){fe(t,"Indent"===n?"IndentList":"OutdentList",e.dom)})),r=e.sourceList,O(o,(function(t){Ot(r,t)})),Et(e.sourceList)}))},Ee=function(t,e){var n=k(ae(t),rt.fromDom),r=k(function(t){return T(oe(t),Ft)}(t),rt.fromDom),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();_e(t,n,e),function(t,e,n){O(n,"Indent"===e?Qt:function(e){return Jt(t,e)})}(t,e,r),t.selection.moveToBookmark(i),t.selection.setRng(te(t.selection.getRng())),t.nodeChanged(),o=!0}return o},Ae=function(t){return Ee(t,"Indent")},De=function(t){return Ee(t,"Outdent")},Me=function(t){return Ee(t,"Flatten")},Ne=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Re=Mt.DOM,ze=function(t){var e={},n=function(n){var r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"];if(1===r.nodeType){var i=Re.create("span",{"data-mce-type":"bookmark"});r.hasChildNodes()?(o=Math.min(o,r.childNodes.length-1),n?r.insertBefore(i,r.childNodes[o]):Re.insertAfter(i,r.childNodes[o])):r.appendChild(i),r=i,o=0}e[n?"startContainer":"endContainer"]=r,e[n?"startOffset":"endOffset"]=o};return n(!0),t.collapsed||n(),e},Be=function(t){var e=function(e){var n,r=n=t[e?"startContainer":"endContainer"],o=t[e?"startOffset":"endOffset"];r&&(1===r.nodeType&&(o=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(r),r=r.parentNode,Re.remove(n),!r.hasChildNodes()&&Re.isBlock(r)&&r.appendChild(Re.create("br"))),t[e?"startContainer":"endContainer"]=r,t[e?"startOffset":"endOffset"]=o)};e(!0),e();var n=Re.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),te(n)},Ie=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Pe=function(t){return/\btox\-/.test(t.className)},Le=function(t,e,n){var r=function(t){var r=E(t.parents,It,Vt).filter((function(t){return t.nodeName===e&&!Pe(t)})).isSome();n(r)},o=t.dom.getParents(t.selection.getNode());return r({parents:o}),t.on("NodeChange",r),function(){return t.off("NodeChange",r)}},He=function(t,e){Nt.each(e,(function(e,n){t.setAttribute(n,e)}))},Fe=function(t,e,n){!function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)}(t,e,n),function(t,e,n){He(e,n["list-attributes"]),Nt.each(t.select("li",e),(function(t){He(t,n["list-item-attributes"])}))}(t,e,n)},Ve=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&jt(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Ut(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},je=function(t,e,n){var r=t.selection.getRng(),o="LI",i=ie(t,t.selection.getStart(!0)),u=t.dom;if("false"!==u.getContentEditable(t.selection.getNode())){"DL"===(e=e.toUpperCase())&&(o="DT");var a=ze(r),c=function(t,e,n){for(var r,o=[],i=t.dom,u=Ve(t,e,!0,n),a=Ve(t,e,!1,n),c=[],s=u;s&&(c.push(s),s!==a);s=s.nextSibling);return Nt.each(c,(function(e){if(Ut(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||jt(e))return jt(e)&&i.remove(e),void(r=null);var u=e.nextSibling;Ne.isBookmarkNode(e)&&(It(u)||Ut(t,u)||!u&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))})),o}(t,r,i);Nt.each(c,(function(r){var i,a=r.previousSibling,c=r.parentNode;Ht(c)||(a&&It(a)&&a.nodeName===e&&function(t,e,n){var r=t.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return r===(o=null===o?"":o)}(u,a,n)?(i=a,r=u.rename(r,o),a.appendChild(r)):(i=u.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=u.rename(r,o)),function(t,e,n){Nt.each(n,(function(n){var r;return t.setStyle(e,((r={})[n]="",r))}))}(u,r,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),Fe(u,i,n),We(t.dom,i))})),t.selection.setRng(Be(a))}},Ue=function(t,e,n){return function(t,e){return t&&e&&It(t)&&t.nodeName===e.nodeName}(e,n)&&function(t,e,n){return t.getStyle(e,"list-style-type",!0)===t.getStyle(n,"list-style-type",!0)}(t,e,n)&&(r=n,e.className===r.className);var r},We=function(t,e){var n,r;if(n=e.nextSibling,Ue(t,e,n)){for(;r=n.firstChild;)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,Ue(t,e,n)){for(;r=n.lastChild;)e.insertBefore(r,e.firstChild);t.remove(n)}},qe=function(t,e,n,r,o){var i=It(e);if(i&&e.nodeName===r&&!Ge(o))Me(t);else{je(t,r,o);var u=ze(t.selection.getRng()),a=i?function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}([e],n):n;Nt.each(a,(function(e){!function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);Fe(t.dom,o,r),fe(t,Ie(n),o)}else Fe(t.dom,e,r),fe(t,Ie(n),e)}(t,e,r,o)})),t.selection.setRng(Be(u))}},Ge=function(t){return"list-style-type"in t},$e=function(t,e,n){var r=ne(t),o=re(t),i=u(n)?n:{};o.length>0?qe(t,r,o,e,i):function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||Ge(r)||Pe(e)){var o=ze(t.selection.getRng());Fe(t.dom,e,r);var i=t.dom.rename(e,n);We(t.dom,i),t.selection.setRng(Be(o)),je(t,n,r),fe(t,Ie(n),i)}else Me(t);else je(t,n,r),fe(t,Ie(n),e)}(t,r,e,i)},Xe=Mt.DOM,Ke=function(t,e){var n=Nt.grep(t.select("ol,ul",e));Nt.each(n,(function(e){!function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(e),qt(t,r)&&Xe.remove(r)):Xe.setStyle(r,"listStyleType","none"));It(r)&&((n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(e))}(t,e)}))},Ye=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(Bt(o)&&(n?i<o.data.length:i>0))return o;var u=t.schema.getNonEmptyElements();1===o.nodeType&&(o=ct.getNode(o,i));var a=new st(o,r);for(n&&function(t,e){return!!jt(e)&&(t.isBlock(e.nextSibling)&&!jt(e.previousSibling))}(t.dom,o)&&a.next();o=a[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(Bt(o)&&o.data.length>0)return o}},Je=function(t,e){var n=e.childNodes;return 1===n.length&&!It(n[0])&&t.isBlock(n[0])},Qe=function(t,e,n){var r,o=Je(t,n)?n.firstChild:n;if(function(t,e){Je(t,e)&&t.remove(e.firstChild,!0)}(t,e),!qt(t,e,!0))for(;r=e.firstChild;)o.appendChild(r)},Ze=function(t,e,n){var r,o=e.parentNode;if(Gt(t,e)&&Gt(t,n)){It(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&jt(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&jt(i)&&e.hasChildNodes()&&t.remove(i),qt(t,n,!0)&&t.$(n).empty(),Qe(t,e,n),r&&n.appendChild(r);var u=ut(rt.fromDom(n),rt.fromDom(e))?t.getParents(e,It,n):[];t.remove(e),O(u,(function(e){qt(t,e)&&e!==t.getRoot()&&t.remove(e)}))}},tn=function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))!function(t,e,n){t.dom.$(n).empty(),Ze(t.dom,e,n),t.selection.setCursorLocation(n,0)}(t,n,r);else{var i=ze(e);Ze(o,n,r),t.selection.setRng(Be(i))}},en=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=ie(t,o),u=n.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===t.getBody()&&qt(n,a))return!0;var c=te(r.getRng()),s=n.getParent(Ye(t,c,e,i),"LI",i);if(s&&s!==u)return t.undoManager.transact((function(){var n;e?tn(t,c,s,u):(n=u).parentNode.firstChild===n?De(t):function(t,e,n,r){var o=ze(e);Ze(t.dom,n,r);var i=Be(o);t.selection.setRng(i)}(t,c,u,s)})),!0;if(!s&&!e&&0===c.startOffset&&0===c.endOffset)return t.undoManager.transact((function(){Me(t)})),!0}return!1},nn=function(t,e){return en(t,e)||function(t,e){var n=t.dom,r=t.selection.getStart(),o=ie(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var u=te(t.selection.getRng()),a=n.getParent(Ye(t,u,e,o),"LI",o);if(a)return t.undoManager.transact((function(){!function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)}(n,i,o),We(n,a.parentNode),t.selection.select(a,!0),t.selection.collapse(e)})),!0}return!1}(t,e)},rn=function(t,e){return t.selection.isCollapsed()?nn(t,e):function(t){var e=t.selection.getStart(),n=ie(t,e);return!!(t.dom.getParent(e,"LI,DT,DD",n)||oe(t).length>0)&&(t.undoManager.transact((function(){t.execCommand("Delete"),Ke(t.dom,t.getBody())})),!0)}(t)},on=function(t){var e=M(U(t).split("")),n=k(e,(function(t,e){var n=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,e)*n}));return _(n,(function(t,e){return t+e}),0)},un=function(t){if(--t<0)return"";var e=t%26,n=Math.floor(t/26);return un(n)+String.fromCharCode("A".charCodeAt(0)+e)},an=function(t){var e,n,r=ne(t);Lt(r)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:(e={start:t.dom.getAttrib(r,"start","1"),listStyleType:x.some(t.dom.getStyle(r,"list-style-type"))},n=parseInt(e.start,10),se(e.listStyleType,"upper-alpha")?un(n):se(e.listStyleType,"lower-alpha")?un(n).toLowerCase():e.start)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){(function(t){switch(function(t){return/^[0-9]+$/.test(t)?2:function(t){return/^[A-Z]+$/.test(t)}(t)?0:function(t){return/^[a-z]+$/.test(t)}(t)?1:function(t){return t.length>0}(t)?4:3}(t)){case 2:return x.some({listStyleType:x.none(),start:t});case 0:return x.some({listStyleType:x.some("upper-alpha"),start:on(t).toString()});case 1:return x.some({listStyleType:x.some("lower-alpha"),start:on(t).toString()});case 3:return x.some({listStyleType:x.none(),start:""});case 4:return x.none()}})(e.getData().start).each((function(e){t.execCommand("mceListUpdate",!1,{attrs:{start:"1"===e.start?"":e.start},styles:{"list-style-type":e.listStyleType.getOr("")}})})),e.close()}})},cn=function(t,e){return function(){var n=ne(t);return n&&n.nodeName===e}},sn=function(t){t.addCommand("mceListProps",(function(){an(t)}))},ln=function(t){t.on("BeforeExecCommand",(function(e){var n=e.command.toLowerCase();"indent"===n?Ae(t):"outdent"===n&&De(t)})),t.addCommand("InsertUnorderedList",(function(e,n){$e(t,"UL",n)})),t.addCommand("InsertOrderedList",(function(e,n){$e(t,"OL",n)})),t.addCommand("InsertDefinitionList",(function(e,n){$e(t,"DL",n)})),t.addCommand("RemoveList",(function(){Me(t)})),sn(t),t.addCommand("mceListUpdate",(function(e,n){u(n)&&function(t,e){var n=ne(t);t.undoManager.transact((function(){u(e.styles)&&t.dom.setStyles(n,e.styles),u(e.attrs)&&dt(e.attrs,(function(e,r){return t.dom.setAttrib(n,r,e)}))}))}(t,n)})),t.addQueryStateHandler("InsertUnorderedList",cn(t,"UL")),t.addQueryStateHandler("InsertOrderedList",cn(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",cn(t,"DL"))},fn=function(t){(function(t){return t.getParam("lists_indent_on_tab",!0)})(t)&&function(t){t.on("keydown",(function(e){e.keyCode!==lt.TAB||lt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?De(t):Ae(t))&&e.preventDefault()}))}))}(t),function(t){t.on("keydown",(function(e){e.keyCode===lt.BACKSPACE?rn(t,!1)&&e.preventDefault():e.keyCode===lt.DELETE&&rn(t,!0)&&e.preventDefault()}))}(t)};n.add("lists",(function(t){return!1===t.hasPlugin("rtc",!0)?(fn(t),ln(t)):sn(t),function(t){var e=function(e){return function(){return t.execCommand(e)}};t.hasPlugin("advlist")||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return Le(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return Le(t,"UL",e.setActive)}}))}(t),function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return t.execCommand("mceListProps")},onSetup:function(e){return Le(t,"OL",(function(t){return e.setDisabled(!t)}))}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=ne(t,e);return Lt(n)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(e){rn(t,e)}}}(t)}))}()},623:function(t,e){!function(){"use strict";var t=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},e=function(t){return function(e){return typeof e===t}},n=function(t){return function(e){return t===e}},r=t("string"),o=t("object"),i=t("array"),u=n(null),a=e("boolean"),c=n(void 0),s=function(t){return!function(t){return null==t}(t)},l=e("function"),f=e("number"),d=function(){},m=function(t){return function(){return t}},g=function(t){return t},h=function(t,e){return t===e};function p(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var v,b,y=function(t){return function(e){return!t(e)}},w=m(!1),x=m(!0),C=function(){return S},S={fold:function(t,e){return t()},isSome:w,isNone:x,getOr:b=g,getOrThunk:v=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(void 0),or:b,orThunk:v,map:C,each:d,bind:C,exists:w,forall:x,filter:function(){return C()},toArray:function(){return[]},toString:m("none()")},k=function(t){var e=m(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:x,isNone:w,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return k(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:S},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},O={some:k,none:C,from:function(t){return null==t?S:k(t)}},T=Array.prototype.slice,_=Array.prototype.indexOf,E=Array.prototype.push,A=function(t,e){return n=t,r=e,_.call(n,r)>-1;var n,r},D=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},M=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},N=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},R=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},z=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},B=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}}(t,(function(t,r){n=e(n,t,r)})),n},I=function(t,e,n){return R(t,(function(t,r){n=e(n,t,r)})),n},P=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return O.some(i);if(n(i,r))break}return O.none()}(t,e,w)},L=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return O.some(n)}return O.none()},H=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!i(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);E.apply(e,t[n])}return e},F=function(t,e){return H(N(t,e))},V=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},j=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},U=function(t){return[t]},W=function(t,e){return e>=0&&e<t.length?O.some(t[e]):O.none()},q=function(t){return W(t,0)},G=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return O.none()},$=function(){return($=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function X(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var K=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Y=function(){return J(0,0)},J=function(t,e){return{major:t,minor:e}},Q={nu:J,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Y():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return J(r(1),r(2))}(t,n)},unknown:Y},Z=function(t,e){var n=String(e).toLowerCase();return P(t,(function(t){return t.search(n)}))},tt=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},et=function(t,e){return-1!==t.indexOf(e)},nt=function(t,e){return tt(t,e,0)},rt=function(t,e){return tt(t,e,t.length-e.length)},ot=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),it=function(t){return t.length>0},ut=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,at=function(t){return function(e){return et(e,t)}},ct=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return et(t,"edge/")&&et(t,"chrome")&&et(t,"safari")&&et(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ut],search:function(t){return et(t,"chrome")&&!et(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return et(t,"msie")||et(t,"trident")}},{name:"Opera",versionRegexes:[ut,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:at("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:at("firefox")},{name:"Safari",versionRegexes:[ut,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(et(t,"safari")||et(t,"mobile/"))&&et(t,"applewebkit")}}],st=[{name:"Windows",search:at("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return et(t,"iphone")||et(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:at("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:at("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:at("linux"),versionRegexes:[]},{name:"Solaris",search:at("sunos"),versionRegexes:[]},{name:"FreeBSD",search:at("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:at("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],lt={browsers:m(ct),oses:m(st)},ft=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},dt={unknown:function(){return ft({current:void 0,version:Q.unknown()})},nu:ft,edge:m("Edge"),chrome:m("Chrome"),ie:m("IE"),opera:m("Opera"),firefox:m("Firefox"),safari:m("Safari")},mt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},gt={unknown:function(){return mt({current:void 0,version:Q.unknown()})},nu:mt,windows:m("Windows"),ios:m("iOS"),android:m("Android"),linux:m("Linux"),osx:m("OSX"),solaris:m("Solaris"),freebsd:m("FreeBSD"),chromeos:m("ChromeOS")},ht=function(t,e,n){var r=lt.browsers(),o=lt.oses(),i=e.bind((function(t){return function(t,e){return G(e.brands,(function(e){var n=e.brand.toLowerCase();return P(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:Q.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return Z(t,e).map((function(t){var n=Q.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(dt.unknown,dt.nu),u=function(t,e){return Z(t,e).map((function(t){var n=Q.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(gt.unknown,gt.nu),a=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),a=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),s=i||u&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:m(o),isiPhone:m(i),isTablet:m(c),isPhone:m(s),isTouch:m(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:m(l),isDesktop:m(f)}}(u,i,t,n);return{browser:i,os:u,deviceType:a}},pt=function(t){return window.matchMedia(t).matches},vt=K((function(){return ht(navigator.userAgent,O.from(navigator.userAgentData),pt)})),bt=function(){return vt()},yt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},wt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return yt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return yt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return yt(n)},fromDom:yt,fromPoint:function(t,e,n){return O.from(t.dom.elementFromPoint(e,n)).map(yt)}},xt=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Ct=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},St=function(t,e){var n=void 0===e?document:e.dom;return Ct(n)?O.none():O.from(n.querySelector(t)).map(wt.fromDom)},kt=function(t,e){return t.dom===e.dom},Ot=function(t,e){return n=t.dom,r=e.dom,function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r},Tt=function(t,e){return bt().browser.isIE()?Ot(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},_t=xt,Et=Object.keys,At=Object.hasOwnProperty,Dt=function(t,e){for(var n=Et(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Mt=function(t,e){return Nt(t,(function(t,n){return{k:n,v:e(t,n)}}))},Nt=function(t,e){var n={};return Dt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Rt=function(t,e){var n={};return function(t,e,n,r){Dt(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),d),n},zt=function(t,e){var n=[];return Dt(t,(function(t,r){n.push(e(t,r))})),n},Bt=function(t){return zt(t,g)},It=function(t){return Et(t).length},Pt=function(t,e){return Lt(t,e)?O.from(t[e]):O.none()},Lt=function(t,e){return At.call(t,e)},Ht=function(t,e){return Lt(t,e)&&void 0!==t[e]&&null!==t[e]},Ft=["tfoot","thead","tbody","colgroup"],Vt=function(t,e,n){return{element:t,rowspan:e,colspan:n}},jt=function(t,e,n){return{element:t,cells:e,section:n}},Ut=function(t,e,n){return{element:t,isNew:e,isLocked:n}},Wt=function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}},qt=function(t,e){return{element:t,columns:e}};"undefined"!=typeof window?window:Function("return this;")();var Gt=function(t){return t.dom.nodeName.toLowerCase()},$t=function(t){return t.dom.nodeType},Xt=function(t){return function(e){return $t(e)===t}},Kt=function(t){return 8===$t(t)||"#comment"===Gt(t)},Yt=Xt(1),Jt=Xt(3),Qt=Xt(9),Zt=Xt(11),te=function(t){return function(e){return Yt(e)&&Gt(e)===t}},ee=function(t){return wt.fromDom(t.dom.ownerDocument)},ne=function(t){return Qt(t)?t:ee(t)},re=function(t){return O.from(t.dom.parentNode).map(wt.fromDom)},oe=function(t,e){for(var n=l(e)?e:w,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=wt.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},ie=function(t){return O.from(t.dom.previousSibling).map(wt.fromDom)},ue=function(t){return O.from(t.dom.nextSibling).map(wt.fromDom)},ae=function(t){return N(t.dom.childNodes,wt.fromDom)},ce=function(t,e){var n=t.dom.childNodes;return O.from(n[e]).map(wt.fromDom)},se=l(Element.prototype.attachShadow)&&l(Node.prototype.getRootNode),le=m(se),fe=se?function(t){return wt.fromDom(t.dom.getRootNode())}:ne,de=function(t){var e,n=fe(t);return Zt(e=n)&&s(e.dom.host)?O.some(n):O.none()},me=function(t){return wt.fromDom(t.dom.host)},ge=function(t){return s(t.dom.shadowRoot)},he=function(t){var e=Jt(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return de(wt.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=he,r=me,function(t){return n(r(t))}))},pe=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return wt.fromDom(e)},ve=function(t,e){var n=[];return R(ae(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(ve(t,e))})),n},be=function(t,e,n){return function(t,e,n){return z(oe(t,n),e)}(t,(function(t){return xt(t,e)}),n)},ye=function(t,e){return function(t,e){return z(ae(t),e)}(t,(function(t){return xt(t,e)}))},we=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ct(n)?[]:N(n.querySelectorAll(t),wt.fromDom)}(e,t)};function xe(t,e,n,r,o){return t(n,r)?O.some(n):l(o)&&o(n)?O.none():e(n,r,o)}var Ce=function(t,e,n){for(var r=t.dom,o=l(n)?n:w;r.parentNode;){r=r.parentNode;var i=wt.fromDom(r);if(e(i))return O.some(i);if(o(i))break}return O.none()},Se=function(t,e,n){return Ce(t,(function(t){return xt(t,e)}),n)},ke=function(t,e){return function(t,e){return P(t.dom.childNodes,(function(t){return e(wt.fromDom(t))})).map(wt.fromDom)}(t,(function(t){return xt(t,e)}))},Oe=function(t,e){return St(e,t)},Te=function(t,e,n){return xe((function(t,e){return xt(t,e)}),Se,t,e,n)},_e=function(t,e,n){if(!(r(n)||a(n)||f(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},Ee=function(t,e,n){_e(t.dom,e,n)},Ae=function(t,e){var n=t.dom;Dt(e,(function(t,e){_e(n,e,t)}))},De=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Me=function(t,e){return O.from(De(t,e))},Ne=function(t,e){t.dom.removeAttribute(e)},Re=function(t){return I(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},ze=function(t,e,n){return void 0===n&&(n=h),t.exists((function(t){return n(t,e)}))},Be=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},Ie=function(t,e,n){return t.isSome()&&e.isSome()?O.some(n(t.getOrDie(),e.getOrDie())):O.none()},Pe=function(t,e){return t?O.some(e):O.none()},Le=function(t){return void 0!==t.style&&l(t.style.getPropertyValue)},He=function(t,e,n){if(!r(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Le(t)&&t.style.setProperty(e,n)},Fe=function(t,e,n){var r=t.dom;He(r,e,n)},Ve=function(t,e){var n=t.dom;Dt(e,(function(t,e){He(n,e,t)}))},je=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||he(t)?r:Ue(n,e)},Ue=function(t,e){return Le(t)?t.style.getPropertyValue(e):""},We=function(t,e){var n=t.dom,r=Ue(n,e);return O.from(r).filter((function(t){return t.length>0}))},qe=function(t,e){!function(t,e){Le(t)&&t.style.removeProperty(e)}(t.dom,e),ze(Me(t,"style").map(ot),"")&&Ne(t,"style")},Ge=function(t,e,n){return void 0===n&&(n=0),Me(t,e).map((function(t){return parseInt(t,10)})).getOr(n)},$e=function(t,e){return Ge(t,e,1)},Xe=function(t){return $e(t,"colspan")>1},Ke=function(t){return $e(t,"rowspan")>1},Ye=function(t,e){return parseInt(je(t,e),10)},Je=m(10),Qe=m(10),Ze=function(t,e){return tn(t,e,x)},tn=function(t,e,n){return F(ae(t),(function(t){return xt(t,e)?n(t)?[t]:[]:tn(t,e,n)}))},en=function(t,e){return function(t,e,n){if(void 0===n&&(n=w),n(e))return O.none();if(A(t,Gt(e)))return O.some(e);return Se(e,t.join(","),(function(t){return xt(t,"table")||n(t)}))}(["td","th"],t,e)},nn=function(t){return Ze(t,"th,td")},rn=function(t){return xt(t,"colgroup")?ye(t,"col"):F(an(t),(function(t){return ye(t,"col")}))},on=function(t,e){return Te(t,"table",e)},un=function(t){return Ze(t,"tr")},an=function(t){return on(t).fold(m([]),(function(t){return ye(t,"colgroup")}))},cn=function(t,e){return N(t,(function(t){if("colgroup"===Gt(t)){var n=N(rn(t),(function(t){var e=Ge(t,"span",1);return Vt(t,1,e)}));return jt(t,n,"colgroup")}n=N(nn(t),(function(t){var e=Ge(t,"rowspan",1),n=Ge(t,"colspan",1);return Vt(t,e,n)}));return jt(t,n,e(t))}))},sn=function(t){return re(t).map((function(t){var e=Gt(t);return function(t){return A(Ft,t)}(e)?e:"tbody"})).getOr("tbody")},ln=function(t){var e=un(t),n=X(X([],an(t)),e);return cn(n,sn)},fn=function(t,e,n){var r=t.cells,o=r.slice(0,e),i=r.slice(e),u=o.concat(n).concat(i);return gn(t,u)},dn=function(t,e,n){return fn(t,e,[n])},mn=function(t,e,n){t.cells[e]=n},gn=function(t,e){return Wt(t.element,e,t.section,t.isNew)},hn=function(t,e){return t.cells[e]},pn=function(t,e){return hn(t,e).element},vn=function(t){return t.cells.length},bn=function(t){var e=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}}(t,(function(t){return"colgroup"===t.section}));return{rows:e.fail,cols:e.pass}},yn=function(t,e,n){var r=N(t.cells,n);return Wt(e(t.element),r,t.section,!0)},wn="data-snooker-locked-cols",xn=function(t){return Me(t,wn).bind((function(t){return O.from(t.match(/\d+/g))})).map((function(t){return j(t,x)}))},Cn=function(t){var e=I(bn(t).rows,(function(t,e){return R(e.cells,(function(e,n){e.isLocked&&(t[n]=!0)})),t}),{});return function(t,e){var n=T.call(t,0);return n.sort(e),n}(zt(e,(function(t,e){return parseInt(e,10)})))},Sn=function(t,e){return t+","+e},kn=function(t,e){var n=F(t.all,(function(t){return t.cells}));return z(n,e)},On=function(t){var e={},n=[],r={},o=[],i=q(t).map((function(t){return t.element})).bind(on).bind(xn).getOr({}),u=0,a=0,c=0;return R(t,(function(t){if("colgroup"===t.section)r=function(t){var e={},n=0;return R(t.cells,(function(t){var r=t.colspan;M(r,(function(o){var i=n+o;e[i]=function(t,e,n){return{element:t,colspan:e,column:n}}(t.element,r,i)})),n+=r})),e}(t),o=[qt(t.element,Bt(r))];else{var s=[];R(t.cells,(function(t){for(var n=0;void 0!==e[Sn(c,n)];)n++;for(var r=Ht(i,n.toString()),o=function(t,e,n,r,o,i){return{element:t,rowspan:e,colspan:n,row:r,column:o,isLocked:i}}(t.element,t.rowspan,t.colspan,c,n,r),u=0;u<t.colspan;u++)for(var l=0;l<t.rowspan;l++){var f=n+u,d=Sn(c+l,f);e[d]=o,a=Math.max(a,f+1)}s.push(o)})),u++,n.push(jt(t.element,s,t.section)),c++}})),{grid:function(t,e){return{rows:t,columns:e}}(u,a),access:e,all:n,columns:r,colgroups:o}},Tn={fromTable:function(t){var e=ln(t);return On(e)},generate:On,getAt:function(t,e,n){return O.from(t.access[Sn(e,n)])},findItem:function(t,e,n){var r=kn(t,(function(t){return n(e,t.element)}));return r.length>0?O.some(r[0]):O.none()},filterItems:kn,justCells:function(t){return F(t.all,(function(t){return t.cells}))},justColumns:function(t){return Bt(t.columns)},hasColumns:function(t){return Et(t.columns).length>0},getColumnAt:function(t,e){return O.from(t.columns[e])}},_n=function(t,e){var n=e.column,r=e.column+e.colspan-1,o=e.row,i=e.row+e.rowspan-1;return n<=t.finishCol&&r>=t.startCol&&o<=t.finishRow&&i>=t.startRow},En=function(t,e){return e.column>=t.startCol&&e.column+e.colspan-1<=t.finishCol&&e.row>=t.startRow&&e.row+e.rowspan-1<=t.finishRow},An=function(t,e,n){var r=Tn.findItem(t,e,kt),o=Tn.findItem(t,n,kt);return r.bind((function(t){return o.map((function(e){return n=t,r=e,o=Math.min(n.row,r.row),i=Math.min(n.column,r.column),u=Math.max(n.row+n.rowspan-1,r.row+r.rowspan-1),a=Math.max(n.column+n.colspan-1,r.column+r.colspan-1),{startRow:o,startCol:i,finishRow:u,finishCol:a};var n,r,o,i,u,a}))}))},Dn=function(t,e,n){return An(t,e,n).bind((function(e){return function(t,e){for(var n=!0,r=p(En,e),o=e.startRow;o<=e.finishRow;o++)for(var i=e.startCol;i<=e.finishCol;i++)n=n&&Tn.getAt(t,o,i).exists(r);return n?O.some(e):O.none()}(t,e)}))},Mn=function(t,e,n){return An(t,e,n).map((function(e){var n=Tn.filterItems(t,p(_n,e));return N(n,(function(t){return t.element}))}))},Nn=function(t,e){return Tn.findItem(t,e,(function(t,e){return Tt(e,t)})).map((function(t){return t.element}))},Rn=function(t,e,n){return on(t).bind((function(r){return function(t,e,n,r){return Tn.findItem(t,e,kt).bind((function(e){var o=n>0?e.row+e.rowspan-1:e.row,i=r>0?e.column+e.colspan-1:e.column;return Tn.getAt(t,o+n,i+r).map((function(t){return t.element}))}))}(In(r),t,e,n)}))},zn=function(t,e,n){var r=In(t);return Mn(r,e,n)},Bn=function(t,e,n,r,o){var i=In(t),u=kt(t,n)?O.some(e):Nn(i,e),a=kt(t,o)?O.some(r):Nn(i,r);return u.bind((function(t){return a.bind((function(e){return Mn(i,t,e)}))}))},In=Tn.fromTable,Pn=function(t,e){re(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Ln=function(t,e){ue(t).fold((function(){re(t).each((function(t){Fn(t,e)}))}),(function(t){Pn(t,e)}))},Hn=function(t,e){(function(t){return ce(t,0)})(t).fold((function(){Fn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Fn=function(t,e){t.dom.appendChild(e.dom)},Vn=function(t,e){Pn(t,e),Fn(e,t)},jn=function(t,e){R(e,(function(n,r){var o=0===r?t:e[r-1];Ln(o,n)}))},Un=function(t,e){R(e,(function(e){Fn(t,e)}))},Wn=function(t){t.dom.textContent="",R(ae(t),(function(t){qn(t)}))},qn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Gn=function(t){var e,n=ae(t);n.length>0&&(e=t,R(n,(function(t){Pn(e,t)}))),qn(t)},$n=function(t,e){var n=function(e){return t(e)?O.from(e.dom.nodeValue):O.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Jt,"text"),Xn=function(t){return $n.get(t)},Kn=function(t){return $n.getOption(t)},Yn=function(t,e){return $n.set(t,e)},Jn=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function Qn(){return{up:m({selector:Se,closest:Te,predicate:Ce,all:oe}),down:m({selector:we,predicate:ve}),styles:m({get:je,getRaw:We,set:Fe,remove:qe}),attrs:m({get:De,set:Ee,remove:Ne,copyTo:function(t,e){var n=Re(t);Ae(e,n)}}),insert:m({before:Pn,after:Ln,afterAll:jn,append:Fn,appendAll:Un,prepend:Hn,wrap:Vn}),remove:m({unwrap:Gn,remove:qn}),create:m({nu:wt.fromTag,clone:function(t){return wt.fromDom(t.dom.cloneNode(!1))},text:wt.fromText}),query:m({comparePosition:function(t,e){return t.dom.compareDocumentPosition(e.dom)},prevSibling:ie,nextSibling:ue}),property:m({children:ae,name:Gt,parent:re,document:function(t){return ne(t).dom},isText:Jt,isComment:Kt,isElement:Yt,isSpecial:function(t){var e=Gt(t);return A(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],e)},getLanguage:function(t){return Yt(t)?Me(t,"lang"):O.none()},getText:Xn,setText:Yn,isBoundary:function(t){return!!Yt(t)&&("body"===Gt(t)||A(Jn,Gt(t)))},isEmptyTag:function(t){return!!Yt(t)&&A(["br","img","hr","input"],Gt(t))},isNonEditable:function(t){return Yt(t)&&"false"===De(t,"contenteditable")}}),eq:kt,is:_t}}var Zn,tr,er=function(t,e,n,r){var o=e(t,n);return B(r,(function(n,r){var o=e(t,r);return nr(t,n,o)}),o)},nr=function(t,e,n){return e.bind((function(e){return n.filter(p(t.eq,e))}))},rr=function(t,e,n){return n.length>0?function(t,e,n,r){return r(t,e,n[0],n.slice(1))}(t,e,n,er):O.none()},or=function(t,e,n,r){void 0===r&&(r=w);var o=[e].concat(t.up().all(e)),i=[n].concat(t.up().all(n)),u=function(t){return L(t,r).fold((function(){return t}),(function(e){return t.slice(0,e+1)}))},a=u(o),c=u(i),s=P(a,(function(e){return D(c,function(t,e){return p(t.eq,e)}(t,e))}));return{firstpath:a,secondpath:c,shared:s}},ir=Qn(),ur=function(t,e){return rr(ir,(function(e,n){return t(n)}),e)},ar=function(t){return Se(t,"table")},cr=function(t,e,n){var r=function(t){return function(e){return void 0!==n&&n(e)||kt(e,t)}};return kt(t,e)?O.some({boxes:O.some([t]),start:t,finish:e}):ar(t).bind((function(o){return ar(e).bind((function(i){if(kt(o,i))return O.some({boxes:zn(o,t,e),start:t,finish:e});if(Tt(o,i)){var u=(a=be(e,"td,th",r(o))).length>0?a[a.length-1]:e;return O.some({boxes:Bn(o,t,o,e,i),start:t,finish:u})}if(Tt(i,o)){var a,c=(a=be(t,"td,th",r(i))).length>0?a[a.length-1]:t;return O.some({boxes:Bn(i,t,o,e,i),start:t,finish:c})}return function(t,e,n){return or(ir,t,e,n)}(t,e).shared.bind((function(u){return Te(u,"table",n).bind((function(n){var u=be(e,"td,th",r(n)),a=u.length>0?u[u.length-1]:e,c=be(t,"td,th",r(n)),s=c.length>0?c[c.length-1]:t;return O.some({boxes:Bn(n,t,o,e,i),start:s,finish:a})}))}))}))}))},sr=function(t,e){var n=we(t,e);return n.length>0?O.some(n):O.none()},lr=function(t,e,n){return Oe(t,e).bind((function(e){return Oe(t,n).bind((function(t){return ur(ar,[e,t]).map((function(n){return{first:e,last:t,table:n}}))}))}))},fr=function(t,e,n,r,o){return function(t,e){return P(t,(function(t){return xt(t,e)}))}(t,o).bind((function(t){return Rn(t,e,n).bind((function(t){return function(t,e){return Se(t,"table").bind((function(n){return Oe(n,e).bind((function(e){return cr(e,t).bind((function(t){return t.boxes.map((function(e){return{boxes:e,start:t.start,finish:t.finish}}))}))}))}))}(t,r)}))}))},dr=function(t,e){return sr(t,e)},mr=function(t,e,n){return lr(t,e,n).bind((function(e){var n=function(e){return kt(t,e)},r=Se(e.first,"thead,tfoot,tbody,table",n),o=Se(e.last,"thead,tfoot,tbody,table",n);return r.bind((function(t){return o.bind((function(n){return kt(t,n)?function(t,e,n){var r=In(t);return Dn(r,e,n)}(e.table,e.first,e.last):O.none()}))}))}))},gr=function(t){if(!i(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return R(t,(function(r,o){var u=Et(r);if(1!==u.length)throw new Error("one and only one name per case");var a=u[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!i(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);var u=function(t){var r=Et(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!V(e,(function(t){return A(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:u,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}})),n},hr=gr([{none:[]},{multiple:["elements"]},{single:["element"]}]),pr=function(t,e,n,r){return t.fold(e,n,r)},vr=hr.none,br=hr.multiple,yr=hr.single,wr=tinymce.util.Tools.resolve("tinymce.PluginManager"),xr=function(t,e){return wt.fromDom(t.dom.cloneNode(e))},Cr=function(t){return xr(t,!1)},Sr=function(t){return xr(t,!0)},kr=function(t,e){var n=wt.fromTag(e),r=Re(t);return Ae(n,r),n},Or=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=je(n,t);return parseFloat(o)||0}return r},r=function(t,e){return I(e,(function(e,n){var r=je(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!f(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Le(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},Tr=Or("width",(function(t){return t.dom.offsetWidth})),_r=function(t){return Tr.get(t)},Er=function(t){return Tr.getOuter(t)},Ar=function(t,e){void 0===e&&(e=x);var n=t.grid,r=M(n.columns,g),o=M(n.rows,g);return N(r,(function(n){return Dr((function(){return F(o,(function(e){return Tn.getAt(t,e,n).filter((function(t){return t.column===n})).toArray()}))}),(function(t){return 1===t.colspan&&e(t.element)}),(function(){return Tn.getAt(t,0,n)}))}))},Dr=function(t,e,n){var r=t();return P(r,e).orThunk((function(){return O.from(r[0]).orThunk(n)})).map((function(t){return t.element}))},Mr=function(t){var e=t.grid,n=M(e.rows,g),r=M(e.columns,g);return N(n,(function(e){return Dr((function(){return F(r,(function(n){return Tn.getAt(t,e,n).filter((function(t){return t.row===e})).fold(m([]),(function(t){return[t]}))}))}),(function(t){return 1===t.rowspan}),(function(){return Tn.getAt(t,e,0)}))}))},Nr=function(t,e){if(e<0||e>=t.length-1)return O.none();var n=t[e].fold((function(){var n=function(t){var e=T.call(t,0);return e.reverse(),e}(t.slice(0,e));return G(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return O.some({value:t,delta:0})})),r=t[e+1].fold((function(){var n=t.slice(e+1);return G(n,(function(t,e){return t.map((function(t){return{value:t,delta:e+1}}))}))}),(function(t){return O.some({value:t,delta:1})}));return n.bind((function(t){return r.map((function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n}))}))},Rr=function(t,e){return function(n){return"rtl"===zr(n)?e:t}},zr=function(t){return"rtl"===je(t,"direction")?"rtl":"ltr"},Br=Or("height",(function(t){var e=t.dom;return he(t)?e.getBoundingClientRect().height:e.offsetHeight})),Ir=function(t){return Br.get(t)},Pr=function(t){return Br.getOuter(t)},Lr=function(t,e){return{left:t,top:e,translate:function(n,r){return Lr(t+n,e+r)}}},Hr=Lr,Fr=function(t,e){return void 0!==t?t:void 0!==e?e:0},Vr=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return Hr(n.offsetLeft,n.offsetTop);var i=Fr(null==r?void 0:r.pageYOffset,o.scrollTop),u=Fr(null==r?void 0:r.pageXOffset,o.scrollLeft),a=Fr(o.clientTop,n.clientTop),c=Fr(o.clientLeft,n.clientLeft);return jr(t).translate(u-c,i-a)},jr=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?Hr(n.offsetLeft,n.offsetTop):he(t)?function(t){var e=t.getBoundingClientRect();return Hr(e.left,e.top)}(e):Hr(0,0)},Ur=function(t,e){return{row:t,y:e}},Wr=function(t,e){return{col:t,x:e}},qr=function(t){return Vr(t).left+Er(t)},Gr=function(t){return Vr(t).left},$r=function(t,e){return Wr(t,Gr(e))},Xr=function(t,e){return Wr(t,qr(e))},Kr=function(t){return Vr(t).top},Yr=function(t,e){return Ur(t,Kr(e))},Jr=function(t,e){return Ur(t,Kr(e)+Pr(e))},Qr=function(t,e,n){if(0===n.length)return[];var r=N(n.slice(1),(function(e,n){return e.map((function(e){return t(n,e)}))})),o=n[n.length-1].map((function(t){return e(n.length-1,t)}));return r.concat([o])},Zr={delta:g,positions:function(t){return Qr(Yr,Jr,t)},edge:Kr},to={delta:g,edge:Gr,positions:function(t){return Qr($r,Xr,t)}},eo={delta:function(t){return-t},edge:qr,positions:function(t){return Qr(Xr,$r,t)}},no=Rr(to,eo),ro={delta:function(t,e){return no(e).delta(t,e)},positions:function(t,e){return no(e).positions(t,e)},edge:function(t){return no(t).edge(t)}},oo={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:[""]},io=(Zn=function(t){return"(?:"+t+")?"},tr=["Infinity","[0-9]+\\."+Zn("[0-9]+")+Zn("[eE][+-]?[0-9]+"),"\\.[0-9]+"+Zn("[eE][+-]?[0-9]+"),"[0-9]+"+Zn("[eE][+-]?[0-9]+")].join("|"),new RegExp("^([+-]?(?:"+tr+"))(.*)$")),uo=function(t,e){return O.from(io.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return D(e,(function(e){return D(oo[e],(function(e){return t===e}))}))}(r,e)?O.some({value:n,unit:r}):O.none()}))},ao=function(){var t=bt().browser;return t.isIE()||t.isEdge()},co=function(t,e,n){return function(t,e){var n=parseFloat(t);return isNaN(n)?e:n}(je(t,e),n)},so=function(t){return ao()?function(t){var e=t.dom.getBoundingClientRect().height;return"border-box"===je(t,"box-sizing")?e:e-co(t,"padding-top",0)-co(t,"padding-bottom",0)-(co(t,"border-top-width",0)+co(t,"border-bottom-width",0))}(t):co(t,"height",Ir(t))},lo=function(t){return ao()?function(t){var e=t.dom.getBoundingClientRect().width;return"border-box"===je(t,"box-sizing")?e:e-co(t,"padding-left",0)-co(t,"padding-right",0)-(co(t,"border-left-width",0)+co(t,"border-right-width",0))}(t):co(t,"width",_r(t))},fo=/(\d+(\.\d+)?)%/,mo=/(\d+(\.\d+)?)px|em/,go=function(t,e){var n,r=(n=t,O.from(n.dom.offsetParent).map(wt.fromDom)).getOr(pe(ee(t)));return e(t)/e(r)*100},ho=function(t,e){Fe(t,"width",e+"px")},po=function(t,e){Fe(t,"width",e+"%")},vo=function(t,e){Fe(t,"height",e+"px")},bo=function(t,e,n,r){var o=parseInt(t,10);return rt(t,"%")&&"table"!==Gt(e)?function(t,e,n,r){var o=on(t).map((function(t){var r=n(t);return Math.floor(e/100*r)})).getOr(e);return r(t,o),o}(e,o,n,r):o},yo=function(t){var e=function(t){return We(t,"height").getOrThunk((function(){return so(t)+"px"}))}(t);return e?bo(e,t,Ir,vo):Ir(t)},wo=function(t){return We(t,"width").fold((function(){return O.from(De(t,"width"))}),(function(t){return O.some(t)}))},xo=function(t,e){return t/e.pixelWidth()*100},Co=function(t,e){return wo(t).fold((function(){var n=_r(t);return xo(n,e)}),(function(n){return function(t,e,n){var r=fo.exec(e);if(null!==r)return parseFloat(r[1]);var o=lo(t);return xo(o,n)}(t,n,e)}))},So=function(t,e){return wo(t).fold((function(){return lo(t)}),(function(n){return function(t,e,n){var r=mo.exec(e);if(null!==r)return parseInt(r[1],10);var o=fo.exec(e);return null!==o?function(t,e){return t/100*e.pixelWidth()}(parseFloat(o[1]),n):lo(t)}(t,n,e)}))},ko=function(t){return function(t,e,n){return n(t)/$e(t,e)}(t,"rowspan",yo)},Oo=function(t,e,n){Fe(t,"width",e+n)},To=function(t){return go(t,_r)+"%"},_o=m(fo),Eo=m(mo),Ao=te("col"),Do=function(t,e,n){return We(t,e).getOrThunk((function(){return n(t)+"px"}))},Mo=function(t,e){return Do(t,"width",(function(t){return Ao(t)?_r(t):So(t,e)}))},No=function(t){return Do(t,"height",ko)},Ro=function(t,e){return We(t,e).isSome()},zo=function(t,e,n,r,o,i){return t.filter(r).fold((function(){return i(Nr(n,e))}),(function(t){return o(t)}))},Bo=function(t,e,n,r,o){var i=Ar(t,(function(t){return Ro(t,"width")})),u=Tn.hasColumns(t)?function(t){return N(Tn.justColumns(t),(function(t){return O.from(t.element)}))}(t):i,a=[O.some(ro.edge(e))].concat(N(ro.positions(i,e),(function(t){return t.map((function(t){return t.x}))}))),c=y(Xe);return N(u,(function(t,e){return zo(t,e,a,c,(function(t){if(function(t){return!Ao(t)||Ro(t,"width")}(t))return n(t,o);var u,s,l=(u=i[e],s=g,null!=u?s(u):O.none());return zo(l,e,a,c,(function(t){return r(O.some(_r(t)))}),r)}),r)}))},Io=function(t){return t.map((function(t){return t+"px"})).getOr("")},Po=function(t,e,n){return Bo(t,e,So,(function(t){return t.getOrThunk(n.minCellWidth)}),n)},Lo=function(t,e,n,r,o){var i=Mr(t),u=[O.some(n.edge(e))].concat(N(n.positions(i,e),(function(t){return t.map((function(t){return t.y}))})));return N(i,(function(t,e){return zo(t,e,u,y(Ke),r,o)}))},Ho=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Fo=function(t){var e=function(){return _r(t)},n=m(0);return{width:e,pixelWidth:e,getWidths:function(e,n){return Po(e,t,n)},getCellDelta:n,singleColumnWidth:m([0]),minCellWidth:n,setElementWidth:d,adjustTableWidth:d,isRelative:!0,label:"none"}},Vo=function(t,e){var n=Ho(parseFloat(t)),r=Ho(_r(e));return{width:n.get,pixelWidth:r.get,getWidths:function(t,n){return function(t,e,n){return Bo(t,e,Co,(function(t){return t.fold((function(){return n.minCellWidth()}),(function(t){return t/n.pixelWidth()*100}))}),n)}(t,e,n)},getCellDelta:function(t){return t/r.get()*100},singleColumnWidth:function(t,e){return[100-t]},minCellWidth:function(){return Je()/r.get()*100},setElementWidth:po,adjustTableWidth:function(t){var o=n.get(),i=o+t/100*o;po(e,i),n.set(i),r.set(_r(e))},isRelative:!0,label:"percent"}},jo=function(t,e){var n=Ho(t),r=n.get;return{width:r,pixelWidth:r,getWidths:function(t,n){return Po(t,e,n)},getCellDelta:g,singleColumnWidth:function(t,e){return[Math.max(Je(),t+e)-t]},minCellWidth:Je,setElementWidth:ho,adjustTableWidth:function(t){var o=r()+t;ho(e,o),n.set(o)},isRelative:!1,label:"pixel"}},Uo=function(t){return wo(t).fold((function(){return Fo(t)}),(function(e){return function(t,e){var n=_o().exec(e);if(null!==n)return Vo(n[1],t);var r=Eo().exec(e);if(null!==r){var o=parseInt(r[1],10);return jo(o,t)}var i=_r(t);return jo(i,t)}(t,e)}))},Wo=jo,qo=Vo,Go=function(t,e,n){var r=t[n].element,o=wt.fromTag("td");Fn(o,wt.fromTag("br")),(e?Fn:Hn)(r,o)},$o=function(t,e){var n=function(t){return xt(t.element,e)},r=Sr(t),o=ln(r),i=Uo(t),u=Tn.generate(o),a=function(t,e){var n=t.grid.columns,r=t.grid.rows,o=n,i=0,u=0,a=[],c=[];return Dt(t.access,(function(t){if(a.push(t),e(t)){c.push(t);var n=t.row,s=n+t.rowspan-1,l=t.column,f=l+t.colspan-1;n<r?r=n:s>i&&(i=s),l<o?o=l:f>u&&(u=f)}})),function(t,e,n,r,o,i){return{minRow:t,minCol:e,maxRow:n,maxCol:r,allCells:o,selectedCells:i}}(r,o,i,u,a,c)}(u,n),c="th:not("+e+"),td:not("+e+")",s=tn(r,"th,td",(function(t){return xt(t,c)}));return R(s,qn),function(t,e,n,r){for(var o=e.grid.columns,i=e.grid.rows,u=0;u<i;u++)for(var a=!1,c=0;c<o;c++){if(!(u<n.minRow||u>n.maxRow||c<n.minCol||c>n.maxCol))Tn.getAt(e,u,c).filter(r).isNone()?Go(t,a,u):a=!0}}(o,u,a,n),function(t,e,n,r){Dt(n.columns,(function(t){(t.column<e.minCol||t.column>e.maxCol)&&qn(t.element)}));var o=z(Ze(t,"tr"),(function(t){return 0===t.dom.childElementCount}));R(o,qn),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||R(Ze(t,"th,td"),(function(t){Ne(t,"rowspan"),Ne(t,"colspan")})),Ne(t,wn),Ne(t,"data-snooker-col-series"),Uo(t).adjustTableWidth(r)}(r,a,u,function(t,e,n,r){if(0===r.minCol&&e.grid.columns===r.maxCol+1)return 0;var o=Po(e,t,n),i=I(o,(function(t,e){return t+e}),0),u=I(o.slice(r.minCol,r.maxCol+1),(function(t,e){return t+e}),0)/i*n.pixelWidth()-n.pixelWidth();return n.getCellDelta(u)}(t,Tn.fromTable(t),i,a)),r},Xo=function(t){return"img"===Gt(t)?1:Kn(t).fold((function(){return ae(t).length}),(function(t){return t.length}))},Ko=["img","br"],Yo=function(t){return Kn(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||A(Ko,Gt(t))},Jo=function(t){return e=Yo,(n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=wt.fromDom(t.childNodes[r]);if(e(o))return O.some(o);var i=n(t.childNodes[r]);if(i.isSome())return i}return O.none()})(t.dom);var e,n},Qo=function(t){return Zo(t,Yo)},Zo=function(t,e){var n=function(t){for(var r=ae(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return O.some(i);var u=n(i);if(u.isSome())return u}return O.none()};return n(t)},ti={scope:["row","col"]},ei=function(t){return function(){var e=wt.fromTag("td",t.dom);return Fn(e,wt.fromTag("br",t.dom)),e}},ni=function(t){return function(){return wt.fromTag("col",t.dom)}},ri=function(t){return function(){return wt.fromTag("colgroup",t.dom)}},oi=function(t){return function(){return wt.fromTag("tr",t.dom)}},ii=function(t,e,n){var r=function(t,e){var n=kr(t,e),r=ae(Sr(t));return Un(n,r),n}(t,e);return Dt(n,(function(t,e){null===t?Ne(r,e):Ee(r,e,t)})),r},ui=function(t){return t},ai=function(t,e,n){var r=function(t,e){var n,r,o,i;n=t.element,r=e,o=n.dom,i=r.dom,Le(o)&&Le(i)&&(i.style.cssText=o.style.cssText),qe(e,"height"),1!==t.colspan&&qe(e,"width")};return{col:function(n){var o=wt.fromTag(Gt(n.element),e.dom);return r(n,o),t(n.element,o),o},colgroup:ri(e),row:oi(e),cell:function(o){var i=wt.fromTag(Gt(o.element),e.dom),u=n.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=u.length>0?function(t,e,n){return Jo(t).map((function(r){var o=n.join(","),i=be(r,o,(function(e){return kt(e,t)}));return B(i,(function(t,e){var n=Cr(e);return Ne(n,"contenteditable"),Fn(t,n),n}),e)})).getOr(e)}(o.element,i,u):i;return Fn(a,wt.fromTag("br")),r(o,i),function(t,e){Dt(ti,(function(n,r){return Me(t,r).filter((function(t){return A(n,t)})).each((function(t){return Ee(e,r,t)}))}))}(o.element,i),t(o.element,i),i},replace:ii,gap:ei(e)}},ci=function(t){return{col:ni(t),colgroup:ri(t),row:oi(t),cell:ei(t),replace:ui,gap:ei(t)}},si=function(t){return N(t,wt.fromDom)},li=function(t){return wt.fromDom(t.getBody())},fi=function(t){return t.getBoundingClientRect().width},di=function(t){return t.getBoundingClientRect().height},mi=function(t){return function(e){return kt(e,li(t))}},gi=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},hi=function(t){Ne(t,"data-mce-style");var e=function(t){return Ne(t,"data-mce-style")};R(nn(t),e),R(rn(t),e)},pi=function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return O.from(n).filter(it)},vi=function(t){return/^(\d+(\.\d+)?)%$/.test(t)},bi=function(t){return wt.fromDom(t.selection.getStart())},yi=function(t){return pr(t.get(),m([]),g,U)},wi=function(t){var e=function(t,e){return Me(t,e).exists((function(t){return parseInt(t,10)>1}))},n=yi(t);return n.length>0&&V(n,(function(t){return e(t,"rowspan")||e(t,"colspan")}))?O.some(n):O.none()},xi=function(t,e,n){return pr(e.get(),O.none,(function(e){return e.length<=1?O.none():mr(t,n.firstSelectedSelector,n.lastSelectedSelector).map((function(t){return{bounds:t,cells:e}}))}),O.none)},Ci={selected:"data-mce-selected",selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:"data-mce-first-selected",firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:"data-mce-last-selected",lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},Si=function(t,e,n){return{element:n,mergable:xi(e,t,Ci),unmergable:wi(t),selection:yi(t)}},ki=function(t){return function(e,n){var r,o=Gt(e),i="col"===o||"colgroup"===o?on(r=e).bind((function(t){return dr(t,Ci.firstSelectedSelector)})).fold(m(r),(function(t){return t[0]})):e;return Te(i,t,n)}},Oi=ki("th,td,caption"),Ti=ki("th,td"),_i=function(t){return yi(t)},Ei=function(t,e,n){t.on("BeforeGetContent",(function(n){!0===n.selection&&pr(e.get(),d,(function(e){n.preventDefault(),function(t){return on(t[0]).map((function(t){var e=$o(t,"[data-mce-selected]");return hi(e),[e]}))}(e).each((function(e){n.content="text"===n.format?function(t){return N(t,(function(t){return t.dom.innerText})).join("")}(e):function(t,e){return N(e,(function(e){return t.selection.serializer.serialize(e.dom,{})})).join("")}(t,e)}))}),d)})),t.on("BeforeSetContent",(function(r){if(!0===r.selection&&!0===r.paste){var o=_i(e);q(o).each((function(e){on(e).each((function(o){var i,u,a,c=z((i=r.content,(a=(u||document).createElement("div")).innerHTML=i,ae(wt.fromDom(a))),(function(t){return"meta"!==Gt(t)})),s=te("table");if(1===c.length&&s(c[0])){r.preventDefault();var l=wt.fromDom(t.getDoc()),f=ci(l),d=function(t,e,n){return{element:t,clipboard:e,generators:n}}(e,c[0],f);n.pasteCells(o,d).each((function(){t.focus()}))}}))}))}}))},Ai=gr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Di=$({},Ai),Mi=function(t,e,n,r,o){var i=t.slice(0),u=function(t,e){return 0===t.length?Di.none():1===t.length?Di.only(0):0===e?Di.left(0,1):e===t.length-1?Di.right(e-1,e):e>0&&e<t.length-1?Di.middle(e-1,e,e+1):Di.none()}(t,e),a=m(N(i,m(0)));return u.fold(a,(function(t){return r.singleColumnWidth(i[t],n)}),(function(t,e){return o.calcLeftEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)}),(function(t,e,u){return o.calcMiddleDeltas(i,t,e,u,n,r.minCellWidth(),r.isRelative)}),(function(t,e){return o.calcRightEdgeDeltas(i,t,e,n,r.minCellWidth(),r.isRelative)}))},Ni=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},Ri=function(t,e){var n=Tn.justCells(t);return N(n,(function(t){var n=Ni(t.row,t.row+t.rowspan,e);return{element:t.element,height:n,rowspan:t.rowspan}}))},zi=function(t,e){return Tn.hasColumns(t)?function(t,e){var n=Tn.justColumns(t);return N(n,(function(t,n){return{element:t.element,width:e[n],colspan:t.colspan}}))}(t,e):function(t,e){var n=Tn.justCells(t);return N(n,(function(t){var n=Ni(t.column,t.column+t.colspan,e);return{element:t.element,width:n,colspan:t.colspan}}))}(t,e)},Bi=function(t,e,n){var r=zi(t,e);R(r,(function(t){n.setElementWidth(t.element,t.width)}))},Ii=function(t,e,n,r,o){var i=Tn.fromTable(t),u=o.getCellDelta(e),a=o.getWidths(i,o),c=n===i.grid.columns-1,s=r.clampTableDelta(a,n,u,o.minCellWidth(),c),l=Mi(a,n,s,o,r),f=N(l,(function(t,e){return t+a[e]}));Bi(i,f,o),r.resizeTable(o.adjustTableWidth,s,c)},Pi=function(t,e,n,r){var o=Tn.fromTable(t),i=function(t,e,n){return Lo(t,e,n,ko,(function(t){return t.getOrThunk(Qe)}))}(o,t,r),u=N(i,(function(t,r){return n===r?Math.max(e+t,Qe()):t})),a=Ri(o,u),c=function(t,e){return N(t.all,(function(t,n){return{element:t.element,height:e[n]}}))}(o,u);R(c,(function(t){vo(t.element,t.height)})),R(a,(function(t){vo(t.element,t.height)}));var s=B(u,(function(t,e){return t+e}),0);vo(t,s)},Li=function(t){return N(t,m(0))},Hi=function(t,e,n,r,o){return o(t.slice(0,e)).concat(r).concat(o(t.slice(n)))},Fi=function(t){return function(e,n,r,o){if(t(r)){var i=Math.max(o,e[n]-Math.abs(r)),u=Math.abs(i-e[n]);return r>=0?u:-u}return r}},Vi=Fi((function(t){return t<0})),ji=Fi(x),Ui=function(){var t=function(t,e,n,r){var o=(100+n)/100,i=Math.max(r,(t[e]+n)/o);return N(t,(function(t,n){return(n===e?i:t/o)-t}))},e=function(e,n,r,o,i,u){return u?t(e,n,o,i):function(t,e,n,r,o){var i=Vi(t,e,r,o);return Hi(t,e,n+1,[i,0],Li)}(e,n,r,o,i)};return{resizeTable:function(t,e){return t(e)},clampTableDelta:Vi,calcLeftEdgeDeltas:e,calcMiddleDeltas:function(t,n,r,o,i,u,a){return e(t,r,o,i,u,a)},calcRightEdgeDeltas:function(e,n,r,o,i,u){if(u)return t(e,r,o,i);var a=Vi(e,r,o,i);return Li(e.slice(0,r)).concat([a])},calcRedestributedWidths:function(t,e,n,r){if(r){var o=(e+n)/e,i=N(t,(function(t){return t/o}));return{delta:100*o-100,newSizes:i}}return{delta:n,newSizes:t}}}},Wi=function(){var t=function(t,e,n,r,o){var i=ji(t,r>=0?n:e,r,o);return Hi(t,e,n+1,[i,-i],Li)};return{resizeTable:function(t,e,n){n&&t(e)},clampTableDelta:function(t,e,n,r,o){if(o){if(n>=0)return n;var i=I(t,(function(t,e){return t+e-r}),0);return Math.max(-i,n)}return Vi(t,e,n,r)},calcLeftEdgeDeltas:t,calcMiddleDeltas:function(e,n,r,o,i,u){return t(e,r,o,i,u)},calcRightEdgeDeltas:function(t,e,n,r,o,i){if(i)return Li(t);var u=r/t.length;return N(t,m(u))},calcRedestributedWidths:function(t,e,n,r){return{delta:0,newSizes:t}}}},qi=function(t,e){var n=O.from(t.dom.documentElement).map(wt.fromDom).getOr(t);return{parent:m(n),view:m(t),origin:m(Hr(0,0)),isResizable:e}},Gi=function(t,e,n){return{parent:m(e),view:m(t),origin:m(Hr(0,0)),isResizable:n}},$i=gr([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),Xi=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):$i.invalid(n)},Ki=$($({},$i),{from:function(t){return rt(t,"%")?Xi("%",$i.percent,t):rt(t,"px")?Xi("px",$i.pixels,t):$i.invalid(t)}}),Yi=function(t,e,n){return t.fold((function(){return e}),(function(t){return function(t,e,n){var r=n/e;return N(t,(function(t){return Ki.from(t).fold((function(){return t}),(function(t){return t*r+"px"}),(function(t){return t/100*n+"px"}))}))}(e,n,t)}),(function(t){return function(t,e){return N(t,(function(t){return Ki.from(t).fold((function(){return t}),(function(t){return t/e*100+"%"}),(function(t){return t+"%"}))}))}(e,n)}))},Ji=function(t,e,n){var r=Ki.from(n),o=V(t,(function(t){return"0px"===t}))?function(t,e){var n=t.fold((function(){return m("")}),(function(t){return m(t/e+"px")}),(function(){return m(100/e+"%")}));return M(e,n)}(r,t.length):Yi(r,t,e);return tu(o)},Qi=function(t,e){return 0===t.length?e:B(t,(function(t,e){return Ki.from(e).fold(m(0),g,g)+t}),0)},Zi=function(t,e){return Ki.from(t).fold(m(t),(function(t){return t+e+"px"}),(function(t){return t+e+"%"}))},tu=function(t){if(0===t.length)return t;var e=B(t,(function(t,e){var n=Ki.from(e).fold((function(){return{value:e,remainder:0}}),(function(t){return function(t,e){var n=Math.floor(t);return{value:n+e,remainder:t-n}}(t,"px")}),(function(t){return{value:t+"%",remainder:0}}));return{output:[n.value].concat(t.output),remainder:t.remainder+n.remainder}}),{output:[],remainder:0}),n=e.output;return n.slice(0,n.length-1).concat([Zi(n[n.length-1],Math.round(e.remainder))])},eu=Ki.from,nu=function(t){return eu(t).fold(m("px"),m("px"),m("%"))},ru=function(t,e,n,r){var o=Tn.fromTable(t),i=o.all,u=Tn.justCells(o),a=Tn.justColumns(o);e.each((function(e){var n=nu(e),i=_r(t),c=function(t,e,n){return Bo(t,e,Mo,Io,n)}(o,t,r),s=Ji(c,i,e);Tn.hasColumns(o)?function(t,e,n){R(e,(function(e,r){var o=Qi([t[r]],Je());Fe(e.element,"width",o+n)}))}(s,a,n):function(t,e,n){R(e,(function(e){var r=t.slice(e.column,e.colspan+e.column),o=Qi(r,Je());Fe(e.element,"width",o+n)}))}(s,u,n),Fe(t,"width",e)})),n.each((function(e){var n=nu(e),r=Ir(t),a=function(t,e,n){return Lo(t,e,n,No,Io)}(o,t,Zr);!function(t,e,n,r){R(n,(function(e){var n=t.slice(e.row,e.rowspan+e.row),o=Qi(n,Qe());Fe(e.element,"height",o+r)})),R(e,(function(e,n){Fe(e.element,"height",t[n])}))}(Ji(a,r,e),i,u,n),Fe(t,"height",e)}))},ou=function(t){return wo(t).exists((function(t){return fo.test(t)}))},iu=function(t){return wo(t).exists((function(t){return mo.test(t)}))},uu=function(t){return wo(t).isNone()},au=To,cu=function(t){return Tn.fromTable(t).grid},su=function(t){var e=[];return{bind:function(t){if(void 0===t)throw new Error("Event bind error: undefined handler");e.push(t)},unbind:function(t){e=z(e,(function(e){return e!==t}))},trigger:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};R(t,(function(t,e){o[t]=n[e]})),R(e,(function(t){t(o)}))}}},lu=function(t){return{registry:Mt(t,(function(t){return{bind:t.bind,unbind:t.unbind}})),trigger:Mt(t,(function(t){return t.trigger}))}},fu=function(t){return t.slice(0).sort()},du=function(t,e,n){if(0===e.length)throw new Error("You must specify at least one required field.");var o;return function(t,e){if(!i(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");R(e,(function(e){if(!r(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")}))}("required",e),o=fu(e),P(o,(function(t,e){return e<o.length-1&&t===o[e+1]})).each((function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+o.join(", ")+"].")})),function(r){var o=Et(r);V(e,(function(t){return A(o,t)}))||function(t,e){throw new Error("All required keys ("+fu(t).join(", ")+") were not specified. Specified keys were: "+fu(e).join(", ")+".")}(e,o),t(e,o);var i=z(e,(function(t){return!n.validate(r[t],t)}));return i.length>0&&function(t,e){throw new Error("All values need to be of type: "+e+". Keys ("+fu(t).join(", ")+") were not.")}(i,n.label),r}},mu=function(t,e){var n=z(e,(function(e){return!A(t,e)}));n.length>0&&function(t){throw new Error("Unsupported keys for object: "+fu(t).join(", "))}(n)},gu=function(t){return function(t,e){return du(t,e,{validate:l,label:"function"})}(mu,t)},hu=gu(["compare","extract","mutate","sink"]),pu=gu(["element","start","stop","destroy"]),vu=gu(["forceDrop","drop","move","delayDrop"]),bu=function(){var t=O.none(),e=lu({move:su(["info"])});return{onEvent:function(n,r){r.extract(n).each((function(n){(function(e,n){var r=t.map((function(t){return e.compare(t,n)}));return t=O.some(n),r})(r,n).each((function(t){e.trigger.move(t)}))}))},reset:function(){t=O.none()},events:e.registry}},yu=function(){var t,e=(t=lu({move:su(["info"])}),{onEvent:d,reset:d,events:t.registry}),n=bu(),r=e;return{on:function(){r.reset(),r=n},off:function(){r.reset(),r=e},isOn:function(){return r===n},onEvent:function(t,e){r.onEvent(t,e)},events:n.events}},wu=function(t,e,n){var r,o,i,a,c=!1,s=lu({start:su([]),stop:su([])}),l=yu(),f=function(){g.stop(),l.isOn()&&(l.off(),s.trigger.stop())},d=(r=f,o=200,i=null,{cancel:a=function(){u(i)||(clearTimeout(i),i=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a(),i=setTimeout((function(){i=null,r.apply(null,t)}),o)}});l.events.move.bind((function(n){e.mutate(t,n.info)}));var m=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];c&&t.apply(null,e)}},g=e.sink(vu({forceDrop:f,drop:m(f),move:m((function(t){d.cancel(),l.onEvent(t,e)})),delayDrop:m(d.throttle)}),n);return{element:g.element,go:function(t){g.start(t),l.on(),s.trigger.start()},on:function(){c=!0},off:function(){c=!1},destroy:function(){g.destroy()},events:s.registry}},xu=function(t){var e,n,r=wt.fromDom(function(t){if(le()&&s(t.target)){var e=wt.fromDom(t.target);if(Yt(e)&&ge(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return q(n)}}return O.from(t.target)}(t).getOr(t.target)),o=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},u=(e=i,n=o,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e(n.apply(null,t))});return function(t,e,n,r,o,i,u){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:u}}(r,t.clientX,t.clientY,o,i,u,t)},Cu=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(xu(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:p(Su,t,e,i,o)}},Su=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},ku=x,Ou=function(t,e,n){return function(t,e,n,r){return Cu(t,e,n,r,!1)}(t,e,ku,n)},Tu=xu,_u=function(t,e){var n=De(t,e);return void 0===n||""===n?[]:n.split(" ")},Eu=function(t){return void 0!==t.dom.classList},Au=function(t,e){return function(t,e,n){var r=_u(t,e).concat([n]);return Ee(t,e,r.join(" ")),!0}(t,"class",e)},Du=function(t,e){Eu(t)?t.dom.classList.add(e):Au(t,e)},Mu=function(t,e){return Eu(t)&&t.dom.classList.contains(e)},Nu=function(t){var e=t.replace(/\./g,"-");return{resolve:function(t){return e+"-"+t}}},Ru=Nu("ephox-dragster"),zu=Ru.resolve,Bu=hu({compare:function(t,e){return Hr(e.left-t.left,e.top-t.top)},extract:function(t){return O.some(Hr(t.x,t.y))},sink:function(t,e){var n=function(t){var e=$({layerClass:zu("blocker")},t),n=wt.fromTag("div");Ee(n,"role","presentation"),Ve(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Du(n,zu("blocker")),Du(n,e.layerClass);return{element:m(n),destroy:function(){qn(n)}}}(e),r=Ou(n.element(),"mousedown",t.forceDrop),o=Ou(n.element(),"mouseup",t.drop),i=Ou(n.element(),"mousemove",t.move),u=Ou(n.element(),"mouseout",t.delayDrop);return pu({element:n.element,start:function(t){Fn(t,n.element())},stop:function(){qn(n.element())},destroy:function(){n.destroy(),o.unbind(),i.unbind(),u.unbind(),r.unbind()}})},mutate:function(t,e){t.mutate(e.left,e.top)}}),Iu=function(t){return Te(t,"[contenteditable]")},Pu=function(t,e){return void 0===e&&(e=!1),!bt().browser.isIE()&&he(t)?t.dom.isContentEditable:Iu(t).fold(m(e),(function(t){return"true"===Lu(t)}))},Lu=function(t){return t.dom.contentEditable},Hu=Nu("ephox-snooker"),Fu=Hu.resolve,Vu=function(){var t=lu({drag:su(["xDelta","yDelta","target"])}),e=O.none(),n=function(){var t=lu({drag:su(["xDelta","yDelta"])});return{mutate:function(e,n){t.trigger.drag(e,n)},events:t.registry}}();n.events.drag.bind((function(n){e.each((function(e){t.trigger.drag(n.xDelta,n.yDelta,e)}))}));return{assign:function(t){e=O.some(t)},get:function(){return e},mutate:n.mutate,events:t.registry}},ju=Fu("resizer-bar"),Uu=Fu("resizer-rows"),Wu=Fu("resizer-cols"),qu=function(t){var e=we(t.parent(),"."+ju);R(e,qn)},Gu=function(t,e,n){var r=t.origin();R(e,(function(e){e.each((function(e){var o=n(r,e);Du(o,ju),Fn(t.parent(),o)}))}))},$u=function(t,e,n,r){Gu(t,e,(function(t,e){var o,i,u,a,c,s,l=(o=e.col,i=e.x-t.left,u=n.top-t.top,a=7,c=r,s=wt.fromTag("div"),Ve(s,{position:"absolute",left:i-a/2+"px",top:u+"px",height:c+"px",width:a+"px"}),Ae(s,{"data-column":o,role:"presentation"}),s);return Du(l,Wu),l}))},Xu=function(t,e,n,r){Gu(t,e,(function(t,e){var o=function(t,e,n,r,o){var i=wt.fromTag("div");return Ve(i,{position:"absolute",left:e+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),Ae(i,{"data-row":t,role:"presentation"}),i}(e.row,n.left-t.left,e.y-t.top,r,7);return Du(o,Uu),o}))},Ku=function(t,e,n,r,o){var i=Vr(n),u=e.isResizable,a=r.length>0?Zr.positions(r,n):[],c=a.length>0?function(t,e){return F(t.all,(function(t,n){return e(t.element)?[n]:[]}))}(t,u):[],s=z(a,(function(t,e){return D(c,(function(t){return e===t}))}));Xu(e,s,i,Er(n));var l=o.length>0?ro.positions(o,n):[],f=l.length>0?function(t,e){var n=[];return M(t.grid.columns,(function(r){Tn.getColumnAt(t,r).map((function(t){return t.element})).forall(e)&&n.push(r)})),z(n,(function(n){var r=Tn.filterItems(t,(function(t){return t.column===n}));return V(r,(function(t){return e(t.element)}))}))}(t,u):[],d=z(l,(function(t,e){return D(f,(function(t){return e===t}))}));$u(e,d,i,Pr(n))},Yu=function(t,e){if(qu(t),t.isResizable(e)){var n=Tn.fromTable(e),r=Mr(n),o=Ar(n);Ku(n,t,e,r,o)}},Ju=function(t,e){var n=we(t.parent(),"."+ju);R(n,e)},Qu=function(t){Ju(t,(function(t){Fe(t,"display","none")}))},Zu=function(t){Ju(t,(function(t){Fe(t,"display","block")}))},ta=Fu("resizer-bar-dragging"),ea=function(t){var e=Vu(),n=function(t,e){void 0===e&&(e={});var n=void 0!==e.mode?e.mode:Bu;return wu(t,n,e)}(e,{}),r=O.none(),o=function(t,e){return O.from(De(t,e))};e.events.drag.bind((function(t){o(t.target,"data-row").each((function(e){var n=Ye(t.target,"top");Fe(t.target,"top",n+t.yDelta+"px")})),o(t.target,"data-column").each((function(e){var n=Ye(t.target,"left");Fe(t.target,"left",n+t.xDelta+"px")}))}));var i=function(t,e){return Ye(t,e)-Ge(t,"data-initial-"+e,0)};n.events.stop.bind((function(){e.get().each((function(e){r.each((function(n){o(e,"data-row").each((function(t){var r=i(e,"top");Ne(e,"data-initial-top"),l.trigger.adjustHeight(n,r,parseInt(t,10))})),o(e,"data-column").each((function(t){var r=i(e,"left");Ne(e,"data-initial-left"),l.trigger.adjustWidth(n,r,parseInt(t,10))})),Yu(t,n)}))}))}));var u=function(r,o){l.trigger.startAdjust(),e.assign(r),Ee(r,"data-initial-"+o,Ye(r,o)),Du(r,ta),Fe(r,"opacity","0.2"),n.go(t.parent())},a=Ou(t.parent(),"mousedown",(function(t){var e;e=t.target,Mu(e,Uu)&&u(t.target,"top"),function(t){return Mu(t,Wu)}(t.target)&&u(t.target,"left")})),c=function(e){return kt(e,t.view())},s=Ou(t.view(),"mouseover",(function(e){var n;(n=e.target,Te(n,"table",c).filter(Pu)).fold((function(){he(e.target)&&qu(t)}),(function(e){r=O.some(e),Yu(t,e)}))})),l=lu({adjustHeight:su(["table","delta","row"]),adjustWidth:su(["table","delta","column"]),startAdjust:su([])});return{destroy:function(){a.unbind(),s.unbind(),n.destroy(),qu(t)},refresh:function(e){Yu(t,e)},on:n.on,off:n.off,hideBars:p(Qu,t),showBars:p(Zu,t),events:l.registry}},na=function(t,e,n){var r=Zr,o=ro,i=ea(t),u=lu({beforeResize:su(["table","type"]),afterResize:su(["table","type"]),startDrag:su([])});return i.events.adjustHeight.bind((function(t){var e=t.table;u.trigger.beforeResize(e,"row");var n=r.delta(t.delta,e);Pi(e,n,t.row,r),u.trigger.afterResize(e,"row")})),i.events.startAdjust.bind((function(t){u.trigger.startDrag()})),i.events.adjustWidth.bind((function(t){var r=t.table;u.trigger.beforeResize(r,"col");var i=o.delta(t.delta,r),a=n(r);Ii(r,i,t.column,e,a),u.trigger.afterResize(r,"col")})),{on:i.on,off:i.off,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:u.registry}},ra=function(t,e){return t.fire("newrow",{node:e})},oa=function(t,e){return t.fire("newcell",{node:e})},ia=function(t,e,n){t.fire("TableModified",$($({},n),{table:e}))},ua={structure:!1,style:!0},aa={structure:!0,style:!1},ca={structure:!0,style:!0},sa={"border-collapse":"collapse",width:"100%"},la=M(5,(function(t){var e=t+1+"px";return{title:e,value:e}})),fa=N(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(function(t){return{title:t,value:t.toLowerCase()}})),da={border:"1"},ma=function(t){return t.getParam("table_sizing_mode","auto")},ga=function(t){return t.getParam("table_responsive_width")},ha=function(t){return t.getParam("table_border_widths",la,"array")},pa=function(t){return t.getParam("table_border_styles",fa,"array")},va=function(t){return t.getParam("table_default_attributes",da,"object")},ba=function(t){return t.getParam("table_default_styles",function(t){if(Ta(t)){var e=t.getBody().offsetWidth;return $($({},sa),{width:e+"px"})}return _a(t)?Rt(sa,(function(t,e){return"width"!==e})):sa}(t),"object")},ya=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},wa=function(t){return t.getParam("table_row_advtab",!0,"boolean")},xa=function(t){return t.getParam("table_advtab",!0,"boolean")},Ca=function(t){return t.getParam("table_style_by_css",!1,"boolean")},Sa=function(t){return t.getParam("table_cell_class_list",[],"array")},ka=function(t){return t.getParam("table_class_list",[],"array")},Oa=function(t){return"relative"===ma(t)||!0===ga(t)},Ta=function(t){return"fixed"===ma(t)||!1===ga(t)},_a=function(t){return"responsive"===ma(t)},Ea=function(t){return t.getParam("table_use_colgroups",!1,"boolean")},Aa=function(t){var e=t.getParam("table_header_type","section","string");return A(["section","cells","sectionCells","auto"],e)?e:"section"},Da=function(t){var e=t.getParam("table_column_resizing","preservetable","string");return P(["preservetable","resizetable"],(function(t){return t===e})).getOr("preservetable")},Ma=function(t){return"preservetable"===Da(t)},Na=function(t){return"resizetable"===Da(t)},Ra=function(t){var e=t.getParam("table_clone_elements");return r(e)?O.some(e.split(/[ ,]/)):Array.isArray(e)?O.some(e):O.none()},za=function(t){return t.getParam("table_background_color_map",[],"array")},Ba=function(t){return t.getParam("table_border_color_map",[],"array")},Ia=function(t,e){if(Oa(t)){var n=pi(t,e.dom).filter(vi).getOrThunk((function(){return au(e)}));return qo(n,e)}return Ta(t)?Wo(_r(e),e):Uo(e)},Pa=function(t){Ne(t,"width")},La=function(t,e){var n=function(t){return _r(t)+"px"}(t);ru(t,O.some(n),O.none(),e),Pa(t)},Ha=function(t,e){!function(t,e){var n=To(t);ru(t,O.some(n),O.none(),e),Pa(t)}(e,Ia(t,e))},Fa=function(t,e){var n=Ia(t,e);La(e,n)},Va=function(t){qe(t,"width");var e=rn(t),n=e.length>0?e:nn(t);R(n,(function(t){qe(t,"width"),Pa(t)})),Pa(t)},ja=function(){var t=wt.fromTag("div");return Ve(t,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Fn(pe(wt.fromDom(document)),t),t},Ua=function(t){return"false"!==De(t,"data-mce-resize")},Wa=function(t){var e,n,o=O.none(),i=O.none(),u=O.none(),a=function(t){return"TABLE"===t.nodeName},c=function(){return i},s=function(e){return Ia(t,e)},l=function(){return Ma(t)?Wi():Ui()},f=function(r,o,i){var u=rt(o,"e");if(""===n&&Ha(t,r),i!==e&&""!==n){Fe(r,"width",n);var a=l(),c=s(r),f=Ma(t)||u?function(t){return cu(t).columns}(r)-1:0;Ii(r,i-e,f,a,c)}else if(vi(n)){var d=parseFloat(n.replace("%",""));Fe(r,"width",i*d/e+"%")}(function(t){return/^(\d+(\.\d+)?)px$/.test(t)})(n)&&function(t){var e=Tn.fromTable(t);Tn.hasColumns(e)||R(nn(t),(function(t){var e=je(t,"width");Fe(t,"width",e),Ne(t,"width")}))}(r)};return t.on("init",(function(){var e=function(t,e){return t.inline?Gi(li(t),ja(),e):qi(wt.fromDom(t.getDoc()),e)}(t,Ua);if(u=O.some(e),function(t){var e=t.getParam("object_resizing",!0);return r(e)?"table"===e:e}(t)&&function(t){return t.getParam("table_resize_bars",!0,"boolean")}(t)){var n=l(),a=na(e,n,s);a.on(),a.events.startDrag.bind((function(e){o=O.some(t.selection.getRng())})),a.events.beforeResize.bind((function(e){var n=e.table.dom;!function(t,e,n,r,o){t.fire("ObjectResizeStart",{target:e,width:n,height:r,origin:o})}(t,n,fi(n),di(n),"bar-"+e.type)})),a.events.afterResize.bind((function(e){var n=e.table,r=n.dom;hi(n),o.each((function(e){t.selection.setRng(e),t.focus()})),function(t,e,n,r,o){t.fire("ObjectResized",{target:e,width:n,height:r,origin:o})}(t,r,fi(r),di(r),"bar-"+e.type),t.undoManager.add()})),i=O.some(a)}})),t.on("ObjectResizeStart",(function(r){var o=r.target;if(a(o)){var i=wt.fromDom(o);R(t.dom.select(".mce-clonedresizable"),(function(e){t.dom.addClass(e,"mce-"+Da(t)+"-columns")})),!iu(i)&&Ta(t)?Fa(t,i):!ou(i)&&Oa(t)&&Ha(t,i),uu(i)&&nt(r.origin,"bar-")&&Ha(t,i),e=r.width,n=_a(t)?"":pi(t,o).getOr("")}})),t.on("ObjectResized",(function(e){var n=e.target;if(a(n)){var r=wt.fromDom(n),o=e.origin;nt(o,"corner-")&&f(r,o,e.width),hi(r),ia(t,r.dom,ua)}})),t.on("SwitchMode",(function(){c().each((function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()}))})),{lazyResize:c,lazyWire:function(){return u.getOr(qi(wt.fromDom(t.getBody()),Ua))},destroy:function(){i.each((function(t){t.destroy()})),u.each((function(e){!function(t,e){t.inline&&qn(e.parent())}(t,e)}))}}},qa=function(t,e){return{element:t,offset:e}},Ga=function(t,e,n){return t.property().isText(e)&&0===t.property().getText(e).trim().length||t.property().isComment(e)?n(e).bind((function(e){return Ga(t,e,n).orThunk((function(){return O.some(e)}))})):O.none()},$a=function(t,e){return t.property().isText(e)?t.property().getText(e).length:t.property().children(e).length},Xa=function(t,e){var n=Ga(t,e,t.query().prevSibling).getOr(e);if(t.property().isText(n))return qa(n,$a(t,n));var r=t.property().children(n);return r.length>0?Xa(t,r[r.length-1]):qa(n,$a(t,n))},Ka=Xa,Ya=Qn(),Ja=function(t,e){1===$e(t,"colspan")&&function(t){return wo(t).bind((function(t){return uo(t,["fixed","relative","empty"])}))}(t).each((function(n){var r=n.value/2;Oo(t,r,n.unit),Oo(e,r,n.unit)}))},Qa=te("th"),Za=function(t,e){return t&&e?"sectionCells":t?"section":"cells"},tc=function(t){var e="thead"===t.section,n=ze(ec(t.cells),"th");return e||n?{type:"header",subType:Za(e,n)}:"tfoot"===t.section?{type:"footer"}:{type:"body"}},ec=function(t){var e=z(t,(function(t){return Qa(t.element)}));return 0===e.length?O.some("td"):e.length===t.length?O.some("th"):O.none()},nc=function(t,e,n){return Ut(n(t.element,e),!0,t.isLocked)},rc=function(t,e){return t.section!==e?Wt(t.element,t.cells,e,t.isNew):t},oc=function(){return{transformRow:rc,transformCell:function(t,e,n){var r=n(t.element,e),o="td"!==Gt(r)?function(t,e){var n=kr(t,e);Pn(t,n);var r=ae(t);return Un(n,r),qn(t),n}(r,"td"):r;return Ut(o,t.isNew,t.isLocked)}}},ic=function(){return{transformRow:rc,transformCell:nc}},uc=function(){return{transformRow:function(t,e){return rc(t,"thead"===e?"tbody":e)},transformCell:nc}},ac=function(t,e){switch(function(t){return G(t.all,(function(t){var e=tc(t);return"header"===e.type?O.from(e.subType):O.none()}))}(Tn.fromTable(t)).getOr(e)){case"section":return oc();case"sectionCells":return ic();case"cells":return uc()}},cc=oc,sc=ic,lc=uc,fc=function(){return{transformRow:g,transformCell:nc}},dc=function(t,e,n,r){n===r?Ne(t,e):Ee(t,e,n)},mc=function(t,e,n){var r;(r=ye(t,e),W(r,r.length-1)).fold((function(){return Hn(t,n)}),(function(t){return Ln(t,n)}))},gc=function(t,e){var n=[],r=[],o=function(t){return N(t,(function(t){t.isNew&&n.push(t.element);var e=t.element;return Wn(e),R(t.cells,(function(t){t.isNew&&r.push(t.element),dc(t.element,"colspan",t.colspan,1),dc(t.element,"rowspan",t.rowspan,1),Fn(e,t.element)})),e}))},i=function(t){return F(t,(function(t){return N(t.cells,(function(t){return dc(t.element,"span",t.colspan,1),t.element}))}))},u=function(e,n){var r=function(t,e){var n=ke(t,e).getOrThunk((function(){var n=wt.fromTag(e,ee(t).dom);return"thead"===e?mc(t,"caption,colgroup",n):"colgroup"===e?mc(t,"caption",n):Fn(t,n),n}));return Wn(n),n}(t,n),u=("colgroup"===n?i:o)(e);Un(r,u)},a=function(e,n){e.length>0?u(e,n):function(e){ke(t,e).each(qn)}(n)},c=[],s=[],l=[],f=[];return R(e,(function(t){switch(t.section){case"thead":c.push(t);break;case"tbody":s.push(t);break;case"tfoot":l.push(t);break;case"colgroup":f.push(t)}})),a(f,"colgroup"),a(c,"thead"),a(s,"tbody"),a(l,"tfoot"),{newRows:n,newCells:r}},hc=function(t,e){if(0===t.length)return 0;var n=t[0];return L(t,(function(t){return!e(n.element,t.element)})).getOr(t.length)},pc=function(t,e,n,r){var o=function(t,e){return t[e]}(t,e).cells.slice(n),i=hc(o,r),u=function(t,e){return N(t,(function(t){return hn(t,e)}))}(t,n).slice(e);return{colspan:i,rowspan:hc(u,r)}},vc=function(t,e){var n=N(t,(function(t){return N(t.cells,w)}));return N(t,(function(r,o){var i=F(r.cells,(function(r,i){if(!1===n[o][i]){var u=pc(t,o,i,e);return function(t,e,r,o){for(var i=t;i<t+r;i++)for(var u=e;u<e+o;u++)n[i][u]=!0}(o,i,u.rowspan,u.colspan),[(a=r.element,c=u.rowspan,s=u.colspan,l=r.isNew,{element:a,rowspan:c,colspan:s,isNew:l})]}return[];var a,c,s,l}));return function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}}(r.element,i,r.section,r.isNew)}))},bc=function(t,e,n){var r=[];R(t.colgroups,(function(t){var e=N(t.columns,(function(t){return Ut(t.element,n,!1)}));r.push(Wt(t.element,e,"colgroup",n))}));for(var o=0;o<t.grid.rows;o++){for(var i=[],u=0;u<t.grid.columns;u++){var a=Tn.getAt(t,o,u).map((function(t){return Ut(t.element,n,t.isLocked)})).getOrThunk((function(){return Ut(e.gap(),!0,!1)}));i.push(a)}var c=t.all[o],s=Wt(c.element,i,c.section,n);r.push(s)}return r},yc=function(t){return vc(t,kt)},wc=function(t,e){return G(t.all,(function(t){return P(t.cells,(function(t){return kt(e,t.element)}))}))},xc=function(t,e,n){var r=N(e.selection,(function(e){return en(e).bind((function(e){return wc(t,e)})).filter(n)})),o=Be(r);return Pe(o.length>0,o)},Cc=function(t,e,n,r,o){return function(i,u,a,c,s){var l=Tn.fromTable(u),f=O.from(null==s?void 0:s.section).getOrThunk(fc);return e(l,a).map((function(e){var n=function(t,e){return bc(t,e,!1)}(l,c),r=t(n,e,kt,o(c),f),i=Cn(r.grid);return{info:e,grid:yc(r.grid),cursor:r.cursor,lockedColumns:i}})).bind((function(t){var e=gc(u,t.grid),o=O.from(null==s?void 0:s.sizing).getOrThunk((function(){return Uo(u)})),a=O.from(null==s?void 0:s.resize).getOrThunk(Wi);return n(u,t.grid,t.info,{sizing:o,resize:a,section:f}),r(u),Yu(i,u),Ne(u,wn),t.lockedColumns.length>0&&Ee(u,wn,t.lockedColumns.join(",")),O.some({cursor:t.cursor,newRows:e.newRows,newCells:e.newCells})}))}},Sc=function(t,e){return xc(t,e,x).map((function(t){return{cells:t,generators:e.generators,clipboard:e.clipboard}}))},kc=function(t,e){return xc(t,e,x)},Oc=function(t,e){return xc(t,e,(function(t){return!t.isLocked}))},Tc=function(t,e){return V(e,(function(e){return function(t,e){return wc(t,e).exists((function(t){return!t.isLocked}))}(t,e)}))},_c=function(t,e){return function(t,e){return e.mergable}(0,e).filter((function(e){return Tc(t,e.cells)}))},Ec=function(t,e){return function(t,e){return e.unmergable}(0,e).filter((function(e){return Tc(t,e)}))},Ac=function(t,e,n,r){for(var o=bn(t).rows,i=!0,u=0;u<o.length;u++)for(var a=0;a<vn(o[0]);a++){var c=o[u],s=hn(c,a),l=n(s.element,e);!0===l&&!1===i?mn(c,a,Ut(r(),!0,s.isLocked)):!0===l&&(i=!1)}return t},Dc=function(t,e,n,r){var o=bn(t).rows;if(e>0&&e<o.length){var i=function(t,e){return I(t,(function(t,n){return D(t,(function(t){return e(t.element,n.element)}))?t:t.concat([n])}),[])}(o[e-1].cells,n);R(i,(function(t){for(var i=O.none(),u=e;u<o.length;u++)for(var a=function(e){var a=o[u],c=hn(a,e);n(c.element,t.element)&&(i.isNone()&&(i=O.some(r())),i.each((function(t){mn(a,e,Ut(t,!0,c.isLocked))})))},c=0;c<vn(o[0]);c++)a(c)}))}return t},Mc=function(t){return{isValue:x,isError:w,getOr:m(t),getOrThunk:m(t),getOrDie:m(t),or:function(e){return Mc(t)},orThunk:function(e){return Mc(t)},fold:function(e,n){return n(t)},map:function(e){return Mc(e(t))},mapError:function(e){return Mc(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return O.some(t)}}},Nc=function(t){return{isValue:w,isError:x,getOr:g,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:g,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Nc(t)},mapError:function(e){return Nc(e(t))},each:d,bind:function(e){return Nc(t)},exists:w,forall:x,toOptional:O.none}},Rc={value:Mc,error:Nc,fromOption:function(t,e){return t.fold((function(){return Nc(e)}),Mc)}},zc=function(t,e){return{rowDelta:0,colDelta:vn(t[0])-vn(e[0])}},Bc=function(t,e){return{rowDelta:t.length-e.length,colDelta:0}},Ic=function(t,e,n,r){var o="colgroup"===e.section?n.col:n.cell;return M(t,(function(t){return Ut(o(),!0,r(t))}))},Pc=function(t,e,n,r){var o=t[t.length-1];return t.concat(M(e,(function(){var t="colgroup"===o.section?n.colgroup:n.row,e=yn(o,t,g),i=Ic(e.cells.length,e,n,(function(t){return Lt(r,t.toString())}));return gn(e,i)})))},Lc=function(t,e,n,r){return N(t,(function(t){var o=Ic(e,t,n,w);return fn(t,r,o)}))},Hc=function(t,e,n){var r=e.colDelta<0?Lc:g,o=e.rowDelta<0?Pc:g,i=Cn(t),u=vn(t[0]),a=D(i,(function(t){return t===u-1})),c=r(t,Math.abs(e.colDelta),n,a?u-1:u),s=Cn(c);return o(c,Math.abs(e.rowDelta),n,j(s,x))},Fc=function(t,e,n,r){var o=p(r,hn(t[e],n).element),i=t[e];return t.length>1&&vn(i)>1&&(n>0&&o(pn(i,n-1))||n<i.cells.length-1&&o(pn(i,n+1))||e>0&&o(pn(t[e-1],n))||e<t.length-1&&o(pn(t[e+1],n)))},Vc=function(t,e,n){return z(n,(function(n){return n>=t.column&&n<=vn(e[0])+t.column}))},jc=function(t,e,n,r,o){var i=Cn(e),u=function(t,e,n){var r=vn(e[0]),o=bn(e).cols.length+t.row,i=M(r-t.column,(function(e){return e+t.column}));return{row:o,column:P(i,(function(t){return V(n,(function(e){return e!==t}))})).getOr(r-1)}}(t,e,i),a=bn(n).rows,c=Vc(u,a,i);return function(t,e,n){if(t.row>=e.length||t.column>vn(e[0]))return Rc.error("invalid start address out of table bounds, row: "+t.row+", column: "+t.column);var r=e.slice(t.row),o=r[0].cells.slice(t.column),i=vn(n[0]),u=n.length;return Rc.value({rowDelta:r.length-u,colDelta:o.length-i})}(u,e,a).map((function(t){var n=$($({},t),{colDelta:t.colDelta-c.length}),i=Hc(e,n,r),s=Cn(i),l=Vc(u,a,s);return function(t,e,n,r,o,i){for(var u=t.row,a=t.column,c=u+n.length,s=a+vn(n[0])+i.length,l=j(i,x),f=u;f<c;f++)for(var d=0,m=a;m<s;m++)if(l[m])d++;else{Fc(e,f,m,o)&&Ac(e,pn(e[f],m),o,r.cell);var g=m-a-d,h=hn(n[f-u],g),p=h.element,v=r.replace(p);mn(e[f],m,Ut(v,!0,h.isLocked))}return e}(u,i,a,r,o,l)}))},Uc=function(t,e,n,r,o){!function(t,e,n,r){e>0&&e<t[0].cells.length&&R(t,(function(t){var o=t.cells[e-1],i=t.cells[e];n(i.element,o.element)&&mn(t,e,Ut(r(),!0,i.isLocked))}))}(e,t,o,r.cell);var i=Bc(n,e),u=Hc(n,i,r),a=Bc(e,u),c=Hc(e,a,r);return N(c,(function(e,n){return fn(e,t,u[n].cells)}))},Wc=function(t,e,n,r,o){Dc(e,t,o,r.cell);var i=Cn(e),u=zc(e,n),a=$($({},u),{colDelta:u.colDelta-i.length}),c=Hc(e,a,r),s=bn(c),l=s.cols,f=s.rows,d=Cn(c),m=zc(n,e),g=$($({},m),{colDelta:m.colDelta+d.length}),h=function(t,e,n){return N(t,(function(t){return I(n,(function(n,r){var o=Ic(1,t,e,x)[0];return dn(n,r,o)}),t)}))}(n,r,d),p=Hc(h,g,r);return l.concat(f.slice(0,t)).concat(p).concat(f.slice(t,f.length))},qc=function(t,e,n,r,o){var i=bn(t),u=i.rows,a=i.cols,c=u.slice(0,e),s=u.slice(e),l=function(t,e,n,r){return yn(t,(function(t){return r(t,n)}),e)}(u[n],(function(t,n){return e>0&&e<u.length&&r(pn(u[e-1],n),pn(u[e],n))?hn(u[e],n):Ut(o(t.element,r),!0,t.isLocked)}),r,o);return a.concat(c).concat([l]).concat(s)},Gc=function(t,e,n,r,o){return N(t,(function(t){var i=e>0&&e<vn(t)&&r(pn(t,e-1),pn(t,e)),u=function(t,e,n,r,o,i,u){if("colgroup"!==n&&r)return hn(t,e);var a=hn(t,o);return Ut(u(a.element,i),!0,!1)}(t,e,t.section,i,n,r,o);return dn(t,e,u)}))},$c=function(t,e,n){return Ut(n(t.element,e),!0,t.isLocked)},Xc=function(t,e,n,r,o){return N(t,(function(t){return function(t,e){var n=t.cells,r=N(n,e);return Wt(t.element,r,t.section,t.isNew)}(t,(function(t){return function(t){return D(e,(function(e){return n(t.element,e.element)}))}(t)?o(t,n,r):t}))}))},Kc=function(t,e,n,r){return void 0!==pn(t[e],n)&&e>0&&r(pn(t[e-1],n),pn(t[e],n))},Yc=function(t,e,n){return e>0&&n(pn(t,e-1),pn(t,e))},Jc=function(t,e,n,r){var o=bn(t).rows,i=F(o,(function(t,r){return Kc(o,r,e,n)||Yc(t,e,n)?[]:[hn(t,e)]}));return Xc(t,i,n,r,$c)},Qc=function(t,e,n,r,o){var i=bn(t).rows[e],u=hn(i,n);return Xc(t,[u],r,o,$c)},Zc=function(t){return I(t,(function(t,e){return D(t,(function(t){return t.column===e.column}))?t:t.concat([e])}),[]).sort((function(t,e){return t.column-e.column}))},ts=te("col"),es=te("colgroup"),ns=function(t){return"tr"===Gt(t)||es(t)},rs=function(t){return{element:t,colspan:Ge(t,"colspan",1),rowspan:Ge(t,"rowspan",1)}},os=function(t){return Me(t,"scope").map((function(t){return t.substr(0,3)}))},is=function(t,e){void 0===e&&(e=rs);var n=function(n){if(ns(n))return es((o={element:n}).element)?t.colgroup(o):t.row(o);var o,i=function(e){return ts(e.element)?t.col(e):t.cell(e)}(e(n));return r=O.some({item:n,replacement:i}),i},r=O.none();return{getOrInit:function(t,e){return r.fold((function(){return n(t)}),(function(r){return e(t,r.item)?r.replacement:n(t)}))}}},us=function(t,e){return function(n){var r=[],o=function(o){var i=c(e)?{}:{scope:e},u=n.replace(o,t,i);return r.push({item:o,sub:u}),u};return{replaceOrInit:function(t,e){return ns(t)||ts(t)?t:function(t,e){return P(r,(function(n){return e(n.item,t)}))}(t,e).fold((function(){return o(t)}),(function(n){return e(t,n.item)?n.sub:o(t)}))}}}},as=function(t){return{unmerge:function(e){var n=os(e);return n.each((function(t){return Ee(e,"scope",t)})),function(){var r=t.cell({element:e,colspan:1,rowspan:1});return qe(r,"width"),qe(e,"width"),n.each((function(t){return Ee(r,"scope",t)})),r}},merge:function(t){return qe(t[0],"width"),function(){var e=Be(N(t,os));if(0===e.length)return O.none();var n=e[0],r=["row","col"];return D(e,(function(t){return t!==n&&A(r,t)}))?O.none():O.from(n)}().fold((function(){return Ne(t[0],"scope")}),(function(e){return Ee(t[0],"scope",e+"group")})),m(t[0])}}},cs=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],ss=Qn(),ls=function(t){return function(t,e){var n=t.property().name(e);return A(cs,n)}(ss,t)},fs=function(t){return function(t,e){var n=t.property().name(e);return A(["ol","ul"],n)}(ss,t)},ds=function(t){return function(t,e){return A(["br","img","hr","input"],t.property().name(e))}(ss,t)},ms=function(t){var e,n=function(t){return"br"===Gt(t)},r=function(t){return Qo(t).bind((function(e){var r=ue(e).map((function(t){return!!ls(t)||!!ds(t)&&"img"!==Gt(t)})).getOr(!1);return re(e).map((function(o){return!0===r||function(t){return"li"===Gt(t)||Ce(t,fs).isSome()}(o)||n(e)||ls(o)&&!kt(t,o)?[]:[wt.fromTag("br")]}))})).getOr([])},o=0===(e=F(t,(function(t){var e=ae(t);return function(t){return V(t,(function(t){return n(t)||Jt(t)&&0===Xn(t).trim().length}))}(e)?[]:e.concat(r(t))}))).length?[wt.fromTag("br")]:e;Wn(t[0]),Un(t[0],o)},gs=function(t){return Pu(t,!0)},hs=function(t){0===nn(t).length&&qn(t)},ps=function(t,e){return{grid:t,cursor:e}},vs=function(t,e,n){var r,o,i=bn(t).rows;return O.from(null===(o=null===(r=i[e])||void 0===r?void 0:r.cells[n])||void 0===o?void 0:o.element).filter(gs).orThunk((function(){return function(t){return G(t,(function(t){return G(t.cells,(function(t){var e=t.element;return Pe(gs(e),e)}))}))}(i)}))},bs=function(t,e,n){var r=vs(t,e,n);return ps(t,r)},ys=function(t){return I(t,(function(t,e){return D(t,(function(t){return t.row===e.row}))?t:t.concat([e])}),[]).sort((function(t,e){return t.row-e.row}))},ws=function(t){return function(e,n,r,o,i){var u=ys(n),a=I(u,(function(e,n){return function(t,e,n,r,o,i){var u=bn(t),a=u.cols,c=u.rows,s=c[e],l=F(s.cells,(function(t,n){return Kc(c,e,n,r)||Yc(s,n,r)?[]:[t]})),f=X([],c);return f[e]=i.transformRow(s,n),Xc(a.concat(f),l,r,o,i.transformCell)}(e,n.row,t,r,o.replaceOrInit,i)}),e);return bs(a,n[0].row,n[0].column)}},xs=ws("thead"),Cs=ws("tbody"),Ss=ws("tfoot"),ks=function(t,e,n){var r=function(t,e){return cn(t,(function(){return e}))}(t,n.section),o=Tn.generate(r);return bc(o,e,!0)},Os=function(t,e,n,r){return function(t,e,n,r){var o=Tn.generate(e),i=r.getWidths(o,r);Bi(o,i,r)}(0,e,0,r.sizing)},Ts=function(t,e,n,r){return function(t,e,n,r,o){var i=Tn.generate(e),u=r.getWidths(i,r),a=r.pixelWidth(),c=o.calcRedestributedWidths(u,a,n.pixelDelta,r.isRelative),s=c.newSizes,l=c.delta;Bi(i,s,r),r.adjustTableWidth(l)}(0,e,n,r.sizing,r.resize)},_s=function(t,e){return D(e,(function(t){return 0===t.column&&t.isLocked}))},Es=function(t,e){return D(e,(function(e){return e.column+e.colspan>=t.grid.columns&&e.isLocked}))},As=function(t,e){var n=Ar(t),r=Zc(e);return I(r,(function(t,e){return t+n[e.column].map(Er).getOr(0)}),0)},Ds=function(t){return function(e,n){return kc(e,n).filter((function(n){return!(t?_s:Es)(e,n)})).map((function(t){return{details:t,pixelDelta:As(e,t)}}))}},Ms=function(t){return function(e,n){return Sc(e,n).filter((function(n){return!(t?_s:Es)(e,n.cells)}))}},Ns=Cc((function(t,e,n,r){var o=e[0].row,i=ys(e),u=B(i,(function(t,e){return{grid:qc(t.grid,o,e.row+t.delta,n,r.getOrInit),delta:t.delta+1}}),{grid:t,delta:0}).grid;return bs(u,o,e[0].column)}),kc,d,d,is),Rs=Cc((function(t,e,n,r){var o=ys(e),i=o[o.length-1],u=i.row+i.rowspan,a=B(o,(function(t,e){return qc(t,u,e.row,n,r.getOrInit)}),t);return bs(a,u,e[0].column)}),kc,d,d,is),zs=Cc((function(t,e,n,r){var o=e.details,i=Zc(o),u=i[0].column,a=B(i,(function(t,e){return{grid:Gc(t.grid,u,e.column+t.delta,n,r.getOrInit),delta:t.delta+1}}),{grid:t,delta:0}).grid;return bs(a,o[0].row,u)}),Ds(!0),Ts,d,is),Bs=Cc((function(t,e,n,r){var o=e.details,i=o[o.length-1],u=i.column+i.colspan,a=Zc(o),c=B(a,(function(t,e){return Gc(t,u,e.column,n,r.getOrInit)}),t);return bs(c,o[0].row,u)}),Ds(!1),Ts,d,is),Is=Cc((function(t,e,n,r){var o=Zc(e.details),i=function(t,e){return F(t,(function(t){var n=t.cells,r=B(e,(function(t,e){return e>=0&&e<t.length?t.slice(0,e).concat(t.slice(e+1)):t}),n);return r.length>0?[Wt(t.element,r,t.section,t.isNew)]:[]}))}(t,N(o,(function(t){return t.column}))),u=i.length>0?i[0].cells.length-1:0;return bs(i,o[0].row,Math.min(o[0].column,u))}),(function(t,e){return Oc(t,e).map((function(e){return{details:e,pixelDelta:-As(t,e)}}))}),Ts,hs,is),Ps=Cc((function(t,e,n,r){var o=ys(e),i=function(t,e,n){var r=bn(t),o=r.rows;return r.cols.concat(o.slice(0,e)).concat(o.slice(n+1))}(t,o[0].row,o[o.length-1].row),u=i.length>0?i.length-1:0;return bs(i,Math.min(e[0].row,u),e[0].column)}),kc,d,hs,is),Ls=Cc((function(t,e,n,r){var o=Zc(e),i=I(o,(function(t,e){return Jc(t,e.column,n,r.replaceOrInit)}),t);return bs(i,e[0].row,e[0].column)}),Oc,d,d,us("th","row")),Hs=Cc((function(t,e,n,r){var o=Zc(e),i=I(o,(function(t,e){return Jc(t,e.column,n,r.replaceOrInit)}),t);return bs(i,e[0].row,e[0].column)}),Oc,d,d,us("td",null)),Fs=Cc(xs,Oc,d,d,us("th","col")),Vs=Cc(Cs,Oc,d,d,us("td",null)),js=Cc(Ss,Oc,d,d,us("td",null)),Us=Cc((function(t,e,n,r){var o=I(e,(function(t,e){return Qc(t,e.row,e.column,n,r.replaceOrInit)}),t);return bs(o,e[0].row,e[0].column)}),Oc,d,d,us("th")),Ws=Cc((function(t,e,n,r){var o=I(e,(function(t,e){return Qc(t,e.row,e.column,n,r.replaceOrInit)}),t);return bs(o,e[0].row,e[0].column)}),Oc,d,d,us("td")),qs=Cc((function(t,e,n,r){var o=e.cells;ms(o);var i=function(t,e,n,r){var o=bn(t).rows;if(0===o.length)return t;for(var i=e.startRow;i<=e.finishRow;i++)for(var u=e.startCol;u<=e.finishCol;u++){var a=o[i],c=hn(a,u).isLocked;mn(a,u,Ut(r(),!1,c))}return t}(t,e.bounds,0,r.merge(o));return ps(i,O.from(o[0]))}),_c,Os,d,as),Gs=Cc((function(t,e,n,r){var o=B(e,(function(t,e){return Ac(t,e,n,r.unmerge(e))}),t);return ps(o,O.from(e[0]))}),Ec,Os,d,as),$s=Cc((function(t,e,n,r){var o=function(t,e){var n=Tn.fromTable(t);return bc(n,e,!0)}(e.clipboard,e.generators),i=function(t,e){return{row:t,column:e}}(e.row,e.column);return jc(i,t,o,e.generators,n).fold((function(){return ps(t,O.some(e.element))}),(function(t){return bs(t,e.row,e.column)}))}),(function(t,e){return en(e.element).bind((function(n){return wc(t,n).map((function(t){return $($({},t),{generators:e.generators,clipboard:e.clipboard})}))}))}),Os,d,is),Xs=Cc((function(t,e,n,r){var o=bn(t).rows,i=e.cells[0].column,u=o[e.cells[0].row],a=ks(e.clipboard,e.generators,u),c=Uc(i,t,a,e.generators,n);return bs(c,e.cells[0].row,e.cells[0].column)}),Ms(!0),d,d,is),Ks=Cc((function(t,e,n,r){var o=bn(t).rows,i=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,u=o[e.cells[0].row],a=ks(e.clipboard,e.generators,u),c=Uc(i,t,a,e.generators,n);return bs(c,e.cells[0].row,e.cells[0].column)}),Ms(!1),d,d,is),Ys=Cc((function(t,e,n,r){var o=bn(t).rows,i=e.cells[0].row,u=o[i],a=ks(e.clipboard,e.generators,u),c=Wc(i,t,a,e.generators,n);return bs(c,e.cells[0].row,e.cells[0].column)}),Sc,d,d,is),Js=Cc((function(t,e,n,r){var o=bn(t).rows,i=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,u=o[e.cells[0].row],a=ks(e.clipboard,e.generators,u),c=Wc(i,t,a,e.generators,n);return bs(c,e.cells[0].row,e.cells[0].column)}),Sc,d,d,is),Qs=function(t,e){var n=Tn.fromTable(t);return kc(n,e).bind((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=H(N(n.all,(function(t){return z(t.cells,(function(t){return t.column>=r&&t.column<o}))})));return ec(i)})).getOr("")},Zs=function(t,e){var n=Tn.fromTable(t);return kc(n,e).bind(ec).getOr("")},tl=function(t,e){var n=Tn.fromTable(t);return kc(n,e).bind((function(t){var e=t[t.length-1],r=t[0].row,o=e.row+e.rowspan;return function(t){var e=N(t,(function(t){return tc(t).type})),n=A(e,"header"),r=A(e,"footer");if(n||r){var o=A(e,"body");return!n||o||r?n||o||!r?O.none():O.some("footer"):O.some("header")}return O.some("body")}(n.all.slice(r,o))})).getOr("")},el=function(t,e,n){var r=function(t){return"table"===Gt(li(t))},o=Ra(t),i=Na(t)?d:Ja,u=function(e){switch(Aa(t)){case"section":return cc();case"sectionCells":return sc();case"cells":return lc();default:return ac(e,"section")}},a=function(n,r){return r.cursor.fold((function(){var r=nn(n);return q(r).filter(he).map((function(r){e.clear(n);var o=t.dom.createRng();return o.selectNode(r.dom),t.selection.setRng(o),Ee(r,"data-mce-selected","1"),o}))}),(function(r){var o=Ka(Ya,r),i=t.dom.createRng();return i.setStart(o.element.dom,o.offset),i.setEnd(o.element.dom,o.offset),t.selection.setRng(i),e.clear(n),O.some(i)}))},c=function(e,n,r,i,c){return function(s,l,f){void 0===f&&(f=!1),hi(s);var d=i(),m=wt.fromDom(t.getDoc()),g=ai(r,m,o),h={sizing:Ia(t,s),resize:Na(t)?Ui():Wi(),section:u(s)};return n(s)?e(d,s,l,g,h).bind((function(e){R(e.newRows,(function(e){ra(t,e.dom)})),R(e.newCells,(function(e){oa(t,e.dom)}));var n=a(s,e);return he(s)&&(hi(s),f||ia(t,s.dom,c)),n.map((function(t){return{rng:t,effect:c}}))})):O.none()}};return{deleteRow:c(Ps,(function(e){return!1===r(t)||cu(e).rows>1}),d,n,aa),deleteColumn:c(Is,(function(e){return!1===r(t)||cu(e).columns>1}),d,n,aa),insertRowsBefore:c(Ns,x,d,n,aa),insertRowsAfter:c(Rs,x,d,n,aa),insertColumnsBefore:c(zs,x,i,n,aa),insertColumnsAfter:c(Bs,x,i,n,aa),mergeCells:c(qs,x,d,n,aa),unmergeCells:c(Gs,x,d,n,aa),pasteColsBefore:c(Xs,x,d,n,aa),pasteColsAfter:c(Ks,x,d,n,aa),pasteRowsBefore:c(Ys,x,d,n,aa),pasteRowsAfter:c(Js,x,d,n,aa),pasteCells:c($s,x,d,n,ca),makeCellsHeader:c(Us,x,d,n,aa),unmakeCellsHeader:c(Ws,x,d,n,aa),makeColumnsHeader:c(Ls,x,d,n,aa),unmakeColumnsHeader:c(Hs,x,d,n,aa),makeRowsHeader:c(Fs,x,d,n,aa),makeRowsBody:c(Vs,x,d,n,aa),makeRowsFooter:c(js,x,d,n,aa),getTableRowType:tl,getTableCellType:Zs,getTableColType:Qs}},nl={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},rl=function(t){var e=wt.fromTag("colgroup");return M(t,(function(){return Fn(e,wt.fromTag("col"))})),e},ol=function(t,e,n,r){return M(t,(function(t){return function(t,e,n,r){for(var o=wt.fromTag("tr"),i=0;i<t;i++){var u=r<e||i<n?wt.fromTag("th"):wt.fromTag("td");i<n&&Ee(u,"scope","row"),r<e&&Ee(u,"scope","col"),Fn(u,wt.fromTag("br")),Fn(o,u)}return o}(e,n,r,t)}))},il=function(t,e){t.selection.select(e.dom,!0),t.selection.collapse(!0)},ul=function(t,e,n,o,i){var u=ba(t),a={styles:u,attributes:va(t),colGroups:Ea(t)};return t.undoManager.ignore((function(){var r=function(t,e,n,r,o,i){void 0===i&&(i=nl);var u=wt.fromTag("table"),a="cells"!==o;Ve(u,i.styles),Ae(u,i.attributes),i.colGroups&&Fn(u,rl(e));var c=Math.min(t,n);if(a&&n>0){var s=wt.fromTag("thead");Fn(u,s);var l=ol(n,e,"sectionCells"===o?c:0,r);Un(s,l)}var f=wt.fromTag("tbody");Fn(u,f);var d=ol(a?t-c:t,e,a?0:n,r);return Un(f,d),u}(n,e,i,o,Aa(t),a);Ee(r,"data-mce-id","__mce");var u=function(t){var e=wt.fromTag("div"),n=wt.fromDom(t.dom.cloneNode(!0));return Fn(e,n),function(t){return t.dom.innerHTML}(e)}(r);t.insertContent(u),t.addVisual()})),Oe(li(t),'table[data-mce-id="__mce"]').map((function(e){return Ta(t)?Fa(t,e):_a(t)?Va(e):(Oa(t)||function(t){return r(t)&&-1!==t.indexOf("%")}(u.width))&&Ha(t,e),hi(e),Ne(e,"data-mce-id"),function(t,e){R(we(e,"tr"),(function(e){ra(t,e.dom),R(we(e,"th,td"),(function(e){oa(t,e.dom)}))}))}(t,e),function(t,e){Oe(e,"td,th").each(p(il,t))}(t,e),e.dom})).getOr(null)},al=function(t,e,n,r,o){void 0===r&&(r={});var i=function(t){return f(t)&&t>0};if(i(e)&&i(n)){var u=r.headerRows||0,a=r.headerColumns||0;return ul(t,n,e,a,u)}return console.error(o),null},cl=function(t){return function(){return t().fold((function(){return[]}),(function(t){return N(t,(function(t){return t.dom}))}))}},sl=function(t){return function(e){var n=e.length>0?O.some(si(e)):O.none();t(n)}},ll=function(t){return function(e,n,r){void 0===r&&(r={});var o=al(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return t.undoManager.add(),o}},fl=function(t,e,n){var r=Ge(t,e,1);1===n||r<=1?Ne(t,e):Ee(t,e,Math.min(n,r))},dl=function(t,e){var n=Tn.fromTable(t);return Oc(n,e).map((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=function(t,e,n){if(Tn.hasColumns(t)){var r=z(Tn.justColumns(t),(function(t){return t.column>=e&&t.column<n})),o=N(r,(function(t){var r=Sr(t.element);return fl(r,"span",n-e),r})),i=wt.fromTag("colgroup");return Un(i,o),[i]}return[]}(n,r,o),u=function(t,e,n){return N(t.all,(function(t){var r=z(t.cells,(function(t){return t.column>=e&&t.column<n})),o=N(r,(function(t){var r=Sr(t.element);return fl(r,"colspan",n-e),r})),i=wt.fromTag("tr");return Un(i,o),i}))}(n,r,o);return X(X([],i),u)}))},ml=function(t,e,n){var r=Tn.fromTable(t);return kc(r,e).bind((function(t){var e=bc(r,n,!1),o=bn(e).rows.slice(t[0].row,t[t.length-1].row+t[t.length-1].rowspan),i=F(o,(function(t){var e=z(t.cells,(function(t){return!t.isLocked}));return e.length>0?[$($({},t),{cells:e})]:[]})),u=yc(i);return Pe(u.length>0,u)})).map((function(t){return function(t){return N(t,(function(t){var e=Cr(t.element);return R(t.cells,(function(t){var n=Sr(t.element);dc(n,"colspan",t.colspan,1),dc(n,"rowspan",t.rowspan,1),Fn(e,n)})),e}))}(t)}))},gl=tinymce.util.Tools.resolve("tinymce.util.Tools"),hl=function(t,e,n){return function(e,r){for(var o=0;o<r.length;o++){var i=t.getStyle(r[o],n);if(void 0===e&&(e=i),e!==i)return""}return e}(void 0,t.select("td,th",e))},pl=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},vl=function(t,e){gl.each("left center right".split(" "),(function(n){t.formatter.remove("align"+n,{},e)}))},bl=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],yl=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,wl=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,xl=function(t){return(e=t,n="#",nt(e,n)?function(t,e){return t.substring(e)}(e,n.length):e).toUpperCase();var e,n},Cl=function(t){return function(t){return yl.test(t)||wl.test(t)}(t)?O.some({value:xl(t)}):O.none()},Sl=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},kl=function(t){return function(t){return{value:t}}(Sl(t.red)+Sl(t.green)+Sl(t.blue))},Ol=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Tl=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,_l=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},El=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return _l(o,i,u,a)},Al=function(t){return Cl(t).orThunk((function(){return function(t){if("transparent"===t)return O.some(_l(0,0,0,0));var e=Ol.exec(t);if(null!==e)return O.some(El(e[1],e[2],e[3],"1"));var n=Tl.exec(t);return null!==n?O.some(El(n[1],n[2],n[3],n[4])):O.none()}(t).map(kl)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],u=r[2],a=r[3];return kl(_l(o,i,u,a))}))},Dl=function(t){var e=Ho(O.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(O.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(O.some(t))}}},Ml=function(){var t=Dl(d);return $($({},t),{on:function(e){return t.get().each(e)}})},Nl=function(t,e,n,r){return function(o){var i=Dl((function(t){return t.unbind()})),u=!it(r),a=function(){var a=_i(e),c=function(e){return t.formatter.match(n,{value:r},e.dom,u)};u?(o.setActive(!D(a,c)),i.set(t.formatter.formatChanged(n,(function(t){return o.setActive(!t)}),!0))):(o.setActive(V(a,c)),i.set(t.formatter.formatChanged(n,o.setActive,!1,{value:r})))};return t.initialized?a():t.on("init",a),i.clear}},Rl=function(t){return Ht(t,"menu")},zl=function(t){return N(t,(function(t){var e=t.text||t.title;return Rl(t)?{text:e,items:zl(t.menu)}:{text:e,value:t.value}}))},Bl=function(t,e,n,r,o){return N(n,(function(n){var i=n.text||n.title;return Rl(n)?{type:"nestedmenuitem",text:i,getSubmenuItems:function(){return Bl(t,e,n.menu,r,o)}}:{text:i,type:"togglemenuitem",onAction:function(){return o(n.value)},onSetup:Nl(t,e,r,n.value)}}))},Il=function(t,e){return function(n){var r;t.execCommand("mceTableApplyCellStyle",!1,((r={})[e]=n,r))}},Pl=function(t){return F(t,(function(t){return Rl(t)?[$($({},t),{menu:Pl(t.menu)})]:it(t.value)?[t]:[]}))},Ll=function(t,e,n,r,o){return function(i){return i(Bl(t,e,n,r,o))}},Hl=function(t,e,n){var r=N(e,(function(t){return{text:t.title,value:"#"+Al(t.value).value,type:"choiceitem"}}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:r.length>0?r:void 0,allowCustomColors:!1},onAction:function(e){var r,o="remove"===e.value?"":e.value;t.execCommand("mceTableApplyCellStyle",!1,((r={})[n]=o,r))}}]},Fl=function(t){return function(){var e="header"===t.queryCommandValue("mceTableRowType")?"body":"header";t.execCommand("mceTableRowType",!1,{type:e})}},Vl=function(t){return function(){var e="th"===t.queryCommandValue("mceTableColType")?"td":"th";t.execCommand("mceTableColType",!1,{type:e})}},jl=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:bl}],Ul=function(t){return jl.concat(function(t){var e=zl(Sa(t));return e.length>0?O.some({name:"class",type:"listbox",label:"Class",items:e}):O.none()}(t).toArray())},Wl=function(t,e){var n=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(zl(pa(t)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===e?[{name:"borderwidth",type:"input",label:"Border width"}].concat(n):n}},ql=function(t){return function(e,n){var r=e.dom;return{setAttrib:function(e,o){t&&!o||r.setAttrib(n,e,o)},setStyle:function(e,o){t&&!o||r.setStyle(n,e,o)},setFormat:function(r,o){t&&!o||(""===o?e.formatter.remove(r,{value:null},n,!0):e.formatter.apply(r,{value:o},n))}}}},Gl={normal:ql(!1),ifTruthy:ql(!0)},$l=function(t){return function(e){return nt(e,"rgb")?t.toHex(e):e}},Xl=function(t,e){var n=wt.fromDom(e);return{borderwidth:We(n,"border-width").getOr(""),borderstyle:We(n,"border-style").getOr(""),bordercolor:We(n,"border-color").map($l(t)).getOr(""),backgroundcolor:We(n,"background-color").map($l(t)).getOr("")}},Kl=function(t){var e=t[0],n=t.slice(1);return R(n,(function(t){R(Et(e),(function(n){Dt(t,(function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")}))}))})),e},Yl=function(t,e,n,r){return P(t,(function(t){return!c(n.formatter.matchNode(r,e+t))})).getOr("")},Jl=p(Yl,["left","center","right"],"align"),Ql=p(Yl,["top","middle","bottom"],"valign"),Zl=function(t){return on(wt.fromDom(t)).map((function(e){var n={selection:si(t.cells)};return tl(e,n)})).getOr("")},tf=function(t,e){var n=Tn.fromTable(t),r=Tn.justCells(n),o=z(r,(function(t){return D(e,(function(e){return kt(t.element,e)}))}));return N(o,(function(t){return{element:t.element.dom,column:Tn.getColumnAt(n,t.column).map((function(t){return t.element.dom}))}}))},ef=function(t,e,n){var r=1===e.length;R(e,(function(e){var o=e.element,i=r?Gl.normal(t,o):Gl.ifTruthy(t,o);!function(t,e,n){t.setAttrib("scope",n.scope),t.setAttrib("class",n.class),t.setStyle("height",gi(n.height)),e.setStyle("width",gi(n.width))}(i,e.column.map((function(e){return r?Gl.normal(t,e):Gl.ifTruthy(t,e)})).getOr(i),n),ya(t)&&function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",gi(e.borderwidth))}(i,n),r&&(vl(t,o),function(t,e){gl.each("top middle bottom".split(" "),(function(n){t.formatter.remove("valign"+n,{},e)}))}(t,o)),n.halign&&pl(t,o,n.halign),n.valign&&function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)}(t,o,n.valign)}))},nf=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){!function(t,e,n,r){var o=Rt(r,(function(t,e){return n[e]!==t}));It(o)>0&&e.length>=1&&on(e[0]).each((function(n){var i=tf(n,e),u=It(Rt(o,(function(t,e){return"scope"!==e&&"celltype"!==e})))>0,a=Lt(o,"celltype");(u||Lt(o,"scope"))&&ef(t,i,r),a&&function(t,e){t.execCommand("mceTableCellType",!1,{type:e.celltype,no_events:!0})}(t,r),ia(t,n.dom,{structure:a,style:u})}))}(t,e,n,o),t.focus()}))},rf=function(t,e){var n=on(e[0]).map((function(n){return N(tf(n,e),(function(e){return function(t,e,n,r){var o,i=t.dom,u=r.getOr(e),a=function(t,e){return i.getStyle(t,e)||i.getAttrib(t,e)};return $({width:a(u,"width"),height:a(e,"height"),scope:i.getAttrib(e,"scope"),celltype:(o=e,o.nodeName.toLowerCase()),class:i.getAttrib(e,"class",""),halign:Jl(t,e),valign:Ql(t,e)},n?Xl(i,e):{})}(t,e.element,ya(t),e.column)}))}));return Kl(n.getOrDie())},of=function(t,e){var n=_i(e);if(0!==n.length){var r=rf(t,n),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:Ul(t)},Wl(t,"cell")]},i={type:"panel",items:[{type:"grid",columns:2,items:Ul(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:ya(t)?o:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:p(nf,t,n,r)})}},uf=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],af=function(t){return uf.concat(function(t){var e=zl(function(t){return t.getParam("table_row_class_list",[],"array")}(t));return e.length>0?O.some({name:"class",type:"listbox",label:"Class",items:e}):O.none()}(t).toArray())},cf=function(t,e,n,r){var o=1===e.length;R(e,(function(e){var i=o?Gl.normal(t,e):Gl.ifTruthy(t,e);!function(t,e){t.setAttrib("class",e.class),t.setStyle("height",gi(e.height))}(i,n),wa(t)&&function(t,e){t.setStyle("background-color",e.backgroundcolor),t.setStyle("border-color",e.bordercolor),t.setStyle("border-style",e.borderstyle)}(i,n),n.align!==r.align&&(vl(t,e),pl(t,e,n.align))}))},sf=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){!function(t,e,n,r){var o=Rt(r,(function(t,e){return n[e]!==t}));if(It(o)>0){var i=Lt(o,"type"),u=!i||It(o)>1;u&&cf(t,e,r,n),i&&function(t,e){t.execCommand("mceTableRowType",!1,{type:e.type,no_events:!0})}(t,r),on(wt.fromDom(e[0])).each((function(e){return ia(t,e.dom,{structure:i,style:u})}))}}(t,e,n,o),t.focus()}))},lf=function(t){var e,n,r,o,i=(e=bi(t),n=Ci.selected,r=Ti(e),o=r.bind((function(t){return on(t)})).map((function(t){return un(t)})),Ie(r,o,(function(t,e){return z(e,(function(e){return D(si(e.dom.cells),(function(e){return"1"===De(e,n)||kt(e,t)}))}))})).getOr([]));if(0!==i.length){var u=N(i,(function(e){return function(t,e,n){var r=t.dom;return $({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),class:r.getAttrib(e,"class",""),type:Zl(e),align:Jl(t,e)},n?Xl(r,e):{})}(t,e.dom,wa(t))})),a=Kl(u),c={type:"tabpanel",tabs:[{title:"General",name:"general",items:af(t)},Wl(t,"row")]},s={type:"panel",items:[{type:"grid",columns:2,items:af(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:wa(t)?c:s,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:a,onSubmit:p(sf,t,N(i,(function(t){return t.dom})),a)})}},ff=function(t,e,n){var r=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],o=function(t){return t.getParam("table_appearance_options",!0,"boolean")}(t)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],i=e.length>0?[{type:"listbox",name:"class",label:"Class",items:e}]:[];return r.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(o).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(i)},df=function(t,e,n,o){if("TD"===e.tagName||"TH"===e.tagName)r(n)?t.setStyle(e,n,o):t.setStyle(e,n);else if(e.children)for(var i=0;i<e.children.length;i++)df(t,e.children[i],n,o)},mf=function(t,e,n,r){var o=t.dom,i=r.getData(),u=Rt(i,(function(t,e){return n[e]!==t}));r.close(),""===i.class&&delete i.class,t.undoManager.transact((function(){if(!e){var n=parseInt(i.cols,10)||1,r=parseInt(i.rows,10)||1;e=ul(t,n,r,0,0)}if(It(u)>0){!function(t,e,n){var r=t.dom,o={},i={};if(o.class=n.class,i.height=gi(n.height),r.getAttrib(e,"width")&&!Ca(t)?o.width=function(t){return t?t.replace(/px$/,""):""}(n.width):i.width=gi(n.width),Ca(t)?(i["border-width"]=gi(n.border),i["border-spacing"]=gi(n.cellspacing)):(o.border=n.border,o.cellpadding=n.cellpadding,o.cellspacing=n.cellspacing),Ca(t)&&e.children)for(var u=0;u<e.children.length;u++)df(r,e.children[u],{"border-width":gi(n.border),padding:gi(n.cellpadding)}),xa(t)&&df(r,e.children[u],{"border-color":n.bordercolor});xa(t)&&(i["background-color"]=n.backgroundcolor,i["border-color"]=n.bordercolor,i["border-style"]=n.borderstyle),o.style=r.serializeStyle($($({},ba(t)),i)),r.setAttribs(e,$($({},va(t)),o))}(t,e,i);var a=o.select("caption",e)[0];(a&&!i.caption||!a&&i.caption)&&t.execCommand("mceTableToggleCaption"),""===i.align?vl(t,e):pl(t,e,i.align)}if(t.focus(),t.addVisual(),It(u)>0){var c=Lt(u,"caption"),s=!c||It(u)>1;ia(t,e,{structure:c,style:s})}}))},gf=function(t,e){var n,r=t.dom,o=function(t,e){var n,r,o,i,u=ba(t),a=va(t),c=e?(n=t.dom,{borderstyle:Pt(u,"border-style").getOr(""),bordercolor:$l(n)(Pt(u,"border-color").getOr("")),backgroundcolor:$l(n)(Pt(u,"background-color").getOr(""))}):{};return $($($($($($({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),c),(i=u["border-width"],Ca(t)&&i?{border:i}:Pt(a,"border").fold((function(){return{}}),(function(t){return{border:t}})))),(r=Pt(u,"border-spacing").or(Pt(a,"cellspacing")).fold((function(){return{}}),(function(t){return{cellspacing:t}})),o=Pt(u,"border-padding").or(Pt(a,"cellpadding")).fold((function(){return{}}),(function(t){return{cellpadding:t}})),$($({},r),o)))}(t,xa(t));!1===e?(n=r.getParent(t.selection.getStart(),"table",t.getBody()))?o=function(t,e,n){var r=t.dom,o=Ca(t)?r.getStyle(e,"border-spacing")||r.getAttrib(e,"cellspacing"):r.getAttrib(e,"cellspacing")||r.getStyle(e,"border-spacing"),i=Ca(t)?hl(r,e,"padding")||r.getAttrib(e,"cellpadding"):r.getAttrib(e,"cellpadding")||hl(r,e,"padding");return $({width:r.getStyle(e,"width")||r.getAttrib(e,"width"),height:r.getStyle(e,"height")||r.getAttrib(e,"height"),cellspacing:o,cellpadding:i,border:function(e,n){var r=We(wt.fromDom(n),"border-width");return Ca(t)&&r.isSome()?r.getOr(""):e.getAttrib(n,"border")||hl(t.dom,n,"border-width")||hl(t.dom,n,"border")}(r,e),caption:!!r.select("caption",e)[0],class:r.getAttrib(e,"class",""),align:Jl(t,e)},n?Xl(r,e):{})}(t,n,xa(t)):xa(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",xa(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=zl(ka(t));i.length>0&&o.class&&(o.class=o.class.replace(/\s*mce\-item\-table\s*/g,""));var u={type:"grid",columns:2,items:ff(t,i,e)},a=xa(t)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[u]},Wl(t,"table")]}:{type:"panel",items:[u]};t.windowManager.open({title:"Table Properties",size:"normal",body:a,onSubmit:p(mf,t,n,o),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},hf=function(t){return Oi(bi(t),mi(t))},pf=function(t,e,n,i,u){var a=mi(t),c=function(t){return on(t,a)},s=function(e){return function(t){return Ti(bi(t),mi(t))}(t).bind((function(t){return c(t).map((function(n){return e(n,t)}))}))},l=function(e){t.focus()},f=function(t,e){return void 0===e&&(e=!1),s((function(n,r){var o=Si(i,n,r);t(n,o,e).each(l)}))},m=function(){return s((function(e,n){var r=Si(i,e,n),o=ai(d,wt.fromDom(t.getDoc()),O.none());return ml(e,r,o)}))},g=function(){return s((function(t,e){var n=Si(i,t,e);return dl(t,n)}))},h=function(e,n){return n().each((function(n){var r=N(n,(function(t){return Sr(t)}));s((function(n,o){var u=ci(wt.fromDom(t.getDoc())),a=function(t,e,n,r){return{selection:yi(t),clipboard:n,generators:r}}(i,0,r,u);e(n,a).each(l)}))}))},v=function(t){return function(e,n){return Pt(n,"type").each((function(e){f(t(e),n.no_events)}))}};Dt({mceTableSplitCells:function(){return f(e.unmergeCells)},mceTableMergeCells:function(){return f(e.mergeCells)},mceTableInsertRowBefore:function(){return f(e.insertRowsBefore)},mceTableInsertRowAfter:function(){return f(e.insertRowsAfter)},mceTableInsertColBefore:function(){return f(e.insertColumnsBefore)},mceTableInsertColAfter:function(){return f(e.insertColumnsAfter)},mceTableDeleteCol:function(){return f(e.deleteColumn)},mceTableDeleteRow:function(){return f(e.deleteRow)},mceTableCutCol:function(){return g().each((function(t){u.setColumns(t),f(e.deleteColumn)}))},mceTableCutRow:function(){return m().each((function(t){u.setRows(t),f(e.deleteRow)}))},mceTableCopyCol:function(){return g().each((function(t){return u.setColumns(t)}))},mceTableCopyRow:function(){return m().each((function(t){return u.setRows(t)}))},mceTablePasteColBefore:function(){return h(e.pasteColsBefore,u.getColumns)},mceTablePasteColAfter:function(){return h(e.pasteColsAfter,u.getColumns)},mceTablePasteRowBefore:function(){return h(e.pasteRowsBefore,u.getRows)},mceTablePasteRowAfter:function(){return h(e.pasteRowsAfter,u.getRows)},mceTableDelete:function(){return hf(t).each((function(e){on(e,a).filter(y(a)).each((function(e){var n=wt.fromText("");if(Ln(e,n),qn(e),t.dom.isEmpty(t.getBody()))t.setContent(""),t.selection.setCursorLocation();else{var r=t.dom.createRng();r.setStart(n.dom,0),r.setEnd(n.dom,0),t.selection.setRng(r),t.nodeChanged()}}))}))},mceTableCellToggleClass:function(e,n){s((function(e){var r=_i(i),o=V(r,(function(e){return t.formatter.match("tablecellclass",{value:n},e.dom)}))?t.formatter.remove:t.formatter.apply;R(r,(function(t){return o("tablecellclass",{value:n},t.dom)})),ia(t,e.dom,ua)}))},mceTableToggleClass:function(e,n){s((function(e){t.formatter.toggle("tableclass",{value:n},e.dom),ia(t,e.dom,ua)}))},mceTableToggleCaption:function(){hf(t).each((function(e){on(e,a).each((function(n){ke(n,"caption").fold((function(){var e=wt.fromTag("caption");Fn(e,wt.fromText("Caption")),function(t,e,n){ce(t,n).fold((function(){Fn(t,e)}),(function(t){Pn(t,e)}))}(n,e,0),t.selection.setCursorLocation(e.dom,0)}),(function(r){te("caption")(e)&&St("td",n).each((function(e){return t.selection.setCursorLocation(e.dom,0)})),qn(r)})),ia(t,n.dom,aa)}))}))},mceTableSizingMode:function(e,n){return function(e){return hf(t).each((function(n){_a(t)||Ta(t)||Oa(t)||on(n,a).each((function(n){"relative"!==e||ou(n)?"fixed"!==e||iu(n)?"responsive"!==e||uu(n)||Va(n):Fa(t,n):Ha(t,n),hi(n),ia(t,n.dom,aa)}))}))}(n)},mceTableCellType:v((function(t){return"th"===t?e.makeCellsHeader:e.unmakeCellsHeader})),mceTableColType:v((function(t){return"th"===t?e.makeColumnsHeader:e.unmakeColumnsHeader})),mceTableRowType:v((function(t){switch(t){case"header":return e.makeRowsHeader;case"footer":return e.makeRowsFooter;default:return e.makeRowsBody}}))},(function(e,n){return t.addCommand(n,e)})),Dt({mceTableProps:p(gf,t,!1),mceTableRowProps:p(lf,t),mceTableCellProps:p(of,t,i)},(function(e,n){return t.addCommand(n,(function(){return e()}))})),t.addCommand("mceInsertTable",(function(e,n){o(n)&&Et(n).length>0?al(t,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):gf(t,!0)})),t.addCommand("mceTableApplyCellStyle",(function(e,n){var u=function(t){return"tablecell"+t.toLowerCase().replace("-","")};if(o(n)){var a=_i(i);if(0!==a.length){var s=Rt(n,(function(e,n){return t.formatter.has(u(n))&&r(e)}));(function(t){for(var e in t)if(At.call(t,e))return!1;return!0})(s)||(Dt(s,(function(e,n){R(a,(function(r){Gl.normal(t,r.dom).setFormat(u(n),e)}))})),c(a[0]).each((function(e){return ia(t,e.dom,ua)})))}}}))},vf={remove_similar:!0,inherit:!1},bf=$({selector:"td,th"},vf),yf={tablecellbackgroundcolor:$({styles:{backgroundColor:"%value"}},bf),tablecellverticalalign:$({styles:{"vertical-align":"%value"}},bf),tablecellbordercolor:$({styles:{borderColor:"%value"}},bf),tablecellclass:$({classes:["%value"]},bf),tableclass:$({selector:"table",classes:["%value"]},vf),tablecellborderstyle:$({styles:{borderStyle:"%value"}},bf),tablecellborderwidth:$({styles:{borderWidth:"%value"}},bf)},wf=gr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),xf=$($({},wf),{none:function(t){return void 0===t&&(t=void 0),wf.none(t)}}),Cf=function(t,e,n,r,o){void 0===o&&(o=x);var i=1===r;if(!i&&n<=0)return xf.first(t[0]);if(i&&n>=t.length-1)return xf.last(t[t.length-1]);var u=n+r,a=t[u];return o(a)?xf.middle(e,a):Cf(t,e,u,r,o)},Sf=function(t,e){return on(t,e).bind((function(e){var n=nn(e);return L(n,(function(e){return kt(t,e)})).map((function(t){return{index:t,all:n}}))}))},kf=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Of=gr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Tf={before:Of.before,on:Of.on,after:Of.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(g,g,g)}},_f=gr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ef={domRange:_f.domRange,relative:_f.relative,exact:_f.exact,exactFromRange:function(t){return _f.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e,n=function(t){return t.match({domRange:function(t){return wt.fromDom(t.startContainer)},relative:function(t,e){return Tf.getStart(t)},exact:function(t,e,n,r){return t}})}(t);return e=n,wt.fromDom(ne(e).dom.defaultView)},range:kf},Af=function(t,e){var n=t.document.createRange();return n.selectNode(e.dom),n},Df=function(t,e){var n=t.document.createRange();return Mf(n,e),n},Mf=function(t,e){return t.selectNodeContents(e.dom)},Nf=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Rf=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},zf=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Bf=gr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),If=function(t,e,n){return e(wt.fromDom(n.startContainer),n.startOffset,wt.fromDom(n.endContainer),n.endOffset)},Pf=function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return Bf.rtl(wt.fromDom(t.endContainer),t.endOffset,wt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return If(0,Bf.ltr,n)})):If(0,Bf.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:m(t),rtl:O.none}},relative:function(e,n){return{ltr:K((function(){return Nf(t,e,n)})),rtl:K((function(){return O.some(Nf(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:K((function(){return Rf(t,e,n,r,o)})),rtl:K((function(){return O.some(Rf(t,r,o,e,n))}))}}})}(t,e))},Lf=function(t,e){return Pf(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Bf.ltr,Bf.rtl;var Hf=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},Ff=function(t,e,n,r,o){var i=function(n){var r=t.dom.createRange();return r.setStart(e.dom,n),r.collapse(!0),r},u=Xn(e).length,a=function(t,e,n,r,o){if(0===o)return 0;if(e===r)return o-1;for(var i=r,u=1;u<o;u++){var a=t(u),c=Math.abs(e-a.left);if(n<=a.bottom){if(n<a.top||c>i)return u-1;i=c}}return 0}((function(t){return i(t).getBoundingClientRect()}),n,r,o.right,u);return i(a)},Vf=function(t,e,n,r){return Jt(e)?function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getClientRects();return G(i,(function(t){return Hf(t,n,r)?O.some(t):O.none()})).map((function(o){return Ff(t,e,n,r,o)}))}(t,e,n,r):function(t,e,n,r){var o=t.dom.createRange(),i=ae(e);return G(i,(function(e){return o.selectNode(e.dom),Hf(o.getBoundingClientRect(),n,r)?Vf(t,e,n,r):O.none()}))}(t,e,n,r)},jf=function(t,e){return e-t.left<t.right-e},Uf=function(t,e,n){var r=t.dom.createRange();return r.selectNode(e.dom),r.collapse(n),r},Wf=function(t,e,n){var r=t.dom.createRange();r.selectNode(e.dom);var o=r.getBoundingClientRect(),i=jf(o,n);return(!0===i?Jo:Qo)(e).map((function(e){return Uf(t,e,i)}))},qf=function(t,e,n){var r=e.dom.getBoundingClientRect(),o=jf(r,n);return O.some(Uf(t,e,o))},Gf=function(t,e,n){var r,o;return O.from(null===(o=(r=t.dom).caretPositionFromPoint)||void 0===o?void 0:o.call(r,e,n)).bind((function(e){if(null===e.offsetNode)return O.none();var n=t.dom.createRange();return n.setStart(e.offsetNode,e.offset),n.collapse(),O.some(n)}))},$f=function(t,e,n){var r,o;return O.from(null===(o=(r=t.dom).caretRangeFromPoint)||void 0===o?void 0:o.call(r,e,n))},Xf=function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect();return function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return Vf(t,e,u,a)}(t,e,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},Kf=function(t,e,n){return wt.fromPoint(t,e,n).bind((function(r){var o=function(){return function(t,e,n){return(0===ae(e).length?qf:Wf)(t,e,n)}(t,r,e)};return 0===ae(r).length?o():Xf(t,r,e,n).orThunk(o)}))},Yf=document.caretPositionFromPoint?Gf:document.caretRangeFromPoint?$f:Kf,Jf=function(t,e){var n=Gt(t);return"input"===n?Tf.after(t):A(["br","img"],n)?0===e?Tf.before(t):Tf.after(t):Tf.on(t,e)},Qf=function(t,e){var n=t.fold(Tf.before,Jf,Tf.after),r=e.fold(Tf.before,Jf,Tf.after);return Ef.relative(n,r)},Zf=function(t,e,n,r){var o=Jf(t,e),i=Jf(n,r);return Ef.relative(o,i)},td=function(t,e,n,r){var o=function(t,e,n,r){var o=ee(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=kt(t,n)&&e===r;return o.collapsed&&!i},ed=function(t){return O.from(t.getSelection())},nd=function(t,e){ed(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))},rd=function(t,e,n,r,o){var i=Rf(t,e,n,r,o);nd(t,i)},od=function(t,e){return Pf(t,e).match({ltr:function(e,n,r,o){rd(t,e,n,r,o)},rtl:function(e,n,r,o){ed(t).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{!function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)}(0,i,e,n,r,o)}catch(i){rd(t,r,o,e,n)}else rd(t,r,o,e,n)}))}})},id=function(t,e,n,r,o){var i=Zf(e,n,r,o);od(t,i)},ud=function(t,e,n){var r=Qf(e,n);od(t,r)},ad=function(t){var e=Ef.getWin(t).dom,n=function(t,n,r,o){return Rf(e,t,n,r,o)},r=function(t){return t.match({domRange:function(t){var e=wt.fromDom(t.startContainer),n=wt.fromDom(t.endContainer);return Zf(e,t.startOffset,n,t.endOffset)},relative:Qf,exact:Zf})}(t);return Pf(e,r).match({ltr:n,rtl:n})},cd=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return O.some(kf(wt.fromDom(e.startContainer),e.startOffset,wt.fromDom(n.endContainer),n.endOffset))}return O.none()},sd=function(t){if(null===t.anchorNode||null===t.focusNode)return cd(t);var e=wt.fromDom(t.anchorNode),n=wt.fromDom(t.focusNode);return td(e,t.anchorOffset,n,t.focusOffset)?O.some(kf(e,t.anchorOffset,n,t.focusOffset)):cd(t)},ld=function(t,e,n){void 0===n&&(n=!0);var r=(n?Df:Af)(t,e);nd(t,r)},fd=function(t){return function(t){return ed(t).filter((function(t){return t.rangeCount>0})).bind(sd)}(t).map((function(t){return Ef.exact(t.start,t.soffset,t.finish,t.foffset)}))},dd=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?O.some(n).map(zf):O.none()}(Lf(t,e))},md=function(t,e,n){return function(t,e,n){var r=wt.fromDom(t.document);return Yf(r,e,n).map((function(t){return kf(wt.fromDom(t.startContainer),t.startOffset,wt.fromDom(t.endContainer),t.endOffset)}))}(t,e,n)},gd=tinymce.util.Tools.resolve("tinymce.util.VK"),hd=function(t,e,n){return vd(t,e,function(t,e,n){return Sf(t,n).fold((function(){return xf.none(t)}),(function(n){return Cf(n.all,t,n.index,1,e)}))}(n,Pu))},pd=function(t,e,n){return vd(t,e,function(t,e,n){return Sf(t,n).fold((function(){return xf.none()}),(function(n){return Cf(n.all,t,n.index,-1,e)}))}(n,Pu))},vd=function(t,e,n){return n.fold(O.none,O.none,(function(t,e){return Jo(e).map((function(t){return function(t,e){var n=Ef.exact(e,0,e,0);return ad(n)}(0,t)}))}),(function(n){return t.execCommand("mceTableInsertRowAfter"),hd(t,e,n)}))},bd=["table","li","dl"],yd=function(t,e){return{selection:t,kill:e}},wd=function(t,e,n,r){return{start:Tf.on(t,e),finish:Tf.on(n,r)}},xd=function(t,e){var n=Lf(t,e);return kf(wt.fromDom(n.startContainer),n.startOffset,wt.fromDom(n.endContainer),n.endOffset)},Cd=wd,Sd=function(t,e,n,r,o){return kt(n,r)?O.none():cr(n,r,e).bind((function(e){var r=e.boxes.getOr([]);return r.length>1?(o(t,r,e.start,e.finish),O.some(yd(O.some(Cd(n,0,n,Xo(n))),!0))):O.none()}))},kd=function(t,e){return{item:t,mode:e}},Od=function(t,e,n,r){return void 0===r&&(r=Td),t.property().parent(e).map((function(t){return kd(t,r)}))},Td=function(t,e,n,r){return void 0===r&&(r=_d),n.sibling(t,e).map((function(t){return kd(t,r)}))},_d=function(t,e,n,r){void 0===r&&(r=_d);var o=t.property().children(e);return n.first(o).map((function(t){return kd(t,r)}))},Ed=[{current:Od,next:Td,fallback:O.none()},{current:Td,next:_d,fallback:O.some(Od)},{current:_d,next:_d,fallback:O.some(Td)}],Ad=function(t,e,n,r,o){return void 0===o&&(o=Ed),P(o,(function(t){return t.current===n})).bind((function(n){return n.current(t,e,r,n.next).orThunk((function(){return n.fallback.bind((function(n){return Ad(t,e,n,r)}))}))}))},Dd=function(){return{sibling:function(t,e){return t.query().prevSibling(e)},first:function(t){return t.length>0?O.some(t[t.length-1]):O.none()}}},Md=function(){return{sibling:function(t,e){return t.query().nextSibling(e)},first:function(t){return t.length>0?O.some(t[0]):O.none()}}},Nd=function(t,e,n,r,o,i){return Ad(t,e,r,o).bind((function(e){return i(e.item)?O.none():n(e.item)?O.some(e.item):Nd(t,e.item,n,e.mode,o,i)}))},Rd=function(t){return function(e){return 0===t.property().children(e).length}},zd=function(t,e,n,r){return Nd(t,e,n,Td,Dd(),r)},Bd=function(t,e,n,r){return Nd(t,e,n,Td,Md(),r)},Id=Qn(),Pd=function(t,e){return function(t,e,n){return zd(t,e,Rd(t),n)}(Id,t,e)},Ld=function(t,e){return function(t,e,n){return Bd(t,e,Rd(t),n)}(Id,t,e)},Hd=gr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Fd=function(t){return Te(t,"tr")},Vd=$($({},Hd),{verify:function(t,e,n,r,o,i,u){return Te(r,"td,th",u).bind((function(n){return Te(e,"td,th",u).map((function(e){return kt(n,e)?kt(r,n)&&Xo(n)===o?i(e):Hd.none("in same cell"):ur(Fd,[n,e]).fold((function(){return function(t,e,n){var r=t.getRect(e),o=t.getRect(n);return o.right>r.left&&o.left<r.right}(t,e,n)?Hd.success():i(e)}),(function(t){return i(e)}))}))})).getOr(Hd.none("default"))},cata:function(t,e,n,r,o){return t.fold(e,n,r,o)}}),jd=function(t,e){return L(t,p(kt,e))},Ud=function(t){return"br"===Gt(t)},Wd=function(t,e,n){return e(t,n).bind((function(t){return Jt(t)&&0===Xn(t).trim().length?Wd(t,e,n):O.some(t)}))},qd=function(t,e,n,r){return function(t,e){return ce(t,e).filter(Ud).orThunk((function(){return ce(t,e-1).filter(Ud)}))}(e,n).bind((function(e){return r.traverse(e).fold((function(){return Wd(e,r.gather,t).map(r.relative)}),(function(t){return function(t){return re(t).bind((function(e){var n=ae(e);return jd(n,t).map((function(r){return function(t,e,n,r){return{parent:t,children:e,element:n,index:r}}(e,n,t,r)}))}))}(t).map((function(t){return Tf.on(t.parent,t.index)}))}))}))},Gd=function(t,e,n,r){return(Ud(e)?function(t,e,n){return n.traverse(e).orThunk((function(){return Wd(e,n.gather,t)})).map(n.relative)}(t,e,r):qd(t,e,n,r)).map((function(t){return{start:t,finish:t}}))},$d=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},Xd=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},Kd=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},Yd=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},Jd=function(t,e){return O.some(t.getRect(e))},Qd=function(t,e,n){return Yt(e)?Jd(t,e).map(Yd):Jt(e)?function(t,e,n){return n>=0&&n<Xo(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):O.none()}(t,e,n).map(Yd):O.none()},Zd=function(t,e){return Yt(e)?Jd(t,e).map(Yd):Jt(e)?t.getRangedRect(e,0,e,Xo(e)).map(Yd):O.none()},tm=gr([{none:[]},{retry:["caret"]}]),em=function(t,e,n){return(r=e,o=ls,xe((function(t,e){return e(t)}),Ce,r,o,i)).fold(w,(function(e){return Zd(t,e).exists((function(t){return function(t,e){return t.left<e.left||Math.abs(e.right-t.left)<1||t.left>e.right}(n,t)}))}));var r,o,i},nm={point:function(t){return t.bottom},adjuster:function(t,e,n,r,o){var i=$d(o,5);return Math.abs(n.bottom-r.bottom)<1?tm.retry(i):n.top>o.bottom?tm.retry(i):n.top===o.bottom?tm.retry($d(o,1)):em(t,e,o)?tm.retry(Kd(i,5,0)):tm.none()},move:$d,gather:Ld},rm=function(t,e,n,r,o){return 0===o?O.some(r):function(t,e,n){return t.elementFromPoint(e,n).filter((function(t){return"table"===Gt(t)})).isSome()}(t,r.left,e.point(r))?function(t,e,n,r,o){return rm(t,e,n,e.move(r,5),o)}(t,e,n,r,o-1):t.situsFromPoint(r.left,e.point(r)).bind((function(i){return i.start.fold(O.none,(function(i){return Zd(t,i).bind((function(u){return e.adjuster(t,i,u,n,r).fold(O.none,(function(r){return rm(t,e,n,r,o-1)}))})).orThunk((function(){return O.some(r)}))}),O.none)}))},om=function(t,e,n){var r=t.move(n,5),o=rm(e,t,n,r,100).getOr(r);return function(t,e,n){return t.point(e)>n.getInnerHeight()?O.some(t.point(e)-n.getInnerHeight()):t.point(e)<0?O.some(-t.point(e)):O.none()}(t,o,e).fold((function(){return e.situsFromPoint(o.left,t.point(o))}),(function(n){return e.scrollBy(0,n),e.situsFromPoint(o.left,t.point(o)-n)}))},im={tryUp:p(om,{point:function(t){return t.top},adjuster:function(t,e,n,r,o){var i=Xd(o,5);return Math.abs(n.top-r.top)<1?tm.retry(i):n.bottom<o.top?tm.retry(i):n.bottom===o.top?tm.retry(Xd(o,1)):em(t,e,o)?tm.retry(Kd(i,5,0)):tm.none()},move:Xd,gather:Pd}),tryDown:p(om,nm),ieTryUp:function(t,e){return t.situsFromPoint(e.left,e.top-5)},ieTryDown:function(t,e){return t.situsFromPoint(e.left,e.bottom+5)},getJumpSize:m(5)},um=function(t,e,n){return t.getSelection().bind((function(r){return Gd(e,r.finish,r.foffset,n).fold((function(){return O.some(qa(r.finish,r.foffset))}),(function(o){var i=t.fromSitus(o);return function(t){return Vd.cata(t,(function(t){return O.none()}),(function(){return O.none()}),(function(t){return O.some(qa(t,0))}),(function(t){return O.some(qa(t,Xo(t)))}))}(Vd.verify(t,r.finish,r.foffset,i.finish,i.foffset,n.failure,e))}))}))},am=function(t,e,n,r,o,i){return 0===i?O.none():lm(t,e,n,r,o).bind((function(u){var a=t.fromSitus(u),c=Vd.verify(t,n,r,a.finish,a.foffset,o.failure,e);return Vd.cata(c,(function(){return O.none()}),(function(){return O.some(u)}),(function(u){return kt(n,u)&&0===r?cm(t,n,r,Xd,o):am(t,e,u,0,o,i-1)}),(function(u){return kt(n,u)&&r===Xo(u)?cm(t,n,r,$d,o):am(t,e,u,Xo(u),o,i-1)}))}))},cm=function(t,e,n,r,o){return Qd(t,e,n).bind((function(e){return sm(t,o,r(e,im.getJumpSize()))}))},sm=function(t,e,n){var r=bt().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):O.none()},lm=function(t,e,n,r,o){return Qd(t,n,r).bind((function(e){return sm(t,o,e)}))},fm=function(t,e){return Ce(t,(function(t){return re(t).exists((function(t){return kt(t,e)}))}),n).isSome();var n},dm=function(t,e,n,r,o){return Te(r,"td,th",e).bind((function(r){return Te(r,"table",e).bind((function(i){return fm(o,i)?function(t,e,n){return um(t,e,n).bind((function(r){return am(t,e,r.element,r.offset,n,20).map(t.fromSitus)}))}(t,e,n).bind((function(t){return Te(t.finish,"td,th",e).map((function(e){return{start:r,finish:e,range:t}}))})):O.none()}))}))},mm=function(t,e,n,r,o,i){return bt().browser.isIE()?O.none():i(r,e).orThunk((function(){return dm(t,e,n,r,o).map((function(t){var e=t.range;return yd(O.some(Cd(e.start,e.soffset,e.finish,e.foffset)),!0)}))}))},gm=function(t,e){return Te(t,"tr",e).bind((function(t){return Te(t,"table",e).bind((function(n){var r=we(n,"tr");return kt(t,r[0])?function(t,e,n){return zd(Id,t,e,n)}(n,(function(t){return Qo(t).isSome()}),e).map((function(t){var e=Xo(t);return yd(O.some(Cd(t,e,t,e)),!0)})):O.none()}))}))},hm=function(t,e){return Te(t,"tr",e).bind((function(t){return Te(t,"table",e).bind((function(n){var r=we(n,"tr");return kt(t,r[r.length-1])?function(t,e,n){return Bd(Id,t,e,n)}(n,(function(t){return Jo(t).isSome()}),e).map((function(t){return yd(O.some(Cd(t,0,t,0)),!0)})):O.none()}))}))},pm=function(t,e,n,r,o,i,u){return dm(t,n,r,o,i).bind((function(t){return Sd(e,n,t.start,t.finish,u)}))},vm=function(t,e){return Te(t,"td,th",e)},bm={traverse:ue,gather:Ld,relative:Tf.before,otherRetry:im.tryDown,ieRetry:im.ieTryDown,failure:Vd.failedDown},ym={traverse:ie,gather:Pd,relative:Tf.before,otherRetry:im.tryUp,ieRetry:im.ieTryUp,failure:Vd.failedUp},wm=function(t){return function(e){return e===t}},xm=wm(38),Cm=wm(40),Sm=function(t){return t>=37&&t<=40},km={isBackward:wm(37),isForward:wm(39)},Om={isBackward:wm(39),isForward:wm(37)},Tm=function(t){return{elementFromPoint:function(e,n){return wt.fromPoint(wt.fromDom(t.document),e,n)},getRect:function(t){return t.dom.getBoundingClientRect()},getRangedRect:function(e,n,r,o){var i=Ef.exact(e,n,r,o);return dd(t,i)},getSelection:function(){return fd(t).map((function(e){return xd(t,e)}))},fromSitus:function(e){var n=Ef.relative(e.start,e.finish);return xd(t,n)},situsFromPoint:function(e,n){return md(t,e,n).map((function(t){return wd(t.start,t.soffset,t.finish,t.foffset)}))},clearSelection:function(){!function(t){ed(t).each((function(t){return t.removeAllRanges()}))}(t)},collapseSelection:function(e){void 0===e&&(e=!1),fd(t).each((function(n){return n.fold((function(t){return t.collapse(e)}),(function(n,r){var o=e?n:r;ud(t,o,o)}),(function(n,r,o,i){var u=e?n:o,a=e?r:i;id(t,u,a,u,a)}))}))},setSelection:function(e){id(t,e.start,e.soffset,e.finish,e.foffset)},setRelativeSelection:function(e,n){ud(t,e,n)},selectNode:function(e){ld(t,e,!1)},selectContents:function(e){ld(t,e)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){var e,n,r,o;return(e=wt.fromDom(t.document),n=void 0!==e?e.dom:document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop,Hr(r,o)).top},scrollBy:function(e,n){!function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollBy(t,e)}(e,n,wt.fromDom(t.document))}}},_m=function(t,e){return{rows:t,cols:e}},Em=function(t,e,n,r){var o=function(t,e,n,r){var o=Ml(),i=o.clear,u=function(i){o.on((function(o){r.clearBeforeUpdate(e),vm(i.target,n).each((function(u){cr(o,u,n).each((function(n){var o=n.boxes.getOr([]);if(1===o.length){var a=o[0],c="false"===Lu(a),s=ze(Iu(i.target),a,kt);c&&s&&(r.selectRange(e,o,a,a),t.selectContents(a))}else o.length>1&&(r.selectRange(e,o,n.start,n.finish),t.selectContents(u))}))}))}))};return{clearstate:i,mousedown:function(t){r.clear(e),vm(t.target,n).each(o.set)},mouseover:function(t){u(t)},mouseup:function(t){u(t),i()}}}(Tm(t),e,n,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},Am=function(t,e,n,r){var o=Tm(t),i=function(){return r.clear(e),O.none()};return{keydown:function(t,u,a,c,s,l){var f=t.raw,d=f.which,m=!0===f.shiftKey;return sr(e,r.selectedSelector).fold((function(){return Cm(d)&&m?p(pm,o,e,n,bm,c,u,r.selectRange):xm(d)&&m?p(pm,o,e,n,ym,c,u,r.selectRange):Cm(d)?p(mm,o,n,bm,c,u,hm):xm(d)?p(mm,o,n,ym,c,u,gm):O.none}),(function(t){var n=function(n){return function(){return G(n,(function(n){return function(t,e,n,r,o){return fr(r,t,e,o.firstSelectedSelector,o.lastSelectedSelector).map((function(t){return o.clearBeforeUpdate(n),o.selectRange(n,t.boxes,t.start,t.finish),t.boxes}))}(n.rows,n.cols,e,t,r)})).fold((function(){return lr(e,r.firstSelectedSelector,r.lastSelectedSelector).map((function(t){var n=Cm(d)||l.isForward(d)?Tf.after:Tf.before;return o.setRelativeSelection(Tf.on(t.first,0),n(t.table)),r.clear(e),yd(O.none(),!0)}))}),(function(t){return O.some(yd(O.none(),!0))}))}};return Cm(d)&&m?n([_m(1,0)]):xm(d)&&m?n([_m(-1,0)]):l.isBackward(d)&&m?n([_m(0,-1),_m(-1,0)]):l.isForward(d)&&m?n([_m(0,1),_m(1,0)]):Sm(d)&&!1===m?i:O.none}))()},keyup:function(t,o,i,u,a){return sr(e,r.selectedSelector).fold((function(){var c=t.raw,s=c.which;return!1===(!0===c.shiftKey)?O.none():Sm(s)?function(t,e,n,r,o,i,u){return kt(n,o)&&r===i?O.none():Te(n,"td,th",e).bind((function(n){return Te(o,"td,th",e).bind((function(r){return Sd(t,e,n,r,u)}))}))}(e,n,o,i,u,a,r.selectRange):O.none()}),O.none)}}},Dm=function(t,e,n){var r=function(e){Ne(e,t.selected),Ne(e,t.firstSelected),Ne(e,t.lastSelected)},o=function(e){Ee(e,t.selected,"1")},i=function(t){u(t),n()},u=function(e){var n=we(e,t.selectedSelector);R(n,r)};return{clearBeforeUpdate:u,clear:i,selectRange:function(n,r,u,a){i(n),R(r,o),Ee(u,t.firstSelected,"1"),Ee(a,t.lastSelected,"1"),e(r,u,a)},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},Mm=function(t,e,n){var r=Tn.fromTable(t);return kc(r,e).map((function(t){var e=bc(r,n,!1);return{upOrLeftCells:function(t,e){var n=t.slice(0,e[e.length-1].row+1),r=yc(n);return F(r,(function(t){var n=t.cells.slice(0,e[e.length-1].column+1);return N(n,(function(t){return t.element}))}))}(e,t),downOrRightCells:function(t,e){var n=t.slice(e[0].row+e[0].rowspan-1,t.length),r=yc(n);return F(r,(function(t){var n=t.cells.slice(e[0].column+e[0].colspan-1,t.cells.length);return N(n,(function(t){return t.element}))}))}(e,t)}}))},Nm=tinymce.util.Tools.resolve("tinymce.Env"),Rm=function(t){return!1===Mu(wt.fromDom(t.target),"ephox-snooker-resizer-bar")};function zm(t,e,n){var r=Dm(Ci,(function(e,r,o){n.targets().each((function(n){on(r).each((function(i){var u=Ra(t),a=ai(d,wt.fromDom(t.getDoc()),u),c=Mm(i,n,a);!function(t,e,n,r,o){t.fire("TableSelectionChange",{cells:e,start:n,finish:r,otherCells:o})}(t,e,r,o,c)}))}))}),(function(){return function(t){t.fire("TableSelectionClear")}(t)}));return t.on("init",(function(n){var o=t.getWin(),i=li(t),u=mi(t),a=Em(o,i,u,r),c=Am(o,i,u,r),s=function(t,e,n,r){var o=Tm(t);return function(t,i){r.clearBeforeUpdate(e),cr(t,i,n).each((function(t){var n=t.boxes.getOr([]);r.selectRange(e,n,t.start,t.finish),o.selectContents(i),o.collapseSelection()}))}}(o,i,u,r);t.on("TableSelectorChange",(function(t){return s(t.start,t.finish)}));var l,f,m=function(e,n){(function(t){return!0===t.raw.shiftKey})(e)&&(n.kill&&e.kill(),n.selection.each((function(e){var n=Ef.relative(e.start,e.finish),r=Lf(o,n);t.selection.setRng(r)})))},g=function(t){return 0===t.button},h=(l=Ho(wt.fromDom(i)),f=Ho(0),{touchEnd:function(t){var e=wt.fromDom(t.target);if("td"===Gt(e)||"th"===Gt(e)){var n=l.get(),r=f.get();kt(n,e)&&t.timeStamp-r<300&&(t.preventDefault(),s(e,e))}l.set(e),f.set(t.timeStamp)}});t.on("dragstart",(function(t){a.clearstate()})),t.on("mousedown",(function(t){g(t)&&Rm(t)&&a.mousedown(Tu(t))})),t.on("mouseover",(function(t){var e;(void 0===(e=t).buttons||Nm.browser.isEdge()&&0===e.buttons||0!=(1&e.buttons))&&Rm(t)&&a.mouseover(Tu(t))})),t.on("mouseup",(function(t){g(t)&&Rm(t)&&a.mouseup(Tu(t))})),t.on("touchend",h.touchEnd),t.on("keyup",(function(e){var n=Tu(e);if(n.raw.shiftKey&&Sm(n.raw.which)){var r=t.selection.getRng(),o=wt.fromDom(r.startContainer),i=wt.fromDom(r.endContainer);c.keyup(n,o,r.startOffset,i,r.endOffset).each((function(t){m(n,t)}))}})),t.on("keydown",(function(n){var r=Tu(n);e().each((function(t){return t.hideBars()}));var o=t.selection.getRng(),i=wt.fromDom(o.startContainer),u=wt.fromDom(o.endContainer),a=Rr(km,Om)(wt.fromDom(t.selection.getStart()));c.keydown(r,i,o.startOffset,u,o.endOffset,a).each((function(t){m(r,t)})),e().each((function(t){return t.showBars()}))})),t.on("NodeChange",(function(){var e=t.selection,n=wt.fromDom(e.getStart()),o=wt.fromDom(e.getEnd());ur(on,[n,o]).fold((function(){return r.clear(i)}),d)}))})),{clear:r.clear}}var Bm=function(t,e){var n=Ho(O.none()),r=Ho([]),o=O.none(),i=te("caption"),u=function(t){return o.forall((function(e){return!e[t]}))},a=function(){return Oi(function(t){return wt.fromDom(t.selection.getEnd())}(t),mi(t))},c=function(){return Oi(bi(t),mi(t)).bind((function(t){return Ie(on(t),a().bind(on),(function(n,r){return kt(n,r)?i(t)?O.some(function(t){return{element:t,mergable:O.none(),unmergable:O.none(),selection:[t]}}(t)):O.some(Si(e,n,t)):O.none()})).bind(g)}))},s=function(t){return on(t.element).map((function(e){var n=Tn.fromTable(e),r=kc(n,t).getOr([]),o=I(r,(function(t,e){return e.isLocked&&(t.onAny=!0,0===e.column?t.onFirst=!0:e.column+e.colspan>=n.grid.columns&&(t.onLast=!0)),t}),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:_c(n,t).isSome(),unmergeable:Ec(n,t).isSome(),locked:o}}))},l=function(){n.set(K(c)()),o=n.get().bind(s),R(r.get(),(function(t){return t()}))},f=function(t){return t(),r.set(r.get().concat([t])),function(){r.set(z(r.get(),(function(e){return e!==t})))}},d=function(t,e){return f((function(){return n.get().fold((function(){t.setDisabled(!0)}),(function(n){t.setDisabled(e(n))}))}))},m=function(t,e,r){return f((function(){return n.get().fold((function(){t.setDisabled(!0),t.setActive(!1)}),(function(n){t.setDisabled(e(n)),t.setActive(r(n))}))}))},h=function(t){return o.exists((function(e){return e.locked[t]}))},p=function(e,n){return function(r){return m(r,(function(t){return i(t.element)}),(function(){return t.queryCommandValue(e)===n}))}},v=p("mceTableRowType","header"),b=p("mceTableColType","th");return t.on("NodeChange ExecCommand TableSelectorChange",l),{onSetupTable:function(t){return d(t,(function(t){return!1}))},onSetupCellOrRow:function(t){return d(t,(function(t){return i(t.element)}))},onSetupColumn:function(t){return function(e){return d(e,(function(e){return i(e.element)||h(t)}))}},onSetupPasteable:function(t){return function(e){return d(e,(function(e){return i(e.element)||t().isNone()}))}},onSetupPasteableColumn:function(t,e){return function(n){return d(n,(function(n){return i(n.element)||t().isNone()||h(e)}))}},onSetupMergeable:function(t){return d(t,(function(t){return u("mergeable")}))},onSetupUnmergeable:function(t){return d(t,(function(t){return u("unmergeable")}))},resetTargets:l,onSetupTableWithCaption:function(e){return m(e,w,(function(e){return on(e.element,mi(t)).exists((function(t){return ke(t,"caption").isSome()}))}))},onSetupTableRowHeaders:v,onSetupTableColumnHeaders:b,targets:n.get}},Im=function(t){var e=function(t,e,n){return{get:function(){return dr(t(),n).fold((function(){return e().fold(vr,yr)}),(function(t){return br(t)}))}}}((function(){return li(t)}),(function(){return Ti(bi(t),mi(t))}),Ci.selectedSelector),n=Bm(t,e),r=Wa(t),o=zm(t,r.lazyResize,n),i=el(t,o,r.lazyWire),u=function(){var t=Ml(),e=Ml();return{getRows:t.get,setRows:function(n){n.fold(t.clear,t.set),e.clear()},clearRows:t.clear,getColumns:e.get,setColumns:function(n){n.fold(e.clear,e.set),t.clear()},clearColumns:e.clear}}();return pf(t,i,0,e,u),function(t,e,n){var r=mi(t),o=function(e){return Ti(bi(t)).bind((function(t){return on(t,r).map((function(r){var o=Si(n,r,t);return e(r,o)}))})).getOr("")};Dt({mceTableRowType:function(){return o(e.getTableRowType)},mceTableCellType:function(){return o(e.getTableCellType)},mceTableColType:function(){return o(e.getTableColType)}},(function(e,n){return t.addQueryValueHandler(n,e)}))}(t,i,e),Ei(t,e,i),function(t,e,n,r){var o=function(e){return function(){return t.execCommand(e)}},i=function(e){t.execCommand("mceInsertTable",!1,{rows:e.numRows,columns:e.numColumns})},u={text:"Table properties",onSetup:n.onSetupTable,onAction:o("mceTableProps")},a={text:"Delete table",icon:"table-delete-table",onSetup:n.onSetupTable,onAction:o("mceTableDelete")};t.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:o("mceTableInsertRowBefore"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:o("mceTableInsertRowAfter"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:o("mceTableDeleteRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:o("mceTableRowProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)});var c={type:"nestedmenuitem",text:"Row",getSubmenuItems:m("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")};t.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:o("mceTableInsertColBefore"),onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:o("mceTableInsertColAfter"),onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:o("mceTableDeleteCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")});var s={type:"nestedmenuitem",text:"Column",getSubmenuItems:m("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")};t.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:o("mceTableCellProps"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:o("mceTableMergeCells"),onSetup:n.onSetupMergeable}),t.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:o("mceTableSplitCells"),onSetup:n.onSetupUnmergeable});var l={type:"nestedmenuitem",text:"Cell",getSubmenuItems:m("tablecellprops tablemergecells tablesplitcells")};!1===function(t){return t.getParam("table_grid",!0,"boolean")}(t)?t.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTable")}):t.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:i}]}}),t.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTable")}),t.ui.registry.addMenuItem("tableprops",u),t.ui.registry.addMenuItem("deletetable",a),t.ui.registry.addNestedMenuItem("row",c),t.ui.registry.addNestedMenuItem("column",s),t.ui.registry.addNestedMenuItem("cell",l),t.ui.registry.addContextMenu("table",{update:function(){return n.resetTargets(),n.targets().fold(m(""),(function(t){return"caption"===Gt(t.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}});var f=Pl(ka(t));0!==f.length&&t.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return Bl(t,e,f,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)}))},onSetup:n.onSetupTable});var d=Pl(Sa(t));0!==d.length&&t.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return Bl(t,e,d,"tablecellclass",(function(e){return t.execCommand("mceTableCellToggleClass",!1,e)}))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return Bl(t,e,bl,"tablecellverticalalign",Il(t,"vertical-align"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return Bl(t,e,ha(t),"tablecellborderwidth",Il(t,"border-width"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return Bl(t,e,pa(t),"tablecellborderstyle",Il(t,"border-style"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablecaption",{icon:"table-caption",text:"Table caption",onAction:o("mceTableToggleCaption"),onSetup:n.onSetupTableWithCaption}),t.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return Hl(t,za(t),"background-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return Hl(t,Ba(t),"border-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablerowheader",{text:"Row header",icon:"table-top-header",onAction:Fl(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleMenuItem("tablecolheader",{text:"Column header",icon:"table-left-header",onAction:Vl(t),onSetup:n.onSetupTableColumnHeaders})}(t,e,n,u),function(t,e,n,r){t.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(t){return t("inserttable | cell row column | advtablesort | tableprops deletetable")}});var o=function(e){return function(){return t.execCommand(e)}};t.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:o("mceTableProps"),icon:"table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:o("mceTableDelete"),icon:"table-delete-table",onSetup:n.onSetupTable}),t.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:o("mceTableCellProps"),icon:"table-cell-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:o("mceTableMergeCells"),icon:"table-merge-cells",onSetup:n.onSetupMergeable}),t.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:o("mceTableSplitCells"),icon:"table-split-cells",onSetup:n.onSetupUnmergeable}),t.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:o("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:o("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:o("mceTableDeleteRow"),icon:"table-delete-row",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:o("mceTableRowProps"),icon:"table-row-properties",onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:o("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:n.onSetupColumn("onFirst")}),t.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:o("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:n.onSetupColumn("onLast")}),t.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:o("mceTableDeleteCol"),icon:"table-delete-column",onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:o("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:o("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),t.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:o("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:o("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(r.getRows)}),t.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:o("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:o("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),t.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:o("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onFirst")}),t.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:o("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(r.getColumns,"onLast")}),t.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:o("mceInsertTable"),icon:"table"});var i=Pl(ka(t));0!==i.length&&t.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Ll(t,e,i,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)})),onSetup:n.onSetupTable});var u=Pl(Sa(t));0!==u.length&&t.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Ll(t,e,u,"tablecellclass",(function(e){return t.execCommand("mceTableCellToggleClass",!1,e)})),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Ll(t,e,bl,"tablecellverticalalign",Il(t,"vertical-align")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Ll(t,e,ha(t),"tablecellborderwidth",Il(t,"border-width")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Ll(t,e,pa(t),"tablecellborderstyle",Il(t,"border-style")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablecaption",{tooltip:"Table caption",onAction:o("mceTableToggleCaption"),icon:"table-caption",onSetup:n.onSetupTableWithCaption}),t.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(e){return e(Hl(t,za(t),"background-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(e){return e(Hl(t,Ba(t),"border-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablerowheader",{tooltip:"Row header",icon:"table-top-header",onAction:Fl(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleButton("tablecolheader",{tooltip:"Column header",icon:"table-left-header",onAction:Vl(t),onSetup:n.onSetupTableColumnHeaders})}(t,e,n,u),function(t){var e=function(t){return t.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")}(t);e.length>0&&t.ui.registry.addContextToolbar("table",{predicate:function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},items:e,scope:"node",position:"node"})}(t),t.on("PreInit",(function(){t.serializer.addTempAttr(Ci.firstSelected),t.serializer.addTempAttr(Ci.lastSelected),function(t){t.formatter.register(yf)}(t)})),function(t){return t.getParam("table_tab_navigation",!0,"boolean")}(t)&&t.on("keydown",(function(e){!function(t,e,n){if(t.keyCode===gd.TAB){var r=li(e),o=function(t){var e=Gt(t);return kt(t,r)||A(bd,e)},i=e.selection.getRng(),u=wt.fromDom(t.shiftKey?i.startContainer:i.endContainer);en(u,o).each((function(r){t.preventDefault(),on(r,o).each(n.clear),e.selection.collapse(t.shiftKey),(t.shiftKey?pd:hd)(e,o,r).each((function(t){e.selection.setRng(t)}))}))}}(e,t,o)})),t.on("remove",(function(){r.destroy()})),function(t,e,n,r){return{insertTable:ll(t),setClipboardRows:sl(e.setRows),getClipboardRows:cl(e.getRows),setClipboardCols:sl(e.setColumns),getClipboardCols:cl(e.getColumns),resizeHandler:n,selectionTargets:r}}(t,u,r,n)};wr.add("table",Im)}()},624:function(t,e){!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},u=function(t){return function(e){return typeof e===t}},a=i("string"),c=i("object"),s=i("array"),l=(t=null,function(e){return t===e}),f=u("boolean"),d=function(t){return!function(t){return null==t}(t)},m=u("function"),g=u("number"),h=function(){},p=function(t){return function(){return t}},v=function(t){return t},b=p(!1),y=p(!0),w=function(){return x},x={fold:function(t,e){return t()},isSome:b,isNone:y,getOr:n=v,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:p(null),getOrUndefined:p(void 0),or:n,orThunk:e,map:w,each:h,bind:w,exists:b,forall:y,filter:function(){return w()},toArray:function(){return[]},toString:p("none()")},C=function(t){var e=p(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:y,isNone:b,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return C(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:x},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},S={some:C,none:w,from:function(t){return null==t?x:C(t)}},k=Object.keys,O=Object.hasOwnProperty,T=function(t,e,n,r){return function(t,e){for(var n=k(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},_=function(t,e){return O.call(t,e)},E=Array.prototype.push,A=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!s(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);E.apply(e,t[n])}return e},D=function(t){return function(t,e){return e>=0&&e<t.length?S.some(t[e]):S.none()}(t,0)};"undefined"!=typeof window?window:Function("return this;")();var M,N=function(t,e,n){!function(t,e,n){if(!(a(n)||f(n)||g(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},R=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},z={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return R(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return R(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return R(n)},fromDom:R,fromPoint:function(t,e,n){return S.from(t.dom.elementFromPoint(e,n)).map(R)}},B=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),I=tinymce.util.Tools.resolve("tinymce.util.Promise"),P=tinymce.util.Tools.resolve("tinymce.util.XHR"),L=function(t){return t.getParam("image_dimensions",!0,"boolean")},H=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},F=function(t){return t&&(t=t.replace(/px$/,"")),t},V=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},j=function(t){if(t.margin){var e=String(t.margin).split(" ");switch(e.length){case 1:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[0],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[0];break;case 2:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[0],t["margin-left"]=t["margin-left"]||e[1];break;case 3:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[1];break;case 4:t["margin-top"]=t["margin-top"]||e[0],t["margin-right"]=t["margin-right"]||e[1],t["margin-bottom"]=t["margin-bottom"]||e[2],t["margin-left"]=t["margin-left"]||e[3]}delete t.margin}return t},U=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},W=B.DOM,q=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?F(t.style.marginLeft):""},G=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?F(t.style.marginTop):""},$=function(t){return t.style.borderWidth?F(t.style.borderWidth):""},X=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},K=function(t,e){return t.style[e]?t.style[e]:""},Y=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},J=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},Q=function(t){Y(t)?function(t){var e=t.parentNode;W.insertAfter(t,e),W.remove(e)}(t):function(t){var e=W.create("figure",{class:"image"});W.insertAfter(e,t),e.appendChild(t),e.appendChild(W.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)},Z=function(t,e){var n=t.getAttribute("style"),r=e(null!==n?n:"");r.length>0?(t.setAttribute("style",r),t.setAttribute("data-mce-style",r)):t.removeAttribute("style")},tt=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=V(r),Z(t,e)):J(t,n,r)}},et=function(t,e){return t.style[e]?F(t.style[e]):X(t,e)},nt=function(t,e){var n=V(e);t.style.marginLeft=n,t.style.marginRight=n},rt=function(t,e){var n=V(e);t.style.marginTop=n,t.style.marginBottom=n},ot=function(t,e){var n=V(e);t.style.borderWidth=n},it=function(t,e){t.style.borderStyle=e},ut=function(t){return"FIGURE"===t.nodeName},at=function(t){return 0===W.getAttrib(t,"alt").length&&"presentation"===W.getAttrib(t,"role")},ct=function(t){return at(t)?"":X(t,"alt")},st=function(t,e){var n=document.createElement("img");return J(n,"style",e.style),(q(n)||""!==e.hspace)&&nt(n,e.hspace),(G(n)||""!==e.vspace)&&rt(n,e.vspace),($(n)||""!==e.border)&&ot(n,e.border),(function(t){return K(t,"borderStyle")}(n)||""!==e.borderStyle)&&it(n,e.borderStyle),t(n.getAttribute("style"))},lt=function(t,e){return{src:X(e,"src"),alt:ct(e),title:X(e,"title"),width:et(e,"width"),height:et(e,"height"),class:X(e,"class"),style:t(X(e,"style")),caption:Y(e),hspace:q(e),vspace:G(e),border:$(e),borderStyle:K(e,"borderStyle"),isDecorative:at(e)}},ft=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},dt=function(t,e,n){if(n){W.setAttrib(t,"role","presentation");var r=z.fromDom(t);N(r,"alt","")}else{if(l(e)){r=z.fromDom(t);o="alt",r.dom.removeAttribute(o)}else{r=z.fromDom(t);N(r,"alt",e)}"presentation"===W.getAttrib(t,"role")&&W.setAttrib(t,"role","")}var o},mt=function(t,e){return function(n,r,o){t(n,o),Z(n,e)}},gt=function(t,e,n){var r=lt(t,n);ft(n,r,e,"caption",(function(t,e,n){return Q(t)})),ft(n,r,e,"src",J),ft(n,r,e,"title",J),ft(n,r,e,"width",tt(0,t)),ft(n,r,e,"height",tt(0,t)),ft(n,r,e,"class",J),ft(n,r,e,"style",mt((function(t,e){return J(t,"style",e)}),t)),ft(n,r,e,"hspace",mt(nt,t)),ft(n,r,e,"vspace",mt(rt,t)),ft(n,r,e,"border",mt(ot,t)),ft(n,r,e,"borderStyle",mt(it,t)),function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||dt(t,n.alt,n.isDecorative)}(n,r,e)},ht=function(t,e){var n=t.dom.styles.parse(e),r=j(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},pt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return n?t.dom.select("img",n)[0]:e&&("IMG"!==e.nodeName||U(e))?null:e},vt=function(t,e){var n=t.dom,r=function(t,e){var n,r={};return T(t,e,(n=r,function(t,e){n[e]=t}),h),r}(t.schema.getTextBlockElements(),(function(e,n){return!t.schema.isValidChild(n,"figure")})),o=n.getParent(e.parentNode,(function(t){return e=r,n=t.nodeName,_(e,n)&&void 0!==e[n]&&null!==e[n];var e,n}),t.getBody());return o?n.split(o,e):e},bt=function(t,e){var n=function(t,e){var n=document.createElement("img");if(gt(t,o(o({},e),{caption:!1}),n),dt(n,e.alt,e.isDecorative),e.caption){var r=W.create("figure",{class:"image"});return r.appendChild(n),r.appendChild(W.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}((function(e){return ht(t,e)}),e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),ut(r)){var i=vt(t,r);t.selection.select(i)}else t.selection.select(r)},yt=function(t,e){var n=pt(t);if(gt((function(e){return ht(t,e)}),e,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(t,n),ut(n.parentNode)){var r=n.parentNode;vt(t,r),t.selection.select(n.parentNode)}else t.selection.select(n),function(t,e,n){var r=function(){n.onload=n.onerror=null,t.selection&&(t.selection.select(n),t.nodeChanged())};n.onload=function(){e.width||e.height||!L(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r}(t,e,n)},wt=(M=function(t,e){return c(t)&&c(e)?wt(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)_(o,i)&&(n[i]=M(n[i],o[i]))}return n}),xt=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Ct=tinymce.util.Tools.resolve("tinymce.util.Tools"),St=function(t){return a(t.value)?t.value:""},kt=function(t,e){var n=[];return Ct.each(t,(function(t){var r=function(t){return a(t.text)?t.text:a(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=kt(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},Ot=function(t){return void 0===t&&(t=St),function(e){return e?S.from(e).map((function(e){return kt(e,t)})):S.none()}},Tt=function(t,e){return function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return S.none()}(t,(function(t){return function(t){return _(t,"items")}(t)?Tt(t.items,e):t.value===e?S.some(t):S.none()}))},_t=Ot,Et=function(t){return Ot(St)(t)},At=function(t,e){return t.bind((function(t){return Tt(t,e)}))},Dt=function(t){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},Mt=function(t){var e=_t((function(e){return t.convertURL(e.value||e.url,"src")})),n=new I((function(n){!function(t,e){var n=function(t){return t.getParam("image_list",!1)}(t);a(n)?P.send({url:n,success:function(t){e(JSON.parse(t))}}):m(n)?n(e):e(n)}(t,(function(t){n(e(t).map((function(t){return A([[{text:"None",value:""}],t])})))}))})),r=Et(function(t){return t.getParam("image_class_list")}(t)),o=function(t){return t.getParam("image_advtab",!1,"boolean")}(t),i=function(t){return t.getParam("image_uploadtab",!0,"boolean")}(t),u=function(t){return d(t.getParam("images_upload_url"))}(t),c=function(t){return d(t.getParam("images_upload_handler"))}(t),s=function(t){var e=pt(t);return e?lt((function(e){return ht(t,e)}),e):{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}(t),l=function(t){return t.getParam("image_description",!0,"boolean")}(t),f=function(t){return t.getParam("image_title",!1,"boolean")}(t),g=L(t),h=function(t){return t.getParam("image_caption",!1,"boolean")}(t),p=function(t){return t.getParam("a11y_advanced_options",!1,"boolean")}(t),v=function(t){return t.getParam("automatic_uploads",!0,"boolean")}(t),b=S.some(function(t){return t.getParam("image_prepend_url","","string")}(t)).filter((function(t){return a(t)&&t.length>0}));return n.then((function(t){return{image:s,imageList:t,classList:r,hasAdvTab:o,hasUploadTab:i,hasUploadUrl:u,hasUploadHandler:c,hasDescription:l,hasImageTitle:f,hasDimensions:g,hasImageCaption:h,prependURL:b,hasAccessibilityOptions:p,automaticUploads:v}}))},Nt=function(t){var e,n=t.imageList.map((function(t){return{name:"images",type:"listbox",label:"Image list",items:t}})),r={name:"alt",type:"input",label:"Alternative description",disabled:t.hasAccessibilityOptions&&t.image.isDecorative},i=t.classList.map((function(t){return{name:"classes",type:"listbox",label:"Class",items:t}}));return A([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],n.toArray(),t.hasAccessibilityOptions&&t.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],t.hasDescription?[r]:[],t.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],t.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[o(o({},(e=t.classList.isSome()&&t.hasImageCaption,e?{type:"grid",columns:2}:{type:"panel"})),{items:A([i.toArray(),t.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])})]])},Rt=function(t){return{title:"General",name:"general",items:Nt(t)}},zt=Nt,Bt=function(t){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},It=function(t){return{src:{value:t.src,meta:{}},images:t.src,alt:t.alt,title:t.title,dimensions:{width:t.width,height:t.height},classes:t.class,caption:t.caption,style:t.style,vspace:t.vspace,border:t.border,hspace:t.hspace,borderstyle:t.borderStyle,fileinput:[],isDecorative:t.isDecorative}},Pt=function(t,e){return{src:t.src.value,alt:0===t.alt.length&&e?null:t.alt,title:t.title,width:t.dimensions.width,height:t.dimensions.height,class:t.classes,style:t.style,caption:t.caption,hspace:t.hspace,vspace:t.vspace,border:t.border,borderStyle:t.borderstyle,isDecorative:t.isDecorative}},Lt=function(t,e){var n=e.getData();(function(t,e){return/^(?:[a-zA-Z]+:)?\/\//.test(e)?S.none():t.prependURL.bind((function(t){return e.substring(0,t.length)!==t?S.some(t+e):S.none()}))})(t,n.src.value).each((function(t){e.setData({src:{value:t,meta:n.src.meta}})}))},Ht=function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=wt({},n);!function(t,e,n){t.hasDescription&&a(n.alt)&&(e.alt=n.alt),t.hasAccessibilityOptions&&(e.isDecorative=n.isDecorative||e.isDecorative||!1),t.hasImageTitle&&a(n.title)&&(e.title=n.title),t.hasDimensions&&(a(n.width)&&(e.dimensions.width=n.width),a(n.height)&&(e.dimensions.height=n.height)),a(n.class)&&At(t.classList,n.class).each((function(t){e.classes=t.value})),t.hasImageCaption&&f(n.caption)&&(e.caption=n.caption),t.hasAdvTab&&(a(n.style)&&(e.style=n.style),a(n.vspace)&&(e.vspace=n.vspace),a(n.border)&&(e.border=n.border),a(n.hspace)&&(e.hspace=n.hspace),a(n.borderstyle)&&(e.borderstyle=n.borderstyle))}(t,o,r),e.setData(o)}},Ft=function(t,e,n,r){Lt(e,r),Ht(e,r),function(t,e,n,r){var o=r.getData(),i=o.src.value,u=o.src.meta||{};u.width||u.height||!e.hasDimensions||(i.length>0?t.imageSize(i).then((function(t){n.open&&r.setData({dimensions:t})})).catch((function(t){return console.error(t)})):r.setData({dimensions:{width:"",height:""}}))}(t,e,n,r),function(t,e,n){var r=n.getData(),o=At(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map((function(t){return t.value})).getOr("")})}(e,n,r)},Vt=function(t,e,n){var r=j(t(n.style)),o=wt({},n);return o.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?F(String(t["margin-top"])):""}(r),o.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?F(String(t["margin-right"])):""}(r),o.border=function(t){return t["border-width"]?F(String(t["border-width"])):""}(r),o.borderstyle=function(t){return t["border-style"]?String(t["border-style"]):""}(r),o.style=function(t,e,n){return e(t(e(n)))}(t,e,r),o},jt=function(t,e,n,r){var o=r.getData();r.block("Uploading image"),D(o.fileinput).fold((function(){r.unblock()}),(function(o){var i,u=URL.createObjectURL(o),a=function(){r.unblock(),URL.revokeObjectURL(u)},c=function(o){r.setData({src:{value:o,meta:{}}}),r.showTab("general"),Ft(t,e,n,r)};(i=o,new I((function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(){e(n.error.message)},n.readAsDataURL(i)}))).then((function(n){var i=t.createBlobCache(o,u,n);e.automaticUploads?t.uploadImage(i).then((function(t){c(t.url),a()})).catch((function(e){a(),t.alertErr(e)})):(t.addToBlobCache(i),c(i.blobUri()),r.unblock())}))}))},Ut=function(t,e,n){return function(r,o){"src"===o.name?Ft(t,e,n,r):"images"===o.name?function(t,e,n,r){var o=r.getData(),i=At(e.imageList,o.images);i.each((function(t){""===o.alt||n.prevImage.map((function(t){return t.text===o.alt})).getOr(!1)?""===t.value?r.setData({src:t,alt:n.prevAlt}):r.setData({src:t,alt:t.text}):r.setData({src:t})})),n.prevImage=i,Ft(t,e,n,r)}(t,e,n,r):"alt"===o.name?n.prevAlt=r.getData().alt:"style"===o.name?function(t,e){var n=e.getData(),r=Vt(t.parseStyle,t.serializeStyle,n);e.setData(r)}(t,r):"vspace"===o.name||"hspace"===o.name||"border"===o.name||"borderstyle"===o.name?function(t,e,n){var r=wt(It(e.image),n.getData()),o=st(t.normalizeCss,Pt(r,!1));n.setData({style:o})}(t,e,r):"fileinput"===o.name?jt(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},Wt=function(t){return function(){t.open=!1}},qt=function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:A([[Rt(t)],t.hasAdvTab?[Dt(t)]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[Bt(t)]:[]])}:{type:"panel",items:zt(t)}},Gt=function(t){return function(e){var n=function(t){return{prevImage:At(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(e);return{title:"Insert/Edit Image",size:"normal",body:qt(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:It(e.image),onSubmit:t.onSubmit(e),onChange:Ut(t,e,n),onClose:Wt(n)}}},$t=function(t){return function(e){return function(n){var r=wt(It(e.image),n.getData());t.execCommand("mceUpdateImage",!1,Pt(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}},Xt=function(t){return function(e){return function(t){return new I((function(e){var n=document.createElement("img"),r=function(t){n.onload=n.onerror=null,n.parentNode&&n.parentNode.removeChild(n),e(t)};n.onload=function(){var t={width:H(n.width,n.clientWidth),height:H(n.height,n.clientHeight)};r(I.resolve(t))},n.onerror=function(){r(I.reject("Failed to get image dimensions for: "+t))};var o=n.style;o.visibility="hidden",o.position="fixed",o.bottom=o.left="0px",o.width=o.height="auto",document.body.appendChild(n),n.src=t}))}(t.documentBaseURI.toAbsolute(e)).then((function(t){return{width:String(t.width),height:String(t.height)}}))}},Kt=function(t){return function(e,n,r){return t.editorUpload.blobCache.create({blob:e,blobUri:n,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:r.split(",")[1]})}},Yt=function(t){return function(e){t.editorUpload.blobCache.add(e)}},Jt=function(t){return function(e){t.windowManager.alert(e)}},Qt=function(t){return function(e){return ht(t,e)}},Zt=function(t){return function(e){return t.dom.parseStyle(e)}},te=function(t){return function(e,n){return t.dom.serializeStyle(e,n)}},ee=function(t){return function(e){return xt(t).upload([e],!1).then((function(t){return 0===t.length?I.reject("Failed to upload image"):!1===t[0].status?I.reject(t[0].error.message):t[0]}))}},ne=function(t){var e={onSubmit:$t(t),imageSize:Xt(t),addToBlobCache:Yt(t),createBlobCache:Kt(t),alertErr:Jt(t),normalizeCss:Qt(t),parseStyle:Zt(t),serializeStyle:te(t),uploadImage:ee(t)};return{open:function(){Mt(t).then(Gt(e)).then(t.windowManager.open)}}},re=function(t){t.addCommand("mceImage",ne(t).open),t.addCommand("mceUpdateImage",(function(e,n){t.undoManager.transact((function(){return function(t,e){var n=pt(t);if(n){var r=lt((function(e){return ht(t,e)}),n),i=o(o({},r),e);i.src?yt(t,i):function(t,e){if(e){var n=t.dom.is(e.parentNode,"figure.image")?e.parentNode:e;t.dom.remove(n),t.focus(),t.nodeChanged(),t.dom.isEmpty(t.getBody())&&(t.setContent(""),t.selection.setCursorLocation())}}(t,n)}else e.src&&bt(t,o(o({},{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),e))}(t,n)}))}))},oe=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},ie=function(t){return function(e){for(var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};n--;){var o=e[n];oe(o)&&(o.attr("contenteditable",t?"false":null),Ct.each(o.getAll("figcaption"),r))}}};r.add("image",(function(t){!function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("figure",ie(!0)),t.serializer.addNodeFilter("figure",ie(!1))}))}(t),function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ne(t).open,onSetup:function(e){return t.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),t.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:ne(t).open}),t.ui.registry.addContextMenu("image",{update:function(t){return ut(t)||"IMG"===t.nodeName&&!U(t)?["image"]:[]}})}(t),re(t)}))}()},625:function(t,e){!function(){"use strict";var t,e,n,r=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=(t="array",function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}),a=function(t){return!function(t){return null==t}(t)},c=function(t){return function(e){return typeof e===t}}("function"),s=function(){},l=function(t){return function(){return t}},f=function(t){return t},d=l(!1),m=l(!0),g=function(){return h},h={fold:function(t,e){return t()},isSome:d,isNone:m,getOr:n=f,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:n,orThunk:e,map:g,each:s,bind:g,exists:d,forall:m,filter:function(){return g()},toArray:function(){return[]},toString:l("none()")},p=function(t){var e=l(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:m,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return p(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:h},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},v={some:p,none:g,from:function(t){return null==t?h:p(t)}},b=function(t,e){return x(document.createElement("canvas"),t,e)},y=function(t){var e=b(t.width,t.height);return w(e).drawImage(t,0,0),e},w=function(t){return t.getContext("2d")},x=function(t,e,n){return t.width=e,t.height=n,t},C=window.Promise?window.Promise:function(){var t=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(u,this),r(a,this))},e=window,n=t.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){return setTimeout(t,1)},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.apply(e,n)}},o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n((function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)})):this._deferreds.push(t)}function u(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(u,this),r(a,this))}this._state=!0,this._value=t,c.call(this)}catch(t){a.call(this,t)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function s(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}var l=function(t,e,n){var r=!1;try{t((function(t){r||(r=!0,e(t))}),(function(t){r||(r=!0,n(t))}))}catch(t){if(r)return;r=!0,n(t)}};return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){i.call(r,new s(e,n,t,o))}))},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t((function(t,e){if(0===r.length)return t([]);for(var n=r.length,o=function(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,(function(t){o(i,t)}),e)}r[i]=u,0==--n&&t(r)}catch(t){e(t)}},i=0;i<r.length;i++)o(i,r[i])}))},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=0,o=e;r<o.length;r++){o[r].then(t,n)}}))},t}(),S=function(t){return new C((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",u),o.removeEventListener("error",a)},u=function(){i(),e(o)},a=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",u),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(u,0)}))},k=function(t){return new C((function(e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="blob",r.onload=function(){200===this.status&&e(this.response)},r.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},r.send()}))},O=function(t){return new C((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return v.none();for(var r=n[1],o=e[1],i=atob(o),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var l=1024*s,f=Math.min(l+1024,u),d=new Array(f-l),m=l,g=0;m<f;++g,++m)d[g]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return v.some(new Blob(c,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))},T=function(t,e,n){return e=e||"image/png",c(HTMLCanvasElement.prototype.toBlob)?new C((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):O(t.toDataURL(e,n))},_=function(t){URL.revokeObjectURL(t.src)},E=function(t){return function(t){var e=t.src;return 0===e.indexOf("data:")?O(e):k(e)}(t)},A=Array.prototype.indexOf,D=function(t,e){return n=t,r=e,A.call(n,r)>-1;var n,r},M=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},N=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return v.some(i);if(n(i,r))break}return v.none()}(t,e,d)},R=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},z=Object.keys;(function(t){if(!u(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};M(t,(function(r,o){var i=z(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],c=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!u(c))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+i);var u=function(t){var r=z(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!R(e,(function(t){return D(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)};return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);var i=e[o];return i.apply(null,n)},match:u,log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}}))})([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var B=function(t,e,n){var r=e.type,o=l(r),i=l(n),u=function(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))};return{getType:o,toBlob:function(){return C.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return T(t,e,n)}))},toAdjustedDataURL:u,toAdjustedBase64:function(t,e){return u(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(y)}}},I=function(t){return function(t){return new C((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return B(function(t){return S(t).then((function(t){_(t);var e=b(function(t){return t.naturalWidth||t.width}(t),function(t){return t.naturalHeight||t.height}(t));return w(e).drawImage(t,0,0),e}))}(t),t,e)}))},P=function(t,e){return T(t,e).then((function(e){return B(C.resolve(t),e,t.toDataURL())}))},L=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},H=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,u=Math.sin(r),a=Math.cos(r),c=L(Math.abs(o*a)+Math.abs(i*u)),s=L(Math.abs(o*u)+Math.abs(i*a)),l=b(c,s),f=w(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),P(l,e)},F=function(t,e,n){var r=b(t.width,t.height),o=w(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),P(r,e)},V=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return F(n,t.getType(),e)}))}(t,e)},j=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return H(n,t.getType(),e)}))}(t,e)},U=function(t,e,n){return void 0===n&&(n=!1),new C((function(r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&r({status:o.status,blob:o.response})},o.open("GET",t,!0),o.withCredentials=n,function(t,e){for(var n=z(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(e,(function(t,e){o.setRequestHeader(e,t)})),o.responseType="blob",o.send()}))},W=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],q=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],G=function(t,e){var n,r,o=(n=function(t,e){return a(t)?t[e]:void 0},r=t,M(e,(function(t,e){r=n(r,t,e)})),r);return v.from(o)},$=function(t){var e=function(t){return"ImageProxy HTTP error: "+N(W,(function(e){return t===e.code})).fold(l("Unknown ImageProxy error"),(function(t){return t.message}))}(t);return C.reject(e)},X=function(t){return N(q,(function(e){return e.type===t})).fold(l("Unknown service error"),(function(t){return t.message}))},K=function(t){return"ImageProxy Service error: "+function(t){try{return v.some(JSON.parse(t))}catch(t){return v.none()}}(t).bind((function(t){return G(t,["error","type"]).map(X)})).getOr("Invalid JSON in service error message")},Y=function(t){return function(t){return new C((function(e,n){var r=new FileReader;r.onload=function(){e(r.result)},r.onerror=function(t){n(t)},r.readAsText(t)}))}(t).then((function(t){var e=K(t);return C.reject(e)}))},J=function(t){return t<200||t>=300},Q=function(t,e){var n={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return U(function(t,e){var n=-1===t.indexOf("?")?"?":"&";return/[?&]apiKey=/.test(t)?t:t+n+"apiKey="+encodeURIComponent(e)}(t,e),n).then((function(t){return J(t.status)?(e=t.status,n=t.blob,function(t,e){return"application/json"===(null==e?void 0:e.type)&&(400===t||403===t||404===t||500===t)}(e,n)?Y(n):$(e)):C.resolve(t.blob);var e,n}))},Z=function(t,e,n){return void 0===n&&(n=!1),e?Q(t,e):function(t,e){return U(t,{},e).then((function(t){return J(t.status)?$(t.status):C.resolve(t.blob)}))}(t,n)},tt=function(t){return I(t)},et=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},nt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return et(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return et(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return et(n)},fromDom:et,fromPoint:function(t,e,n){return v.from(t.dom.elementFromPoint(e,n)).map(et)}};"undefined"!=typeof window?window:Function("return this;")();var rt=function(t,e){return function(t,e){return N(t.dom.childNodes,(function(t){return e(nt.fromDom(t))})).map(nt.fromDom)}(t,(function(t){return function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(t,e)}))},ot=tinymce.util.Tools.resolve("tinymce.util.Delay"),it=tinymce.util.Tools.resolve("tinymce.util.Promise"),ut=tinymce.util.Tools.resolve("tinymce.util.URI"),at=function(t){return t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")},ct=function(t){return t.getParam("imagetools_proxy")},st=function(t){var e,n,r=function(t){return/^[0-9\.]+px$/.test(t)};return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)},lt=function(t){return{w:t.naturalWidth,h:t.naturalHeight}},ft=0,dt=function(t){return rt(nt.fromDom(t),"img")},mt=function(t,e){return t.dom.is(e,"figure")},gt=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")},ht=function(t,e){var n=function(e){return gt(t,e)&&(yt(t,e)||wt(t,e)||a(ct(t)))};return mt(t,e)?dt(e).bind((function(t){return n(t.dom)?v.some(t.dom):v.none()})):n(e)?v.some(e):v.none()},pt=function(t,e){t.notificationManager.open({text:e,type:"error"})},vt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&mt(t,n)?dt(n):gt(t,e)?v.some(nt.fromDom(e)):v.none()},bt=function(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return a(r)?t.dom.encode(r[n]):null},yt=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new ut(n).host===t.documentBaseURI.host},wt=function(t,e){return-1!==i.inArray(function(t){return t.getParam("imagetools_cors_hosts",[],"string[]")}(t),new ut(e.src).host)},xt=function(t,e){if(wt(t,e))return Z(e.src,null,function(t,e){return-1!==i.inArray(function(t){return t.getParam("imagetools_credentials_hosts",[],"string[]")}(t),new ut(e.src).host)}(t,e));if(!yt(t,e)){var n=ct(t),r=n+(-1===n.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),o=function(t){return t.getParam("api_key",t.getParam("imagetools_api_key","","string"),"string")}(t);return Z(r,o,!1)}return E(e)},Ct=function(t,e){return function(t){return v.from(t.getParam("imagetools_fetch_image",null,"function"))}(t).fold((function(){return xt(t,e)}),(function(t){return t(e)}))},St=function(t,e){var n=t.editorUpload.blobCache.getByUri(e.src);return n?it.resolve(n.blob()):Ct(t,e)},kt=function(t){ot.clearTimeout(t.get())},Ot=function(t,e,n,r,o,i,u){return n.toBlob().then((function(c){var s,l,f,d,m=t.editorUpload.blobCache;s=i.src;var g=e.type===c.type;return function(t){return t.getParam("images_reuse_filename",!1,"boolean")}(t)&&(d=m.getByUri(s),a(d)?(s=d.uri(),l=d.name(),f=d.filename()):(l=bt(t,s,2),f=bt(t,s,1))),d=m.create({id:"imagetools"+ft++,blob:c,base64:n.toBase64(),uri:s,name:l,filename:g?f:void 0}),m.add(d),t.undoManager.transact((function(){var e=function(){t.$(i).off("load",e),t.nodeChanged(),r?t.editorUpload.uploadImagesAuto():(kt(o),function(t,e){var n=ot.setEditorTimeout(t,(function(){t.editorUpload.uploadImagesAuto()}),function(t){return t.getParam("images_upload_timeout",3e4,"number")}(t));e.set(n)}(t,o))};t.$(i).on("load",e),u&&t.$(i).attr({width:u.w,height:u.h}),t.$(i).attr({src:d.blobUri()}).removeAttr("data-mce-src")})),d}))},Tt=function(t,e,n,r){return function(){return vt(t).fold((function(){pt(t,"Could not find selected image")}),(function(o){return t._scanForImages().then((function(){return St(t,o.dom)})).then((function(i){return tt(i).then(n).then((function(n){return Ot(t,i,n,!1,e,o.dom,r)}))})).catch((function(e){pt(t,e)}))}))}},_t=function(t,e,n){return function(){var r=vt(t).map((function(t){var e=st(t.dom);return e?{w:e.h,h:e.w}:null})).getOrNull();return Tt(t,e,(function(t){return j(t,n)}),r)()}},Et=function(t,e,n){return function(){return Tt(t,e,(function(t){return V(t,n)}))()}},At=function(t,e,n,r,o){return function(t){return S(t)}(o).then((function(t){var e=lt(t);return r.w===e.w&&r.h===e.h||st(n)&&function(t,e){var n,r;e&&(n=t.style.width,r=t.style.height,(n||r)&&(t.style.width=e.w+"px",t.style.height=e.h+"px",t.removeAttribute("data-mce-style")),n=t.width,r=t.height,(n||r)&&(t.setAttribute("width",String(e.w)),t.setAttribute("height",String(e.h))))}(n,e),URL.revokeObjectURL(t.src),o})).then(tt).then((function(r){return Ot(t,o,r,!0,e,n)}))},Dt=function(t,e){return function(){var n=vt(t),r=n.map((function(t){return lt(t.dom)}));n.each((function(o){ht(t,o.dom).each((function(i){St(t,o.dom).then((function(o){var i=function(t){return{blob:t,url:URL.createObjectURL(t)}}(o);t.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:i}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(o){var i=o.getData().imagetools.blob;n.each((function(n){r.each((function(r){At(t,e,n.dom,r,i)}))})),o.close()},onCancel:s,onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})}))}))}))}};o.add("imagetools",(function(t){var e=r(0),n=r(null);!function(t,e){i.each({mceImageRotateLeft:_t(t,e,-90),mceImageRotateRight:_t(t,e,90),mceImageFlipVertical:Et(t,e,"v"),mceImageFlipHorizontal:Et(t,e,"h"),mceEditImage:Dt(t,e)},(function(e,n){t.addCommand(n,e)}))}(t,e),function(t){var e=[],n=function(e){return function(){return t.execCommand(e)}},r=function(){return vt(t).exists((function(e){return ht(t,e.dom).isSome()}))},o=function(t){var n=function(e){return t.setDisabled(!e)};return n(r()),e=e.concat([n]),function(){e=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(e,(function(t){return t!==n}))}};t.on("NodeChange",(function(){var t=r();M(e,(function(e){return e(t)}))})),t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft"),onSetup:o}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight"),onSetup:o}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical"),onSetup:o}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal"),onSetup:o}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:o}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:n("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(e){return ht(t,e).map((function(t){return{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}})).toArray()}})}(t),function(t){t.ui.registry.addContextToolbar("imagetools",{items:at(t),predicate:function(e){return ht(t,e).isSome()},position:"node",scope:"node"})}(t),function(t,e,n){t.on("NodeChange",(function(r){var o=n.get(),i=ht(t,r.element);o&&!i.exists((function(t){return o.src===t.src}))&&(kt(e),t.editorUpload.uploadImagesAuto(),n.set(null)),i.each(n.set)}))}(t,e,n)}))}()},626:function(t,e){!function(){"use strict";var t,e,n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},u=function(t){return function(e){return typeof e===t}},a=i("string"),c=i("array"),s=(t=null,function(e){return t===e}),l=u("boolean"),f=u("function"),d=function(){},m=function(t){return function(){return t}},g=function(t){return t},h=function(t,e){return t===e},p=m(!1),v=m(!0),b=function(){return y},y={fold:function(t,e){return t()},isSome:p,isNone:v,getOr:n=g,getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(void 0),or:n,orThunk:e,map:b,each:d,bind:b,exists:p,forall:v,filter:function(){return b()},toArray:function(){return[]},toString:m("none()")},w=function(t){var e=m(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:v,isNone:p,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return w(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:y},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},x={some:w,none:b,from:function(t){return null==t?y:w(t)}},C=Array.prototype.indexOf,S=Array.prototype.push,k=function(t,e){return function(t,e){return C.call(t,e)}(t,e)>-1},O=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);S.apply(e,t[n])}return e},T=function(t,e){return O(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t,e))},_=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return x.none()},E=function(t,e,n){return void 0===n&&(n=h),t.exists((function(t){return n(t,e)}))},A=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},D=function(t,e){return t?x.some(e):x.none()},M=function(t){var e=t.getParam("link_assume_external_targets",!1);return l(e)&&e?1:!a(e)||"http"!==e&&"https"!==e?0:e},N=function(t){return t.getParam("default_link_target")},R=function(t){return t.getParam("target_list",!0)},z=function(t){return t.getParam("rel_list",[],"array")},B=function(t){return t.getParam("link_title",!0,"boolean")},I=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},P=function(t){return t.getParam("link_default_protocol","http","string")},L=tinymce.util.Tools.resolve("tinymce.util.Tools"),H=function(t){return a(t.value)?t.value:""},F=function(t,e){var n=[];return L.each(t,(function(t){var r=function(t){return a(t.text)?t.text:a(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=F(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},V=function(t){return void 0===t&&(t=H),function(e){return x.from(e).map((function(e){return F(e,t)}))}},j={sanitize:function(t){return V(H)(t)},sanitizeWith:V,createUi:function(t,e){return function(n){return{name:t,type:"listbox",label:e,items:n}}},getValue:H},U=function(){return(U=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},W=Object.keys,q=Object.hasOwnProperty,G=function(t,e,n,r){return function(t,e){for(var n=W(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},$=function(t,e){return q.call(t,e)},X=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),K=function(t){return t&&"a"===t.nodeName.toLowerCase()},Y=function(t){return K(t)&&!!Z(t)},J=function(t,e){if(t.collapsed)return[];var n=t.cloneContents(),r=new X(n.firstChild,n),o=[],i=n.firstChild;do{e(i)&&o.push(i)}while(i=r.next());return o},Q=function(t){return/^\w+:/i.test(t)},Z=function(t){var e=t.getAttribute("data-mce-href");return e||t.getAttribute("href")},tt=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===L.inArray(n,t)}))},i=e?function(t){return(t=o(t)).length>0?t.concat(n):n}(r):o(r);return i.length>0?function(t){return L.trim(t.sort().join(" "))}(i):""},et=function(t,e){return e=e||t.selection.getNode(),it(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},nt=function(t,e){return function(t){return t.replace(/\uFEFF/g,"")}(e?e.innerText||e.textContent:t.getContent({format:"text"}))},rt=function(t){return L.grep(t,Y).length>0},ot=function(t){var e=t.schema.getTextInlineElements();return 0===J(t.selection.getRng(),(function(t){return 1===t.nodeType&&!K(t)&&!$(e,t.nodeName.toLowerCase())})).length},it=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},ut=function(t,e){var n=U({},e);if(!(z(t).length>0)&&!1===I(t)){var r=tt(n.rel,"_blank"===n.target);n.rel=r||null}return x.from(n.target).isNone()&&!1===R(t)&&(n.target=N(t)),n.href=function(t,e){return"http"!==e&&"https"!==e||Q(t)?t:e+"://"+t}(n.href,M(t)),n},at=function(t,e,n){var r=t.selection.getNode(),o=et(t,r),i=ut(t,function(t){return function(t,e,n){return function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}}(t,(function(t,r){n=e(n,t,r)})),n}(["title","rel","class","target"],(function(e,n){return t[n].each((function(t){e[n]=t.length>0?t:null})),e}),{href:t.href})}(n));t.undoManager.transact((function(){n.href===e.href&&e.attach(),o?(t.focus(),function(t,e,n,r){n.each((function(t){$(e,"innerText")?e.innerText=t:e.textContent=t})),t.dom.setAttribs(e,r),t.selection.select(e)}(t,o,n.text,i)):function(t,e,n,r){it(e)?dt(t,e,r):n.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))}))}(t,r,n.text,i)}))},ct=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return function(t,e){var n,r={};return G(t,e,(n=r,function(t,e){n[e]=t}),d),r}({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()},(function(t,e){return!1===s(t)}))},st=function(t,e,n){t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,ct(n)):at(t,e,n)},lt=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var e=t.selection.getNode();it(e)?ft(t,e):function(t){var e=t.dom,n=t.selection,r=n.getBookmark(),o=n.getRng().cloneRange(),i=e.getParent(o.startContainer,"a[href]",t.getBody()),u=e.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),n.setRng(o),t.execCommand("unlink"),n.moveToBookmark(r)}(t),t.focus()}))}(t)},ft=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},dt=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},mt=function(t){return $(e=t,n="items")&&void 0!==e[n]&&null!==e[n];var e,n},gt=function(t,e){return _(e,(function(e){return mt(e)?gt(t,e.items):D(e.value===t,e)}))},ht=function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?gt(o,n).map((function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:d}},text:i?t:e.text}})):x.none()},pt=function(t,e){var n={text:t.text,title:t.title},r=function(t){var e,r=(e=t.url,D(n.text.length<=0,x.from(e.meta.text).getOr(e.value))),o=function(t){return D(n.title.length<=0,x.from(t.meta.title).getOr(""))}(t.url);return r.isSome()||o.isSome()?x.some(U(U({},r.map((function(t){return{text:t}})).getOr({})),o.map((function(t){return{title:t}})).getOr({}))):x.none()},o=function(t,r){var o,i,u=(o=e,i=r.name,"link"===i?o.link:"anchor"===i?o.anchor:x.none()).getOr([]);return ht(n.text,r.name,u,t)};return{onChange:function(t,e){var i=e.name;return"url"===i?r(t()):k(["anchor","link"],i)?o(t(),e):"text"===i||"title"===i?(n[i]=t()[i],x.none()):x.none()}}},vt=tinymce.util.Tools.resolve("tinymce.util.Delay"),bt=tinymce.util.Tools.resolve("tinymce.util.Promise"),yt=function(t){var e=t.href;return e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:")?x.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return U(U({},t),{href:"mailto:"+e})}}):x.none()},wt=function(t,e){return function(n){var r=n.href;return 1===t&&!Q(r)||0===t&&/^\s*www(\.|\d\.)/i.test(r)?x.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return U(U({},t),{href:e+"://"+r})}}):x.none()}},xt=function(t,e){return _([yt,wt(M(t),P(t))],(function(t){return t(e)})).fold((function(){return bt.resolve(e)}),(function(n){return new bt((function(r){!function(t,e,n){var r=t.selection.getRng();vt.setEditorTimeout(t,(function(){t.windowManager.confirm(e,(function(e){t.selection.setRng(r),n(e)}))}))}(t,n.message,(function(t){r(t?n.preprocess(e):e)}))}))}))},Ct=function(t){var e=t.dom.select("a:not([href])"),n=T(e,(function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]}));return n.length>0?x.some([{text:"None",value:""}].concat(n)):x.none()},St=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?j.sanitize(e):x.none()},kt=tinymce.util.Tools.resolve("tinymce.util.XHR"),Ot=function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=function(t){return t.getParam("link_list")}(t);return new bt((function(t){a(n)?kt.send({url:n,success:function(e){return t(function(t){try{return x.some(JSON.parse(t))}catch(t){return x.none()}}(e))},error:function(e){return t(x.none())}}):f(n)?n((function(e){return t(x.some(e))})):t(x.from(n))})).then((function(t){return t.bind(j.sanitizeWith(e)).map((function(t){if(t.length>0){return[{text:"None",value:""}].concat(t)}return t}))}))},Tt=function(t,e){var n=z(t);if(n.length>0){var r=E(e,"_blank");return(!1===I(t)?j.sanitizeWith((function(t){return tt(j.getValue(t),r)})):j.sanitize)(n)}return x.none()},_t=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Et=function(t){var e=R(t);return c(e)?j.sanitize(e).orThunk((function(){return x.some(_t)})):!1===e?x.none():x.some(_t)},At=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?x.some(r):x.none()},Dt=function(t,e){return Ot(t).then((function(n){var r=function(t,e){var n=t.dom,r=ot(t)?x.some(nt(t.selection,e)):x.none(),o=e?x.some(n.getAttrib(e,"href")):x.none(),i=e?x.from(n.getAttrib(e,"target")):x.none(),u=At(n,e,"rel"),a=At(n,e,"class");return{url:o,text:r,title:At(n,e,"title"),target:i,rel:u,linkClass:a}}(t,e);return{anchor:r,catalogs:{targets:Et(t),rels:Tt(t,r.target),classes:St(t),anchor:Ct(t),link:n},optNode:x.from(e),flags:{titleEnabled:B(t)}}}))},Mt=function(t){(function(t){var e=et(t);return Dt(t,e)})(t).then((function(e){return function(t,e,n){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,e){var n=t.anchor,r=n.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:n.text.getOr(""),title:n.title.getOr(""),anchor:r,link:r,rel:n.rel.getOr(""),target:n.target.or(e).getOr(""),linkClass:n.linkClass.getOr("")}}(t,x.from(N(n))),u=t.catalogs,a=pt(i,u);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:O([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,A([u.anchor.map(j.createUi("anchor","Anchors")),u.rels.map(j.createUi("rel","Rel")),u.targets.map(j.createUi("target","Open link in...")),u.link.map(j.createUi("link","Link list")),u.classes.map(j.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,e){var n=e.name;a.onChange(t.getData,{name:n}).each((function(e){t.setData(e)}))},onSubmit:e}}(e,function(t,e){return function(n){var r=n.getData();if(!r.url.value)return lt(t),void n.close();var o=function(t){return x.from(r[t]).filter((function(n){return!E(e.anchor[t],n)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:d};xt(t,i).then((function(e){st(t,u,e)})),n.close()}}(t,e),t)})).then((function(e){t.windowManager.open(e)}))},Nt=function(t){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,e){document.body.appendChild(t),t.dispatchEvent(e),document.body.removeChild(t)}(e,n)},Rt=function(t,e){return t.dom.getParent(e,"a[href]")},zt=function(t){return Rt(t,t.selection.getStart())},Bt=function(t,e){if(e){var n=Z(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else Nt(e.href)}},It=function(t){return function(){Mt(t)}},Pt=function(t){return function(){Bt(t,zt(t))}},Lt=function(t,e){return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}},Ht=function(t){return function(e){var n=function(){return e.setActive(!t.mode.isReadOnly()&&null!==et(t,t.selection.getNode()))};return n(),Lt(t,n)}},Ft=function(t){return function(e){var n=function(){return e.setDisabled(null===et(t,t.selection.getNode()))};return n(),Lt(t,n)}},Vt=function(t){return function(e){var n=function(e){return rt(e)||(n=t.selection.getRng(),J(n,Y).length>0);var n},r=t.dom.getParents(t.selection.getStart());return e.setDisabled(!n(r)),Lt(t,(function(t){return e.setDisabled(!n(t.parents))}))}},jt=function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!et(t,n)),d};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Ht(t)},label:"Link",predicate:function(e){return!!et(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=et(t);return e?Z(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!et(t,n)),Ht(t)(e)},onAction:function(e){var n=e.getValue(),r=function(e){var n=et(t),r=ot(t);if(!n&&r){var o=nt(t.selection,n);return x.some(o.length>0?o:e)}return x.none()}(n);st(t,{href:n,attach:d},{href:n,text:r,title:x.none(),rel:x.none(),target:x.none(),class:x.none()}),function(t){t.selection.collapse(!1)}(t),e.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:e,onAction:function(e){lt(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){Pt(t)(),e.hide()}}]})};r.add("link",(function(t){!function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:It(t),onSetup:Ht(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Pt(t),onSetup:Ft(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return lt(t)},onSetup:Vt(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Pt(t),onSetup:Ft(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:It(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return lt(t)},onSetup:Vt(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(e){return rt(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})}(t),jt(t),function(t){t.on("click",(function(e){var n=Rt(t,e.target);n&&o.metaKeyPressed(e)&&(e.preventDefault(),Bt(t,n))})),t.on("keydown",(function(e){var n=zt(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),Bt(t,n))}))}(t),function(t){t.addCommand("mceLink",(function(){!function(t){return t.getParam("link_quicklink",!1,"boolean")}(t)?It(t)():t.fire("contexttoolbar-show",{toolbarKey:"quicklink"})}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}()},627:function(t,e){!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env"),n=new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i"),r=function(t,e){if(e<0&&(e=0),3===t.nodeType){var n=t.data.length;e>n&&(e=n)}return e},o=function(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setStart(e,r(e,n)):t.setStartBefore(e)},i=function(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setEnd(e,r(e,n)):t.setEndAfter(e)},u=function(t,e,r){var u,a,c,s,l,f,d,m=function(t){return t.getParam("autolink_pattern",n)}(t),g=function(t){return t.getParam("default_link_target",!1)}(t);if("A"!==t.selection.getNode().tagName){var h=t.selection.getRng().cloneRange();if(h.startOffset<5){if(!(l=h.endContainer.previousSibling)){if(!h.endContainer.firstChild||!h.endContainer.firstChild.nextSibling)return;l=h.endContainer.firstChild.nextSibling}if(f=l.length,o(h,l,f),i(h,l,f),h.endOffset<5)return;u=h.endOffset,a=l}else{if(3!==(a=h.endContainer).nodeType&&a.firstChild){for(;3!==a.nodeType&&a.firstChild;)a=a.firstChild;3===a.nodeType&&(o(h,a,0),i(h,a,a.nodeValue.length))}u=1===h.endOffset?2:h.endOffset-1-e}var p,v=u;do{o(h,a,u>=2?u-2:0),i(h,a,u>=1?u-1:0),u-=1,d=h.toString()}while(" "!==d&&""!==d&&160!==d.charCodeAt(0)&&u-2>=0&&d!==r);!function(t,e){return t===e||" "===t||160===t.charCodeAt(0)}(h.toString(),r)?0===h.startOffset?(o(h,a,0),i(h,a,v)):(o(h,a,u),i(h,a,v)):(o(h,a,u),i(h,a,v),u+=1),s=h.toString(),p=s.charAt(s.length-1),/[?!,.;:]/.test(p)&&i(h,a,v-1);var b=(s=h.toString().trim()).match(m),y=function(t){return t.getParam("link_default_protocol","http","string")}(t);if(b){var w=b[0];(function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e})(w,"www.",0)?w=y+"://"+w:function(t,e){return-1!==t.indexOf(e)}(w,"@")&&!function(t){return/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(t)}(w)&&(w="mailto:"+w),c=t.selection.getBookmark(),t.selection.setRng(h),t.execCommand("createlink",!1,w),!1!==g&&t.dom.setAttrib(t.selection.getNode(),"target",g),t.selection.moveToBookmark(c),t.nodeChanged()}}},a=function(t){var n;t.on("keydown",(function(e){if(13===e.keyCode)return function(t){u(t,-1,"")}(t)})),e.browser.isIE()?t.on("focus",(function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}})):(t.on("keypress",(function(e){if(41===e.keyCode)return function(t){u(t,-1,"(")}(t)})),t.on("keyup",(function(e){if(32===e.keyCode)return function(t){u(t,0,"")}(t)})))};t.add("autolink",(function(t){a(t)}))}()},628:function(t,e){!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("contextmenu",(function(){console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")}))}()},629:function(t,e){!function(){"use strict";var t,e,n=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},i=function(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},u=function(t){return function(e){return typeof e===t}},a=i("string"),c=i("array"),s=u("boolean"),l=u("number"),f=function(){},d=function(t){return function(){return t}},m=function(t){return t},g=d(!1),h=d(!0),p=d("[!-#%-*,-\\/:;?@\\[-\\]_{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫！-＃％-＊，-／：；？＠［-］＿｛｝｟-･]"),v=function(){return b},b={fold:function(t,e){return t()},isSome:g,isNone:h,getOr:e=m,getOrThunk:t=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:e,orThunk:t,map:v,each:f,bind:v,exists:g,forall:h,filter:function(){return v()},toArray:function(){return[]},toString:d("none()")},y=function(t){var e=d(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:h,isNone:g,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return y(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:b},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},w={some:y,none:v,from:function(t){return null==t?b:y(t)}},x=p,C=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=Array.prototype.slice,k=Array.prototype.push,O=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},T=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},_=function(t,e){for(var n=t.length-1;n>=0;n--){e(t[n],n)}},E=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);k.apply(e,t[n])}return e}(O(t,e))},A=Object.hasOwnProperty,D=function(t,e){return A.call(t,e)};"undefined"!=typeof window?window:Function("return this;")();var M,N,R,z,B=(M=3,function(t){return function(t){return t.dom.nodeType}(t)===M}),I=function(t,e,n){!function(t,e,n){if(!(a(n)||s(n)||l(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}(t.dom,e,n)},P=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},L={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return P(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return P(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return P(n)},fromDom:P,fromPoint:function(t,e,n){return w.from(t.dom.elementFromPoint(e,n)).map(P)}},H=function(t,e){return{element:t,offset:e}},F=function(t,e){var n=function(t){return O(t.dom.childNodes,L.fromDom)}(t);return n.length>0&&e<n.length?H(n[e],0):H(t,e)},V=function(t,e){(function(t){return w.from(t.dom.parentNode).map(L.fromDom)})(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},j=function(t,e){V(t,e),function(t,e){t.dom.appendChild(e.dom)}(e,t)},U=(N=B,R="text",{get:function(t){if(!N(t))throw new Error("Can only get "+R+" value of a "+R+" node");return z(t).getOr("")},getOption:z=function(t){return N(t)?w.from(t.dom.nodeValue):w.none()},set:function(t,e){if(!N(t))throw new Error("Can only set raw "+R+" value of a "+R+" node");t.dom.nodeValue=e}}),W=function(t){return U.get(t)},q=function(t,e){return function(t,e){var n,r=void 0===e?document:e.dom;return 1!==(n=r).nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount?[]:O(r.querySelectorAll(t),L.fromDom)}(e,t)},G=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),$=function(t,e){return t.isBlock(e)||D(t.schema.getShortEndedElements(),e.nodeName)},X=function(t,e){return"false"===t.getContentEditable(e)},K=function(t,e){return!t.isBlock(e)&&D(t.schema.getWhiteSpaceElements(),e.nodeName)},Y=function(t,e){return F(L.fromDom(t),e)},J=function(t,e,n,r,o,i){void 0===i&&(i=!0);for(var u=i?e(!1):n;u;){var a=X(t,u);if(a||K(t,u)){if(a?r.cef(u):r.boundary(u))break;u=e(!0)}else{if($(t,u)){if(r.boundary(u))break}else 3===u.nodeType&&r.text(u);if(u===o)break;u=e(!1)}}},Q=function(t,e,n,r,o){if(!function(t,e){return $(t,e)||X(t,e)||K(t,e)||function(t,e){return"true"===t.getContentEditable(e)&&"false"===t.getContentEditableParent(e.parentNode)}(t,e)}(t,n)){var i=t.getParent(r,t.isBlock),u=new G(n,i),a=o?u.next.bind(u):u.prev.bind(u);J(t,a,n,{boundary:h,cef:h,text:function(t){o?e.fOffset+=t.length:e.sOffset+=t.length,e.elements.push(L.fromDom(t))}})}},Z=function(t,e,n,r,o,i){void 0===i&&(i=!0);var u=new G(n,e),a=[],c={sOffset:0,fOffset:0,elements:[]};Q(t,c,n,e,!1);var s=function(){return c.elements.length>0&&(a.push(c),c={sOffset:0,fOffset:0,elements:[]}),!1};return J(t,u.next.bind(u),n,{boundary:s,cef:function(t){return s(),o&&a.push.apply(a,o.cef(t)),!1},text:function(t){c.elements.push(L.fromDom(t)),o&&o.text(t,c)}},r,i),r&&Q(t,c,r,e,!0),s(),a},tt=function(t,e){var n=Y(e.startContainer,e.startOffset),r=n.element.dom,o=Y(e.endContainer,e.endOffset),i=o.element.dom;return Z(t,e.commonAncestorContainer,r,i,{text:function(t,e){t===i?e.fOffset+=t.length-o.offset:t===r&&(e.sOffset+=n.offset)},cef:function(e){var n,r,o,i=E(q(L.fromDom(e),"*[contenteditable=true]"),(function(e){var n=e.dom;return Z(t,n,n)}));return n=i,r=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_PRECEDING)}(t.elements[0].dom,e.elements[0].dom)?1:-1},(o=S.call(n,0)).sort(r),o}},!1)},et=function(t,e){return e.collapsed?[]:tt(t,e)},nt=function(t,e){var n=t.createRng();return n.selectNode(e),et(t,n)},rt=function(t,e){return function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,u=t.length;i<u;i++){var a=t[i],c=e(a);c!==n&&(r.push(o),o=[]),n=c,o.push(a)}return 0!==o.length&&r.push(o),r}(function(t,e,n){return T(t,(function(t,r){n=e(n,t,r)})),n}(t,(function(t,n){var r=W(n),o=t.last,i=o+r.length,u=E(e,(function(t,e){return t.start<i&&t.finish>o?[{element:n,start:Math.max(o,t.start)-o,finish:Math.min(i,t.finish)-o,matchId:e}]:[]}));return{results:t.results.concat(u),last:i}}),{results:[],last:0}).results,(function(t){return t.matchId}))},ot=function(t,e){return E(e,(function(e){var n=e.elements,r=O(n,W).join(""),o=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=e.regex;o.lastIndex=n;for(var i,u=[];i=o.exec(t);){var a=i[e.matchIndex],c=i.index+i[0].indexOf(a),s=c+a.length;if(s>r)break;u.push({start:c,finish:s}),o.lastIndex=s}return u}(r,t,e.sOffset,r.length-e.fOffset);return rt(n,o)}))},it=function(t,e){_(t,(function(t,n){_(t,(function(t){var r=L.fromDom(e.cloneNode(!1));I(r,"data-mce-index",n);var o=t.element.dom;if(o.length===t.finish&&0===t.start)j(t.element,r);else{o.length!==t.finish&&o.splitText(t.finish);var i=o.splitText(t.start);j(L.fromDom(i),r)}}))}))},ut=function(t,e,n,r){var o=n.getBookmark(),i=t.select("td[data-mce-selected],th[data-mce-selected]"),u=i.length>0?function(t,e){return E(e,(function(e){return nt(t,e)}))}(t,i):et(t,n.getRng()),a=ot(e,u);return it(a,r),n.moveToBookmark(o),a.length},at=function(t){var e=t.getAttribute("data-mce-index");return"number"==typeof e?""+e:e},ct=function(t,e,n,r){var o=t.dom.create("span",{"data-mce-bogus":1});o.className="mce-match-marker";var i=t.getBody();return bt(t,e,!1),r?ut(t.dom,n,t.selection,o):function(t,e,n,r){var o=nt(t,n),i=ot(e,o);return it(i,r),i.length}(t.dom,n,i,o)},st=function(t){var e=t.parentNode;t.firstChild&&e.insertBefore(t.firstChild,t),t.parentNode.removeChild(t)},lt=function(t,e){var n=[],r=C.toArray(t.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var i=at(r[o]);null!==i&&i.length&&(i===e.toString()&&n.push(r[o]))}return n},ft=function(t,e,n){var r=e.get(),o=r.index,i=t.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,i.removeClass(lt(t,r.index),"mce-match-marker-selected");var u=lt(t,o);return u.length?(i.addClass(lt(t,o),"mce-match-marker-selected"),t.selection.scrollIntoView(u[0]),o):-1},dt=function(t,e){var n=e.parentNode;t.remove(e),t.isEmpty(n)&&t.remove(n)},mt=function(t,e,n,r,o,i){var u=function(t,e){var n="("+t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return e?"(?:^|\\s|"+x()+")"+n+"(?=$|\\s|"+x()+")":n}(n,o),a={regex:new RegExp(u,r?"g":"gi"),matchIndex:1},c=ct(t,e,a,i);if(c){var s=ft(t,e,!0);e.set({index:s,count:c,text:n,matchCase:r,wholeWord:o,inSelection:i})}return c},gt=function(t,e){var n=ft(t,e,!0);e.set(o(o({},e.get()),{index:n}))},ht=function(t,e){var n=ft(t,e,!1);e.set(o(o({},e.get()),{index:n}))},pt=function(t){var e=at(t);return null!==e&&e.length>0},vt=function(t,e,n,r,i){var u,a=e.get(),c=a.index,s=c;r=!1!==r;for(var l=t.getBody(),f=C.grep(C.toArray(l.getElementsByTagName("span")),pt),d=0;d<f.length;d++){var m=at(f[d]),g=u=parseInt(m,10);if(i||g===a.index){for(n.length?(f[d].firstChild.nodeValue=n,st(f[d])):dt(t.dom,f[d]);f[++d];){if((g=parseInt(at(f[d]),10))!==u){d--;break}dt(t.dom,f[d])}r&&s--}else u>c&&f[d].setAttribute("data-mce-index",String(u-1))}return e.set(o(o({},a),{count:i?0:a.count-1,index:s})),r?gt(t,e):ht(t,e),!i&&e.get().count>0},bt=function(t,e,n){for(var r,i,u=e.get(),a=C.toArray(t.getBody().getElementsByTagName("span")),c=0;c<a.length;c++){var s=at(a[c]);null!==s&&s.length&&(s===u.index.toString()&&(r||(r=a[c].firstChild),i=a[c].firstChild),st(a[c]))}if(e.set(o(o({},u),{index:-1,count:0,text:""})),r&&i){var l=t.dom.createRng();return l.setStart(r,0),l.setEnd(i,i.data.length),!1!==n&&t.selection.setRng(l),l}},yt=function(){var t=function(t){var e=n(w.none()),r=function(){return e.get().each(t)};return{clear:function(){r(),e.set(w.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){r(),e.set(w.some(t))}}}(f);return o(o({},t),{on:function(e){return t.get().each(e)}})},wt=tinymce.util.Tools.resolve("tinymce.Env"),xt=function(t,e){var n=yt();t.undoManager.add();var r=C.trim(t.selection.getContent({format:"text"})),i=function(t){(function(t,e){return e.get().count>1}(0,e)?t.enable:t.disable)("next"),(function(t,e){return e.get().count>1}(0,e)?t.enable:t.disable)("prev")},u=function(t,e){var n=e?t.disable:t.enable;T(["replace","replaceall","prev","next"],n)},a=function(t,e){wt.browser.isSafari()&&wt.deviceType.isTouch()&&("find"===e||"replace"===e||"replaceall"===e)&&t.focus(e)},c=function(n){bt(t,e,!1),u(n,!0),i(n)},s=function(n){var r=n.getData(),o=e.get();if(r.findtext.length){if(o.text===r.findtext&&o.matchCase===r.matchcase&&o.wholeWord===r.wholewords)gt(t,e);else{var a=mt(t,e,r.findtext,r.matchcase,r.wholewords,r.inselection);a<=0&&function(e){t.windowManager.alert("Could not find the specified string.",(function(){e.focus("findtext")}))}(n),u(n,0===a)}i(n)}else c(n)},l=e.get(),f={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace all",disabled:!0}],initialData:{findtext:r,replacetext:"",wholewords:l.wholeWord,matchcase:l.matchCase,inselection:l.inSelection},onChange:function(t,n){"findtext"===n.name&&e.get().count>0&&c(t)},onAction:function(n,r){var u=n.getData();switch(r.name){case"find":s(n);break;case"replace":vt(t,e,u.replacetext)?i(n):c(n);break;case"replaceall":vt(t,e,u.replacetext,!0,!0),c(n);break;case"prev":ht(t,e),i(n);break;case"next":gt(t,e),i(n);break;case"matchcase":case"wholewords":case"inselection":!function(t){var n=t.getData(),r=e.get();e.set(o(o({},r),{matchCase:n.matchcase,wholeWord:n.wholewords,inSelection:n.inselection}))}(n),c(n)}a(n,r.name)},onSubmit:function(t){s(t),a(t,"find")},onClose:function(){t.focus(),bt(t,e),t.undoManager.add()}};n.set(t.windowManager.open(f,{inline:"toolbar"}))},Ct=function(t,e){return function(){xt(t,e)}};r.add("searchreplace",(function(t){var e=n({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return function(t,e){t.addCommand("SearchReplace",(function(){xt(t,e)}))}(t,e),function(t,e){t.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:Ct(t,e),icon:"search"}),t.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:Ct(t,e),icon:"search"}),t.shortcuts.add("Meta+F","",Ct(t,e))}(t,e),function(t,e){return{done:function(n){return bt(t,e,n)},find:function(n,r,o,i){return void 0===i&&(i=!1),mt(t,e,n,r,o,i)},next:function(){return gt(t,e)},prev:function(){return ht(t,e)},replace:function(n,r,o){return vt(t,e,n,r,o)}}}(t,e)}))}()},630:function(t,e){!function(){"use strict";var t=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=Object.hasOwnProperty,r=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=tinymce.util.Tools.resolve("tinymce.util.URI"),i=tinymce.util.Tools.resolve("tinymce.util.XHR"),u=function(t){return t.getParam("spellchecker_rpc_url")},a=function(t){var e=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`§©«®±¶·¸»¼½¾¿×÷¤”“„    ]+',"g");return t.getParam("spellchecker_wordchar_pattern",e)},c=function(t){return t&&1===t.nodeType&&"false"===t.contentEditable},s=function(t,e){var n,r=[],o=e.dom,i=e.schema.getBlockElements(),u=e.schema.getWhiteSpaceElements(),a=e.schema.getShortEndedElements(),s=function(t,e){if(!t[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:t.index,end:t.index+t[0].length,text:t[0],data:e}},l=function(t){if(3===t.nodeType)return t.data;if(u[t.nodeName]&&!i[t.nodeName])return"";if(c(t))return"\n";var e="";if((i[t.nodeName]||a[t.nodeName])&&(e+="\n"),t=t.firstChild)do{e+=l(t)}while(t=t.nextSibling);return e},f=function(t){for(var e=t.parentNode;t.childNodes.length>0;)e.insertBefore(t.childNodes[0],t);e.removeChild(t)},d=function(e){var n=t.getElementsByTagName("*"),r=[];e="number"==typeof e?""+e:null;for(var o=0;o<n.length;o++){var i=n[o],u=i.getAttribute("data-mce-index");null!==u&&u.length&&-1!==i.className.indexOf("mce-spellchecker-word")&&(u!==e&&null!==e||r.push(i))}return r},m=function(t){for(var e=r.length;e--;)if(r[e]===t)return e;return-1};function g(t){for(var e=0,n=r.length;e<n&&!1!==t(r[e],e);e++);return this}function h(t){var e,n=d(t?m(t):null);for(e=n.length;e--;)f(n[e]);return this}var p=function(t){var n=d(m(t)),r=e.dom.createRng();return r.setStartBefore(n[0]),r.setEndAfter(n[n.length-1]),r};var v=l(t);return{text:v,matches:r,each:g,filter:function(t){var e=[];return g((function(n,r){t(n,r)&&e.push(n)})),r=e,this},reset:function(){return r.splice(0,r.length),h(),this},matchFromElement:function(t){return r[t.getAttribute("data-mce-index")]},elementFromMatch:function(t){return d(m(t))[0]},find:function(t,e){if(v&&t.global)for(;n=t.exec(v);)r.push(s(n,e));return this},add:function(t,e,n){return r.push({start:t,end:t+e,text:v.substr(t,e),data:n}),this},wrap:function(e){return r.length&&function(t,e,n){var r,o,s,l,f,d=[],m=0,g=t,h=0;(e=e.slice(0)).sort((function(t,e){return t.start-e.start})),f=e.shift();t:for(;;){if((i[g.nodeName]||a[g.nodeName]||c(g))&&m++,3===g.nodeType&&(!o&&g.length+m>=f.end?(o=g,l=f.end-m):r&&d.push(g),!r&&g.length+m>f.start&&(r=g,s=f.start-m),m+=g.length),r&&o){if(g=n({startNode:r,startNodeIndex:s,endNode:o,endNodeIndex:l,innerNodes:d,match:f.text,matchIndex:h}),m-=o.length-l,r=null,o=null,d=[],h++,!(f=e.shift()))break}else if(u[g.nodeName]&&!i[g.nodeName]||!g.firstChild){if(g.nextSibling){g=g.nextSibling;continue}}else if(!c(g)){g=g.firstChild;continue}for(;;){if(g.nextSibling){g=g.nextSibling;break}if(g.parentNode===t)break t;g=g.parentNode}}}(t,r,function(t){var e=function(e,n){var i=r[n];i.stencil||(i.stencil=t(i));var u=i.stencil.cloneNode(!1);return u.setAttribute("data-mce-index",""+n),e&&u.appendChild(o.doc.createTextNode(e)),u};return function(t){var n,r,i,u=t.startNode,a=t.endNode,c=t.matchIndex,s=o.doc;if(u===a){var l=u;i=l.parentNode,t.startNodeIndex>0&&(n=s.createTextNode(l.data.substring(0,t.startNodeIndex)),i.insertBefore(n,l));var f=e(t.match,c);return i.insertBefore(f,l),t.endNodeIndex<l.length&&(r=s.createTextNode(l.data.substring(t.endNodeIndex)),i.insertBefore(r,l)),l.parentNode.removeChild(l),f}n=s.createTextNode(u.data.substring(0,t.startNodeIndex)),r=s.createTextNode(a.data.substring(t.endNodeIndex));for(var d=e(u.data.substring(t.startNodeIndex),c),m=0,g=t.innerNodes.length;m<g;++m){var h=t.innerNodes[m],p=e(h.data,c);h.parentNode.replaceChild(p,h)}var v=e(a.data.substring(0,t.endNodeIndex),c);return(i=u.parentNode).insertBefore(n,u),i.insertBefore(d,u),i.removeChild(u),(i=a.parentNode).insertBefore(v,a),i.insertBefore(r,a),i.removeChild(a),v}}(e)),this},unwrap:h,replace:function(t,n){var r=p(t);return r.deleteContents(),n.length>0&&r.insertNode(e.dom.doc.createTextNode(n)),r},rangeFromMatch:p,indexOf:m}},l=function(t,e){if(!e.get()){var n=s(t.getBody(),t);e.set(n)}return e.get()},f=function(t,e,n,a,c,s,l){var f=function(t){return t.getParam("spellchecker_callback")}(t);(f||function(t,e,n){return function(a,c,s,l){var f={method:a,lang:n.get()},d="";f["addToDictionary"===a?"word":"text"]=c,r.each(f,(function(t,e){d&&(d+="&"),d+=e+"="+encodeURIComponent(t)})),i.send({url:new o(e).toAbsolute(u(t)),type:"post",content_type:"application/x-www-form-urlencoded",data:d,success:function(e){var n=JSON.parse(e);if(n)n.error?l(n.error):s(n);else{var r=t.translate("Server response wasn't proper JSON.");l(r)}},error:function(){var e=t.translate("The spelling service was not found: (")+u(t)+t.translate(")");l(e)}})}}(t,e,n)).call(t.plugins.spellchecker,a,c,s,l)},d=function(t,e,n,r,o,i){if(!h(t,n,r)){t.setProgressState(!0),f(t,e,i,"spellcheck",l(t,r).text,(function(e){v(t,n,r,o,e)}),(function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1),h(t,n,r)})),t.focus()}},m=function(t,e,n){t.dom.select("span.mce-spellchecker-word").length||h(t,e,n)},g=function(t,e,n,o,i,u){t.selection.collapse(),u?r.each(t.dom.select("span.mce-spellchecker-word"),(function(e){e.getAttribute("data-mce-word")===o&&t.dom.remove(e,!0)})):t.dom.remove(i,!0),m(t,e,n)},h=function(t,e,n){var r=t.selection.getBookmark();if(l(t,n).reset(),t.selection.moveToBookmark(r),n.set(null),e.get())return e.set(!1),function(t){t.fire("SpellcheckEnd")}(t),!0},p=function(t){var e=t.getAttribute("data-mce-index");return"number"==typeof e?""+e:e},v=function(t,e,r,o,i){var u=!!i.dictionary,c=i.words;if(t.setProgressState(!1),function(t){for(var e in t)if(n.call(t,e))return!1;return!0}(c)){var s=t.translate("No misspellings found.");return t.notificationManager.open({text:s,type:"info"}),void e.set(!1)}o.set({suggestions:c,hasDictionarySupport:u});var f=t.selection.getBookmark();l(t,r).find(a(t)).filter((function(t){return!!c[t.text]})).wrap((function(e){return t.dom.create("span",{class:"mce-spellchecker-word","aria-invalid":"spelling","data-mce-bogus":1,"data-mce-word":e.text})})),t.selection.moveToBookmark(f),e.set(!0),function(t){t.fire("SpellcheckStart")}(t)},b=function(){return(b=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},y="SpellcheckStart SpellcheckEnd",w=function(t,e,n,o,i,u){var a,c,s=(a=function(t){return r.map(function(t){return t.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv")}(t).split(","),(function(t){var e=t.split("=");return{name:e[0],value:e[1]}}))}(t),c=[],r.each(a,(function(t){c.push({selectable:!0,text:t.name,data:t.value})})),c),l=function(){d(t,e,n,o,u,i)},f={tooltip:"Spellcheck",onAction:l,icon:"spell-check",onSetup:function(e){var r=function(){e.setActive(n.get())};return t.on(y,r),function(){t.off(y,r)}}},m=b(b({},f),{type:"splitbutton",select:function(t){return t===i.get()},fetch:function(t){t(r.map(s,(function(t){return{type:"choiceitem",value:t.data,text:t.text}})))},onItemAction:function(t,e){i.set(e)}});s.length>1?t.ui.registry.addSplitButton("spellchecker",m):t.ui.registry.addToggleButton("spellchecker",f),t.ui.registry.addToggleMenuItem("spellchecker",{text:"Spellcheck",icon:"spell-check",onSetup:function(e){e.setActive(n.get());var r=function(){e.setActive(n.get())};return t.on(y,r),function(){t.off(y,r)}},onAction:l})},x=function(t,e,n,o,i,u,a,c){var s=[],l=n.get().suggestions[a];return r.each(l,(function(e){s.push({text:e,onAction:function(){t.insertContent(t.dom.encode(e)),t.dom.remove(c),m(t,o,i)}})})),n.get().hasDictionarySupport&&(s.push({type:"separator"}),s.push({text:"Add to dictionary",onAction:function(){!function(t,e,n,r,o,i,u){t.setProgressState(!0),f(t,e,o,"addToDictionary",i,(function(){t.setProgressState(!1),t.dom.remove(u,!0),m(t,n,r)}),(function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1)}))}(t,e,o,i,u,a,c)}})),s.push.apply(s,[{type:"separator"},{text:"Ignore",onAction:function(){g(t,o,i,a,c)}},{text:"Ignore all",onAction:function(){g(t,o,i,a,c,!0)}}]),s},C=function(t,e,n,o,i,u){t.ui.registry.addContextMenu("spellchecker",{update:function(a){var c=a;if("mce-spellchecker-word"!==c.className)return[];var s=function(t,e){var n=[],o=r.toArray(t.getBody().getElementsByTagName("span"));if(o.length)for(var i=0;i<o.length;i++){var u=p(o[i]);null!==u&&u.length&&(u===e.toString()&&n.push(o[i]))}return n}(t,p(c));if(s.length>0){var l=t.dom.createRng();return l.setStartBefore(s[0]),l.setEndAfter(s[s.length-1]),t.selection.setRng(l),x(t,e,n,o,i,u,c.getAttribute("data-mce-word"),s)}}})};e.add("spellchecker",(function(e,n){if(!1===function(t){return!!t.hasPlugin("tinymcespellchecker",!0)&&(void 0!==window.console&&window.console.log&&window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),!0)}(e)){console.warn("The spellchecker plugin has been deprecated and marked for removal in TinyMCE 6.0");var r=t(!1),o=t(function(t){var e=t.getParam("language","en");return t.getParam("spellchecker_language",e)}(e)),i=t(null),u=t(null);return w(e,n,r,i,o,u),C(e,n,u,r,i,o),function(t,e,n,r,o,i){t.addCommand("mceSpellCheck",(function(){d(t,e,n,r,o,i)}))}(e,n,r,i,u,o),function(t,e,n,r,o){return{getTextMatcher:r.get,getWordCharPattern:function(){return a(t)},markErrors:function(o){v(t,e,r,n,o)},getLanguage:o.get}}(e,r,u,i,o)}}))}()},631:function(t,e){!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("textcolor",(function(){console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")}))}()},76:function(t,e,n){"use strict";n.r(e),function(t){var n=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return(function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n++){var o=r[n];t.call(e,o[1],o[0])}},e}())}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,o=void 0!==t&&t.Math===Math?t:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),i="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(o):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var u=["top","right","bottom","left","width","height","size","weight"],a="undefined"!=typeof MutationObserver,c=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,r=!1,o=0;function u(){n&&(n=!1,t()),r&&c()}function a(){i(u)}function c(){var t=Date.now();if(n){if(t-o<2)return;r=!0}else n=!0,r=!1,setTimeout(a,e);o=t}return c}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),a?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;u.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),s=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},l=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||o},f=v(0,0,0,0);function d(t){return parseFloat(t)||0}function m(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce((function(e,n){return e+d(t["border-"+n+"-width"])}),0)}function g(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return f;var r=l(t).getComputedStyle(t),o=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var o=r[n],i=t["padding-"+o];e[o]=d(i)}return e}(r),i=o.left+o.right,u=o.top+o.bottom,a=d(r.width),c=d(r.height);if("border-box"===r.boxSizing&&(Math.round(a+i)!==e&&(a-=m(r,"left","right")+i),Math.round(c+u)!==n&&(c-=m(r,"top","bottom")+u)),!function(t){return t===l(t).document.documentElement}(t)){var s=Math.round(a+i)-e,g=Math.round(c+u)-n;1!==Math.abs(s)&&(a-=s),1!==Math.abs(g)&&(c-=g)}return v(o.left,o.top,a,c)}var h="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof l(t).SVGGraphicsElement}:function(t){return t instanceof l(t).SVGElement&&"function"==typeof t.getBBox};function p(t){return r?h(t)?function(t){var e=t.getBBox();return v(0,0,e.width,e.height)}(t):g(t):f}function v(t,e,n,r){return{x:t,y:e,width:n,height:r}}var b=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=v(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=p(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),y=function(t,e){var n,r,o,i,u,a,c,l=(r=(n=e).x,o=n.y,i=n.width,u=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,c=Object.create(a.prototype),s(c,{x:r,y:o,width:i,height:u,top:o,right:r+i,bottom:u+o,left:r}),c);s(this,{target:t,contentRect:l})},w=function(){function t(t,e,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=r}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof l(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new b(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof l(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new y(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),x="undefined"!=typeof WeakMap?new WeakMap:new n,C=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=c.getInstance(),r=new w(e,n,this);x.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){C.prototype[t]=function(){var e;return(e=x.get(this))[t].apply(e,arguments)}}));var S=void 0!==o.ResizeObserver?o.ResizeObserver:C;e.default=S}.call(this,n(28))},8:function(t,e,n){var r,o;!function(i,u){"use strict";void 0===(o="function"==typeof(r=function(){var t=function(){},e=["trace","debug","info","warn","error"];function n(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,arguments])}}}function r(e){return"debug"===e&&(e="log"),"undefined"!=typeof console&&(void 0!==console[e]?n(console,e):void 0!==console.log?n(console,"log"):t)}function o(n,r){for(var o=0;o<e.length;o++){var i=e[o];this[i]=o<n?t:this.methodFactory(i,n,r)}this.log=this.debug}function i(t,e,n){return function(){"undefined"!=typeof console&&(o.call(this,e,n),this[t].apply(this,arguments))}}function u(t,e,n){return r(t)||i.apply(this,arguments)}function a(t,n,r){var i,a=this,c="loglevel";function s(){var t;if("undefined"!=typeof window){try{t=window.localStorage[c]}catch(t){}if(void 0===t)try{var e=window.document.cookie,n=e.indexOf(encodeURIComponent(c)+"=");-1!==n&&(t=/^([^;]+)/.exec(e.slice(n))[1])}catch(t){}return void 0===a.levels[t]&&(t=void 0),t}}t&&(c+=":"+t),a.name=t,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=r||u,a.getLevel=function(){return i},a.setLevel=function(n,r){if("string"==typeof n&&void 0!==a.levels[n.toUpperCase()]&&(n=a.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(i=n,!1!==r&&function(t){var n=(e[t]||"silent").toUpperCase();if("undefined"!=typeof window){try{return void(window.localStorage[c]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"="+n+";"}catch(t){}}}(n),o.call(a,n,t),"undefined"==typeof console&&n<a.levels.SILENT)return"No console available for logging"},a.setDefaultLevel=function(t){s()||a.setLevel(t,!1)},a.enableAll=function(t){a.setLevel(a.levels.TRACE,t)},a.disableAll=function(t){a.setLevel(a.levels.SILENT,t)};var l=s();null==l&&(l=null==n?"WARN":n),a.setLevel(l,!1)}var c=new a,s={};c.getLogger=function(t){if("string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=s[t];return e||(e=s[t]=new a(t,c.getLevel(),c.methodFactory)),e};var l="undefined"!=typeof window?window.log:void 0;return c.noConflict=function(){return"undefined"!=typeof window&&window.log===c&&(window.log=l),c},c.getLoggers=function(){return s},c})?r.call(e,n,e,t):r)||(t.exports=o)}()}}]);
//# sourceMappingURL=0.afa399e2645e0c8d1b38.js.map