(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 _})),n.d(e,"__classPrivateFieldGet",(function(){return T})),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){return t&&t.__esModule?t:{default:t}}function T(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}},26: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},266:function(t,e,n){"use strict";var r=n(371),o=n(375),i=n(267);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):[]}},267: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}},269: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)},338: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}},_=function(t){return t},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()},R=O(!1),N=O(!0),z=function(){return B},B=function(){var t=function(t){return t()},e=_;return{fold:function(t,e){return t()},isSome:R,isNone:N,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:R,forall:N,filter:function(){return z()},toArray:function(){return[]},toString:O("none()")}}(),P=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:N,isNone:R,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:B},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},I={some:P,none:z,from:function(t){return null==t?B:P(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 I.some(i);if(n(i,r))break}return I.none()},Q=function(t,e){return J(t,e,R)},Z=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return I.some(n)}return I.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){var n=L.call(t,0);return n.sort(e),n},it=function(t,e){return e>=0&&e<t.length?I.some(t[e]):I.none()},ut=function(t){return it(t,0)},at=function(t){return it(t,t.length-1)},ct=w(Array.from)?Array.from:function(t){return L.call(t)},st=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return I.none()},lt=Object.keys,ft=Object.hasOwnProperty,dt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},mt=function(t,e){return gt(t,(function(t,n){return{k:n,v:e(t,n)}}))},gt=function(t,e){var n={};return dt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ht=function(t){return function(e,n){t[n]=e}},pt=function(t,e,n,r){return dt(t,(function(t,o){(e(t,o)?n:r)(t,o)})),{}},vt=function(t,e){var n={};return pt(t,e,ht(n),C),n},bt=function(t){return function(t,e){var n=[];return dt(t,(function(t,r){n.push(e(t,r))})),n}(t,_)},yt=function(t,e){return wt(t,e)?I.from(t[e]):I.none()},wt=function(t,e){return ft.call(t,e)},xt=function(t,e){return wt(t,e)&&void 0!==t[e]&&null!==t[e]},Ct=Array.isArray,St=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(wt(t,r)&&!1===e.call(n,t[r],r,t))return!1;return!0},kt=function(t,e){var n=[];return St(t,(function(r,o){n.push(e(r,o,t))})),n},Ot=function(t,e){var n=[];return St(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n},_t=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},Et=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},At=function(t){return t[t.length-1]},Dt=function(){return(Dt=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 Mt(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 Rt=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 zt(0,0)},zt=function(t,e){return{major:t,minor:e}},Bt={nu:zt,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 zt(r(1),r(2))}(t,n)},unknown:Nt},Pt=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)},Lt=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(t,e,0)},Ht=function(t){return function(e){return e.replace(t,"")}},Ft=Ht(/^\s+|\s+$/g),Vt=Ht(/^\s+/g),jt=Ht(/\s+$/g),Ut=function(t){return t.length>0},Wt=function(t){return!Ut(t)},qt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Gt=function(t){return function(e){return It(e,t)}},$t=[{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]+).*/,qt],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:[qt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Gt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Gt("firefox")},{name:"Safari",versionRegexes:[qt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(It(t,"safari")||It(t,"mobile/"))&&It(t,"applewebkit")}}],Xt=[{name:"Windows",search:Gt("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:Gt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Gt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Gt("linux"),versionRegexes:[]},{name:"Solaris",search:Gt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Gt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Gt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Kt={browsers:O($t),oses:O(Xt)},Yt=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")}},Jt={unknown:function(){return Yt({current:void 0,version:Bt.unknown()})},nu:Yt,edge:O("Edge"),chrome:O("Chrome"),ie:O("IE"),opera:O("Opera"),firefox:O("Firefox"),safari:O("Safari")},Qt=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")}},Zt={unknown:function(){return Qt({current:void 0,version:Bt.unknown()})},nu:Qt,windows:O("Windows"),ios:O("iOS"),android:O("Android"),linux:O("Linux"),osx:O("OSX"),solaris:O("Solaris"),freebsd:O("FreeBSD"),chromeos:O("ChromeOS")},te=function(t,e,n){var r=Kt.browsers(),o=Kt.oses(),i=e.bind((function(t){return function(t,e){return st(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:Bt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return Pt(t,e).map((function(t){var n=Bt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(Jt.unknown,Jt.nu),u=function(t,e){return Pt(t,e).map((function(t){var n=Bt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(Zt.unknown,Zt.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}},ee=function(t){return window.matchMedia(t).matches},ne=Rt((function(){return te(navigator.userAgent,I.from(navigator.userAgentData),ee)})),re=function(){return ne()},oe=navigator.userAgent,ie=re(),ue=ie.browser,ae=ie.os,ce=ie.deviceType,se=/WebKit/.test(oe)&&!ue.isEdge(),le="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,fe=-1!==oe.indexOf("Windows Phone"),de={opera:ue.isOpera(),webkit:se,ie:!(!ue.isIE()&&!ue.isEdge())&&ue.version.major,gecko:ue.isFirefox(),mac:ae.isOSX()||ae.isiOS(),iOS:ce.isiPad()||ce.isiPhone(),android:ae.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:ue.isIE()?document.documentMode||7:10,fileApi:le,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!ue.isIE(),desktop:ce.isDesktop(),windowsPhone:fe,browser:{current:ue.current,version:ue.version,isChrome:ue.isChrome,isEdge:ue.isEdge,isFirefox:ue.isFirefox,isIE:ue.isIE,isOpera:ue.isOpera,isSafari:ue.isSafari},os:{current:ae.current,version:ae.version,isAndroid:ae.isAndroid,isChromeOS:ae.isChromeOS,isFreeBSD:ae.isFreeBSD,isiOS:ae.isiOS,isLinux:ae.isLinux,isOSX:ae.isOSX,isSolaris:ae.isSolaris,isWindows:ae.isWindows},deviceType:{isDesktop:ce.isDesktop,isiPad:ce.isiPad,isiPhone:ce.isiPhone,isPhone:ce.isPhone,isTablet:ce.isTablet,isTouch:ce.isTouch,isWebView:ce.isWebView}},me=/^\s*|\s*$/g,ge=function(t){return null==t?"":(""+t).replace(me,"")},he=function(t,e){return e?!("array"!==e||!Ct(t))||typeof t===e:void 0!==t},pe=function(t,e,n,r){r=r||this,t&&(n&&(t=t[n]),St(t,(function(t,o){if(!1===e.call(r,t,o,n))return!1;pe(t,e,n,r)})))},ve={trim:ge,isArray:Ct,is:he,toArray:function(t){if(Ct(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:St,map:kt,grep:Ot,inArray:_t,hasOwn:wt,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(wt(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:pe,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||he(t,"array")?t:kt(t.split(e||","),ge)},_addCacheSuffix:function(t){var e=de.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},be=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},ye={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 be(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return be(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return be(n)},fromDom:be,fromPoint:function(t,e,n){return I.from(t.dom.elementFromPoint(e,n)).map(be)}},we=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},xe=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")},Ce=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Se=function(t,e){return t.dom===e.dom},ke=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},Oe=function(t,e){return re().browser.isIE()?ke(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 _e=function(t){return t.dom.nodeName.toLowerCase()},Te=function(t){return t.dom.nodeType},Ee=function(t){return function(e){return Te(e)===t}},Ae=Ee(1),De=Ee(3),Me=Ee(9),Re=Ee(11),Ne=function(t){return ye.fromDom(t.dom.ownerDocument)},ze=function(t){return Me(t)?t:Ne(t)},Be=function(t){return ye.fromDom(ze(t).dom.defaultView)},Pe=function(t){return I.from(t.dom.parentNode).map(ye.fromDom)},Ie=function(t){return I.from(t.dom.previousSibling).map(ye.fromDom)},Le=function(t){return I.from(t.dom.nextSibling).map(ye.fromDom)},He=function(t){return nt(we(t,Ie))},Fe=function(t){return we(t,Le)},Ve=function(t){return W(t.dom.childNodes,ye.fromDom)},je=function(t,e){var n=t.dom.childNodes;return I.from(n[e]).map(ye.fromDom)},Ue=function(t){return je(t,0)},We=function(t){return je(t,t.dom.childNodes.length-1)},qe=function(t){return t.dom.childNodes.length},Ge=function(t){return Re(t)&&y(t.dom.host)},$e=w(Element.prototype.attachShadow)&&w(Node.prototype.getRootNode),Xe=O($e),Ke=$e?function(t){return ye.fromDom(t.dom.getRootNode())}:ze,Ye=function(t){return Ge(t)?t:function(t){var e=t.dom.head;if(null==e)throw new Error("Head is not available yet");return ye.fromDom(e)}(ze(t))},Je=function(t){return ye.fromDom(t.dom.host)},Qe=function(t){return y(t.dom.shadowRoot)},Ze=function(t,e){Pe(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},tn=function(t,e){Le(t).fold((function(){Pe(t).each((function(t){nn(t,e)}))}),(function(t){Ze(t,e)}))},en=function(t,e){Ue(t).fold((function(){nn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},nn=function(t,e){t.dom.appendChild(e.dom)},rn=function(t,e){q(e,(function(e){nn(t,e)}))},on=function(t){t.dom.textContent="",q(Ve(t),(function(t){un(t)}))},un=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},an=function(t){var e,n=Ve(t);n.length>0&&(e=t,q(n,(function(t){Ze(e,t)}))),un(t)},cn=function(t){var e=De(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n=e.ownerDocument;return function(t){var e=Ke(t);return Ge(e)?I.some(e):I.none()}(ye.fromDom(e)).fold((function(){return n.body.contains(e)}),k(cn,Je))},sn=function(t,e){return{left:t,top:e,translate:function(n,r){return sn(t+n,e+r)}}},ln=sn,fn=function(t,e){return void 0!==t?t:void 0!==e?e:0},dn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?ln(n.offsetLeft,n.offsetTop):cn(t)?function(t){var e=t.getBoundingClientRect();return ln(e.left,e.top)}(e):ln(0,0)},mn=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 ln(n,r)},gn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},hn=function(t,e){re().browser.isSafari()&&w(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)},pn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},vn=function(t){var e=void 0===t?window:t,n=e.document,r=mn(ye.fromDom(n));return function(t){var e=void 0===t?window:t;return re().browser.isFirefox()?I.none():I.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return pn(r.left,r.top,n,o)}),(function(t){return pn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},bn=function(t){return function(e){return!!e&&e.nodeType===t}},yn=function(t){return!!t&&!Object.getPrototypeOf(t)},wn=bn(1),xn=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}},Cn=function(t,e){var n=e.toLowerCase().split(" ");return function(e){if(wn(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}},Sn=function(t){return function(e){return wn(e)&&e.hasAttribute(t)}},kn=function(t){return wn(t)&&t.hasAttribute("data-mce-bogus")},On=function(t){return wn(t)&&"TABLE"===t.tagName},_n=function(t){return function(e){if(wn(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Tn=xn(["textarea","input"]),En=bn(3),An=bn(8),Dn=bn(9),Mn=bn(11),Rn=xn(["br"]),Nn=xn(["img"]),zn=_n("true"),Bn=_n("false"),Pn=xn(["td","th"]),In=xn(["video","audio","object","embed"]),Ln=function(t,e,n){return void 0===n&&(n=T),t.exists((function(t){return n(t,e)}))},Hn=function(t,e,n){return t.isSome()&&e.isSome()?I.some(n(t.getOrDie(),e.getOrDie())):I.none()},Fn=function(t){return void 0!==t.style&&w(t.style.getPropertyValue)},Vn=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+"")},jn=function(t,e,n){Vn(t.dom,e,n)},Un=function(t,e){var n=t.dom;dt(e,(function(t,e){Vn(n,e,t)}))},Wn=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},qn=function(t,e){return I.from(Wn(t,e))},Gn=function(t,e){t.dom.removeAttribute(e)},$n=function(t,e){var n=t.dom;dt(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);Fn(t)&&t.style.setProperty(e,n)}(n,e,t)}))},Xn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||cn(t)?r:Kn(n,e)},Kn=function(t,e){return Fn(t)?t.style.getPropertyValue(e):""},Yn=function(t,e){var n=t.dom,r=Kn(n,e);return I.from(r).filter((function(t){return t.length>0}))},Jn=function(t){var e={},n=t.dom;if(Fn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},Qn=re().browser,Zn=function(t){return Q(t,Ae)},tr=function(t,e){return t.children&&j(t.children,e)},er=function(t,e,n){var r=0,o=0,i=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===Xn(ye.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&&!tr(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&&!tr(a,n);)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;o+=function(t){return Qn.isFirefox()&&"table"===_e(t)?Zn(Ve(t)).filter((function(t){return"caption"===_e(t)})).bind((function(t){return Zn(Fe(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}(ye.fromDom(e))}return{x:r,y:o}},nr={},rr={exports:nr};!function(t,n,r,o){!function(e,o){"object"==typeof n&&void 0!==r?r.exports=o():"function"==typeof t&&t.amd?t(o):(e="undefined"!=typeof globalThis?globalThis:e||self).EphoxContactWrapper=o()}(this,(function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},n={exports:{}};!function(e){!function(t){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._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 a(e.promise,t)}u(e.promise,r)}else(1===t._state?u:a)(e.promise,t._value)}))):t._deferreds.push(e)}function u(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 o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){a(t,e)}var r,i}function a(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,a(e,t))}))}catch(t){if(n)return;n=!0,a(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((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])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(t)}(n);var r=n.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||r}}))}(void 0,nr,rr);var or=rr.exports.boltExport,ir=function(t){var e=I.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=I.some(t),i(n),n=[])})),{get:r,map:function(t){return ir((function(e){r((function(n){e(t(n))}))}))},isReady:o}},ur={nu:ir,pure:function(t){return ir((function(e){e(t)}))}},ar=function(t){setTimeout((function(){throw t}),0)},cr=function(t){var e=function(e){t().then(e,ar)};return{map:function(e){return cr((function(){return t().then(e)}))},bind:function(e){return cr((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return cr((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return ur.nu(e)},toCached:function(){var e=null;return cr((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},sr=function(t){return cr((function(){return new or(t)}))},lr=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))}))}))},fr=function(t){return{isValue:N,isError:R,getOr:O(t),getOrThunk:O(t),getOrDie:O(t),or:function(e){return fr(t)},orThunk:function(e){return fr(t)},fold:function(e,n){return n(t)},map:function(e){return fr(e(t))},mapError:function(e){return fr(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 I.some(t)}}},dr=function(t){return{isValue:R,isError:N,getOr:_,getOrThunk:function(t){return t()},getOrDie:function(){return(e=String(t),function(){throw new Error(e)})();var e},or:_,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return dr(t)},mapError:function(e){return dr(e(t))},each:C,bind:function(e){return dr(t)},exists:R,forall:N,toOptional:I.none}},mr={value:fr,error:dr,fromOption:function(t,e){return t.fold((function(){return dr(e)}),fr)}},gr=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=lt(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=lt(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};gr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var hr=function(t){return t.fold(_,_)};function pr(t,e,n,r,o){return t(n,r)?I.some(n):w(o)&&o(n)?I.none():e(n,r,o)}var vr,br,yr,wr,xr,Cr,Sr,kr,Or,_r,Tr,Er,Ar,Dr,Mr,Rr,Nr,zr,Br,Pr,Ir=function(t,e,n){for(var r=t.dom,o=w(n)?n:R;r.parentNode;){r=r.parentNode;var i=ye.fromDom(r);if(e(i))return I.some(i);if(o(i))break}return I.none()},Lr=function(t,e,n){return pr((function(t,e){return e(t)}),Ir,t,e,n)},Hr=function(t,e){return Q(t.dom.childNodes,(function(t){return e(ye.fromDom(t))})).map(ye.fromDom)},Fr=function(t,e,n){return Ir(t,(function(t){return xe(t,e)}),n)},Vr=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ce(n)?I.none():I.from(n.querySelector(t)).map(ye.fromDom)}(e,t)},jr=function(t,e,n){return pr((function(t,e){return xe(t,e)}),Fr,t,e,n)},Ur=window.Promise?window.Promise:or,Wr=function(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)},qr=function(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)},Gr=function(t,e){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=Wr((function(){t.apply(this,r)}),e)};return r.stop=function(){clearTimeout(n)},r},$r={requestAnimationFrame:function(t,e){vr?vr.then(t):vr=new Ur((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:Wr,setInterval:qr,setEditorTimeout:function(t,e,n){return Wr((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=qr((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:Gr,throttle:Gr,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}},Xr=function(t,e){void 0===e&&(e={});var n=0,r={},o=ye.fromDom(t),i=ze(o),u=e.maxLoadTime||5e3,a=function(a,c,s){var l,f=ve._addCacheSuffix(a),d=function(t){return yt(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?$r.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=ye.fromTag("link",i.dom);Un(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();e.contentCssCors&&jn(v,"crossOrigin","anonymous"),e.referrerPolicy&&jn(v,"referrerpolicy",e.referrerPolicy),(l=v.dom).onload=p,l.onerror=h,b=v,nn(Ye(o),b),jn(v,"href",f)}else h();else g()},c=function(t){return sr((function(e){a(t,S(e,O(mr.value(t))),S(e,O(mr.error(t))))}))},s=function(t){var e=ve._addCacheSuffix(t);yt(r,e).each((function(t){var n,i;0===--t.count&&(delete r[e],n=t.id,i=Ye(o),Vr(i,"#"+n).each(un))}))};return{load:a,loadAll:function(t,e,n){var r;(r=W(t,c),lr(r,sr)).get((function(t){var r=$(t,(function(t){return t.isValue()}));r.fail.length>0?n(r.fail.map(hr)):e(r.pass.map(hr))}))},unload:s,unloadAll:function(t){q(t,(function(t){s(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}},Kr=function(){var t=new WeakMap;return{forElement:function(e,n){var r=Ke(e).dom;return I.from(t.get(r)).getOrThunk((function(){var e=Xr(r,n);return t.set(r,e),e}))}}}(),Yr=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}(),Jr=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,N),wt(e,_e(n))}},Qr=Jr(["h1","h2","h3","h4","h5","h6"]),Zr=Jr(["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"]),to=function(t){return Ae(t)&&!Zr(t)},eo=function(t){return Ae(t)&&"br"===_e(t)},no=Jr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),ro=Jr(["ul","ol","dl"]),oo=Jr(["li","dd","dt"]),io=Jr(["thead","tbody","tfoot"]),uo=Jr(["td","th"]),ao=Jr(["pre","script","textarea","style"]),co="\ufeff",so=function(t){return"\ufeff"===t},lo=function(t){return t.replace(/\uFEFF/g,"")},fo=wn,mo=En,go=function(t){return mo(t)&&(t=t.parentNode),fo(t)&&t.hasAttribute("data-mce-caret")},ho=function(t){return mo(t)&&so(t.data)},po=function(t){return go(t)||ho(t)},vo=function(t){return t.firstChild!==t.lastChild||!Rn(t.firstChild)},bo=function(t){var e=t.container();return!!En(e)&&(e.data.charAt(t.offset())===co||t.isAtStart()&&ho(e.previousSibling))},yo=function(t){var e=t.container();return!!En(e)&&(e.data.charAt(t.offset()-1)===co||t.isAtEnd()&&ho(e.nextSibling))},wo=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},xo=function(t){return mo(t)&&t.data[0]===co},Co=function(t){return mo(t)&&t.data[t.data.length-1]===co},So=function(t){return t&&t.hasAttribute("data-mce-caret")?(e=t.getElementsByTagName("br"),n=e[e.length-1],kn(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},ko=function(t){return go(t.startContainer)},Oo=zn,_o=Bn,To=Rn,Eo=En,Ao=xn(["script","style","textarea"]),Do=xn(["img","input","textarea","hr","iframe","video","audio","object","embed"]),Mo=xn(["table"]),Ro=po,No=function(t){return!Ro(t)&&(Eo(t)?!Ao(t.parentNode):Do(t)||To(t)||Mo(t)||zo(t))},zo=function(t){return!1===function(t){return wn(t)&&"true"===t.getAttribute("unselectable")}(t)&&_o(t)},Bo=function(t,e){return No(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(zo(t))return!1;if(Oo(t))return!0}return!0}(t,e)},Po=/^[ \t\r\n]*$/,Io=function(t){return Po.test(t)},Lo=function(t,e){var n,r,o,i=ye.fromDom(e),u=ye.fromDom(t);return n=u,r="pre,code",o=E(Se,i),Fr(n,r,o).isSome()},Ho=function(t,e){return No(t)&&!1===function(t,e){return En(t)&&Io(t.data)&&!1===Lo(t,e)}(t,e)||function(t){return wn(t)&&"A"===t.nodeName&&!t.hasAttribute("href")&&(t.hasAttribute("name")||t.hasAttribute("id"))}(t)||Fo(t)},Fo=Sn("data-mce-bookmark"),Vo=Sn("data-mce-bogus"),jo=(br="data-mce-bogus",yr="all",function(t){return wn(t)&&t.getAttribute(br)===yr}),Uo=function(t,e){return void 0===e&&(e=!0),function(t,e){var n=0;if(Ho(t,t))return!1;var r=t.firstChild;if(!r)return!0;var o=new Yr(r,t);do{if(e){if(jo(r)){r=o.next(!0);continue}if(Vo(r)){r=o.next();continue}}if(Rn(r))n++,r=o.next();else{if(Ho(r,t))return!1;r=o.next()}}while(r);return n<=1}(t.dom,e)},Wo=function(t,e){return y(t)&&(Ho(t,e)||to(ye.fromDom(t)))},qo=function(t){return function(t){return"span"===t.nodeName.toLowerCase()}(t)&&"bookmark"===t.getAttribute("data-mce-type")},Go=function(t,e){return En(t)&&t.data.length>0&&function(t,e){var n=new Yr(t,e).prev(!1),r=new Yr(t,e).next(!1),o=v(n)||Wo(n,e),i=v(r)||Wo(r,e);return o&&i}(t,e)},$o=function(t,e,n){var r=n||e;if(wn(e)&&qo(e))return e;for(var o=e.childNodes,i=o.length-1;i>=0;i--)$o(t,o[i],r);if(wn(e)){var u=e.childNodes;1===u.length&&qo(u[0])&&e.parentNode.insertBefore(u[0],e)}return function(t){return Mn(t)||Dn(t)}(e)||Ho(e,r)||function(t){return!!wn(t)&&t.childNodes.length>0}(e)||Go(e,r)||t.remove(e),e},Xo=ve.makeMap,Ko=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Yo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Jo=/[<>&\"\']/g,Qo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Zo={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:"Ÿ"},ti={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},ei={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},ni=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)),ti[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},ri=ni("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),oi=function(t,e){return t.replace(e?Ko:Yo,(function(t){return ti[t]||t}))},ii=function(t,e){return t.replace(e?Ko:Yo,(function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":ti[t]||"&#"+t.charCodeAt(0)+";"}))},ui=function(t,e,n){return n=n||ri,t.replace(e?Ko:Yo,(function(t){return ti[t]||n[t]||t}))},ai={encodeRaw:oi,encodeAllRaw:function(t){return(""+t).replace(Jo,(function(t){return ti[t]||t}))},encodeNumeric:ii,encodeNamed:ui,getEncodeFunc:function(t,e){var n=ni(e)||ri,r=Xo(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?Ko:Yo,(function(t){return void 0!==ti[t]?ti[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 ui(t,e,n)}:ui:r.numeric?ii:oi},decode:function(t){return t.replace(Qo,(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))):Zo[e]||String.fromCharCode(e):ei[t]||ri[t]||function(t){var e=ye.fromTag("div").dom;return e.innerHTML=t,e.textContent||e.innerText||t}(t)}))}},ci={},si={},li=ve.makeMap,fi=ve.each,di=ve.extend,mi=ve.explode,gi=ve.inArray,hi=function(t,e){return(t=ve.trim(t))?t.split(e||" "):[]},pi=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),fi(t,(function(t,r){n[r]=n[r.toUpperCase()]="map"===e?li(t,/[, ]/):mi(t,/[, ]/)}))),n},vi=function(t){var e={},n={},r=[],o={},i={},u=function(e,n,r){var o=t[e];return o?o=li(o,/[, ]/,li(o.toUpperCase(),/[, ]/)):(o=ci[e])||(o=li(n," ",li(n.toUpperCase()," ")),o=di(o,r),ci[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=hi(r));var s=hi(t);for(o=s.length;o--;)u={attributes:c(i=hi([e,n].join(" "))),attributesOrder:i,children:c(r,si)},a[s[o]]=u},s=function(t,e){var n,r,o,i,u=hi(t);n=u.length;for(var c=hi(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 ci[t]?ci[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(" "),fi(hi(u),(function(t){c(t,"",r)})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),fi(hi(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")),fi(hi("a form meter progress dfn"),(function(t){a[t]&&delete a[t].children[t]})),delete a.caption.children.table,delete a.script,ci[t]=a,a)}((t=t||{}).schema);!1===t.verify_html&&(t.valid_elements="*[*]");var c=pi(t.valid_styles),s=pi(t.invalid_styles,"map"),l=pi(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");fi((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=hi(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&&(dt(b,(function(t,e){g[e]=t})),h.push.apply(h,y)),l)for(i=0,u=(l=hi(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(gi(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=li(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),fi(a,(function(t,e){n[e]=t.children}))},S=function(t){var r=/^(~)?(.+)$/;t&&(ci.text_block_elements=ci.block_elements=null,fi(hi(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=di({},s)).removeEmptyAttrs,delete s.removeEmpty,e[c]=s}fi(n,(function(t,e){t[a]&&(n[e]=t=di({},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]+)\[([^\]]+)]$/;ci[t.schema]=null,e&&fi(hi(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]],fi(hi(i[3],"|"),(function(t){"-"===o?delete e[t]:e[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):(fi(a,(function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children})),"html5"!==t.schema&&fi(hi("strong/b em/i"),(function(t){var n=hi(t,"/");e[n[1]].outputName=n[0]})),fi(hi("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(t){e[t]&&(e[t].removeEmpty=!0)})),fi(hi("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){e[t].paddEmpty=!0})),fi(hi("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]"),fi({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=hi(t))})),t.invalid_elements&&fi(mi(t.invalid_elements),(function(t){e[t]&&delete e[t]})),_("span")||x("span[!data-mce-type|*]");var T=O(c),E=O(s),A=O(l),D=O(g),M=O(b),R=O(v),N=O(y),z=O(m),B=O(d),P=O(h),I=O(p),L=O(f),H=O(i),F=O(o);return{children:n,elements:e,getValidStyles:T,getValidClasses:A,getBlockElements:M,getInvalidStyles:E,getShortEndedElements:z,getTextBlockElements:R,getTextInlineElements:N,getBoolAttrs:D,getElementRule:_,getSelfClosingElements:B,getNonEmptyElements:P,getMoveCaretBeforeOnEnterElements:I,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);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}},bi=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)},yi=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,bi)},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)},_=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,bi)).replace(a,_),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)):dt(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}}},wi={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},xi=function(t){return t instanceof Event||w(t.initEvent)},Ci=function(t,e,n,r){var o,i=function(t,e){var n=null!=e?e:{};for(var r in t)wt(wi,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)||xi(t)}(e)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=N,w(e.preventDefault)?e.preventDefault():xi(e)&&(e.returnValue=!1)},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=N,w(e.stopPropagation)?e.stopPropagation():xi(e)&&(e.cancelBubble=!0)},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=N,i.stopPropagation()},function(t){return t.isDefaultPrevented===N||t.isDefaultPrevented===R}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?N:R,i.isPropagationStopped=!0===i.cancelBubble?N:R,i.isImmediatePropagationStopped=R)),i},Si=/^(?:mouse|contextmenu)|click/,ki=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},Oi=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},_i=function(t,e){var n=Ci(t.type,t,document,e);if(function(t){return y(t)&&Si.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(){Oi(t,"DOMContentLoaded",i),Oi(t,"load",i),n.domLoaded||(n.domLoaded=!0,e(o)),t=null};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():ki(t,"DOMContentLoaded",i),n.domLoaded||ki(t,"load",i)}},Ei=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(_i(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,_i({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=_i(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=_i(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,o)}),(i=f.events[o][a])?"ready"===a&&f.domLoaded?n(_i({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):ki(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],Oi(t,r.fakeName||u,r.nativeHandler,r.capture))}}else dt(a,(function(e,n){Oi(t,e.fakeName||n,e.nativeHandler,e.capture)})),a={};for(u in a)if(wt(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=_i({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}(),Ai="sizzle"+-new Date,Di=window.document,Mi=0,Ri=0,Ni=lu(),zi=lu(),Bi=lu(),Pi=function(t,e){return t===e&&(Ar=!0),0},Ii={}.hasOwnProperty,Li=[],Hi=Li.pop,Fi=Li.push,Vi=Li.push,ji=Li.slice,Ui=Li.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},Wi="[\\x20\\t\\r\\n\\f]",qi="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Gi="\\["+Wi+"*("+qi+")(?:"+Wi+"*([*^$|!~]?=)"+Wi+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+qi+"))|)"+Wi+"*\\]",$i=":("+qi+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Gi+")*)|.*)\\)|)",Xi=new RegExp("^"+Wi+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Wi+"+$","g"),Ki=new RegExp("^"+Wi+"*,"+Wi+"*"),Yi=new RegExp("^"+Wi+"*([>+~]|"+Wi+")"+Wi+"*"),Ji=new RegExp("="+Wi+"*([^\\]'\"]*?)"+Wi+"*\\]","g"),Qi=new RegExp($i),Zi=new RegExp("^"+qi+"$"),tu={ID:new RegExp("^#("+qi+")"),CLASS:new RegExp("^\\.("+qi+")"),TAG:new RegExp("^("+qi+"|[*])"),ATTR:new RegExp("^"+Gi),PSEUDO:new RegExp("^"+$i),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Wi+"*(even|odd|(([+-]|)(\\d*)n|)"+Wi+"*(?:([+-]|)"+Wi+"*(\\d+)|))"+Wi+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+Wi+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Wi+"*((?:-\\d)?\\d*)"+Wi+"*\\)|)(?=[^-]|$)","i")},eu=/^(?:input|select|textarea|button)$/i,nu=/^h\d$/i,ru=/^[^{]+\{\s*\[native \w/,ou=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,iu=/[+~]/,uu=/'|\\/g,au=new RegExp("\\\\([\\da-f]{1,6}"+Wi+"?|("+Wi+")|.)","ig"),cu=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{Vi.apply(Li=ji.call(Di.childNodes),Di.childNodes),Li[Di.childNodes.length].nodeType}catch(t){Vi={apply:Li.length?function(t,e){Fi.apply(t,ji.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var su=function(t,e,n,r){var o,i,u,a,c,s,l,f,d,m;if((e?e.ownerDocument||e:Di)!==Mr&&Dr(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(a=(e=e||Mr).nodeType)&&9!==a)return[];if(Nr&&!r){if(o=ou.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))&&Pr(e,i)&&i.id===u)return n.push(i),n}else{if(o[2])return Vi.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&wr.getElementsByClassName)return Vi.apply(n,e.getElementsByClassName(u)),n}if(wr.qsa&&(!zr||!zr.test(t))){if(f=l=Ai,d=e,m=9===a&&t,1===a&&"object"!==e.nodeName.toLowerCase()){for(s=kr(t),(l=e.getAttribute("id"))?f=l.replace(uu,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+pu(s[c]);d=iu.test(t)&&gu(e.parentNode)||e,m=s.join(",")}if(m)try{return Vi.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return _r(t.replace(Xi,"$1"),e,n,r)};function lu(){var t=[];return function e(n,r){return t.push(n+" ")>xr.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function fu(t){return t[Ai]=!0,t}function du(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 mu(t){return fu((function(e){return e=+e,fu((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 gu(t){return t&&void 0!==t.getElementsByTagName&&t}function hu(){}function pu(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function vu(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Ri++;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=[Mi,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[Ai]||(e[Ai]={}))[r])&&a[0]===Mi&&a[1]===i)return s[2]=a[2];if(c[r]=s,s[2]=t(e,n,u))return!0}}}function bu(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 yu(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 wu(t,e,n,r,o,i){return r&&!r[Ai]&&(r=wu(r)),o&&!o[Ai]&&(o=wu(o,i)),fu((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++)su(t,e[r],n);return n}(e||"*",a.nodeType?[a]:a,[]),p=!t||!i&&e?h:yu(h,d,t,a,c),v=n?o||(i?t:g||r)?[]:u:p;if(n&&n(p,v,a,c),r)for(s=yu(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?Ui.call(i,f):d[l])>-1&&(i[s]=!(u[s]=f))}}else v=yu(v===u?v.splice(g,v.length):v),o?o(null,u,v,c):Vi.apply(u,v)}))}function xu(t){for(var e,n,r,o=t.length,i=xr.relative[t[0].type],u=i||xr.relative[" "],a=i?1:0,c=vu((function(t){return t===e}),u,!0),s=vu((function(t){return Ui.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=xr.relative[t[a].type])l=[vu(bu(l),n)];else{if((n=xr.filter[t[a].type].apply(null,t[a].matches))[Ai]){for(r=++a;r<o&&!xr.relative[t[r].type];r++);return wu(a>1&&bu(l),a>1&&pu(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(Xi,"$1"),n,a<r&&xu(t.slice(a,r)),r<o&&xu(t=t.slice(r)),r<o&&pu(t))}l.push(n)}return bu(l)}wr=su.support={},Sr=su.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},Dr=su.setDocument=function(t){var e,n=t?t.ownerDocument||t:Di,r=n.defaultView;return n!==Mr&&9===n.nodeType&&n.documentElement?(Mr=n,Rr=n.documentElement,Nr=!Sr(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){Dr()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){Dr()}))),wr.attributes=!0,wr.getElementsByTagName=!0,wr.getElementsByClassName=ru.test(n.getElementsByClassName),wr.getById=!0,xr.find.ID=function(t,e){if(void 0!==e.getElementById&&Nr){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},xr.filter.ID=function(t){var e=t.replace(au,cu);return function(t){return t.getAttribute("id")===e}},xr.find.TAG=wr.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},xr.find.CLASS=wr.getElementsByClassName&&function(t,e){if(Nr)return e.getElementsByClassName(t)},Br=[],zr=[],wr.disconnectedMatch=!0,zr=zr.length&&new RegExp(zr.join("|")),Br=Br.length&&new RegExp(Br.join("|")),e=ru.test(Rr.compareDocumentPosition),Pr=e||ru.test(Rr.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},Pi=e?function(t,e){if(t===e)return Ar=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!wr.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===Di&&Pr(Di,t)?-1:e===n||e.ownerDocument===Di&&Pr(Di,e)?1:Er?Ui.call(Er,t)-Ui.call(Er,e):0:4&r?-1:1)}:function(t,e){if(t===e)return Ar=!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:Er?Ui.call(Er,t)-Ui.call(Er,e):0;if(i===u)return du(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?du(a[o],c[o]):a[o]===Di?-1:c[o]===Di?1:0},n):Mr},su.matches=function(t,e){return su(t,null,null,e)},su.matchesSelector=function(t,e){if((t.ownerDocument||t)!==Mr&&Dr(t),e=e.replace(Ji,"='$1']"),wr.matchesSelector&&Nr&&(!Br||!Br.test(e))&&(!zr||!zr.test(e)))try{var n=(void 0).call(t,e);if(n||wr.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return su(e,Mr,null,[t]).length>0},su.contains=function(t,e){return(t.ownerDocument||t)!==Mr&&Dr(t),Pr(t,e)},su.attr=function(t,e){(t.ownerDocument||t)!==Mr&&Dr(t);var n=xr.attrHandle[e.toLowerCase()],r=n&&Ii.call(xr.attrHandle,e.toLowerCase())?n(t,e,!Nr):void 0;return void 0!==r?r:wr.attributes||!Nr?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},su.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},su.uniqueSort=function(t){var e,n=[],r=0,o=0;if(Ar=!wr.detectDuplicates,Er=!wr.sortStable&&t.slice(0),t.sort(Pi),Ar){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return Er=null,t},Cr=su.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+=Cr(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=Cr(e);return n},(xr=su.selectors={cacheLength:50,createPseudo:fu,match:tu,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(au,cu),t[3]=(t[3]||t[4]||t[5]||"").replace(au,cu),"~="===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]||su.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]&&su.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return tu.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&Qi.test(n)&&(e=kr(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(au,cu).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("(^|"+Wi+")"+t+"("+Wi+"|$)"))&&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=su.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[Ai]||(p[Ai]={}))[t]||[])[0]===Mi&&s[1],d=s[0]===Mi&&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]=[Mi,m,d];break}}else if(b&&(s=(e[Ai]||(e[Ai]={}))[t])&&s[0]===Mi)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[Ai]||(f[Ai]={}))[t]=[Mi,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=xr.pseudos[t]||xr.setFilters[t.toLowerCase()]||su.error("unsupported pseudo: "+t);return r[Ai]?r(e):r.length>1?(n=[t,t,"",e],xr.setFilters.hasOwnProperty(t.toLowerCase())?fu((function(t,n){for(var o,i=r(t,e),u=i.length;u--;)t[o=Ui.call(t,i[u])]=!(n[o]=i[u])})):function(t){return r(t,0,n)}):r}},pseudos:{not:fu((function(t){var e=[],n=[],r=Or(t.replace(Xi,"$1"));return r[Ai]?fu((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:fu((function(t){return function(e){return su(t,e).length>0}})),contains:fu((function(t){return t=t.replace(au,cu),function(e){return(e.textContent||e.innerText||Cr(e)).indexOf(t)>-1}})),lang:fu((function(t){return Zi.test(t||"")||su.error("unsupported lang: "+t),t=t.replace(au,cu).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===Rr},focus:function(t){return t===Mr.activeElement&&(!Mr.hasFocus||Mr.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!xr.pseudos.empty(t)},header:function(t){return nu.test(t.nodeName)},input:function(t){return eu.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:mu((function(){return[0]})),last:mu((function(t,e){return[e-1]})),eq:mu((function(t,e,n){return[n<0?n+e:n]})),even:mu((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:mu((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:mu((function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t})),gt:mu((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=xr.pseudos.eq,q(["radio","checkbox","file","password","image"],(function(t){xr.pseudos[t]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(t)})),q(["submit","reset"],(function(t){xr.pseudos[t]=function(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}(t)})),hu.prototype=xr.filters=xr.pseudos,xr.setFilters=new hu,kr=su.tokenize=function(t,e){var n,r,o,i,u,a,c,s=zi[t+" "];if(s)return e?0:s.slice(0);for(u=t,a=[],c=xr.preFilter;u;){for(i in n&&!(r=Ki.exec(u))||(r&&(u=u.slice(r[0].length)||u),a.push(o=[])),n=!1,(r=Yi.exec(u))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Xi," ")}),u=u.slice(n.length)),xr.filter)xr.filter.hasOwnProperty(i)&&(!(r=tu[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?su.error(t):zi(t,a).slice(0)},Or=su.compile=function(t,e){var n,r=[],o=[],i=Bi[t+" "];if(!i){for(e||(e=kr(t)),n=e.length;n--;)(i=xu(e[n]))[Ai]?r.push(i):o.push(i);(i=Bi(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&&xr.find.TAG("*",c),b=Mi+=null==p?1:Math.random()||.1,y=v.length;for(c&&(Tr=i!==Mr&&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&&(Mi=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]=Hi.call(a));h=yu(h)}Vi.apply(a,h),c&&!o&&h.length>0&&d+e.length>1&&su.uniqueSort(a)}return c&&(Mi=b,Tr=p),g};return n?fu(o):o}(o,r))).selector=t}return i},_r=su.select=function(t,e,n,r){var o,i,u,a,c,s="function"==typeof t&&t,l=!r&&kr(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&&wr.getById&&9===e.nodeType&&Nr&&xr.relative[i[1].type]){if(!(e=(xr.find.ID(u.matches[0].replace(au,cu),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=tu.needsContext.test(t)?0:i.length;o--&&(u=i[o],!xr.relative[a=u.type]);)if((c=xr.find[a])&&(r=c(u.matches[0].replace(au,cu),iu.test(i[0].type)&&gu(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&pu(i)))return Vi.apply(n,r),n;break}}return(s||Or(t,l))(r,e,!Nr,n,iu.test(t)&&gu(e.parentNode)||e),n},wr.sortStable=Ai.split("").sort(Pi).join("")===Ai,wr.detectDuplicates=!!Ar,Dr(),wr.sortDetached=!0;var Cu=document,Su=Array.prototype.push,ku=Array.prototype.slice,Ou=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,_u=Ei.Event,Tu=ve.makeMap("children,contents,next,prev"),Eu=function(t){return void 0!==t},Au=function(t){return"string"==typeof t},Du=function(t,e){var n,r=(e=e||Cu).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},Mu=function(t,e,n,r){var o;if(Au(e))e=Du(e,qu(t[0]));else if(e.length&&!e.nodeType){if(e=Ku.makeArray(e),r)for(o=e.length-1;o>=0;o--)Mu(t,e[o],n,r);else for(o=0;o<e.length;o++)Mu(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},Ru=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Nu=function(t,e,n){var r,o;return e=Ku(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},zu=ve.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Bu=ve.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Pu={for:"htmlFor",class:"className",readonly:"readOnly"},Iu={float:"cssFloat"},Lu={},Hu={},Fu=function(t,e){return new Ku.fn.init(t,e)},Vu=/^\s*|\s*$/g,ju=function(t){return null==t?"":(""+t).replace(Vu,"")},Uu=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},Wu=function(t,e){var n=[];return Uu(t,(function(t,r){e(r,t)&&n.push(r)})),n},qu=function(t){return t?9===t.nodeType?t:t.ownerDocument:Cu};Fu.fn=Fu.prototype={constructor:Fu,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 Ku(t).attr(e);this.context=e=document}if(Au(t)){if(this.selector=t,!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Ou.exec(t)))return Ku(e).find(t);if(n[1])for(r=Du(t,qu(e)).firstChild;r;)Su.call(this,r),r=r.nextSibling;else{if(!(r=qu(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 ve.toArray(this)},add:function(t,e){var n,r;if(Au(t))return this.add(Ku(t));if(!1!==e)for(n=Ku.unique(this.toArray().concat(Ku.makeArray(t))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Su.apply(this,Ku.makeArray(t));return this},attr:function(t,e){var n,r=this;if("object"==typeof t)Uu(t,(function(t,e){r.attr(t,e)}));else{if(!Eu(e)){if(r[0]&&1===r[0].nodeType){if((n=Lu[t])&&n.get)return n.get(r[0],t);if(Bu[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=Lu[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=Pu[t]||t))Uu(t,(function(t,e){n.prop(t,e)}));else{if(!Eu(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)Uu(t,(function(t,e){o.css(t,e)}));else if(Eu(e))t=i(t),"number"!=typeof e||zu[t]||(e=e.toString()+"px"),o.each((function(){var n=this.style;if((r=Hu[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=Hu[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],_u.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(Eu(t)){e=this.length;try{for(;e--;)this[e].innerHTML=t}catch(n){Ku(this[e]).empty().append(t)}return this}return this[0]?this[0].innerHTML:""},text:function(t){var e;if(Eu(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 Mu(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return Mu(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?Mu(t,arguments,(function(t){this.parentNode.insertBefore(t,this)})):t},after:function(){var t=this;return t[0]&&t[0].parentNode?Mu(t,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):t},appendTo:function(t){return Ku(t).append(this),this},prependTo:function(t){return Ku(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(){Ku(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){Ku(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),Ku(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(" ")?Uu(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o=Ru(r,t);if(o!==e){var i=r.className;o?r.className=ju((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}})),n)},hasClass:function(t){return Ru(this[0],t)},each:function(t){return Uu(this,t)},on:function(t,e){return this.each((function(){_u.bind(this,t,e)}))},off:function(t,e){return this.each((function(){_u.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?_u.fire(this,t.type,t):_u.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return Ku(ku.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++)Ku.find(t,this[e],r);return Ku(r)},filter:function(t){return Ku("function"==typeof t?Wu(this.toArray(),(function(e,n){return t(n,e)})):Ku.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof Ku&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&Ku(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),Ku(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:Su,sort:Array.prototype.sort,splice:Array.prototype.splice},ve.extend(Fu,{extend:ve.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:ve.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:ve.isArray,each:Uu,trim:ju,grep:Wu,find:su,expr:su.selectors,unique:su.uniqueSort,text:su.getText,contains:su.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?Ku.find.matchesSelector(e[0],t)?[e[0]]:[]:Ku.find.matches(t,e)}});var Gu=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof Ku&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&Ku(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},$u=function(t,e,n,r){var o=[];for(r instanceof Ku&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&Ku(t).is(r))break}o.push(t)}return o},Xu=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};Uu({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Gu(t,"parentNode")},next:function(t){return Xu(t,"nextSibling",1)},prev:function(t){return Xu(t,"previousSibling",1)},children:function(t){return $u(t.firstChild,"nextSibling",1)},contents:function(t){return ve.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){Fu.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(Ku.isArray(t)?r.push.apply(r,t):r.push(t))})),this.length>1&&(Tu[t]||(r=Ku.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=Ku(r);return n?o.filter(n):o}})),Uu({parentsUntil:function(t,e){return Gu(t,"parentNode",e)},nextUntil:function(t,e){return $u(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return $u(t,"previousSibling",1,e).slice(1)}},(function(t,e){Fu.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(Ku.isArray(t)?o.push.apply(o,t):o.push(t))})),this.length>1&&(o=Ku.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=Ku(o);return r?i.filter(r):i}})),Fu.fn.is=function(t){return!!t&&this.filter(t).length>0},Fu.fn.init.prototype=Fu.fn,Fu.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 Ku.extend(n,this),n},Fu.attrHooks=Lu,Fu.cssHooks=Hu;var Ku=Fu,Yu=ve.each,Ju=ve.grep,Qu=de.ie,Zu=/^([a-z0-9],?)+$/i,ta=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)},ea=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},na=function(t,e){void 0===e&&(e={});var n={},r=window,o={},i=0,u=Kr.forElement(ye.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),a=[],c=e.schema?e.schema:vi({}),s=yi({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),l=e.ownEvents?new Ei:Ei.Event,f=c.getBlockElements(),m=Ku.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 er(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=de.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}},_=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(Zu.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 su(e,i[0].ownerDocument||i[0],null,i).length>0},T=function(t,e,n,r){var o,i=[],u=g(t);for(r=void 0===r,n=n||("BODY"!==w().nodeName?w().parentNode:null),ve.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return _(t,o)});u&&!(u===n||b(u.nodeType)||Dn(u)||Mn(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,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(ve.isArray(o)&&(o.length||0===o.length))return r=[],Yu(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){Yu(e,(function(t,e){y(n,e,t)}))}))},M=function(t,e){var n=h(t);Qu?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){Ku("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)},R=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)}))},N=function(e,n,r){return R(t.createElement(e),e,n,r,!0)},z=ai.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]},P=function(t,e,n){h(t).toggleClass(e,n).each((function(){""===this.className&&Ku(this).attr("class",null)}))},I=function(t,e,n){return A(e,(function(e){return ve.is(e,"array")&&(t=t.cloneNode(!0)),n&&Yu(Ju(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))},L=function(t){if(wn(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(ve.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(ve.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&&wn(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(!Qu||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return Yu(v(e),(function(t){y(r,t.nodeName,p(e,t.nodeName))})),r},getRoot:w,getViewPort:function(t){var e=vn(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(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:T,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 su(n,g(r)||e.root_element||t,[])},is:_,add:R,create:N,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)xt(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&&ta(s,o)},getStyle:S,setStyles:function(t,n){var r=h(t).css(n);e.update_styles&&ta(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!==na.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){P(t,e,!1)},hasClass:function(t,e){return h(t).hasClass(e)},toggleClass:P,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 wn(e)?e.outerHTML:Ku("<div></div>").append(Ku(e).clone()).html()},setOuterHTML:function(t,e){h(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}B(Ku(this).html(e),!0)}))},decode:ai.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:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=N(e),Yu(v(t),(function(e){y(n,e.nodeName,p(t,e.nodeName))})),I(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(ve.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 Yr(t,t.parentNode),u=c?c.getWhiteSpaceElements():{};e=e||(c?c.getNonEmptyElements():null);do{if(n=t.nodeType,wn(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:ea,split:function(t,e,n){var r,o,i,u=H();if(t&&e)return u.setStart(t.parentNode,ea(t)),u.setEnd(e.parentNode,ea(e)),r=u.extractContents(),(u=H()).setStart(e.parentNode,ea(e)+1),u.setEnd(t.parentNode,ea(t)+1),o=u.extractContents(),(i=t.parentNode).insertBefore($o(U,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore($o(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])}dt(o,(function(t,e){u.unload(e),delete o[e]})),su.setDocument&&su.setDocument()},isChildOf:function(t,e){if(Qu){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&&null!==r&&(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};na.DOM=na(document),na.nodeIndex=ea;var ra=na.DOM,oa=ve.each,ia=ve.grep,ua=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=ra,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=ve._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){oa(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=ia(t);if(t.length=0,oa(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,oa(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}(),aa=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},ca={},sa=aa("en"),la=function(){return yt(ca,sa.get())},fa={getData:function(){return mt(ca,(function(t){return Dt({},t)}))},setCode:function(t){t&&sa.set(t)},getCode:function(){return sa.get()},add:function(t,e){var n=ca[t];n||(ca[t]=n={}),dt(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){var e,n=la().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 yt(n,e.toLowerCase()).map(r).getOr(e)},u=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(m(e=t)&&wt(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 wt(a,e)?r(a[e]):t})))}return u(i(t))},isRtl:function(){return la().bind((function(t){return yt(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return wt(ca,t)}},da=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=da.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(ua))}(t,r,c,s)};n[t]?d():ua.ScriptLoader.add(f,d,s,l)}},c=function(t,o,i){void 0===i&&(i="added"),wt(n,t)&&"added"===i?o():wt(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!==da.languageLoad&&c(t,(function(){var r=fa.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||ua.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){ua.ScriptLoader.add(r+"/"+t)}))},load:a,waitFor:c}};da.languageLoad=!0,da.baseURL="",da.PluginManager=da(),da.ThemeManager=da();var ma=function(){var t=function(t){var e=aa(I.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(I.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(I.some(t))}}}(C);return Dt(Dt({},t),{on:function(e){return t.get().each(e)}})},ga=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))}}},ha=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)}}},pa=function(t,e){var n=Wn(t,e);return void 0===n||""===n?[]:n.split(" ")},va=function(t){return void 0!==t.dom.classList},ba=function(t,e){return function(t,e,n){var r=pa(t,e).concat([n]);return jn(t,e,r.join(" ")),!0}(t,"class",e)},ya=function(t,e){return function(t,e,n){var r=X(pa(t,e),(function(t){return t!==n}));return r.length>0?jn(t,e,r.join(" ")):Gn(t,e),!1}(t,"class",e)},wa=function(t,e){va(t)?t.dom.classList.add(e):ba(t,e)},xa=function(t){0===(va(t)?t.dom.classList:function(t){return pa(t,"class")}(t)).length&&Gn(t,"class")},Ca=function(t,e){return va(t)&&t.dom.classList.contains(e)},Sa=function(t,e){var n=[];return q(Ve(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(Sa(t,e))})),n},ka=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return Ce(n)?[]:W(n.querySelectorAll(t),ye.fromDom)}(e,t)},Oa=O("mce-annotation"),_a=O("data-mce-annotation"),Ta=O("data-mce-annotation-uid"),Ea=function(t,e){var n=t.selection.getRng(),r=ye.fromDom(n.startContainer),o=ye.fromDom(t.getBody()),i=e.fold((function(){return"."+Oa()}),(function(t){return"["+_a()+'="'+t+'"]'})),u=je(r,n.startOffset).getOr(r),a=jr(u,i,(function(t){return Se(t,o)})),c=function(t,e){return function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}(t,e)?I.some(Wn(t,e)):I.none()};return a.bind((function(e){return c(e,""+Ta()).bind((function(n){return c(e,""+_a()).map((function(e){var r=Aa(t,n);return{uid:n,name:e,elements:r}}))}))}))},Aa=function(t,e){var n=ye.fromDom(t.getBody());return ka(n,"["+Ta()+'="'+e+'"]')},Da=function(t,e){var n=aa({}),r=function(){return{listeners:[],previous:ma()}},o=function(t,e){i(t,(function(t){return e(t),t}))},i=function(t,e){var o=n.get(),i=e(yt(o,t).getOrThunk(r));o[t]=i,n.set(o)},u=ha((function(){var e=n.get(),r=ot(lt(e));q(r,(function(e){i(e,(function(n){var r=n.previous.get();return Ea(t,I.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;Ln(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])}}))}}},Ma=function(t,e){t.on("init",(function(){t.serializer.addNodeFilter("span",(function(t){q(t,(function(t){(function(t){return I.from(t.attr(_a())).bind(e.lookup)})(t).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}))},Ra=0,Na=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Ra+String(e)},za=function(t,e){var n,r,o=Ne(t).dom,i=ye.fromDom(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Ve(ye.fromDom(r)));rn(i,u),on(t),nn(t,i)},Ba=function(t,e){return ye.fromDom(t.dom.cloneNode(e))},Pa=function(t){return Ba(t,!1)},Ia=function(t){return Ba(t,!0)},La=function(t,e,n){void 0===n&&(n=R);var r=new Yr(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!En(e)&&!n(e));return I.from(e).filter(En)};return{current:function(){return I.from(r.current()).filter(En)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Ha=function(t,e){var n=e||function(e){return t.isBlock(e)||Rn(e)||Bn(e)},r=function(t,e,n,o){if(En(t)){var i=o(t,e,t.data);if(-1!==i)return I.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=La(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=La(t,i,n);return r(t,e,(function(){return u.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}},Fa=Math.round,Va=function(t){return t?{left:Fa(t.left),top:Fa(t.top),bottom:Fa(t.bottom),right:Fa(t.right),width:Fa(t.width),height:Fa(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},ja=function(t,e){return t=Va(t),e?t.right=t.left:(t.left=t.left+t.width,t.right=t.left),t.width=0,t},Ua=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},Wa=function(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&Ua(e.top-t.bottom,t,e)},qa=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&Ua(e.bottom-t.top,t,e)},Ga=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},$a=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},Xa=function(t,e){if(wn(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},Ka=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︯ﾞ-ﾟ]"),Ya=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&Ka.test(t)},Ja=wn,Qa=No,Za=Cn("display","block table"),tc=Cn("float","left right"),ec=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}}(Ja,Qa,A(tc)),nc=A(Cn("white-space","pre pre-line pre-wrap")),rc=En,oc=Rn,ic=na.nodeIndex,uc=function(t,e){return e<0&&wn(t)&&t.hasChildNodes()?void 0:Xa(t,e)},ac=function(t){return"createRange"in t?t.createRange():na.DOM.createRng()},cc=function(t){return t&&/[\r\n\t ]/.test(t)},sc=function(t){return!!t.setStart&&!!t.setEnd},lc=function(t){var e=t.startContainer,n=t.startOffset;if(cc(t.toString())&&nc(e.parentNode)&&En(e)){var r=e.data;if(cc(r[n-1])||cc(r[n+1]))return!0}return!1},fc=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},dc=function(t){var e,n=t.getClientRects();return e=n.length>0?Va(n[0]):Va(t.getBoundingClientRect()),!sc(t)&&oc(t)&&fc(e)?function(t){var e=t.ownerDocument,n=ac(e),r=e.createTextNode(" "),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=Va(n.getBoundingClientRect());return o.removeChild(r),i}(t):fc(e)&&sc(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&En(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),dc(i)}return null}(t):e},mc=function(t,e){var n=ja(t,e);return n.width=1,n.right=n.left+1,n},gc=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=ac(t.ownerDocument);if(r<t.data.length){if(Ya(t.data[r]))return e;if(Ya(t.data[r-1])&&(o.setStart(t,r),o.setEnd(t,r+1),!lc(o)))return n(mc(dc(o),!1)),e}r>0&&(o.setStart(t,r-1),o.setEnd(t,r),lc(o)||n(mc(dc(o),!1))),r<t.data.length&&(o.setStart(t,r),o.setEnd(t,r+1),lc(o)||n(mc(dc(o),!0)))},o=t.container(),i=t.offset();if(rc(o))return r(o,i),e;if(Ja(o))if(t.isAtEnd()){var u=uc(o,i);rc(u)&&r(u,u.data.length),ec(u)&&!oc(u)&&n(mc(dc(u),!1))}else{u=uc(o,i);if(rc(u)&&r(u,0),ec(u)&&t.isAtEnd())return n(mc(dc(u),!1)),e;var a=uc(t.container(),t.offset()-1);ec(a)&&!oc(a)&&(Za(a)||Za(u)||!ec(u))&&n(mc(dc(a),!1)),ec(u)&&n(mc(dc(u),!0))}return e},hc=function(t,e,n){var r=function(){return n||(n=gc(hc(t,e))),n};return{container:O(t),offset:O(e),toRange:function(){var n=ac(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return rc(t),0===e},isAtEnd:function(){return rc(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return uc(t,n?e-1:e)}}};hc.fromRangeStart=function(t){return hc(t.startContainer,t.startOffset)},hc.fromRangeEnd=function(t){return hc(t.endContainer,t.endOffset)},hc.after=function(t){return hc(t.parentNode,ic(t)+1)},hc.before=function(t){return hc(t.parentNode,ic(t))},hc.isAbove=function(t,e){return Hn(ut(e.getClientRects()),at(t.getClientRects()),Wa).getOr(!1)},hc.isBelow=function(t,e){return Hn(at(e.getClientRects()),ut(t.getClientRects()),qa).getOr(!1)},hc.isAtStart=function(t){return!!t&&t.isAtStart()},hc.isAtEnd=function(t){return!!t&&t.isAtEnd()},hc.isTextPosition=function(t){return!!t&&En(t.container())},hc.isElementPosition=function(t){return!1===hc.isTextPosition(t)};var pc,vc=function(t,e){En(e)&&0===e.data.length&&t.remove(e)},bc=function(t,e,n){Mn(n)?function(t,e,n){var r=I.from(n.firstChild),o=I.from(n.lastChild);e.insertNode(n),r.each((function(e){return vc(t,e.previousSibling)})),o.each((function(e){return vc(t,e.nextSibling)}))}(t,e,n):function(t,e,n){e.insertNode(n),vc(t,n.previousSibling),vc(t,n.nextSibling)}(t,e,n)},yc=En,wc=kn,xc=na.nodeIndex,Cc=function(t){var e=t.parentNode;return wc(e)?Cc(e):e},Sc=function(t){return t?Tt(t.childNodes,(function(t,e){return wc(e)&&"BR"!==e.nodeName?t=t.concat(Sc(e)):t.push(e),t}),[]):[]},kc=function(t){return function(e){return t===e}},Oc=function(t){return(yc(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=Sc(Cc(t)),n=Et(e,kc(t),t),e=e.slice(0,n+1);var r=Tt(e,(function(t,n,r){return yc(n)&&yc(e[r-1])&&t++,t}),0);return e=Ot(e,xn([t.nodeName])),(n=Et(e,kc(t),t))-r}(t)+"]"},_c=function(t,e){var n,r,o,i,u,a=[];return n=e.container(),r=e.offset(),yc(n)?o=function(t,e){for(;(t=t.previousSibling)&&yc(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(Oc(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=Ot(u,A(kn)),(a=a.concat(kt(u,(function(t){return Oc(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=Sc(t);return r=Ot(r,(function(t,e){return!yc(t)||!yc(r[e-1])})),(r=Ot(r,xn([e])))[n]}(t,n[1],parseInt(n[2],10))):null}),t);return i?yc(i)?function(t,e){for(var n,r=t,o=0;yc(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!yc(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return yc(t)&&e>t.data.length&&(e=t.data.length),hc(t,e)}(i,parseInt(n,10)):(n="after"===n?xc(i)+1:xc(i),hc(i.parentNode,n)):null},Ec=Bn,Ac=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(En(u)?c.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&En(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},Dc=function(t,e,n){var r=0;return ve.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r},Mc=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],wn(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))},Rc=function(t){return Mc(t,!0),Mc(t,!1),t},Nc=function(t,e){var n;if(wn(t)&&(t=Xa(t,e),Ec(t)))return t;if(po(t)){if(En(t)&&go(t)&&(t=t.parentNode),n=t.previousSibling,Ec(n))return n;if(n=t.nextSibling,Ec(n))return n}},zc=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Ec(r)||"IMG"===o)return{name:o,index:Dc(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:Dc(n.dom,o,u)}:function(t,e,n,r){var o=e.dom,i={};return i.start=Ac(o,t,n,r,!0),e.isCollapsed()||(i.end=Ac(o,t,n,r,!1)),ko(r)&&(i.isFakeCaret=!0),i}(t,n,e,i)},Bc=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)},Pc=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:Dc(n,a,u)};var c=Rc(r.cloneRange());if(!i){c.collapse(!1);var s=Bc(n,o+"_end",e);bc(n,c,s)}(r=Rc(r)).collapse(!0);var l=Bc(n,o+"_start",e);return bc(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},Ic=function(t,e,n){return 2===e?zc(lo,n,t):3===e?function(t){var e=t.getRng();return{start:_c(t.dom.getRoot(),hc.fromRangeStart(e)),end:_c(t.dom.getRoot(),hc.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):Pc(t,!1)},Lc=E(zc,_,!0),Hc=na.DOM,Fc=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return yt(o,t.id).getOr(n)}return r},Vc=function(t){return t.getParam("content_security_policy","")},jc=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},Uc=function(t){return t.getParam("forced_root_block_attrs",{})},Wc=function(t){return t.getParam("automatic_uploads",!0,"boolean")},qc=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},Gc=function(t){return t.getParam("icons","","string")},$c=function(t){return t.getParam("images_upload_url","","string")},Xc=function(t){return t.getParam("images_upload_base_path","","string")},Kc=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},Yc=function(t){return t.getParam("images_upload_handler",null,"function")},Jc=function(t){return t.getParam("content_css_cors",!1,"boolean")},Qc=function(t){return t.getParam("referrer_policy","","string")},Zc=function(t){return t.getParam("language","en","string")},ts=function(t){return t.getParam("indent_use_margin",!1)},es=function(t){var e=t.getParam("font_css",[]);return g(e)?e:W(e.split(","),Ft)},ns=function(t){var e=t.getParam("object_resizing");return!1!==e&&!de.iOS&&(d(e)?e:"table,img,figure.image,div,video,iframe")},rs=function(t){return t.getParam("event_root")},os=function(t){return t.getParam("theme")},is=function(t){return t.getParam("validate")},us=function(t){return!1!==t.getParam("inline_boundaries")},as=function(t){return t.getParam("content_css_cors")},cs=function(t){return t.getParam("plugins","","string")},ss=wn,ls=En,fs=function(t){var e=t.parentNode;e&&e.removeChild(t)},ds=function(t){var e=lo(t);return{count:t.length-e.length,text:e}},ms=function(t){for(var e;-1!==(e=t.data.lastIndexOf(co));)t.deleteData(e,1)},gs=function(t,e){return bs(t),e},hs=function(t,e){var n=e.container(),r=function(t,e){var n=V(t,e);return-1===n?I.none():I.some(n)}(ct(n.childNodes),t).map((function(t){return t<e.offset()?hc(n,e.offset()-1):e})).getOr(e);return bs(t),r},ps=function(t,e){return ls(t)&&e.container()===t?function(t,e){var n=ds(t.data.substr(0,e.offset())),r=ds(t.data.substr(e.offset()));return(n.text+r.text).length>0?(ms(t),hc(t,e.offset()-n.count)):e}(t,e):gs(t,e)},vs=function(t,e){return hc.isTextPosition(e)?ps(t,e):function(t,e){return e.container()===t.parentNode?hs(t,e):gs(t,e)}(t,e)},bs=function(t){ss(t)&&po(t)&&(vo(t)?t.removeAttribute("data-mce-caret"):fs(t)),ls(t)&&(ms(t),0===t.data.length&&fs(t))},ys=re().browser,ws=Bn,xs=In,Cs=Pn,Ss=function(t,e,n){var r,o,i=ja(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},ks=function(t,e,n,r){var o,i,u=ma(),a=jc(t),c=a.length>0?a:"p",s=function(){!function(t){for(var e=ka(ye.fromDom(t),"*[contentEditable=false],video,audio,embed,object"),n=0;n<e.length;n++){var r,o=e[n].dom,i=o.previousSibling;if(Co(i))1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1);if(i=o.nextSibling,xo(i))1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1)}}(e),i&&(bs(i),i=null),u.on((function(t){Ku(t.caret).remove(),u.clear()})),o&&($r.clearInterval(o),o=void 0)},l=function(){o=$r.setInterval((function(){r()?Ku("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):Ku("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500)};return{show:function(t,r){var o;if(s(),Cs(r))return null;if(!n(r))return i=function(t,e){var n=t.ownerDocument.createTextNode(co),r=t.parentNode;if(e){o=t.previousSibling;if(mo(o)){if(po(o))return o;if(Co(o))return o.splitText(o.data.length-1)}r.insertBefore(n,t)}else{var o=t.nextSibling;if(mo(o)){if(po(o))return o;if(xo(o))return o.splitText(1),o}t.nextSibling?r.insertBefore(n,t.nextSibling):r.appendChild(n)}return n}(r,t),o=r.ownerDocument.createRange(),_s(i.nextSibling)?(o.setStart(i,0),o.setEnd(i,0)):(o.setStart(i,1),o.setEnd(i,1)),o;i=wo(c,r,t);var a=Ss(e,r,t);Ku(i).css("top",a.top);var f=Ku('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(Dt({},a)).appendTo(e)[0];return u.set({caret:f,element:r,before:t}),t&&Ku(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=Ss(e,t.element,t.before);Ku(t.caret).css(Dt({},n))}))},destroy:function(){return $r.clearInterval(o)}}},Os=function(){return ys.isIE()||ys.isEdge()||ys.isFirefox()},_s=function(t){return ws(t)||xs(t)},Ts=function(t){return _s(t)||On(t)&&Os()},Es=Bn,As=In,Ds=Cn("display","block table table-cell table-caption list-item"),Ms=po,Rs=go,Ns=wn,zs=No,Bs=function(t){return t>0},Ps=function(t){return t<0},Is=function(t,e){for(var n;n=t(e);)if(!Rs(n))return n;return null},Ls=function(t,e,n,r,o){var i=new Yr(t,r),u=Es(t)||Rs(t);if(Ps(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(Bs(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},Hs=function(t,e){for(;t&&t!==e;){if(Ds(t))return t;t=t.parentNode}return null},Fs=function(t,e,n){return Hs(t.container(),n)===Hs(e.container(),n)},Vs=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return Ns(n)?n.childNodes[r+t]:null},js=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},Us=function(t,e,n){return Hs(e,t)===Hs(n,t)},Ws=function(t,e,n){for(var r=t?"previousSibling":"nextSibling";n&&n!==e;){var o=n[r];if(Ms(o)&&(o=o[r]),Es(o)||As(o)){if(Us(e,o,n))return o;break}if(zs(o))break;n=n.parentNode}return null},qs=E(js,!0),Gs=E(js,!1),$s=function(t,e,n){var r,o=E(Ws,!0,e),i=E(Ws,!1,e),u=n.startContainer,a=n.startOffset;if(go(u)){Ns(u)||(u=u.parentNode);var c=u.getAttribute("data-mce-caret");if("before"===c&&(r=u.nextSibling,Ts(r)))return qs(r);if("after"===c&&(r=u.previousSibling,Ts(r)))return Gs(r)}if(!n.collapsed)return n;if(En(u)){if(Ms(u)){if(1===t){if(r=i(u))return qs(r);if(r=o(u))return Gs(r)}if(-1===t){if(r=o(u))return Gs(r);if(r=i(u))return qs(r)}return n}if(Co(u)&&a>=u.data.length-1)return 1===t&&(r=i(u))?qs(r):n;if(xo(u)&&a<=1)return-1===t&&(r=o(u))?Gs(r):n;if(a===u.data.length)return(r=i(u))?qs(r):n;if(0===a)return(r=o(u))?Gs(r):n}return n},Xs=function(t,e){return I.from(Vs(t?0:-1,e)).filter(Es)},Ks=function(t,e,n){var r=$s(t,e,n);return-1===t?hc.fromRangeStart(r):hc.fromRangeEnd(r)},Ys=function(t){return I.from(t.getNode()).map(ye.fromDom)},Js=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},Qs=function(t,e){var n=Fs(t,e);return!(n||!Rn(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(pc||(pc={}));var Zs,tl=Bn,el=En,nl=wn,rl=Rn,ol=No,il=function(t){return Do(t)||function(t){return!!zo(t)&&!0!==Y(ct(t.getElementsByTagName("*")),(function(t,e){return t||Oo(e)}),!1)}(t)},ul=Bo,al=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},cl=function(t,e){if(Bs(t)){if(ol(e.previousSibling)&&!el(e.previousSibling))return hc.before(e);if(el(e))return hc(e,0)}if(Ps(t)){if(ol(e.nextSibling)&&!el(e.nextSibling))return hc.after(e);if(el(e))return hc(e,e.data.length)}return Ps(t)?rl(e)?hc.before(e):hc.after(e):hc.before(e)},sl=function(t,e,n){var r,o,i,u;if(!nl(n)||!e)return null;if(e.isEqual(hc.after(n))&&n.lastChild){if(u=hc.after(n.lastChild),Ps(t)&&ol(n.lastChild)&&nl(n.lastChild))return rl(n.lastChild)?hc.before(n.lastChild):u}else u=e;var a=u.container(),c=u.offset();if(el(a)){if(Ps(t)&&c>0)return hc(a,--c);if(Bs(t)&&c<a.length)return hc(a,++c);r=a}else{if(Ps(t)&&c>0&&(o=al(a,c-1),ol(o)))return!il(o)&&(i=Ls(o,t,ul,o))?el(i)?hc(i,i.data.length):hc.after(i):el(o)?hc(o,o.data.length):hc.before(o);if(Bs(t)&&c<a.childNodes.length&&(o=al(a,c),ol(o)))return rl(o)?function(t,e){var n=e.nextSibling;return n&&ol(n)?el(n)?hc(n,0):hc.before(n):sl(pc.Forwards,hc.after(e),t)}(n,o):!il(o)&&(i=Ls(o,t,ul,o))?el(i)?hc(i,0):hc.before(i):el(o)?hc(o,0):hc.after(o);r=o||u.getNode()}if((Bs(t)&&u.isAtEnd()||Ps(t)&&u.isAtStart())&&(r=Ls(r,t,N,n,!0),ul(r,n)))return cl(t,r);o=Ls(r,t,ul,n);var s=At(X(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(a,n),tl));return!s||o&&s.contains(o)?o?cl(t,o):null:u=Bs(t)?hc.after(s):hc.before(s)},ll=function(t){return{next:function(e){return sl(pc.Forwards,e,t)},prev:function(e){return sl(pc.Backwards,e,t)}}},fl=function(t){return hc.isTextPosition(t)?0===t.offset():No(t.getNode())},dl=function(t){if(hc.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return No(t.getNode(!0))},ml=function(t,e){return!hc.isTextPosition(t)&&!hc.isTextPosition(e)&&t.getNode()===e.getNode(!0)},gl=function(t,e,n){return t?!ml(e,n)&&(r=e,!(!hc.isTextPosition(r)&&Rn(r.getNode())))&&dl(e)&&fl(n):!ml(n,e)&&fl(e)&&dl(n);var r},hl=function(t,e,n){var r=ll(e);return I.from(t?r.next(n):r.prev(n))},pl=function(t,e,n){return hl(t,e,n).bind((function(r){return Fs(n,r,e)&&gl(t,n,r)?hl(t,e,r):I.some(r)}))},vl=function(t,e,n,r){return pl(t,e,n).bind((function(n){return r(n)?vl(t,e,n,r):I.some(n)}))},bl=function(t,e){var n,r=t?e.firstChild:e.lastChild;return En(r)?I.some(hc(r,t?0:r.data.length)):r?No(r)?I.some(t?hc.before(r):Rn(n=r)?hc.before(n):hc.after(n)):function(t,e,n){var r=t?hc.before(n):hc.after(n);return hl(t,e,r)}(t,e,r):I.none()},yl=E(hl,!0),wl=E(hl,!1),xl=E(bl,!0),Cl=E(bl,!1),Sl=function(t){return wn(t)&&"_mce_caret"===t.id},kl=function(t,e){for(;e&&e!==t;){if("_mce_caret"===e.id)return e;e=e.parentNode}return null},Ol=function(t){return ve.isArray(t.start)},_l=function(t,e){return wn(e)&&t.isBlock(e)&&!e.innerHTML&&!de.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},Tl=function(t,e){return Cl(t).fold(R,(function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0}))},El=function(t,e,n){return!(!function(t){return!1===t.hasChildNodes()}(e)||!kl(t,e))&&(function(t,e){var n=t.ownerDocument.createTextNode(co);t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),!0)},Al=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,El(s,i,r))return!0;if(c[o]>a.length-1)return!!El(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},Dl=function(t){return En(t)&&t.data.length>0},Ml=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):Dl(s.nextSibling)?(r=s.nextSibling,o=0):Dl(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):Dl(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,ve.each(ve.grep(s.childNodes),(function(t){En(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));s=t.get(n.id+"_"+e);)t.remove(s,!0);u&&i&&u.nodeType===i.nodeType&&En(u)&&!de.opera&&(o=u.nodeValue.length,u.appendData(i.nodeValue),t.remove(i),a=u,c=o)}return I.some(hc(a,c))}return I.none()},Rl=function(t,e){var n=t.dom;if(e){if(Ol(e))return function(t,e){var n=t.createRng();return Al(t,!0,e,n)&&Al(t,!1,e,n)?I.some(n):I.none()}(n,e);if(function(t){return d(t.start)}(e))return I.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 wt(t,"id")}(e))return function(t,e){var n=Ml(t,"start",e),r=Ml(t,"end",e);return Hn(n,r.or(n),(function(e,n){var r=t.createRng();return r.setStart(_l(t,e.container()),e.offset()),r.setEnd(_l(t,n.container()),n.offset()),r}))}(n,e);if(function(t){return wt(t,"name")}(e))return function(t,e){return I.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 wt(t,"rng")}(e))return I.some(e.rng)}return I.none()},Nl=function(t,e,n){return Ic(t,e,n)},zl=function(t,e){Rl(t,e).each((function(e){t.setRng(e)}))},Bl=function(t){return wn(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Pl=(Zs=" ",function(t){return Zs===t}),Il=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Ll=function(t){return!Il(t)&&!Pl(t)},Hl=function(t){return!!t.nodeType},Fl=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]))&&wn(o)){var i=o.childNodes,u=void 0;r<i.length?(o=i[r],u=new Yr(o,t.getParent(o,t.isBlock))):(o=i[i.length-1],(u=new Yr(o,t.getParent(o,t.isBlock))).next(!0));for(var a=u.current();a;a=u.next())if(En(a)&&!Wl(a))return n.setStart(a,0),void e.setRng(n)}},Vl=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(wn(t)||!Wl(t))return t}},jl=function(t,e){return Hl(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},Ul=function(t,e,n){return t.schema.isValidChild(e,n)},Wl=function(t,e){if(void 0===e&&(e=!1),y(t)&&En(t)){var n=e?t.data.replace(/ /g," "):t.data;return Io(n)}return!1},ql=function(t,e){return w(t)?t=t(e):y(e)&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t},Gl=function(t,e){return e=e||"",t=""+((t=t||"").nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},$l=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},Xl=function(t,e,n){return $l(t,t.getStyle(e,n),n)},Kl=function(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n},Yl=function(t,e,n){return t.getParents(e,n,t.getRoot())},Jl=function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return vt(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)}))}))},Ql=function(t){return xt(t,"block")},Zl=function(t){return xt(t,"selector")},tf=function(t){return xt(t,"inline")},ef=function(t){return Zl(t)&&!1!==t.expand&&!tf(t)},nf=Bl,rf=Yl,of=Wl,uf=jl,af=function(t,e){for(var n=e;n;){if(wn(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},cf=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},sf=function(t,e,n){return cf(t,e,n,(function(t){return Pl(t)||Il(t)}))},lf=function(t,e,n){return cf(t,e,n,Ll)},ff=function(t,e,n,r,o,i){var u,a=t.getParent(n,t.isBlock)||e,c=function(e,n,r){var i=Ha(t),c=o?i.backwards:i.forwards;return I.from(c(e,n,(function(t,e){return nf(t.parentNode)?-1:(u=t,r(o,t,e))}),a))};return c(n,r,sf).bind((function(t){return i?c(t.container,t.offset+(o?-1:0),lf):I.some(t)})).orThunk((function(){return u?I.some({container:u,offset:o?0:u.length}):I.none()}))},df=function(t,e,n,r,o){En(r)&&Wt(r.data)&&r[o]&&(r=r[o]);for(var i=rf(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)&&(Zl(c)&&t.is(i[u],c.selector)))return i[u]}return r},mf=function(t,e,n,r){var o=n,i=t.dom,u=i.getRoot(),a=e[0];if(Ql(a)&&(o=a.wrapper?null:i.getParent(n,a.block,u)),!o){var c=i.getParent(n,"LI,TD,TH");o=i.getParent(En(n)?n.parentNode:n,(function(e){return e!==u&&uf(t,e)}),c)}if(o&&Ql(a)&&a.wrapper&&(o=rf(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Gl(o,"br")););return o||n},gf=function(t,e,n,r){var o=n.parentNode;return!y(n[r])&&(!(o!==e&&!b(o)&&!t.isBlock(o))||gf(t,e,o,r))},hf=function(t,e,n,r,o){var i,u=n,a=o?"previousSibling":"nextSibling",c=t.getRoot();if(En(n)&&!of(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=En(s)&&!gf(t,c,s,a);if(!nf(s)&&(!Rn(i=s)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!of(s,l))return u}if(u===c||u.parentNode===c){n=u;break}u=u.parentNode}return n},pf=function(t){return nf(t.parentNode)||nf(t)},vf=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];(wn(o)&&o.hasChildNodes()&&(o=Xa(o,i),En(o)&&(i=0)),wn(u)&&u.hasChildNodes()&&(u=Xa(u,e.collapsed?a:a-1),En(u)&&(a=u.nodeValue.length)),o=af(c,o),u=af(c,u),pf(o)&&(o=nf(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,En(o)&&(i=e.collapsed?o.length:0)),pf(u)&&(u=nf(u)?u:u.parentNode,u=e.collapsed?u.nextSibling||u:u.previousSibling||u,En(u)&&(a=e.collapsed?0:u.length)),e.collapsed)&&(ff(c,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),ff(c,t.getBody(),u,a,!1,r).each((function(t){var e=t.container,n=t.offset;u=e,a=n})));return(tf(s)||s.block_expand)&&(tf(s)&&En(o)&&0!==i||(o=hf(c,n,o,i,!0)),tf(s)&&En(u)&&a!==u.nodeValue.length||(u=hf(c,n,u,a,!1))),ef(s)&&(o=df(c,n,e,o,"previousSibling"),u=df(c,n,e,u,"nextSibling")),(Ql(s)||Zl(s))&&(o=mf(t,n,o,"previousSibling"),u=mf(t,n,u,"nextSibling"),Ql(s)&&(c.isBlock(o)||(o=hf(c,n,o,i,!0)),c.isBlock(u)||(u=hf(c,n,u,a,!1)))),wn(o)&&(i=c.nodeIndex(o),o=o.parentNode),wn(u)&&(a=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:o,startOffset:i,endContainer:u,endOffset:a}},bf=function(t,e,n){var r=e.startOffset,o=Xa(e.startContainer,r),i=e.endOffset,u=Xa(e.endContainer,i-1),a=function(t){var e=t[0];En(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&&En(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)},yf=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},wf=function(t){return X(function(t){return tt(t,(function(t){var e=$a(t);return e?[ye.fromDom(e)]:[]}))}(t),uo)},xf=function(t,e){var n=ka(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:wf(t)},Cf=function(t){return xf(yf(t.selection.getSel()),ye.fromDom(t.getBody()))},Sf=function(t,e){return Fr(t,"table",e)},kf=function(t){return Ue(t).fold(O([t]),(function(e){return[t].concat(kf(e))}))},Of=function(t){return We(t).fold(O([t]),(function(e){return"br"===_e(e)?Ie(e).map((function(e){return[t].concat(Of(e))})).getOr([]):[t].concat(Of(e))}))},_f=function(t,e){return Hn(function(t){var e=t.startContainer,n=t.startOffset;return En(e)?0===n?I.some(ye.fromDom(e)):I.none():I.from(e.childNodes[n]).map(ye.fromDom)}(e),function(t){var e=t.endContainer,n=t.endOffset;return En(e)?n===e.data.length?I.some(ye.fromDom(e)):I.none():I.from(e.childNodes[n-1]).map(ye.fromDom)}(e),(function(e,n){var r=Q(kf(t),E(Se,e)),o=Q(Of(t),E(Se,n));return r.isSome()&&o.isSome()})).getOr(!1)},Tf=function(t,e,n,r){var o=n,i=new Yr(n,o),u=vt(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!j(["td","th","table"],e.toLowerCase())}));do{if(En(n)&&0!==ve.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))},Ef=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},Af=function(t,e){var n=Cf(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)},Df=function(t,e,n){var r=Pc(t,e);n(r),t.moveToBookmark(r)},Mf=function(t,e){var n=function(e){return t(e)?I.from(e.dom.nodeValue):I.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}}}(De,"text"),Rf=function(t){return Mf.get(t)},Nf=function(t,e,n,r){return Pe(e).fold((function(){return"skipping"}),(function(o){return"br"===r||function(t){return De(t)&&Rf(t)===co}(e)?"valid":function(t){return Ae(t)&&Ca(t,Oa())}(e)?"existing":Sl(e.dom)?"caret":Ul(t,n,r)&&Ul(t,_e(o),n)?"valid":"invalid-child"}))},zf=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=ye.fromTag("span",t);wa(a,Oa()),jn(a,""+Ta(),i),jn(a,""+_a(),n);var c=r(i,u),s=c.attributes,l=void 0===s?{}:s,f=c.classes,d=void 0===f?[]:f;return Un(a,l),function(t,e){q(e,(function(e){wa(t,e)}))}(a,d),a},Bf=function(t,e,n,r,o){var i=[],u=zf(t.getDoc(),o,n,r),a=ma(),c=function(){a.clear()},s=function(t){q(t,l)},l=function(e){switch(Nf(t,e,"span",_e(e))){case"invalid-child":c();var n=Ve(e);s(n),c();break;case"valid":!function(t,e){Ze(t,e),nn(e,t)}(e,a.get().getOrThunk((function(){var t=Pa(u);return i.push(t),a.set(t),t})))}};return bf(t.dom,e,(function(t){c(),function(t){var e=W(t,ye.fromDom);s(e)}(t)})),i},Pf=function(t,e,n,r){t.undoManager.transact((function(){var o=t.selection,i=o.getRng(),u=Cf(t).length>0;if(i.collapsed&&!u&&function(t,e){var n=vf(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=zf(t.getDoc(),r,e,n.decorate);za(a," "),o.getRng().insertNode(a.dom),o.select(a.dom)}else Df(o,!1,(function(){Af(t,(function(o){Bf(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 yt(e,t).map((function(t){return t.settings}))}});Ma(t,n);var r=Da(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each((function(n){Pf(t,e,n,r)}))},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){Ea(t,I.some(e)).each((function(t){var e=t.elements;q(e,an)}))},getAll:function(e){var n=function(t,e){var n=ye.fromDom(t.getBody()),r=ka(n,"["+_a()+'="'+e+'"]'),o={};return q(r,(function(t){var e=Wn(t,Ta()),n=yt(o,e).getOr([]);o[e]=n.concat([t])})),o}(t,e);return mt(n,(function(t){return W(t,(function(t){return t.dom}))}))}}},Lf=function(t){return{getBookmark:E(Nl,t),moveToBookmark:E(zl,t)}};Lf.isBookmarkNode=Bl;var Hf=function(t,e){for(;e&&e!==t;){if(zn(e)||Bn(e))return e;e=e.parentNode}return null},Ff=function(t,e,n){if(n.collapsed)return!1;if(de.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(wn(r))return U(r.getClientRects(),(function(n){return Ga(n,t,e)}))}return U(n.getClientRects(),(function(n){return Ga(n,t,e)}))},Vf=function(t,e,n){return t.fire(e,n)},jf=function(t,e,n,r){return t.fire("FormatApply",{format:e,node:n,vars:r})},Uf=function(t,e,n,r){return t.fire("FormatRemove",{format:e,node:n,vars:r})},Wf={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,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||Wf.metaKeyPressed(t)},metaKeyPressed:function(t){return de.mac?t.metaKey:t.ctrlKey&&!t.altKey}},qf=Bn,Gf=function(t,e){var n,r,o,i,u,a,c,s,l,f,d,m,g,h,p,v=e.dom,b=ve.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]},_=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},T=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.target)&&!Ff(n.clientX,n.clientY,e)}return _(t.target)&&!Ff(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=ns(e);return!!n&&("false"!==t.getAttribute("data-mce-resize")&&(t!==e.getBody()&&(v.hasClass(t,"mce-preview-object")?xe(ye.fromDom(t.firstElementChild),n):xe(ye.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)}))}},R=function(t,e,n){M(t,"width",e),M(t,"height",n)},N=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,((_(n)||T(n))&&!1!==function(t){return t.getParam("resize_img_proportional",!0,"boolean")}(e)?!Wf.modifierPressed(t):Wf.modifierPressed(t))&&(C(u)>C(b)?(g=S(m*f),m=S(g/f)):(m=S(g/f),g=S(m*f))),R(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",N),v.unbind(w,"mouseup",z),x!==w&&(v.unbind(x,"mousemove",N),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(),_=S.width||S.right-S.left,E=S.height||S.bottom-S.top;n!==t&&(P(),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[0]+y,y:E*t[1]+C},h=k.scrollWidth,p=k.scrollHeight,u=v.add(k,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),v.setStyles(u,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),r=T(m=n)?v.create("img",{src:de.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}),R(r,_,E),r.removeAttribute("data-mce-selected"),k.appendChild(r),v.bind(w,"mousemove",N),v.bind(w,"mouseup",z),x!==w&&(v.bind(x,"mousemove",N),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===de.ie&&(d.contentEditable=!1),v.bind(d,"mousedown",(function(t){t.stopImmediatePropagation(),t.preventDefault(),m(t)})),t.elm=d,v.setStyles(d,{left:_*t[0]+y-d.offsetWidth/2,top:E*t[1]+C-d.offsetHeight/2})})):P(),v.getAttrib(n,"data-mce-selected")||n.setAttribute("data-mce-selected",B)},P=function(){H(),n&&n.removeAttribute("data-mce-selected"),dt(O,(function(t,e){var n=v.get("mceResizeHandle"+e);n&&(v.unbind(n),v.remove(n))}))},I=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):P())},L=function(t){return qf(Hf(e.getBody(),t))},H=function(){dt(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(),de.browser.isIE()||de.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){$r.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=$r.throttle((function(t){e.composing||I(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",P),e.on("contextmenu longpress",E,!0)})),e.on("remove",H);return{isResizable:D,showResizeRect:B,hideResizeRect:P,updateResizeRect:I,destroy:function(){n=r=u=null}}},$f=function(t){return zn(t)||Bn(t)},Xf=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=ve.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 Bn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,$f))?null:t}(r,n.body)}return r},Kf=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},Yf=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)},Jf=function(t,e,n){return Yf(t,e,(function(t){return t.nodeName===n}))},Qf=function(t){return t&&"TABLE"===t.nodeName},Zf=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},td=function(t,e){return po(t)&&!1===Yf(t,e,Sl)},ed=function(t,e,n){for(var r=new Yr(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(Rn(e))return!0},nd=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&&Rn(o)&&e&&t.isEmpty(s))return I.some(hc(o.parentNode,t.nodeIndex(o)));for(var l=new Yr(o,s);u=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(u)||td(u,a))return I.none();if(En(u)&&u.nodeValue.length>0)return!1===Jf(u,a,"A")?I.some(hc(u,r?u.nodeValue.length:0)):I.none();if(t.isBlock(u)||c[u.nodeName.toLowerCase()])return I.none();i=u}return n&&i?I.some(hc(i,0)):I.none()},rd=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=wn(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(a=n,po(o))return I.none();if(wn(o)&&i>o.childNodes.length-1&&(a=!1),Dn(o)&&(o=c,i=0),o===c){if(a&&(u=o.childNodes[i>0?i-1:0])){if(po(u))return I.none();if(f[u.nodeName]||Qf(u))return I.none()}if(o.hasChildNodes()){if(i=Math.min(!a&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=En(o)&&l?o.data.length:0,!e&&o===c.lastChild&&Qf(o))return I.none();if(function(t,e){for(;e&&e!==t;){if(Bn(e))return!0;e=e.parentNode}return!1}(c,o)||po(o))return I.none();if(o.hasChildNodes()&&!1===Qf(o)){u=o;var d=new Yr(o,c);do{if(Bn(u)||po(u)){s=!1;break}if(En(u)&&u.nodeValue.length>0){i=a?0:u.nodeValue.length,o=u,s=!0;break}if(f[u.nodeName.toLowerCase()]&&!Zf(u)){i=t.nodeIndex(u),o=u.parentNode,a||i++,s=!0;break}}while(u=a?d.next():d.prev())}}}return e&&(En(o)&&0===i&&nd(t,l,e,!0,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),wn(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Rn(u)||function(t,e){return t.previousSibling&&t.previousSibling.nodeName===e}(u,"A")||ed(t,u,!1)||ed(t,u,!0)||nd(t,l,e,!0,u).each((function(t){o=t.container(),i=t.offset(),s=!0})))),a&&!e&&En(o)&&i===o.nodeValue.length&&nd(t,l,e,!1,o).each((function(t){o=t.container(),i=t.offset(),s=!0})),s?I.some(hc(o,i)):I.none()},od=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=hc.fromRangeStart(e);return rd(t,n,!0,r).each((function(t){n&&hc.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||rd(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),Kf(e,r)?I.none():I.some(r)},id=function(t,e){return t.splitText(e)},ud=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&En(e)?n>0&&n<e.nodeValue.length&&(e=(r=id(e,n)).previousSibling,o>n?(e=r=id(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(En(e)&&n>0&&n<e.nodeValue.length&&(e=id(e,n),n=0),En(r)&&o>0&&o<r.nodeValue.length&&(o=(r=id(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}},ad=function(t){return{walk:function(e,n){return bf(t,e,n)},split:ud,normalize:function(e){return od(t,e).fold(R,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}};ad.compareRanges=Kf,ad.getCaretRangeFromPoint=Xf,ad.getSelectedNode=$a,ad.getNode=Xa;var cd,sd=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Xn(n,t);return parseFloat(o)||0}return r},r=function(t,e){return Y(e,(function(e,n){var r=Xn(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;Fn(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 cn(t)?e.getBoundingClientRect().height:e.offsetHeight})),ld=function(t,e){return t.view(e).fold(O([]),(function(e){var n=t.owner(e),r=ld(t,n);return[e].concat(r)}))},fd=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?I.none():I.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(ye.fromDom)},owner:function(t){return ze(t)}}),dd=function(t){var e=ye.fromDom(document),n=mn(e),r=function(t,e){var n=e.owner(t);return ld(e,n)}(t,fd),o=dn(t),i=K(r,(function(t,e){var n=dn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return ln(i.left+o.left+n.left,i.top+o.top+n.top)},md=function(t){return"textarea"===_e(t)},gd=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 ln(n.offsetLeft,n.offsetTop);var i=fn(null==r?void 0:r.pageYOffset,o.scrollTop),u=fn(null==r?void 0:r.pageXOffset,o.scrollLeft),a=fn(o.clientTop,n.clientTop),c=fn(o.clientLeft,n.clientLeft);return dn(t).translate(u-c,i-a)}(t),r=function(t){return sd.get(t)}(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}},hd=function(t,e){var n=function(t,e){var n=Ve(t);if(0===n.length||md(t))return{element:t,offset:e};if(e<n.length&&!md(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return md(r)?{element:t,offset:e}:"img"===_e(r)?{element:r,offset:1}:De(r)?{element:r,offset:Rf(r).length}:{element:r,offset:Ve(r).length}}(t,e),r=ye.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>');return Ze(n.element,r),gd(r,(function(){return un(r)}))},pd=function(t,e,n,r){wd(t,(function(o,i){return bd(t,e,n,r)}),n)},vd=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,mn(e).top,r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},bd=function(t,e,n,r){var o=ye.fromDom(t.getBody()),i=ye.fromDom(t.getDoc());o.dom.offsetWidth;var u=hd(ye.fromDom(n.startContainer),n.startOffset);vd(t,i,e,u,r),u.cleanup()},yd=function(t,e,n,r){var o=ye.fromDom(t.getDoc());vd(t,o,n,function(t){return gd(ye.fromDom(t),C)}(e),r)},wd=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,u=n.endOffset;e(ye.fromDom(r),ye.fromDom(i));var a=t.dom.createRng();a.setStart(r,o),a.setEnd(i,u),t.selection.setRng(n)},xd=function(t,e,n,r){var o=t.pos;if(n)gn(o.left,o.top,r);else{var i=o.top-e+t.height;gn(o.left,i,r)}},Cd=function(t,e,n,r,o){var i=n+e,u=r.pos.top,a=r.bottom,c=a-u>=n;if(u<e)xd(r,n,!1!==o,t);else if(u>i){xd(r,n,c?!1!==o:!0===o,t)}else a>i&&!c&&xd(r,n,!0===o,t)},Sd=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Cd(t,e,o,n,r)},kd=function(t,e,n,r){var o=t.dom.defaultView.innerHeight;Cd(t,e,o,n,r);var i=dd(n.element),u=vn(window);i.top<u.y?hn(n.element,!1!==r):i.top>u.bottom&&hn(n.element,!0===r)},Od=function(t,e,n){return pd(t,Sd,e,n)},_d=function(t,e,n){return yd(t,e,Sd,n)},Td=function(t,e,n){return pd(t,kd,e,n)},Ed=function(t,e,n){return yd(t,e,kd,n)},Ad=function(t,e,n){(t.inline?Od:Td)(t,e,n)},Dd=function(t){var e=Ke(t).dom;return t.dom===e.activeElement},Md=function(t){return void 0===t&&(t=ye.fromDom(document)),I.from(t.dom.activeElement).map(ye.fromDom)},Rd=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Nd=gr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),zd=(Nd.before,Nd.on,Nd.after,function(t){return t.fold(_,_,_)}),Bd=gr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Pd={domRange:Bd.domRange,relative:Bd.relative,exact:Bd.exact,exactFromRange:function(t){return Bd.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return ye.fromDom(t.startContainer)},relative:function(t,e){return zd(t)},exact:function(t,e,n,r){return t}})}(t);return Be(e)},range:Rd},Id=re().browser,Ld=function(t,e){var n=De(e)?Rf(e).length:Ve(e).length+1;return t>n?n:t<0?0:t},Hd=function(t){return Pd.range(t.start,Ld(t.soffset,t.start),t.finish,Ld(t.foffset,t.finish))},Fd=function(t,e){return!yn(e.dom)&&(Oe(t,e)||Se(t,e))},Vd=function(t){return function(e){return Fd(t,e.start)&&Fd(t,e.finish)}},jd=function(t){return!0===t.inline||Id.isIE()},Ud=function(t){return Pd.range(ye.fromDom(t.startContainer),t.startOffset,ye.fromDom(t.endContainer),t.endOffset)},Wd=function(t){return function(t){var e=t.getSelection();return(e&&0!==e.rangeCount?I.from(e.getRangeAt(0)):I.none()).map(Ud)}(Be(t).dom).filter(Vd(t))},qd=function(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),I.some(e)}catch(t){return I.none()}},Gd=function(t){var e=jd(t)?Wd(ye.fromDom(t.getBody())):I.none();t.bookmark=e.isSome()?e:t.bookmark},$d=function(t){return(t.bookmark?t.bookmark:I.none()).bind((function(e){return function(t,e){return I.from(e).filter(Vd(t)).map(Hd)}(ye.fromDom(t.getBody()),e)})).bind(qd)},Xd={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},Kd=function(t,e){re().browser.isIE()?function(t){t.on("focusout",(function(){Gd(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)||Gd(t)}))},Yd=function(t){var e=ga((function(){Gd(t)}),0);t.on("init",(function(){t.inline&&function(t,e){var n=function(){e.throttle()};na.DOM.bind(document,"mouseup",n),t.on("remove",(function(){na.DOM.unbind(document,"mouseup",n)}))}(t,e),Kd(t,e)})),t.on("remove",(function(){e.cancel()}))},Jd=na.DOM,Qd=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==Jd.getParent(e,(function(e){return function(t){return Xd.isEditorUIElement(t)}(e)||!!n&&t.dom.is(e,n)}))},Zd=function(t,e){var n=e.editor;Yd(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(){$r.setEditorTimeout(n,(function(){var e=t.focusedEditor;Qd(n,function(t){try{var e=Ke(ye.fromDom(t.getElement()));return Md(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)}))})),cd||(cd=function(e){var n=t.activeEditor;n&&function(t){if(Xe()&&y(t.target)){var e=ye.fromDom(t.target);if(Ae(e)&&Qe(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return ut(n)}}return I.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||Qd(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},Jd.bind(document,"focusin",cd))},tm=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(Jd.unbind(document,"focusin",cd),cd=null)},em=function(t,e){return function(t){return t.collapsed?I.from(Xa(t.startContainer,t.startOffset)).map(ye.fromDom):I.none()}(e).bind((function(e){return io(e)?I.some(e):!1===Oe(t,e)?I.some(t):I.none()}))},nm=function(t,e){em(ye.fromDom(t.getBody()),e).bind((function(t){return xl(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))},rm=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},om=function(t){return Dd(t)||(e=t,Md(Ke(e)).filter((function(t){return e.dom.contains(t.dom)}))).isSome();var e},im=function(t){return t.inline?function(t){var e=t.getBody();return e&&om(ye.fromDom(e))}(t):function(t){return t.iframeElement&&Dd(ye.fromDom(t.iframeElement))}(t)},um=function(t){return im(t)||function(t){var e=Ke(ye.fromDom(t.getElement()));return Md(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")))&&Qd(t,e.dom);var n,r})).isSome()}(t)},am=function(t){return t.editorManager.setActive(t)},cm=function(t,e){t.removed||(e?am(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===im(t)&&$d(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 rm(o),nm(t,r),void am(t);t.inline||(de.opera||rm(n),t.getWin().focus()),(de.gecko||t.inline)&&(rm(n),nm(t,r)),am(t)}(t))},sm=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,u=n?e.startOffset:e.endOffset;return I.from(i).map(ye.fromDom).map((function(t){return r&&e.collapsed?t:je(t,o(t,u)).getOr(t)})).bind((function(t){return Ae(t)?I.some(t):Pe(t).filter(Ae)})).map((function(t){return t.dom})).getOr(t)},lm=function(t,e,n){return sm(t,e,!0,n,(function(t,e){return Math.min(qe(t),e)}))},fm=function(t,e,n){return sm(t,e,!1,n,(function(t,e){return e>0?e-1:e}))},dm=function(t,e){for(var n=t;t&&En(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},mm=function(t,e){return W(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))},gm={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},hm=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}},pm=function(t){if(!Io(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},vm=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},bm=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,gm[e]||1);return n&&dt(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&&dt(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=hm(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=hm(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(vm(this))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(t[r.name])return!1;if(vm(r))return!1}if(8===r.type)return!1;if(3===r.type&&!pm(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=hm(r,this));return!0},t.prototype.walk=function(t){return hm(this,null,t)},t}(),ym=function(t,e){return t.replace(e.re,(function(t){return yt(e.uris,t).getOr(t)}))},wm=ve.each,xm=ve.trim,Cm="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Sm={ftp:21,http:80,https:443,mailto:25},km=["img","video"],Om=function(t,e,n){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?function(t,e){return y(t)?!t:!y(e)||!j(km,e)}(t.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))},_m=function(){function t(e,n){e=xm(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);wm(Cm,(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.isDomSafe=function(t,e,n){if(void 0===n&&(n={}),n.allow_script_urls)return!0;var r=ai.decode(t).replace(/[\s\u0000-\u001F]+/g,"");try{r=decodeURIComponent(r)}catch(t){r=unescape(r)}return!/((java|vb)script|mhtml):/i.test(r)&&!Om(n,r,e)},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=Sm[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(wm(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}(),Tm=ve.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),Em=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=Lt(c[2],"--")?Am(e,!1,c.index+"!--".length):Am(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:wt(i,c[2])||(u+=1),a=r.lastIndex+s[0].length;break}}return a},Am=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},Dm=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},Mm=function(t,e){var n;void 0===e&&(e=vi());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,R=n.html,N=0,z=[],B=0,P=ai.decode,I=ve.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),L="html"===d?0:1,H=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}},F=function(t,e){return a(ym(t,n),e)},V=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),i(ym(e,n)))},j=function(t,e){var n=t||"",r=!Lt(n,"--"),o=Am(R,r,e);return t=R.substr(e,o-e),V(r?n+t:t),o+1},U=function(e,i,u,a,c){if(u=function(t){return ym(t,n)}((i=i.toLowerCase())in X?i:P(u||a||c||"")),K&&!w&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(i)){var s=_[i];if(!s&&T){for(var l=T.length;l--&&!(s=T[l]).pattern.test(i););-1===l&&(s=null)}if(!s)return;if(s.validValues&&!(u in s.validValues))return}("name"===i||"id"===i)&&e in Tm&&(u in r||u in o)||I[i]&&!_m.isDomSafe(u,e,t)||w&&(i in I||0===i.indexOf("on"))||(p.map[i]=u,p.push({name:i,value:u}))},W=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"),q=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,G=e.getShortEndedElements(),$=t.self_closing_elements||e.getSelfClosingElements(),X=e.getBoolAttrs(),K=t.validate,Y=t.remove_internals,J=t.fix_self_closing,Q=e.getSpecialElements(),Z=R+">";m=W.exec(Z);){var tt=m[0];if(N<m.index&&F(P(R.substr(N,m.index-N))),g=m[7])":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),H(g);else if(g=m[8]){if(m.index+tt.length>R.length){F(P(R.substr(m.index))),N=m.index+tt.length;continue}":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),x=g in G,J&&$[g]&&z.length>0&&z[z.length-1].name===g&&H(g);var et=Dm(q,m[9]);if(null!==et){if("all"===et){N=Em(e,R,W.lastIndex),W.lastIndex=N;continue}S=!1}if(!K||(C=e.getElementRule(g))){if(S=!0,K&&(_=C.attributes,T=C.attributePatterns),(O=m[9])?((w=-1!==O.indexOf("data-mce-type"))&&Y&&(S=!1),(p=[]).map={},O.replace(q,(function(t,e,n,r,o){return U(g,e,n,r,o),""}))):(p=[]).map={},K&&!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){N=Em(e,R,W.lastIndex),W.lastIndex=N;continue}S=!1}}S&&c(g,p,x)}else S=!1;if(h=Q[g]){h.lastIndex=N=m.index+tt.length,(m=h.exec(R))?(S&&(b=R.substr(N,m.index-N)),N=m.index+m[0].length):(b=R.substr(N),N=R.length),S&&(b.length>0&&F(b,!0),s(g)),W.lastIndex=N;continue}x||(O&&O.indexOf("/")===O.length-1?S&&s(g):z.push({name:g,valid:S}))}else if(g=m[1])V(g);else if(g=m[2]){if(!(1===L||t.preserve_cdata||z.length>0&&e.isValidChild(z[z.length-1].name,"#cdata"))){N=j("",m.index+2),W.lastIndex=N;continue}u(g)}else if(g=m[3])f(g);else{if((g=m[4])||"<!"===tt){N=j(g,m.index+tt.length),W.lastIndex=N;continue}if(g=m[5]){if(1!==L){N=j("?",m.index+2),W.lastIndex=N;continue}l(g,m[6])}}N=m.index+tt.length}for(N<R.length&&F(P(R.substr(N))),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)}}};Mm.findEndTag=Em;var Rm=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:Mm.findEndTag(o,i,a),i=i.substring(0,a-c)+i.substring(s),r.lastIndex=a-c}return lo(i)},Nm=Rm,zm=function(t,e,n,r){var o,i=function(t,e){return Dt(Dt({},t),{format:e,get:!0,getInner:!0})}(e,n),u=e.no_events?i:t.fire("BeforeGetContent",i);return o="raw"===u.format?ve.trim(Nm(t.serializer,r.innerHTML)):"text"===u.format?t.dom.isEmpty(r)?"":lo(r.innerText||r.textContent):"tree"===u.format?t.serializer.serialize(r,u):function(t,e){var n=jc(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)||ao(ye.fromDom(r))?u.content=o:u.content=ve.trim(o),u.no_events?u.content:t.fire("GetContent",u).content},Bm=ve.each,Pm=function(t){return{compare:function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return Bm(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(wt(t,r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(wt(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")))&&(!Bl(e)&&!Bl(n)))}}},Im=ve.makeMap,Lm=function(t){var e=[],n=(t=t||{}).indent,r=Im(t.indent_before||""),o=Im(t.indent_after||""),i=ai.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$/,"")}}},Hm=function(t,e){void 0===e&&(e=vi());var n=Lm(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()}}},Fm=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){Fm.add(t)}));var Vm=["font","text-decoration","text-emphasis"],jm=function(t,e){return lt(t.parseStyle(t.getAttrib(e,"style")))},Um=function(t,e){return et(jm(t,e),(function(t){return!function(t){return Fm.has(t)}(t)}))},Wm=function(t,e,n){var r=jm(t,e),o=jm(t,n),i=function(r){var o=t.getStyle(e,r),i=t.getStyle(n,r);return Ut(o)&&Ut(i)&&o!==i};return U(r,(function(t){var e=function(e){return U(e,(function(e){return e===t}))};if(!e(o)&&e(Vm)){var n=X(o,(function(t){return U(Vm,(function(e){return Lt(t,e)}))}));return U(n,i)}return i(t)}))},qm=function(t,e,n){return I.from(n.container()).filter(En).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))},Gm=E(qm,!0,Il),$m=E(qm,!1,Il),Xm=function(t){var e=t.container();return En(e)&&(0===e.data.length||so(e.data)&&Lf.isBookmarkNode(e.parentNode))},Km=function(t,e){return function(n){return I.from(Vs(t?0:-1,n)).filter(e).isSome()}},Ym=function(t){return Nn(t)&&"block"===Xn(ye.fromDom(t),"display")},Jm=function(t){return Bn(t)&&!function(t){return wn(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},Qm=Km(!0,Ym),Zm=Km(!1,Ym),tg=Km(!0,In),eg=Km(!1,In),ng=Km(!0,On),rg=Km(!1,On),og=Km(!0,Jm),ig=Km(!1,Jm),ug=function(t){var e=ka(t,"br"),n=X(function(t){for(var e=[],n=t.dom;n;)e.push(ye.fromDom(n)),n=n.lastChild;return e}(t).slice(-1),eo);e.length===n.length&&q(n,un)},ag=function(t){on(t),nn(t,ye.fromHtml('<br data-mce-bogus="1">'))},cg=function(t){We(t).each((function(e){Ie(e).each((function(n){Zr(t)&&eo(e)&&Zr(n)&&un(e)}))}))},sg=function(t,e,n){return Oe(e,t)?function(t,e){for(var n=w(e)?e:R,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,u=ye.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o}(t,(function(t){return n(t)||Se(t,e)})).slice(0,-1):[]},lg=function(t,e){return sg(t,e,R)},fg=function(t,e){return[t].concat(lg(t,e))},dg=function(t,e,n){return vl(t,e,n,Xm)},mg=function(t,e){return Q(fg(ye.fromDom(e.container()),t),Zr)},gg=function(t,e,n){return dg(t,e.dom,n).forall((function(t){return mg(e,n).fold((function(){return!1===Fs(t,n,e.dom)}),(function(r){return!1===Fs(t,n,e.dom)&&Oe(r,ye.fromDom(t.container()))}))}))},hg=function(t,e,n){return mg(e,n).fold((function(){return dg(t,e.dom,n).forall((function(t){return!1===Fs(t,n,e.dom)}))}),(function(e){return dg(t,e.dom,n).isNone()}))},pg=E(hg,!1),vg=E(hg,!0),bg=E(gg,!1),yg=E(gg,!0),wg=function(t){return Ys(t).exists(eo)},xg=function(t,e,n){var r=X(fg(ye.fromDom(n.container()),e),Zr),o=ut(r).getOr(e);return hl(t,o.dom,n).filter(wg)},Cg=function(t,e){return Ys(e).exists(eo)||xg(!0,t,e).isSome()},Sg=function(t,e){return function(t){return I.from(t.getNode(!0)).map(ye.fromDom)}(e).exists(eo)||xg(!1,t,e).isSome()},kg=E(xg,!1),Og=E(xg,!0),_g=function(t){return hc.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},Tg=function(t,e){var n=X(fg(ye.fromDom(e.container()),t),Zr);return ut(n).getOr(t)},Eg=function(t,e){return _g(e)?$m(e):$m(e)||wl(Tg(t,e).dom,e).exists($m)},Ag=function(t,e){return _g(e)?Gm(e):Gm(e)||yl(Tg(t,e).dom,e).exists(Gm)},Dg=function(t){return Ys(t).bind((function(t){return Lr(t,Ae)})).exists((function(t){return function(t){return j(["pre","pre-wrap"],t)}(Xn(t,"white-space"))}))},Mg=function(t,e){return function(t,e){return wl(t.dom,e).isNone()}(t,e)||function(t,e){return yl(t.dom,e).isNone()}(t,e)||pg(t,e)||vg(t,e)||Sg(t,e)||Cg(t,e)},Rg=function(t,e){return!Dg(e)&&(pg(t,e)||bg(t,e)||Sg(t,e)||Eg(t,e))},Ng=function(t,e){return!Dg(e)&&(vg(t,e)||yg(t,e)||Cg(t,e)||Ag(t,e))},zg=function(t,e){return Rg(t,e)||Ng(t,function(t){var e=t.container(),n=t.offset();return En(e)&&n<e.data.length?hc(e,n+1):t}(e))},Bg=function(t,e){return Pl(t.charAt(e))},Pg=function(t){var e=t.container();return En(e)&&It(e.data," ")},Ig=function(t){var e=t.data,n=function(t){var e=t.split("");return W(e,(function(t,n){return Pl(t)&&n>0&&n<e.length-1&&Ll(e[n-1])&&Ll(e[n+1])?" ":t})).join("")}(e);return n!==e&&(t.data=n,!0)},Lg=function(t,e){return I.some(e).filter(Pg).bind((function(e){var n=e.container();return function(t,e){var n=e.data,r=hc(e,0);return!(!Bg(n,0)||zg(t,r))&&(e.data=" "+n.slice(1),!0)}(t,n)||Ig(n)||function(t,e){var n=e.data,r=hc(e,n.length-1);return!(!Bg(n,n.length-1)||zg(t,r))&&(e.data=n.slice(0,-1)+" ",!0)}(t,n)?I.some(e):I.none()}))},Hg=function(t){var e=ye.fromDom(t.getBody());t.selection.isCollapsed()&&Lg(e,hc.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))},Fg=function(t,e,n){if(0!==n){var r=ye.fromDom(t),o=Ir(r,Zr).getOr(r),i=t.data.slice(e,e+n),u=e+n>=t.data.length&&Ng(o,hc(t,t.data.length)),a=0===e&&Rg(o,hc(t,0));t.replaceData(e,n,function(t,e,n){return Y(t,(function(r,o){return Il(o)||Pl(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))}},Vg=function(t,e){var n=t.data.slice(e),r=n.length-Vt(n).length;Fg(t,e,r)},jg=function(t,e){var n=t.data.slice(0,e),r=n.length-jt(n).length;Fg(t,e-r,r)},Ug=function(t,e,n,r){void 0===r&&(r=!0);var o=jt(t.data).length,i=r?t:e,u=r?e:t;return r?i.appendData(u.data):i.insertData(0,u.data),un(ye.fromDom(u)),n&&Vg(i,o),i},Wg=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===hc.isTextPosition(t)&&n===e.parentNode&&r>hc.before(e).offset()}(e,t)?hc(e.container(),e.offset()-1):e},qg=function(t){return No(t.previousSibling)?I.some((e=t.previousSibling,En(e)?hc(e,e.data.length):hc.after(e))):t.previousSibling?Cl(t.previousSibling):I.none();var e},Gg=function(t){return No(t.nextSibling)?I.some((e=t.nextSibling,En(e)?hc(e,0):hc.before(e))):t.nextSibling?xl(t.nextSibling):I.none();var e},$g=function(t,e){return qg(e).orThunk((function(){return Gg(e)})).orThunk((function(){return function(t,e){var n=hc.before(e.previousSibling?e.previousSibling:e.parentNode);return wl(t,n).fold((function(){return yl(t,hc.after(e))}),I.some)}(t,e)}))},Xg=function(t,e){return Gg(e).orThunk((function(){return qg(e)})).orThunk((function(){return function(t,e){return yl(t,hc.after(e)).fold((function(){return wl(t,hc.before(e))}),I.some)}(t,e)}))},Kg=function(t,e,n){return function(t,e,n){return t?Xg(e,n):$g(e,n)}(t,e,n).map(E(Wg,n))},Yg=function(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))},Jg=function(t,e){return e&&wt(t.schema.getBlockElements(),_e(e))},Qg=function(t){if(Uo(t)){var e=ye.fromHtml('<br data-mce-bogus="1">');return on(t),nn(t,e),I.some(hc.before(e.dom))}return I.none()},Zg=function(t,e,n){var r,o,i,u,a=Ie(t).filter(De),c=Le(t).filter(De);return un(t),(r=a,o=c,i=e,u=function(t,e,r){var o=t.dom,i=e.dom,u=o.data.length;return Ug(o,i,n),r.container()===i?hc(o,u):r},r.isSome()&&o.isSome()&&i.isSome()?I.some(u(r.getOrDie(),o.getOrDie(),i.getOrDie())):I.none()).orThunk((function(){return n&&(a.each((function(t){return jg(t.dom,t.dom.length)})),c.each((function(t){return Vg(t.dom,0)}))),e}))},th=function(t,e,n,r){void 0===r&&(r=!0);var o,i=Kg(e,t.getBody(),n.dom),u=Ir(n,E(Jg,t),(o=t.getBody(),function(t){return t.dom===o})),a=Zg(n,i,function(t,e){return wt(t.schema.getTextInlineElements(),_e(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(Qg).fold((function(){r&&Yg(t,e,a)}),(function(n){r&&Yg(t,e,I.some(n))}))},eh=function(t){return ka(t,"td,th")},nh=function(t,e){return{start:t,end:e}},rh=gr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),oh=function(t,e){return jr(ye.fromDom(t),"td,th",e)},ih=function(t){return!Se(t.start,t.end)},uh=function(t,e){return Sf(t.start,e).bind((function(n){return Sf(t.end,e).bind((function(t){return e=Se(n,t),r=n,e?I.some(r):I.none();var e,r}))}))},ah=function(t){return function(e){return uh(e,t).map((function(t){return function(t,e,n){return{rng:t,table:e,cells:n}}(e,t,eh(t))}))}},ch=function(t,e,n,r){if(n.collapsed||!t.forall(ih))return I.none();if(e.isSameTable){var o=t.bind(ah(r));return I.some({start:o,end:o})}var i=oh(n.startContainer,r),u=oh(n.endContainer,r),a=i.bind(function(t){return function(e){return Sf(e,t).bind((function(t){return at(eh(t)).map((function(t){return nh(e,t)}))}))}}(r)).bind(ah(r)),c=u.bind(function(t){return function(e){return Sf(e,t).bind((function(t){return ut(eh(t)).map((function(t){return nh(t,e)}))}))}}(r)).bind(ah(r));return I.some({start:a,end:c})},sh=function(t,e){return Z(t,(function(t){return Se(t,e)}))},lh=function(t){return Hn(sh(t.cells,t.rng.start),sh(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))},fh=function(t,e,n){return t.exists((function(t){return function(t,e){return!ih(t)&&uh(t,e).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))}(t,n)&&_f(t.start,e)}))},dh=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},mh=function(t,e){var n=function(t){return function(e){return Se(t,e)}}(t),r=function(t,e){var n=oh(t.startContainer,e),r=oh(t.endContainer,e);return Hn(n,r,nh)}(e,n),o=function(t,e){var n=function(t){return Sf(ye.fromDom(t),e)},r=n(t.startContainer),o=n(t.endContainer),i=r.isSome(),u=o.isSome(),a=Hn(r,o,Se).getOr(!1);return{startTable:r,endTable:o,isStartInTable:i,isEndInTable:u,isSameTable:a,isMultiTable:!a&&i&&u}}(e,n);return fh(r,e,n)?r.map((function(t){return rh.singleCellTable(e,t.start)})):o.isMultiTable?function(t,e,n,r){return ch(t,e,n,r).bind((function(t){var r=t.start,o=t.end,i=r.bind(lh).getOr([]),u=o.bind(lh).getOr([]);if(i.length>0&&u.length>0){var a=dh(n,e);return I.some(rh.multiTable(i,u,a))}return I.none()}))}(r,o,e,n):function(t,e,n,r){return ch(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=lh(t).getOr([]);if(r&&t.cells.length===o.length)return I.some(rh.fullTable(t.table));if(o.length>0){if(r)return I.some(rh.partialTable(o,I.none()));var i=dh(n,e);return I.some(rh.partialTable(o,I.some(Dt(Dt({},e),{rng:i}))))}return I.none()}))}(r,o,e,n)},gh=function(t){var e;return(8===Te(e=t)||"#comment"===_e(e)?Ie(t):We(t)).bind(gh).orThunk((function(){return I.some(t)}))},hh=function(t){return q(t,(function(t){Gn(t,"contenteditable"),ag(t)}))},ph=function(t,e,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(e.dom.lastChild)):(o.setStartBefore(e.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),wh(t,o,e,!1)},vh=function(t){var e=Cf(t),n=ye.fromDom(t.selection.getNode());Pn(n.dom)&&Uo(n)?t.selection.setCursorLocation(n.dom,0):t.selection.collapse(!0),e.length>1&&U(e,(function(t){return Se(t,n)}))&&jn(n,"data-mce-selected","1")},bh=function(t,e,n){var r=t.selection.getRng(),o=n.bind((function(n){var o=n.rng,i=n.isStartInTable,u=function(t,e){return I.from(t.dom.getParent(e,t.dom.isBlock)).map(ye.fromDom)}(t,i?o.endContainer:o.startContainer);o.deleteContents(),function(t,e,n){n.each((function(n){e?un(n):(ag(n),t.selection.setCursorLocation(n.dom,0))}))}(t,i,u.filter(Uo));var a=i?e[0]:e[e.length-1];return ph(t,a,r,i),Uo(a)?I.none():I.some(i?e.slice(1):e.slice(0,-1))})).getOr(e);return hh(o),vh(t),!0},yh=function(t,e,n,r){var o=t.selection.getRng(),i=e[0],u=n[n.length-1];ph(t,i,o,!0),ph(t,u,o,!1);var a=Uo(i)?e:e.slice(1),c=Uo(u)?n:n.slice(0,-1);return hh(a.concat(c)),r.deleteContents(),vh(t),!0},wh=function(t,e,n,r){void 0===r&&(r=!0),e.deleteContents();var o,i=gh(n).getOr(n),u=ye.fromDom(t.dom.getParent(i.dom,t.dom.isBlock));if(Uo(u)&&(ag(u),r&&t.selection.setCursorLocation(u.dom,0)),!Se(n,u)){var a=Ln(Pe(u),n)?[]:Pe(o=u).map(Ve).map((function(t){return X(t,(function(t){return!Se(o,t)}))})).getOr([]);q(a.concat(Ve(n)),(function(t){Se(t,u)||Oe(t,u)||!Uo(t)||un(t)}))}return!0},xh=function(t,e){return th(t,!1,e),!0},Ch=function(t,e,n,r){return kh(e,r).fold((function(){return function(t,e,n){return mh(e,n).map((function(e){return e.fold(E(wh,t),E(xh,t),E(bh,t),E(yh,t))}))}(t,e,n)}),(function(e){return function(t,e){return Oh(t,e)}(t,e)})).getOr(!1)},Sh=function(t,e){return Q(fg(e,t),uo)},kh=function(t,e){return Q(fg(e,t),(n="caption",function(t){return Ae(t)&&_e(t)===n}));var n},Oh=function(t,e){return ag(e),t.selection.setCursorLocation(e.dom,0),I.some(!0)},_h=function(t,e,n,r,o){return pl(n,t.getBody(),o).bind((function(i){return function(t,e,n,r){return xl(t.dom).bind((function(o){return Cl(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 Oh(t,e)}(t,r):function(t,e,n){return kh(t,ye.fromDom(n.getNode())).map((function(t){return!1===Se(t,e)}))}(e,r,i)})).or(I.some(!0))},Th=function(t,e,n,r){var o=hc.fromRangeStart(t.selection.getRng());return Sh(n,r).bind((function(r){return Uo(r)?Oh(t,r):function(t,e,n,r,o){return pl(n,t.getBody(),o).bind((function(t){return Sh(e,ye.fromDom(t.getNode())).map((function(t){return!1===Se(t,r)}))}))}(t,n,e,r,o)})).getOr(!1)},Eh=function(t,e){return t?ng(e):rg(e)},Ah=function(t,e,n){var r=ye.fromDom(t.getBody());return kh(r,n).fold((function(){return Th(t,e,r,n)||function(t,e){var n=hc.fromRangeStart(t.selection.getRng());return Eh(e,n)||hl(e,t.getBody(),n).exists((function(t){return Eh(e,t)}))}(t,e)}),(function(n){return function(t,e,n,r){var o=hc.fromRangeStart(t.selection.getRng());return Uo(r)?Oh(t,r):_h(t,n,e,r,o)}(t,e,r,n).getOr(!1)}))},Dh=function(t,e){var n=ye.fromDom(t.selection.getStart(!0)),r=Cf(t);return t.selection.isCollapsed()&&0===r.length?Ah(t,e,n):function(t,e,n){var r=ye.fromDom(t.getBody()),o=t.selection.getRng();return 0!==n.length?bh(t,n,I.none()):Ch(t,r,o,e)}(t,n,r)},Mh=function(t){var e=hc.fromRangeStart(t),n=hc.fromRangeEnd(t),r=t.commonAncestorContainer;return hl(!1,r,n).map((function(o){return!Fs(e,n,r)&&Fs(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)},Rh=function(t){return t.collapsed?t:Mh(t)},Nh=function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&function(t){return" "===t.data||Rn(t)}(t.firstChild)},zh=function(t){return t.length>0&&(!(e=t[t.length-1]).firstChild||Nh(e))?t.slice(0,-1):t;var e},Bh=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},Ph=function(t,e){var n=hc.after(t),r=ll(e).prev(n);return r?r.toRange():null},Ih=function(t,e,n){var r=t.parentNode;return ve.each(e,(function(e){r.insertBefore(e,t)})),function(t,e){var n=hc.before(t),r=ll(e).next(n);return r?r.toRange():null}(t,n)},Lh=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=Bh(e,n.startContainer),a=zh((o=i.firstChild,X(o.childNodes,(function(t){return"LI"===t.nodeName})))),c=e.getRoot(),s=function(t){var r=hc.fromRangeStart(n),o=ll(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Bh(e,i.getNode())!==u};return s(1)?Ih(u,a,c):s(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),Ph(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),ve.each(e,(function(e){i.insertBefore(e,t)})),i.insertBefore(o[1],t),i.removeChild(t),Ph(e[e.length-1],n)}(u,a,c,n)},Hh=Pn,Fh=function(t){var e=t.dom,n=Rh(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,Hh);!function(t,e,n){return null!==n&&(n===t.getParent(e.endContainer,Hh)&&_f(ye.fromDom(n),e))}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):wh(t,n,ye.fromDom(r))},Vh=function(t,e,n){var r,o,i,u=t.selection,a=t.dom;/^ | $/.test(e)&&(e=function(t,e,n){var r=ye.fromDom(t.getRoot());return n=Rg(r,hc.fromRangeStart(e))?n.replace(/^ /,"&nbsp;"):n.replace(/^&nbsp;/," "),n=Ng(r,hc.fromRangeEnd(e))?n.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):n.replace(/&nbsp;(<br( \/)?>)?$/," ")}(a,u.getRng(),e));var c=t.parser,s=n.merge,l=Hm({validate:is(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()||Fh(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!!Bh(t,e)}(a,r))return o=Lh(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=Pm(r);ve.each(r.select("*[data-mce-fragment]"),(function(t){if(y(n[t.nodeName.toLowerCase()])&&Um(r,t))for(var e=t.parentNode;y(e)&&e!==o;e=e.parentNode){if(Wm(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=Hf(t.getBody(),e);if("false"===r.getContentEditable(i))return r.remove(e),void o.select(i);var u=r.createRng(),a=e.previousSibling;if(En(a)){if(u.setStart(a,a.nodeValue.length),!de.ie){var c=e.nextSibling;En(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),Hh(s)||function(t){return!!t.getAttribute("data-mce-fragment")}(s)||!(n=function(e){var n=hc.fromRangeStart(e);if(n=ll(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(),ve.each(h.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),function(t,e){I.from(t.getParent(e,"td,th")).map(ye.fromDom).each(cg)}(a,u.getStart()),t.fire("SetContent",d),t.addVisual()}},jh=function(t,e){e(t),t.firstChild&&jh(t.firstChild,e),t.next&&jh(t.next,e)},Uh=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var u in n.firstChild&&jh(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)wt(r,u)&&i.push(r[u]);for(var a in o)wt(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,{})}))}))},Wh=function(t){return t instanceof bm},qh=function(t,e,n){t.dom.setHTML(t.getBody(),e),!0!==n&&function(t){im(t)&&xl(t.getBody()).each((function(e){var n=e.getNode(),r=On(n)?xl(n).getOr(e):e;t.selection.setRng(r.toRange())}))}(t)},Gh=function(t,e,n){var r=function(t,e){return Dt(Dt({format:"html"},t),{set:!0,content:Wh(e)?"":e})}(n,e),o=n.no_events?r:t.fire("BeforeSetContent",r);return Wh(e)||(e=o.content),I.from(t.getBody()).fold(O(e),(function(n){return Wh(e)?function(t,e,n,r){Uh(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=Hm({validate:t.validate},t.schema).serialize(n);return r.content=ao(ye.fromDom(e))?o:ve.trim(o),qh(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=jc(t);i&&t.schema.isValidChild(e.nodeName.toLowerCase(),i.toLowerCase())?(n=o,n=t.dom.createHTML(i,Uc(t),n)):n||(n='<br data-mce-bogus="1">'),qh(t,n,r.no_selection),t.fire("SetContent",r)}else"raw"!==r.format&&(n=Hm({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=ao(ye.fromDom(e))?n:ve.trim(n),qh(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r);return r.content}(t,n,e,o)}))},$h=function(t,e){return function(t,e){var n=t.dom;return n.parentNode?Hr(ye.fromDom(n.parentNode),(function(n){return!Se(t,n)&&e(n)})):I.none()}(t,e).isSome()},Xh=function(t){return w(t)?t:R},Kh=function(t,e,n){var r=e(t),o=Xh(n);return r.orThunk((function(){return o(t)?I.none():function(t,e,n){for(var r=t.dom,o=Xh(n);r.parentNode;){r=r.parentNode;var i=ye.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return I.none()}(t,e,o)}))},Yh=Gl,Jh=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(Zl(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!!Jh(t,e,n)||(e.parentNode===i||!!ep(t,e,n,r,!0))})),!!ep(t,e,n,r,o))},Zh=function(t,e,n){return!!Yh(e,n.inline)||(!!Yh(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0))},tp=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(wt(u,a)){var c="attributes"===r?t.getAttrib(e,a):Xl(t,e,a),s=ql(u[a],i),l=b(c)||Wt(c);if(l&&b(s))continue;if(o&&l&&!n.exact)return!1;if((!o||n.exact)&&!Yh(c,$l(t,s,a)))return!1}}else for(var f=0;f<u.length;f++)if("attributes"===r?t.getAttrib(e,u[f]):Xl(t,e,u[f]))return!0;return!0},ep=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(Zh(t.dom,e,c)&&tp(u,e,c,"attributes",o,r)&&tp(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,ql(s[l],r)))return;return c}}},np=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))},rp=function(t,e){var n=function(e){return Se(e,ye.fromDom(t.getBody()))};return I.from(t.selection.getStart(!0)).bind((function(r){return Kh(ye.fromDom(r),(function(n){return st(e,(function(e){return function(e,n){return ep(t,e.dom,n)?I.some(n):I.none()}(n,e)}))}),n)})).getOrNull()},op=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 yt(t,n).exists((function(t){var n=g(t)?t:bt(t);return U(n,e)}))}))}))}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n}),[])},ip=co,up=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==ip||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},ap=function(t){if(t){var e=new Yr(t,t);for(t=e.current();t;t=e.next())if(En(t))return t}return null},cp=function(t){var e=ye.fromTag("span");return Un(e,{id:"_mce_caret","data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&nn(e,ye.fromText(ip)),e},sp=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(up(e))th(t,!1,ye.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=ap(t);return e&&e.nodeValue.charAt(0)===ip&&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)&&ag(ye.fromDom(u)),o.setRng(i)}},lp=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)sp(t,e,n);else if(!(e=kl(t.getBody(),o.getStart())))for(;e=r.get("_mce_caret");)sp(t,e,!1)},fp=function(t,e){return t.appendChild(e),e},dp=function(t,e){var n=K(t,(function(t,e){return fp(t,e.cloneNode(!1))}),e);return fp(n,n.ownerDocument.createTextNode(ip))},mp=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(ep(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=vf(t,l,t.formatter.get(e),!0);g=ud(g),t.formatter.remove(e,n,g,r),c.moveToBookmark(m)}else{var h=kl(t.getBody(),u),p=cp(!1).dom;!function(t,e,n){var r=t.dom,o=r.getParent(n,E(jl,t));o&&r.isEmpty(o)?n.parentNode.replaceChild(e,n):(ug(ye.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(lt(u.get()),(function(t){return t!==r&&!It(t,"removeformat")})),s=op(t,n,c);if(X(s,(function(e){return!Jl(t,e,r)})).length>0){var l=n.cloneNode(!1);return a.add(e,l),u.remove(r,o,l,i),a.remove(l),I.some(l)}return I.none()}(t,p,u,e,n,r),b=dp(s.concat(v.toArray()),p);sp(t,h,!1),c.setCursorLocation(b,1),a.isEmpty(u)&&a.remove(u)}},gp=function(t){t.on("mouseup keydown",(function(e){!function(t,e){var n=t.selection,r=t.getBody();lp(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||n.getStart().innerHTML!==ip||lp(t,kl(r,n.getStart())),37!==e&&39!==e||lp(t,kl(r,n.getStart()))}(t,e.keyCode)}))},hp=function(t,e){var n=t.schema.getTextInlineElements();return wt(n,_e(e))&&!Sl(e.dom)&&!kn(e.dom)},pp={},vp=Ot,bp=St;!function(t,e){pp[t]||(pp[t]=[]),pp[t].push(e)}("pre",(function(t){var e,n=t.selection.getRng(),r=xn(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),bp(vp(vp(e,r),(function(t){return r(t.previousSibling)&&-1!==_t(e,t.previousSibling)})),(function(t){var e,n;e=t.previousSibling,Ku(n=t).remove(),Ku(e).append("<br><br>").append(n.childNodes)})))}));var yp=ve.each,wp=function(t){return wn(t)&&!Bl(t)&&!Sl(t)&&!kn(t)},xp=function(t,e){for(var n=t;n;n=n[e]){if(En(n)&&Ut(n.data))return t;if(wn(n)&&!Bl(n))return n}return t},Cp=function(t,e,n){var r=Pm(t);if(e&&n&&(e=xp(e,"previousSibling"),n=xp(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),ve.each(ve.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n},Sp=function(t,e,n,r){if(r&&!1!==e.merge_siblings){var o=Cp(t,Vl(r),r);Cp(t,o,Vl(o,!0))}},kp=function(t,e,n){yp(t.childNodes,(function(t){wp(t)&&(e(t)&&n(t),t.hasChildNodes()&&kp(t,e,n))}))},Op=function(t,e){return function(n){return!(!n||!Xl(t,n,e))}},_p=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)}},Tp=gr([{keep:[]},{rename:["name"]},{removed:[]}]),Ep=/^(src|href|style)$/,Ap=ve.each,Dp=Gl,Mp=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},Rp=function(t,e,n){var r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"];if(wn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return En(r)&&n&&o>=r.nodeValue.length&&(r=new Yr(r,t.getBody()).next()||r),En(r)&&!n&&0===o&&(r=new Yr(r,t.getBody()).prev()||r),r},Np=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},zp=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},Bp=function(t,e,n,r,o){var i=ye.fromDom(e),u=ye.fromDom(t.create(r,o)),a=n?Fe(i):He(i);return rn(u,a),n?(Ze(i,u),en(u,i)):(tn(i,u),nn(u,i)),u.dom},Pp=function(t,e,n,r){var o=Vl(e,n,r);return b(o)||"BR"===o.nodeName||t.isBlock(o)},Ip=function(t,e,n){var r,o=e.parentNode,i=t.dom,u=jc(t);Ql(n)&&(u?o===i.getRoot()&&(n.list_block&&Dp(e,n.list_block)||q(ct(e.childNodes),(function(e){Ul(t,u,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=zp(i,e,u),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=null}))):i.isBlock(e)&&!i.isBlock(o)&&(Pp(i,e,!1)||Pp(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),Pp(i,e,!0)||Pp(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),function(t){return Zl(t)&&tf(t)&&Ln(yt(t,"mixed"),!0)}(n)&&!Dp(n.inline,e)||i.remove(e,!0)},Lp=function(t,e,n,r,o){var i,u=t.dom;if(!function(t,e,n){return!(!tf(n)||!Dp(e,n.inline))||(!(!Ql(n)||!Dp(e,n.block))||(Zl(n)?wn(e)&&t.is(e,n.selector):void 0))}(u,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return Tp.keep();var a=r;if(tf(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 Tp.rename("span")}if("all"!==e.remove){Ap(e.styles,(function(t,r){t=$l(u,ql(t,n),r+""),x(r)&&(r=t,o=null),(e.remove_similar||!o||Dp(Xl(u,o,r),t))&&u.setStyle(a,r,""),i=!0})),i&&""===u.getAttrib(a,"style")&&(a.removeAttribute("style"),a.removeAttribute("data-mce-style")),Ap(e.attributes,(function(t,r){var i;if(t=ql(t,n),x(r)&&(r=t,o=null),e.remove_similar||!o||Dp(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(Ep.test(r)&&a.removeAttribute("data-mce-"+r),"style"===r&&xn(["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)}})),Ap(e.classes,(function(t){t=ql(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 Tp.keep()}}return"none"!==e.remove?(Ip(t,a,e),Tp.removed()):Tp.keep()},Hp=function(t,e,n,r,o){return Lp(t,e,n,r,o).fold(R,(function(e){return t.dom.rename(r,e),!0}),N)},Fp=function(t,e,n,r){return Lp(t,e,n,r,r).fold(O(r),(function(e){return t.dom.createFragment().appendChild(r),t.dom.rename(r,e)}),O(null))},Vp=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(Yl(t.dom,e.parentNode).reverse(),(function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var u=ep(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=Fp(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),tf(u)&&Sp(f,u,0,s))}return r}(t,i,a,r,r,!0,u,n)},f=function(e){return U(i,(function(r){return Hp(t,r,n,e,e)}))},d=function(e){var n=!0,r=!1;wn(e)&&c.getContentEditable(e)&&(n=a,a="true"===c.getContentEditable(e),r=!0);var o=ct(e.childNodes);if(a&&!r){var i=f(e),s=e.parentNode;!i&&y(s)&&ef(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){wn(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&Kl(c,e.parentNode)===n&&Hp(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 Bl(t)&&wn(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),En(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=vf(t,e,i,e.collapsed);if(u.split){if(o=ud(o),(n=Rp(t,o,!0))!==(r=Rp(t,o))){if(n=Np(n,!0),r=Np(r,!1),Mp(c,n,r)){var a=I.from(n.firstChild).getOr(n);return l(Bp(c,a,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void m(!0)}if(Mp(c,r,n)){a=I.from(r.lastChild).getOr(r);return l(Bp(c,a,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void m(!1)}n=zp(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=zp(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),bf(c,s,(function(t){q(t,(function(t){Bl(t)||Bl(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}bf(c,o,(function(t){q(t,d)}))};if(r){if(Hl(r)){var h=c.createRng();h.setStartBefore(r),h.setEndAfter(r),g(h)}else g(r);Uf(t,e,r,n)}else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&tf(u)&&!Cf(t).length?mp(t,e,n,o):(Df(s,!0,(function(){Af(t,g)})),tf(u)&&np(t,e,n,s.getStart())&&Fl(c,s,s.getRng()),t.nodeChanged()),Uf(t,e,r,n);else{r=s.getNode();for(var p=0;p<i.length&&(!i[p].ceFalseOverride||!Hp(t,i[p],n,r,r));p++);Uf(t,e,r,n)}},jp=ve.each,Up=function(t,e,n,r){jp(e,(function(e){tf(e)&&jp(t.dom.select(e.inline,r),(function(r){wp(r)&&Hp(t,e,n,r,e.exact?r:null)})),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";yp(t.select(r,n),(function(n){wp(n)&&yp(e.styles,(function(e,r){t.setStyle(n,r,"")}))}))}}(t.dom,e,r)}))},Wp=ve.each,qp=function(t){return wn(t)&&!Bl(t)&&!Sl(t)&&!kn(t)},Gp=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),Wp(e.styles,(function(e,r){a.setStyle(t,r,ql(e,n))})),e.styles){var o=a.getAttrib(t,"style");o&&a.setAttrib(t,"data-mce-style",o)}Wp(e.attributes,(function(e,r){a.setAttrib(t,r,ql(e,n))})),Wp(e.classes,(function(e){e=ql(e,n),a.hasClass(t,e)||a.addClass(t,e)}))},l=function(t,e){var n=!1;return Wp(t,(function(t){return!!Zl(t)&&(y(t.collapsed)&&t.collapsed!==u?void 0:a.is(e,t.selector)&&!Sl(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);bf(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(wn(u)&&r.getContentEditable(u)&&(v=d,d="true"===r.getContentEditable(u),p=!0),Rn(u)&&!function(t,e,n,r){if(function(t){return t.getParam("format_empty_lines",!1,"boolean")}(t)&&tf(e)){var o=Dt(Dt({},t.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=$h(ye.fromDom(n),(function(t){return Sl(t.dom)}));return xt(o,r)&&Uo(ye.fromDom(n.parentNode),!1)&&!i}return!1}(t,i,u,x))return f=null,void(Ql(i)&&r.remove(u));if(Ql(i)&&i.wrapper&&ep(t,u,e,n))f=null;else{if(d&&!p&&Ql(i)&&!i.wrapper&&jl(t,b)&&Ul(t,x,m)){var C=r.rename(u,m);return s(C),c.push(C),void(f=null)}if(Zl(i)){var S=l(o,u);if(!S&&y(w)&&ef(i)&&(S=l(o,w)),!tf(i)||S)return void(f=null)}!d||p||!Ul(t,m,b)||!Ul(t,x,m)||!a&&En(u)&&so(u.data)||Sl(u)||tf(i)&&r.isBlock(u)?(f=null,q(ct(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(ct(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)&&En(t)&&0===t.length})(t)||Bl(t)||e++})),e}(u);!(c.length>1)&&r.isBlock(u)||0!==a?(tf(i)||Ql(i)&&i.wrapper)&&(i.exact||1!==a||(u=function(t){return Q(t.childNodes,qp).filter((function(t){return Zh(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)),Up(t,o,n,u),function(t,e,n,r,o){ep(t,o.parentNode,n,r)&&Hp(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,(function(i){if(ep(t,i,n,r))return Hp(t,e,r,o),!0}))}(t,i,e,n,u),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&kp(r,Op(t,"fontSize"),_p(t,"backgroundColor",ql(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=Kl(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)&&(ve.walk(r,o,"childNodes"),o(r))}(r,i,0,u),function(t,e,n,r){!tf(e)||"sub"!==e.inline&&"sup"!==e.inline||(kp(r,Op(t,"fontSize"),_p(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(r,i,0,u),Sp(r,i,0,u)):r.remove(u,!0)}))};if("false"!==a.getContentEditable(c.getNode())){if(i){if(r)if(Hl(r)){if(!l(o,r)){var g=a.createRng();g.setStartBefore(r),g.setEndAfter(r),m(a,vf(t,g,o),!0)}}else m(a,r,!0);else if(u&&tf(i)&&!Cf(t).length)!function(t,e,n){var r,o,i=t.selection,u=i.getRng(),a=u.startOffset,c=u.startContainer.nodeValue;(r=kl(t.getBody(),i.getStart()))&&(o=ap(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=vf(t,u,t.formatter.get(e));m=ud(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&o.nodeValue===ip?t.formatter.apply(e,n,r):(s=t.getDoc(),l=cp(!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)||Gp(t,p.defaultBlock),c.setRng(Rh(c.getRng())),Df(c,!0,(function(){Af(t,(function(e,n){var r=n?e:vf(t,e,o);m(a,r,!1)}))})),Fl(a,c,c.getRng()),t.nodeChanged()}!function(t,e){bp(pp[t],(function(t){t(e)}))}(e,t)}jf(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&&Zl(x)&&a.is(r,x.selector)){s(r,x);break}}jf(t,e,r,n)}},$p=function(t){return wt(t,"vars")},Xp=function(t){return t.selection.getStart()},Kp=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!!Jh(t,e,n)||!r&&y(t.formatter.matchNode(e,n,o,!0))}))},Yp=function(t,e){var n=null!=e?e:Xp(t);return X(Yl(t.dom,n),(function(t){return wn(t)&&!kn(t)}))},Jp=function(t,e,n){var r=Yp(t,e);dt(n,(function(n,o){var i=function(n){var i=Kp(t,r,o,n.similar,$p(n)?n.vars:void 0),u=i.isSome();if(n.state.get()!==u){n.state.set(u);var a=i.getOr(e);$p(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){Jp(e,n.element,t.get())})),e.on("FormatApply FormatRemove",(function(n){var r=I.from(n.node).map((function(t){return Hl(t)?t:t.startContainer})).bind((function(t){return wn(t)?I.some(t):I.from(t.parentElement)})).getOrThunk((function(){return Xp(e)}));Jp(e,r,t.get())}))}(e,t),function(t,e,n,r,o,i){var u=e.get();q(n.split(","),(function(e){var n=yt(u,e).getOrThunk((function(){var t={withSimilar:{state:aa(!1),similar:!0,callbacks:[]},withoutSimilar:{state:aa(!1),similar:!1,callbacks:[]},withVars:[]};return u[e]=t,t})),a=function(){var n=Yp(t);return Kp(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:aa(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 yt(r,t).each((function(e){r[t]={withSimilar:Dt(Dt({},e.withSimilar),{callbacks:X(e.withSimilar.callbacks,(function(t){return t!==n}))}),withoutSimilar:Dt(Dt({},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)}}},Zp=function(t,e){var n=(e||document).createDocumentFragment();return q(t,(function(t){n.appendChild(t.dom)})),ye.fromDom(n)},tv=function(t,e,n){return{element:t,width:e,rows:n}},ev=function(t,e){return{element:t,cells:e}},nv=function(t,e){return{x:t,y:e}},rv=function(t,e){var n=parseInt(Wn(t,e),10);return isNaN(n)?1:n},ov=function(t,e,n){var r=t.rows;return!!(r[n]?r[n].cells:[])[e]},iv=function(t){return Y(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)},uv=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(Se(o[i],e))return I.some(nv(i,r));return I.none()},av=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(ev(u[a].element,s))}return i},cv=function(t){var e=tv(Pa(t),0,[]);return q(ka(t,"tr"),(function(t,n){q(ka(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=rv(o,"rowspan"),u=rv(o,"colspan"),a=t.rows,c=n;c<n+i;c++){a[c]||(a[c]=ev(Ia(r),[]));for(var s=e;s<e+u;s++){a[c].cells[s]=c===n&&s===e?o:Pa(o)}}}(e,function(t,e,n){for(;ov(t,e,n);)e++;return e}(e,o,n),n,t,r)}))})),tv(e.element,iv(e.rows),e.rows)},sv=function(t){return function(t,e){var n=Pa(t.element),r=ye.fromTag("tbody");return rn(r,e),nn(n,r),n}(t,function(t){return W(t.rows,(function(t){var e=W(t.cells,(function(t){var e=Ia(t);return Gn(e,"colspan"),Gn(e,"rowspan"),e})),n=Pa(t.element);return rn(n,e),n}))}(t))},lv=function(t,e,n){return uv(t,e).bind((function(e){return uv(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?av(t,r,o,i,u):av(t,r,u,i,o);return tv(t.element,iv(a),a)}(t,e,n)}))}))},fv=function(t,e){return Q(t,(function(t){return"li"===_e(t)&&_f(t,e)})).fold(O([]),(function(e){return function(t){return Q(t,(function(t){return"ul"===_e(t)||"ol"===_e(t)}))}(t).map((function(t){var e=ye.fromTag(_e(t)),n=vt(Jn(t),(function(t,e){return Lt(e,"list-style")}));return $n(e,n),[ye.fromTag("li"),e]})).getOr([])}))},dv=function(t,e){var n=ye.fromDom(e.commonAncestorContainer),r=fg(n,t),o=X(r,(function(t){return to(t)||Qr(t)})),i=fv(r,e),u=o.concat(i.length?i:function(t){return oo(t)?Pe(t).filter(ro).fold(O([]),(function(e){return[t,e]})):ro(t)?[t]:[]}(n));return W(u,Pa)},mv=function(){return Zp([])},gv=function(t,e){return n=ye.fromDom(e.cloneContents()),r=dv(t,e),o=Y(r,(function(t,e){return nn(e,t),e}),n),r.length>0?Zp([o]):o;var n,r,o},hv=function(t,e){return(n=t,r=e[0],Fr(r,"table",E(Se,n))).bind((function(t){var n=e[0],r=e[e.length-1],o=cv(t);return lv(o,n,r).map((function(t){return Zp([sv(t)])}))})).getOrThunk(mv);var n,r},pv=function(t,e){var n=xf(e,t);return n.length>0?hv(t,n):function(t,e){return e.length>0&&e[0].collapsed?mv():gv(t,e[0])}(t,e)},vv=function(t,e){return e>=0&&e<t.length&&Il(t.charAt(e))},bv=function(t,e){var n=lo(t.innerText);return e?function(t){return t.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},yv=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return Dt(Dt({},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 I.from(t.selection.getRng()).map((function(e){var n=I.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=de.browser.isIE()&&"pre"!==o,u=t.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),a=bv(u,i),c=lo(u.textContent);if(t.dom.remove(u),vv(c,0)||vv(c,c.length-1)){var s=n.getOr(r),l=bv(s,i),f=l.indexOf(a);return-1===f?a:(vv(l,f-1)?" ":"")+a+(vv(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=mm(t,yf(o)),u=e.contextual?pv(ye.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)},wv=function(t){return wn(t)?t.outerHTML:En(t)?ai.encodeRaw(t.data,!1):An(t)?"\x3c!--"+t.data+"--\x3e":""},xv=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)},Cv=function(t,e){var n,r,o,i,u,a,c,s,l,f=W(ct(e.childNodes),wv);return function(t,e){var n=0;q(t,(function(t){0===t[0]?n++:1===t[0]?(xv(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},Sv=Rt((function(){return document.implementation.createHTMLDocument("undo")})),kv=function(t){var e,n=(e=t.getBody(),X(W(ct(e.childNodes),wv),(function(t){return t.length>0}))),r=tt(n,(function(e){var n=Rm(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)},Ov=function(t,e,n){var r=n?e.beforeBookmark:e.bookmark;"fragmented"===e.type?Cv(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw",no_selection:!y(r)||!Ol(r)||!r.isFakeCaret}),t.selection.moveToBookmark(r)},_v=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},Tv=function(t){var e=ye.fromTag("body",Sv());return za(e,_v(t)),q(ka(e,"*[data-mce-bogus]"),an),e.dom.innerHTML},Ev=function(t,e){return!(!t||!e)&&(!!function(t,e){return _v(t)===_v(e)}(t,e)||function(t,e){return Tv(t)===Tv(e)}(t,e))},Av=function(t){return 0===t.get()},Dv=function(t,e,n){Av(n)&&(t.typing=e)},Mv=function(t,e){t.typing&&(Dv(t,!1,e),t.add())},Rv=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){Av(e)&&n.set(Lc(t.selection))}(t,e,n)},add:function(e,n,r,o,i,u){return function(t,e,n,r,o,i,u){var a=kv(t);if(i=i||{},i=ve.extend(i,a),!1===Av(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&&Ev(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=Lc(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,Dv(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],Ov(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()],Ov(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]&&!Ev(kv(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 Mv(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];Ov(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 np(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]&&ep(t,i,a,n)&&(o[a]=!0,r.push(a))}}),t.dom.getRoot()),r}(t,e,n)},matchNode:function(e,n,r,o){return ep(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=Yl(r,o),u=n.length-1;u>=0;u--){var a=n[u];if(!Zl(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 rp(t,e)},apply:function(e,n,r){return Gp(t,e,n,r)},remove:function(e,n,r,o){return Vp(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!np(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?Gp(t,e,n,r):Vp(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 I.from(t.getBody()).fold(O("tree"===e.format?new bm("body",11):""),(function(r){return zm(t,e,n,r)}))}(t,e,n)},setContent:function(e,n){return Gh(t,e,n)},insertContent:function(e,n){return Vh(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 yv(t,e,n)}},raw:{getModel:function(){return I.none()}}}},Nv=function(t){return wt(t.plugins,"rtc")},zv=function(t){var e=t;return function(t){return yt(t.plugins,"rtc").bind((function(t){return I.from(t.setup)}))}(t).fold((function(){return e.rtcInstance=Rv(t),I.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:R,hasRedo:R,transact:t,ignore:C,extra:C},formatter:{match:R,matchAll:O([]),matchNode:O(void 0),canApply:R,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(I.none())}}}(),I.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 I.some(u.getRawModel())}}}}(t),t.rtc.isRemote}))}))}))},Bv=function(t){return t.rtcInstance?t.rtcInstance:Rv(t)},Pv=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},Iv=function(t,e){return void 0===e&&(e={}),function(t,e,n){return Pv(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)},Lv=function(t){return 0===t.dom.length?(un(t),I.none()):I.some(t)},Hv=function(t,e,n,r){t.bind((function(t){return(r?jg:Vg)(t.dom,r?t.dom.length:0),e.filter(De).map((function(e){return function(t,e,n,r){var o=t.dom,i=e.dom,u=r?o.length:i.length;r?(Ug(o,i,!1,!r),n.setStart(i,u)):(Ug(i,o,!1,!r),n.setEnd(i,u))}(t,e,n,r)}))})).orThunk((function(){return function(t,e){return t.filter((function(t){return Lf.isBookmarkNode(t.dom)})).bind(e?Le:Ie)}(e,r).or(e).filter(De).map((function(t){return function(t,e){Pe(t).each((function(n){var r=t.dom;e&&Rg(n,hc(r,0))?Vg(r,0):!e&&Ng(n,hc(r,r.length))&&jg(r,r.length)}))}(t,r)}))}))},Fv=function(t,e,n){void 0===n&&(n={});var r=function(t,e){return Dt(Dt({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,Dt(Dt({isRootContent:!0,forced_root_block:!1},o),e));return Hm({validate:t.validate},t.schema).serialize(i)}return e.content}(t,o);var u=t.selection.getRng();!function(t,e){var n=I.from(e.firstChild).map(ye.fromDom),r=I.from(e.lastChild).map(ye.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(Ie).filter(De).bind(Lv),i=r.bind(Le).filter(De).bind(Lv);Hv(o,n,t,!0),Hv(i,r,t,!1),t.collapse(!1)}(u,u.createContextualFragment(o.content)),t.selection.setRng(u),Ad(t,u),o.no_events||t.fire("SetContent",o)},Vv=function(t,e,n){if(t&&wt(t,e)){var r=X(t[e],(function(t){return t!==n}));0===r.length?delete t[e]:t[e]=r}};var jv,Uv,Wv=function(t){return!!t.select},qv=function(t){return!(!t||!t.ownerDocument)&&Oe(ye.fromDom(t.ownerDocument),ye.fromDom(t))},Gv=function(t,e,n,r){var o,i,u=function(t,e){var n,r,o=function(e,n){return Q(n,(function(n){return t.is(n,e)}))},i=function(e){return t.getParents(e,null,t.getRoot())};return{selectorChangedWithUnbind:function(t,u){return n||(n={},r={},e.on("NodeChange",(function(t){var e=t.element,u=i(e),a={};ve.each(n,(function(t,e){o(e,u).each((function(n){r[e]||(q(t,(function(t){t(!0,{node:n,selector:e,parents:u})})),r[e]=t),a[e]=t}))})),ve.each(r,(function(t,n){a[n]||(delete r[n],ve.each(t,(function(t){t(!1,{node:e,selector:n,parents:u})})))}))}))),n[t]||(n[t]=[]),n[t].push(u),o(t,i(e.selection.getStart())).each((function(){r[t]=n[t]})),{unbind:function(){Vv(n,t,u),Vv(r,t,u)}}}}}(t,r).selectorChangedWithUnbind,a=function(t,e){return Fv(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===im(r)){var f=$d(r);if(f.isSome())return f.map((function(t){return mm(r,[t])[0]})).getOr(l.createRange())}try{(n=s())&&!yn(n.anchorNode)&&(u=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange(),u=mm(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&&(!!Wv(t)||qv(t.startContainer)&&qv(t.endContainer))}(t)){var u=Wv(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||de.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||yn(n)||yn(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 Iv(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 I.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?dm(r.nextSibling,!0):r.parentNode,o=0===u?dm(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 lm(r.getBody(),l(),t)},getEnd:function(t){return fm(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||lm(u,e,e.collapsed),t.isBlock),r=t.getParent(r||fm(u,e,e.collapsed),t.isBlock),n&&n!==u&&i.push(n),n&&r&&n!==r){o=n;for(var a=new Yr(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(!(yf(n).length>1)&&Ef(r)){var o=od(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){y(t)?function(t,e,n){(t.inline?_d:Ed)(t,e,n)}(r,t,e):Ad(r,l(),e)},placeCaretAt:function(t,e){return f(Xf(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?hc.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,h.destroy()}},g=Lf(m),h=Gf(m,r);return m.bookmarkManager=g,m.controlSelection=h,m},$v=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"])}))}))},Xv=function(t,e){var n=yi();e.convert_fonts_to_spans&&$v(t,n,ve.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)},Kv=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},Yv=function(t,e){var n;try{n=atob(e)}catch(t){return I.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return I.some(new Blob([r],{type:t}))},Jv=function(t){return 0===t.indexOf("blob:")?function(t){return new Ur((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 Ur((function(t){var n=Kv(e),r=n.type,o=n.data;Yv(r,o).fold((function(){return t(new Blob([]))}),t)}))):null;var e},Qv=0,Zv=function(t){return(t||"blobid")+Qv++},tb=function(t,e,n,r){var o,i;if(0!==e.src.indexOf("blob:")){var u=Kv(e.src),a=u.data,c=u.type;o=a,(i=t.getByData(o,c))?n({image:e,blobInfo:i}):Jv(e.src).then((function(r){i=t.create(Zv(),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}):Jv(e.src).then((function(r){(function(t){return new Ur((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))})(r).then((function(u){o=Kv(u).data,i=t.create(Zv(),r,o),t.add(i),n({image:e,blobInfo:i})}))}),(function(t){r(t)}))},eb=function(t,e){var n={};return{findAll:function(r,o){o||(o=N);var i=X(function(t){return t?ct(t.getElementsByTagName("img")):[]}(r),(function(e){var n=e.src;return!!de.fileApi&&(!e.hasAttribute("data-mce-bogus")&&(!e.hasAttribute("data-mce-placeholder")&&(!(!n||n===de.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 Ur((function(e){n[t.src].then((function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})}))}));var r=new Ur((function(n,r){tb(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 Ur.all(u)}}},nb=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new bm("br",1)).shortEnded=!0:r.empty().append(new bm("#text",3)).value=" "},rb=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},ob=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)}))},ib=function(t,e){var n=e.blob_cache,r=function(t){var r=t.attr("src");(function(t){return t.attr("src")===de.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?I.some({type:e[1],data:decodeURIComponent(e[2])}):I.none()}(r).filter((function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),dt(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 I.from(n.getByData(r,e)).orThunk((function(){return Yv(e,r).map((function(t){var e=n.create(Zv(),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)}))},ub=ve.makeMap,ab=ve.each,cb=ve.explode,sb=ve.extend,lb=function(t,e){void 0===e&&(e=vi());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){ab(cb(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){ab(cb(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t=[];for(var e in n)wt(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=sb(ub("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\r\n]+/g,T=/^[ \t\r\n]+$/,E=wt(S,c.context)||wt(S,t.root_name),A=function(t,e){var r,i=new bm(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=Mm({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(_," "),function(t,e){return t&&(wt(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||T.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||T.test(o))&&(r.remove(),r=i),r=i}if(E&&S[n]&&(E=!1),a.removeEmpty&&ob(e,y,S,p))return u=p.parent,b[p.name]?p.empty().remove():p.unwrap(),void(p=u);a.paddEmpty&&(function(t){return rb(t,"#text")&&" "===t.firstChild.value}(p)||ob(e,y,S,p))&&nb(t,c,b,p),p=p.parent}}},e),R=p=new bm(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=ub("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}ob(e,r,o,d)?f.insert(l,h[0],!0):(f.insert(d,h[0],!0),f.insert(l,d)),f=h[0],(ob(e,r,o,f)||rb(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 bm("ul",1)));continue}e.isValidChild(l.parent.name,"div")&&e.isValidChild("div",l.name)?l.wrap(u(new bm("div",1))):c(l)}}}}(v)),C&&("body"===R.name||c.isRootContent)&&function(){var n=R.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(R.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),R.insert(r,n),r.append(n)):(o(r),r=null),n=i}o(r)}}(),!c.invalid){for(h in o)if(wt(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 R}};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=ve.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(),ob(n,h,p,a)&&(f=n.getElementRule(a.name))&&(f.removeEmpty?a.remove():f.paddEmpty&&nb(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 bm("#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?ve.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 bm("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)}})),ib(t,e)}(a,t),function(t,e){e.inline_styles&&Xv(t,e)}(a,t),a},fb=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("");ve.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,Dt(Dt({},n),{node:i})),r&&(o.doc=r),i}(t,e,n):e},db=function(t,e,n){-1===ve.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))},mb=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,Dt(Dt({},e),{content:n})).content:n}(t,o,function(t,e,n){return Hm(t,e).serialize(n)}(e,n,r))},gb=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:na.DOM,o=e&&e.schema?e.schema:vi(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=lb(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)I.from(o.firstChild).exists((function(t){return!so(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=ai.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=Dt({format:"html"},u),c=fb(e,n,a),s=function(t,e,n){var r=lo(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||ao(ye.fromDom(e))?r:ve.trim(r)}(r,c,a),l=function(t,e,n){var r=n.selection?Dt({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:mb(e,t,o,l,a)},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:E(db,i,n),getTempAttrs:O(n),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},hb=function(t,e){var n=gb(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}},pb=function(t,e){return void 0===e&&(e={}),function(t,e,n){return Bv(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")},vb=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return Bv(t).editor.setContent(e,n)}(t,e,n)},bb=na.DOM,yb=function(t){return I.from(t).each((function(t){return t.destroy()}))},wb=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&&bb.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){bb.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),bb.remove(t.getContainer()),yb(e),yb(n),t.destroy()}},xb=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(),yb(n),yb(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),bb.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())},Cb=(jv=function(t,e){return m(t)&&m(e)?Cb(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)wt(o,i)&&(n[i]=jv(n[i],o[i]))}return n}),Sb="autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),kb="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),Ob="imagetools,toc".split(","),_b=function(t){var e=X(Sb,(function(e){return wt(t,e)})),n=t.forced_root_block;return!1!==n&&""!==n||e.push("forced_root_block (false only)"),ot(e)},Tb=function(t){var e=ve.makeMap(t.plugins," "),n=function(t){return wt(e,t)},r=Mt(Mt([],X(kb,n),!0),tt(Ob,(function(t){return n(t)?[t+" (moving to premium)"]:[]})),!0);return ot(r)},Eb=re().deviceType,Ab=Eb.isTouch(),Db=Eb.isPhone(),Mb=Eb.isTablet(),Rb=["lists","autolink","autosave"],Nb={table_grid:!1,object_resizing:!1,resize:!1},zb=function(t){var e=g(t)?t.join(" "):t,n=W(d(e)?e.split(" "):[],Ft);return X(n,(function(t){return t.length>0}))},Bb=function(t,e){var n,r,o=(r={},pt(e,(function(e,n){return j(t,n)}),ht(n={}),ht(r)),{t:n,f:r});return function(t,e){return{sections:O(t),settings:O(e)}}(o.t,o.f)},Pb=function(t,e){return wt(t.sections(),e)},Ib=function(t,e){return yt(t,"toolbar_mode").orThunk((function(){return yt(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)},Lb=function(t,e){var n={resize:!1,toolbar_mode:Ib(t,"scrolling"),toolbar_sticky:!1};return Dt(Dt(Dt({},Nb),n),e?{menubar:!1}:{})},Hb=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?ve.extend({},t.external_plugins,n):n},Fb=function(t,e,n,r){return t&&function(t,e,n){var r=t.sections();return Pb(t,e)&&r[e].theme===n}(e,"mobile","mobile")?X(r,E(j,Rb)):t&&Pb(e,"mobile")?r:n},Vb=function(t,e,n,r){var o=zb(n.forced_plugins),i=zb(r.plugins),u=function(t,e){return Pb(t,e)?t.sections()[e]:{}}(e,"mobile"),a=u.plugins?zb(u.plugins):i,c=function(t,e){return[].concat(zb(t)).concat(zb(e))}(o,Fb(t,e,i,a));if(de.browser.isIE()&&j(c,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return ve.extend(r,{plugins:c.join(" ")})},jb=function(t,e,n,r,o){var i=t?{mobile:Lb(o.mobile||{},e)}:{},u=Bb(["mobile"],Cb(i,o)),a=ve.extend(n,r,u.settings(),function(t,e){return t&&Pb(e,"mobile")}(t,u)?function(t,e,n){void 0===n&&(n={});var r=t.sections(),o=yt(r,e).getOr({});return ve.extend({},n,o)}(u,"mobile"):{},{validate:!0,external_plugins:Hb(r,u.settings())});return Vb(t,u,r,a)},Ub=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:Ib(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 Dt(Dt({},i),r?Nb:{})}(o,e,n,Ab,t),u=jb(Db||Mb,Db,i,r,o);return!1!==u.deprecation_warnings&&function(t,e){var n=_b(t),r=Tb(e),o=r.length>0,i=n.length>0,u="mobile"===e.theme;if(o||i||u){var a=u?"\n\nThemes:\n- mobile":"",c=o?"\n\nPlugins:\n- "+r.join("\n- "):"",s=i?"\n\nSettings:\n- "+n.join("\n- "):"";console.warn("The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information."+a+c+s)}}(o,u),u},Wb=function(t,e,n){return I.from(e.settings[n]).filter(t)},qb=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[ve.trim(n[0])]=ve.trim(n[1]):e[ve.trim(n[0])]=ve.trim(n[0])})):e=t,e}(i):"string"===r?Wb(d,t,e).getOr(n):"number"===r?Wb(x,t,e).getOr(n):"boolean"===r?Wb(p,t,e).getOr(n):"object"===r?Wb(m,t,e).getOr(n):"array"===r?Wb(g,t,e).getOr(n):"string[]"===r?Wb((o=d,function(t){return g(t)&&et(t,o)}),t,e).getOr(n):"function"===r?Wb(w,t,e).getOr(n):i},Gb=(Uv={},{add:function(t,e){Uv[t]=e},get:function(t){return Uv[t]?Uv[t]:{icons:{}}},has:function(t){return wt(Uv,t)}}),$b=function(t,e){return e.dom[t]},Xb=function(t,e){return parseInt(Xn(e,t),10)},Kb=E($b,"clientWidth"),Yb=E($b,"clientHeight"),Jb=E(Xb,"margin-top"),Qb=E(Xb,"margin-left"),Zb=function(t,e,n){var r,o=ye.fromDom(t.getBody()),i=t.inline?o:(r=o,ye.fromDom(ze(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+Qb(e):0),y:r-(t?o.top+e.dom.clientTop+Jb(e):0)}}(t.inline,i,e,n);return function(t,e,n){var r=Kb(t),o=Yb(t);return e>=0&&n>=0&&e<=r&&n<=o}(i,u.x,u.y)},ty=function(t){var e,n=t.inline?t.getBody():t.getContentAreaContainer();return(e=n,I.from(e).map(ye.fromDom)).map(cn).getOr(!1)},ey=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 I.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&&ty(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 ye.fromDom(t.getEl()).dom.focus()}))}));return function(t){e.push(t)}(a),o(),t.fire("OpenNotification",{notification:Dt({},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),o()})),t.on("show ResizeEditor ResizeWindow NodeChange",(function(){$r.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}},ny=da.PluginManager,ry=da.ThemeManager;var oy=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),Gd(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(){I.from(e[e.length-1]).each((function(t){n().close(t),i(t)}))}}},iy=function(t,e){t.notificationManager.open({type:"error",text:e})},uy=function(t,e){t._skinLoaded?iy(t,e):t.on("SkinLoaded",(function(){iy(t,e)}))},ay=function(t,e,n){Vf(t,e,{message:n}),console.error(n)},cy=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},sy=function(t,e,n){ay(t,"PluginLoadError",cy("plugin",e,n))},ly=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,Mt([t],e,!1)):r.log.apply(r,Mt([t],e,!1)))},fy=function(t){return dy(t,function(t){var e=t.getParam("content_css");return d(e)?W(e.split(","),Ft):g(e)?e:!1===e||t.inline?[]:["default"]}(t))},dy=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)}))},my=function(t){t.contentCSS=t.contentCSS.concat(fy(t),function(t){return dy(t,es(t))}(t))},gy=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={}}}},hy=0,py=function(t){return t+hy+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e},vy=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){ve.each(n[t],(function(t){t(e)})),delete n[t]},a=function(r,a){return r=ve.grep(r,(function(e){return!t.isUploaded(e.blobUri())})),Ur.all(ve.map(r,(function(r){return t.isPending(r.blobUri())?function(t){var e=t.blobUri();return new Ur((function(t){n[e]=n[e]||[],n[e].push(t)}))}(r):function(e,n,r){return t.markPending(e.blobUri()),new Ur((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||I.from(c).orThunk((function(){return I.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 Ur((function(t){t([])}))}}},by=function(t){return function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}},yy=function(t,e){return vy(e,{url:$c(t),basePath:Xc(t),credentials:Kc(t),handler:Yc(t)})},wy=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||py("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=gy(),i=[],u=function(t){var e=aa(null);t.on("change AddUndo",(function(t){e.set(Dt({},t.level))}));return{fireIfChanged:function(){var n=t.undoManager.data;at(n).filter((function(t){return!Ev(e.get(),t)})).each((function(e){t.setDirty(!0),t.fire("change",{level:e,lastLevel:it(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===de.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=yy(t,o)),p().then(a((function(o){var i=W(o,(function(t){return t.blobInfo}));return e.upload(i,by(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),Nv(t)||function(e,n){var r,o=t.convertURL(n,"src");l(e.src,n),t.$(e).attr({src:qc(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"),de.transparentSrc),i.push(a)),function(t,e){uy(t,fa.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&&(Nv(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(Wc(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",N,"function")}(t)(e))},p=function(){return n||(n=eb(o,r)),n.findAll(t.getBody(),h).then(a((function(e){return e=X(e,(function(e){return"string"!=typeof e||(uy(t,e),!1)})),Nv(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(){Wc(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}}},xy=function(t){var e={},n=function(t,r){t&&(d(t)?(g(r)||(r=[r]),q(r,(function(t){v(t.deep)&&(t.deep=!Zl(t)),v(t.split)&&(t.split=!Zl(t)||tf(t)),v(t.remove)&&Zl(t)&&!tf(t)&&(t.remove="none"),Zl(t)&&tf(t)&&(t.mixed=!0,t.block_expand=!0),d(t.classes)&&(t.classes=t.classes.split(/\s+/))})),e[t]=r):dt(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 wn(t)&&t.hasAttribute("href")},onformat:function(e,n,r){ve.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 ve.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 wt(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}},Cy=ve.each,Sy=na.DOM,ky=function(t,e){var n,r,o,i=e&&e.schema||vi({}),u=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Sy.create(r.name);return function(t,e){e.classes.length&&Sy.addClass(t,e.classes.join(" ")),Sy.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!==ve.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=Sy.create("div")).appendChild(t),ve.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=Sy.create("div")).appendChild(a(n,t.slice(1),r.siblings)),o):""},Oy=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=ve.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!==ve.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},_y=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=yt(e,"preview");if(Ln(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"),ve.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=ve.map(t.split(/(?:~\+|~|\+)/),Oy),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=ky(l,t)):r=ky([n],t);var f=Sy.select(n,r)[0]||r.firstChild;return Cy(e.styles,(function(t,e){var n=a(t);n&&Sy.setStyle(f,e,n)})),Cy(e.attributes,(function(t,e){var n=a(t);n&&Sy.setAttrib(f,e,n)})),Cy(e.classes,(function(t){var e=a(t);Sy.hasClass(f,e)||Sy.addClass(f,e)})),t.fire("PreviewFormats"),Sy.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Sy.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Cy(u.split(" "),(function(e){var n=Sy.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Sy.getStyle(t.getBody(),e,!0),"#ffffff"===Sy.toHex(n).toLowerCase())||"color"===e&&"#000000"===Sy.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"),Sy.remove(r),i},Ty=function(t){var e=xy(t),n=aa(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),gp(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){Pv(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){Pv(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){Pv(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:function(e,n,r,o){return function(t,e,n,r,o){return Pv(t).formatter.match(e,n,r,o)}(t,e,n,r,o)},closest:function(e){return function(t,e){return Pv(t).formatter.closest(e)}(t,e)},matchAll:function(e,n){return function(t,e,n){return Pv(t).formatter.matchAll(e,n)}(t,e,n)},matchNode:function(e,n,r,o){return function(t,e,n,r,o){return Pv(t).formatter.matchNode(e,n,r,o)}(t,e,n,r,o)},canApply:function(e){return function(t,e){return Pv(t).formatter.canApply(e)}(t,e)},formatChanged:function(e,r,o,i){return function(t,e,n,r,o,i){return Pv(t).formatter.formatChanged(e,n,r,o,i)}(t,n,e,r,o,i)},getCssText:E(_y,t)}},Ey=function(t){switch(t.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return!0;default:return!1}},Ay=function(t){var e=ma(),n=aa(0),r=aa(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){Pv(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,u){return function(t,e,n,r,o,i,u){return Pv(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 Pv(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return Pv(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){Pv(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){Pv(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return Pv(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return Pv(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return Pv(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){Pv(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){Pv(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return Nv(t)||function(t,e,n){var r=aa(!1),o=function(t){Dv(e,!1,n),e.add({},t)};t.on("init",(function(){e.add()})),t.on("BeforeExecCommand",(function(t){var r=t.command;Ey(r)||(Mv(e,n),e.beforeChange())})),t.on("ExecCommand",(function(t){var e=t.command;Ey(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===Ev(kv(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(),Dv(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},Dy=[9,27,Wf.HOME,Wf.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Wf.DOWN,Wf.UP,Wf.LEFT,Wf.RIGHT].concat(de.browser.isFirefox()?[224]:[]),My=function(t){return"keydown"===t.type||"keyup"===t.type},Ry=function(t){var e=t.keyCode;return e===Wf.BACKSPACE||e===Wf.DELETE},Ny=function(t){var e=t.dom,n=jc(t),r=function(t){return t.getParam("placeholder",Hc.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function(i,u){if(!function(t){if(My(t)){var e=t.keyCode;return!Ry(t)&&(Wf.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||j(Dy,e))}return!1}(i)){var a=t.getBody(),c=!function(t){return My(t)&&!(Ry(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(Uo(ye.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 $r.setEditorTimeout(t,(function(){return o(e)}))}))}))},zy=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,By=function(t,e){return xe(ye.fromDom(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},Py=function(t){return"rtl"===na.DOM.getStyle(t,"direction",!0)||(e=t.textContent,zy.test(e));var e},Iy=function(t,e,n){var r=function(t,e,n){return X(na.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return I.from(r[r.length-1])},Ly=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?ho(n)?En(n.nextSibling)?hc(n.nextSibling,0):hc.after(n):bo(e)?hc(n,r+1):e:ho(n)?En(n.previousSibling)?hc(n.previousSibling,n.previousSibling.data.length):hc.before(n):yo(e)?hc(n,r-1):e},Hy=E(Ly,!0),Fy=E(Ly,!1),Vy=function(t){return no(t)||oo(t)},jy=function(t,e){return Oe(t,e)?Lr(e,Vy,function(t){return function(e){return Se(t,ye.fromDom(e.dom.parentNode))}}(t)):I.none()},Uy=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))},Wy=function(t,e){return{from:t,to:e}},qy=function(t,e){var n=ye.fromDom(t),r=ye.fromDom(e.container());return jy(n,r).map((function(t){return function(t,e){return{block:t,position:e}}(t,e)}))},Gy=function(t,e,n){var r=qy(t,hc.fromRangeStart(n)),o=r.bind((function(n){return hl(e,t,n.position).bind((function(n){return qy(t,n).map((function(n){return function(t,e,n){return Rn(n.position.getNode())&&!1===Uo(n.block)?bl(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?hl(e,t,r).bind((function(e){return qy(t,e)})):I.some(n)})).getOr(n):n}(t,e,n)}))}))}));return Hn(r,o,Wy).filter((function(t){return function(t){return!1===Se(t.from.block,t.to.block)}(t)&&function(t){return Pe(t.from.block).bind((function(e){return Pe(t.to.block).filter((function(t){return Se(e,t)}))})).isSome()}(t)&&function(t){return!1===Bn(t.from.block.dom)&&!1===Bn(t.to.block.dom)}(t)}))},$y=function(t){var e=Ve(t);return Z(e,Zr).fold(O(e),(function(t){return e.slice(0,t)}))},Xy=function(t){var e=$y(t);return q(e,un),e},Ky=function(t,e){var n=fg(e,t);return Q(n.reverse(),(function(t){return Uo(t)})).each(un)},Yy=function(t,e,n,r){if(Uo(n))return ag(n),xl(n.dom);0===X(He(r),(function(t){return!Uo(t)})).length&&Uo(e)&&Ze(r,ye.fromTag("br"));var o=wl(n.dom,hc.before(r.dom));return q(Xy(e),(function(t){Ze(r,t)})),Ky(t,e),o},Jy=function(t,e,n){if(Uo(n))return un(n),Uo(e)&&ag(e),xl(e.dom);var r=Cl(n.dom);return q(Xy(e),(function(t){nn(n,t)})),Ky(t,e),r},Qy=function(t,e){return Oe(e,t)?function(t,e){var n=fg(e,t);return I.from(n[n.length-1])}(e,t):I.none()},Zy=function(t,e){bl(t,e.dom).map((function(t){return t.getNode()})).map(ye.fromDom).filter(eo).each(un)},tw=function(t,e,n){return Zy(!0,e),Zy(!1,n),Qy(e,n).fold(E(Jy,t,e,n),E(Yy,t,e,n))},ew=function(t,e,n,r){return e?tw(t,r,n):tw(t,n,r)},nw=function(t,e){var n=ye.fromDom(t.getBody()),r=function(t,e,n){return n.collapsed?Gy(t,e,n):I.none()}(n.dom,e,t.selection.getRng()).bind((function(t){return ew(n,e,t.from.block,t.to.block)}));return r.each((function(e){t.selection.setRng(e.toRange())})),r.isSome()},rw=function(t,e){var n=ye.fromDom(e),r=E(Se,t);return Ir(n,uo,r).isSome()},ow=function(t,e){var n=wl(t.dom,hc.fromRangeStart(e)).isNone(),r=yl(t.dom,hc.fromRangeEnd(e)).isNone();return!function(t,e){return rw(t,e.startContainer)||rw(t,e.endContainer)}(t,e)&&n&&r},iw=function(t){var e=ye.fromDom(t.getBody()),n=t.selection.getRng();return ow(e,n)?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Hn(jy(t,ye.fromDom(n.startContainer)),jy(t,ye.fromDom(n.endContainer)),(function(r,o){return!1===Se(r,o)&&(n.deleteContents(),ew(t,!0,r,o).each((function(t){e.setRng(t.toRange())})),!0)})).getOr(!1)}(e,t.selection)},uw=function(t,e){return!t.selection.isCollapsed()&&iw(t)},aw=zn,cw=Bn,sw=function(t,e,n,r,o){return I.from(e._selectionOverrides.showCaret(t,n,r,o))},lw=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?I.none():I.some(function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e))},fw=function(t,e,n){var r=$s(1,t.getBody(),e),o=hc.fromRangeStart(r),i=o.getNode();if(_s(i))return sw(1,t,i,!o.isAtEnd(),!1);var u=o.getNode(!0);if(_s(u))return sw(1,t,u,!1,!1);var a=t.dom.getParent(o.getNode(),(function(t){return cw(t)||aw(t)}));return _s(a)?sw(1,t,a,!1,n):I.none()},dw=function(t,e,n){return e.collapsed?fw(t,e,n).getOr(e):e},mw=function(t){return og(t)||tg(t)},gw=function(t){return ig(t)||eg(t)},hw=function(t,e,n,r,o,i){return sw(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){En(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},pw=function(t,e){return function(t,e){var n=t.selection.getRng();if(!En(n.commonAncestorContainer))return!1;var r=e?pc.Forwards:pc.Backwards,o=ll(t.getBody()),i=E(Js,e?o.next:o.prev),u=e?mw:gw,a=Ks(r,t.getBody(),n),c=Ly(e,i(a));if(!c||!Qs(a,c))return!1;if(u(c))return hw(t,n,a.getNode(),r,e,c);var s=i(c);return!!(s&&u(s)&&Qs(c,s))&&hw(t,n,a.getNode(),r,e,s)}(t,e)},vw=gr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),bw=function(t,e,n,r){var o=r.getNode(!1===e);return jy(ye.fromDom(t),ye.fromDom(n.getNode())).map((function(t){return Uo(t)?vw.remove(t.dom):vw.moveToElement(o)})).orThunk((function(){return I.some(vw.moveToElement(o))}))},yw=function(t,e,n){return hl(e,t,n).bind((function(r){return o=r.getNode(),uo(ye.fromDom(o))||oo(ye.fromDom(o))?I.none():function(t,e,n,r){var o=function(e){return to(ye.fromDom(e))&&!Fs(n,r,t)};return Xs(!e,n).fold((function(){return Xs(e,r).fold(R,o)}),o)}(t,e,n,r)?I.none():e&&Bn(r.getNode())?bw(t,e,n,r):!1===e&&Bn(r.getNode(!0))?bw(t,e,n,r):e&&ig(n)?I.some(vw.moveToPosition(r)):!1===e&&og(n)?I.some(vw.moveToPosition(r)):I.none();var o}))},ww=function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return wn(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&Bn(e.nextSibling)?I.some(vw.moveToElement(e.nextSibling)):!1===t&&Bn(e.previousSibling)?I.some(vw.moveToElement(e.previousSibling)):I.none()}(e,n.getNode(!1===e)).fold((function(){return yw(t,e,n)}),I.some):yw(t,e,n).bind((function(e){return function(t,e,n){return n.fold((function(t){return I.some(vw.remove(t))}),(function(t){return I.some(vw.moveToElement(t))}),(function(n){return Fs(e,n,t)?I.none():I.some(vw.moveToPosition(n))}))}(t,n,e)}))},xw=function(t,e){return I.from(Hf(t.getBody(),e))},Cw=function(t,e){var n=t.selection.getNode();return xw(t,n).filter(Bn).fold((function(){return function(t,e,n){var r=$s(e?1:-1,t,n),o=hc.fromRangeStart(r),i=ye.fromDom(t);return!1===e&&ig(o)?I.some(vw.remove(o.getNode(!0))):e&&og(o)?I.some(vw.remove(o.getNode())):!1===e&&og(o)&&Sg(i,o)?kg(i,o).map((function(t){return vw.remove(t.getNode())})):e&&ig(o)&&Cg(i,o)?Og(i,o).map((function(t){return vw.remove(t.getNode())})):ww(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(),th(t,e,ye.fromDom(n)),!0}}(t,e),function(t,e){return function(n){var r=e?hc.before(n):hc.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))}))}),N)},Sw=function(t,e){var n=t.selection.getNode();return!(!Bn(n)||Pn(n))&&xw(t,n.parentNode).filter(Bn).fold((function(){var n;return n=ye.fromDom(t.getBody()),q(ka(n,".mce-offscreen-selection"),un),th(t,e,ye.fromDom(t.selection.getNode())),Uy(t),!0}),N)},kw=function(t){var e=t.dom,n=t.selection,r=Hf(t.getBody(),n.getNode());if(zn(r)&&e.isBlock(r)&&e.isEmpty(r)){var o=e.create("br",{"data-mce-bogus":"1"});e.setHTML(r,""),r.appendChild(o),n.setRng(hc.before(o).toRange())}return!0},Ow=function(t,e){return t.selection.isCollapsed()?Cw(t,e):Sw(t,e)},_w=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=hc.fromRangeStart(t.selection.getRng());return hl(e,t.getBody(),n).filter((function(t){return e?Qm(t):Zm(t)})).bind((function(t){return I.from(Vs(e?0:-1,t))})).exists((function(e){return t.selection.select(e),!0}))}(t,e)},Tw=En,Ew=function(t){return Tw(t)&&t.data[0]===co},Aw=function(t){return Tw(t)&&t.data[t.data.length-1]===co},Dw=function(t){return t.ownerDocument.createTextNode(co)},Mw=function(t,e){return t?function(t){if(Tw(t.previousSibling))return Aw(t.previousSibling)?t.previousSibling:(t.previousSibling.appendData(co),t.previousSibling);if(Tw(t))return Ew(t)?t:(t.insertData(0,co),t);var e=Dw(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if(Tw(t.nextSibling))return Ew(t.nextSibling)?t.nextSibling:(t.nextSibling.insertData(0,co),t.nextSibling);if(Tw(t))return Aw(t)?t:(t.appendData(co),t);var e=Dw(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},Rw=E(Mw,!0),Nw=E(Mw,!1),zw=function(t,e){return En(t.container())?Mw(e,t.container()):Mw(e,t.getNode())},Bw=function(t,e){var n=e.get();return n&&t.container()===n&&ho(n)},Pw=function(t,e){return e.fold((function(e){bs(t.get());var n=Rw(e);return t.set(n),I.some(hc(n,n.length-1))}),(function(e){return xl(e).map((function(e){if(Bw(e,t))return hc(t.get(),1);bs(t.get());var n=zw(e,!0);return t.set(n),hc(n,1)}))}),(function(e){return Cl(e).map((function(e){if(Bw(e,t))return hc(t.get(),t.get().length-1);bs(t.get());var n=zw(e,!1);return t.set(n),hc(n,n.length-1)}))}),(function(e){bs(t.get());var n=Nw(e);return t.set(n),I.some(hc(n,1))}))},Iw=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return I.none()},Lw=gr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Hw=function(t,e){var n=Hs(e,t);return n||t},Fw=function(t,e,n){var r=Hy(n),o=Hw(e,r.container());return Iy(t,o,r).fold((function(){return yl(o,r).bind(E(Iy,t,o)).map((function(t){return Lw.before(t)}))}),I.none)},Vw=function(t,e){return null===kl(t,e)},jw=function(t,e,n){return Iy(t,e,n).filter(E(Vw,e))},Uw=function(t,e,n){var r=Fy(n);return jw(t,e,r).bind((function(t){return wl(t,r).isNone()?I.some(Lw.start(t)):I.none()}))},Ww=function(t,e,n){var r=Hy(n);return jw(t,e,r).bind((function(t){return yl(t,r).isNone()?I.some(Lw.end(t)):I.none()}))},qw=function(t,e,n){var r=Fy(n),o=Hw(e,r.container());return Iy(t,o,r).fold((function(){return wl(o,r).bind(E(Iy,t,o)).map((function(t){return Lw.after(t)}))}),I.none)},Gw=function(t){return!1===Py(Xw(t))},$w=function(t,e,n){return Iw([Fw,Uw,Ww,qw],[t,e,n]).filter(Gw)},Xw=function(t){return t.fold(_,_,_,_)},Kw=function(t){return t.fold(O("before"),O("start"),O("end"),O("after"))},Yw=function(t){return t.fold(Lw.before,Lw.before,Lw.after,Lw.after)},Jw=function(t){return t.fold(Lw.start,Lw.start,Lw.end,Lw.end)},Qw=function(t,e,n,r,o,i){return Hn(Iy(e,n,r),Iy(e,n,o),(function(e,r){return e!==r&&function(t,e,n){var r=Hs(e,t),o=Hs(n,t);return r&&r===o}(n,e,r)?Lw.after(t?e:r):i})).getOr(i)},Zw=function(t,e){return t.fold(N,(function(t){return r=e,!(Kw(n=t)===Kw(r)&&Xw(n)===Xw(r));var n,r}))},tx=function(t,e){return t?e.fold(S(I.some,Lw.start),I.none,S(I.some,Lw.after),I.none):e.fold(I.none,S(I.some,Lw.before),I.none,S(I.some,Lw.end))},ex=function(t,e,n,r){var o=Ly(t,r),i=$w(e,n,o);return $w(e,n,o).bind(E(tx,t)).orThunk((function(){return function(t,e,n,r,o){var i=Ly(t,o);return hl(t,n,i).map(E(Ly,t)).fold((function(){return r.map(Yw)}),(function(o){return $w(e,n,o).map(E(Qw,t,e,n,i,o)).filter(E(Zw,r))})).filter(Gw)}(t,e,n,i,r)}))};E(ex,!1),E(ex,!0);var nx,rx=function(t,e,n){var r=t?1:-1;return e.setRng(hc(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0},ox=function(t,e){var n=e.selection.getRng(),r=t?hc.fromRangeEnd(n):hc.fromRangeStart(n);return!!function(t){return w(t.selection.getSel().modify)}(e)&&(t&&bo(r)?rx(!0,e.selection,r):!(t||!yo(r))&&rx(!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"}(nx||(nx={}));var ix,ux=function(t,e){return t===pc.Backwards?nt(e):e},ax=function(t,e,n){return t===pc.Forwards?e.next(n):e.prev(n)},cx=function(t,e,n,r){return Rn(r.getNode(e===pc.Forwards))?nx.Br:!1===Fs(n,r)?nx.Block:nx.Wrap},sx=function(t,e,n,r){for(var o=ll(n),i=r,u=[];i;){var a=ax(e,o,i);if(!a)break;if(Rn(a.getNode(!1)))return e===pc.Forwards?{positions:ux(e,u).concat([a]),breakType:nx.Br,breakAt:I.some(a)}:{positions:ux(e,u),breakType:nx.Br,breakAt:I.some(a)};if(a.isVisible()){if(t(i,a)){var c=cx(0,e,i,a);return{positions:ux(e,u),breakType:c,breakAt:I.some(a)}}u.push(a),i=a}else i=a}return{positions:ux(e,u),breakType:nx.Eol,breakAt:I.none()}},lx=function(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===pc.Backwards?o.concat(r):[r].concat(o)})).getOr([])},fx=function(t,e){return Y(t,(function(t,n){return t.fold((function(){return I.some(n)}),(function(r){return Hn(ut(r.getClientRects()),ut(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),I.none())},dx=function(t,e){return ut(e.getClientRects()).bind((function(e){return fx(t,e.left)}))},mx=E(sx,hc.isAbove,-1),gx=E(sx,hc.isBelow,1),hx=E(lx,-1,mx),px=E(lx,1,gx),vx=function(t){var e=function(e){return W(e,(function(e){var n=Va(e);return n.node=t,n}))};if(wn(t))return e(t.getClientRects());if(En(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},bx=function(t){return tt(t,vx)};!function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}(ix||(ix={}));var yx,wx,xx=function(t,e,n,r,o,i){var u=0,a=[],c=function(r){var i=bx([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,At(a))&&u++,l.line=u,o(l))return!0;a.push(l)}}},s=At(i.getClientRects());if(!s)return a;var l=i.getNode();return c(l),function(t,e,n,r){for(;r=Ls(r,t,Bo,e);)if(n(r))return}(t,r,c,l),a},Cx=E(xx,ix.Up,Wa,qa),Sx=E(xx,ix.Down,qa,Wa),kx=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},Ox=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},_x=Bn,Tx=Ls,Ex=function(t,e){return Math.abs(t.left-e)},Ax=function(t,e){return Math.abs(t.right-e)},Dx=function(t,e){return t>=e.left&&t<=e.right},Mx=function(t,e){return t>=e.top&&t<=e.bottom},Rx=function(t,e,n){return void 0===n&&(n=N),Tt(t,(function(t,r){if(Dx(e,r))return n(r)?r:t;if(Dx(e,t))return n(t)?t:r;var o=Math.min(Ex(t,e),Ax(t,e)),i=Math.min(Ex(r,e),Ax(r,e));return i===o&&xt(r,"node")&&_x(r.node)?r:i<o?r:t}))},Nx=function(t,e,n,r,o){var i=Tx(r,t,Bo,e,!o);do{if(!i||n(i))return}while(i=Tx(i,t,Bo,e))},zx=function(t,e,n){var r=bx(function(t){return X(ct(t.getElementsByTagName("*")),Ts)}(t)),o=X(r,E(Mx,n)),i=function(t){return!On(t.node)&&!In(t.node)},u=Rx(o,e,i);if(u){var a=i(u);if((u=Rx(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=X(bx([n]),(function(n){return!t(n,e)}));return r=r.concat(o),0===o.length};return r.push(e),Nx(ix.Up,t,E(o,Wa),e.node,n),Nx(ix.Down,t,E(o,qa),e.node,n),r}(t,u,a),e,i))&&Ts(u.node))return function(t,e){return{node:t.node,before:Ex(t,e)<Ax(t,e)}}(u,e)}return null},Bx=function(t,e){t.selection.setRng(e),Ad(t,t.selection.getRng())},Px=function(t,e,n){return I.some(dw(t,e,n))},Ix=function(t,e,n,r,o,i){var u=e===pc.Forwards,a=ll(t.getBody()),c=E(Js,u?a.next:a.prev),s=u?r:o;if(!n.collapsed){var l=$a(n);if(i(l))return sw(e,t,l,e===pc.Backwards,!1)}var f=Ks(e,t.getBody(),n);if(s(f))return lw(t,f.getNode(!u));var d=Ly(u,c(f)),m=ko(n);if(!d)return m?I.some(n):I.none();if(s(d))return sw(e,t,d.getNode(!u),u,!1);var g=c(d);return g&&s(g)&&Qs(d,g)?sw(e,t,g.getNode(!u),u,!1):m?Px(t,d.toRange(),!1):I.none()},Lx=function(t,e,n,r,o,i){var u=Ks(e,t.getBody(),n),a=At(u.getClientRects()),c=e===ix.Down;if(!a)return I.none();var s,l=(c?Sx:Cx)(t.getBody(),kx(1),u),f=X(l,Ox(1)),d=a.left,m=Rx(f,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),h=Math.abs(d-m.right);return sw(e,t,m.node,g<h,!1)}if(s=r(u)?u.getNode():o(u)?u.getNode(!0):$a(n)){var p=function(t,e,n,r){var o,i,u,a,c=ll(e),s=[],l=0,f=function(t){return At(t.getClientRects())};1===t?(o=c.next,i=qa,u=Wa,a=hc.after(r)):(o=c.prev,i=Wa,u=qa,a=hc.before(r));var d=f(a);do{if(a.isVisible()){var m=f(a);if(!u(m,d)){s.length>0&&i(m,At(s))&&l++;var g=Va(m);if(g.position=a,g.line=l,n(g))return s;s.push(g)}}}while(a=o(a));return s}(e,t.getBody(),kx(1),s),v=Rx(X(p,Ox(1)),d);if(v)return Px(t,v.position.toRange(),!1);if(v=At(X(p,Ox(0))))return Px(t,v.position.toRange(),!1)}return 0===f.length?Hx(t,c).filter(c?o:r).map((function(e){return dw(t,e.toRange(),!1)})):I.none()},Hx=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=hc.fromRangeEnd(n),i=gx(r,o);return at(i.positions)}o=hc.fromRangeStart(n),i=mx(r,o);return ut(i.positions)},Fx=function(t,e,n){return Hx(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))},Vx=function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)},jx=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},Ux=function(t,e,n){return Pw(e,n).map((function(e){return Vx(t,e),n}))},Wx=function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=hc.fromRangeStart(t.selection.getRng());hc.isTextPosition(n)&&!1===function(t){return bo(t)||yo(t)}(n)&&(Vx(t,vs(e.get(),n)),e.set(null))}},qx=function(t,e,n){return!!us(t)&&function(t,e,n){var r=t.getBody(),o=hc.fromRangeStart(t.selection.getRng()),i=E(By,t);return ex(n,i,r,o).bind((function(n){return Ux(t,e,n)}))}(t,e,n).isSome()},Gx=function(t,e,n){return!!us(e)&&ox(t,e)},$x=function(t){var e=aa(null),n=E(By,t);return t.on("NodeChange",(function(r){!us(t)||de.browser.isIE()&&r.initial||(function(t,e,n){var r=W(ka(ye.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(jx,!1)),q(rt(i,o),E(jx,!0))}(n,t.dom,r.parents),Wx(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=X(r,t);q(o,(function(r){var o=hc.fromRangeStart(e.selection.getRng());$w(t,e.getBody(),o).bind((function(t){return Ux(e,n,t)}))}))}}(n,t,e,r.parents))})),e},Xx=E(Gx,!0),Kx=E(Gx,!1),Yx=function(t,e,n){if(us(t)){var r=Hx(t,e).getOrThunk((function(){var n=t.selection.getRng();return e?hc.fromRangeEnd(n):hc.fromRangeStart(n)}));return $w(E(By,t),t.getBody(),r).exists((function(e){var r=Yw(e);return Pw(n,r).exists((function(e){return Vx(t,e),!0}))}))}return!1},Jx=function(t,e){return function(n){return Pw(e,n).exists((function(e){return Vx(t,e),!0}))}},Qx=function(t,e,n,r){var o=t.getBody(),i=E(By,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"),$w(i,o,hc.fromRangeStart(t.selection.getRng())).map(Jw).map(Jx(t,e))})),t.nodeChanged()},Zx=function(t,e,n,r){var o=function(t,e){var n=Hs(e,t);return n||t}(t.getBody(),r.container()),i=E(By,t),u=$w(i,o,r);return u.bind((function(t){return n?t.fold(O(I.some(Jw(t))),I.none,O(I.some(Yw(t))),I.none):t.fold(I.none,O(I.some(Yw(t))),I.none,O(I.some(Jw(t))))})).map(Jx(t,e)).getOrThunk((function(){var a=pl(n,o,r),c=a.bind((function(t){return $w(i,o,t)}));return Hn(u,c,(function(){return Iy(i,o,r).exists((function(e){return!!function(t){return Hn(xl(t),Cl(t),(function(e,n){var r=Ly(!0,e),o=Ly(!1,n);return yl(t,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)}(e)&&(th(t,n,ye.fromDom(e)),!0)}))})).orThunk((function(){return c.bind((function(o){return a.map((function(o){return n?Qx(t,e,r,o):Qx(t,e,o,r),!0}))}))})).getOr(!1)}))},tC=function(t,e,n){if(t.selection.isCollapsed()&&us(t)){var r=hc.fromRangeStart(t.selection.getRng());return Zx(t,e,n,r)}return!1},eC=function(t){return 1===qe(t)},nC=function(t,e,n,r){var o=E(hp,e),i=W(X(r,o),(function(t){return t.dom}));if(0===i.length)th(e,t,n);else{var u=function(t,e){var n=cp(!1),r=dp(e,n.dom);return Ze(ye.fromDom(t),n),un(ye.fromDom(t)),hc(r,0)}(n.dom,i);e.selection.setRng(u.toRange())}},rC=function(t,e){var n=ye.fromDom(t.getBody()),r=ye.fromDom(t.selection.getStart()),o=X(function(t,e){var n=fg(e,t);return Z(n,Zr).fold(O(n),(function(t){return n.slice(0,t)}))}(n,r),eC);return at(o).exists((function(n){var r,i=hc.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Hn(xl(n),Cl(n),(function(r,o){var i=Ly(!0,r),u=Ly(!1,o),a=Ly(!1,e);return t?yl(n,a).exists((function(t){return t.isEqual(u)&&e.isEqual(i)})):wl(n,a).exists((function(t){return t.isEqual(i)&&e.isEqual(u)}))})).getOr(!0)}(e,i,n.dom)||(r=n,Sl(r.dom)&&up(r.dom)))&&(nC(e,t,n,o),!0)}))},oC=function(t,e){return!!t.selection.isCollapsed()&&rC(t,e)},iC=function(t,e,n){return t._selectionOverrides.hideFakeCaret(),th(t,e,ye.fromDom(n)),!0},uC=function(t,e){return t.selection.isCollapsed()?function(t,e){var n=e?tg:eg,r=e?pc.Forwards:pc.Backwards,o=Ks(r,t.getBody(),t.selection.getRng());return n(o)?iC(t,e,o.getNode(!e)):I.from(Ly(e,o)).filter((function(t){return n(t)&&Qs(o,t)})).exists((function(n){return iC(t,e,n.getNode(!e))}))}(t,e):function(t,e){var n=t.selection.getNode();return!!In(n)&&iC(t,e,n)}(t,e)},aC=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},cC=function(t,e){return(t||"table"===_e(e)?"margin":"padding")+("rtl"===Xn(e,"direction")?"-right":"-left")},sC=function(t){var e=fC(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return et(e,(function(e){var n=cC(ts(t),e),r=Yn(e,n).map(aC).getOr(0);return"false"!==t.dom.getContentEditable(e.dom)&&r>0}))}(t,e))},lC=function(t){return ro(t)||oo(t)},fC=function(t){return X((e=t.selection.getSelectedBlocks(),W(e,ye.fromDom)),(function(t){return!lC(t)&&!function(t){return Pe(t).exists(lC)}(t)&&Lr(t,(function(t){return zn(t.dom)||Bn(t.dom)})).exists((function(t){return zn(t.dom)}))}));var e},dC=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=ts(t),s=jc(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),q(fC(t),(function(t){!function(t,e,n,r,o,i){var u=cC(n,ye.fromDom(i));if("outdent"===e){var a=Math.max(0,aC(i.style[u])-r);t.setStyle(i,u,a?a+o:"")}else{a=aC(i.style[u])+r+o;t.setStyle(i,u,a)}}(n,e,c,a,u,t.dom)}))},mC=function(t,e){if(t.selection.isCollapsed()&&sC(t)){var n=t.dom,r=t.selection.getRng(),o=hc.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&pg(ye.fromDom(i),o))return dC(t,"outdent"),!0}return!1},gC=function(t,e){t.getDoc().execCommand(e,!1,null)},hC=function(t,e){t.addCommand("delete",(function(){!function(t,e){mC(t)||Ow(t,!1)||pw(t,!1)||tC(t,e,!1)||nw(t,!1)||Dh(t)||_w(t,!1)||uC(t,!1)||uw(t)||oC(t,!1)||(gC(t,"Delete"),Uy(t))}(t,e)})),t.addCommand("forwardDelete",(function(){!function(t,e){Ow(t,!0)||pw(t,!0)||tC(t,e,!0)||nw(t,!0)||Dh(t)||_w(t,!0)||uC(t,!0)||uw(t)||oC(t,!0)||gC(t,"ForwardDelete")}(t,e)}))},pC=function(t){return void 0===t.touches||1!==t.touches.length?I.none():I.some(t.touches[0])},vC=function(t){var e=ma(),n=aa(!1),r=ha((function(e){t.fire("longpress",Dt(Dt({},e),{type:"longpress"})),n.set(!0)}),400);t.on("touchstart",(function(t){pC(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(),pC(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",Dt(Dt({},o),{type:"tap"}))}))}),!0)},bC=function(t,e){return wt(t,e.nodeName)},yC=function(t,e){return!!En(e)||!!wn(e)&&(!bC(t,e)&&!Bl(e))},wC=function(t,e){if(En(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||bC(t,e.nextSibling)))return!0}return!1},xC=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=jc(t);if(c&&wn(c)&&l){var f=s.nodeName.toLowerCase();if(u.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return U(lg(ye.fromDom(n),ye.fromDom(e)),(function(e){return bC(t,e.dom)}))}(a,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,h=d.endContainer,p=d.endOffset,v=im(t);for(c=s.firstChild;c;)if(yC(a,c)){if(wC(a,c)){n=c,c=c.nextSibling,o.remove(n);continue}e||(e=o.create(l,Uc(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())}}},CC=function(t,e){e.hasAttribute("data-mce-caret")&&(So(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},SC=function(t,e){var n=function(t){return Vr(ye.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 CC(t,n)):void(vo(n)&&(CC(t,n),t.undoManager.add()))},kC=Bn,OC=function(t,e,n){var r=ll(t.getBody()),o=E(Js,1===e?r.next:r.prev);if(n.collapsed&&function(t){return""!==jc(t)}(t)){var i=t.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(hc.fromRangeStart(n))){var u=function(t){var e=t.dom.create(jc(t));return(!de.ie||de.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()}}},_C=function(t,e){var n=e?pc.Forwards:pc.Backwards,r=t.selection.getRng();return function(t,e,n){return Ix(e,t,n,og,ig,kC)}(n,t,r).orThunk((function(){return OC(t,n,r),I.none()}))},TC=function(t,e){var n=e?1:-1,r=t.selection.getRng();return function(t,e,n){return Lx(e,t,n,(function(t){return og(t)||ng(t)}),(function(t){return ig(t)||rg(t)}),kC)}(n,t,r).orThunk((function(){return OC(t,n,r),I.none()}))},EC=function(t,e){return _C(t,e).exists((function(e){return Bx(t,e),!0}))},AC=function(t,e){return TC(t,e).exists((function(e){return Bx(t,e),!0}))},DC=function(t,e){return Fx(t,e,e?ig:og)},MC=function(t){return j(["figcaption"],_e(t))},RC=function(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e},NC=function(t,e,n){n?nn(t,e):en(t,e)},zC=function(t,e,n,r){return""===e?function(t,e){var n=ye.fromTag("br");return NC(t,n,e),RC(n)}(t,r):function(t,e,n,r){var o=ye.fromTag(n),i=ye.fromTag("br");return Un(o,r),nn(o,i),NC(t,o,e),RC(i)}(t,r,e,n)},BC=function(t,e,n){return e?function(t,e){return gx(t,e).breakAt.isNone()}(t.dom,n):function(t,e){return mx(t,e).breakAt.isNone()}(t.dom,n)},PC=function(t,e){var n=ye.fromDom(t.getBody()),r=hc.fromRangeStart(t.selection.getRng()),o=jc(t),i=Uc(t);return function(t,e){var n=E(Se,e);return Lr(ye.fromDom(t.container()),Zr,n).filter(MC)}(r,n).exists((function(){if(BC(n,e,r)){var u=zC(n,o,i,e);return t.selection.setRng(u),!0}return!1}))},IC=function(t,e){return!!t.selection.isCollapsed()&&PC(t,e)},LC=function(t,e){return tt(function(t){return W(t,(function(t){return Dt({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]:[]}))},HC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},FC=function(t,e){return Q(LC(t,e),(function(t){return t.action()}))},VC=function(t,e){var n=e?pc.Forwards:pc.Backwards,r=t.selection.getRng();return Ix(t,n,r,tg,eg,In).exists((function(e){return Bx(t,e),!0}))},jC=function(t,e){var n=e?1:-1,r=t.selection.getRng();return Lx(t,n,r,tg,eg,In).exists((function(e){return Bx(t,e),!0}))},UC=function(t,e){return Fx(t,e,e?eg:tg)},WC=function(t,e,n,r,o){var i=ka(ye.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 I.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 I.some(i<o?r:t)}))}),I.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}}(Va(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}))},qC=E(WC,(function(t){return t.bottom}),(function(t,e){return t.y<e})),GC=E(WC,(function(t){return t.top}),(function(t,e){return t.y>e})),$C=function(t,e){return ut(e.getClientRects()).bind((function(e){return qC(t,e.left,e.top)})).bind((function(t){return dx(Cl(n=t).map((function(t){return mx(n,t).positions.concat(t)})).getOr([]),e);var n}))},XC=function(t,e){return at(e.getClientRects()).bind((function(e){return GC(t,e.left,e.top)})).bind((function(t){return dx(xl(n=t).map((function(t){return[t].concat(gx(n,t).positions)})).getOr([]),e);var n}))},KC=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===nx.Wrap&&0===t.positions.length}(r)||!Rn(n.getNode())&&function(t){return t.breakType===nx.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()},YC=E(KC,mx),JC=E(KC,gx),QC=function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;return!(!Os()||!function(t,e,n){var r=hc.fromRangeStart(e);return bl(!t,n).exists((function(t){return t.isEqual(r)}))}(e,o,n))&&(sw(i,t,n,!e,!1).each((function(e){Bx(t,e)})),!0)},ZC=function(t,e){var n=e.getNode(t);return wn(n)&&"TABLE"===n.nodeName?I.some(n):I.none()},tS=function(t,e,n){var r=ZC(!!e,n),o=!1===e;r.fold((function(){return Bx(t,n.toRange())}),(function(r){return bl(o,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return Bx(t,n.toRange())}),(function(o){return function(t,e,n,r){var o=jc(e);o?e.undoManager.transact((function(){var r=ye.fromTag(o);Un(r,Uc(e)),nn(r,ye.fromTag("br")),t?tn(ye.fromDom(n),r):Ze(ye.fromDom(n),r);var i=e.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),Bx(e,i)})):Bx(e,r.toRange())}(e,t,r,n)}))}))},eS=function(t,e,n,r){var o=t.selection.getRng(),i=hc.fromRangeStart(o),u=t.getBody();if(!e&&YC(r,i)){var a=function(t,e,n){return $C(e,n).orThunk((function(){return ut(n.getClientRects()).bind((function(n){return fx(hx(t,hc.before(e)),n.left)}))})).getOr(hc.before(e))}(u,n,i);return tS(t,e,a),!0}if(e&&JC(r,i)){a=function(t,e,n){return XC(e,n).orThunk((function(){return ut(n.getClientRects()).bind((function(n){return fx(px(t,hc.after(e)),n.left)}))})).getOr(hc.after(e))}(u,n,i);return tS(t,e,a),!0}return!1},nS=function(t,e,n){return I.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return I.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)},rS=function(t,e){return nS(t,e,QC)},oS=function(t,e){return nS(t,e,eS)},iS=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=re().os;FC([{keyCode:Wf.RIGHT,action:HC(EC,t,!0)},{keyCode:Wf.LEFT,action:HC(EC,t,!1)},{keyCode:Wf.UP,action:HC(AC,t,!1)},{keyCode:Wf.DOWN,action:HC(AC,t,!0)},{keyCode:Wf.RIGHT,action:HC(rS,t,!0)},{keyCode:Wf.LEFT,action:HC(rS,t,!1)},{keyCode:Wf.UP,action:HC(oS,t,!1)},{keyCode:Wf.DOWN,action:HC(oS,t,!0)},{keyCode:Wf.RIGHT,action:HC(VC,t,!0)},{keyCode:Wf.LEFT,action:HC(VC,t,!1)},{keyCode:Wf.UP,action:HC(jC,t,!1)},{keyCode:Wf.DOWN,action:HC(jC,t,!0)},{keyCode:Wf.RIGHT,action:HC(qx,t,e,!0)},{keyCode:Wf.LEFT,action:HC(qx,t,e,!1)},{keyCode:Wf.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:HC(Xx,t,e)},{keyCode:Wf.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:HC(Kx,t,e)},{keyCode:Wf.UP,action:HC(IC,t,!1)},{keyCode:Wf.DOWN,action:HC(IC,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},uS=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){FC([{keyCode:Wf.BACKSPACE,action:HC(mC,t,!1)},{keyCode:Wf.BACKSPACE,action:HC(Ow,t,!1)},{keyCode:Wf.DELETE,action:HC(Ow,t,!0)},{keyCode:Wf.BACKSPACE,action:HC(pw,t,!1)},{keyCode:Wf.DELETE,action:HC(pw,t,!0)},{keyCode:Wf.BACKSPACE,action:HC(tC,t,e,!1)},{keyCode:Wf.DELETE,action:HC(tC,t,e,!0)},{keyCode:Wf.BACKSPACE,action:HC(Dh,t,!1)},{keyCode:Wf.DELETE,action:HC(Dh,t,!0)},{keyCode:Wf.BACKSPACE,action:HC(_w,t,!1)},{keyCode:Wf.DELETE,action:HC(_w,t,!0)},{keyCode:Wf.BACKSPACE,action:HC(uC,t,!1)},{keyCode:Wf.DELETE,action:HC(uC,t,!0)},{keyCode:Wf.BACKSPACE,action:HC(uw,t,!1)},{keyCode:Wf.DELETE,action:HC(uw,t,!0)},{keyCode:Wf.BACKSPACE,action:HC(nw,t,!1)},{keyCode:Wf.DELETE,action:HC(nw,t,!0)},{keyCode:Wf.BACKSPACE,action:HC(oC,t,!1)},{keyCode:Wf.DELETE,action:HC(oC,t,!0)}],n).each((function(t){n.preventDefault()}))}(t,e,n)})),t.on("keyup",(function(e){!1===e.isDefaultPrevented()&&function(t,e){FC([{keyCode:Wf.BACKSPACE,action:HC(kw,t)},{keyCode:Wf.DELETE,action:HC(kw,t)}],e)}(t,e)}))},aS=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 Yr(e,e);n=c.current();){if(En(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 Rn(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),Ad(t,a)}},cS=function(t){return I.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},sS=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},lS=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},fS=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},dS=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!wn(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},mS=function(t,e,n,r,o){var i=t.dom,u=t.selection.getRng();if(n!==t.getBody()){var a;lS(a=n)&&lS(a.parentNode)&&(o="LI");var c=o?e(o):i.create("BR");if(dS(n,r,!0)&&dS(n,r,!1))if(sS(n,"LI")){var s=fS(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(dS(n,r,!0))sS(n,"LI")?(i.insertAfter(c,fS(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n),i.remove(r);else if(dS(n,r,!1))i.insertAfter(c,fS(n)),i.remove(r);else{n=fS(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)}aS(t,c)}},gS=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},hS=function(t){t.innerHTML='<br data-mce-bogus="1">'},pS=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},vS=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)},bS=function(t,e,n){return!1===En(e)?n:t?1===n&&e.data.charAt(n-1)===co?0:n:n===e.data.length-1&&e.data.charAt(n)===co?e.data.length:n},yS=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},wS=function(t,e){var n=jc(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;I.from(n.style).map(r.parseStyle).each((function(t){var n=Jn(ye.fromDom(e)),o=Dt(Dt({},n),t);r.setStyles(e,o)}));var o=I.from(n.class).map((function(t){return t.split(/\s+/)})),i=I.from(e.className).map((function(t){return X(t.split(/\s+/),(function(t){return""!==t}))}));Hn(o,i,(function(t,n){var o=X(n,(function(e){return!j(t,e)})),i=Mt(Mt([],t,!0),o,!0);r.setAttrib(e,"class",i.join(" "))}));var u=["style","class"],a=vt(n,(function(t,e){return!j(u,e)}));r.setAttribs(e,a)}(t,e,Uc(t))},xS=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(Sl(a)||Bl(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 wS(t,n),hS(u),n},v=function(t){var e,n,u=bS(t,r,o);if(En(r)&&(t?u>0:u<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&wn(r)&&r===i.firstChild)return!0;if(pS(r,"TABLE")||pS(r,"HR"))return f&&!t||!f&&t;var a=new Yr(r,i);for(En(r)&&(t&&0===u?a.prev():t||u!==r.nodeValue.length||a.next());e=a.current();){if(wn(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),g[n]&&"br"!==n))return!1}else if(En(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)&&vS(d,c)&&d.isEmpty(i)?u=d.split(c,i):d.insertAfter(u,i),aS(t,u)};od(d,h).each((function(t){h.setStart(t.startContainer,t.startOffset),h.setEnd(t.endContainer,t.endOffset)})),r=h.startContainer,o=h.startOffset,l=jc(t);var y=!(!e||!e.shiftKey),w=!(!e||!e.ctrlKey);wn(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&En(r)?r.nodeValue.length:0);var x=yS(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=yS(d,r);if(!(u=d.getParent(r,d.isBlock))||!vS(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),wS(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),wS(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)?mS(t,p,c,i,l):l&&i===t.getBody()||(l=l||"P",go(i)?(u=So(i),d.isEmpty(i)&&hS(i),wS(t,u),aS(t,u)):v()?b():v(!0)?(u=i.parentNode.insertBefore(p(),i),aS(t,pS(i,"HR")?u:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,bS(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,bS(!1,t.endContainer,t.endOffset)),e}(h).cloneRange()).setEndAfter(i),function(t){q(Sa(ye.fromDom(t),De),(function(t){var e=t.dom;e.nodeValue=lo(e.nodeValue)}))}(a=n.extractContents()),function(t){do{En(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;wn(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):gS(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)&&hS(i),u.normalize(),d.isEmpty(u)?(d.remove(u),b()):(wS(t,u),aS(t,u))),d.setAttrib(u,"id",""),t.fire("NewBlock",{newBlock:u}))}},CS=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),Ad(t,r)},SS=function(t,e){var n,r,o=t.selection,i=t.dom,u=o.getRng();od(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 Yr(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"),bc(i,u,n),CS(t,n,r),t.undoManager.add()},kS=function(t,e){var n=ye.fromTag("br");Ze(ye.fromDom(e),n),t.undoManager.add()},OS=function(t,e){_S(t.getBody(),e)||tn(ye.fromDom(e),ye.fromTag("br"));var n=ye.fromTag("br");tn(ye.fromDom(e),n),CS(t,n.dom,!1),t.undoManager.add()},_S=function(t,e){return n=hc.after(e),!!Rn(n.getNode())||yl(t,hc.after(e)).map((function(t){return Rn(t.getNode())})).getOr(!1);var n},TS=function(t){return t&&"A"===t.nodeName&&"href"in t},ES=function(t){return t.fold(R,TS,TS,R)},AS=function(t,e){e.fold(C,E(kS,t),E(OS,t),C)},DS=function(t,e){var n=function(t){var e=E(By,t),n=hc.fromRangeStart(t.selection.getRng());return $w(e,t.getBody(),n).filter(ES)}(t);n.isSome()?n.each(E(AS,t)):SS(t,e)},MS=function(t,e){return cS(t).filter((function(t){return e.length>0&&xe(ye.fromDom(t),e)})).isSome()},RS=gr([{br:[]},{block:[]},{none:[]}]),NS=function(t,e){return function(t){return MS(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},zS=function(t){return function(e,n){return""===jc(e)===t}},BS=function(t){return function(e,n){return function(t){return cS(t).filter((function(t){return oo(ye.fromDom(t))})).isSome()}(e)===t}},PS=function(t,e){return function(n,r){return function(t){return cS(t).fold(O(""),(function(t){return t.nodeName.toUpperCase()}))}(n)===t.toUpperCase()===e}},IS=function(t){return PS("pre",t)},LS=function(t){return function(e,n){return function(t){return t.getParam("br_in_pre",!0)}(e)===t}},HS=function(t,e){return function(t){return MS(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},FS=function(t,e){return e},VS=function(t){var e=jc(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")},jS=function(t,e){return function(n,r){return Y(t,(function(t,e){return t&&e(n,r)}),!0)?I.some(e):I.none()}},US=function(t,e){(function(t,e){return Iw([jS([NS],RS.none()),jS([PS("summary",!0)],RS.br()),jS([IS(!0),LS(!1),FS],RS.br()),jS([IS(!0),LS(!1)],RS.block()),jS([IS(!0),LS(!0),FS],RS.block()),jS([IS(!0),LS(!0)],RS.br()),jS([BS(!0),FS],RS.br()),jS([BS(!0)],RS.block()),jS([zS(!0),FS,VS],RS.block()),jS([zS(!0)],RS.br()),jS([HS],RS.br()),jS([zS(!1),FS],RS.br()),jS([VS],RS.block())],[t,!(!e||!e.shiftKey)]).getOr(RS.none())})(t,e).fold((function(){DS(t,e)}),(function(){xS(t,e)}),C)},WS=function(t){t.on("keydown",(function(e){e.keyCode===Wf.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"),US(t,e)})))}(t,e)}))},qS=function(t,e){t.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(t,e,n){FC([{keyCode:Wf.END,action:HC(DC,t,!0)},{keyCode:Wf.HOME,action:HC(DC,t,!1)},{keyCode:Wf.END,action:HC(UC,t,!0)},{keyCode:Wf.HOME,action:HC(UC,t,!1)},{keyCode:Wf.END,action:HC(Yx,t,!0,e)},{keyCode:Wf.HOME,action:HC(Yx,t,!1,e)}],n).each((function(t){n.preventDefault()}))}(t,e,n)}))},GS=re().browser,$S=function(t){!function(t){var e=ga((function(){t.composing||Hg(t)}),0);GS.isIE()&&(t.on("keypress",(function(t){e.throttle()})),t.on("remove",(function(t){e.cancel()})))}(t),t.on("input",(function(e){!1===e.isComposing&&Hg(t)}))},XS=re(),KS=function(t){return t.stopImmediatePropagation()},YS=function(t){return t.keyCode===Wf.PAGE_UP||t.keyCode===Wf.PAGE_DOWN},JS=function(t,e,n){n&&!t.get()?e.on("NodeChange",KS,!0):!n&&t.get()&&e.off("NodeChange",KS),t.set(n)},QS=function(t,e){if(!XS.os.isOSX()){var n=aa(!1);t.on("keydown",(function(e){YS(e)&&JS(n,t,!0)})),t.on("keyup",(function(r){!1===r.isDefaultPrevented()&&function(t,e,n){FC([{keyCode:Wf.PAGE_UP,action:HC(Yx,t,!1,e)},{keyCode:Wf.PAGE_DOWN,action:HC(Yx,t,!0,e)}],n)}(t,e,r),YS(r)&&n.get()&&(JS(n,t,!1),t.nodeChanged())}))}},ZS=function(t,e){var n=e.container(),r=e.offset();return En(n)?(n.insertData(r,t),I.some(hc(n,r+t.length))):Ys(e).map((function(n){var r=ye.fromText(t);return e.isAtEnd()?tn(n,r):Ze(n,r),hc(r.dom,t.length)}))},tk=E(ZS," "),ek=E(ZS," "),nk=function(t,e){return function(n){return function(t,e){return!Dg(e)&&(Mg(t,e)||Eg(t,e)||Ag(t,e))}(t,n)?tk(e):ek(e)}},rk=function(t){var e=hc.fromRangeStart(t.selection.getRng()),n=ye.fromDom(t.getBody());if(t.selection.isCollapsed()){var r=E(By,t),o=hc.fromRangeStart(t.selection.getRng());return $w(r,t.getBody(),o).bind(function(t){return function(e){return e.fold((function(e){return wl(t.dom,hc.before(e))}),(function(t){return xl(t)}),(function(t){return Cl(t)}),(function(e){return yl(t.dom,hc.after(e))}))}}(n)).bind(nk(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},ok=function(t){t.on("keydown",(function(e){!1===e.isDefaultPrevented()&&function(t,e){FC([{keyCode:Wf.SPACEBAR,action:HC(rk,t)}],e).each((function(t){e.preventDefault()}))}(t,e)}))},ik=function(t){var e=$x(t);return function(t){t.on("keyup compositionstart",E(SC,t))}(t),iS(t,e),uS(t,e),WS(t),ok(t),$S(t),qS(t,e),QS(t,e),e},uk=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&&Kf(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||!de.range&&t.selection.isCollapsed()||Ef(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&Ef(t)&&("IMG"===t.selection.getNode().nodeName?$r.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}(),ak=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)},ck=function(t){return wn(t)&&no(ye.fromDom(t))},sk=function(t){t.on("click",(function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=hc.fromRangeStart(e),r=hc.fromRangeEnd(e);if(hc.isElementPosition(n)){var o=n.container();ck(o)&&xl(o).each((function(t){return e.setStart(t.container(),t.offset())}))}if(hc.isElementPosition(r)){o=n.container();ck(o)&&Cl(o).each((function(t){return e.setEnd(t.container(),t.offset())}))}t.selection.setRng(Rh(e))}(t)}))},lk=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}},fk=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?lk(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=lk(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))},dk=Bn,mk=zn,gk=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},hk=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},pk=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}}(dk,mk)).getOr(null);if(a=e.getBody(),dk(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:gk(e,r,r.offsetWidth,r.offsetHeight)})}}var a,c}},vk=function(t,e){return function(n){t.on((function(t){if(t.dragging){if(function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!dk(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(){hk(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))}e.fire("dragend")}var o,i,u,a})),bk(t)}},bk=function(t){t.on((function(t){hk(t.ghost)})),t.clear()},yk=function(t){var e=ma(),n=na.DOM,r=document,o=pk(e,t),i=function(t,e){var n=$r.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,fk(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=vk(e,t),a=function(t,e){return function(){t.on((function(t){t.dragging&&e.fire("dragend")})),bk(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)})),t.on("keydown",(function(t){t.keyCode===Wf.ESC&&a()}))},wk=function(t){yk(t),function(t){t.on("drop",(function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(dk(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&&uy(t,"Dropped file type is not supported"))}},n=function(n){Qd(t,n.target)&&e(n)},r=function(){var r=na.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(){$r.setEditorTimeout(t,r,0)}))}(t)},xk=zn,Ck=Bn,Sk=function(t,e){return Hf(t.getBody(),e)},kk=function(t){var e,n=t.selection,r=t.dom,o=r.isBlock,i=t.getBody(),u=ks(t,i,o,(function(){return im(t)})),a="sel-"+r.uniqueId(),c=function(t){return t!==i&&(Ck(t)||In(t))&&r.isChildOf(t,i)},s=function(t){return og(t)||ig(t)||tg(t)||eg(t)},l=function(t){t&&n.setRng(t)},f=n.getRng,d=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))},m=function(t){return po(t)||xo(t)||Co(t)},g=function(t){return m(t.startContainer)||m(t.endContainer)},h=function(e){var n=t.schema.getShortEndedElements(),o=r.createRng(),i=e.startContainer,u=e.startOffset,a=e.endContainer,c=e.endOffset;return wt(n,i.nodeName.toLowerCase())?0===u?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,u),wt(n,a.nodeName.toLowerCase())?0===c?o.setEndBefore(a):o.setEndAfter(a):o.setEnd(a,c),o},p=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=Vr(ye.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&&de.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=ye.fromDom(o);return q(ka(ye.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Se(s,t)||Gn(t,"data-mce-selected")})),r.getAttrib(o,"data-mce-selected")||o.setAttribute("data-mce-selected","1"),e=o,w(),c},v=function(t,e){if(!t)return null;if(t.collapsed){if(!g(t)){var n=e?1:-1,o=Ks(n,i,t),u=o.getNode(!e);if(Ts(u))return d(n,u,!!e&&!o.isAtEnd(),!1);var a=o.getNode(e);if(Ts(a))return d(n,a,!e&&!o.isAtEnd(),!1)}return null}var s=t.startContainer,l=t.startOffset,f=t.endOffset;if(3===s.nodeType&&0===l&&Ck(s.parentNode)&&(s=s.parentNode,l=r.nodeIndex(s),s=s.parentNode),1!==s.nodeType)return null;if(f===l+1&&s===t.endContainer){var m=s.childNodes[l];if(c(m))return p(m)}return null},y=function(){e&&e.removeAttribute("data-mce-selected"),Vr(ye.fromDom(t.getBody()),"#"+a).each(un),e=null},w=function(){u.hide()};return de.ceFalse&&!Nv(t)&&function(){t.on("mouseup",(function(e){var n=f();n.collapsed&&Zb(t,e.clientX,e.clientY)&&fw(t,n,!1).each(l)})),t.on("click",(function(e){var o=Sk(t,e.target);o&&(Ck(o)&&(e.preventDefault(),t.focus()),xk(o)&&r.isChildOf(o,n.getNode())&&y())})),t.on("blur NewBlock",y),t.on("ResizeWindow FullscreenStateChanged",u.reposition);var m=function(e,n){var i,u,a=r.getParent(e,o),c=r.getParent(n,o);return!b(a)&&(!(e===c||!r.isChildOf(a,c)||!1!==Ck(Sk(t,a)))||!r.isChildOf(c,a)&&(i=a,u=c,!(r.getParent(i,o)===r.getParent(u,o)))&&function(t){var e=t.firstChild;if(b(e))return!1;var n=hc.before(e);if(Rn(n.getNode())&&1===t.childNodes.length)return!s(n);var r=ll(t).next(n);return r&&!s(r)}(a))};t.on("tap",(function(e){var n=e.target,r=Sk(t,n);Ck(r)?(e.preventDefault(),lw(t,r).each(v)):c(n)&&lw(t,n).each(v)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==Zb(t,e.clientX,e.clientY)){var u=Sk(t,o);if(u)Ck(u)?(e.preventDefault(),lw(t,u).each(v)):(y(),xk(u)&&e.shiftKey||Ff(e.clientX,e.clientY,n.getRng())||(w(),n.placeCaretAt(e.clientX,e.clientY)));else if(c(o))lw(t,o).each(v);else if(!1===Ts(o)){y(),w();var a=zx(i,e.clientX,e.clientY);if(a&&!m(o,a.node)){e.preventDefault();var s=d(1,a.node,a.before,!1);l(s),t.getBody().focus()}}}})),t.on("keypress",(function(t){Wf.modifierPressed(t)||Ck(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=h(t.range);var e=v(t.range,t.forward);e&&(t.range=e)}));t.on("AfterSetSelectionRange",(function(t){var e=t.range,n=e.startContainer.parentNode;g(e)||"mcepastebin"===n.id||w(),function(t){return r.hasClass(t,"mce-offscreen-selection")}(n)||y()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!de.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))}})),wk(t),function(t){var e=ga((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=dw(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=Hf(t.getBody(),n),o=Bn(r)?r:n;t.selection.getNode()!==o&&lw(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:d,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(So(t),l(f()),n.scrollIntoView(t))},hideFakeCaret:w,destroy:function(){u.destroy(),e=null}}},Ok=function(t){var e,n,r=ve.each,o=Wf.BACKSPACE,i=Wf.DELETE,u=t.dom,a=t.selection,c=t.parser,s=de.gecko,l=de.ie,f=de.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(po(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(),$r.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),ns(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()}))},_=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(de.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},T=function(){de.mac&&t.on("keydown",(function(e){!Wf.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=Xf(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 Nv(t)?(f&&(v(),y(),A(),p(),de.iOS&&(O(),_(),E())),s&&(b(),x(),k(),T())):(t.on("keydown",(function(e){var n,r;if(!g(e)&&e.keyCode===Wf.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(),de.windowsPhone||t.on("keyup focusin mouseup",(function(t){Wf.modifierPressed(t)||a.normalize()}),!0),f&&(v(),y(),jc(t)&&t.on("init",(function(){m("DefaultParagraphSeparator",jc(t))})),A(),w(),c.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),de.iOS?(O(),_(),E()):p()),de.ie>=11&&(_(),w()),de.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(),$r.setEditorTimeout(t,(function(){o()})))})),x(),S(),k(),T(),w())),{refreshContentEditable:M,isHidden:function(){if(!s||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},_k=na.DOM,Tk=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Ek=function(t){return vt(t,(function(t){return!1===v(t)}))},Ak=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Ek({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:Tk(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},Dk=function(t){var e=t.dom.getRoot();t.inline||Ef(t)&&t.selection.getStart(!0)!==e||xl(e).each((function(e){var n=e.getNode(),r=On(n)?xl(n).getOr(e):e;de.browser.isIE()?function(t,e){var n=ye.fromDom(t.getBody()),r=(jd(t)?I.from(e):I.none()).map(Ud).filter(Vd(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},Mk=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),Dk(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&$r.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},Rk=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},Nk=function(t){var e=Rk(t),n=es(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="";ve.each(t.contentStyles,(function(t){u+=t+"\r\n"})),t.dom.addStyle(u)}var a=Ur.all(function(t,e,n){var r=[new Ur((function(n,r){return Rk(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new Ur((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=ye.fromDom(t.getBody()),r=Ye(Ke(n)),o=ye.fromTag("style");jn(o,"type","text/css"),nn(o,ye.fromText(e)),nn(r,o),t.on("remove",(function(){un(o)}))}(t,t.settings.content_style),a},zk=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,_k.setAttrib(r,"spellcheck","false")),t.quirks=Ok(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",fa.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){ve.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}))},Bk=function(t){!0!==t.removed&&(!function(t){Nv(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),Mk(t))},Pk=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&&(_k.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"===_k.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=wy(t),t.schema=vi(n),t.dom=na(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:Jc(t),referrerPolicy:Qc(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=lb(Ak(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 bm("br",1)).shortEnded=!0)}})),e}(t),t.serializer=hb(function(t){var e=t.settings;return Dt(Dt({},Ak(t)),Ek({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=Gv(t.dom,t.getWin(),t.serializer,t),t.annotator=If(t),t.formatter=Ty(t),t.undoManager=Ay(t),t._nodeChangeDispatcher=new uk(t),t._selectionOverrides=kk(t),vC(t),ak(t),Nv(t)||sk(t);var u=function(t){return Nv(t)?aa(null):ik(t)}(t);hC(t,u),function(t){jc(t)&&t.on("NodeChange",E(xC,t))}(t),Ny(t);var a=zv(t);zk(t),a.fold((function(){Nk(t).then((function(){return Bk(t)}))}),(function(e){t.setProgressState(!0),Nk(t).then((function(){e().then((function(e){t.setProgressState(!1),Bk(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),Bk(t)}))}))}))},Ik=na.DOM,Lk=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 Fc(t,"body_id","tinymce")}(t),r=function(t){return Fc(t,"body_class","")}(t);return Vc(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+Vc(t)+'" />'),e+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>'},Hk=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=ye.fromTag("iframe"),Un(i,o),Un(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),wa(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&&de.browser.isIE()){var n=py("mce");t[n]=function(){Pk(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 Ik.setAttrib(e,"src",r),!0}return!1}(t,a);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=a,t.iframeHTML=Lk(t),Ik.add(e.iframeContainer,a),c},Fk=na.DOM,Vk=function(t,e,n){var r=ny.get(n),o=ny.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=ve.trim(n),r&&-1===ve.inArray(e,n)){if(ve.each(ny.dependencies(n),(function(n){Vk(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=fa.translate(["Failed to initialize plugin: {0}",e]);Vf(t,"PluginLoadError",{message:r}),ly(r,n),uy(t,r)}(t,n,e)}}},jk=function(t){return t.replace(/^\-/,"")},Uk=function(t){return{editorContainer:t,iframeContainer:t,api:{}}},Wk=function(t){var e=t.getElement();return t.inline?Uk(null):function(t){var e=Fk.create("div");return Fk.insertAfter(e,t),Uk(e)}(e)},qk=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,d(os(t))?function(t){return t.theme.renderUI()}(t):w(os(t))?function(t){var e=t.getElement(),n=os(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):Wk(t)},Gk=function(t){t.fire("ScriptsLoaded"),function(t){var e=ve.trim(Gc(t)),n=t.ui.registry.getAll().icons,r=Dt(Dt({},Gb.get("default").icons),Gb.get(e).icons);dt(r,(function(e,r){wt(n,r)||t.ui.registry.addIcon(r,e)}))}(t),function(t){var e=os(t);if(d(e)){t.settings.theme=jk(e);var n=ry.get(e);t.theme=new n(t,ry.urls[e]),t.theme.init&&t.theme.init(t,ry.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];ve.each(cs(t).split(/[ ,]/),(function(n){Vk(t,e,jk(n))}))}(t);var e=qk(t);!function(t,e){var n={show:I.from(e.show).getOr(C),hide:I.from(e.hide).getOr(C),disable:I.from(e.disable).getOr(C),isDisabled:I.from(e.isDisabled).getOr(R),enable:function(){t.mode.isReadOnly()||I.from(e.enable).map(M)}};t.ui=Dt(Dt({},t.ui),n)}(t,I.from(e.api).getOr({}));var n={editorContainer:e.editorContainer,iframeContainer:e.iframeContainer};return t.editorContainer=n.editorContainer?n.editorContainer:null,my(t),t.inline?Pk(t):function(t,e){var n=Hk(t,e);e.editorContainer&&(Ik.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=Ik.isHidden(e.editorContainer)),t.getElement().style.display="none",Ik.setAttrib(t.id,"aria-hidden","true"),n||Pk(t)}(t,n)},$k=na.DOM,Xk=function(t){return"-"===t.charAt(0)},Kk=function(t,e){var n=Zc(e),r=function(t){return t.getParam("language_url","","string")}(e);if(!1===fa.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){ay(t,"LanguageLoadError",cy("language",e,n))}(e,o,n)}))}},Yk=function(t,e,n){return I.from(e).filter((function(t){return t.length>0&&!Gb.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:I.some(e)}}))},Jk=function(t,e,n){var r=Yk(e,"default",n),o=function(t){return I.from(function(t){return t.getParam("icons_url","","string")}(t)).filter((function(t){return t.length>0})).map((function(t){return{url:t,name:I.none()}}))}(e).orThunk((function(){return Yk(e,Gc(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){ay(t,"IconsLoadError",cy("icons",e,n))}(e,n.url,n.name.getOrUndefined())}))}))},Qk=function(t,e){var n=ua.ScriptLoader;!function(t,e,n,r){var o=os(e);if(d(o)){if(!Xk(o)&&!wt(ry.urls,o)){var i=function(t){return t.getParam("theme_url")}(e);i?ry.load(o,e.documentBaseURI.toAbsolute(i)):ry.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue((function(){ry.waitFor(o,r)}))}else r()}(n,t,e,(function(){Kk(n,t),Jk(n,t,e),function(t,e){ve.each(function(t){return t.getParam("external_plugins")}(t),(function(e,n){ny.load(n,e,C,void 0,(function(){sy(t,e,n)})),t.settings.plugins+=" "+n})),ve.each(cs(t).split(/[ ,]/),(function(n){if((n=ve.trim(n))&&!ny.urls[n])if(Xk(n)){n=n.substr(1,n.length);var r=ny.dependencies(n);ve.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=ny.createUrl(r,n);ny.load(o.resource,o,C,void 0,(function(){sy(t,o.prefix+o.resource+o.suffix,o.resource)}))}))}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};ny.load(n,o,C,void 0,(function(){sy(t,o.prefix+o.resource+o.suffix,n)}))}}))}(t,e),n.loadQueue((function(){t.removed||Gk(t)}),t,(function(){t.removed||Gk(t)}))}))},Zk=function(t){var e=t.id;fa.setCode(Zc(t));var n=function(){$k.unbind(window,"ready",n),t.render()};if(Ei.Event.domLoaded){if(t.getElement()&&de.contentEditable){var r=ye.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 Gn(r,t.name)})),Un(r,o)})),t.ui.styleSheetLoader=function(t,e){return Kr.forElement(t,{contentCssCors:as(e),referrerPolicy:Qc(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||$k.getParent(e,"form");i&&(t.formElement=i,function(t){return t.getParam("hidden_input")}(t)&&!Tn(t.getElement())&&($k.insertAfter($k.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},$k.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=oy(t),t.notificationManager=ey(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",(function(t){t.save&&(t.content=$k.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),Qk(t,t.suffix)}}else $k.bind(window,"ready",n)},tO=function(t,e){return function(t,e){return Pv(t).editor.addVisual(e)}(t,e)},eO={"font-size":"size","font-family":"face"},nO=function(t,e,n){return Kh(ye.fromDom(n),(function(e){return function(e){return Yn(e,t).orThunk((function(){return"font"===_e(e)?yt(eO,t).bind((function(t){return qn(e,t)})):I.none()}))}(e)}),(function(t){return Se(ye.fromDom(e),t)}))},rO=function(t){return function(e,n){return I.from(n).map(ye.fromDom).filter(Ae).bind((function(n){return nO(t,e,n.dom).or(function(t,e){return I.from(na.DOM.getStyle(e,t,!0))}(t,n.dom))})).getOr("")}},oO=rO("font-size"),iO=S((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),rO("font-family")),uO=function(t){return xl(t.getBody()).map((function(t){var e=t.container();return En(e)?e.parentNode:e}))},aO=function(t,e){return function(t){return I.from(t.selection.getRng()).bind((function(e){var n=t.getBody();return e.startContainer===n&&0===e.startOffset?I.none():I.from(t.selection.getStart(!0))}))}(t).orThunk(E(uO,t)).map(ye.fromDom).filter(Ae).bind(e)},cO=function(t,e){return aO(t,k(I.some,e))},sO=function(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return ve.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return ve.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},lO=function(t){var e=t.split(/\s*,\s*/);return W(e,(function(t){return-1===t.indexOf(" ")||Lt(t,'"')||Lt(t,"'")?t:"'"+t+"'"})).join(",")},fO=function(t,e){var n=function(t){if("string"!=typeof t){var e=ve.extend({paste:t.paste,data:{paste:t.paste}},t);return{content:t.content,details:e}}return{content:t,details:{}}}(e);!function(t,e,n){Bv(t).editor.insertContent(e,n)}(t,n.content,n.details)},dO=ve.each,mO=ve.map,gO=ve.inArray,hO=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,$d(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(dO(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;dO(t,(function(t,r){dO(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){cm(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.");de.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"),dO("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=sO(t,e);t.formatter.toggle("fontname",{value:lO(n)}),t.nodeChanged()}(t,r)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:sO(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){fO(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){US(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){dC(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(),zn);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return DS(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=mO(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==gO(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 sC(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 cO(t,(function(e){return iO(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("FontSize",(function(){return function(t){return cO(t,(function(e){return oO(t.getBody(),e.dom)})).getOr("")}(t)}),this),e.addQueryValueHandler("LineHeight",(function(){return function(t){return cO(t,(function(e){var n=ye.fromDom(t.getBody());return Kh(e,(function(t){return Yn(t,"line-height")}),E(Se,n)).getOrThunk((function(){var t=parseFloat(Xn(e,"line-height")),n=parseFloat(Xn(e,"font-size"));return String(t/n)}))})).getOr("")}(t)}),this)},t}(),pO=function(t,e,n){Ca(t,e)&&!1===n?function(t,e){va(t)?t.dom.classList.remove(e):ya(t,e);xa(t)}(t,e):n&&wa(t,e)},vO=function(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}},bO=function(t,e){t.dom.contentEditable=e?"true":"false"},yO=function(t,e){var n=ye.fromDom(t.getBody());pO(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){I.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")}))}(t),t.readonly=!0,bO(n,!1),q(ka(n,'*[contenteditable="true"]'),(function(t){jn(t,"data-mce-contenteditable","true"),bO(t,!1)}))):(t.readonly=!1,bO(n,!0),function(t){q(ka(t,'*[data-mce-contenteditable="true"]'),(function(t){Gn(t,"data-mce-contenteditable"),bO(t,!0)}))}(n),vO(t,"StyleWithCSS",!1),vO(t,"enableInlineTableEditing",!1),vO(t,"enableObjectResizing",!1),um(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},wO=function(t){return t.readonly},xO=function(t){t.parser.addAttributeFilter("contenteditable",(function(e){wO(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){wO(t)&&q(e,(function(t){t.attr("contenteditable",t.attr("data-mce-contenteditable"))}))})),t.serializer.addTempAttr("data-mce-contenteditable")},CO=function(t,e){if(function(t){return"click"===t.type}(e)&&!Wf.metaKeyPressed(e)){var n=ye.fromDom(e.target);(function(t,e){return jr(e,"a",(function(e){return Se(e,ye.fromDom(t.getBody()))})).bind((function(t){return qn(t,"href")}))})(t,n).each((function(n){if(e.preventDefault(),/^#/.test(n)){var r=t.dom.select(n+',[name="'+(Lt(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}))}},SO=ve.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"," "),kO=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||R}return t.isNative=function(t){return!!SO[t.toLowerCase()]},t.prototype.fire=function(t,e){var n=t.toLowerCase(),r=Ci(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=R),e){var o={func:e,removed:!1};r&&ve.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?Mt([o],c,!0):Mt(Mt([],c,!0),[o],!1),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 dt(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 dt(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}(),OO=function(t){return t._eventDispatcher||(t._eventDispatcher=new kO({scope:t,toggleEvent:function(e,n){kO.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},_O={fire:function(t,e,n){if(this.removed&&"remove"!==t&&"detach"!==t)return e;var r=OO(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 OO(this).on(t,e,n)},off:function(t,e){return OO(this).off(t,e)},once:function(t,e){return OO(this).once(t,e)},hasEventListeners:function(t){return OO(this).has(t)}},TO=na.DOM,EO=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=rs(t);return n?(t.eventRoot||(t.eventRoot=TO.select(n)[0]),t.eventRoot):t.getBody()},AO=function(t,e,n){!function(t){return!t.hidden&&!wO(t)}(t)?wO(t)&&CO(t,n):t.fire(e,n)},DO=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=EO(t,e);if(rs(t)){if(yx||(yx={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||yx&&(dt(yx,(function(e,n){t.dom.unbind(EO(t,n))})),yx=null)}))),yx[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||TO.isChildOf(r,u))&&AO(o[i],e,n)}},yx[e]=n,TO.bind(r,e,n)}else n=function(n){AO(t,e,n)},TO.bind(r,e,n),t.delegates[e]=n}},MO=Dt(Dt({},_O),{bindPendingEventDelegates:function(){var t=this;ve.each(t._pendingNativeEvents,(function(e){DO(t,e)}))},toggleNativeEvent:function(t,e){"focus"!==t&&"blur"!==t&&(this.removed||(e?this.initialized?DO(this,t):this._pendingNativeEvents?this._pendingNativeEvents.push(t):this._pendingNativeEvents=[t]:this.initialized&&(this.dom.unbind(EO(this,t),t,this.delegates[t]),delete this.delegates[t])))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(dt(t.delegates,(function(e,n){t.dom.unbind(EO(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()))}}),RO=["design","readonly"],NO=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&&yO(t,i.editorReadOnly),e.set(r),function(t,e){t.fire("SwitchMode",{mode:e})}(t,r)},zO=function(t){var e=aa("design"),n=aa({design:{activate:C,deactivate:C,editorReadOnly:!1},readonly:{activate:C,deactivate:C,editorReadOnly:!0}});return function(t){t.serializer?xO(t):t.on("PreInit",(function(){xO(t)}))}(t),function(t){t.on("ShowCaret",(function(e){wO(t)&&e.preventDefault()})),t.on("ObjectSelected",(function(e){wO(t)&&e.preventDefault()}))}(t),{isReadOnly:function(){return wO(t)},set:function(r){return function(t,e,n,r){if(r!==n.get()){if(!wt(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?NO(t,n,e,r):t.on("init",(function(){return NO(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(RO,e))throw new Error("Cannot override default mode "+e);return Dt(Dt({},t),((r={})[e]=Dt(Dt({},n),{deactivate:function(){try{n.deactivate()}catch(t){console.error("problem while deactivating editor mode "+e+":",t)}}}),r))}(n.get(),t,e))}}},BO=ve.each,PO=ve.explode,IO={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},LO=ve.makeMap("alt,ctrl,shift,meta,access"),HO=function(t){var e,n={};BO(PO(t.toLowerCase(),"+"),(function(t){t in LO?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=IO[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in LO)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,de.mac?n.ctrl=!0:n.shift=!0),n.meta&&(de.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},FO=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()||(BO(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 BO(PO(ve.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)}:ve.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},t.prototype.createShortcut=function(t,e,n,r){var o=ve.map(PO(t,">"),HO);return o[o.length-1]=ve.extend(o[o.length-1],{func:n,scope:r||this.editor}),ve.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}(),VO=function(){var t=function(){var t={},e={},n={},r={},o={},i={},u={},a=function(t,e){return function(n,r){return t[n.toLowerCase()]=Dt(Dt({},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}},jO=na.DOM,UO=ve.extend,WO=ve.each,qO=ve.resolve,GO=de.ie,$O=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,UO(this,MO),this.settings=Ub(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&&(ua.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),na.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),da.languageLoad=this.settings.language_load,da.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new _m(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new FO(this),this.editorCommands=new hO(this),this.settings.cache_suffix&&(de.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:VO(),styleSheetLoader:void 0,show:C,hide:C,enable:C,disable:C,isDisabled:R};var o=zO(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Ku.overrideDefaults((function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}))}return t.prototype.render=function(){Zk(this)},t.prototype.focus=function(t){this.execCommand("mceFocus",!1,t)},t.prototype.hasFocus=function(){return im(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+$/,""))?qO(r):0,i=qO(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return fa.translate(t)},t.prototype.getParam=function(t,e,n){return qb(this,t,e,n)},t.prototype.hasPlugin=function(t,e){return!!j(cs(this).split(/[ ,]/),t)&&(!e||void 0!==ny.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":(jO.show(this.getContainer()),jO.hide(this.id)),this.load(),this.fire("show"))},t.prototype.hide=function(){var t=this.getDoc();this.hidden||(GO&&t&&!this.inline&&t.execCommand("SelectAll"),this.save(),this.inline?(this.getBody().contentEditable="false",this===this.editorManager.focusedEditor&&(this.editorManager.focusedEditor=null)):(jO.hide(this.getContainer()),jO.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=jO.getParent(r.id,"form"))&&WO(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 vb(this,t,e)},t.prototype.getContent=function(t){return pb(this,t)},t.prototype.insertContent=function(t,e){e&&(t=UO({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?vb(this,this.startContent,{format:"raw"}):vb(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=jO.get(this.editorContainer||this.id+"_parent")),this.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=jO.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){tO(this,t)},t.prototype.remove=function(){wb(this)},t.prototype.destroy=function(t){xb(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}(),XO=na.DOM,KO=ve.explode,YO=ve.each,JO=ve.extend,QO=0,ZO=!1,t_=[],e_=[],n_=function(t){var e=t.type;YO(u_.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))},r_=function(t){t!==ZO&&(t?Ku(window).on("resize scroll",n_):Ku(window).off("resize scroll",n_),ZO=t)},o_=function(t){var e=e_;delete t_[t.id];for(var n=0;n<t_.length;n++)if(t_[n]===t){t_.splice(n,1);break}return e_=X(e_,(function(e){return t!==e})),u_.activeEditor===t&&(u_.activeEditor=e_.length>0?e_[0]:null),u_.focusedEditor===t&&(u_.focusedEditor=null),e.length!==e_.length},i_="CSS1Compat"!==document.compatMode,u_=Dt(Dt({},_O),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Ku,majorVersion:"5",minorVersion:"10.0",releaseDate:"2021-10-11",editors:t_,i18n:fa,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,n="";e=_m.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 _m(e).toAbsolute(t),this.documentBaseURL=e,this.baseURI=new _m(this.baseURL),this.suffix=n,(r=this).on("AddEditor",E(Zd,r)),r.on("RemoveEditor",E(tm,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&&dt(r,(function(t,e){da.PluginManager.urls[e]=t}))},init:function(t){var e,n=this,r=ve.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=yt(t,"name").filter((function(t){return!XO.get(t)})).getOrThunk(XO.uniqueId),t.setAttribute("id",e)),e},i=function(t,e){return e.constructor===RegExp?e.test(t.className):XO.hasClass(t,e)},u=function(t){e=t},a=function(){var e,c=0,s=[],l=function(t,r,o){var i=new $O(t,r,n);s.push(i),i.on("init",(function(){++c===e.length&&u(s)})),i.targetElm=i.targetElm||o,i.render()};XO.unbind(window,"ready",a),function(e){var r=t[e];if(r)r.apply(n,[])}("onpageload"),e=Ku.unique(function(t){var e=[];if(de.browser.isIE()&&de.browser.version.major<11)return ly("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(i_)return ly("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return YO(t.types,(function(t){e=e.concat(XO.select(t.selector))})),e;if(t.selector)return XO.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var n=t.elements||"";n.length>0&&YO(KO(n),(function(t){var n=XO.get(t);n?e.push(n):YO(document.forms,(function(n){YO(n.elements,(function(n){n.name===t&&(t="mce_editor_"+QO++,XO.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":YO(XO.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?YO(t.types,(function(n){ve.each(e,(function(e){return!XO.is(e,n.selector)||(l(o(e),JO({},t,n),e),!1)}))})):(ve.each(e,(function(t){var e;(e=n.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(o_(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)})),0===(e=ve.grep(e,(function(t){return!n.get(t.id)}))).length?u([]):YO(e,(function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in r}(t,e)?l(o(e),t,e):ly("Could not initialize inline editor on invalid inline target element",e)})))};return n.settings=t,XO.bind(window,"ready",a),new Ur((function(t){e?t(e):u=function(e){t(e)}}))},get:function(t){return 0===arguments.length?e_.slice(0):d(t)?Q(e_,(function(e){return e.id===t})).getOr(null):x(t)&&e_[t]?e_[t]:null},add:function(t){var e=this;return t_[t.id]===t?t:(null===e.get(t.id)&&("length"!==t.id&&(t_[t.id]=t),t_.push(t),e_.push(t)),r_(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),wx||(wx=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",wx)),t)},createEditor:function(t,e){return this.add(new $O(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:(o_(n)&&r.fire("RemoveEditor",{editor:n}),0===e_.length&&window.removeEventListener("beforeunload",wx),n.remove(),r_(e_.length>0),n);YO(XO.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=e_.length-1;e>=0;e--)r.remove(e_[e])},execCommand:function(t,e,n){var r=this.get(n);switch(t){case"mceAddEditor":return this.get(n)||new $O(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(){YO(e_,(function(t){t.save()}))},addI18n:function(t,e){fa.add(t,e)},translate:function(t){return fa.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 _m(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new _m(this.baseURL)}});u_.setup();var a_,c_,s_,l_,f_=Math.min,d_=Math.max,m_=Math.round,g_=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+=m_(c/2)),"c"===s[1]&&(r+=m_(a/2)),"b"===s[3]&&(o-=u),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=m_(u/2)),"c"===s[4]&&(r-=m_(i/2)),h_(r,o,i,u)},h_=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},p_={inflate:function(t,e,n){return h_(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:g_,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=g_(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=d_(t.x,e.x),r=d_(t.y,e.y),o=f_(t.x+t.w,e.x+e.w),i=f_(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:h_(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=d_(0,e.x-r),l=d_(0,e.y-o),f=d_(0,i-a),d=d_(0,u-c);return r+=s,o+=l,n&&(i+=s,u+=l,r-=f,o-=d),h_(r,o,(i-=f)-r,(u-=d)-o)},create:h_,fromClientRect:function(t){return h_(t.left,t.top,t.width,t.height)}},v_=(a_={},c_={},{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!==a_[t])return a_[t];var o=new Ur((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);c_[t]=u.resolve,ua.ScriptLoader.loadScript(e,(function(){return u.start(r)}),(function(){return u.reject(n)}))}));return a_[t]=o,o},add:function(t,e){void 0!==c_[t]&&(c_[t](e),delete c_[t]),a_[t]=Ur.resolve(e)}}),b_=ve.each,y_=ve.extend,w_=function(){};w_.extend=s_=function(t){var e=this.prototype,n=function(){var t,e,n,r=this;if(!l_&&(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};l_=!0;var o=new this;return l_=!1,t.Mixins&&(b_(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&&b_(t.Methods.split(","),(function(e){t[e]=r})),t.Properties&&b_(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){return void 0!==t?(this[n]=t,this):this[n]}})),t.Statics&&b_(t.Statics,(function(t,e){n[e]=t})),t.Defaults&&e.Defaults&&(t.Defaults=y_({},e.Defaults,t.Defaults)),dt(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=s_,n};var x_,C_=Math.min,S_=Math.max,k_=Math.round,O_={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){}}},__={callbacks:{},count:0,send:function(t){var e=this,n=na.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++}},T_=Dt(Dt({},_O),{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):$r.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||"",T_.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&&ve.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=T_.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();$r.setTimeout(r,10)}}),E_=ve.extend,A_=function(){function t(t){this.settings=E_({},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=E_(this.settings,t);r.success=function(t,o){void 0===(t=O_.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=O_.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",T_.send(r)},t}();try{var D_="__storage_test__";(x_=window.localStorage).setItem(D_,D_),x_.removeItem(D_)}catch(t){x_=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 M_={geom:{Rect:p_},util:{Promise:Ur,Delay:$r,Tools:ve,VK:Wf,URI:_m,Class:w_,EventDispatcher:kO,Observable:_O,I18n:fa,XHR:T_,JSON:O_,JSONRequest:A_,JSONP:__,LocalStorage:x_,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=S_(0,C_(e,1)),i=S_(0,C_(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=k_(255*(n+s)),r=k_(255*(r+s)),o=k_(255*(o+s))}else n=r=o=k_(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=C_(t/=255,C_(e/=255,n/=255)),u=S_(t,S_(e,n));return i===u?{h:0,s:0,v:100*(o=i)}:(r=(u-i)/u,o=u,{h:k_(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(u-i))),s:k_(100*r),v:k_(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=gy(),n=yy(t,e);return{upload:function(e,r){return void 0===r&&(r=!0),n.upload(e,r?by(t):void 0)}}}},dom:{EventUtils:Ei,Sizzle:su,DomQuery:Ku,TreeWalker:Yr,TextSeeker:Ha,DOMUtils:na,ScriptLoader:ua,RangeUtils:ad,Serializer:hb,StyleSheetLoader:Xr,ControlSelection:Gf,BookmarkManager:Lf,Selection:Gv,Event:Ei.Event},html:{Styles:yi,Entities:ai,Node:bm,Schema:vi,SaxParser:Mm,DomParser:lb,Writer:Lm,Serializer:Hm},Env:de,AddOnManager:da,Annotator:If,Formatter:Ty,UndoManager:Ay,EditorCommands:hO,WindowManager:oy,NotificationManager:ey,EditorObservable:MO,Shortcuts:FO,Editor:$O,FocusManager:Xd,EditorManager:u_,DOM:na.DOM,ScriptLoader:ua.ScriptLoader,PluginManager:ny,ThemeManager:ry,IconManager:Gb,Resource:v_,trim:ve.trim,isArray:ve.isArray,is:ve.is,toArray:ve.toArray,makeMap:ve.makeMap,each:ve.each,map:ve.map,grep:ve.grep,inArray:ve.inArray,extend:ve.extend,create:ve.create,walk:ve.walk,createNS:ve.createNS,resolve:ve.resolve,explode:ve.explode,_addCacheSuffix:ve._addCacheSuffix,isOpera:de.opera,isWebKit:de.webkit,isIE:de.ie,isGecko:de.gecko,isMac:de.mac},R_=ve.extend(u_,M_);!function(t){window.tinymce=t,window.tinyMCE=t}(R_),function(e){try{t.exports=e}catch(t){}}(R_)}()}).call(this,n(26))},339:function(t,e,n){n(618)},340:function(t,e,n){n(619)},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)},371:function(t,e,n){"use strict";(function(e){var r=n(372),o=n(373),i=n(374);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(26))},372: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]}},373: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({}))}},374:function(t,e){t.exports=function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]}},375:function(t,e,n){"use strict";var r=n(376);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]}},376:function(t,e,n){"use strict";t.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},47: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,e,n){return Math.max(t,Math.min(e,n))}function T(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,T=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:T("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 _=k(n);_===d(n)&&(_=x(n)),c===r&&(S=o,b-=_.clientHeight-a.height,b*=f?1:-1),c===u&&(C=i,p-=_.clientWidth-a.width,p*=f?1:-1)}var T,E=Object.assign({position:l},m&&D);return f?Object.assign(Object.assign({},E),{},((T={})[S]=w?"0":"",T[C]=y?"0":"",T.transform=(O.devicePixelRatio||1)<2?"translate("+p+"px, "+b+"px)":"translate3d("+p+"px, "+b+"px, 0)",T)):Object.assign(Object.assign({},E),{},((e={})[S]=w?b+"px":"",e[C]=y?p+"px":"",e.transform="",e))}var R={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:{}},N={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,N)})),a&&c.addEventListener("resize",n.update,N),function(){i&&s.forEach((function(t){t.removeEventListener("scroll",n.update,N)})),a&&c.removeEventListener("resize",n.update,N)}},data:{}},B={left:"right",right:"left",bottom:"top",top:"bottom"};function P(t){return t.replace(/left|right|bottom|top/g,(function(t){return B[t]}))}var I={start:"end",end:"start"};function L(t){return t.replace(/start|end/g,(function(t){return I[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=T("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],_=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)),R="popper"===h?M:A,N={top:_.top-R.top+w.top,bottom:R.bottom-_.bottom+w.bottom,left:_.left-R.left+w.left,right:R.right-_.right+w.right},z=t.modifiersData.offset;if("popper"===h&&z){var B=z[c];Object.keys(N).forEach((function(t){var e=[i,o].indexOf(t)>=0?1:-1,n=[r,o].indexOf(t)>=0?"y":"x";N[t]+=B[n]*e}))}return N}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),_=h||(O===k||!C?[P(k)]:function(t){if("auto"===p(t))return[];var e=P(t);return[L(t),e,L(e)]}(k)),T=[k].concat(_).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,R=T[0],N=0;N<T.length;N++){var z=T[N],B=p(z),I="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?I?i:u:I?o:r;E[F]>A[F]&&(j=P(j));var U=P(j),W=[];if(d&&W.push(V[B]<=0),g&&W.push(V[j]<=0,V[U]<=0),W.every((function(t){return t}))){R=z,M=!1;break}D.set(z,W)}if(M)for(var q=function(t){var e=T.find((function(e){var n=D.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return R=e,"break"},G=C?3:1;G>0;G--){if("break"===q(G))break}e.placement!==R&&(e.modifiersData[l]._skip=!0,e.placement=R,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),T=$(e.placement),E=!T,A=O(S),D="x"===A?"y":"x",M=e.modifiersData.popperOffsets,R=e.rects.reference,N=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 P="y"===A?r:u,I="y"===A?o:i,L="y"===A?"height":"width",H=M[A],F=M[A]+C[P],V=M[A]-C[I],j=y?-N[L]/2:0,U="start"===T?R[L]:N[L],W="start"===T?-N[L]:-R[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[P],J=X[I],Q=_(0,R[L],G[L]),Z=E?R[L]/2-j-Q-Y-z:U-Q-Y-z,tt=E?-R[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=_(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=_(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,R,h,tt,Y,nt,A,Z]}),lt=at({defaultModifiers:[z,et,R,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 R})),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}))},618: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"),_=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 T(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=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:M,each:h,bind:M,exists:S,forall:k,filter:function(){return M()},toArray:function(){return[]},toString:v("none()")},N=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 N(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},z={some:N,none:M,from:function(t){return null==t?R:N(t)}},B=Array.prototype.slice,P=Array.prototype.indexOf,I=Array.prototype.push,L=function(t,e){return P.call(t,e)},H=function(t,e){return L(t,e)>-1},F=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},V=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},j=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=B.call(t,r,r+e);n.push(o)}return n},U=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},W=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},q=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}},G=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 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},X=function(t,e,n){return W(t,(function(t,r){n=e(n,t,r)})),n},K=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 z.some(i);if(n(i,r))break}return z.none()}(t,e,S)},Y=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return z.some(n)}return z.none()},J=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);I.apply(e,t[n])}return e},Q=function(t,e){return J(U(t,e))},Z=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},tt=function(t){var e=B.call(t,0);return e.reverse(),e},et=function(t,e){return G(t,(function(t){return!H(e,t)}))},nt=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},rt=function(t){return[t]},ot=function(t,e){var n=B.call(t,0);return n.sort(e),n},it=function(t,e){return e>=0&&e<t.length?z.some(t[e]):z.none()},ut=function(t){return it(t,0)},at=function(t){return it(t,t.length-1)},ct=d(Array.from)?Array.from:function(t){return B.call(t)},st=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return z.none()},lt=Object.keys,ft=Object.hasOwnProperty,dt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},mt=function(t,e){return gt(t,(function(t,n){return{k:n,v:e(t,n)}}))},gt=function(t,e){var n={};return dt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},ht=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),h),n},pt=function(t,e){var n=[];return dt(t,(function(t,r){n.push(e(t,r))})),n},vt=function(t,e){for(var n=lt(t),r=0,o=n.length;r<o;r++){var i=n[r],u=t[i];if(e(u,i,t))return z.some(u)}return z.none()},bt=function(t){return pt(t,b)},yt=function(t,e){return wt(t,e)?z.from(t[e]):z.none()},wt=function(t,e){return ft.call(t,e)},xt=function(t,e){return wt(t,e)&&void 0!==t[e]&&null!==t[e]},Ct=function(t,e,n){return void 0===n&&(n=y),t.exists((function(t){return n(t,e)}))},St=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},kt=function(t,e,n){return t.isSome()&&e.isSome()?z.some(n(t.getOrDie(),e.getOrDie())):z.none()},Ot=function(t,e){return t?z.some(e):z.none()},_t=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},Tt=function(t,e){return-1!==t.indexOf(e)},Et=function(t,e){return _t(t,e,0)},At=function(t,e){return _t(t,e,t.length-e.length)},Dt=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),Mt=function(t){return t.length>0},Rt=function(t){return void 0!==t.style&&d(t.style.getPropertyValue)},Nt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},zt={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 z.from(t.dom.elementFromPoint(e,n)).map(Nt)}};"undefined"!=typeof window?window:Function("return this;")();var Bt,Pt=function(t){return t.dom.nodeName.toLowerCase()},It=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},Lt=It(1),Ht=It(3),Ft=It(9),Vt=It(11),jt=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}},Ut=function(){return Wt(0,0)},Wt=function(t,e){return{major:t,minor:e}},qt={nu:Wt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Ut():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 Wt(r(1),r(2))}(t,n)},unknown:Ut},Gt=function(t,e){var n=String(e).toLowerCase();return K(t,(function(t){return t.search(n)}))},$t=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Xt=function(t){return function(e){return Tt(e,t)}},Kt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Tt(t,"edge/")&&Tt(t,"chrome")&&Tt(t,"safari")&&Tt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,$t],search:function(t){return Tt(t,"chrome")&&!Tt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Tt(t,"msie")||Tt(t,"trident")}},{name:"Opera",versionRegexes:[$t,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Xt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Xt("firefox")},{name:"Safari",versionRegexes:[$t,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Tt(t,"safari")||Tt(t,"mobile/"))&&Tt(t,"applewebkit")}}],Yt=[{name:"Windows",search:Xt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Tt(t,"iphone")||Tt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Xt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Xt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Xt("linux"),versionRegexes:[]},{name:"Solaris",search:Xt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Xt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Xt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Jt={browsers:v(Kt),oses:v(Yt)},Qt=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")}},Zt={unknown:function(){return Qt({current:void 0,version:qt.unknown()})},nu:Qt,edge:v("Edge"),chrome:v("Chrome"),ie:v("IE"),opera:v("Opera"),firefox:v("Firefox"),safari:v("Safari")},te=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")}},ee={unknown:function(){return te({current:void 0,version:qt.unknown()})},nu:te,windows:v("Windows"),ios:v("iOS"),android:v("Android"),linux:v("Linux"),osx:v("OSX"),solaris:v("Solaris"),freebsd:v("FreeBSD"),chromeos:v("ChromeOS")},ne=function(t,e,n){var r=Jt.browsers(),o=Jt.oses(),i=e.bind((function(t){return function(t,e){return st(e.brands,(function(e){var n=e.brand.toLowerCase();return K(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:qt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return Gt(t,e).map((function(t){var n=qt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(Zt.unknown,Zt.nu),u=function(t,e){return Gt(t,e).map((function(t){var n=qt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(ee.unknown,ee.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}},re=function(t){return window.matchMedia(t).matches},oe=jt((function(){return ne(navigator.userAgent,z.from(navigator.userAgentData),re)})),ie=function(){return oe()},ue=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")},ae=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 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)},le=function(t,e){return ie().browser.isIE()?se(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},fe=function(t){return zt.fromDom(t.dom.ownerDocument)},de=function(t){return Ft(t)?t:fe(t)},me=function(t){return zt.fromDom(de(t).dom.documentElement)},ge=function(t){return zt.fromDom(de(t).dom.defaultView)},he=function(t){return z.from(t.dom.parentNode).map(zt.fromDom)},pe=function(t){return z.from(t.dom.offsetParent).map(zt.fromDom)},ve=function(t){return U(t.dom.childNodes,zt.fromDom)},be=function(t,e){var n=t.dom.childNodes;return z.from(n[e]).map(zt.fromDom)},ye=function(t,e){return{element:t,offset:e}},we=function(t,e){var n=ve(t);return n.length>0&&e<n.length?ye(n[e],0):ye(t,e)},xe=function(t){return Vt(t)&&f(t.dom.host)},Ce=d(Element.prototype.attachShadow)&&d(Node.prototype.getRootNode),Se=v(Ce),ke=Ce?function(t){return zt.fromDom(t.dom.getRootNode())}:de,Oe=function(t){return xe(t)?t:zt.fromDom(de(t).dom.body)},_e=function(t){var e=ke(t);return xe(e)?z.some(e):z.none()},Te=function(t){return zt.fromDom(t.dom.host)},Ee=function(t){return f(t.dom.shadowRoot)},Ae=function(t){var e=Ht(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return _e(zt.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=Ae,r=Te,function(t){return n(r(t))}))},De=function(){return Me(zt.fromDom(document))},Me=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return zt.fromDom(e)},Re=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+"")},Ne=function(t,e,n){Re(t.dom,e,n)},ze=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Be=function(t,e){return z.from(ze(t,e))},Pe=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Ie=function(t,e){t.dom.removeAttribute(e)},Le=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);Rt(t)&&t.style.setProperty(e,n)},He=function(t,e){Rt(t)&&t.style.removeProperty(e)},Fe=function(t,e,n){var r=t.dom;Le(r,e,n)},Ve=function(t,e){var n=t.dom;dt(e,(function(t,e){Le(n,e,t)}))},je=function(t,e){var n=t.dom;dt(e,(function(t,e){t.fold((function(){He(n,e)}),(function(t){Le(n,e,t)}))}))},Ue=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Ae(t)?r:We(n,e)},We=function(t,e){return Rt(t)?t.style.getPropertyValue(e):""},qe=function(t,e){var n=t.dom,r=We(n,e);return z.from(r).filter((function(t){return t.length>0}))},Ge=function(t){var e={},n=t.dom;if(Rt(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},$e=function(t,e,n){var r=zt.fromTag(t);return Fe(r,e,n),qe(r,e).isSome()},Xe=function(t,e){var n=t.dom;He(n,e),Ct(Be(t,"style").map(Dt),"")&&Ie(t,"style")},Ke=function(t){return t.dom.offsetWidth},Ye=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Ue(n,t);return parseFloat(o)||0}return r},r=function(t,e){return X(e,(function(e,n){var r=Ue(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;Rt(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}}},Je=Ye("height",(function(t){var e=t.dom;return Ae(t)?e.getBoundingClientRect().height:e.offsetHeight})),Qe=function(t){return Je.get(t)},Ze=function(t){return Je.getOuter(t)},tn=function(t,e){return{left:t,top:e,translate:function(n,r){return tn(t+n,e+r)}}},en=tn,nn=function(t,e){return void 0!==t?t:void 0!==e?e:0},rn=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return en(n.offsetLeft,n.offsetTop);var i=nn(null==r?void 0:r.pageYOffset,o.scrollTop),u=nn(null==r?void 0:r.pageXOffset,o.scrollLeft),a=nn(o.clientTop,n.clientTop),c=nn(o.clientLeft,n.clientLeft);return on(t).translate(u-c,i-a)},on=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?en(n.offsetLeft,n.offsetTop):Ae(t)?function(t){var e=t.getBoundingClientRect();return en(e.left,e.top)}(e):en(0,0)},un=Ye("width",(function(t){return t.dom.offsetWidth})),an=function(t){return un.get(t)},cn=function(t){return un.getOuter(t)},sn=function(t){var e=zt.fromDom(function(t){if(Se()&&f(t.target)){var e=zt.fromDom(t.target);if(Lt(e)&&Ee(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return ut(n)}}return z.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)},ln=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(sn(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:w(fn,t,e,i,o)}},fn=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},dn=function(t,e){he(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},mn=function(t,e){(function(t){return z.from(t.dom.nextSibling).map(zt.fromDom)})(t).fold((function(){he(t).each((function(t){hn(t,e)}))}),(function(t){dn(t,e)}))},gn=function(t,e){(function(t){return be(t,0)})(t).fold((function(){hn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},hn=function(t,e){t.dom.appendChild(e.dom)},pn=function(t,e){W(e,(function(e){hn(t,e)}))},vn=function(t){t.dom.textContent="",W(ve(t),(function(t){bn(t)}))},bn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},yn=function(t){var e,n=ve(t);n.length>0&&(e=t,W(n,(function(t){dn(e,t)}))),bn(t)},wn=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 en(n,r)},xn=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},Cn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Sn=function(t){var e=void 0===t?window:t,n=e.document,r=wn(zt.fromDom(n));return function(t){var e=void 0===t?window:t;return ie().browser.isFirefox()?z.none():z.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Cn(r.left,r.top,n,o)}),(function(t){return Cn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},kn=function(t,e){return t.view(e).fold(v([]),(function(e){var n=t.owner(e),r=kn(t,n);return[e].concat(r)}))},On=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?z.none():z.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(zt.fromDom)},owner:function(t){return fe(t)}}),_n=function(t){var e=zt.fromDom(document),n=wn(e);return function(t,e){var n=e.owner(t),r=kn(e,n);return z.some(r)}(t,On).fold(w(rn,t),(function(e){var r=on(t),o=$(e,(function(t,e){var n=on(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return en(o.left+r.left+n.left,o.top+r.top+n.top)}))},Tn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},En=function(t){var e=rn(t),n=cn(t),r=Ze(t);return Tn(e.left,e.top,n,r)},An=function(t){var e=_n(t),n=cn(t),r=Ze(t);return Tn(e.left,e.top,n,r)},Dn=function(){return Sn(window)},Mn=function(t){return{isValue:k,isError:S,getOr:v(t),getOrThunk:v(t),getOrDie:v(t),or:function(e){return Mn(t)},orThunk:function(e){return Mn(t)},fold:function(e,n){return n(t)},map:function(e){return Mn(e(t))},mapError:function(e){return Mn(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 z.some(t)}}},Rn=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 Rn(t)},mapError:function(e){return Rn(e(t))},each:h,bind:function(e){return Rn(t)},exists:S,forall:k,toOptional:z.none}},Nn={value:Mn,error:Rn,fromOption:function(t,e){return t.fold((function(){return Rn(e)}),Mn)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(Bt||(Bt={}));var zn=function(t,e,n){return t.stype===Bt.Error?e(t.serror):n(t.svalue)},Bn=function(t){return{stype:Bt.Value,svalue:t}},Pn=function(t){return{stype:Bt.Error,serror:t}},In=function(t){return t.fold(Pn,Bn)},Ln=function(t){return zn(t,Nn.error,Nn.value)},Hn=Bn,Fn=function(t){var e=[],n=[];return W(t,(function(t){zn(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},Vn=Pn,jn=function(t,e){return t.stype===Bt.Value?e(t.svalue):t},Un=function(t,e){return t.stype===Bt.Error?e(t.serror):t},Wn=function(t,e){return t.stype===Bt.Value?{stype:Bt.Value,svalue:e(t.svalue)}:t},qn=function(t,e){return t.stype===Bt.Error?{stype:Bt.Error,serror:e(t.serror)}:t},Gn=zn,$n=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},Xn=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)}},Kn=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)wt(i,u)&&(r[u]=t(r[u],i[u]))}return r}},Yn=Kn((function(t,e){return i(t)&&i(e)?Yn(t,e):e})),Jn=Kn((function(t,e){return e})),Qn=function(t){return{tag:"defaultedThunk",process:t}},Zn=function(t){return Qn(v(t))},tr=function(t){return{tag:"mergeWithThunk",process:t}},er=function(t){return p(Vn,J)(t)},nr=function(t){var e=Fn(t);return e.errors.length>0?er(e.errors):Hn(e.values)},rr=function(t){return i(t)&&lt(t).length>100?" removed due to size":JSON.stringify(t,null,2)},or=function(t,e){return Vn([{path:t,getErrorInfo:e}])},ir=function(t){return{extract:function(e,n){return Un(t(n),(function(t){return function(t,e){return or(t,v(e))}(e,t)}))},toString:v("val")}},ur=ir(Hn),ar=function(t,e,n,r){return yt(e,n).fold((function(){return function(t,e,n){return or(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+rr(n)}))}(t,n,e)}),r)},cr=function(t,e,n,r){return r(yt(t,e).getOrThunk((function(){return n(t)})))},sr=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 Hn(z.none())}),(function(t){var n=o.extract(e.concat([r]),t);return Wn(n,z.some)}))};switch(t.tag){case"required":return ar(e,n,r,i);case"defaultedThunk":return cr(n,r,t.process,i);case"option":return function(t,e,n){return n(yt(t,e))}(n,r,u);case"defaultedOptionThunk":return function(t,e,n,r){return r(yt(t,e).map((function(e){return!0===e?n(t):e})))}(n,r,t.process,u);case"mergeWithThunk":return cr(n,r,v({}),(function(e){var r=Yn(t.process(n),e);return i(r)}))}},lr=function(t){return{extract:function(e,n){return t().extract(e,n)},toString:function(){return t().toString()}}},fr=function(t){return lt(ht(t,f))},dr=function(t){var e=mr(t),n=$(t,(function(t,e){return Xn(e,(function(e){var n;return Yn(t,((n={})[e]=!0,n))}),v(t))}),{});return{extract:function(t,r){var o=c(r)?[]:fr(r),i=G(o,(function(t){return!xt(n,t)}));return 0===i.length?e.extract(t,r):function(t,e){return or(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,i)},toString:e.toString}},mr=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];Xn(a,(function(n,i,u,a){var c=sr(u,t,e,n,a);Gn(c,(function(t){o.push.apply(o,t)}),(function(t){r[i]=t}))}),(function(t,n){r[t]=n(e)}))}return o.length>0?Vn(o):Hn(r)}(e,n,t)},toString:function(){return"obj{\n"+U(t,(function(t){return Xn(t,(function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))})).join("\n")+"}"}}},gr=function(t){return{extract:function(e,n){var r=U(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return nr(r)},toString:function(){return"array("+t.toString()+")"}}},hr=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===Bt.Value)return u;r.push(u)}return nr(r)},toString:function(){return"oneOf("+U(t,(function(t){return t.toString()})).join(", ")+")"}}},pr=function(t,e){return{extract:function(n,r){var o=lt(r),i=function(e,n){return gr(ir(t)).extract(e,n)}(n,o);return jn(i,(function(t){var o=U(t,(function(t){return $n(t,t,{tag:"required",process:{}},e)}));return mr(o).extract(n,r)}))},toString:function(){return"setOf("+e.toString()+")"}}},vr=p(gr,mr),br=v(ur),yr=function(t,e){return ir((function(n){var r=typeof n;return t(n)?Hn(n):Vn("Expected type: "+e+" but got: "+r)}))},wr=yr(m,"number"),xr=yr(o,"string"),Cr=yr(c,"boolean"),Sr=yr(d,"function"),kr=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 kr(t[e])}));default:return!1}},Or=ir((function(t){return kr(t)?Hn(t):Vn("Expected value to be acceptable for sending via postMessage")})),_r=function(t,e,n,r){return yt(n,r).fold((function(){return function(t,e,n){return or(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+rr(e)}))}(t,n,r)}),(function(n){return n.extract(t.concat(["branch: "+r]),e)}))},Tr=function(t,e){return{extract:function(n,r){return yt(r,t).fold((function(){return function(t,e){return or(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return _r(n,r,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+lt(e)}}},Er=function(t){return ir((function(e){return t(e).fold(Vn,Hn)}))},Ar=function(t,e){return pr((function(e){return In(t(e))}),e)},Dr=function(t,e,n){return Ln(function(t,e,n){var r=e.extract([t],n);return qn(r,(function(t){return{input:n,errors:t}}))}(t,e,n))},Mr=function(t){return t.fold((function(t){throw new Error(Nr(t))}),b)},Rr=function(t,e,n){return Mr(Dr(t,e,n))},Nr=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,U(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+rr(t.input);var e,n},zr=function(t,e){return Tr(t,mt(e,mr))},Br=$n,Pr=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},Ir=function(t){return Er((function(e){return H(t,e)?Nn.value(e):Nn.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},Lr=function(t){return Br(t,t,{tag:"required",process:{}},br())},Hr=function(t,e){return Br(t,t,{tag:"required",process:{}},e)},Fr=function(t){return Hr(t,wr)},Vr=function(t){return Hr(t,xr)},jr=function(t,e){return Br(t,t,{tag:"required",process:{}},Ir(e))},Ur=function(t){return Hr(t,Sr)},Wr=function(t,e){return Br(t,t,{tag:"required",process:{}},mr(e))},qr=function(t,e){return Br(t,t,{tag:"required",process:{}},vr(e))},Gr=function(t,e){return Br(t,t,{tag:"required",process:{}},gr(e))},$r=function(t){return Br(t,t,{tag:"option",process:{}},br())},Xr=function(t,e){return Br(t,t,{tag:"option",process:{}},e)},Kr=function(t){return Xr(t,wr)},Yr=function(t){return Xr(t,xr)},Jr=function(t){return Xr(t,Sr)},Qr=function(t,e){return Xr(t,gr(e))},Zr=function(t,e){return Xr(t,mr(e))},to=function(t,e){return Br(t,t,Zn(e),br())},eo=function(t,e,n){return Br(t,t,Zn(e),n)},no=function(t,e){return eo(t,e,wr)},ro=function(t,e){return eo(t,e,xr)},oo=function(t,e,n){return eo(t,e,Ir(n))},io=function(t,e){return eo(t,e,Cr)},uo=function(t,e){return eo(t,e,Sr)},ao=function(t,e,n){return eo(t,e,gr(n))},co=function(t,e,n){return eo(t,e,mr(n))},so=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},lo=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 W(t,(function(r,o){var i=lt(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=lt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!Z(e,(function(t){return H(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};lo([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var fo,mo=function(t,e){return function(t,e){var n={};return dt(t,(function(t,r){H(e,r)||(n[r]=t)})),n}(t,e)},go=function(t,e){return function(t,e){var n;return(n={})[t]=e,n}(t,e)},ho=function(t){return function(t){var e={};return W(t,(function(t){e[t.key]=t.value})),e}(t)},po=function(t,e){var n,r=function(t){var e=[],n=[];return W(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,Nn.error(J(n))):function(t,e){return 0===t.length?Nn.value(e):Nn.value(Yn(e,Jn.apply(void 0,t)))}(r.values,e)},vo=function(t){return d(t)?t:S},bo=function(t,e,n){for(var r=t.dom,o=vo(n);r.parentNode;){r=r.parentNode;var i=zt.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return z.none()},yo=function(t,e,n){var r=e(t),o=vo(n);return r.orThunk((function(){return o(t)?z.none():bo(t,e,o)}))},wo=function(t,e){return ce(t.element,e.event.target)},xo={can:k,abort:S,run:h},Co=function(t){if(!xt(t,"can")&&!xt(t,"abort")&&!xt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return _(_({},xo),t)},So=function(t){return{can:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return X(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 X(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];W(t,(function(t){t.run.apply(void 0,e)}))}}},ko=v,Oo=ko("touchstart"),_o=ko("touchmove"),To=ko("touchend"),Eo=ko("touchcancel"),Ao=ko("mousedown"),Do=ko("mousemove"),Mo=ko("mouseout"),Ro=ko("mouseup"),No=ko("mouseover"),zo=ko("focusin"),Bo=ko("focusout"),Po=ko("keydown"),Io=ko("keyup"),Lo=ko("input"),Ho=ko("change"),Fo=ko("click"),Vo=ko("transitioncancel"),jo=ko("transitionend"),Uo=ko("transitionstart"),Wo=ko("selectstart"),qo=function(t){return v("alloy."+t)},Go={tap:qo("tap")},$o=qo("focus"),Xo=qo("blur.post"),Ko=qo("paste.post"),Yo=qo("receive"),Jo=qo("execute"),Qo=qo("focus.item"),Zo=Go.tap,ti=qo("longpress"),ei=qo("sandbox.close"),ni=qo("typeahead.cancel"),ri=qo("system.init"),oi=qo("system.touchmove"),ii=qo("system.touchend"),ui=qo("system.scroll"),ai=qo("system.resize"),ci=qo("system.attached"),si=qo("system.detached"),li=qo("system.dismissRequested"),fi=qo("system.repositionRequested"),di=qo("focusmanager.shifted"),mi=qo("slotcontainer.visibility"),gi=qo("change.tab"),hi=qo("dismiss.tab"),pi=qo("highlight"),vi=qo("dehighlight"),bi=function(t,e){Ci(t,t.element,e,{})},yi=function(t,e,n){Ci(t,t.element,e,n)},wi=function(t){bi(t,Jo())},xi=function(t,e,n){Ci(t,e,n,{})},Ci=function(t,e,n,r){var o=_({target:e},r);t.getSystem().triggerEvent(n,e,o)},Si=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},ki=function(t){return ho(t)},Oi=function(t,e){return{key:t,value:Co({abort:e})}},_i=function(t){return{key:t,value:Co({run:function(t,e){e.event.prevent()}})}},Ti=function(t,e){return{key:t,value:Co({run:e})}},Ei=function(t,e,n){return{key:t,value:Co({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Ai=function(t){return function(e){return{key:t,value:Co({run:function(t,n){wo(t,n)&&e(t,n)}})}}},Di=function(t,e,n){return function(t,e){return Ti(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){Si(e,e.element,t,r)}))}))}(t,e.partUids[n])},Mi=function(t,e){return Ti(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).getOrThunk((function(){return yo(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),S).getOr(t)}));e(t,o,n)}))},Ri=function(t){return Ti(t,(function(t,e){e.cut()}))},Ni=function(t){return Ti(t,(function(t,e){e.stop()}))},zi=function(t,e){return Ai(t)(e)},Bi=Ai(ci()),Pi=Ai(si()),Ii=Ai(ri()),Li=function(t){return function(e){return Ti(t,e)}}(Jo()),Hi=function(t){return t.dom.innerHTML},Fi=function(t,e){var n,r,o=fe(t).dom,i=zt.fromDom(o.createDocumentFragment()),u=(n=e,(r=(o||document).createElement("div")).innerHTML=n,ve(zt.fromDom(r)));pn(i,u),vn(t),hn(t,i)},Vi=function(t){return function(t,e){return zt.fromDom(t.dom.cloneNode(e))}(t,!1)},ji=function(t){return xe(t)?"#shadow-root":function(t){var e=zt.fromTag("div"),n=zt.fromDom(t.dom.cloneNode(!0));return hn(e,n),Hi(e)}(Vi(t))},Ui=function(t){return ji(t)},Wi=ki([function(t,e){return{key:t,value:Co({can:e})}}($o(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return ce(e,t.element)&&!ce(e,n)}(t,r,o)||(console.warn($o()+" did not get interpreted by the desired target. \nOriginator: "+Ui(r)+"\nTarget: "+Ui(o)+"\nCheck the "+$o()+" event handlers"),!1)}))]),qi=Object.freeze({__proto__:null,events:Wi}),Gi=0,$i=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Gi+String(e)},Xi=v("alloy-id-"),Ki=v("data-alloy-id"),Yi=Xi(),Ji=Ki(),Qi=function(t,e){Object.defineProperty(t.dom,Ji,{value:e,writable:!0})},Zi=function(t){var e=Lt(t)?t.dom[Ji]:null;return z.from(e)},tu=function(t){return $i(t)},eu=b,nu=function(t){var e=function(e){return"The component must be in a context to execute: "+e+(t?"\n"+Ui(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}},ru=nu(),ou=function(t){return U(t,(function(t){return At(t,"/*")?t.substring(0,t.length-"/*".length):t}))},iu=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:ou(i)}},t},uu=$i("alloy-premade"),au=function(t){return go(uu,t)},cu=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:ou(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,!1))}),t)},su={init:function(){return lu({readState:v("No State required")})}},lu=function(t){return t},fu=function(t,e){var n={};return dt(t,(function(t,r){dt(t,(function(t,o){var i=yt(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},du=function(t){return{classes:s(t.classes)?[]:t.classes,attributes:s(t.attributes)?{}:t.attributes,styles:s(t.styles)?{}:t.styles}},mu=function(t){return t.cHandler},gu=function(t,e){return{name:t,handler:e}},hu=function(t,e,n){var r=_(_({},n),function(t,e){var n={};return W(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return fu(r,gu)},pu=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)}},vu=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=ot(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 Nn.value(o)}catch(t){return Nn.error([t])}}("Event: "+n,"name",t,r).map((function(t){var e=U(t,(function(t){return t.handler}));return So(e)})):function(t,e){return Nn.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(U(e,(function(t){return t.name})),null,2)])}(n,t)},bu=function(t,e){var n=pt(t,(function(t,n){return(1===t.length?Nn.value(t[0].handler):vu(t,e,n)).map((function(r){var o=pu(r),i=t.length>1?G(e[n],(function(e){return F(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return go(n,function(t,e){return{handler:t,purpose:e}}(o,i))}))}));return po(n,{})},yu="alloy.base.behaviour",wu=mr([Br("dom","dom",{tag:"required",process:{}},mr([Lr("tag"),to("styles",{}),to("classes",[]),to("attributes",{}),$r("value"),$r("innerHtml")])),Lr("components"),Lr("uid"),to("events",{}),to("apis",{}),Br("eventOrder","eventOrder",function(t){return tr(v(t))}((fo={},fo[Jo()]=["disabling",yu,"toggling","typeaheadevents"],fo[$o()]=[yu,"focusing","keying"],fo[ri()]=[yu,"disabling","toggling","representing"],fo[Lo()]=[yu,"representing","streaming","invalidating"],fo[si()]=[yu,"representing","item-events","tooltipping"],fo[Ao()]=["focusing",yu,"item-type-events"],fo[Oo()]=["focusing",yu,"item-type-events"],fo[No()]=["item-type-events","tooltipping"],fo[Yo()]=["receiving","reflecting","tooltipping"],fo)),br()),$r("domModification")]),xu=function(t){return t.events},Cu=function(t,e){var n=ze(t,e);return void 0===n||""===n?[]:n.split(" ")},Su=function(t){return void 0!==t.dom.classList},ku=function(t,e){return function(t,e,n){var r=Cu(t,e).concat([n]);return Ne(t,e,r.join(" ")),!0}(t,"class",e)},Ou=function(t,e){return function(t,e,n){var r=G(Cu(t,e),(function(t){return t!==n}));return r.length>0?Ne(t,e,r.join(" ")):Ie(t,e),!1}(t,"class",e)},_u=function(t,e){Su(t)?t.dom.classList.add(e):ku(t,e)},Tu=function(t){0===(Su(t)?t.dom.classList:function(t){return Cu(t,"class")}(t)).length&&Ie(t,"class")},Eu=function(t,e){Su(t)?t.dom.classList.remove(e):Ou(t,e);Tu(t)},Au=function(t,e){return Su(t)&&t.dom.classList.contains(e)},Du=function(t,e){W(e,(function(e){_u(t,e)}))},Mu=function(t,e){W(e,(function(e){Eu(t,e)}))},Ru=function(t){return t.dom.value},Nu=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},zu=function(t){var e=zt.fromTag(t.tag);!function(t,e){var n=t.dom;dt(e,(function(t,e){Re(n,e,t)}))}(e,t.attributes),Du(e,t.classes),Ve(e,t.styles),t.innerHtml.each((function(t){return Fi(e,t)}));var n=t.domChildren;return pn(e,n),t.value.each((function(t){Nu(e,t)})),t.uid,Qi(e,t.uid),e},Bu=function(t,e){return function(t,e){var n=U(e,(function(t){return Zr(t.name(),[Lr("config"),to("state",su)])})),r=Dr("component.behaviours",mr(n),t.behaviours).fold((function(e){throw new Error(Nr(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),b);return{list:e,data:mt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return v(e)}))}}(t,e)},Pu=function(t){var e=function(t){var e=yt(t,"behaviours").getOr({});return Q(lt(e),(function(t){var n=e[t];return f(n)?[n.me]:[]}))}(t);return Bu(t,e)},Iu=function(t,e,n){var r,o,i,u=_(_({},(r=t).dom),{uid:r.uid,domChildren:U(r.components,(function(t){return t.element}))}),a=function(t){return t.domModification.fold((function(){return du({})}),du)}(t),c={"alloy.base.modification":a},s=e.length>0?function(t,e,n,r){var o=_({},e);W(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=fu(o,(function(t,e){return{name:t,modification:e}})),u=function(t){return $(t,(function(t,e){return _(_({},e.modification),t)}),{})},a=$(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=u(i.attributes),s=u(i.styles);return du({classes:a,attributes:c,styles:s})}(n,c,e,u):a;return i=s,_(_({},o=u),{attributes:_(_({},o.attributes),i.attributes),styles:_(_({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},Lu=function(t,e,n){var r={"alloy.base.behaviour":xu(t)};return function(t,e,n,r){var o=hu(t,n,r);return bu(o,e)}(n,t.eventOrder,e,r).getOrDie()},Hu=function(t){var e=function(){return f},n=so(ru),r=Mr(function(t){return Dr("custom.definition",wu,t)}(t)),o=Pu(t),i=function(t){return t.list}(o),u=function(t){return t.data}(o),a=Iu(r,i,u),c=zu(a),s=Lu(r,i,u),l=so(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(nu(e))},element:c,syncComponents:function(){var t=ve(c),e=Q(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),rt)}));l.set(e)},components:l.get,events:s};return f},Fu=function(t){var e=eu(t),n=e.events,r=T(e,["events"]),o=function(t){var e=yt(t,"components").getOr([]);return U(e,Wu)}(r),i=_(_({},r),{events:_(_({},qi),n),components:o});return Nn.value(Hu(i))},Vu=function(t){var e=zt.fromText(t);return ju({element:e})},ju=function(t){var e=Rr("external.component",dr([Lr("element"),$r("uid")]),t),n=so(nu()),r=e.uid.getOrThunk((function(){return tu("external")}));Qi(e.element,r);var o={uid:r,getSystem:n.get,config:z.none,hasConfigured:S,connect:function(t){n.set(t)},disconnect:function(){n.set(nu((function(){return o})))},getApis:function(){return{}},element:e.element,spec:t,readState:v("No state"),syncComponents:h,components:v([]),events:{}};return au(o)},Uu=tu,Wu=function(t){return function(t){return yt(t,uu)}(t).getOrThunk((function(){var e=function(t){return wt(t,"uid")}(t)?t:_({uid:Uu("")},t);return Fu(e).getOrDie()}))},qu=au;function Gu(t,e,n,r,o){return t(n,r)?z.some(n):d(o)&&o(n)?z.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=zt.fromDom(r);if(e(i))return z.some(i);if(o(i))break}return z.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 ue(t,e)}),n)},Qu=function(t,e){return function(t,e){return K(t.dom.childNodes,(function(t){return e(zt.fromDom(t))})).map(zt.fromDom)}(t,(function(t){return ue(t,e)}))},Zu=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return ae(n)?z.none():z.from(n.querySelector(t)).map(zt.fromDom)}(e,t)},ta=function(t,e,n){return Gu((function(t,e){return ue(t,e)}),Ju,t,e,n)},ea=function(){var t=$i("aria-owns");return{id:t,link:function(e){Ne(e,"aria-owns",t)},unlink:function(t){Ie(t,"aria-owns")}}},na=function(t,e){return function(t){return Ku(t,(function(t){if(!Lt(t))return!1;var e=ze(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1})).bind((function(t){var e=ze(t,"id"),n=ke(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 ce(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=so({}),ia=function(t,e,n){switch(yt(oa.get(),t).orThunk((function(){var e=lt(oa.get());return st(e,(function(e){return t.indexOf(e)>-1?z.some(oa.get()[e]):z.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();H(["mousemove","mouseover","mouseout",ri()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:U(n,(function(t){return H(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Ui(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([Lr("menu"),Lr("selectedMenu")]),la=v([Lr("item"),Lr("selectedItem")]);v(mr(la().concat(sa())));var fa=v(mr(la())),da=Wr("initSize",[Lr("numColumns"),Lr("numRows")]),ma=function(){return Wr("markers",[Lr("backgroundMenu")].concat(sa()).concat(la()))},ga=function(t){return Wr("markers",U(t,Lr))},ha=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return K(e,(function(t){return t.indexOf("alloy")>0&&!F(ua,(function(e){return t.indexOf(e)>-1}))})).getOr("unknown")}}(),Br(e,e,n,Er((function(t){return Nn.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,Zn(h))},va=function(t){return ha(0,t,Zn(z.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 Pr(t,v(e))},xa=function(t){return Pr(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=lo([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Oa=ka.southeast,_a=ka.southwest,Ta=ka.northeast,Ea=ka.northwest,Aa=ka.south,Da=ka.north,Ma=ka.east,Ra=ka.west,Na=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 nt(["left","right","top","bottom"],(function(n){return yt(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)}))}))},Pa=function(t){return t.x},Ia=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(Pa(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(),_a(),"southwest",Ba(t,{right:0,top:3}),"layout")},Wa=function(t,e,n){return Sa(Pa(t),Ha(t,e),n.northeast(),Ta(),"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(Ia(t,e),Ha(t,e),n.north(),Da(),"north",Ba(t,{bottom:2}),"layout")},$a=function(t,e,n){return Sa(Ia(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(),Ra(),"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 ki([Ti(Yo(),(function(e,n){var r=t.channels,o=lt(r),i=n,u=function(t,e){return e.universal?t:G(t,(function(t){return H(e.channels,t)}))}(o,i);W(u,(function(t){var n=r[t],o=n.schema,u=Rr("channel["+t+"] data\nReceiver: "+Ui(e.element),o,i.data);n.onReceive(e,u)}))}))])}}),rc=[Hr("channels",Ar(Nn.value,dr([ba("onReceive"),to("schema",br())])))],oc=function(t,e,n){return Ii((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:ou(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 xt(t,n)?t[n]():z.none()},c=mt(o,(function(t,e){return ic(n,t,e)})),s=mt(i,(function(t,e){return iu(t,e)})),l=_(_(_({},s),c),{revoke:w(uc,n),config:function(e){var r=Rr(n+"-config",t,e);return{key:n,value:{config:r,me:l,configAsRaw:jt((function(){return Rr(n+"-config",t,e)})),initialConfig:e,state:u}}},schema:v(e),exhibit:function(t,e){return kt(a(t),yt(r,"exhibit"),(function(t,n){return n(e,t.config,t.state)})).getOrThunk((function(){return du({})}))},name:v(n),handlers:function(t){return a(t).map((function(t){return yt(r,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return l},cc=function(t){return ho(t)},sc=dr([Lr("fields"),Lr("name"),to("active",{}),to("apis",{}),to("state",su),to("extra",{})]),lc=function(t){var e=Rr("Creating behaviour: "+t.name,sc,t);return function(t,e,n,r,o,i){var u,a,c=dr(t),s=Zr(e,[(u="config",a=t,Xr(u,dr(a)))]);return ac(c,s,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},fc=dr([Lr("branchKey"),Lr("branches"),Lr("name"),to("active",{}),to("apis",{}),to("state",su),to("extra",{})]),dc=function(t){var e=Rr("Creating behaviour: "+t.name,fc,t);return function(t,e,n,r,o,i){var u=t,a=Zr(e,[Xr("config",t)]);return ac(u,a,e,n,r,o,i)}(zr(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 du({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),pc=function(){return zt.fromDom(document)},vc=function(t){return t.dom.focus()},bc=function(t){var e=ke(t).dom;return t.dom===e.activeElement},yc=function(t){return void 0===t&&(t=pc()),z.from(t.dom.activeElement).map(zt.fromDom)},wc=function(t){return yc(ke(t)).filter((function(e){return t.dom.contains(e.dom)}))},xc=function(t,e){var n=ke(e),r=yc(n).bind((function(t){var n,r,o=function(e){return ce(t,e)};return o(e)?z.some(e):(n=o,(r=function(t){for(var e=0;e<t.childNodes.length;e++){var o=zt.fromDom(t.childNodes[e]);if(n(o))return z.some(o);var i=r(t.childNodes[e]);if(i.isSome())return i}return z.none()})(e.dom))})),o=t(e);return r.each((function(t){yc(n).filter((function(e){return ce(e,t)})).fold((function(){vc(t)}),h)})),o},Cc=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)}},Sc=function(t,e){je(t,function(t){return _(_({},t),{position:z.some(t.position)})}(e))},kc=lo([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Oc=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=z.some(a),d=z.some(c),m=z.some(s),g=z.some(l),h=z.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 Cc(t,f,d,h,h)}),(function(){return Cc(t,h,d,m,h)}),(function(){return Cc(t,f,h,h,g)}),(function(){return Cc(t,h,h,m,g)}),(function(){return Cc(t,f,d,h,h)}),(function(){return Cc(t,f,h,h,g)}),(function(){return Cc(t,f,d,h,h)}),(function(){return Cc(t,h,d,m,h)}))},_c=function(t,e){return t.fold((function(){var t=e.rect;return Cc("absolute",z.some(t.x),z.some(t.y),z.none(),z.none())}),(function(t,n,r,o){return Oc("absolute",e,t,n,r,o)}),(function(t,n,r,o){return Oc("fixed",e,t,n,r,o)}))},Tc=function(t,e){var n=w(_n,e),r=t.fold(n,n,(function(){var t=wn();return _n(e).translate(-t.left,-t.top)})),o=cn(e),i=Ze(e);return Tn(r.left,r.top,o,i)},Ec=function(t,e){return e.fold((function(){return t.fold(Dn,Dn,Tn)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=Ac(t,n.x,n.y);return Tn(r.left,r.top,n.width,n.height)}))}))},Ac=function(t,e,n){var r=en(e,n);return t.fold(v(r),v(r),(function(){var t=wn();return r.translate(-t.left,-t.top)}))};kc.none;var Dc,Mc=kc.relative,Rc=kc.fixed,Nc=function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)},zc=function(t){return Be(t,"data-alloy-placement")},Bc=lo([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Pc=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 Tn(o,i,u-o,a-i)}(r,t.restriction,i),a=t.x+i.left,c=t.y+i.top,s=Tn(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 Tn(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?Bc.fit(x):Bc.nofit(x,m,g,b)},Ic=function(t){var e=so(z.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(z.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(z.some(t))}}},Lc=function(){return Ic((function(t){return t.unbind()}))},Hc=function(){var t=Ic(h);return _(_({},t),{on:function(e){return t.get().each(e)}})},Fc=k,Vc=function(t,e,n){return function(t,e,n,r){return ln(t,e,n,r,!1)}(t,e,Fc,n)},jc=function(t,e,n){return function(t,e,n,r){return ln(t,e,n,r,!0)}(t,e,Fc,n)},Uc=sn,Wc=["top","bottom","right","left"],qc="data-alloy-transition-timer",Gc=function(t,e){return function(t,e){return Z(e,(function(e){return Au(t,e)}))}(t,e.classes)},$c=function(t,e){var n=function(t){return parseFloat(t).toFixed(3)};return vt(e,(function(e,r){var o,i,u,a=t[r].map(n),c=e.map(n);return void 0===u&&(u=y),!kt(o=a,i=c,u).getOr(o.isNone()&&i.isNone())})).isSome()},Xc=function(t,e){var n,r=Lc(),i=Lc(),u=function(e){var n,r=null!==(n=e.raw.pseudoElement)&&void 0!==n?n:"";return ce(e.target,t)&&!Mt(r)&&H(Wc,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===jo())&&(clearTimeout(n),Ie(t,qc),Mu(t,e.classes))}},c=function(){r.set(Vc(t,jo(),a)),i.set(Vc(t,Vo(),a))};if("ontransitionstart"in t.dom)var s=Vc(t,Uo(),(function(t){u(t)&&(s.unbind(),c())}));else c();var f=function(t){var e=function(e){var n=Ue(t,e),r=o(n)?n.split(/\s*,\s*/):[];return G(r,Mt)},n=function(t){if(o(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return At(t,"ms")?e:1e3*e}return 0},r=e("transition-delay"),i=e("transition-duration");return X(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),Ne(t,qc,n)}))},Kc=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||Gc(t,r)){Fe(t,"position",n.position);var a=Tc(e,t),c=_c(e,_(_({},o),{rect:a})),s=nt(Wc,(function(t){return c[t]}));$c(n,s)&&(je(t,s),u&&function(t,e){Du(t,e.classes),Be(t,qc).each((function(e){clearTimeout(parseInt(e,10)),Ie(t,qc)})),Xc(t,e)}(t,r),Ke(t))}else Mu(t,r.classes)},Yc=function(t,e,n,r){Xe(e,"max-height"),Xe(e,"max-width");var o,i={width:cn(o=e),height:Ze(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=Pc(d,u,a,i);return m.fold(v(m),(function(t,e,n,r){return(f===r?n>l||e>s:!f&&r)?m:Bc.nofit(c,s,l,f)}))};return X(e,(function(t,e){var n=w(c,e);return t.fold(v(t),n)}),Bc.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)},Jc=function(t,e){!function(t,e){Ne(t,"data-alloy-placement",e)}(t,e.placement)},Qc=function(t,e){!function(t,e){var n=Je.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Fe(t,"max-height",n+"px")}(t,Math.floor(e))},Zc=v((function(t,e){Qc(t,e),Ve(t,{"overflow-x":"hidden","overflow-y":"auto"})})),ts=v((function(t,e){Qc(t,e)})),es=function(t,e,n){return void 0===t[e]?n:t[e]},ns=function(t,e,n,r){var o=Yc(t,e,n,r);return function(t,e,n){var r=_c(n.origin,e);n.transition.each((function(o){Kc(t,n.origin,r,o,e,n.lastPlacement)})),Sc(t,r)}(e,o,r),Jc(e,o),function(t,e){var n=e.classes;Mu(t,n.off),Du(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}},rs=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],os=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,u=function(t){return yt(n,t).getOr([])},a=function(t,e,n){var r=et(rs,n);return{offset:en(t,e),classesOn:Q(n,u),classesOff:Q(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"])}}},is=function(){return os(0,0,{})},us=b,as=function(t,e){return function(n){return"rtl"===cs(n)?e:t}},cs=function(t){return"rtl"===Ue(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(Dc||(Dc={}));var ss="data-alloy-vertical-dir",ls=function(t){return Yu(t,(function(t){return Lt(t)&&ze(t,"data-alloy-vertical-dir")===Dc.BottomToTop}))},fs=function(){return Zr("layouts",[Lr("onLtr"),Lr("onRtl"),$r("onBottomLtr"),$r("onBottomRtl")])},ds=function(t,e,n,r,o,i,u){var a=u.map(ls).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 as(l,f)(t)},ms=[Lr("hotspot"),$r("bubble"),to("overrides",{}),fs(),wa("placement",(function(t,e,n){var r=e.hotspot,o=Tc(n,r.element),i=ds(t.element,e,tc(),ec(),Qa(),Za(),z.some(e.hotspot.element));return z.some(us({anchorBox:o,bubble:e.bubble.getOr(is()),overrides:e.overrides,layouts:i,placer:z.none()}))}))],gs=[Lr("x"),Lr("y"),to("height",0),to("width",0),to("bubble",is()),to("overrides",{}),fs(),wa("placement",(function(t,e,n){var r=Ac(n,e.x,e.y),o=Tn(r.left,r.top,e.width,e.height),i=ds(t.element,e,Ya(),Ja(),Ya(),Ja(),z.none());return z.some(us({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:z.none()}))}))],hs=lo([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),ps=function(t){return t.fold(b,(function(t,e,n){return t.translate(-e,-n)}))},vs=function(t){return t.fold(b,b)},bs=function(t){return X(t,(function(t,e){return t.translate(e.left,e.top)}),en(0,0))},ys=function(t){var e=U(t,vs);return bs(e)},ws=hs.screen,xs=hs.absolute,Cs=function(t,e,n){var r=fe(t.element),o=wn(r),i=function(t,e,n){var r=ge(n.root).dom;return z.from(r.frameElement).map(zt.fromDom).filter((function(e){var n=fe(e),r=fe(t.element);return ce(n,r)})).map(rn)}(t,0,n).getOr(o);return xs(i,o.left,o.top)},Ss=function(t,e,n,r){var o=ws(en(t,e));return z.some(function(t,e,n){return{point:t,width:e,height:n}}(o,n,r))},ks=function(t,e,n,r,o){return t.map((function(t){var i,u,a,c=[e,t.point],s=(i=function(){return ys(c)},u=function(){return ys(c)},a=function(){return function(t){var e=U(t,ps);return bs(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=ds(o,n,f,d,f,d,z.none());return us({anchorBox:l,bubble:n.bubble.getOr(is()),overrides:n.overrides,layouts:m,placer:z.none()})}))},Os=[Lr("node"),Lr("root"),$r("bubble"),fs(),to("overrides",{}),to("showAbove",!1),wa("placement",(function(t,e,n){var r=Cs(t,0,e);return e.node.filter(Ae).bind((function(o){var i=o.dom.getBoundingClientRect(),u=Ss(i.left,i.top,i.width,i.height),a=e.node.getOr(t.element);return ks(u,r,e,n,a)}))}))],_s=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Ts=lo([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Es=(Ts.before,Ts.on,Ts.after,function(t){return t.fold(b,b,b)}),As=lo([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ds={domRange:As.domRange,relative:As.relative,exact:As.exact,exactFromRange:function(t){return As.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return zt.fromDom(t.startContainer)},relative:function(t,e){return Es(t)},exact:function(t,e,n,r){return t}})}(t);return ge(e)},range:_s},Ms=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},Rs=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}},zs=lo([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Bs=function(t,e,n){return e(zt.fromDom(n.startContainer),n.startOffset,zt.fromDom(n.endContainer),n.endOffset)},Ps=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 zs.rtl(zt.fromDom(t.endContainer),t.endOffset,zt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Bs(0,zs.ltr,n)})):Bs(0,zs.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:v(t),rtl:z.none}},relative:function(e,n){return{ltr:jt((function(){return Ms(t,e,n)})),rtl:jt((function(){return z.some(Ms(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:jt((function(){return Rs(t,e,n,r,o)})),rtl:jt((function(){return z.some(Rs(t,r,o,e,n))}))}}})}(t,e))},Is=function(t,e){return Ps(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}})};zs.ltr,zs.rtl;var Ls,Hs=function(t,e){var n=function(e){return t(e)?z.from(e.dom.nodeValue):z.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}}}(Ht,"text"),Fs=function(t){return Hs.getOption(t)},Vs=["img","br"],js=function(t){return Fs(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||H(Vs,Pt(t))},Us=function(t,e){var n=function(t){for(var r=ve(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return z.some(i);var u=n(i);if(u.isSome())return u}return z.none()};return n(t)},Ws=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return ae(n)?[]:U(n.querySelectorAll(t),zt.fromDom)}(e,t)},qs=function(t,e,n,r){var o=function(t,e,n,r){var o=fe(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=ce(t,n)&&e===r;return o.collapsed&&!i},Gs=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return z.some(_s(zt.fromDom(e.startContainer),e.startOffset,zt.fromDom(n.endContainer),n.endOffset))}return z.none()},$s=function(t){if(null===t.anchorNode||null===t.focusNode)return Gs(t);var e=zt.fromDom(t.anchorNode),n=zt.fromDom(t.focusNode);return qs(e,t.anchorOffset,n,t.focusOffset)?z.some(_s(e,t.anchorOffset,n,t.focusOffset)):Gs(t)},Xs=function(t){return function(t){return z.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind($s)},Ks=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?z.some(n).map(Ns):z.none()}(Is(t,e))},Ys=function(t,e){return function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?z.some(e).map(Ns):z.none()}(Is(t,e))},Js=function(t,e){return{element:t,offset:e}},Qs=function(t,e){var n=ve(t);if(0===n.length)return Js(t,e);if(e<n.length)return Js(n[e],0);var r=n[n.length-1],o=Ht(r)?function(t){return Hs.get(t)}(r).length:ve(r).length;return Js(r,o)},Zs=function(t,e){return Ht(t)?Js(t,e):Qs(t,e)},tl=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return Xs(t)}}))().map((function(t){var e=Zs(t.start,t.soffset),n=Zs(t.finish,t.foffset);return Ds.range(e.element,e.offset,n.element,n.offset)}))},el=[$r("getSelection"),Lr("root"),$r("bubble"),fs(),to("overrides",{}),to("showAbove",!1),wa("placement",(function(t,e,n){var r=ge(e.root).dom,o=Cs(t,0,e),i=tl(r,e).bind((function(t){return Ys(r,Ds.exactFromRange(t)).orThunk((function(){var e=zt.fromText("\ufeff");dn(t.start,e);var n=Ks(r,Ds.exact(e,0,e,1));return bn(e),n})).bind((function(t){return Ss(t.left,t.top,t.width,t.height)}))})),u=tl(r,e).bind((function(t){return Lt(t.start)?z.some(t.start):function(t){return he(t)}(t.start)})).getOr(t.element);return ks(i,o,e,n,u)}))],nl=function(t){return t.x+t.width},rl=function(t,e){return t.x-e.width},ol=function(t,e){return t.y-e.height+t.height},il=function(t){return t.y},ul=function(t,e,n){return Sa(nl(t),il(t),n.southeast(),Oa(),"southeast",Ba(t,{left:0,top:2}),"link-layout")},al=function(t,e,n){return Sa(rl(t,e),il(t),n.southwest(),_a(),"southwest",Ba(t,{right:1,top:2}),"link-layout")},cl=function(t,e,n){return Sa(nl(t),ol(t,e),n.northeast(),Ta(),"northeast",Ba(t,{left:0,bottom:3}),"link-layout")},sl=function(t,e,n){return Sa(rl(t,e),ol(t,e),n.northwest(),Ea(),"northwest",Ba(t,{right:1,bottom:3}),"link-layout")},ll=function(){return[ul,al,cl,sl]},fl=function(){return[al,ul,sl,cl]},dl=[Lr("item"),fs(),to("overrides",{}),wa("placement",(function(t,e,n){var r=Tc(n,e.item.element),o=ds(t.element,e,ll(),fl(),ll(),fl(),z.none());return z.some(us({anchorBox:r,bubble:is(),overrides:e.overrides,layouts:o,placer:z.none()}))}))],ml=zr("type",{selection:el,node:Os,hotspot:ms,submenu:dl,makeshift:gs}),gl=[Gr("classes",xr),oo("mode","all",["all","layout","placement"])],hl=[to("useFixed",S),$r("getBounds")],pl=[Hr("anchor",ml),Zr("transition",gl)],vl=function(t,e,n,r,o,i,u){return function(t,e,n,r,o,i,u,a){var c=es(u,"maxHeightFunction",Zc()),s=es(u,"maxWidthFunction",h),l=t.anchorBox,f=t.origin,d={bounds:Ec(f,i),origin:f,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:a};return ns(l,e,n,d)}(Nc(n.anchorBox,e),o.element,n.bubble,n.layouts,i,r,n.overrides,u)},bl=function(t,e,n,r,o,i){var u=i.map(En);return yl(t,e,n,r,o,u)},yl=function(t,e,n,r,o,i){var u=Rr("placement.info",mr(pl),o),a=u.anchor,c=r.element,s=n.get(r.uid);xc((function(){Fe(c,"position","fixed");var o=qe(c,"visibility");Fe(c,"visibility","hidden");var l,f=e.useFixed()?(l=document.documentElement,Rc(0,0,l.clientWidth,l.clientHeight)):function(t){var e=rn(t.element),n=t.element.dom.getBoundingClientRect();return Mc(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(vl)(t,f,e,m,r,s,u.transition);n.set(r.uid,o)})),o.fold((function(){Xe(c,"visibility")}),(function(t){Fe(c,"visibility",t)})),qe(c,"left").isNone()&&qe(c,"top").isNone()&&qe(c,"right").isNone()&&qe(c,"bottom").isNone()&&Ct(qe(c,"position"),"fixed")&&Xe(c,"position")}),c)},wl=Object.freeze({__proto__:null,position:function(t,e,n,r,o){bl(t,e,n,r,o,z.none())},positionWithin:bl,positionWithinBounds:yl,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"},reset:function(t,e,n,r){var o=r.element;W(["position","left","right","top","bottom"],(function(t){return Xe(o,t)})),function(t){Ie(t,"data-alloy-placement")}(o),n.clear(r.uid)}}),xl=Object.freeze({__proto__:null,init:function(){var t={};return lu({readState:function(){return t},clear:function(e){f(e)?delete t[e]:t={}},set:function(e,n){t[e]=n},get:function(e){return yt(t,e)}})}}),Cl=lc({fields:hl,name:"positioning",active:hc,apis:wl,state:xl}),Sl=function(t){bi(t,si());var e=t.components();W(e,Sl)},kl=function(t){var e=t.components();W(e,kl),bi(t,ci())},Ol=function(t,e){hn(t.element,e.element)},_l=function(t,e){var n=t.components();!function(t){W(t.components(),(function(t){return bn(t.element)})),vn(t.element),t.syncComponents()}(t);var r=et(n,e);W(r,(function(e){Sl(e),t.getSystem().removeFromWorld(e)})),W(e,(function(e){e.getSystem().isConnected()?Ol(t,e):(t.getSystem().addToWorld(e),Ol(t,e),Ae(t.element)&&kl(e)),t.syncComponents()}))},Tl=function(t,e){El(t,e,hn)},El=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),Ae(t.element)&&kl(e),t.syncComponents()},Al=function(t){Sl(t),bn(t.element),t.getSystem().removeFromWorld(t)},Dl=function(t){var e=he(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));Al(t),e.each((function(t){t.syncComponents()}))},Ml=function(t){var e=t.components();W(e,Al),vn(t.element),t.syncComponents()},Rl=function(t,e){Nl(t,e,hn)},Nl=function(t,e,n){n(t,e.element);var r=ve(e.element);W(r,(function(t){e.getByDom(t).each(kl)}))},zl=function(t){var e=ve(t.element);W(e,(function(e){t.getByDom(e).each(Sl)})),bn(t.element)},Bl=function(t,e,n,r){n.get().each((function(e){Ml(t)}));var o=e.getAttachPoint(t);Tl(o,t);var i=t.getSystem().build(r);return Tl(t,i),n.set(i),i},Pl=function(t,e,n,r){var o=Bl(t,e,n,r);return e.onOpen(t,o),o},Il=function(t,e,n){n.get().each((function(r){Ml(t),Dl(t),e.onClose(t,r),n.clear()}))},Ll=function(t,e,n){return n.isOpen()},Hl=function(t,e,n){var r=e.getAttachPoint(t);Fe(t.element,"position",Cl.getMode(r)),function(t,e,n,r){qe(t.element,e).fold((function(){Ie(t.element,n)}),(function(e){Ne(t.element,n,e)})),Fe(t.element,e,r)}(t,"visibility",e.cloakVisibilityAttr,"hidden")},Fl=function(t,e,n){(function(t){return F(["top","left","right","bottom"],(function(e){return qe(t,e).isSome()}))})(t.element)||Xe(t.element,"position"),function(t,e,n){Be(t.element,n).fold((function(){return Xe(t.element,e)}),(function(n){return Fe(t.element,e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},Vl=Object.freeze({__proto__:null,cloak:Hl,decloak:Fl,open:Pl,openWhileCloaked:function(t,e,n,r,o){Hl(t,e),Pl(t,e,n,r),o(),Fl(t,e)},close:Il,isOpen:Ll,isPartOf:function(t,e,n,r){return Ll(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 Bl(t,e,n,r)}))}}),jl=Object.freeze({__proto__:null,events:function(t,e){return ki([Ti(ei(),(function(n,r){Il(n,t,e)}))])}}),Ul=[pa("onOpen"),pa("onClose"),Lr("isPartOf"),Lr("getAttachPoint"),to("cloakVisibilityAttr","data-precloak-visibility")],Wl=lc({fields:Ul,name:"sandboxing",active:jl,apis:Vl,state:Object.freeze({__proto__:null,init:function(){var t=Hc(),e=v("not-implemented");return lu({readState:e,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}})}),ql=v("dismiss.popups"),Gl=v("reposition.popups"),$l=v("mouse.released"),Xl=dr([to("isExtraPart",S),Zr("fireEventInstead",[to("event",li())])]),Kl=function(t){var e,n=Rr("Dismissal",Xl,t);return(e={})[ql()]={schema:dr([Lr("target")]),onReceive:function(t,e){Wl.isOpen(t)&&(Wl.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return Wl.close(t)}),(function(e){return bi(t,e.event)})))}},e},Yl=dr([Zr("fireEventInstead",[to("event",fi())]),Ur("doReposition")]),Jl=function(t){var e,n=Rr("Reposition",Yl,t);return(e={})[Gl()]={onReceive:function(t){Wl.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return bi(t,e.event)}))}},e},Ql=function(t,e,n){e.store.manager.onLoad(t,e,n)},Zl=function(t,e,n){e.store.manager.onUnload(t,e,n)},tf=Object.freeze({__proto__:null,onLoad:Ql,onUnload:Zl,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}}),ef=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[Bi((function(n,r){Ql(n,t,e)})),Pi((function(n,r){Zl(n,t,e)}))]:[oc(t,e,Ql)];return ki(n)}}),nf=function(){var t=so(null);return lu({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},rf=function(){var t=so({}),e=so({});return lu({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return yt(t.get(),n).orThunk((function(){return yt(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},u={};W(n,(function(t){i[t.value]=t,yt(t,"meta").each((function(e){yt(e,"text").each((function(e){u[e]=t}))}))})),t.set(_(_({},r),i)),e.set(_(_({},o),u))},clear:function(){t.set({}),e.set({})}})},of=Object.freeze({__proto__:null,memory:nf,dataset:rf,manual:function(){return lu({readState:h})},init:function(t){return t.store.manager.state(t)}}),uf=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},af=[$r("initialValue"),Lr("getFallbackEntry"),Lr("getDataKey"),Lr("setValue"),wa("manager",{setValue:uf,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){uf(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:rf})],cf=[Lr("getValue"),to("setValue",h),$r("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:su.init})],sf=[$r("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:nf})],lf=[eo("store",{mode:"memory"},zr("mode",{memory:sf,manual:cf,dataset:af})),pa("onSetValue"),to("resetOnDom",!1)],ff=lc({fields:lf,name:"representing",active:ef,apis:tf,extra:{setValueFrom:function(t,e){var n=ff.getValue(e);ff.setValue(t,n)}},state:of}),df=function(t,e){return co(t,{},U(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,Br(n,n,{tag:"option",process:{}},ir((function(t){return Vn("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([Pr("dump",b)]))},mf=function(t){return t.dump},gf=function(t,e){return _(_({},cc(e)),t.dump)},hf=df,pf=gf,vf=lo([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),bf=function(t){return wt(t,"uiType")},yf=function(t,e,n,r){return bf(n)&&"placeholder"===n.uiType?function(t,e,n,r){return t.exists((function(t){return t!==n.owner}))?vf.single(!0,v(n)):yt(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+lt(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,r):vf.single(!1,v(n))},wf=function(t,e,n,r){return yf(t,0,n,r).fold((function(o,i){var u=bf(n)?i(e,n.config,n.validated):i(e),a=yt(u,"components").getOr([]),c=Q(a,(function(n){return wf(t,e,n,r)}));return[_(_({},u),{components:c})]}),(function(t,r){if(bf(n)){var o=r(e,n.config,n.validated);return n.validated.preprocess.getOr(b)(o)}return r(e)}))},xf=function(t,e,n,r){var o=mt(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 Q(n,(function(n){return wf(t,e,n,r)}))}(t,e,n,o);return dt(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},Cf=vf.single,Sf=vf.multiple,kf=v("placeholder"),Of=lo([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),_f=to("factory",{sketch:b}),Tf=to("schema",[]),Ef=Lr("name"),Af=Br("pname","pname",Qn((function(t){return"<alloy."+$i(t.name)+">"})),br()),Df=Pr("schema",(function(){return[$r("preprocess")]})),Mf=to("defaults",v({})),Rf=to("overrides",v({})),Nf=mr([_f,Tf,Ef,Af,Mf,Rf]),zf=mr([_f,Tf,Ef,Mf,Rf]),Bf=mr([_f,Tf,Ef,Af,Mf,Rf]),Pf=mr([_f,Df,Ef,Lr("unit"),Af,Mf,Rf]),If=function(t){return t.fold(z.some,z.none,z.some,z.some)},Lf=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Hf=function(t,e){return function(n){var r=Rr("Converting part type",e,n);return t(r)}},Ff=Hf(Of.required,Nf),Vf=Hf(Of.external,zf),jf=Hf(Of.optional,Bf),Uf=Hf(Of.group,Pf),Wf=v("entirety"),qf=Object.freeze({__proto__:null,required:Ff,external:Vf,optional:jf,group:Uf,asNamedPart:If,name:Lf,asCommon:function(t){return t.fold(b,b,b,b)},original:Wf}),Gf=function(t,e,n,r){return Yn(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},$f=function(t,e){var n={};return W(e,(function(e){If(e).each((function(e){var r=Xf(t,e.pname);n[e.name]=function(n){var o=Rr("Part: "+e.name+" in "+t,mr(e.schema),n);return _(_({},r),{config:n,validated:o})}}))})),n},Xf=function(t,e){return{uiType:kf(),owner:t,name:e}},Kf=function(t,e,n){return{uiType:kf(),owner:t,name:e,config:n,validated:{}}},Yf=function(t){return Q(t,(function(t){return t.fold(z.none,z.some,z.none,z.none).map((function(t){return Wr(t.name,t.schema.concat([xa(Wf())]))})).toArray()}))},Jf=function(t){return U(t,Lf)},Qf=function(t,e,n){return function(t,e,n){var r={},o={};return W(n,(function(t){t.fold((function(t){r[t.pname]=Cf(!0,(function(e,n,r){return t.factory.sketch(Gf(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=v(t.factory.sketch(Gf(e,t,n[Wf()]),n))}),(function(t){r[t.pname]=Cf(!1,(function(e,n,r){return t.factory.sketch(Gf(e,t,n,r))}))}),(function(t){r[t.pname]=Sf(!0,(function(e,n,r){var o=e[t.name];return U(o,(function(n){return t.factory.sketch(Yn(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:v(r),externals:v(o)}}(0,e,n)},Zf=function(t,e,n){return xf(z.some(t),e,e.components,n)},td=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},ed=function(t,e,n){return td(t,e,n).getOrDie("Could not find part: "+n)},nd=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return W(n,(function(t){r[t]=v(i.getByUid(o[t]))})),r},rd=function(t,e){var n=t.getSystem();return mt(e.partUids,(function(t,e){return v(n.getByUid(t))}))},od=function(t){return lt(t.partUids)},id=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return W(n,(function(t){r[t]=v(i.getByUid(o[t]).getOrDie())})),r},ud=function(t,e){var n=Jf(e);return ho(U(n,(function(e){return{key:e,value:t+"-"+e}})))},ad=function(t){return Br("partUids","partUids",tr((function(e){return ud(e.uid,t)})),br())},cd=Object.freeze({__proto__:null,generate:$f,generateOne:Kf,schemas:Yf,names:Jf,substitutes:Qf,components:Zf,defaultUids:ud,defaultUidsSchema:ad,getAllParts:rd,getAllPartNames:od,getPart:td,getPartOrDie:ed,getParts:nd,getPartsOrDie:id}),sd=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[Wr("parts",t)]:[]).concat([Lr("uid"),to("dom",{}),to("components",[]),xa("originalSpec"),to("debug.sketcher",{})]).concat(e)}(r,o);return Rr(t+" [SpecSchema]",dr(i.concat(e)),n)},ld=function(t,e,n,r,o){var i=fd(o),u=Yf(n),a=ad(n),c=sd(t,e,i,u,[a]),s=Qf(0,c,n);return r(c,Zf(t,c,s.internals()),i,s.externals())},fd=function(t){return function(t){return wt(t,"uid")}(t)?t:_(_({},t),{uid:tu("uid")})},dd=dr([Lr("name"),Lr("factory"),Lr("configFields"),to("apis",{}),to("extraApis",{})]),md=dr([Lr("name"),Lr("factory"),Lr("configFields"),Lr("partFields"),to("apis",{}),to("extraApis",{})]),gd=function(t){var e=Rr("Sketcher for "+t.name,dd,t),n=mt(e.apis,cu),r=mt(e.extraApis,(function(t,e){return iu(t,e)}));return _(_({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=fd(r);return n(sd(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},hd=function(t){var e=Rr("Sketcher for "+t.name,md,t),n=$f(e.name,e.partFields),r=mt(e.apis,cu),o=mt(e.extraApis,(function(t,e){return iu(t,e)}));return _(_({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return ld(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},pd=function(t){return"input"===Pt(t)&&"radio"!==ze(t,"type")||"textarea"===Pt(t)},vd=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),bd=[Lr("find")],yd=lc({fields:bd,name:"composing",apis:vd}),wd=["input","button","textarea","select"],xd=function(t,e,n){(e.disabled()?Td:Ed)(t,e)},Cd=function(t,e){return!0===e.useNative&&H(wd,Pt(t.element))},Sd=function(t){Ne(t.element,"disabled","disabled")},kd=function(t){Ie(t.element,"disabled")},Od=function(t){Ne(t.element,"aria-disabled","true")},_d=function(t){Ne(t.element,"aria-disabled","false")},Td=function(t,e,n){e.disableClass.each((function(e){_u(t.element,e)})),(Cd(t,e)?Sd:Od)(t),e.onDisabled(t)},Ed=function(t,e,n){e.disableClass.each((function(e){Eu(t.element,e)})),(Cd(t,e)?kd:_d)(t),e.onEnabled(t)},Ad=function(t,e){return Cd(t,e)?function(t){return Pe(t.element,"disabled")}(t):function(t){return"true"===ze(t.element,"aria-disabled")}(t)},Dd=Object.freeze({__proto__:null,enable:Ed,disable:Td,isDisabled:Ad,onLoad:xd,set:function(t,e,n,r){(r?Td:Ed)(t,e)}}),Md=Object.freeze({__proto__:null,exhibit:function(t,e){return du({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return ki([Oi(Jo(),(function(e,n){return Ad(e,t)})),oc(t,e,xd)])}}),Rd=[uo("disabled",S),to("useNative",!0),$r("disableClass"),pa("onDisabled"),pa("onEnabled")],Nd=lc({fields:Rd,name:"disabling",active:Md,apis:Dd}),zd=function(t,e,n,r){var o=Ws(t.element,"."+e.highlightClass);W(o,(function(n){F(r,(function(t){return t.element===n}))||(Eu(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),bi(n,vi())})))}))},Bd=function(t,e,n,r){zd(t,e,0,[r]),Pd(t,e,n,r)||(_u(r.element,e.highlightClass),e.onHighlight(t,r),bi(r,pi()))},Pd=function(t,e,n,r){return Au(r.element,e.highlightClass)},Id=function(t,e,n,r){var o=Ws(t.element,"."+e.itemClass);return z.from(o[r]).fold((function(){return Nn.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},Ld=function(t,e,n){return Zu(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Hd=function(t,e,n){var r=Ws(t.element,"."+e.itemClass);return(r.length>0?z.some(r[r.length-1]):z.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Fd=function(t,e,n,r){var o=Ws(t.element,"."+e.itemClass);return Y(o,(function(t){return Au(t,e.highlightClass)})).bind((function(e){var n=Na(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},Vd=function(t,e,n){var r=Ws(t.element,"."+e.itemClass);return St(U(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},jd=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return zd(t,e,0,[])},dehighlight:function(t,e,n,r){Pd(t,e,n,r)&&(Eu(r.element,e.highlightClass),e.onDehighlight(t,r),bi(r,vi()))},highlight:Bd,highlightFirst:function(t,e,n){Ld(t,e).each((function(r){Bd(t,e,n,r)}))},highlightLast:function(t,e,n){Hd(t,e).each((function(r){Bd(t,e,n,r)}))},highlightAt:function(t,e,n,r){Id(t,e,n,r).fold((function(t){throw t}),(function(r){Bd(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=Vd(t,e);K(o,r).each((function(r){Bd(t,e,n,r)}))},isHighlighted:Pd,getHighlighted:function(t,e,n){return Zu(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:Ld,getLast:Hd,getPrevious:function(t,e,n){return Fd(t,e,0,-1)},getNext:function(t,e,n){return Fd(t,e,0,1)},getCandidates:Vd}),Ud=[Lr("highlightClass"),Lr("itemClass"),pa("onHighlight"),pa("onDehighlight")],Wd=lc({fields:Ud,name:"highlighting",apis:jd}),qd=[8],Gd=[9],$d=[13],Xd=[27],Kd=[32],Yd=[37],Jd=[38],Qd=[39],Zd=[40],tm=function(t,e,n){var r=tt(t.slice(0,e)),o=tt(t.slice(e+1));return K(r.concat(o),n)},em=function(t,e,n){var r=tt(t.slice(0,e));return K(r,n)},nm=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return K(o.concat(r),n)},rm=function(t,e,n){var r=t.slice(e+1);return K(r,n)},om=function(t){return function(e){var n=e.raw;return H(t,n.which)}},im=function(t){return function(e){return Z(t,(function(t){return t(e)}))}},um=function(t){return!0===t.raw.shiftKey},am=function(t){return!0===t.raw.ctrlKey},cm=x(um),sm=function(t,e){return{matches:t,classification:e}},lm=function(t,e,n){e.exists((function(t){return n.exists((function(e){return ce(e,t)}))}))||yi(t,di(),{prevFocus:e,newFocus:n})},fm=function(){var t=function(t){return wc(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);lm(e,r,o)}}},dm=function(){var t=function(t){return Wd.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){Wd.highlight(e,t)}));var o=t(e);lm(e,r,o)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Ls||(Ls={}));var mm,gm=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,K(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([to("focusManager",fm()),eo("focusInside","onFocus",Er((function(t){return H(["onFocus","onEnterOrSpace","onApi"],t)?Nn.value(t):Nn.error("Invalid value for focusInside")}))),wa("handler",u),wa("state",e),wa("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var u=t.focusInside!==Ls.OnFocusMode?z.none():o(t).map((function(n){return Ti($o(),(function(r,o){n(r,t,e),o.stop()}))})),a=[Ti(Po(),(function(r,u){i(r,u,n,t,e).fold((function(){!function(n,r){var i=om(Kd.concat($d))(r.event);t.focusInside===Ls.OnEnterOrSpaceMode&&i&&wo(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,u)}),(function(t){u.stop()}))})),Ti(Io(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return ki(u.toArray().concat(a))}};return u},hm=function(t){var e=[$r("onEscape"),$r("onEnter"),to("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),to("firstTabstop",0),to("useTabstopAt",k),$r("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return ta(e,t)})).getOr(e);return Qe(n)>0},r=function(t,e,r){(function(t,e){var r=Ws(t.element,e.selector),o=G(r,(function(t){return n(e,t)}));return z.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?z.some(!0):z.none()}),(function(e){return o.focusManager.set(t,e),z.some(!0)}))},i=function(t,e,n,r){var i=Ws(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 Y(i,w(ce,e)).bind((function(e){return o(t,i,e,n,r)}))}))},u=v([sm(im([um,om(Gd)]),(function(t,e,n){var r=n.cyclic?tm:em;return i(t,0,n,r)})),sm(om(Gd),(function(t,e,n){var r=n.cyclic?nm:rm;return i(t,0,n,r)})),sm(om(Xd),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),sm(im([cm,om($d)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),a=v([]);return gm(e,su.init,u,a,(function(){return z.some(r)}))},pm=hm(Pr("cyclic",S)),vm=hm(Pr("cyclic",k)),bm=function(t,e,n){return pd(n)&&om(Kd)(e.event)?z.none():function(t,e,n){return xi(t,n,Jo()),z.some(!0)}(t,0,n)},ym=function(t,e){return z.some(!0)},wm=[to("execute",bm),to("useSpace",!1),to("useEnter",!0),to("useControlEnter",!1),to("useDown",!1)],xm=function(t,e,n){return n.execute(t,e,t.element)},Cm=gm(wm,su.init,(function(t,e,n,r){var o=n.useSpace&&!pd(t.element)?Kd:[],i=n.useEnter?$d:[],u=n.useDown?Zd:[],a=o.concat(i).concat(u);return[sm(om(a),xm)].concat(n.useControlEnter?[sm(im([am,om($d)]),xm)]:[])}),(function(t,e,n,r){return n.useSpace&&!pd(t.element)?[sm(om(Kd),ym)]:[]}),(function(){return z.none()})),Sm=function(){var t=Hc();return lu({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}))}})},km=Object.freeze({__proto__:null,flatgrid:Sm,init:function(t){return t.state(t)}}),Om=function(t){return function(e,n,r,o){var i=t(e.element);return Am(i,e,n,r,o)}},_m=function(t,e){var n=as(t,e);return Om(n)},Tm=function(t,e){var n=as(e,t);return Om(n)},Em=function(t){return function(e,n,r,o){return Am(t,e,n,r,o)}},Am=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}))},Dm=Em,Mm=Em,Rm=Em,Nm=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},zm=function(t,e,n){var r=Ws(t,n);return function(t,e){return Y(t,e).map((function(e){return{index:e,candidates:t}}))}(G(r,Nm),(function(t){return ce(t,e)}))},Bm=function(t,e){return Y(t,(function(t){return ce(e,t)}))},Pm=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?z.some(t[r]):z.none()}))},Im=function(t,e,n,r,o){return Pm(t,e,r,(function(e,i){var u=e===n-1?t.length-e*r:r,a=Na(i,o,0,u-1);return z.some({row:e,column:a})}))},Lm=function(t,e,n,r,o){return Pm(t,e,r,(function(e,i){var u=Na(e,o,0,n-1),a=u===n-1?t.length-u*r:r,c=za(i,0,a-1);return z.some({row:u,column:c})}))},Hm=[Lr("selector"),to("execute",bm),va("onEscape"),to("captureTab",!1),Ca()],Fm=function(t,e,n){Zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Vm=function(t){return function(e,n,r,o){return zm(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))}))}},jm=function(t,e,n){return n.captureTab?z.some(!0):z.none()},Um=Vm((function(t,e,n,r){return Im(t,e,n,r,-1)})),Wm=Vm((function(t,e,n,r){return Im(t,e,n,r,1)})),qm=Vm((function(t,e,n,r){return Lm(t,e,n,r,-1)})),Gm=Vm((function(t,e,n,r){return Lm(t,e,n,r,1)})),$m=v([sm(om(Yd),_m(Um,Wm)),sm(om(Qd),Tm(Um,Wm)),sm(om(Jd),Dm(qm)),sm(om(Zd),Mm(Gm)),sm(im([um,om(Gd)]),jm),sm(im([cm,om(Gd)]),jm),sm(om(Xd),(function(t,e,n){return n.onEscape(t,e)})),sm(om(Kd.concat($d)),(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)}))}))]),Xm=v([sm(om(Kd),ym)]),Km=gm(Hm,Sm,$m,Xm,(function(){return z.some(Fm)})),Ym=function(t,e,n,r){var o=function(t,e,n){var i,u=Na(e,r,0,n.length-1);return u===t?z.none():(i=n[u],"button"===Pt(i)&&"disabled"===ze(i,"disabled")?o(t,u,n):z.from(n[u]))};return zm(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},Jm=[Lr("selector"),to("getInitial",z.none),to("execute",bm),va("onEscape"),to("executeOnMove",!1),to("allowVertical",!0)],Qm=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)}))},Zm=function(t,e,n){e.getInitial(t).orThunk((function(){return Zu(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},tg=function(t,e,n){return Ym(t,n.selector,e,-1)},eg=function(t,e,n){return Ym(t,n.selector,e,1)},ng=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?Qm(e,n,r):z.some(!0)}))}},rg=function(t,e,n){return n.onEscape(t,e)},og=v([sm(om(Kd),ym)]),ig=gm(Jm,su.init,(function(t,e,n,r){var o=Yd.concat(n.allowVertical?Jd:[]),i=Qd.concat(n.allowVertical?Zd:[]);return[sm(om(o),ng(_m(tg,eg))),sm(om(i),ng(Tm(tg,eg))),sm(om($d),Qm),sm(om(Kd),Qm),sm(om(Xd),rg)]}),og,(function(){return z.some(Zm)})),ug=function(t,e,n){return z.from(t[e]).bind((function(t){return z.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},ag=function(t,e,n,r){var o=t[e].length,i=Na(n,r,0,o-1);return ug(t,e,i)},cg=function(t,e,n,r){var o=Na(n,r,0,t.length-1),i=t[o].length,u=za(e,0,i-1);return ug(t,o,u)},sg=function(t,e,n,r){var o=t[e].length,i=za(n+r,0,o-1);return ug(t,e,i)},lg=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 ug(t,o,u)},fg=[Wr("selectors",[Lr("row"),Lr("cell")]),to("cycles",!0),to("previousSelector",z.none),to("execute",bm)],dg=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)}))},mg=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=Ws(t,o.selectors.cell);return Bm(e,r).bind((function(e){var r=Ws(n,o.selectors.row);return Bm(r,t).bind((function(t){var n=function(t,e){return U(t,(function(t){return Ws(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},gg=mg((function(t,e,n){return ag(t,e,n,-1)}),(function(t,e,n){return sg(t,e,n,-1)})),hg=mg((function(t,e,n){return ag(t,e,n,1)}),(function(t,e,n){return sg(t,e,n,1)})),pg=mg((function(t,e,n){return cg(t,n,e,-1)}),(function(t,e,n){return lg(t,n,e,-1)})),vg=mg((function(t,e,n){return cg(t,n,e,1)}),(function(t,e,n){return lg(t,n,e,1)})),bg=v([sm(om(Yd),_m(gg,hg)),sm(om(Qd),Tm(gg,hg)),sm(om(Jd),Dm(pg)),sm(om(Zd),Mm(vg)),sm(om(Kd.concat($d)),(function(t,e,n){return wc(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),yg=v([sm(om(Kd),ym)]),wg=gm(fg,su.init,bg,yg,(function(){return z.some(dg)})),xg=[Lr("selector"),to("execute",bm),to("moveOnTab",!1)],Cg=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},Sg=function(t,e,n){Zu(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},kg=function(t,e,n){return Ym(t,n.selector,e,-1)},Og=function(t,e,n){return Ym(t,n.selector,e,1)},_g=v([sm(om(Jd),Rm(kg)),sm(om(Zd),Rm(Og)),sm(im([um,om(Gd)]),(function(t,e,n,r){return n.moveOnTab?Rm(kg)(t,e,n,r):z.none()})),sm(im([cm,om(Gd)]),(function(t,e,n,r){return n.moveOnTab?Rm(Og)(t,e,n,r):z.none()})),sm(om($d),Cg),sm(om(Kd),Cg)]),Tg=v([sm(om(Kd),ym)]),Eg=gm(xg,su.init,_g,Tg,(function(){return z.some(Sg)})),Ag=[va("onSpace"),va("onEnter"),va("onShiftEnter"),va("onLeft"),va("onRight"),va("onTab"),va("onShiftTab"),va("onUp"),va("onDown"),va("onEscape"),to("stopSpaceKeyup",!1),$r("focusIn")],Dg=gm(Ag,su.init,(function(t,e,n){return[sm(om(Kd),n.onSpace),sm(im([cm,om($d)]),n.onEnter),sm(im([um,om($d)]),n.onShiftEnter),sm(im([um,om(Gd)]),n.onShiftTab),sm(im([cm,om(Gd)]),n.onTab),sm(om(Jd),n.onUp),sm(om(Zd),n.onDown),sm(om(Yd),n.onLeft),sm(om(Qd),n.onRight),sm(om(Kd),n.onSpace),sm(om(Xd),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[sm(om(Kd),ym)]:[]}),(function(t){return t.focusIn})),Mg=pm.schema(),Rg=vm.schema(),Ng=ig.schema(),zg=Km.schema(),Bg=wg.schema(),Pg=Cm.schema(),Ig=Eg.schema(),Lg=Dg.schema(),Hg=dc({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Mg,cyclic:Rg,flow:Ng,flatgrid:zg,matrix:Bg,execution:Pg,menu:Ig,special:Lg}),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 xt(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:km}),Fg=function(t,e,n,r){var o=t.getSystem().build(r);El(t,o,n)},Vg=function(t,e,n,r){var o=jg(t);K(o,(function(t){return ce(r.element,t.element)})).each(Dl)},jg=function(t,e){return t.components()},Ug=function(t,e,n,r,o){var i=jg(t);return z.from(i[r]).map((function(e){return Vg(t,0,0,e),o.each((function(e){Fg(t,0,(function(t,e){!function(t,e,n){be(t,n).fold((function(){hn(t,e)}),(function(t){dn(t,e)}))}(t,e,r)}),e)})),e}))},Wg=lc({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){Fg(t,0,hn,r)},prepend:function(t,e,n,r){Fg(t,0,gn,r)},remove:Vg,replaceAt:Ug,replaceBy:function(t,e,n,r,o){var i=jg(t);return Y(i,r).bind((function(e){return Ug(t,0,0,e,o)}))},set:function(t,e,n,r){xc((function(){var e=U(r,t.getSystem().build);_l(t,e)}),t.element)},contents:jg})}),qg=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=ki(e);return lc({fields:[Lr("enabled")],name:t,active:{events:v(n)}})}(t,e),configAsRaw:v({}),initialConfig:{},state:su}}},Gg=function(t,e){e.ignore||(vc(t.element),e.onFocus(t))},$g=Object.freeze({__proto__:null,focus:Gg,blur:function(t,e){e.ignore||function(t){t.dom.blur()}(t.element)},isFocused:function(t){return bc(t.element)}}),Xg=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return du(n)},events:function(t){return ki([Ti($o(),(function(e,n){Gg(e,t),n.stop()}))].concat(t.stopMousedown?[Ti(Ao(),(function(t,e){e.event.prevent()}))]:[]))}}),Kg=[pa("onFocus"),to("stopMousedown",!1),to("ignore",!1)],Yg=lc({fields:Kg,name:"focusing",active:Xg,apis:$g}),Jg=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},Qg=function(t,e,n){e.toggleClass.each((function(e){n.get()?_u(t.element,e):Eu(t.element,e)}))},Zg=function(t,e,n){nh(t,e,n,!n.get())},th=function(t,e,n){n.set(!0),Qg(t,e,n),Jg(t,e,n)},eh=function(t,e,n){n.set(!1),Qg(t,e,n),Jg(t,e,n)},nh=function(t,e,n,r){(r?th:eh)(t,e,n)},rh=function(t,e,n){nh(t,e,n,e.selected)},oh=Object.freeze({__proto__:null,onLoad:rh,toggle:Zg,isOn:function(t,e,n){return n.get()},on:th,off:eh,set:nh}),ih=Object.freeze({__proto__:null,exhibit:function(){return du({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=Zg,Li((function(t){o(t,n,r)}))),u=oc(t,e,rh);return ki(J([t.toggleOnExecute?[i]:[],[u]]))}}),uh=function(t,e,n){Ne(t.element,"aria-expanded",n)},ah=[to("selected",!1),$r("toggleClass"),to("toggleOnExecute",!0),eo("aria",{mode:"none"},zr("mode",{pressed:[to("syncWithExpanded",!1),wa("update",(function(t,e,n){Ne(t.element,"aria-pressed",n),e.syncWithExpanded&&uh(t,e,n)}))],checked:[wa("update",(function(t,e,n){Ne(t.element,"aria-checked",n)}))],expanded:[wa("update",uh)],selected:[wa("update",(function(t,e,n){Ne(t.element,"aria-selected",n)}))],none:[wa("update",h)]}))],ch=lc({fields:ah,name:"toggling",active:ih,apis:oh,state:(mm=!1,{init:function(){var t=so(mm);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(mm)},readState:function(){return t.get()}}}})}),sh=function(){var t=function(t,e){e.stop(),wi(t)};return[Ti(Fo(),t),Ti(Zo(),t),Ri(Oo()),Ri(Ao())]},lh=function(t){return ki(J([t.map((function(t){return Li((function(e,n){t(e),n.stop()}))})).toArray(),sh()]))},fh=function(t){(wc(t.element).isNone()||Yg.isFocused(t))&&(Yg.isFocused(t)||Yg.focus(t),yi(t,"alloy.item-hover",{item:t}))},dh=function(t){yi(t,"alloy.item-focus",{item:t})},mh=v("alloy.item-hover"),gh=v("alloy.item-focus"),hh=[Lr("data"),Lr("components"),Lr("dom"),to("hasSubmenu",!1),$r("toggling"),hf("itemBehaviours",[ch,Yg,Hg,ff]),to("ignoreFocus",!1),to("domModification",{}),wa("builder",(function(t){return{dom:t.dom,domModification:_(_({},t.domModification),{attributes:_(_(_({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:pf(t.itemBehaviours,[t.toggling.fold(ch.revoke,(function(t){return ch.config(_({aria:{mode:"checked"}},t))})),Yg.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){dh(t)}}),Hg.config({mode:"execution"}),ff.config({store:{mode:"memory",initialValue:t.data}}),qg("item-type-events",E(E([],sh(),!0),[Ti(No(),fh),Ti(Qo(),Yg.focus)],!1))]),components:t.components,eventOrder:t.eventOrder}})),to("eventOrder",{})],ph=[Lr("dom"),Lr("components"),wa("builder",(function(t){return{dom:t.dom,components:t.components,events:ki([Ni(Qo())])}}))],vh=v("item-widget"),bh=v([Ff({name:"widget",overrides:function(t){return{behaviours:cc([ff.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:h}})])}}})]),yh=[Lr("uid"),Lr("data"),Lr("components"),Lr("dom"),to("autofocus",!1),to("ignoreFocus",!1),hf("widgetBehaviours",[ff,Yg,Hg]),to("domModification",{}),ad(bh()),wa("builder",(function(t){var e=Qf(vh(),t,bh()),n=Zf(vh(),t,e.internals()),r=function(e){return td(e,t,"widget").map((function(t){return Hg.focusIn(t),t}))},o=function(e,n){return pd(n.event.target)?z.none():t.autofocus?(n.setSource(e.element),z.none()):z.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:ki([Li((function(t,e){r(t).each((function(t){e.stop()}))})),Ti(No(),fh),Ti(Qo(),(function(e,n){t.autofocus?r(e):Yg.focus(e)}))]),behaviours:pf(t.widgetBehaviours,[ff.config({store:{mode:"memory",initialValue:t.data}}),Yg.config({ignore:t.ignoreFocus,onFocus:function(t){dh(t)}}),Hg.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:mc(),onLeft:o,onRight:o,onEscape:function(e,n){return Yg.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),z.none()):z.none():(Yg.focus(e),z.some(!0))}})])}}))],wh=zr("type",{widget:yh,item:hh,separator:ph}),xh=v([Uf({factory:{sketch:function(t){var e=Rr("menu.spec item",wh,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return wt(e,"uid")?e:_(_({},e),{uid:tu("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Ch=v([Lr("value"),Lr("items"),Lr("dom"),Lr("components"),to("eventOrder",{}),df("menuBehaviours",[Wd,ff,yd,Hg]),eo("movement",{mode:"menu",moveOnTab:!0},zr("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}})),Lr("rowSelector")],menu:[to("moveOnTab",!0),wa("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Hr("markers",fa()),to("fakeFocus",!1),to("focusManager",fm()),pa("onHighlight")]),Sh=v("alloy.menu-focus"),kh=hd({name:"Menu",configFields:Ch(),partFields:xh(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:gf(t.menuBehaviours,[Wd.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),ff.config({store:{mode:"memory",initialValue:t.value}}),yd.config({find:z.some}),Hg.config(t.movement.config(t,t.movement))]),events:ki([Ti(gh(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){Wd.highlight(t,n),e.stop(),yi(t,Sh(),{menu:t,item:n})}))})),Ti(mh(),(function(t,e){var n=e.event.item;Wd.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Oh=function(t,e,n,r){return yt(n,r).bind((function(r){return yt(t,r).bind((function(r){var o=Oh(t,e,n,r);return z.some([r].concat(o))}))})).getOr([])},_h=function(t,e){var n={};dt(t,(function(t,e){W(t,(function(t){n[t]=e}))}));var r=e,o=gt(e,(function(t,e){return{k:t,v:e}})),i=mt(o,(function(t,e){return[e].concat(Oh(n,r,o,e))}));return mt(n,(function(t){return yt(i,t).getOr([t])}))},Th=function(t){return"prepared"===t.type?z.some(t.menu):z.none()},Eh={init:function(){var t=so({}),e=so({}),n=so({}),r=Hc(),o=so({}),i=function(e,n,r){return u(e).bind((function(o){return function(e){return vt(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 yt(e.get(),t)},c=function(e){return yt(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(_(_({},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=_h(c,a);n.set(s)},expand:function(e){return yt(t.get(),e).map((function(t){var r=yt(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return yt(n.get(),t)},collapse:function(t){return yt(n.get(),t).bind((function(t){return t.length>1?z.some(t.slice(1)):z.none()}))},lookupMenu:a,lookupItem:c,otherMenus:function(t){var e=o.get();return et(lt(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=G(c(t).toArray(),(function(t){return u(t).isSome()}));return yt(n.get(),t).bind((function(t){var n=tt(o.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return z.none();e.push(r.getOrDie())}return z.some(e)}(Q(n,(function(t,o){return i(t,e,n.slice(0,o+1)).fold((function(){return Ct(r.get(),t)?[]:[z.none()]}),(function(t){return[z.some(t)]}))})))}))}}},extractPreparedMenu:Th},Ah=v("collapse-item"),Dh=gd({name:"TieredMenu",configFields:[ya("onExecute"),ya("onEscape"),ba("onOpenMenu"),ba("onOpenSubmenu"),pa("onRepositionMenu"),pa("onCollapseMenu"),to("highlightImmediately",!0),Wr("data",[Lr("primary"),Lr("menus"),Lr("expansions")]),to("fakeFocus",!1),pa("onHighlight"),pa("onHover"),ma(),Lr("dom"),to("navigateOnHover",!0),to("stayInDom",!1),df("tmenuBehaviours",[Hg,Wd,yd,Wg]),to("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=Hc(),o=Eh.init(),i=function(e){var n=function(e,n,r){return mt(r,(function(r,o){var i=function(){return kh.sketch(_(_({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?dm():fm()}))};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 ff.getValue(t).value},a=function(e){return mt(t.data.menus,(function(t,e){return Q(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},c=function(t,e){Wd.highlight(t,e),Wd.getHighlighted(e).orThunk((function(){return Wd.getFirst(e)})).each((function(e){xi(t,e.element,Qo())}))},s=function(t,e){return St(U(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?z.some(t.menu):z.none()}))})))},l=function(e,n,r){var o=s(n,n.otherMenus(r));W(o,(function(n){Mu(n.element,[t.markers.backgroundMenu]),t.stayInDom||Wg.remove(e,n)}))},f=function(e,n){var o=function(e){return r.get().getOrThunk((function(){var n={},o=Ws(e.element,"."+t.markers.item),i=G(o,(function(t){return"true"===ze(t,"aria-haspopup")}));return W(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=u(t);n[e]=t}))})),r.set(n),n}))}(e);dt(o,(function(t,e){var r=H(n,e);Ne(t.element,"aria-expanded",r)}))},d=function(e,n,r){return z.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return z.none();var i=o.menu,u=s(n,r.slice(1));return W(u,(function(e){_u(e.element,t.markers.backgroundMenu)})),Ae(i.element)||Wg.append(e,qu(i)),Mu(i.element,[t.markers.backgroundMenu]),c(e,i),l(e,n,r),z.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 z.some(r);var a=u(r);return o.expand(a).bind((function(u){return f(e,u),z.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 Ae(s.element)||Wg.append(e,qu(s)),t.onOpenSubmenu(e,r,s,tt(u)),i===n.HighlightSubmenu?(Wd.highlightFirst(s),d(e,o,u)):(Wd.dehighlightAll(s),z.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=ki([Ti(Sh(),(function(t,e){var n=e.event.item;o.lookupItem(u(n)).each((function(){var n=e.event.menu;Wd.highlight(t,n);var r=u(e.event.item);o.refresh(r).each((function(e){return l(t,o,e)}))}))})),Li((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)}))})),Bi((function(e,n){i(e).each((function(n){Wg.append(e,qu(n)),t.onOpenMenu(e,n),t.highlightImmediately&&c(e,n)}))}))].concat(t.navigateOnHover?[Ti(mh(),(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 Wd.getHighlighted(t).bind(Wd.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=bt(o.getMenus()),r=St(U(n,Eh.extractPreparedMenu));return o.getTriggeringPath(e,(function(t){return function(t,e,n){return st(e,(function(t){if(!t.getSystem().isConnected())return z.none();var e=Wd.getCandidates(t);return K(e,(function(t){return u(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))})).fold((function(){(function(t){return z.from(t.components()[0]).filter((function(t){return"menu"===ze(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:gf(t.tmenuBehaviours,[Hg.config({mode:"special",onRight:p((function(t,e){return pd(e.element)?z.none():m(t,e,n.HighlightSubmenu)})),onLeft:p((function(t,e){return pd(e.element)?z.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){xi(t,e.element,Qo())}))}}),Wd.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),yd.config({find:function(t){return Wd.getHighlighted(t)}}),Wg.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:go(t,e),expansions:{}}},collapseItem:function(t){return{value:$i(Ah()),meta:{text:t}}}}}),Mh=gd({name:"InlineView",configFields:[Lr("lazySink"),pa("onShow"),pa("onHide"),Jr("onEscape"),df("inlineBehaviours",[Wl,ff,gc]),Zr("fireDismissalEventInstead",[to("event",li())]),Zr("fireRepositionEventInstead",[to("event",fi())]),to("getRelated",z.none),to("isExtraPart",S),to("eventOrder",z.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return En(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();Wl.openWhileCloaked(e,n,(function(){return Cl.positionWithinBounds(i,e,r,o())})),ff.setValue(e,z.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 Dh.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return Wl.close(e),t.onEscape.map((function(t){return t(e)})),z.some(!0)},onExecute:function(){return z.some(!0)},onOpenMenu:function(t,e){Cl.positionWithinBounds(i().getOrDie(),e,n,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Cl.position(o,n,{anchor:_({type:"submenu",item:e},a(r))})},onRepositionMenu:function(t,e,r){var u=i().getOrDie();Cl.positionWithinBounds(u,e,n,o()),W(r,(function(t){var e=a(t.triggeringPath);Cl.position(u,t.triggeredMenu,{anchor:_({type:"submenu",item:t.triggeringItem},e)})}))}})}(t,e,n,r,o);Wl.open(e,i),ff.setValue(e,z.some({mode:"menu",menu:i}))},i=function(e){Wl.isOpen(e)&&ff.getValue(e).each((function(n){switch(n.mode){case"menu":Wl.getState(e).each(Dh.repositionMenus);break;case"position":var r=t.lazySink(e).getOrDie();Cl.positionWithinBounds(r,e,n.config,n.getBounds())}}))},u={setContent:function(t,e){Wl.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,z.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,z.none)},showMenuWithinBounds:o,hide:function(t){Wl.isOpen(t)&&(ff.setValue(t,z.none()),Wl.close(t))},getContent:function(t){return Wl.getState(t)},reposition:i,isOpen:Wl.isOpen};return{uid:t.uid,dom:t.dom,behaviours:gf(t.inlineBehaviours,[Wl.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)}}),ff.config({store:{mode:"memory",initialValue:z.none()}}),gc.config({channels:_(_({},Kl(_({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Jl(_(_({},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)}}}),Rh=function(t){return t.x},Nh=function(t,e){return t.x+t.width/2-e.width/2},zh=function(t,e){return t.x+t.width-e.width},Bh=function(t){return t.y},Ph=function(t,e){return t.y+t.height-e.height},Ih=function(t,e){return t.y+t.height/2-e.height/2},Lh=function(t,e,n){return Sa(zh(t,e),Ph(t,e),n.insetSouthwest(),Ea(),"southwest",Ba(t,{right:0,bottom:3}),"layout-inset")},Hh=function(t,e,n){return Sa(Rh(t),Ph(t,e),n.insetSoutheast(),Ta(),"southeast",Ba(t,{left:1,bottom:3}),"layout-inset")},Fh=function(t,e,n){return Sa(zh(t,e),Bh(t),n.insetNorthwest(),_a(),"northwest",Ba(t,{right:0,top:2}),"layout-inset")},Vh=function(t,e,n){return Sa(Rh(t),Bh(t),n.insetNortheast(),Oa(),"northeast",Ba(t,{left:1,top:2}),"layout-inset")},jh=function(t,e,n){return Sa(Nh(t,e),Bh(t),n.insetNorth(),Aa(),"north",Ba(t,{top:2}),"layout-inset")},Uh=function(t,e,n){return Sa(Nh(t,e),Ph(t,e),n.insetSouth(),Da(),"south",Ba(t,{bottom:3}),"layout-inset")},Wh=function(t,e,n){return Sa(zh(t,e),Ih(t,e),n.insetEast(),Ra(),"east",Ba(t,{right:0}),"layout-inset")},qh=function(t,e,n){return Sa(Rh(t),Ih(t,e),n.insetWest(),Ma(),"west",Ba(t,{left:1}),"layout-inset")},Gh=function(t){switch(t){case"north":return jh;case"northeast":return Vh;case"northwest":return Fh;case"south":return Uh;case"southeast":return Hh;case"southwest":return Lh;case"east":return Wh;case"west":return qh}},$h=function(t,e,n,r,o){return zc(r).map(Gh).getOr(jh)(t,e,n,r,o)},Xh=function(t){switch(t){case"north":return Uh;case"northeast":return Hh;case"northwest":return Lh;case"south":return jh;case"southeast":return Vh;case"southwest":return Fh;case"east":return qh;case"west":return Wh}},Kh=function(t,e,n,r,o){return zc(r).map(Xh).getOr(jh)(t,e,n,r,o)},Yh=tinymce.util.Tools.resolve("tinymce.util.Delay"),Jh=gd({name:"Button",factory:function(t){var e=lh(t.action),n=t.dom.tag,r=function(e){return yt(t.dom,"attributes").bind((function(t){return yt(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:pf(t.buttonBehaviours,[Yg.config({}),Hg.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 _({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[to("uid",void 0),Lr("dom"),to("components",[]),hf("buttonBehaviours",[Yg,Hg]),$r("action"),$r("role"),to("eventOrder",{})]}),Qh=function(t){var e=function(t){return void 0!==t.uid}(t)&&xt(t,"uid")?t.uid:tu("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return _(_({},t),{uid:e})}}},Zh=tinymce.util.Tools.resolve("tinymce.util.I18n"),tp={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},ep=function(t){return function(){return yt(t,"temporary-placeholder").getOr("!not found!")}},np=function(t,e){var n=t.toLowerCase();if(Zh.isRtl()){var r=function(t,e){return At(t,e)?t:function(t,e){return t+e}(t,e)}(n,"-rtl");return wt(e,r)?r:n}return n},rp=function(t,e){return yt(e,np(t,e))},op=function(t,e){var n=e();return rp(t,n).getOrThunk(ep(n))},ip=function(){return qg("add-focusable",[Bi((function(t){Qu(t.element,"svg").each((function(t){return Ne(t,"focusable","false")}))}))])},up=function(t,e,n,r){var o,i,u=function(t){return!!Zh.isRtl()&&wt(tp,t)}(e)?["tox-icon--flip"]:[],a=yt(n,np(e,n)).or(r).getOrThunk(ep(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:[],!0),[ip()],!1))}},ap=function(t,e,n,r){return void 0===r&&(r=z.none()),up(e,t,n(),r)},cp={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},sp=gd({name:"Notification",factory:function(t){var e,n,r,o,i,u=Qh({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:cc([Wg.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=Qh({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([Wg.config({})])}),l={updateProgress:function(t,e){t.getSystem().isConnected()&&s.getOpt(t).each((function(t){Wg.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);Wg.set(n,[Vu(e)])}}},f=J([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return z.from(cp[t])})).toArray()]),d=Qh(Jh.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[ap("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=K(e,(function(t){return wt(o,np(t,o))})),up(n,i.getOr("temporary-placeholder"),o,z.none())),{dom:{tag:"div",classes:["tox-notification__body"]},components:[u.asSpec()],behaviours:cc([Wg.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([Yg.config({}),qg("notification-events",[Ti(zo(),(function(t){d.getOpt(t).each(Yg.focus)}))])]),components:m.concat(t.progress?[s.asSpec()]:[]).concat(t.closeButton?[d.asSpec()]:[]),apis:l}},configFields:[$r("level"),Lr("progress"),Lr("icon"),Lr("onAction"),Lr("text"),Lr("iconProvider"),Lr("translationProvider"),io("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function lp(t,e,n){var r=e.backstage.shared;return{open:function(e,o){var i=!e.closeButton&&e.timeout&&(e.timeout>0||e.timeout<0),u=function(){o(),Mh.hide(c)},a=Wu(sp.sketch({text:e.text,level:H(["success","error","warning","warn","info"],e.type)?e.type:void 0,progress:!0===e.progressBar,icon:z.from(e.icon),closeButton:!i,onAction:u,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),c=Wu(Mh.sketch(_({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(c),e.timeout>0&&Yh.setTimeout((function(){u()}),e.timeout);var s=function(){var e=En(zt.fromDom(t.getContentAreaContainer())),n=Dn(),r=za(n.x,e.x,e.right),o=za(n.y,e.y,e.bottom),i=Math.max(e.right,n.right),u=Math.max(e.bottom,n.bottom);return z.some(Tn(r,o,i-r,u-o))};return{close:u,moveTo:function(t,e){Mh.showAt(c,qu(a),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){var n=qu(a),o={maxHeightFunction:ts()};if("banner"!==e&&f(t)){var i=function(t){switch(t){case"bc-bc":return Uh;case"tc-tc":return jh;case"tc-bc":return Ga;case"bc-tc":default:return $a}}(e),u={type:"node",root:De(),node:z.some(zt.fromDom(t)),overrides:o,layouts:{onRtl:function(){return[i]},onLtr:function(){return[i]}}};Mh.showWithinBounds(c,n,{anchor:u},s)}else{var l=_(_({},r.anchors.banner()),{overrides:o});Mh.showWithinBounds(c,n,{anchor:l},s)}},text:function(t){sp.updateText(a,t)},settings:e,getEl:function(){return a.element.dom},progressBar:{value:function(t){sp.updateProgress(a,t)}}}},close:function(t){t.close()},reposition:function(t){t.length>0&&W(t,(function(e,n){0===n?e.moveRel(null,"banner"):e.moveRel(t[n-1].getEl(),"bc-tc")}))},getArgs:function(t){return t.settings}}}var fp,dp=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)}}},mp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),gp=function(t,e,n,r,o){var i=mp(t,(function(e){return function(t,e){return t.isBlock(e)||H(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return z.from(i.backwards(e,n,r,o))},hp=function(t,e){return pp(zt.fromDom(t.selection.getNode())).getOrThunk((function(){var n=zt.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return hn(n,zt.fromDom(e.extractContents())),e.insertNode(n.dom),he(n).each((function(t){return t.dom.normalize()})),function(t){return Us(t,js)}(n).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===Pt(t)?1:Fs(t).fold((function(){return ve(t).length}),(function(t){return t.length}))}(e))})),n}))},pp=function(t){return ta(t,"[data-mce-autocompleter]")},vp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},bp=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},yp=function(t,e){return t.substring(e.length)},wp=function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return z.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return gp(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(bp(o))return z.none();if(o===n)break}return z.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 z.none();var i=vp(o);return 0!==i.lastIndexOf(n)||yp(i,n).length<r?z.none():z.some({text:yp(i,n),range:o,triggerChar:n})}))},xp=function(t,e,n,r){return void 0===r&&(r=0),pp(zt.fromDom(e.startContainer)).fold((function(){return wp(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=vp(r);return z.some({range:r,text:yp(o,n),triggerChar:n})}))},Cp=function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){yi(t,Po(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(Wd.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(wi),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(Wd.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()&&pp(zt.fromDom(e.element)).isNone()&&t.cancelIfNecessary()}))},Sp=tinymce.util.Tools.resolve("tinymce.util.Promise"),kp=function(t,e){return{container:t,offset:e}},Op=function(t){if(function(t){return 3===t.nodeType}(t))return kp(t,t.data.length);var e=t.childNodes;return e.length>0?Op(e[e.length-1]):kp(t,e.length)},_p=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?_p(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?Op(n[n.length-1]):kp(t,e)},Tp=function(t){return function(e){var n=_p(e.startContainer,e.startOffset);return!function(t,e){return gp(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!bp(e)})).isSome()}(t,n)}},Ep=function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return st(n.triggerChars,(function(n){return xp(t,e,n)}))}(t.dom,r,n).bind((function(n){return Ap(t,e,n)}))},Ap=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,u=G(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 z.none();var a=Sp.all(U(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 z.some({lookupData:a,context:n})},Dp=mr([Vr("type"),Yr("text")]),Mp=mr([to("type","autocompleteitem"),to("active",!1),to("disabled",!1),to("meta",{}),Vr("value"),Yr("text"),Yr("icon")]),Rp=mr([Vr("type"),Vr("ch"),no("minChars",1),to("columns",1),no("maxResults",10),Jr("matches"),Ur("fetch"),Ur("onAction"),ao("highlightOn",[],xr)]),Np=[io("disabled",!1),Yr("tooltip"),Yr("icon"),Yr("text"),uo("onSetup",(function(){return h}))],zp=mr([Vr("type"),Ur("onAction")].concat(Np)),Bp=function(t){return Dr("toolbarbutton",zp,t)},Pp=[io("active",!1)].concat(Np),Ip=mr(Pp.concat([Vr("type"),Ur("onAction")])),Lp=function(t){return Dr("ToggleButton",Ip,t)},Hp=[uo("predicate",S),oo("scope","node",["node","editor"]),oo("position","selection",["node","selection","line"])],Fp=Np.concat([to("type","contextformbutton"),to("primary",!1),Ur("onAction"),Pr("original",b)]),Vp=Pp.concat([to("type","contextformbutton"),to("primary",!1),Ur("onAction"),Pr("original",b)]),jp=Np.concat([to("type","contextformbutton")]),Up=Pp.concat([to("type","contextformtogglebutton")]),Wp=zr("type",{contextformbutton:Fp,contextformtogglebutton:Vp}),qp=mr([to("type","contextform"),uo("initValue",v("")),Yr("label"),Gr("commands",Wp),Xr("launch",zr("type",{contextformbutton:jp,contextformtogglebutton:Up}))].concat(Hp)),Gp=mr([to("type","contexttoolbar"),Vr("items")].concat(Hp)),$p=function(t){var e=t.ui.registry.getAll().popups,n=mt(e,(function(t){return(e=t,Dr("Autocompleter",Rp,e)).fold((function(t){throw new Error(Nr(t))}),b);var e})),r=function(t){var e={};return W(t,(function(t){e[t]={}})),lt(e)}(pt(n,(function(t){return t.ch}))),o=bt(n);return{dataset:n,triggerChars:r,lookupByChar:function(t){return G(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"}(fp||(fp={}));var Xp,Kp=fp,Yp="tox-menu-nav__js",Jp={normal:Yp,color:"tox-swatch"},Qp="tox-collection__item-label",Zp="tox-collection__item--active",tv=function(t){return yt(Jp,t).getOr(Yp)},ev=function(t){return"color"===t?"tox-swatches":"tox-menu"},nv=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:ev(t),tieredMenu:"tox-tiered-menu"}},rv=function(t){var e=nv(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:tv(t)}},ov=function(t,e,n){var r=nv(n);return{tag:"div",classes:J([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},iv=[kh.parts.items({})],uv=function(t,e,n){var r=nv(n);return{dom:{tag:"div",classes:J([[r.tieredMenu]])},markers:rv(n)}},av=function(t,e){return function(n){var r=j(n,e);return U(r,(function(e){return{dom:t,components:e}}))}},cv=function(t,e){var n=[],r=[];return W(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],wt(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),U(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},sv=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[kh.parts.items({preprocess:function(n){return"auto"!==t&&t>1?av({tag:"div",classes:["tox-collection__group"]},t)(n):cv(n,(function(t,n){return"separator"===e[n].type}))}})]}},lv=function(t){return F(t,(function(t){return"icon"in t&&void 0!==t.icon}))},fv=function(t){return console.error(Nr(t)),console.log(t),z.none()},dv=function(t,e,n,r,o){var i,u=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[kh.parts.items({preprocess:function(t){return cv(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:u.dom,components:u.components,items:n}},mv=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:[kh.parts.items({preprocess:"auto"!==t?av({tag:"div",classes:["tox-swatches__row"]},t):b})]}]}}(r)).dom,components:i.components,items:n}:"normal"===o&&"auto"===r?{value:t,dom:(i=sv(r,n)).dom,components:i.components,items:n}:"normal"===o&&1===r?{value:t,dom:(i=sv(1,n)).dom,components:i.components,items:n}:"normal"===o?{value:t,dom:(i=sv(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:[kh.parts.items({preprocess:av({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:i.components,items:n}:{value:t,dom:ov(e,r,o),components:iv,items:n}},gv=[Vr("type"),Vr("src"),Yr("alt"),ao("classes",[],xr)],hv=mr(gv),pv=[Vr("type"),Vr("text"),Yr("name"),ao("classes",["tox-collection__item-label"],xr)],vv=mr(pv),bv=lr((function(){return Tr("type",{cardimage:hv,cardtext:vv,cardcontainer:yv})})),yv=mr([Vr("type"),ro("direction","horizontal"),ro("align","left"),ro("valign","middle"),Gr("items",bv)]),wv=[io("disabled",!1),Yr("text"),Yr("shortcut"),Br("value","value",Qn((function(){return $i("menuitem-value")})),br()),to("meta",{})],xv=mr([Vr("type"),Yr("label"),Gr("items",bv),uo("onSetup",(function(){return h})),uo("onAction",h)].concat(wv)),Cv=mr([Vr("type"),io("active",!1),Yr("icon")].concat(wv)),Sv=[Vr("type"),Vr("fancytype"),uo("onAction",h)],kv=[to("initData",{})].concat(Sv),Ov=[co("initData",{},[io("allowCustomColors",!0),Qr("colors",br())])].concat(Sv),_v=zr("fancytype",{inserttable:kv,colorswatch:Ov}),Tv=mr([Vr("type"),uo("onSetup",(function(){return h})),uo("onAction",h),Yr("icon")].concat(wv)),Ev=mr([Vr("type"),Ur("getSubmenuItems"),uo("onSetup",(function(){return h})),Yr("icon")].concat(wv)),Av=mr([Vr("type"),Yr("icon"),io("active",!1),uo("onSetup",(function(){return h})),Ur("onAction")].concat(wv)),Dv=function(t,e,n){var r=Ws(t.element,"."+n);if(r.length>0){var o=Y(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 z.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return z.none()},Mv=function(t,e){return cc([qg(t,e)])},Rv=function(t){return Mv($i("unnamed-events"),t)},Nv=$i("tooltip.exclusive"),zv=$i("tooltip.show"),Bv=$i("tooltip.hide"),Pv=function(t,e,n){t.getSystem().broadcastOn([Nv],{})},Iv=Object.freeze({__proto__:null,hideAllExclusive:Pv,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&Wg.set(t,r)}))}}),Lv=Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){Dl(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return ki(J([[Ti(zv,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){Pv(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:ki("normal"===t.mode?[Ti(No(),(function(t){bi(n,zv)})),Ti(Mo(),(function(t){bi(n,Bv)}))]:[]),behaviours:cc([Wg.config({})])});e.setTooltip(o),Tl(r,o),t.onShow(n,o),Cl.position(r,o,{anchor:t.anchor(n)})}}(n)}),t.delay)})),Ti(Bv,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Ti(Yo(),(function(t,e){var r=e;r.universal||H(r.channels,Nv)&&n(t)})),Pi((function(t){n(t)}))],"normal"===t.mode?[Ti(zo(),(function(t){bi(t,zv)})),Ti(Xo(),(function(t){bi(t,Bv)})),Ti(No(),(function(t){bi(t,zv)})),Ti(Mo(),(function(t){bi(t,Bv)}))]:[Ti(pi(),(function(t,e){bi(t,zv)})),Ti(vi(),(function(t){bi(t,Bv)}))]]))}}),Hv=[Lr("lazySink"),Lr("tooltipDom"),to("exclusive",!0),to("tooltipComponents",[]),to("delay",300),oo("mode","normal",["normal","follow-highlight"]),to("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")],Fv=lc({fields:Hv,name:"tooltipping",active:Lv,state:Object.freeze({__proto__:null,init:function(){var t=Hc(),e=Hc(),n=function(){t.on(clearTimeout)},r=v("not-implemented");return lu({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}),Vv=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),jv=tinymce.util.Tools.resolve("tinymce.EditorManager"),Uv=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},Wv=function(t){return t.getParam("width",Vv.DOM.getStyle(t.getElement(),"width"))},qv=function(t){return z.from(t.getParam("min_width")).filter(m)},Gv=function(t){return z.from(t.getParam("min_height")).filter(m)},$v=function(t){return z.from(t.getParam("max_width")).filter(m)},Xv=function(t){return z.from(t.getParam("max_height")).filter(m)},Kv=function(t){return!1!==t.getParam("menubar",!0,"boolean")},Yv=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=o(e),i=u(e)&&e.length>0;return!Qv(t)&&(i||r||n)},Jv=function(t){var e=V(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=G(e,(function(t){return"string"==typeof t}));return n.length>0?z.some(n):z.none()},Qv=function(t){return Jv(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"}(Xp||(Xp={}));var Zv,tb=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(Zv||(Zv={}));var eb,nb,rb=function(t){return t.getParam("toolbar_location",Zv.auto,"string")},ob=function(t){return rb(t)===Zv.bottom},ib=function(t){if(!t.inline)return z.none();var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);if(e.length>0)return Zu(De(),e);var n=function(t){return t.getParam("fixed_toolbar_container_target")}(t);return f(n)?z.some(zt.fromDom(n)):z.none()},ub=function(t){return t.inline&&ib(t).isSome()},ab=function(t){return ib(t).getOrThunk((function(){return Oe(ke(zt.fromDom(t.getElement())))}))},cb=function(t){return t.inline&&!Kv(t)&&!Yv(t)&&!Qv(t)},sb=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!ub(t)&&!cb(t)},lb=function(t){var e=t.getParam("menu");return e?mt(e,(function(t){return _(_({},t),{items:t.items})})):{}},fb=function(t){return t.getParam("menubar")},db=function(t){return t.getParam("anchor_top","#top")},mb=function(t){return t.getParam("anchor_bottom","#bottom")},gb=mr([(eb="readonly",Hr(eb,Cr))]),hb=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([ql()],{target:n}),t.uiMothership.broadcastOn([ql()],{target:n})),t.mothership.broadcastOn(["silver.readonly"],{readonly:e}),t.uiMothership.broadcastOn(["silver.readonly"],{readonly:e})},pb=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&hb(e,!0)})),t.on("SwitchMode",(function(){return hb(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},vb=function(){var t;return gc.config({channels:(t={},t["silver.readonly"]={schema:gb,onReceive:function(t,e){Nd.set(t,e.readonly)}},t)})},bb=function(t){return Nd.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},yb=function(t){return Nd.config({disabled:t})},wb=function(t){return Nd.config({disabled:t,disableClass:"tox-tbtn--disabled"})},xb=function(t){return Nd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Cb=function(t,e){var n=t.getApi(e);return function(t){t(n)}},Sb=function(t,e){return Bi((function(n){Cb(t,n)((function(n){var r=t.onSetup(n);d(r)&&e.set(r)}))}))},kb=function(t,e){return Pi((function(n){return Cb(t,n)(e.get())}))},Ob=function(t,e){return Li((function(n,r){Cb(t,n)(t.onAction),t.triggersSubmenu||e!==Kp.CLOSE_ON_EXECUTE||(bi(n,ei()),r.stop())}))},_b=((nb={})[Jo()]=["disabling","alloy.base.behaviour","toggling","item-events"],nb),Tb=St,Eb=function(t,e,n,r){var o=so(h);return{type:"item",dom:e.dom,components:Tb(e.optComponents),data:t.data,eventOrder:_b,hasSubmenu:t.triggersSubmenu,itemBehaviours:cc([qg("item-events",[Ob(t,n),Sb(t,o),kb(t,o)]),bb((function(){return t.disabled||r.isDisabled()})),vb(),Wg.config({})].concat(t.itemBehaviours))}},Ab=function(t){return{value:t.value,meta:_({text:t.text.getOr("")},t.meta)}},Db=tinymce.util.Tools.resolve("tinymce.Env"),Mb=function(t){var e=Db.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=U(n,(function(t){var n=t.toLowerCase().trim();return wt(e,n)?e[n]:t}));return Db.mac?r.join(""):r.join("+")},Rb=function(t,e,n){return void 0===n&&(n=["tox-collection__item-icon"]),ap(t,{tag:"div",classes:n},e)},Nb=function(t){return{dom:{tag:"div",classes:[Qp]},components:[Vu(Zh.translate(t))]}},zb=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},Bb=function(t,e){return{dom:{tag:"div",classes:[Qp]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Vu(Zh.translate(e))]}]}},Pb=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:Mb(t)}}},Ib=function(t){return Rb("checkmark",t,["tox-collection__item-checkmark"])},Lb=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 rp(t,r).or(n).getOrThunk(ep(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"]},_(_({},o),"custom"===u?{tag:"button",classes:E(E([],o.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:r}:"remove"===u?{classes:E(E([],o.classes,!0),["tox-swatch--remove"],!1),innerHtml:r}:{attributes:_(_({},o.attributes),{"data-mce-color":u}),styles:{"background-color":u}})),optComponents:[]}},Hb=function(t){var e=t.map((function(t){return{attributes:{title:Zh.translate(t)}}})).getOr({});return _({tag:"div",classes:[Yp,"tox-collection__item"]},e)},Fb=function(t,e,n,r){return void 0===r&&(r=z.none()),"color"===t.presets?Lb(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 ap(t,o,e.icons,r)})).orThunk((function(){return z.some({dom:o})})):z.none(),u=t.checkMark,a=z.from(t.meta).fold((function(){return Nb}),(function(t){return wt(t,"style")?w(Bb,t.style):Nb})),c=t.htmlContent.fold((function(){return t.textContent.map(a)}),(function(t){return z.some(zb(t,[Qp]))}));return{dom:Hb(t.ariaLabel),optComponents:[i,c,t.shortcutContent.map(Pb),u,t.caret]}}(t,e,n,r)},Vb=function(t,e){return yt(t,"tooltipWorker").map((function(t){return[Fv.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:ts}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){Fv.setComponents(e,[ju({element:zt.fromDom(t)})])}))}})]})).getOr([])},jb=function(t,e){var n=function(t){return Vv.DOM.encode(t)}(Zh.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},Ub=function(t,e){return U(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,Ub(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 H(e.cardText.highlightOn,t)}))?z.from(e.cardText.matchText).getOr(""):"";return zb(jb(t.text,n),t.classes)}}))},Wb=$f(vh(),bh()),qb=function(t){return{value:t}},Gb=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,$b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Xb=function(t){return Gb.test(t)||$b.test(t)},Kb=function(t){return function(t,e){return Et(t,e)?function(t,e){return t.substring(e)}(t,e.length):t}(t,"#").toUpperCase()},Yb=function(t){var e=function(t){return{value:t.value.replace(Gb,(function(t,e,n,r){return e+e+n+n+r+r}))}}(t),n=$b.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},Jb=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Qb=function(t){var e=Jb(t.red)+Jb(t.green)+Jb(t.blue);return qb(e)},Zb=Math.min,ty=Math.max,ey=Math.round,ny=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,ry=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,oy=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},iy=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},uy=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=ty(0,Zb(i,1)),u=ty(0,Zb(u,1)),0===i)return e=n=r=ey(255*u),oy(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=ey(255*(e+l)),n=ey(255*(n+l)),r=ey(255*(r+l)),oy(e,n,r,1)},ay=function(t){var e=Yb(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return oy(n,r,o,1)},cy=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return oy(o,i,u,a)},sy=function(t){if("transparent"===t)return z.some(oy(0,0,0,0));var e=ny.exec(t);if(null!==e)return z.some(cy(e[1],e[2],e[3],"1"));var n=ry.exec(t);return null!==n?z.some(cy(n[1],n[2],n[3],n[4])):z.none()},ly=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},fy=oy(255,0,0,1),dy=function(t,e){return t.fire("ResizeContent",e)},my=function(t,e,n){return{hue:t,saturation:e,value:n}},gy=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?my(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,my(Math.round(n),Math.round(100*e),Math.round(100*r)))},hy=function(t){return Qb(uy(t))},py=function(t){return(e=t,Xb(e)?z.some({value:Kb(e)}):z.none()).orThunk((function(){return sy(t).map(Qb)})).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 Qb(oy(o,i,u,a))}));var e},vy=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");var by,yy="choiceitem",wy=[{type:yy,text:"Light Green",value:"#BFEDD2"},{type:yy,text:"Light Yellow",value:"#FBEEB8"},{type:yy,text:"Light Red",value:"#F8CAC6"},{type:yy,text:"Light Purple",value:"#ECCAFA"},{type:yy,text:"Light Blue",value:"#C2E0F4"},{type:yy,text:"Green",value:"#2DC26B"},{type:yy,text:"Yellow",value:"#F1C40F"},{type:yy,text:"Red",value:"#E03E2D"},{type:yy,text:"Purple",value:"#B96AD9"},{type:yy,text:"Blue",value:"#3598DB"},{type:yy,text:"Dark Turquoise",value:"#169179"},{type:yy,text:"Orange",value:"#E67E23"},{type:yy,text:"Dark Red",value:"#BA372A"},{type:yy,text:"Dark Purple",value:"#843FA1"},{type:yy,text:"Dark Blue",value:"#236FA1"},{type:yy,text:"Light Gray",value:"#ECF0F1"},{type:yy,text:"Medium Gray",value:"#CED4D9"},{type:yy,text:"Gray",value:"#95A5A6"},{type:yy,text:"Dark Gray",value:"#7E8C8D"},{type:yy,text:"Navy Blue",value:"#34495E"},{type:yy,text:"Black",value:"#000000"},{type:yy,text:"White",value:"#ffffff"}],xy=function(t){void 0===t&&(t=10);var e,n=vy.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=L(t,e);return-1===n?z.none():z.some(n)})(i,e).each(u),i.unshift(e),i.length>t&&i.pop(),vy.setItem("tinymce-custom-colors",JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Cy=function(t){return!1!==t.getParam("custom_colors")},Sy=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:"#"+py(t[n]).value,type:"choiceitem"});return e}(e):wy},ky=function(t){xy.add(t)},Oy=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)))}(Sy(t).length))},_y=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){ky(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},Ey=function(t,e){return t.concat(U(xy.state(),(function(t){return{type:yy,text:t,value:t}})).concat(_y(e)))},Ay=function(t,e){return function(n){n(Ey(t,e))}},Dy=function(t,e,n){var r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";t.setIconFill(r,n)},My=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 z.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 sy(t).map((function(t){var n=Qb(t).value;return Tt(e.toLowerCase(),n)}))})).getOr(!1)},columns:Oy(t),fetch:Ay(Sy(t),Cy(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()&&Dy(n,e,o.get());var r=function(t){t.name===e&&Dy(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},Ry=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(z.from(o)),n.close()):t.windowManager.alert(t.translate(["Invalid hex color code: {0}",o]))},onClose:h,onCancel:function(){e(z.none())}})}},zy=function(t,e,n,r,o,i,u,a){var c=lv(e),s=By(e,n,r,"color"!==o?"normal":"color",i,u,a);return mv(t,c,s,r,o)},By=function(t,e,n,r,o,i,u){return St(U(t,(function(a){return"choiceitem"===a.type?(c=a,Dr("choicemenuitem",Cv,c)).fold(fv,(function(c){return z.some(function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=Fb({presets:n,textContent:e?t.text:z.none(),htmlContent:z.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:z.none(),checkMark:e?z.some(Ib(u.icons)):z.none(),caret:z.none(),value:t.value},u,a);return Yn(Eb({data:Ab(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){ch.set(t,e)},isActive:function(){return ch.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,lv(t)))})):z.none();var c})))},Py=function(t,e){var n=rv(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 Ey(e.colorinput.getColors(),n)}),(function(t){return t.concat(_y(n))}))},Ly=$i("cell-over"),Hy=$i("cell-execute"),Fy=function(t,e,n){var r,o=function(n){return yi(n,Hy,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return Wu({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:cc([qg("insert-table-picker-cell",[Ti(No(),Yg.focus),Ti(Jo(),o),Ti(Fo(),i),Ti(Zo(),i)]),ch.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Yg.config({onFocus:function(n){return yi(n,Ly,{row:t,col:e})}})])})},Vy=function(t){return Q(t,(function(t){return U(t,qu)}))},jy=function(t,e){return Vu(e+1+"x"+(t+1))},Uy={inserttable:function(t){var e=$i("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(Fy(o,u,t));r.push(i)}return r}(e,10,10),r=Qh({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[Vu("0x0")],behaviours:cc([Wg.config({})])});return{type:"widget",data:{value:$i("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Wb.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:Vy(n).concat(r.asSpec()),behaviours:cc([qg("insert-table-picker",[Mi(Ly,(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++)ch.set(t[i][u],i<=e&&u<=n)}(n,i,u,10,10),Wg.set(r.get(t),[jy(i,u)])})),Mi(Hy,(function(e,n,r){t.onAction({numRows:r.event.row+1,numColumns:r.event.col+1}),bi(e,ei())}))]),Hg.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=zy($i("menu-value"),n,(function(e){t.onAction({value:e})}),r,"color",Kp.CLOSE_ON_EXECUTE,S,e.shared.providers),i=_(_({},o),{markers:rv("color"),movement:Py(r,"color")});return{type:"widget",data:{value:$i("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Wb.widget(kh.sketch(i))]}}},Wy=function(t,e,n,r,o,i,u,a){void 0===a&&(a=!0);var c=Fb({presets:r,textContent:z.none(),htmlContent:n?t.text.map((function(t){return jb(t,e)})):z.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:z.none(),checkMark:z.none(),caret:z.none(),value:t.value},u.providers,a,t.icon);return Eb({data:Ab(t),disabled:t.disabled,getApi:v({}),onAction:function(e){return o(t.value,t.meta)},onSetup:v(h),triggersSubmenu:!1,itemBehaviours:Vb(t.meta,u)},c,i,u.providers)},qy=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:_({tag:"div",classes:["tox-collection__item","tox-collection__group-heading"]},e),components:[]}},Gy=function(t,e,n,r){void 0===r&&(r=!0);var o=Fb({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:z.none(),ariaLabel:t.text,caret:z.none(),checkMark:z.none(),shortcutContent:t.shortcut},n,r);return Eb({data:Ab(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)},$y=function(t,e,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var i,u=o?(i=n.icons,Rb("chevron-down",i,["tox-collection__item-caret"])):function(t){return Rb("chevron-right",t,["tox-collection__item-caret"])}(n.icons),a=Fb({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:z.none(),ariaLabel:t.text,caret:z.some(u),checkMark:z.none(),shortcutContent:t.shortcut},n,r);return Eb({data:Ab(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)},Xy=function(t,e,n,r){void 0===r&&(r=!0);var o=Fb({iconContent:t.icon,textContent:t.text,htmlContent:z.none(),ariaLabel:t.text,checkMark:z.some(Ib(n.icons)),caret:z.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Yn(Eb({data:Ab(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){ch.set(t,e)},isActive:function(){return ch.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}})},Ky=function(t,e){return yt(Uy,t.fancytype).map((function(n){return n(t,e)}))},Yy=function(t,e,n,r){var o={dom:Hb(t.label),optComponents:[z.some({dom:{tag:"div",classes:["tox-collection__item-container","tox-collection__item-container--row"]},components:Ub(t.items,r)})]};return Eb({data:Ab(_({text:z.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return Nd.isDisabled(t)},setDisabled:function(e){Nd.set(t,e),W(Ws(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:z.from(r.itemBehaviours).getOr([])},o,e,n.providers)};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(by||(by={}));var Jy=function(t,e,n,r,o){var i,u=n.shared.providers,a=function(t){return o?_(_({},t),{shortcut:z.none(),icon:t.text.isSome()?z.none():t.icon}):t};switch(t.type){case"menuitem":return(i=t,Dr("menuitem",Tv,i)).fold(fv,(function(t){return z.some(Gy(a(t),e,u,r))}));case"nestedmenuitem":return function(t){return Dr("nestedmenuitem",Ev,t)}(t).fold(fv,(function(t){return z.some($y(a(t),e,u,r,o))}));case"togglemenuitem":return function(t){return Dr("togglemenuitem",Av,t)}(t).fold(fv,(function(t){return z.some(Xy(a(t),e,u,r))}));case"separator":return function(t){return Dr("separatormenuitem",Dp,t)}(t).fold(fv,(function(t){return z.some(qy(t))}));case"fancymenuitem":return function(t){return Dr("fancymenuitem",_v,t)}(t).fold(fv,(function(t){return Ky(a(t),n)}));default:return console.error("Unknown item in general menu",t),z.none()}},Qy=function(t,e,n,r,o,i,u){var a=1===r,c=!a||lv(t);return St(U(t,(function(t){switch(t.type){case"separator":return(r=t,Dr("Autocompleter.Separator",Dp,r)).fold(fv,(function(t){return z.some(qy(t))}));case"cardmenuitem":return function(t){return Dr("cardmenuitem",xv,t)}(t).fold(fv,(function(t){return z.some(Yy(_(_({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:Vb(t.meta,i),cardText:{matchText:e,highlightOn:u}}))}));case"autocompleteitem":default:return function(t){return Dr("Autocompleter.Item",Mp,t)}(t).fold(fv,(function(t){return z.some(Wy(t,e,a,"normal",n,o,i,c))}))}var r})))},Zy=function(t,e,n,r,o){var i=lv(e),u=St(U(e,(function(t){var e=function(t){return Jy(t,n,r,function(t){return o?!wt(t,"text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(_(_({},t),{disabled:!0})):e(t)})));return(o?dv:mv)(t,i,u,1,"normal")},tw=function(t){return Dh.singleData(t.value,t)},ew=function(t,e){var n=Hc(),r=so(!1),o=Wu(Mh.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:cc([qg("dismissAutocompleter",[Ti(li(),(function(){return a()}))])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},u=function(){i()&&Mh.hide(o)},a=function(){if(i()){var e=n.get().map((function(t){return t.element}));pp(e.getOr(zt.fromDom(t.selection.getNode()))).each(yn),u(),n.clear(),r.set(!1)}},c=jt((function(){return $p(t)})),s=function(e,n,r,i){e.matchLength=n.text.length;var u=st(r,(function(t){return z.from(t.columns)})).getOr(1);Mh.showAt(o,kh.sketch(function(t,e,n,r){var o=n===by.ContentFocus?dm():fm(),i=Py(e,r),u=rv(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===by.ContentFocus,focusManager:o,menuBehaviours:Rv("auto"!==e?[]:[Bi((function(t,e){Dv(t,4,u.item).each((function(e){var n=e.numColumns,r=e.numRows;Hg.setGridSize(t,r,n)}))}))])}}(mv("autocompleter-value",!0,i,u,"normal"),u,by.ContentFocus,"normal")),{anchor:{type:"node",root:zt.fromDom(t.getBody()),node:z.from(e.element)}}),Mh.getContent(o).each(Wd.highlightFirst)},l=function(o){(function(e){return n.get().map((function(n){return xp(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return Ap(t,c,n,e)}))})).getOrThunk((function(){return Ep(t,c)}))})(o).fold(a,(function(o){!function(e){if(!i()){var o=hp(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=st(f=i,(function(t){return z.from(t.columns)})).getOr(1),Q(f,(function(n){var o=n.items;return Qy(o,n.matchText,(function(e,o){var i=t.selection.getRng();xp(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,Kp.BUBBLE_TO_SANDBOX,e,n.highlightOn)})));g.length>0?s(n,m,i,g):m.text.length-n.matchLength>=10?a():u()}}))}))}))},f={onKeypress:dp((function(t){27!==t.which&&l()}),50),cancelIfNecessary:a,isMenuOpen:function(){return Mh.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return Mh.getContent(o)}};!1===t.hasPlugin("rtc")&&Cp(f,t)},nw=function(t,e,n){return ta(t,e,n).isSome()},rw=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)}}},ow=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?z.none():z.some(e.touches[0])},iw=function(t){var e=Hc(),n=so(!1),r=rw((function(e){t.triggerEvent(ti(),e),n.set(!0)}),400),o=ho([{key:Oo(),value:function(t){return ow(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)})),z.none()}},{key:_o(),value:function(t){return r.cancel(),ow(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()}))})),z.none()}},{key:To(),value:function(o){r.cancel();return e.get().filter((function(t){return ce(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(Zo(),o)}))}}]);return{fireIfReady:function(t,e){return yt(o,e).bind((function(e){return e(t)}))}}},uw=function(){return ie().browser.isFirefox()},aw=function(t,e){var n=_({stopBackspace:!0},e),r=iw(n),o=U(["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 Vc(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=Hc(),u=Vc(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(Ko(),t)}),0))})),a=Vc(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():n.stopBackspace&&function(t){return t.raw.which===qd[0]&&!H(["input","textarea"],Pt(t.target))&&!nw(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return uw()?jc(t,"focus",e):Vc(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=Hc(),l=function(t,e){return uw()?jc(t,"blur",e):Vc(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(setTimeout((function(){n.triggerEvent(Xo(),t)}),0))}));return{unbind:function(){W(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=yt(t,"target").getOr(e);return so(n)},sw=lo([{stopped:[]},{resume:["element"]},{complete:[]}]),lw=function(t,e,n,r,o,i){var u=t(e,r),a=function(t,e){var n=so(!1),r=so(!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 mu(n)(a),a.isStopped()?(i.logEventStopped(e,t.element,n.purpose),sw.stopped()):a.isCut()?(i.logEventCut(e,t.element,n.purpose),sw.complete()):he(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=so(!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 W(t,(function(t){var e=t.descHandler;mu(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){dt(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){dt(t,(function(t,n){wt(t,e)&&delete t[e]}))},filterByType:function(e){return yt(t,e).map((function(t){return pt(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){return yt(t,n).bind((function(t){return yo(r,(function(e){return function(t,e){return Zi(e).bind((function(e){return yt(t,e)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}(t,e)}),e)}))}}},hw=function(){var t=gw(),e={},n=function(t){var e=t.element;return Zi(e).getOrThunk((function(){return function(t,e){var n=$i(Yi+t);return Qi(e,n),n}("uid-",t.element)}))},r=function(n){Zi(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);xt(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+Ui(o.element)+"\nCannot use it for: "+Ui(t.element)+"\nThe conflicting element is"+(Ae(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 yt(e,t)}}},pw=gd({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=T(e,["attributes"]);return{uid:t.uid,dom:_({tag:"div",attributes:_({role:"presentation"},n)},r),components:t.components,behaviours:mf(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[to("components",[]),df("containerBehaviours",[]),to("events",{}),to("domModification",{}),to("eventOrder",{})]}),vw=function(t){var e=function(e){return he(t.element).fold(k,(function(t){return ce(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){Zi(t).fold((function(){vc(t)}),(function(n){aa($o(),t,(function(n){return function(t,e,n,r,o){var i=cw(n,r);lw(t,e,n,r,i,o)}(r,$o(),{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:Wu,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),Ht(t.element)||(n.register(t),W(t.components(),u),i.triggerEvent(ri(),t.element,{target:t.element}))},a=function(t){Ht(t.element)||(W(t.components(),a),n.unregister(t)),t.disconnect()},c=function(e){Tl(t,e)},s=function(t){Dl(t)},l=function(t){var e=n.filter(Yo());W(e,(function(e){var n=e.descHandler;mu(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 Nn.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),Nn.value)},p=function(t){var e=Zi(t).getOr("not found");return g(e)};return u(t),{root:t,element:t.element,destroy:function(){o.unbind(),bn(t.element)},add:c,remove:s,getByUid:g,getByDom:p,addToWorld:u,removeFromWorld:a,broadcast:f,broadcastOn:d,broadcastEvent:m}},bw=v([to("prefix","form-field"),df("fieldBehaviours",[yd,ff])]),yw=v([jf({schema:[Lr("dom")],name:"label"}),jf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Lr("text")],name:"aria-descriptor"}),Ff({factory:{sketch:function(t){var e=mo(t,["factory"]);return t.factory.sketch(e)}},schema:[Lr("factory")],name:"field"})]),ww=hd({name:"FormField",configFields:bw(),partFields:yw(),factory:function(t,e,n,r){var o=gf(t.fieldBehaviours,[yd.config({find:function(e){return td(e,t,"field")}}),ff.config({store:{mode:"manual",getValue:function(t){return yd.getCurrent(t).bind(ff.getValue)},setValue:function(t,e){yd.getCurrent(t).each((function(t){ff.setValue(t,e)}))}}})]),i=ki([Bi((function(e,n){var r=nd(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=$i(t.prefix);r.label().each((function(t){Ne(t.element,"for",n),Ne(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=$i(t.prefix);Ne(n.element,"id",r),Ne(e.element,"aria-describedby",r)}))}))}))]),u={getField:function(e){return td(e,t,"field")},getLabel:function(e){return td(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 du({attributes:ho([{key:e.tabAttr,value:"true"}])})}}),Cw=[to("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=_w(t,e,n,r);return ww.sketch(o)},_w=function(t,e,n,r){return{dom:Tw(n),components:t.toArray().concat([e]),fieldBehaviours:cc(r)}},Tw=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=$i("form-component-change"),Dw=$i("form-close"),Mw=$i("form-cancel"),Rw=$i("form-action"),Nw=$i("form-submit"),zw=$i("form-block"),Bw=$i("form-unblock"),Pw=$i("form-tabchange"),Iw=$i("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,ze(r,"data-collection-item-value"))}))}},a=u((function(n,r,o,i){r.stop(),e.isDisabled()||yi(n,Rw,{name:t.name,value:i})})),c=[Ti(No(),u((function(t,e,n){vc(n)}))),Ti(Fo(),a),Ti(Zo(),a),Ti(zo(),u((function(t,e,n){Zu(t.element,"."+Zp).each((function(t){Eu(t,Zp)})),_u(n,Zp)}))),Ti(Bo(),u((function(t){Zu(t.element,"."+Zp).each((function(t){Eu(t,Zp)}))}))),Li(u((function(e,n,r,o){yi(e,Rw,{name:t.name,value:o})})))],s=function(t,e){return U(Ws(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){_u(t,"tox-collection__item--state-disabled"),Ne(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){Eu(t,"tox-collection__item--state-disabled"),Ie(t,"aria-disabled")}))}}),vb(),Wg.config({}),ff.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=U(r,(function(n){var r=Zh.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?j(o,t.columns):[o],u=U(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));Fi(n.element,u.join(""))}(n,r),"auto"===t.columns&&Dv(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;Hg.setGridSize(n,e,r)})),bi(n,Iw)}}),Sw.config({}),Hg.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"}})),qg("collection-events",c)]),eventOrder:(n={},n[Jo()]=["disabling","alloy.base.behaviour","collection-events"],n)});return Ow(i,l,["tox-form__group--collection"],[])},Hw=v([$r("data"),to("inputAttributes",{}),to("inputStyles",{}),to("tag","input"),to("inputClasses",[]),pa("onSetValue"),to("styles",{}),to("eventOrder",{}),df("inputBehaviours",[ff,Yg]),to("selectOnFocus",!0)]),Fw=function(t){return cc([Yg.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=Ru(e);e.dom.setSelectionRange(0,n.length)}:h})])},Vw=function(t){return _(_({},Fw(t)),gf(t.inputBehaviours,[ff.config({store:_(_({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return Ru(t.element)},setValue:function(t,e){Ru(t.element)!==e&&Nu(t.element,e)}}),onSetValue:t.onSetValue})]))},jw=function(t){return{tag:t.tag,attributes:_({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Uw=gd({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(t,o){"object"==typeof n&&void 0!==r?r.exports=o():"function"==typeof e&&e.amd?e(o):(t="undefined"!=typeof globalThis?globalThis:t||self).EphoxContactWrapper=o()}(this,(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},n={exports:{}};!function(t){!function(e){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._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 a(e.promise,t)}u(e.promise,r)}else(1===t._state?u:a)(e.promise,t._value)}))):t._deferreds.push(e)}function u(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 o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){a(t,e)}var r,i}function a(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,a(e,t))}))}catch(t){if(n)return;n=!0,a(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((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])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},t.exports?t.exports=o:e.Promise||(e.Promise=o)}(e)}(n);var r=n.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||r}}))}(void 0,Ww,qw);var Gw,$w=qw.exports.boltExport,Xw=function(t){var e=z.none(),n=[],r=function(t){o()?u(t):n.push(t)},o=function(){return e.isSome()},i=function(t){W(t,u)},u=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=z.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=Pt(t);return H(tx,e)},nx=function(t,e){var n=e.getRoot(t).getOr(t.element);Eu(n,e.invalidClass),e.notify.each((function(e){ex(t.element)&&Ne(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){Fi(t,e.validHtml)})),e.onValid(t)}))},rx=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);_u(o,e.invalidClass),e.notify.each((function(e){ex(t.element)&&Ne(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){Fi(t,r)})),e.onInvalid(t,r)}))},ox=function(t,e,n){return e.validator.fold((function(){return Zw(Nn.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),Nn.error(n)}),(function(n){return nx(t,e),Nn.value(n)})):Nn.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 Au(n,e.invalidClass)}}),ax=Object.freeze({__proto__:null,events:function(t,e){return t.validator.map((function(e){return ki([Ti(e.onEvent,(function(e){ix(e,t).get(b)}))].concat(e.validateOnLoad?[Bi((function(e){ix(e,t).get(h)}))]:[]))})).getOr({})}}),cx=[Lr("invalidClass"),to("getRoot",z.none),Zr("notify",[to("aria","alert"),to("getContainer",z.none),to("validHtml",""),pa("onValid"),pa("onInvalid"),pa("onValidate")]),Zr("validator",[Lr("validate"),to("onEvent","input"),to("validateOnLoad",!0)])],sx=lc({fields:cx,name:"invalidating",active:ax,apis:ux,extra:{validation:function(t){return function(e){var n=ff.getValue(e);return Zw(t(n))}}}}),lx=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),fx=[Hr("others",Ar(Nn.value,br()))],dx=lc({fields:fx,name:"coupling",apis:lx,state:Object.freeze({__proto__:null,init:function(){var t={},e=v({});return lu({readState:e,getOrCreate:function(e,n,r){var o=lt(n.others);if(o)return yt(t,r).getOrThunk((function(){var o=yt(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(jf({name:mx(),overrides:v({dom:{tag:"div"},behaviours:cc([Cl.config({useFixed:k})]),events:ki([Ri(Po()),Ri(Ao()),Ri(Fo())])})}));!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 z.from(Dh.sketch(_(_({},i.menu()),{uid:tu(""),data:t,highlightImmediately:u===Gw.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Cl.position(r,e,{anchor:n}),Wl.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Cl.position(r,n,{anchor:{type:"submenu",item:e}}),Wl.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Cl.position(o,e,{anchor:n}),W(r,(function(t){Cl.position(o,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})}))},onEscape:function(){return Yg.focus(r),Wl.close(o),z.some(!0)}})))}))}))}(t,e,bx(t,n),n,r,o,u).map((function(t){return t.fold((function(){Wl.isOpen(r)&&Wl.close(r)}),(function(t){Wl.cloak(r),Wl.open(r,t),i(r)})),r}))},wx=function(t,e,n,r,o,i,u){return Wl.close(r),Zw(r)},xx=function(t,e,n,r,o,i){var u=dx.getCoupled(n,"sandbox");return(Wl.isOpen(u)?wx:yx)(t,e,n,u,r,o,i)},Cx=function(t,e,n){var r=yd.getCurrent(e).getOr(e),o=an(t.element);n?Fe(r.element,"min-width",o+"px"):function(t,e){un.set(t,e)}(r.element,o)},Sx=function(t,e){return t.getSystem().getByUid(e.uid+"-"+mx()).map((function(t){return function(){return Nn.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return Nn.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){Wl.getState(t).each((function(t){Dh.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:pf(t.sandboxBehaviours,[ff.config({store:{mode:"memory",initialValue:e}}),Wl.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()}}),yd.config({find:function(t){return Wl.getState(t).bind((function(t){return yd.getCurrent(t)}))}}),gc.config({channels:_(_({},Kl({isExtraPart:S})),Jl({doReposition:kx}))})])}},_x=function(t){var e=dx.getCoupled(t,"sandbox");kx(e)},Tx=function(){return[to("sandboxClasses",[]),hf("sandboxBehaviours",[yd,gc,Wl,ff])]},Ex=v([Lr("dom"),Lr("fetch"),pa("onOpen"),va("onExecute"),to("getHotspot",z.some),to("getAnchorOverrides",v({})),fs(),df("dropdownBehaviours",[ch,dx,Hg,Yg]),Lr("toggleClass"),to("eventOrder",{}),$r("lazySink"),to("matchWidth",!1),to("useMinWidth",!1),$r("role")].concat(Tx())),Ax=v([Vf({schema:[ma()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),gx()]),Dx=hd({name:"Dropdown",configFields:Ex(),partFields:Ax(),factory:function(t,e,n,r){var o,i,u=function(t){Wl.getState(t).each((function(t){Dh.highlightPrimary(t)}))},a={expand:function(e){ch.isOn(e)||xx(t,b,e,r,h,Gw.HighlightNone).get(h)},open:function(e){ch.isOn(e)||xx(t,b,e,r,h,Gw.HighlightFirst).get(h)},isOpen:ch.isOn,close:function(e){ch.isOn(e)&&xx(t,b,e,r,h,Gw.HighlightFirst).get(h)},repositionMenus:function(t){ch.isOn(t)&&_x(t)}},c=function(t,e){return wi(t),z.some(!0)};return{uid:t.uid,dom:t.dom,components:e,behaviours:gf(t.dropdownBehaviours,[ch.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),dx.config({others:{sandbox:function(e){return Ox(t,e,{onOpen:function(){return ch.on(e)},onClose:function(){return ch.off(e)}})}}}),Hg.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 z.some(!0)},onEscape:function(t,e){return Dx.isOpen(t)?(Dx.close(t),z.some(!0)):z.none()}}),Yg.config({})]),events:lh(z.some((function(e){xx(t,b,e,r,u,Gw.HighlightFirst).get(h)}))),eventOrder:_(_({},t.eventOrder),(o={},o[Jo()]=["disabling","toggling","alloy.base.behaviour"],o)),apis:a,domModification:{attributes:_(_({"aria-haspopup":"true"},t.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===t.dom.tag?{type:(i="type",yt(t.dom,"attributes").bind((function(t){return yt(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 ki([Oi(Wo(),k)])},exhibit:function(){return du({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),Rx=lc({fields:[],name:"unselecting",active:Mx}),Nx=$i("color-input-change"),zx=$i("color-swatch-change"),Bx=$i("color-picker-cancel"),Px=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}),vb(),Sw.config({}),sx.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return he(t.element)},notify:{onValid:function(t){var e=ff.getValue(t);yi(t,Nx,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=ff.getValue(t);if(0===e.length)return Zw(Nn.value(!0));var n=zt.fromTag("span");Fe(n,"background-color",e);var r=qe(n,"background-color").fold((function(){return Nn.error("blah")}),(function(t){return Nn.value(e)}));return Zw(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return Ew(t,e.providers)})),i=function(t,e){yi(t,zx,{value:e})},u=Qh(function(t,e){return Dx.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:cc([yb(e.providers.isDisabled),vb(),Rx.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 z.from(tw(Yn(zy($i("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,Kp.CLOSE_ON_EXECUTE,S,e.providers),{movement:Py(t.columns,t.presets)})))}))},parts:{menu:uv(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:Ay(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 bi(t,Bx)}),(function(e){i(t,e),ky(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([qg("form-field-events",[Ti(Nx,(function(e,n){u.getOpt(e).each((function(t){Fe(t.element,"background-color",n.event.color)})),yi(e,Aw,{name:t.name})})),Ti(zx,(function(t,e){ww.getField(t).each((function(n){ff.setValue(n,e.event.value),yd.getCurrent(t).each(Yg.focus)}))})),Ti(Bx,(function(t,e){ww.getField(t).each((function(e){yd.getCurrent(t).each(Yg.focus)}))}))])])})},Ix=jf({schema:[Lr("dom")],name:"label"}),Lx=function(t){return jf({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:ki([Ei(Oo(),(function(e,n,r){return t(e,r)}),[e]),Ei(Ao(),(function(e,n,r){return t(e,r)}),[e]),Ei(Do(),(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=Ff({name:"thumb",defaults:v({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:ki([Di(Oo(),t,"spectrum"),Di(_o(),t,"spectrum"),Di(To(),t,"spectrum"),Di(Ao(),t,"spectrum"),Di(Do(),t,"spectrum"),Di(Ro(),t,"spectrum")])}}}),Xx=Ff({schema:[Pr("mouseIsDown",(function(){return so(!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([Hg.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)}}),Yg.config({})]),events:ki([Ti(Oo(),n),Ti(_o(),n),Ti(Ao(),n),Ti(Do(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}}),Kx=[Ix,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?z.some(n.touches[0]).map((function(t){return en(t.clientX,t.clientY)})):z.none()}var r=e;return void 0!==r.clientX?z.some(r).map((function(t){return en(t.clientX,t.clientY)})):z.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){yi(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)},_C=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},TC=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=TC(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 TC(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]},RC=function(t){var e=DC(t);return MC(e,"left")},NC=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")},PC=function(t){var e=DC(t);return MC(e,"width")},IC=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){yi(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:RC(t),maxBound:NC(t),screenRange:PC(t)};return EC(r)},WC=function(t){return function(e,n){return function(t,e,n){var r=(t>0?_C:OC)(wC(n).x,Qx(n),nC(n),fC(n));return VC(e,jC(r)),z.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=PC(t),u=r.bind((function(e){return z.some(HC(e,t))})).getOr(0),a=o.bind((function(e){return z.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:RC(t),minOffset:0,maxBound:NC(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return AC(c)}(e,i,n,r,o);return RC(e)-RC(t)+u},GC=WC(-1),$C=WC(1),XC=z.none,KC=z.none,YC={"top-left":z.none(),top:z.none(),"top-right":z.none(),right:z.some((function(t,e){kC(t,xC(oC(e)))})),"bottom-right":z.none(),bottom:z.none(),"bottom-left":z.none(),left:z.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=an(e.element)/2;Fe(e.element,"left",i-u+"px")},onLeft:GC,onRight:$C,onUp:XC,onDown:KC,edgeActions:YC}),QC=function(t,e){yi(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:IC(t)};return EC(r)},eS=function(t){return function(e,n){return function(t,e,n){var r=(t>0?_C:OC)(wC(n).y,Zx(n),rC(n),fC(n));return QC(e,ZC(r)),z.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=IC(t),u=r.bind((function(e){return z.some(FC(e,t))})).getOr(0),a=o.bind((function(e){return z.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=z.none,oS=z.none,iS=eS(-1),uS=eS(1),aS={"top-left":z.none(),top:z.some((function(t,e){kC(t,CC(eC(e)))})),"top-right":z.none(),right:z.none(),"bottom-right":z.none(),bottom:z.some((function(t,e){kC(t,CC(iC(e)))})),"bottom-left":z.none(),left:z.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=Qe(e.element)/2;Fe(e.element,"top",i-u+"px")},onLeft:rS,onRight:oS,onUp:iS,onDown:uS,edgeActions:aS}),sS=function(t,e){yi(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?_C: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)),z.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":z.some((function(t,e){kC(t,SC(tC(e),eC(e)))})),top:z.some((function(t,e){kC(t,SC(sC(e),eC(e)))})),"top-right":z.some((function(t,e){kC(t,SC(oC(e),eC(e)))})),right:z.some((function(t,e){kC(t,SC(oC(e),lC(e)))})),"bottom-right":z.some((function(t,e){kC(t,SC(oC(e),iC(e)))})),bottom:z.some((function(t,e){kC(t,SC(sC(e),iC(e)))})),"bottom-left":z.some((function(t,e){kC(t,SC(tC(e),iC(e)))})),left:z.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=an(e.element)/2,c=Qe(e.element)/2;Fe(e.element,"left",i-a+"px"),Fe(e.element,"top",u-c+"px")},onLeft:dS,onRight:mS,onUp:gS,onDown:hS,edgeActions:pS}),bS=hd({name:"Slider",configFields:[to("stepSize",1),to("onChange",h),to("onChoose",h),to("onInit",h),to("onDragStart",h),to("onDragEnd",h),to("snapToGrid",!1),to("rounded",!0),$r("snapStart"),Hr("model",zr("mode",{x:[to("minX",0),to("maxX",100),Pr("value",(function(t){return so(t.mode.minX)})),Lr("getInitialValue"),wa("manager",JC)],y:[to("minY",0),to("maxY",100),Pr("value",(function(t){return so(t.mode.minY)})),Lr("getInitialValue"),wa("manager",cS)],xy:[to("minX",0),to("maxX",100),to("minY",0),to("maxY",100),Pr("value",(function(t){return so({x:t.mode.minX,y:t.mode.minY})})),Lr("getInitialValue"),wa("manager",vS)]})),df("sliderBehaviours",[Hg,ff]),Pr("mouseIsDown",(function(){return so(!1)}))],partFields:Kx,factory:function(t,e,n,r){var o,i=function(e){return ed(e,t,"thumb")},u=function(e){return ed(e,t,"spectrum")},a=function(e){return td(e,t,"left-edge")},c=function(e){return td(e,t,"right-edge")},s=function(e){return td(e,t,"top-edge")},l=function(e){return td(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&&td(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:gf(t.sliderBehaviours,[Hg.config({mode:"special",focusIn:function(e){return td(e,t,"spectrum").map(Hg.focusIn).map(k)}}),ff.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),gc.config({channels:(o={},o[$l()]={onReceive:h},o)})]),events:ki([Ti(Yx(),(function(e,n){!function(e,n){g(e,n);var r=i(e);t.onChange(e,r,n),z.some(!0)}(e,n.event.value)})),Bi((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())})),Ti(Oo(),p),Ti(To(),v),Ti(Ao(),p),Ti(Ro(),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=$i("rgb-hex-update"),wS=$i("slider-update"),xS=$i("palette-update"),CS=[df("formBehaviours",[ff])],SS=function(t){return"<alloy.field."+t+">"},kS=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:gf(t.formBehaviours,[ff.config({store:{mode:"manual",getValue:function(e){var n=rd(e,t);return mt(n,(function(t,e){return t().bind((function(t){var n,r,o=yd.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Ui(t.element)),n.fold((function(){return Nn.error(r)}),Nn.value)})).map(ff.getValue)}))},setValue:function(e,n){dt(n,(function(n,r){td(e,t,r).each((function(t){yd.getCurrent(t).each((function(t){ff.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return td(e,t,n).bind(yd.getCurrent)}}}},OS={getField:cu((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),Kf("form",SS(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=U(r,(function(t){return Ff({name:t,pname:SS(t)})}));return ld("form",CS,o,kS,n)}},_S=$i("valid-input"),TS=$i("invalid-input"),ES=$i("validating-input"),AS=function(t,e,n,r){var o=function(n,r){return sx.config({invalidClass:e("invalid"),notify:{onValidate:function(t){yi(t,ES,{type:n})},onValid:function(t){yi(t,_S,{type:n,value:ff.getValue(t)})},onInvalid:function(t){yi(t,TS,{type:n,value:ff.getValue(t)})}},validator:{validate:function(e){var n=ff.getValue(e),o=r(n)?Nn.value(!0):Nn.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:_({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;ff.setValue(t,{red:n,green:r,blue:o})},a=Qh({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),c=function(t,e){a.getOpt(t).each((function(t){Fe(t.element,"background-color","#"+e.value)}))};return gd({factory:function(){var o={red:so(z.some(255)),green:so(z.some(255)),blue:so(z.some(255)),hex:so(z.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",z.some(e)),l("green",z.some(n)),l("blue",z.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,z.none()):r(t)},m=function(t,e,n){var r=parseInt(n,10);l(e,z.some(r)),s("red").bind((function(t){return s("green").bind((function(e){return s("blue").map((function(n){return oy(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=Qb(e);return OS.getField(t,"hex").each((function(e){Yg.isFocused(e)||ff.setValue(t,{hex:n.value})})),n}(t,e);yi(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=qb(e);l("hex",z.some(e));var o=ay(r);u(t,o),f(o),yi(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 Yn(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(iy,"red",p.label,p.description,255))),n.field("green",ww.sketch(i(iy,"green",v.label,v.description,255))),n.field("blue",ww.sketch(i(iy,"blue",b.label,b.description,255))),n.field("hex",ww.sketch(i(Xb,"hex",y.label,y.description,"ffffff"))),a.asSpec()],formBehaviours:cc([sx.config({invalidClass:e("form-invalid")}),qg("rgb-form-events",[Ti(_S,g),Ti(TS,d),Ti(ES,d)])])}})),{apis:{updateHex:function(t,e){ff.setValue(t,{hex:e.value}),function(t,e){var n=ay(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 gd({factory:function(t){var i=v({x:0,y:0}),u=cc([yd.config({find:z.some}),Yg.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){yi(t,xS,{value:n})},onInit:function(t,e,n,r){o(n.element.dom,ly(fy))},sliderBehaviours:u})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom,r=my(e,100,100),i=uy(r);o(n,ly(i))}(e,n)},setThumb:function(t,e,n){!function(t,e){var n=gy(ay(e));bS.setValue(t,{x:n.saturation,y:100-n.value})}(e,n)}},extraApis:{}})},MS=function(t,e){return gd({name:"ColourPicker",configFields:[Lr("dom"),to("onValidHex",h),to("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:so(fy),paletteHue:so(0)},c=Qh(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([Yg.config({})]),onChange:function(t,e,n){yi(t,wS,{value:n})}})}(0,e)),s=Qh(i.sketch({})),l=Qh(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=ay(t);a.paletteRgba.set(n),a.paletteHue.set(e)}(e,n),W(r,(function(r){r(t,e,n)}))};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),l.asSpec()],behaviours:cc([qg("colour-picker-events",[Ti(yS,(r=[f,m,g],function(t,e){var n=e.event.hex,o=function(t){return gy(ay(t))}(n);h(t,n,o.hue,r)})),Ti(xS,function(){var t=[d];return function(e,n){var r=n.event.value,o=a.paletteHue.get(),i=my(o,r.x,100-r.y),u=hy(i);h(e,u,o,t)}}()),Ti(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=gy(o),u=my(r,i.saturation,i.value),c=hy(u);h(e,c,r,t)}}())]),yd.config({find:function(t){return l.getOpt(t)}}),Hg.config({mode:"acyclic"})])}}})},RS=function(){return yd.config({find:z.some})},NS=function(t){return yd.config({find:t.getOpt})},zS=function(t){return yd.config({find:function(e){return be(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"},PS=function(t){return function(t){return BS[t]}(t)},IS=tinymce.util.Tools.resolve("tinymce.Resource"),LS=tinymce.util.Tools.resolve("tinymce.util.Tools"),HS=mr([to("preprocess",b),to("postprocess",b)]),FS=function(t,e,n){return ff.config(Yn({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=Rr("RepresentingConfigs.memento processors",HS,e);return ff.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=ff.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);ff.setValue(i,o)}}})},US=FS,WS=function(t){return VS(t,Hi,Fi)},qS=function(t){return ff.config({store:{mode:"memory",initialValue:t}})},GS=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){W(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){ff.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 G(ct(t),(function(t){return F(n,(function(e){return At(t.name.toLowerCase(),"."+e.toLowerCase())}))}))}(r,e)),yi(n,Aw,{name:t.name})},a=Qh({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:cc([qg("input-file-events",[Ri(Fo()),Ri(Zo())])])}),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([]),RS(),Nd.config({}),ch.config({toggleClass:"dragenter",toggleOnExecute:!1}),qg("dropzone-events",[Ti("dragenter",r([n,ch.toggle])),Ti("dragleave",r([n,ch.toggle])),Ti("dragover",n),Ti("drop",r([n,o])),Ti(Ho(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Jh.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({}),yb(e.isDisabled),vb()])})]}]}}}});return Ow(c,s,["tox-form__group--stretched"],[])},$S=$i("alloy-fake-before-tabstop"),XS=$i("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([Yg.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){yi(t,Po(),{raw:{which:9,shiftKey:e}})},QS=function(t,e){var n=e.element;Au(n,$S)?JS(t,!0):Au(n,XS)&&JS(t,!1)},ZS=function(t){return nw(t,["."+$S,"."+XS].join(","),S)},tk=!(ie().browser.isIE()||ie().browser.isEdge()),ek=function(t,e){var n=tk&&t.sandboxed,r=_(_({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=so("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)Ne(n.element,"srcdoc",r);else{Ne(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({}),Yg.config({}),US(z.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=function(t){return new $w((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return z.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 z.some(new Blob(c,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))},sk=function(t,e,n){return e=e||"image/png",d(HTMLCanvasElement.prototype.toBlob)?new $w((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):ck(t.toDataURL(e,n))},lk=function(t){return function(t){return new $w((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){fk(t);var e=nk(uk(t),ak(t));return ok(e).drawImage(t,0,0),e}))},fk=function(t){URL.revokeObjectURL(t.src)},dk=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 $w.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return sk(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)}}},mk=function(t){return function(t){return new $w((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return dk(lk(t),t,e)}))},gk=function(t,e){return sk(t,e).then((function(e){return dk($w.resolve(t),e,t.toDataURL())}))},hk=function(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r},pk=[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],vk=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},bk=function(t,e){return t.toCanvas().then((function(n){return yk(n,t.getType(),e)}))},yk=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],_=e[19],T=0;T<u.length;T+=4)n=u[T],r=u[T+1],o=u[T+2],i=u[T+3],u[T]=n*a+r*c+o*s+i*l+f,u[T+1]=n*d+r*m+o*g+i*h+p,u[T+2]=n*v+r*b+o*y+i*w+x,u[T+3]=n*C+r*S+o*k+i*O+_;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),gk(t,e)},wk=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),gk(t,e)},xk=function(t){return function(e,n){return bk(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))}},Ck=function(t){return function(e){return bk(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]),Sk=xk((function(t,e){return e=hk(255*e,-255,255),vk(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])})),kk=xk((function(t,e){var n;return e=hk(e,-1,1),n=(e*=100)<0?127+e/100*127:127*(n=0===(n=e%1)?pk[e]:pk[Math.floor(e)]*(1-n)+pk[Math.floor(e)+1]*n)+127,vk(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])})),Ok=function(t,e,n,r){return bk(t,function(t,e,n,r){return e=hk(e,0,2),n=hk(n,0,2),r=hk(r,0,2),vk(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 wk(n,t.getType(),e)}))}(t,hx)}),Tk=(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),gk(t,e)}(n,t.getType(),e)}))}),Ek=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=Ak(t,i,u);return a?c.then((function(t){return Ek(t,e,n)})):c},Ak=function(t,e,n){return new $w((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)}))},Dk=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},Mk=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=Dk(Math.abs(o*a)+Math.abs(i*u)),s=Dk(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),gk(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)),gk(r,e)},Nk=function(t,e,n,r,o,i){var u=nk(o,i);return ok(u).drawImage(t,-n,-r),gk(u,e)},zk=function(t){return Ck(t)},Bk=function(t){return _k(t)},Pk=function(t,e){return Tk(t,e)},Ik=function(t,e){return Sk(t,e)},Lk=function(t,e){return kk(t,e)},Hk=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return Rk(n,t.getType(),e)}))}(t,e)},Fk=function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then((function(i){return Nk(i,t.getType(),e,n,r,o)}))}(t,e,n,r,o)},Vk=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return Ek(r,e,n).then((function(e){return gk(e,t.getType())}))}))}(t,e,n)},jk=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return Mk(n,t.getType(),e)}))}(t,e)},Uk=function(t,e,n){return ap(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},Wk=function(t,e){return Uk(t,e,[])},qk=function(t,e){return Uk(t,e,[Wg.config({})])},Gk=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:cc([Wg.config({})])}},$k=$i("toolbar.button.execute"),Xk=((vx={})[Jo()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],vx),Kk=$i("update-menu-text"),Yk=$i("update-menu-icon"),Jk=function(t,e,n){var r=so(h),o=t.text.map((function(t){return Qh(Gk(t,e,n.providers))})),i=t.icon.map((function(t){return Qh(qk(t,n.providers.icons))})),u=function(t,e){var n=ff.getValue(t);return Yg.focus(n),yi(n,"keydown",{raw:e.event.raw}),Dx.close(n),z.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=ap("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons);return Qh(Dx.sketch(_(_(_({},t.uid?{uid:t.uid}:{}),a),{dom:{tag:"button",classes:[e,e+"--select"].concat(U(t.classes,(function(t){return e+"--"+t}))),attributes:_({},c)},components:Tb([i.map((function(t){return t.asSpec()})),o.map((function(t){return t.asSpec()})),z.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:cc(E(E([],t.dropdownBehaviours,!0),[yb((function(){return t.disabled||n.providers.isDisabled()})),vb(),Rx.config({}),Wg.config({}),qg("dropdown-events",[Sb(t,r),kb(t,r)]),qg("menubutton-update-display-text",[Ti(Kk,(function(t,e){o.bind((function(e){return e.getOpt(t)})).each((function(t){Wg.set(t,[Vu(n.providers.translate(e.event.text))])}))})),Ti(Yk,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){Wg.set(t,[qk(e.event.icon,n.providers.icons)])}))}))])],!1)),eventOrder:Yn(Xk,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:cc([Hg.config({mode:"special",onLeft:u,onRight:u})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:uv(0,t.columns,t.presets)},fetch:function(e){return Qw(w(t.fetch,e))}}))).asSpec()},Qk=function(t){return"separator"===t.type},Zk={type:"separator"},tO=function(t,e){var n=X(t,(function(t,n){return function(t){return o(t)}(n)?""===n?t:"|"===n?t.length>0&&!Qk(t[t.length-1])?t.concat([Zk]):t:wt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&Qk(n[n.length-1])&&n.pop(),n},eO=function(t,e){return function(t){return wt(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=nO(n,e);return{item:t,menus:Yn(r.menus,go(t.value,r.items)),expansions:Yn(r.expansions,go(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}},nO=function(t,e){var n=tO(o(t)?t.split(" "):t,e);return $(n,(function(t,n){var r=function(t){if(Qk(t))return t;var e=yt(t,"value").getOrThunk((function(){return $i("generated-menu-item")}));return Yn({value:e},t)}(n),o=eO(r,e);return{menus:Yn(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Yn(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},rO=function(t,e,n,r){var o=$i("primary-menu"),i=nO(t,n.shared.providers.menuItems());if(0===i.items.length)return z.none();var u=Zy(o,i.items,e,n,r),a=mt(i.menus,(function(t,r){return Zy(r,t,e,n,!1)})),c=Yn(a,go(o,u));return z.from(Dh.tieredData(o,c,i.expansions))},oO=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?(_u(n,"tox-tbtn--enabled"),Ne(n,"aria-pressed",!0)):(Eu(n,"tox-tbtn--enabled"),Ie(n,"aria-pressed"))},isActive:function(){return Au(t.element,"tox-tbtn--enabled")}}},iO=function(t,e,n,r){return Jk({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(rO(t,Kp.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:oO,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Sw.config({})]},e,n.shared)},uO=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){vc(e.element),yi(e,Rw,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(U(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return _(_({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},aO=function(t,e,n,r,o,i){void 0===n&&(n=[]);var u=e.fold((function(){return{}}),(function(t){return{action:t}})),a=_({buttonBehaviours:cc([yb((function(){return t.disabled||i.isDisabled()})),vb(),Sw.config({}),qg("button press",[_i("click"),_i("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Yn(a,{dom:r});return Yn(c,{components:o})},cO=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 Wk(t,n.icons)})),u=Tb([i]);return aO(t,e,r,o,u,n)},sO=function(t,e,n,r){void 0===r&&(r=[]);var o=cO(t,z.some(e),n,r);return Jh.sketch(o)},lO=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 Wk(t,n.icons)})):z.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"],!0),u.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),o,!0),l=_(_({tag:"button",classes:s},c),{attributes:{title:i}});return aO(t,e,r,l,a,n)},fO=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=lO(t,z.some(e),n,r,o);return Jh.sketch(i)},dO=function(t,e){return function(n){"custom"===e?yi(n,Rw,{name:t,value:{}}):"submit"===e?bi(n,Nw):"cancel"===e?bi(n,Mw):console.error("Unknown button type: ",e)}},mO=function(t,e,n){if(function(t,e){return"menu"===e}(0,e)){var r=t,o=_(_({},t),{onSetup:function(e){return e.setDisabled(t.disabled),h},fetch:uO(r.items,(function(){return i}),n)}),i=Qh(iO(o,"tox-tbtn",n,z.none()));return i.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,e)){var u=dO(t.name,e),a=_(_({},t),{borderless:!1});return fO(a,u,n.shared.providers,[])}console.error("Unknown footer button type: ",e)},gO=function(t,e){var n,r,o=dO(t.name,"custom");return n=z.none(),r=ww.parts.field(_({factory:Jh},lO(t,z.some(o),e,[qS(""),RS()]))),Ow(n,r,[],[])},hO=v([to("field1Name","field1"),to("field2Name","field2"),ba("onLockedChange"),ga(["lockClass"]),to("locked",!1),hf("coupledFieldBehaviours",[yd,ff])]),pO=function(t,e){return Ff({factory:ww,name:t,overrides:function(t){return{fieldBehaviours:cc([qg("coupled-input-behaviour",[Ti(Lo(),(function(n){(function(t,e,n){return td(t,e,n).bind(yd.getCurrent)})(n,t,e).each((function(e){td(n,t,"lock").each((function(r){ch.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},vO=v([pO("field1","field2"),pO("field2","field1"),Ff({factory:Jh,schema:[Lr("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:cc([ch.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),bO=hd({name:"FormCoupledInputs",configFields:hO(),partFields:vO(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:pf(t.coupledFieldBehaviours,[yd.config({find:z.some}),ff.config({store:{mode:"manual",getValue:function(e){var n,r=id(e,t,["field1","field2"]);return(n={})[t.field1Name]=ff.getValue(r.field1()),n[t.field2Name]=ff.getValue(r.field2()),n},setValue:function(e,n){var r=id(e,t,["field1","field2"]);xt(n,t.field1Name)&&ff.setValue(r.field1(),n[t.field1Name]),xt(n,t.field2Name)&&ff.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return td(e,t,"field1")},getField2:function(e){return td(e,t,"field2")},getLock:function(e){return td(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)}}}),yO=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 Nn.value({value:n,unit:r})}return Nn.error(t)},wO=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return wt(n,t)};return t.unit===e?z.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?z.some(t.value):z.some(t.value/n[t.unit]*n[e]):z.none()},xO=function(t){return z.none()},CO=function(t,e){var n=yO(t).toOptional(),r=yO(e).toOptional();return kt(n,r,(function(t,e){return wO(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return wO(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(xO)})).getOr(xO)},SO=function(t,e){var n=xO,r=$i("ratio-event"),o=function(t){return ap(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=bO.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()}}),vb(),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()}}),vb(),Sw.config({}),qg("size-input-events",[Ti(zo(),(function(t,e){yi(t,r,{isField1:n})})),Ti(Ho(),(function(e,n){yi(e,Aw,{name:t.name})}))])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=bO.parts.field1(u([ww.parts.label(c("Width")),a(!0)])),l=bO.parts.field2(u([ww.parts.label(c("Height")),a(!1)]));return bO.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){yO(ff.getValue(t)).each((function(t){n(t).each((function(t){ff.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){bO.getField1(t).bind(ww.getField).each(Nd.disable),bO.getField2(t).bind(ww.getField).each(Nd.disable),bO.getLock(t).each(Nd.disable)},onEnabled:function(t){bO.getField1(t).bind(ww.getField).each(Nd.enable),bO.getField2(t).bind(ww.getField).each(Nd.enable),bO.getLock(t).each(Nd.enable)}}),vb(),qg("size-input-events2",[Ti(r,(function(t,e){var r=e.event.isField1,o=r?bO.getField1(t):bO.getField2(t),i=r?bO.getField2(t):bO.getField1(t),u=o.map(ff.getValue).getOr(""),a=i.map(ff.getValue).getOr("");n=CO(u,a)}))])])})},kO={undo:v($i("undo")),redo:v($i("redo")),zoom:v($i("zoom")),back:v($i("back")),apply:v($i("apply")),swap:v($i("swap")),transform:v($i("transform")),tempTransform:v($i("temp-transform")),transformApply:v($i("transform-apply"))},OO=v("save-state"),_O=v("disable"),TO=v("enable"),EO={formActionEvent:Rw,saveState:OO,disable:_O,enable:TO},AO=function(t,e){var n=function(t,n,r,o){return Qh(fO({name:t,text:t,disabled:r,primary:o,icon:z.none(),borderless:!1},n,e))},r=function(t,n,r,o){return Qh(sO({name:t,icon:z.some(t),tooltip:z.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){yi(t,e,n)},s=function(t){return bi(t,EO.disable())},l=function(t){return bi(t,EO.enable())},f=function(t,e){s(t),c(t,kO.transform(),{transform:e}),l(t)},d=function(t){return function(){tt.getOpt(t).each((function(t){Wg.set(t,[Q])}))}},m=function(t,e){s(t),c(t,kO.transformApply(),{transform:e,swap:d(t)}),l(t)},g=function(){return n("Back",(function(t){return c(t,kO.back(),{swap:d(t)})}),!1,!1)},p=function(){return Qh({dom:{tag:"div",classes:["tox-spacer"]},behaviours:cc([Nd.config({})])})},b=function(){return n("Apply",(function(t){return c(t,kO.apply(),{swap:d(t)})}),!0,!0)},y=[g(),p(),n("Apply",(function(e){m(e,(function(e){var n=t.getRect();return Fk(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([qg("image-tools-crop-buttons-events",[Ti(EO.disable(),(function(t,e){o(y,t)})),Ti(EO.enable(),(function(t,e){i(y,t)}))])])}),x=Qh(SO({name:"size",label:z.none(),constrain:!0,disabled:!1},e)),C=[g(),p(),x,p(),n("Apply",(function(t){x.getOpt(t).each((function(e){var n=ff.getValue(e),r=function(t,e){return function(n){return Vk(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([qg("image-tools-resize-buttons-events",[Ti(EO.disable(),(function(t,e){o(C,t)})),Ti(EO.enable(),(function(t,e){i(C,t)}))])])}),k=function(t,e){return function(n){return t(n,e)}},O=k(Hk,"h"),_=k(Hk,"v"),T=k(jk,-90),E=k(jk,90),A=function(t,e){!function(t,e){s(t),c(t,kO.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,_)}),!1),r("rotate-left","Rotate counterclockwise",(function(t){A(t,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([qg("image-tools-fliprotate-buttons-events",[Ti(EO.disable(),(function(t,e){o(D,t)})),Ti(EO.enable(),(function(t,e){i(D,t)}))])])}),R=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 Qh(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([Yg.config({})]),onChoose:n}))},N=function(t,e,n,r,o){return R(t,(function(t,n,r){var o=k(e,r.x/100);f(t,o)}),n,r,o)},B=function(t,e,n,r,a){var c=function(t,e,n,r,o){return[g(),N(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([qg("image-tools-filter-panel-buttons-events",[Ti(EO.disable(),(function(t,e){o(c,t)})),Ti(EO.enable(),(function(t,e){i(c,t)}))])])})},P=[g(),p(),b()],I=pw.sketch({dom:u,components:P.map((function(t){return t.asSpec()}))}),L=B("Brightness",Ik,-100,0,100),H=B("Contrast",Lk,-100,0,100),F=B("Gamma",Pk,-100,0,100),V=function(t,e,n){return function(r){return function(t,e,n,r){return Ok(t,e,n,r)}(r,t,e,n)}},j=function(t){return R(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=ff.getValue(e).x/100,i=ff.getValue(r).x/100,u=ff.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,kO.swap(),{transform:e,swap:function(){tt.getOpt(r).each((function(e){Wg.set(e,[t]),n(e)}))}})}},K=z.some(Bk),Y=z.some(zk),J=[r("crop","Crop",X(w,z.none(),(function(e){t.showCrop()})),!1),r("resize","Resize",X(S,z.none(),(function(e){x.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;ff.setValue(e,{width:r,height:o})}))})),!1),r("orientation","Orientation",X(M,z.none(),a),!1),r("brightness","Brightness",X(L,z.none(),a),!1),r("sharpen","Sharpen",X(I,K,a),!1),r("contrast","Contrast",X(H,z.none(),a),!1),r("color-levels","Color levels",X($,z.none(),a),!1),r("gamma","Gamma",X(F,z.none(),a),!1),r("invert","Invert",X(I,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([Wg.config({})])}),tt=Qh(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]}))}}},DO=tinymce.util.Tools.resolve("tinymce.geom.Rect"),MO=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),RO=tinymce.util.Tools.resolve("tinymce.util.Observable"),NO=tinymce.util.Tools.resolve("tinymce.util.VK"),zO=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 BO(t,e){var n,r,o,i,u=e.document||document,a=u.getElementById(e.handle||t),c=function(t){if(zO(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){zO(t),MO(u).off("mousemove touchmove",c).off("mouseup touchend",s),n.remove(),e.stop&&e.stop(t)};return MO(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);zO(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=MO("<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),MO(u).on("mousemove touchmove",c).on("mouseup touchend",s),e.start(t)})),{destroy:function(){MO(a).off()}}}var PO=0,IO=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=DO.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),MO("#"+u+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})};LS.each(a,(function(e){MO("#"+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}))};MO('<div id="'+u+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),LS.each(c,(function(t){MO("#"+u,r).append('<div id="'+u+"-"+t+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')})),LS.each(a,(function(t){MO("#"+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 BO(u,{document:r.ownerDocument,handle:u+"-"+e.name,start:function(){n=t},drag:function(t){l(e,n,t.deltaX,t.deltaY)}})})),f(t),MO(r).on("focusin focusout",(function(t){MO(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")})),MO(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 NO.LEFT:r(e,0,t,-10,0);break;case NO.RIGHT:r(e,0,t,10,0);break;case NO.UP:r(e,0,t,0,-10);break;case NO.DOWN:r(e,0,t,0,10);break;case NO.ENTER:case NO.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?MO(e,r).show():MO(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},LO=function(t){var e=Qh({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=so(1),r=Hc(),o=so({x:0,y:0,w:1,h:1}),i=so({x:0,y:0,w:1,h:1}),u=function(t,i){s.getOpt(t).each((function(t){var u=n.get(),a=an(t.element),c=Qe(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"};Ve(i,m),e.getOpt(t).each((function(t){Ve(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=zt.fromTag("img");return Ne(a,"src",e),(r=a.dom,new Sp((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=ju({element:a});Wg.replaceAt(t,1,z.some(e));var r=i.get(),c={x:0,y:0,w:a.dom.naturalWidth,h:a.dom.naturalHeight};i.set(c);var l=DO.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=an(t.element),o=Qe(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([qg("image-panel-crop-events",[Bi((function(t){s.getOpt(t).each((function(t){var e=t.element.dom,i=IO({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([Wg.config({}),qg("image-panel-events",[Bi((function(e){a(e,t)}))])])}),s=Qh(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}}}},HO=function(t,e,n,r,o){return sO({name:t,icon:z.some(e),disabled:n,tooltip:z.some(t),primary:!1,borderless:!1},r,o)},FO=function(t,e){e?Nd.enable(t):Nd.disable(t)};var VO,jO=function(t){var e,n,r,o,i=so(t),u=Hc(),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()}}}},UO=function(t,e){var n=jO(t.currentState),r=function(t){var e=n.getHistoryStates();d.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),yi(t,EO.formActionEvent,{name:EO.saveState(),value:e.undoEnabled})},o=function(t){return t.toBlob()},i=function(t){yi(t,EO.formActionEvent,{name:EO.disable(),value:{}})},u=function(t){m.getApplyButton(t).each((function(t){Nd.enable(t)})),yi(t,EO.formActionEvent,{name:EO.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 mk(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=LO(t.currentState.url),d=function(t){var e=Qh(HO("Undo","undo",!0,(function(t){yi(t,kO.undo(),{direction:1})}),t)),n=Qh(HO("Redo","redo",!0,(function(t){yi(t,kO.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(),HO("Zoom in","zoom-in",!1,(function(t){yi(t,kO.zoom(),{direction:1})}),t),HO("Zoom out","zoom-out",!1,(function(t){yi(t,kO.zoom(),{direction:-1})}),t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){FO(t,r)})),n.getOpt(t).each((function(t){FO(t,o)}))}}}(e),m=AO(f,e);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[m.memContainer.asSpec(),f.memContainer.asSpec(),d.container],behaviours:cc([ff.config({store:{mode:"manual",getValue:function(){return n.getBlobState()}}}),qg("image-tools-events",[Ti(kO.undo(),(function(t,e){var o=n.undo();a(t,o).then((function(e){u(t),r(t)}))})),Ti(kO.redo(),(function(t,e){var o=n.redo();a(t,o).then((function(e){u(t),r(t)}))})),Ti(kO.zoom(),(function(t,e){var n=e.event.direction;f.zoom(t,n)})),Ti(kO.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()})),Ti(kO.apply(),(function(t,e){n.applyTempState((function(){l(t),(0,e.event.swap)()}))})),Ti(kO.transform(),(function(t,e){return s(t,e.event.transform,h)})),Ti(kO.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)})),Ti(kO.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)})),Ti(kO.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)}))}))]),RS()])}},WO=function(t){return!wt(t,"items")},qO=function(t,e,n,r){return U(n,(function(n){return WO(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){ff.setValue(t,n.value),yi(t,Aw,{name:e}),Yg.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return qO(t,e,n.items,r)}}}))},GO=function(t,e){return st(t,(function(t){return WO(t)?Ot(t.value===e,t):GO(t.items,e)}))},$O=gd({name:"HtmlSelect",configFields:[Lr("options"),df("selectBehaviours",[Yg,ff]),to("selectClasses",[]),to("selectAttributes",{}),$r("data")],factory:function(t,e){var n=U(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return go("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:gf(t.selectBehaviours,[Yg.config({}),ff.config({store:_({mode:"manual",getValue:function(t){return Ru(t.element)},setValue:function(e,n){K(t.options,(function(t){return t.value===n})).isSome()&&Nu(e.element,n)}},r)})])}}}),XO=function(t,e){var n=t.label.map((function(t){return Ew(t,e)})),r=[Nd.config({disabled:function(){return t.disabled||e.isDisabled()}}),vb(),Hg.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return bi(t,Nw),z.some(!0)}}),qg("textfield-change",[Ti(Lo(),(function(e,n){yi(e,Aw,{name:t.name})})),Ti(Ko(),(function(e,n){yi(e,Aw,{name:t.name})}))]),Sw.config({})],o=t.validation.map((function(t){return sx.config({getRoot:function(t){return he(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=ff.getValue(e),r=t.validator(n);return Zw(!0===r?Nn.value(n):Nn.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=_(_({},i),u),c=ww.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:a,inputClasses:[t.classname],inputBehaviours:cc(J([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)}}),vb()];return Ow(n,c,s,l)},KO=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return ki([Ti(t.event,n),Pi((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Ti(t,(function(){return e.cancel()}))]})).getOr([])))}}),YO=function(t){var e=so(null);return lu({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()}})},JO=Object.freeze({__proto__:null,throttle:YO,init:function(t){return t.stream.streams.state(t)}}),QO=[Hr("stream",zr("mode",{throttle:[Lr("delay"),to("stopEvent",!0),wa("streams",{setup:function(t,e){var n=t.stream,r=dp(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:YO})]})),to("event","input"),$r("cancelEvent"),ba("onStream")],ZO=lc({fields:QO,name:"streaming",active:KO,state:JO}),t_=function(t,e,n){var r=ff.getValue(n);ff.setValue(e,r),n_(e)},e_=function(t,e){var n=t.element,r=Ru(n),o=n.dom;"number"!==ze(n,"type")&&e(o,r)},n_=function(t){e_(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},r_=function(t,e,n){if(t.selectsOver){var r=ff.getValue(e),o=t.getDisplayText(r),i=ff.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?z.some((function(){t_(0,e,n),function(t,e){e_(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):z.none()}return z.none()},o_=v("alloy.typeahead.itemexecute"),i_=v([$r("lazySink"),Lr("fetch"),to("minChars",5),to("responseTime",1e3),pa("onOpen"),to("getHotspot",z.some),to("getAnchorOverrides",v({})),to("layouts",z.none()),to("eventOrder",{}),co("model",{},[to("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),to("selectsOver",!0),to("populateFromBrowse",!0)]),pa("onSetValue"),va("onExecute"),pa("onItemExecute"),to("inputClasses",[]),to("inputAttributes",{}),to("inputStyles",{}),to("matchWidth",!0),to("useMinWidth",!1),to("dismissOnBlur",!0),ga(["openClass"]),$r("initialData"),df("typeaheadBehaviours",[Yg,ff,ZO,Hg,ch,dx]),Pr("previewing",(function(){return so(!0)}))].concat(Hw()).concat(Tx())),u_=v([Vf({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){r_(t.model,r,n).fold((function(){return Wd.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&t_(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return yi(t,o_(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&t_(t.model,e,n)}))}}}})]),a_=hd({name:"Typeahead",configFields:i_(),partFields:u_(),factory:function(t,e,n,r){var o=function(e,n,o){t.previewing.set(!1);var i=dx.getCoupled(e,"sandbox");if(Wl.isOpen(i))yd.getCurrent(i).each((function(t){Wd.getHighlighted(t).fold((function(){o(t)}),(function(){Si(i,t.element,"keydown",n)}))}));else{yx(t,u(e),e,i,r,(function(t){yd.getCurrent(t).each(o)}),Gw.HighlightFirst).get(h)}},i=Fw(t),u=function(t){return function(e){return e.map((function(e){var n=bt(e.menus),r=Q(n,(function(t){return G(t.items,(function(t){return"item"===t.type}))}));return ff.getState(t).update(U(r,(function(t){return t.data}))),e}))}},a=[Yg.config({}),ff.config({onSetValue:t.onSetValue,store:_({mode:"dataset",getDataKey:function(t){return Ru(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){Nu(e.element,t.model.getDisplayText(n))}},t.initialData.map((function(t){return go("initialValue",t)})).getOr({}))}),ZO.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,n){var o=dx.getCoupled(e,"sandbox");if(Yg.isFocused(e)&&Ru(e.element).length>=t.minChars){var i=yd.getCurrent(o).bind((function(t){return Wd.getHighlighted(t).map(ff.getValue)}));t.previewing.set(!0);yx(t,u(e),e,o,r,(function(e){yd.getCurrent(o).each((function(e){i.fold((function(){t.model.selectsOver&&Wd.highlightFirst(e)}),(function(t){Wd.highlightBy(e,(function(e){return ff.getValue(e).value===t.value})),Wd.getHighlighted(e).orThunk((function(){return Wd.highlightFirst(e),z.none()}))}))}))}),Gw.HighlightFirst).get(h)}},cancelEvent:ni()}),Hg.config({mode:"special",onDown:function(t,e){return o(t,e,Wd.highlightFirst),z.some(!0)},onEscape:function(t){var e=dx.getCoupled(t,"sandbox");return Wl.isOpen(e)?(Wl.close(e),z.some(!0)):z.none()},onUp:function(t,e){return o(t,e,Wd.highlightLast),z.some(!0)},onEnter:function(e){var n=dx.getCoupled(e,"sandbox"),r=Wl.isOpen(n);if(r&&!t.previewing.get())return yd.getCurrent(n).bind((function(t){return Wd.getHighlighted(t)})).map((function(t){return yi(e,o_(),{item:t}),!0}));var o=ff.getValue(e);return bi(e,ni()),t.onExecute(n,e,o),r&&Wl.close(n),z.some(!0)}}),ch.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),dx.config({others:{sandbox:function(e){return Ox(t,e,{onOpen:function(){return ch.on(e)},onClose:function(){return ch.off(e)}})}}}),qg("typeaheadevents",[Li((function(e){var n=h;xx(t,u(e),e,r,n,Gw.HighlightFirst).get(h)})),Ti(o_(),(function(e,n){var r=dx.getCoupled(e,"sandbox");t_(t.model,e,n.event.item),bi(e,ni()),t.onItemExecute(e,r,n.event.item,ff.getValue(e)),Wl.close(r),n_(e)}))].concat(t.dismissOnBlur?[Ti(Xo(),(function(t){var e=dx.getCoupled(t,"sandbox");wc(e.element).isNone()&&Wl.close(e)}))]:[]))];return{uid:t.uid,dom:jw(Yn(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:_(_({},i),gf(t.typeaheadBehaviours,a)),eventOrder:t.eventOrder}}}),c_=function(t){return _(_({},t),{toCached:function(){return c_(t.toCached())},bindFuture:function(e){return c_(t.bind((function(t){return t.fold((function(t){return Zw(Nn.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return c_(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return c_(t.map((function(t){return t.map(e)})))},mapError:function(e){return c_(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 c_(Qw((function(r){var o=!1,i=setTimeout((function(){o=!0,r(Nn.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},s_=function(t){return c_(Qw(t))},l_=s_,f_={type:"separator"},d_=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:h}},m_=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:h}},g_=function(t,e){return function(t){return U(t,d_)}(function(t,e){return G(e,(function(e){return e.type===t}))}(t,e))},h_=function(t){return g_("header",t.targets)},p_=function(t){return g_("anchor",t.targets)},v_=function(t){return z.from(t.anchorTop).map((function(t){return m_("<top>",t)})).toArray()},b_=function(t){return z.from(t.anchorBottom).map((function(t){return m_("<bottom>",t)})).toArray()},y_=function(t,e){var n=t.toLowerCase();return G(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return Tt(e.toLowerCase(),n)||Tt(t.value.toLowerCase(),n)}))},w_=function(t,e,n){var r=ff.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=y_(o,function(t){return U(t,(function(t){return m_(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,y_(o,h_(e)),y_(o,J([v_(e),p_(e),b_(e)]))],X(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(f_,e)}),[])):i}))},x_=$i("aria-invalid"),C_=function(t){return function(e,n,r){return yt(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},S_={bar:C_((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:U(t.items,e.interpreter)}}(t,e.shared)})),collection:C_((function(t,e){return Lw(t,e.shared.providers)})),alertbanner:C_((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:[Jh.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:op(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){yi(e,Rw,{name:"alert-banner",value:t.url})},buttonBehaviours:cc([ip()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:C_((function(t,e){return function(t,e){return XO({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:z.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:C_((function(t,e){return function(t,e){return XO({name:t.name,multiline:!0,label:t.label,inputMode:z.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:z.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:C_((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=U(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:cc([RS(),Wg.config({}),WS(z.none()),Hg.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=Yn(n,{source:"dynamic"});return C_(t)(e,o,r)}}((function(t,e){return ek(t,e.shared.providers)})),button:C_((function(t,e){return gO(t,e.shared.providers)})),checkbox:C_((function(t,e){return function(t,e){var n=ff.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(),z.some(!0)},o=ww.parts.field({factory:{sketch:b},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:cc([RS(),Nd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Sw.config({}),Yg.config({}),n,Hg.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),qg("checkbox-events",[Ti(Ho(),(function(e,n){yi(e,Aw,{name:t.name})}))])])}),i=ww.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:cc([Rx.config({})])}),u=function(t){return ap("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},a=Qh({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)}}),vb()])})}(t,e.shared.providers)})),colorinput:C_((function(t,e){return Px(t,e.shared,e.colorinput)})),colorpicker:C_((function(t){var e=function(t){return"tox-"+t},n=MS(PS,e),r=Qh(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){yi(t,Rw,{name:"hex-valid",value:!0})},onInvalidHex:function(t){yi(t,Rw,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:cc([ff.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return yd.getCurrent(e).bind((function(t){return ff.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);yd.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){ff.setValue(t,{hex:z.from(n[1]).getOr("")}),OS.getField(t,"hex").each((function(t){bi(t,Lo())}))}))}}}),RS()])}})),dropzone:C_((function(t,e){return GS(t,e.shared.providers)})),grid:C_((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:U(t.items,e.interpreter)}}(t,e.shared)})),listbox:C_((function(t,e){return function(t,e){var n=e.shared.providers,r=ut(t.items).filter(WO),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 Jk({uid:n.uid,text:r.map((function(t){return t.text})),icon:z.none(),tooltip:t.label,role:z.none(),fetch:function(n,r){var o=qO(n,t.name,t.items,ff.getValue(n));r(rO(o,Kp.CLOSE_ON_EXECUTE,e,!1))},onSetup:v(h),getApi:v({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Sw.config({}),ff.config({store:{mode:"manual",initialValue:r.map((function(t){return t.value})).getOr(""),getValue:function(t){return ze(t.element,"data-value")},setValue:function(e,n){GO(t.items,n).each((function(t){Ne(e.element,"data-value",t.value),yi(e,Kk,{text:t.text})}))}}})]},"tox-listbox",e.shared)}}})]};return ww.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:J([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:C_((function(t,e){return function(t,e){var n=U(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:$O,selectBehaviours:cc([Nd.config({disabled:function(){return t.disabled||e.isDisabled()}}),Sw.config({}),qg("selectbox-change",[Ti(Ho(),(function(e,n){yi(e,Aw,{name:t.name})}))])])}),i=t.size>1?z.none():z.some(ap("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),u={dom:{tag:"div",classes:["tox-selectfield"]},components:J([[o],i.toArray()])};return ww.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:J([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)}}),vb()])})}(t,e.shared.providers)})),sizeinput:C_((function(t,e){return SO(t,e.shared.providers)})),urlinput:C_((function(t,e){return function(t,e,n){var r,o=e.shared.providers,i=function(e){var r=ff.getValue(e);n.addToHistory(r.value,t.filetype)},u=ww.parts.field({factory:a_,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":x_,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=w_(t.filetype,r,n),i=rO(o,Kp.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(J([n.getValidationHandler().map((function(e){return sx.config({getRoot:function(t){return he(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){c.getOpt(t).each((function(t){Ne(t.element,"title",o.translate(e))}))}},validator:{validate:function(n){var r=ff.getValue(n);return l_((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=Nn.error(t.message);n(e)}else{var r=Nn.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[Nd.config({disabled:function(){return t.disabled||o.isDisabled()}}),Sw.config({}),qg("urlinput-events",J(["file"===t.filetype?[Ti(Lo(),(function(e){yi(e,Aw,{name:t.name})}))]:[],[Ti(Ho(),(function(e){yi(e,Aw,{name:t.name}),i(e)})),Ti(Ko(),(function(e){yi(e,Aw,{name:t.name}),i(e)}))]]))]])),eventOrder:(r={},r[Lo()]=["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:uv(0,0,"normal")},onExecute:function(t,e,n){yi(e,Nw,{})},onItemExecute:function(e,n,r,o){i(e),yi(e,Aw,{name:t.name})}}),a=t.label.map((function(t){return Ew(t,o)})),c=Qh(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),ap(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:_({title:o.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))},o.icons)}("invalid",z.some(x_),"warning")),s=Qh({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),l=n.getUrlPicker(t.filetype),f=$i("browser.url.event"),d=Qh({dom:{tag:"div",classes:["tox-control-wrap"]},components:[u,s.asSpec()],behaviours:cc([Nd.config({disabled:function(){return t.disabled||o.isDisabled()}})])}),m=Qh(fO({name:t.name,icon:z.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return bi(t,f)}),o,[],["tox-browse-url"]));return ww.sketch({dom:Tw([]),components:a.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:J([[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)}}),vb(),qg("url-input-events",[Ti(f,(function(e){yd.getCurrent(e).each((function(n){var r=ff.getValue(n),o=_({fieldname:t.name},r);l.each((function(r){r(o).get((function(r){ff.setValue(n,r),yi(e,Aw,{name:t.name})}))}))}))}))])])})}(t,e,e.urlinput)})),customeditor:C_((function(t){var e=Hc(),n=Qh({dom:{tag:t.tag}}),r=Hc();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:cc([qg("custom-editor-events",[Bi((function(o){n.getOpt(o).each((function(n){(!function(t){return wt(t,"init")}(t)?IS.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)}))}))}))]),ff.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)}))}}}),RS()]),components:[n.asSpec()]}})),htmlpanel:C_((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({}),Yg.config({})])})})),imagetools:C_((function(t,e){return UO(t,e.shared.providers)})),table:C_((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:U(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:U(r,o)}]}),(n=t.cells,{dom:{tag:"tbody"},components:U(n,u)})],behaviours:cc([Sw.config({}),Yg.config({})])}}(t,e.shared.providers)})),panel:C_((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:U(t.items,e.shared.interpreter)}}(t,e)}))},k_={field:function(t,e){return e}},O_=function(t,e,n){var r=Yn(n,{shared:{interpreter:function(e){return __(t,e,r)}}});return __(t,e,r)},__=function(t,e,n){return yt(S_,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},T_={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},E_=function(t,e,n){var r={maxHeightFunction:ts()};return function(){return n()?{type:"node",root:Oe(t()),node:z.from(t()),bubble:os(12,12,T_),layouts:{onRtl:function(){return[Vh]},onLtr:function(){return[Fh]}},overrides:r}:{type:"hotspot",hotspot:e(),bubble:os(-12,12,T_),layouts:{onRtl:function(){return[ja]},onLtr:function(){return[Ua]}},overrides:r}}},A_=function(t,e,n){return function(){return n()?{type:"node",root:Oe(t()),node:z.from(t()),layouts:{onRtl:function(){return[jh]},onLtr:function(){return[jh]}}}:{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[$a]},onLtr:function(){return[$a]}}}}},D_=function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return z.some(Ds.range(zt.fromDom(e.startContainer),e.startOffset,zt.fromDom(e.endContainer),e.endOffset))}}}},M_=function(t){return function(e){return{type:"node",root:t(),node:e}}},R_=function(t,e,n){var r=ub(t),o=function(){return zt.fromDom(t.getBody())},i=function(){return zt.fromDom(t.getContentAreaContainer())},u=function(){return r||!n()};return{inlineDialog:E_(i,e,u),banner:A_(i,e,u),cursor:D_(t,o),node:M_(o)}},N_=function(t){return function(e,n){Ny(t)(e,n)}},z_=function(t){return function(){return Cy(t)}},B_=function(t){return function(){return Sy(t)}},P_=function(t){return function(){return Oy(t)}},I_=function(t){return{colorPicker:N_(t),hasCustomColors:z_(t),getColors:B_(t),getColorCols:P_(t)}},L_=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},H_=function(t){return{isDraggableModal:L_(t)}},F_=[{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"}]}],V_=function(t){return X(t,(function(t,e){if(wt(e,"items")){var n=V_(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(function(t){return wt(t,"inline")}(e)||function(t){return wt(t,"block")}(e)||function(t){return wt(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),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},j_=function(t){return function(t){return z.from(t.getParam("style_formats")).filter(u)}(t).map((function(e){var n=function(t,e){var n=V_(e),r=function(e){W(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)?F_.concat(n):n})).getOr(F_)},U_=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Yn(t,r)},W_=function(t,e,n,r){var i=function(e){return U(e,(function(e){var u=lt(e);if(xt(e,"items")){var a=i(e.items);return Yn(function(t){return Yn(t,{type:"submenu"})}(e),{getStyleItems:v(a)})}return xt(e,"format")?function(t){return U_(t,n,r)}(e):1===u.length&&H(u,"title")?Yn(e,{type:"separator"}):function(e){var i=o(e.name)?e.name:$i(e.title),u="custom-"+i,a={type:"formatter",format:u,isSelected:n(u),getStylePreview:r(u)},c=Yn(e,a);return t.formatter.register(i,c),c}(e)}))};return i(e)},q_=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?z.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):z.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?Q(e,r):[t.format]},o=so([]),i=so([]),u=so([]),a=so([]),c=so(!1);t.on("PreInit",(function(u){var a=j_(t),c=W_(t,a,e,n);o.set(c),i.set(Q(c,r))})),t.on("addStyleModifications",(function(o){var i=W_(t,o.items,e,n);u.set(i),c.set(o.replace),a.set(Q(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)}}},G_=LS.trim,$_=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}},X_=$_("true"),K_=$_("false"),Y_=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},J_=function(t){return t.innerText||t.textContent},Q_=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&tT(t)},Z_=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},tT=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return X_(t)}return!1}(t)&&!K_(t)},eT=function(t){return Z_(t)&&tT(t)},nT=function(t){var e=function(t){return t.id?t.id:$i("h")}(t);return Y_("header",J_(t),"#"+e,function(t){return Z_(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},rT=function(t){var e=t.id||t.name,n=J_(t);return Y_("anchor",n||"#"+e,"#"+e,0,h)},oT=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,U(Ws(zt.fromDom(n),e),(function(t){return t.dom}))},iT=function(t){return G_(t.title).length>0},uT=function(t){var e=oT(t);return G(function(t){return U(G(t,eT),nT)}(e).concat(function(t){return U(G(t,Q_),rT)}(e)),iT)},aT="tinymce-url-history",cT=function(t){return o(t)&&/^https?/.test(t)},sT=function(t){return i(t)&&vt(t,(function(t){return!(u(e=t)&&e.length<=5&&Z(e,cT));var e})).isNone()},lT=function(){var t,e=vy.getItem(aT);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+aT+" was not valid JSON",t),{};throw t}return sT(t)?t:(console.log("Local storage "+aT+" was not valid format",t),{})},fT=function(t){var e=lT();return yt(e,t).getOr([])},dT=function(t,e){if(cT(t)){var n=lT(),r=yt(n,e).getOr([]),o=G(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!sT(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));vy.setItem(aT,JSON.stringify(t))}(n)}},mT=function(t){return!!t},gT=function(t){return mt(LS.makeMap(t,/[, ]/),mT)},hT=function(t){return z.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(d)},pT=function(t,e){var n=function(t){var e=z.some(function(t){return t.getParam("file_picker_types")}(t)).filter(mT),n=z.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(mT),r=e.or(n).map(gT);return hT(t).fold(S,(function(t){return r.fold(k,(function(t){return lt(t).length>0&&t}))}))}(t);return c(n)?n?hT(t):z.none():n[e]?hT(t):z.none()},vT=function(t){return z.from(t).filter(o).getOrUndefined()},bT=function(t){return{getHistory:fT,addToHistory:dT,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?z.none():z.some({targets:uT(t.getBody()),anchorTop:vT(db(t)),anchorBottom:vT(mb(t))})}(t)},getValidationHandler:function(){return function(t){return z.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 pT(t,e).map((function(n){return function(r){return Qw((function(u){var a=_({filetype:e,fieldname:r.fieldname},z.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)}}},yT=function(t,e,n){var r=so(!1),o=function(t){var e=so(ob(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:Zh.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return __(k_,t,e)}(t,i)},anchors:R_(e,n,o.isPositionedAtTop),header:o,getSink:function(){return Nn.value(t)}},urlinput:bT(e),styleselect:q_(e),colorinput:I_(e),dialog:H_(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},wT=cd,xT=qf,CT=v([to("shell",!1),Lr("makeItem"),to("setupItem",h),hf("listBehaviours",[Wg])]),ST=jf({name:"items",overrides:function(){return{behaviours:cc([Wg.config({})])}}}),kT=v([ST]),OT=v("CustomList"),_T=hd({name:OT(),configFields:CT(),partFields:kT(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[Wg.config({})],components:[]}:{behaviours:[],components:e},i=function(e){return t.shell?z.some(e):td(e,t,"items")};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:gf(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=Wg.contents(r),i=n.length,u=i-o.length,a=u>0?V(u,(function(){return t.makeItem()})):[],c=o.slice(i);W(c,(function(t){return Wg.remove(r,t)})),W(a,(function(t){return Wg.append(r,t)}));var s=Wg.contents(r);W(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),TT=v([Lr("dom"),to("shell",!0),df("toolbarBehaviours",[Wg])]),ET=v([jf({name:"groups",overrides:function(){return{behaviours:cc([Wg.config({})])}}})]),AT=hd({name:"Toolbar",configFields:TT(),partFields:ET(),factory:function(t,e,n,r){var o=function(e){return t.shell?z.some(e):td(e,t,"groups")},i=t.shell?{behaviours:[Wg.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:gf(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){Wg.set(t,e)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),DT=h,MT=S,RT=v([]),NT=Object.freeze({__proto__:null,setup:DT,isDocked:MT,getBehaviours:RT}),zT=function(t){return(Ct(qe(t,"position"),"fixed")?z.none():pe(t)).orThunk((function(){var e=zt.fromTag("span");return he(t).bind((function(t){hn(t,e);var n=pe(e);return bn(e),n}))}))},BT=function(t){return zT(t).map(rn).getOrThunk((function(){return en(0,0)}))},PT=lo([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),IT=function(t,e){var n=t.element;_u(n,e.transitionClass),Eu(n,e.fadeOutClass),_u(n,e.fadeInClass),e.onShow(t)},LT=function(t,e){var n=t.element;_u(n,e.transitionClass),Eu(n,e.fadeInClass),_u(n,e.fadeOutClass),e.onHide(t)},HT=function(t,e,n){return Z(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)}}))},FT=function(t,e){return e.getInitialPos().map((function(e){return Tn(e.bounds.x,e.bounds.y,an(t),Qe(t))}))},VT=function(t,e,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return z.some(PT.static());case"absolute":var o=zT(t).map(En).getOrThunk((function(){return En(De())}));return z.some(PT.absolute(Cc("absolute",yt(r.style,"left").map((function(t){return e.x-o.x})),yt(r.style,"top").map((function(t){return e.y-o.y})),yt(r.style,"right").map((function(t){return o.right-e.right})),yt(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return z.none()}}))},jT=function(t,e,n){var r=En(t);if(HT(n.getModes(),r,e))return z.none();!function(t,e,n){n.setInitialPos({style:Ge(t),position:Ue(t,"position")||"static",bounds:e})}(t,r,n);var o=Dn(),i=r.x-o.x,u=e.y-o.y,a=o.bottom-e.bottom,c=r.y<=e.y;return z.some(PT.fixed(Cc("fixed",z.some(i),c?z.some(u):z.none(),z.none(),c?z.none():z.some(a))))},UT=function(t,e,n){var r=t.element;return Ct(qe(r,"position"),"fixed")?function(t,e,n){return FT(t,n).filter((function(t){return HT(n.getModes(),t,e)})).bind((function(e){return VT(t,e,n)}))}(r,e,n):jT(r,e,n)},WT=function(t,e,n){n.setDocked(!1),W(["left","right","top","bottom","position"],(function(e){return Xe(t.element,e)})),e.onUndocked(t)},qT=function(t,e,n,r){var o="fixed"===r.position;n.setDocked(o),Sc(t.element,r),(o?e.onDocked:e.onUndocked)(t)},GT=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?(Du(t.element,[e.fadeOutClass]),e.onHide(t)):(u?IT:LT)(t,e))}))}))},$T=function(t,e,n){var r=t.element;n.setDocked(!1),function(t,e){var n=t.element;return FT(n,e).bind((function(t){return VT(n,t,e)}))}(t,n).each((function(r){r.fold((function(){return WT(t,e,n)}),(function(r){return qT(t,e,n,r)}),h)})),n.setVisible(!0),e.contextual.each((function(e){Mu(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),XT(t,e,n)},XT=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t);n.isDocked()&&GT(t,e,n,r),UT(t,r,n).each((function(o){o.fold((function(){return WT(t,e,n)}),(function(r){return qT(t,e,n,r)}),(function(o){GT(t,e,n,r,!0),qT(t,e,n,o)}))}))}(t,e,n)},KT=function(t,e,n){n.isDocked()&&$T(t,e,n)},YT=Object.freeze({__proto__:null,refresh:XT,reset:KT,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)}}),JT=Object.freeze({__proto__:null,events:function(t,e){return ki([zi(jo(),(function(n,r){t.contextual.each((function(t){Au(n.element,t.transitionClass)&&(Mu(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n));r.stop()}))})),Ti(ui(),(function(n,r){XT(n,t,e)})),Ti(ai(),(function(n,r){KT(n,t,e)}))])}}),QT=[Zr("contextual",[Vr("fadeInClass"),Vr("fadeOutClass"),Vr("transitionClass"),Ur("lazyContext"),pa("onShow"),pa("onShown"),pa("onHide"),pa("onHidden")]),uo("lazyViewport",Dn),ao("modes",["top","bottom"],xr),pa("onDocked"),pa("onUndocked")],ZT=lc({fields:QT,name:"docking",active:JT,apis:YT,state:Object.freeze({__proto__:null,init:function(t){var e=so(!1),n=so(!0),r=Hc(),o=so(t.modes);return lu({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(",")}})}})}),tE=v($i("toolbar-height-change")),eE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},nE=function(t,e){return H(ZT.getModes(t),e)},rE=function(t){var e=t.element;he(e).each((function(n){var r="padding-"+ZT.getModes(t)[0];if(ZT.isDocked(t)){var o=an(n);Fe(e,"width",o+"px"),Fe(n,r,function(t){return Ze(t)+(parseInt(Ue(t,"margin-top"),10)||0)+(parseInt(Ue(t,"margin-bottom"),10)||0)}(e)+"px")}else Xe(e,"width"),Xe(n,r)}))},oE=function(t,e){e?(Eu(t,eE.fadeOutClass),Du(t,[eE.transitionClass,eE.fadeInClass])):(Eu(t,eE.fadeInClass),Du(t,[eE.fadeOutClass,eE.transitionClass]))},iE=function(t,e){var n=zt.fromDom(t.getContainer());e?(_u(n,"tox-tinymce--toolbar-sticky-on"),Eu(n,"tox-tinymce--toolbar-sticky-off")):(_u(n,"tox-tinymce--toolbar-sticky-off"),Eu(n,"tox-tinymce--toolbar-sticky-on"))},uE=function(t,e){var n=Hc(),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||rE(e),iE(t,ZT.isDocked(e)),e.getSystem().broadcastOn([Gl()],{}),r().each((function(t){return t.getSystem().broadcastOn([Gl()],{})}))},u=t.inline?[]:function(){var t;return[gc.config({channels:(t={},t[tE()]={onReceive:rE},t)})]}();return E([Yg.config({}),ZT.config({contextual:_({lazyContext:function(e){var n=Ze(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=En(zt.fromDom(r)),i=o.height-n,u=o.y+(nE(e,"top")?0:n);return z.some(Tn(o.x,u,o.width,i))},onShow:function(){o((function(t){return oE(t,!0)}))},onShown:function(t){o((function(t){return Mu(t,[eE.transitionClass,eE.fadeInClass])})),n.get().each((function(e){var r,o,i;r=t.element,i=fe(o=e),yc(i).filter((function(t){return!ce(o,t)})).filter((function(t){return ce(t,zt.fromDom(i.dom.body))||le(r,t)})).each((function(){return vc(o)})),n.clear()}))},onHide:function(t){(function(t,e){return wc(t).orThunk((function(){return e().toOptional().bind((function(t){return wc(t.element)}))}))})(t.element,r).fold(n.clear,n.set),o((function(t){return oE(t,!1)}))},onHidden:function(){o((function(t){return Mu(t,[eE.transitionClass])}))}},eE),lazyViewport:function(e){var n=Dn(),r=function(t){return t.getParam("toolbar_sticky_offset",0,"number")}(t),o=n.y+(nE(e,"top")?r:0),i=n.height-(nE(e,"bottom")?r:0);return Tn(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],u,!0)},aE=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(ZT.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(rE)})),t.on("SkinLoaded",(function(){n().each((function(t){ZT.isDocked(t)?ZT.reset(t):ZT.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(ZT.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){ZT.refresh(e);var n=e.element;Nm(n)&&function(t,e){var n=fe(e),r=n.dom.defaultView.innerHeight,o=wn(n),i=zt.fromDom(t.elm),u=An(i),a=Qe(i),c=u.y,s=c+a,l=rn(e),f=Qe(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)xn(o.left,c-f,n);else if(h&&s>d){var p=c-r+a+f;xn(o.left,p,n)}}(t,n)}))})),t.on("PostRender",(function(){iE(t,!1)}))},isDocked:function(t){return t().map(ZT.isDocked).getOr(!1)},getBehaviours:uE}),cE=mr([Vr("type"),Hr("items",hr([vr([Vr("name"),Gr("items",xr)]),xr]))].concat(Np)),sE=[Yr("text"),Yr("tooltip"),Yr("icon"),Ur("fetch"),uo("onSetup",(function(){return h}))],lE=mr(E([Vr("type")],sE,!0)),fE=function(t){return Dr("menubutton",lE,t)},dE=mr([Vr("type"),Yr("tooltip"),Yr("icon"),Yr("text"),Jr("select"),Ur("fetch"),uo("onSetup",(function(){return h})),oo("presets","normal",["normal","color","listpreview"]),to("columns",1),Ur("onAction"),Ur("onItemAction")]),mE=gd({factory:function(t,e){var n={focus:Hg.focusIn,setMenus:function(t,n){var r=U(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=fE(n).mapError((function(t){return Nr(t)})).getOrDie();return iO(r,"tox-mbtn",e.backstage,z.some("menuitem"))}));Wg.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:cc([Wg.config({}),qg("menubar-events",[Bi((function(e){t.onSetup(e)})),Ti(No(),(function(t,e){Zu(t.element,".tox-mbtn--active").each((function(n){ta(e.event.target,".tox-mbtn").each((function(e){ce(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){Dx.expand(t),Dx.close(n),Yg.focus(t)}))}))}))}))})),Ti(di(),(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))}))}))}))]),Hg.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),z.some(!0)}}),Sw.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Lr("dom"),Lr("uid"),Lr("onEscape"),Lr("backstage"),to("onSetup",h)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),gE=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},hE=function(t){return t.dimension.property},pE=function(t,e){return t.dimension.getDimension(e)},vE=function(t,e){var n=gE(t,e);Mu(n,[e.shrinkingClass,e.growingClass])},bE=function(t,e){Eu(t.element,e.openClass),_u(t.element,e.closedClass),Fe(t.element,hE(e),"0px"),Ke(t.element)},yE=function(t,e){Eu(t.element,e.closedClass),_u(t.element,e.openClass),Xe(t.element,hE(e))},wE=function(t,e,n,r){n.setCollapsed(),Fe(t.element,hE(e),pE(e,t.element)),Ke(t.element),vE(t,e),bE(t,e),e.onStartShrink(t),e.onShrunk(t)},xE=function(t,e,n,r){var o=r.getOrThunk((function(){return pE(e,t.element)}));n.setCollapsed(),Fe(t.element,hE(e),o),Ke(t.element);var i=gE(t,e);Eu(i,e.growingClass),_u(i,e.shrinkingClass),bE(t,e),e.onStartShrink(t)},CE=function(t,e,n){var r=pE(e,t.element);("0px"===r?wE:xE)(t,e,n,z.some(r))},SE=function(t,e,n){var r=gE(t,e),o=Au(r,e.shrinkingClass),i=pE(e,t.element);yE(t,e);var u=pE(e,t.element);(o?function(){Fe(t.element,hE(e),i),Ke(t.element)}:function(){bE(t,e)})(),Eu(r,e.shrinkingClass),_u(r,e.growingClass),yE(t,e),Fe(t.element,hE(e),u),n.setExpanded(),e.onStartGrow(t)},kE=function(t,e,n){var r=gE(t,e);return!0===Au(r,e.growingClass)},OE=function(t,e,n){var r=gE(t,e);return!0===Au(r,e.shrinkingClass)},_E=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){Xe(t.element,hE(e));var r=pE(e,t.element);Fe(t.element,hE(e),r)}},grow:function(t,e,n){n.isExpanded()||SE(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&CE(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&wE(t,e,n)},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:kE,isShrinking:OE,isTransitioning:function(t,e,n){return kE(t,e)||OE(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?CE:SE)(t,e,n)},disableTransitions:vE}),TE=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return du(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:go(e.dimension.property,"0px")})},events:function(t,e){return ki([zi(jo(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(vE(n,t),e.isExpanded()&&Xe(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),EE=[Lr("closedClass"),Lr("openClass"),Lr("shrinkingClass"),Lr("growingClass"),$r("getAnimationRoot"),pa("onShrunk"),pa("onStartShrink"),pa("onGrown"),pa("onStartGrow"),to("expanded",!1),Hr("dimension",zr("property",{width:[wa("property","width"),wa("getDimension",(function(t){return an(t)+"px"}))],height:[wa("property","height"),wa("getDimension",(function(t){return Qe(t)+"px"}))]}))],AE=lc({fields:EE,name:"sliding",active:TE,apis:_E,state:Object.freeze({__proto__:null,init:function(t){var e=so(t.expanded);return lu({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()}})}})}),DE=[df("slotBehaviours",[])],ME=function(t){return"<alloy.field."+t+">"},RE=function(t,e){var n,r=function(e){return od(t)},o=function(e,n){return function(r,o){return td(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==ze(t.element,"aria-hidden")},u=o(i,!1),a=o((function(t,e){if(i(t)){var n=t.element;Fe(n,"display","none"),Ne(n,"aria-hidden","true"),yi(t,mi(),{name:e,visible:!1})}})),c=(n=a,function(t,e){W(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;Xe(n,"display"),Ie(n,"aria-hidden"),yi(t,mi(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return td(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:mf(t.slotBehaviours),apis:l}},NE=mt({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 cu(t)})),zE=_(_({},NE),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),Kf("container",ME(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=U(r,(function(t){return Ff({name:t,pname:ME(t)})}));return ld("container",DE,o,RE,n)}}),BE=mr([Yr("icon"),Yr("tooltip"),uo("onShow",h),uo("onHide",h),uo("onSetup",(function(){return h}))]),PE=function(t){return{element:function(){return t.element.dom}}},IE=function(t,e){var n=U(lt(e),(function(t){var n=e[t],r=Mr(function(t){return Dr("sidebar",BE,t)}(n));return{name:t,getApi:PE,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return U(n,(function(e){var r=so(h);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Rv([Sb(e,r),kb(e,r),Ti(mi(),(function(t,e){var r=e.event;K(n,(function(t){return t.name===r.name})).each((function(e){(r.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},LE=function(t){return zE.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:IE(e,t),slotBehaviours:Rv([Bi((function(t){return zE.hideAllSlots(t)}))])}}))},HE=function(t){return yd.getCurrent(t).bind((function(t){return AE.isGrowing(t)||AE.hasGrown(t)?yd.getCurrent(t).bind((function(t){return K(zE.getSlotNames(t),(function(e){return zE.isShowing(t,e)}))})):z.none()}))},FE=$i("FixSizeEvent"),VE=$i("AutoSizeEvent"),jE=Object.freeze({__proto__:null,block:function(t,e,n,r){Ne(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=cc([Hg.config({mode:"special",onTab:function(){return z.some(!0)},onShiftTab:function(){return z.some(!0)}}),Yg.config({})]),u=r(o,i),a=o.getSystem().build(u);Wg.append(o,qu(a)),a.hasConfigured(Hg)&&e.focus&&Hg.focusIn(a),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return Wg.remove(o,a)}))},unblock:function(t,e,n){Ie(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),UE=[uo("getRoot",z.none),io("focus",!0),pa("onBlock"),pa("onUnblock")],WE=lc({fields:UE,name:"blocking",apis:jE,state:Object.freeze({__proto__:null,init:function(){var t=Ic((function(t){return t.destroy()}));return lu({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),qE=function(t){var e=zt.fromHtml(t),n=ve(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return X(e,(function(t,e){var n;return"class"===e.name?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:Hi(e)};return _({tag:Pt(e),classes:o,attributes:r},i)},GE=function(t){return yd.getCurrent(t).each((function(t){return vc(t.element)}))},$E=function(t,e,n,r){var o=e.element;if(function(t,e){z.from(t.iframeElement).map(zt.fromDom).each((function(t){e?(Be(t,"tabindex").each((function(e){return Ne(t,"data-mce-tabindex",e)})),Ne(t,"tabindex",-1)):(Ie(t,"tabindex"),Be(t,"data-mce-tabindex").each((function(e){Ne(t,"tabindex",e),Ie(t,"data-mce-tabindex")})))}))}(t,n),n)WE.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:qE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}}(r)),Xe(o,"display"),Ie(o,"aria-hidden"),t.hasFocus()&&GE(e);else{var i=yd.getCurrent(e).exists((function(t){return bc(t.element)}));WE.unblock(e),Fe(o,"display","none"),Ne(o,"aria-hidden","true"),i&&t.focus()}},XE=function(t,e,n){var r=so(!1),o=Hc(),i=function(n){var o;!r.get()||function(t){return"focusin"===t.type}(o=n)&&(o.composed?ut(o.composedPath()):z.from(o.target)).map(zt.fromDom).filter(Lt).exists((function(t){return Au(t,"mce-pastebin")}))||(n.preventDefault(),GE(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),$E(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",(function(e){if(o.on(Yh.clearTimeout),m(e.time)){var n=Yh.setEditorTimeout(t,(function(){return u(e.state)}),e.time);o.set(n)}else u(e.state),o.clear()}))},KE=function(t,e,n){return{within:t,extra:e,withinWidth:n}},YE=function(t,e,n){var r,o=(r=function(t,e){var r=n(t);return z.some({element:t,start:e,finish:e+r,width:r})},X(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=G(o,(function(t){return t.finish<=e})),u=$(i,(function(t,e){return t+e.width}),0);return{within:i,extra:o.slice(i.length),withinWidth:u}},JE=function(t){return U(t,(function(t){return t.element}))},QE=function(t,e,n,r){var o=function(t,e,n){var r=YE(e,t,n);return 0===r.extra.length?z.some(r):z.none()}(t,e,n).getOrThunk((function(){return YE(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=JE(t.concat(e));return KE(r,[],n)}(i,u,a):u.length>=1?function(t,e,n,r){var o=JE(t).concat([n]);return KE(o,JE(e),r)}(i,u,r,a):function(t,e,n){return KE(JE(t),[],n)}(i,0,a)},ZE=function(t,e){var n=U(e,(function(t){return qu(t)}));AT.setGroups(t,n)},tA=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=ed(t,e,"primary"),i=dx.getCoupled(t,"overflowGroup");Fe(o.element,"visibility","hidden");var u=r.concat([i]),a=st(u,(function(t){return wc(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),ZE(o,u);var c=an(o.element),s=QE(c,e.builtGroups.get(),(function(t){return an(t.element)}),i);0===s.extra.length?(Wg.remove(o,i),n([])):(ZE(o,s.within),n(s.extra)),Xe(o.element,"visibility"),Ke(o.element),a.each(Yg.focus)}},eA=v([df("splitToolbarBehaviours",[dx]),Pr("builtGroups",(function(){return so([])}))]),nA=v([ga(["overflowToggledClass"]),Jr("getOverflowBounds"),Lr("lazySink"),Pr("overflowGroups",(function(){return so([])}))].concat(eA())),rA=v([Ff({factory:AT,schema:TT(),name:"primary"}),Vf({schema:TT(),name:"overflow"}),Vf({name:"overflow-button"}),Vf({name:"overflow-group"})]),oA=v((function(t,e){!function(t,e){var n=un.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Fe(t,"max-width",n+"px")}(t,Math.floor(e))})),iA=v([ga(["toggledClass"]),Lr("lazySink"),Ur("fetch"),Jr("getBounds"),Zr("fireDismissalEventInstead",[to("event",li())]),fs()]),uA=v([Vf({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:cc([ch.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Vf({factory:AT,schema:TT(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:cc([Hg.config({mode:"cyclic",onEscape:function(e){return td(e,t,"button").each(Yg.focus),z.none()}})])}}})]),aA=function(t,e){var n=dx.getCoupled(t,"toolbarSandbox");Wl.isOpen(n)?Wl.close(n):Wl.open(n,e.toolbar())},cA=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Cl.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:oA()}}},o)},sA=function(t,e,n,r,o){AT.setGroups(e,o),cA(t,e,n,r),ch.on(t)},lA=hd({name:"FloatingToolbarButton",factory:function(t,e,n,r){return _(_({},Jh.sketch(_(_({},r.button()),{action:function(t){aA(t,r)},buttonBehaviours:pf({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([Hg.config({mode:"special",onEscape:function(t){return Wl.close(t),z.some(!0)}}),Wl.config({onOpen:function(o,i){n.fetch().get((function(o){sA(t,i,n,e.layouts,o),r.link(t.element),Hg.focusIn(i)}))},onClose:function(){ch.off(t),Yg.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:_(_({},Kl(_({isExtraPart:S},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),Jl({doReposition:function(){Wl.getState(dx.getCoupled(t,"toolbarSandbox")).each((function(r){cA(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){Wl.getState(dx.getCoupled(e,"toolbarSandbox")).each((function(o){sA(e,o,t,n.layouts,r)}))},reposition:function(e){Wl.getState(dx.getCoupled(e,"toolbarSandbox")).each((function(r){cA(e,r,t,n.layouts)}))},toggle:function(t){aA(t,r)},getToolbar:function(t){return Wl.getState(dx.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return Wl.isOpen(dx.getCoupled(t,"toolbarSandbox"))}}})},configFields:iA(),partFields:uA(),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)}}}),fA=v([Lr("items"),ga(["itemSelector"]),df("tgroupBehaviours",[Hg])]),dA=v([Uf({name:"items",unit:"item"})]),mA=hd({name:"ToolbarGroup",configFields:fA(),partFields:dA(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:gf(t.tgroupBehaviours,[Hg.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),gA=function(t){return U(t,(function(t){return qu(t)}))},hA=function(t,e,n){tA(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){lA.setGroups(t,gA(r))}))}))},pA=hd({name:"SplitFloatingToolbar",configFields:nA(),partFields:rA(),factory:function(t,e,n,r){var o=Qh(lA.sketch({fetch:function(){return Qw((function(e){e(gA(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:gf(t.splitToolbarBehaviours,[dx.config({others:{overflowGroup:function(){return mA.sketch(_(_({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(U(n,e.getSystem().build)),hA(e,o,t)},refresh:function(e){return hA(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){lA.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(lA.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){lA.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(lA.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)}}}),vA=v([ga(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),pa("onOpened"),pa("onClosed")].concat(eA())),bA=v([Ff({factory:AT,schema:TT(),name:"primary"}),Ff({factory:AT,schema:TT(),name:"overflow",overrides:function(t){return{toolbarBehaviours:cc([AE.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){td(e,t,"overflow-button").each((function(t){ch.off(t),Yg.focus(t)})),t.onClosed(e)},onGrown:function(e){Hg.focusIn(e),t.onOpened(e)},onStartGrow:function(e){td(e,t,"overflow-button").each(ch.on)}}),Hg.config({mode:"acyclic",onEscape:function(e){return td(e,t,"overflow-button").each(Yg.focus),z.some(!0)}})])}}}),Vf({name:"overflow-button",overrides:function(t){return{buttonBehaviours:cc([ch.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Vf({name:"overflow-group"})]),yA=function(t,e){td(t,e,"overflow-button").bind((function(){return td(t,e,"overflow")})).each((function(n){wA(t,e),AE.toggleGrow(n)}))},wA=function(t,e){td(t,e,"overflow").each((function(n){tA(t,e,(function(t){var e=U(t,(function(t){return qu(t)}));AT.setGroups(n,e)})),td(t,e,"overflow-button").each((function(t){AE.hasGrown(n)&&ch.on(t)})),AE.refresh(n)}))},xA=hd({name:"SplitSlidingToolbar",configFields:vA(),partFields:bA(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:gf(t.splitToolbarBehaviours,[dx.config({others:{overflowGroup:function(t){return mA.sketch(_(_({},r["overflow-group"]()),{items:[Jh.sketch(_(_({},r["overflow-button"]()),{action:function(e){bi(t,"alloy.toolbar.toggle")}}))]}))}}}),qg("toolbar-toggle-events",[Ti("alloy.toolbar.toggle",(function(e){yA(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=U(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),wA(e,t)},refresh:function(e){return wA(e,t)},toggle:function(e){return yA(e,t)},isOpen:function(e){return function(t,e){return td(t,e,"overflow").map(AE.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)}}}),CA=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:_({tag:"div",classes:["tox-toolbar__group"]},e),components:[mA.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({}),Yg.config({})])}},SA=function(t){return mA.sketch(CA(t))},kA=function(t,e){var n=Bi((function(e){var n=U(t.initGroups,SA);AT.setGroups(e,n)}));return cc([xb(t.providers.isDisabled),vb(),Hg.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),qg("toolbar-events",[n])])},OA=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":CA({title:z.none(),items:[]}),"overflow-button":cO({name:"more",icon:z.some("more-drawer"),disabled:!1,tooltip:z.some("More..."),primary:!1,borderless:!1},z.none(),t.providers)},splitToolbarBehaviours:kA(t,e)}},_A=function(t){var e=OA(t),n=pA.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return pA.sketch(_(_({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=An(e),r=me(e),o=An(r),i=Math.max(r.dom.scrollHeight,o.height);return Tn(n.x+4,o.y,n.width-8,i)},parts:_(_({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},TA=function(t){var e=xA.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=xA.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=OA(t);return xA.sketch(_(_({},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([tE()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([tE()],{type:"closed"})}}))},EA=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return AT.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===Xp.scrolling?["tox-toolbar--scrolling"]:[])},components:[AT.parts.groups({})],toolbarBehaviours:kA(t,e)})},AA=xT.optional({factory:mE,name:"menubar",schema:[Lr("backstage")]}),DA=xT.optional({factory:{sketch:function(t){return _T.sketch({uid:t.uid,dom:t.dom,listBehaviours:cc([Hg.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return EA({type:t.type,uid:$i("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),z.some(!0)}})},setupItem:function(t,e,n,r){AT.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Lr("dom"),Lr("onEscape")]}),MA=xT.optional({factory:{sketch:function(t){return function(t){return t.type===Xp.sliding?TA:t.type===Xp.floating?_A:EA}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),z.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:[Lr("dom"),Lr("onEscape"),Lr("getSink")]}),RA=xT.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?uE:RT;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:cc(n(e,t.sharedBackstage))}}},name:"header",schema:[Lr("dom")]}),NA=xT.optional({name:"socket",schema:[Lr("dom")]}),zA=xT.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({}),Yg.config({}),AE.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){yd.getCurrent(t).each(zE.hideAllSlots),bi(t,VE)},onGrown:function(t){bi(t,VE)},onStartGrow:function(t){yi(t,FE,{width:qe(t.element,"width").getOr("")})},onStartShrink:function(t){yi(t,FE,{width:an(t.element)+"px"})}}),Wg.config({}),yd.config({find:function(t){var e=Wg.contents(t);return ut(e)}})])}],behaviours:cc([zS(0),qg("sidebar-sliding-events",[Ti(FE,(function(t,e){Fe(t.element,"width",e.event.width)})),Ti(VE,(function(t,e){Xe(t.element,"width")}))])])}}},name:"sidebar",schema:[Lr("dom")]}),BA=xT.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:cc([Wg.config({}),WE.config({focus:!1}),yd.config({find:function(t){return ut(t.components())}})]),components:[]}}},name:"throbber",schema:[Lr("dom")]}),PA=hd({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return wT.getPart(e,t,"socket")},setSidebar:function(e,n){wT.getPart(e,t,"sidebar").each((function(t){return function(t,e){yd.getCurrent(t).each((function(t){return Wg.set(t,[LE(e)])}))}(t,n)}))},toggleSidebar:function(e,n){wT.getPart(e,t,"sidebar").each((function(t){return function(t,e){yd.getCurrent(t).each((function(t){yd.getCurrent(t).each((function(n){AE.hasGrown(t)?zE.isShowing(n,e)?AE.shrink(t):(zE.hideAllSlots(n),zE.showSlot(n,e)):(zE.hideAllSlots(n),zE.showSlot(n,e),AE.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return wT.getPart(e,t,"sidebar").bind(HE).getOrNull()},getHeader:function(e){return wT.getPart(e,t,"header")},getToolbar:function(e){return wT.getPart(e,t,"toolbar")},setToolbar:function(e,n){wT.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){wT.getPart(e,t,"multiple-toolbar").each((function(t){_T.setItems(t,n)}))},refreshToolbar:function(e){wT.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){wT.getPart(e,t,"toolbar").each((function(t){var e,n;e=t.getApis().toggle,n=function(e){return e(t)},null!=e?z.some(n(e)):z.none()}))},isToolbarDrawerToggled:function(e){return wT.getPart(e,t,"toolbar").bind((function(t){return z.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return wT.getPart(e,t,"throbber")},focusToolbar:function(e){wT.getPart(e,t,"toolbar").orThunk((function(){return wT.getPart(e,t,"multiple-toolbar")})).each((function(t){Hg.focusIn(t)}))},setMenubar:function(e,n){wT.getPart(e,t,"menubar").each((function(t){mE.setMenus(t,n)}))},focusMenubar:function(e){wT.getPart(e,t,"menubar").each((function(t){mE.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[Lr("dom"),Lr("behaviours")],partFields:[RA,AA,MA,DA,NA,zA,BA],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=U(n,(function(t){return SA(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=U(n,(function(t){return U(t,SA)}));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)}}}),IA={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"}},LA=function(t){return"string"==typeof t?t.split(" "):t},HA=function(t,e){var n=_(_({},IA),e.menus),r=lt(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?LA("file edit view insert format tools table help"):LA(!1===e.menubar?"":e.menubar),i=G(o,(function(t){var n=wt(IA,t);return r?n||yt(e.menus,t).exists((function(t){return wt(t,"items")})):n})),u=U(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 Q(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length?[]:F(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:LA(o.items)},e,t)}));return G(u,(function(t){return t.getItems().length>0&&F(t.getItems(),(function(t){return"separator"!==t.type}))}))},FA=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},VA=function(t,e,n){return new Sp((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},jA=function(t,e){return VA(t,e+"/skin.min.css",t.ui.styleSheetLoader)},UA=function(t,e){var n;return(n=zt.fromDom(t.getElement()),_e(n).isSome())?VA(t,e+"/skin.shadowdom.min.css",Vv.DOM.styleSheetLoader):Sp.resolve()},WA=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):jv.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)?Sp.all([jA(e,n),UA(e,n)]).then(FA(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:e})}}(e,"Skin could not be loaded")):FA(e)()},qA=w(WA,!1),GA=w(WA,!0),$A=function(t,e){return function(n){var r=Lc(),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()}}},XA=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)}}},KA=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},YA=function(t,e){return function(){return t.execCommand(e)}},JA=function(t,e,n){var r=function(t,r,i,u){var a=e.shared.providers.translate(t.title);if("separator"===t.type)return z.some({type:"separator",text:a});if("submenu"===t.type){var c=Q(t.getStyleItems(),(function(t){return o(t,r,u)}));return 0===r&&c.length<=0?z.none():z.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return Q(t.getStyleItems(),(function(t){return o(t,r,u)}))}})}return z.some(_({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 Q(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(rO(u,Kp.CLOSE_ON_EXECUTE,t,!1))}}}},QA=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return U(r.data,(function(t){return U_(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:JA(0,e,n),getStyleItems:o}},ZA=function(t,e,n){var r=QA(0,e,n),o=r.items,i=r.getStyleItems,u=XA(t,"NodeChange",(function(t){var e=t.getComponent();n.updateText(e)}));return Jk({text:n.icon.isSome()?z.none():n.text,icon:n.icon,tooltip:z.from(n.tooltip),role:z.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"}(VO||(VO={}));var tD,eD,nD,rD=function(t,e,n,r){return{type:"basic",data:function(t){return U(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===VO.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r))}},oD=[{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"}],iD=function(t){var e={type:"basic",data:oD};return{tooltip:"Align",text:z.none(),icon:z.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:z.none,getPreviewFor:function(t){return z.none},onAction:function(e){return function(){return K(oD,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},updateText:function(e){var n=K(oD,(function(e){return t.formatter.match(e.format)})).fold(v("left"),(function(t){return t.title.toLowerCase()}));yi(e,Yk,{icon:"align-"+n})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},uD=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],aD=function(t){var e=t.split(/\s*,\s*/);return U(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},cD=function(t){var e=function(){var e=function(t){return t?aD(t)[0]:""},r=t.queryCommandValue("FontName"),o=n.data,i=r?r.toLowerCase():"";return{matchOpt:K(o,(function(t){var n=t.format;return n.toLowerCase()===i||e(n).toLowerCase()===e(i).toLowerCase()})).orThunk((function(){return Ot(function(t){var e;return 0===t.indexOf("-apple-system")&&(e=aD(t.toLowerCase()),Z(uD,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(i),{title:"System Font",format:i})})),font:r}},n=rD(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",VO.SemiColon);return{tooltip:"Fonts",text:z.some("System Font"),icon:z.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 z.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}));yi(t,Kk,{text:i})},dataset:n,shouldHide:!1,isInvalid:S}},sD={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},lD={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},fD=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":yt(lD,t).getOr(t)},dD=function(t){var e=function(){var e=z.none(),n=r.data,o=t.queryCommandValue("FontSize");if(o)for(var i=function(t){var r=fD(o,t),i=function(t){return yt(sD,t).getOr("")}(r);e=K(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(z.none),r=rD(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",VO.Space);return{tooltip:"Font sizes",text:z.some("12pt"),icon:z.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}));yi(t,Kk,{text:i})},dataset:r,shouldHide:!1,isInvalid:S}},mD=function(t,e){var n=e(),r=U(n,(function(t){return t.format}));return z.from(t.formatter.closest(r)).bind((function(t){return K(n,(function(e){return e.format===t}))})).orThunk((function(){return Ot(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},gD=function(t){var e=rD(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",VO.SemiColon);return{tooltip:"Blocks",text:z.some("Paragraph"),icon:z.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:z.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return z.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:KA(t),updateText:function(n){var r=mD(t,(function(){return e.data})).fold(v("Paragraph"),(function(t){return t.title}));yi(n,Kk,{text:r})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},hD=function(t,e){return{tooltip:"Formats",text:z.some("Paragraph"),icon:z.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:z.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?z.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):z.none()}},onAction:KA(t),updateText:function(e){var n=function(t){var e=t.items;return void 0!==e&&e.length>0?Q(e,n):[{title:t.title,format:t.format}]},r=Q(j_(t),n),o=mD(t,v(r)).fold(v("Paragraph"),(function(t){return t.title}));yi(e,Kk,{text:o})},shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},pD=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=U(o,n.getSystem().build);_l(n,i)}))};return ki([Ti(Yo(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;H(o.channels,i)&&n(e,o.data)}})),Bi((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),vD=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),bD=[Lr("channel"),$r("renderComponents"),$r("updateState"),$r("initialData")],yD=Object.freeze({__proto__:null,init:function(){var t=so(z.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(z.none())}}}}),wD=lc({fields:bD,name:"reflecting",active:pD,apis:vD,state:yD}),xD=v([Lr("toggleClass"),Lr("fetch"),ba("onExecute"),to("getHotspot",z.some),to("getAnchorOverrides",v({})),fs(),ba("onItemExecute"),$r("lazySink"),Lr("dom"),pa("onOpen"),df("splitDropdownBehaviours",[dx,Hg,Yg]),to("matchWidth",!1),to("useMinWidth",!1),to("eventOrder",{}),$r("role")].concat(Tx())),CD=Ff({factory:Jh,schema:[Lr("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:cc([Yg.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(wi)},buttonBehaviours:cc([ch.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),SD=Ff({factory:Jh,schema:[Lr("dom")],name:"button",defaults:function(){return{buttonBehaviours:cc([Yg.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)}))}}}}),kD=v([CD,SD,jf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Lr("text")],name:"aria-descriptor"}),Vf({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()]),OD=hd({name:"SplitDropdown",configFields:xD(),partFields:kD(),factory:function(t,e,n,r){var o,i=function(t){yd.getCurrent(t).each((function(t){Wd.highlightFirst(t),Hg.focusIn(t)}))},u=function(e){xx(t,b,e,r,i,Gw.HighlightFirst).get(h)},a=function(e){var n=ed(e,t,"button");return wi(n),z.some(!0)},c=_(_({},ki([Bi((function(e,n){td(e,t,"aria-descriptor").each((function(t){var n=$i("aria");Ne(t.element,"id",n),Ne(e.element,"aria-describedby",n)}))}))])),lh(z.some(u))),s={repositionMenus:function(t){ch.isOn(t)&&_x(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:s,eventOrder:_(_({},t.eventOrder),(o={},o[Jo()]=["disabling","toggling","alloy.base.behaviour"],o)),events:c,behaviours:gf(t.splitDropdownBehaviours,[dx.config({others:{sandbox:function(e){var n=ed(e,t,"arrow");return Ox(t,e,{onOpen:function(){ch.on(n),ch.on(e)},onClose:function(){ch.off(n),ch.off(e)}})}}}),Hg.config({mode:"special",onSpace:a,onEnter:a,onDown:function(t){return u(t),z.some(!0)}}),Yg.config({}),ch.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)}}},TD=function(t){return{setActive:function(e){ch.set(t,e)},isActive:function(){return ch.isOn(t)},isDisabled:function(){return Nd.isDisabled(t)},setDisabled:function(e){return Nd.set(t,e)}}},ED=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},AD=$i("focus-button"),DD=function(t,e,n,r,o,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:ED(n,i)},components:Tb([t.map((function(t){return Wk(t,i.icons)})),e.map((function(t){return Gk(t,"tox-tbtn",i)}))]),eventOrder:(u={},u[Ao()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:cc([xb(i.isDisabled),vb(),qg("common-button-display-events",[Ti(Ao(),(function(t,e){e.event.prevent(),bi(t,AD)}))])].concat(r.map((function(n){return wD.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return Tb([t.icon.map((function(t){return Wk(t,i.icons)})),t.text.map((function(t){return Gk(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},MD=function(t,e,n){var r,o=so(h),i=DD(t.icon,t.text,t.tooltip,z.none(),z.none(),n);return Jh.sketch({dom:i.dom,components:i.components,eventOrder:Xk,buttonBehaviours:cc([qg("toolbar-button-events",[(r={onAction:t.onAction,getApi:e.getApi},Li((function(t,e){Cb(r,t)((function(e){yi(t,$k,{buttonApi:e}),r.onAction(e)}))}))),Sb(e,o),kb(e,o)]),xb((function(){return t.disabled||n.isDisabled()})),vb()].concat(e.toolbarButtonBehaviours))})},RD=function(t,e,n){return MD(t,{toolbarButtonBehaviours:[].concat(n.length>0?[qg("toolbarButtonWith",n)]:[]),getApi:_D,onSetup:t.onSetup},e)},ND=function(t,e,n){return Yn(MD(t,{toolbarButtonBehaviours:[Wg.config({}),ch.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[qg("toolbarToggleButtonWith",n)]:[]),getApi:TD,onSetup:t.onSetup},e))},zD=function(t,e,n){return function(r){return Qw((function(t){return e.fetch(t)})).map((function(o){return z.from(tw(Yn(zy($i("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,Kp.CLOSE_ON_EXECUTE,e.select.getOr(S),n),{movement:Py(e.columns,e.presets),menuBehaviours:Rv("auto"!==e.columns?[]:[Bi((function(t,n){Dv(t,4,tv(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;Hg.setGridSize(t,n,r)}))}))])})))}))}},BD=[{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 Nr(t)})).getOrDie();return e(i,r,o)}},ID={button:PD(Bp,(function(t,e){return n=t,r=e.backstage.shared.providers,RD(n,r,[]);var n,r})),togglebutton:PD(Lp,(function(t,e){return n=t,r=e.backstage.shared.providers,ND(n,r,[]);var n,r})),menubutton:PD(fE,(function(t,e){return iO(t,"tox-tbtn",e.backstage,z.none())})),splitbutton:PD((function(t){return Dr("SplitButton",dE,t)}),(function(t,e){return function(t,e){var n,r=$i("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){Ne(t,"fill",n)}))},setIconStroke:function(e,n){Zu(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){Ne(t,"stroke",n)}))},setActive:function(e){Ne(t.element,"aria-pressed",e),Zu(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return ch.set(t,e)}))}))},isActive:function(){return Zu(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(ch.isOn)}))}}},i=so(h),u={getApi:o,onSetup:t.onSetup};return OD.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:_({"aria-pressed":!1},ED(t.tooltip,e.providers))},onExecute:function(e){t.onAction(o(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:cc([wb(e.providers.isDisabled),vb(),qg("split-dropdown-events",[Ti(AD,Yg.focus),Sb(u,i),kb(u,i)]),Rx.config({})]),eventOrder:(n={},n[ci()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:zD(o,t,e.providers),parts:{menu:uv(0,t.columns,t.presets)},components:[OD.parts.button(DD(t.icon,t.text,z.none(),z.some(r),z.some([ch.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),OD.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:op("chevron-down",e.providers.icons)},buttonBehaviours:cc([wb(e.providers.isDisabled),vb(),ip()])}),OD.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})}(t,e.backstage.shared)})),grouptoolbarbutton:PD((function(t){return Dr("GroupToolbarButton",cE,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[ss]=e.backstage.shared.header.isPositionedAtTop()?Dc.TopToBottom:Dc.BottomToTop,r);switch(tb(n)){case Xp.floating:return function(t,e,n,r){var o=e.shared;return lA.sketch({lazySink:o.getSink,fetch:function(){return Qw((function(e){e(U(n(t.items),SA))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:DD(t.icon,t.text,t.tooltip,z.none(),z.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return VD(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,z.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=_({type:"advanced"},e.styleselect);return ZA(t,e,hD(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return ZA(t,e,dD(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return ZA(t,e,cD(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return ZA(t,e,gD(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return ZA(t,e,iD(t))}(t,e.backstage)}},LD={styleselect:ID.styleSelectButton,fontsizeselect:ID.fontsizeSelectButton,fontselect:ID.fontSelectButton,formatselect:ID.formatButton,align:ID.alignMenuButton},HD=function(t){var e,n=t.toolbar,r=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=U(BD,(function(e){var n=G(e.items,(function(e){return wt(t,e)||wt(LD,e)}));return{name:e.name,items:n}}));return G(e,(function(t){return t.items.length>0}))}(r):o(n)?(e=n.split("|"),U(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return g(t,(function(t){return wt(t,"name")&&wt(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},FD=function(t,e,n,r,o,i){return yt(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return st(t,(function(t){return yt(e,t+n.toLowerCase())}))}))})).fold((function(){return yt(LD,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return z.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return yt(ID,t.type).fold((function(){return console.error("skipping button defined by",t),z.none()}),(function(r){return z.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."),z.none())}))},VD=function(t,e,n,r){var o=HD(e),i=U(o,(function(o){var i=Q(o.items,(function(o){return 0===o.trim().length?[]:FD(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:z.from(t.translate(o.name)),items:i}}));return G(i,(function(t){return t.items.length>0}))},jD=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 VD(t,o,{backstage:r},z.none())}));PA.setToolbars(i,c)}else PA.setToolbar(i,VD(t,n,{backstage:r},z.none()))},UD=ie(),WD=UD.os.isiOS()&&UD.os.version.major<=12,qD=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=so(0),u=e.outerContainer;qA(t);var c=zt.fromDom(o.targetNode),s=Oe(ke(c));!function(t,e){Nl(t,e,mn)}(c,e.mothership),Rl(s,e.uiMothership),t.on("PostRender",(function(){jD(t,e,n,r),i.set(t.getWin().innerWidth),PA.setMenubar(u,HA(t,n)),PA.setSidebar(u,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=so(en(r.innerWidth,r.innerHeight)),u=so(en(o.offsetWidth,o.offsetHeight)),a=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(en(r.innerWidth,r.innerHeight)),dy(t))},c=function(){var e=t.getDoc().documentElement,n=u.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(u.set(en(e.offsetWidth,e.offsetHeight)),dy(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=jc(zt.fromDom(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Fe(f,"display","none")})),t.on("show",(function(){Xe(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(WD){Ve(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=Vc(m.element,"scroll",g.throttle);t.on("remove",h.unbind)}pb(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=tb(t);p!==Xp.sliding&&p!==Xp.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(){hb(e,!1)},disable:function(){hb(e,!0)},isDisabled:function(){return Nd.isDisabled(u)}};return{iframeContainer:m.element.dom,editorContainer:u.element.dom,api:v}}}),GD=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?z.some(parseInt(""+t,10)):z.none()},$D=function(t){return m(t)?t+"px":t},XD=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)},KD=function(t){return function(t){var e=Uv(t),n=Gv(t),r=Xv(t);return GD(e).map((function(t){return XD(t,n,r)}))}(t).getOr(Uv(t))},YD=function(t){var e=Wv(t),n=qv(t),r=$v(t);return GD(e).map((function(t){return XD(t,n,r)}))},JD=function(t,e,n,r,o){var i=n.uiMothership,u=n.outerContainer,a=Vv.DOM,c=ub(t),s=sb(t),l=$v(t).or(YD(t)),f=r.shared.header,d=f.isPositionedAtTop,m=tb(t),g=m===Xp.sliding||m===Xp.floating,h=so(!1),p=function(){return h.get()&&!t.removed},b=function(t){return g?t.fold(v(0),(function(t){return t.components().length>1?Qe(t.components()[1].element):0})):0},y=function(){i.broadcastOn([Gl()],{})},w=function(t){if(void 0===t&&(t=!1),p()){var n;if(c||(n=l.getOrThunk((function(){var t=GD(Ue(De(),"margin-left")).getOr(0);return an(De())-rn(e).left+t})),Fe(o.get().element,"max-width",n+"px")),g&&PA.refreshToolbar(u),c||function(){var t=PA.getToolbar(u),n=b(t),r=En(e),i=d()?Math.max(r.y-Qe(o.get().element)+n,0):r.bottom;Ve(u.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();t?ZT.reset(r):ZT.refresh(r)}y()}},x=function(n){if(void 0===n&&(n=!0),!c&&s&&p()){var r=f.getDockingMode(),i=function(n){switch(rb(t)){case Zv.auto:var r=PA.getToolbar(u),o=b(r),i=Qe(n.element)-o,a=En(e);if(a.y>i)return"top";var c=me(e),s=Math.max(c.dom.scrollHeight,Qe(c));return a.bottom<s-i?"bottom":Dn().bottom<a.bottom-i?"bottom":"top";case Zv.bottom:return"bottom";case Zv.top:default:return"top"}}(o.get());i!==r&&(!function(t){var e=o.get();ZT.setModes(e,[t]),f.setDockingMode(t);var n=d()?Dc.TopToBottom:Dc.BottomToTop;Ne(e.element,ss,n)}(i),n&&w(!0))}};return{isVisible:p,isPositionedAtTop:d,show:function(){h.set(!0),Fe(u.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),Xe(i.element,"display"),x(!1),w()},hide:function(){h.set(!1),n.outerContainer&&(Fe(u.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus")),Fe(i.element,"display","none")},update:w,updateMode:x,repositionPopups:y}},QD=function(t,e){var n=En(t);return{pos:e?n.y:n.bottom,bounds:n}},ZD=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=so(null),s=zt.fromDom(o.targetNode),l=JD(t,s,e,r,c),f=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);GA(t);var d=function(){if(c.get())l.show();else{c.set(PA.getHeader(a).getOrDie());var o=ab(t);Rl(o,i),Rl(o,u),jD(t,e,n,r),PA.setMenubar(a,HA(t,n)),l.show(),function(t,e,n,r){var o=so(QD(e,n.isPositionedAtTop())),i=function(r){var i=QD(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&&dy(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){Yh.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var u=Lc();u.set(jc(zt.fromDom(t.getBody()),"load",i)),t.on("remove",(function(){u.clear()}))}(t,s,l,f),t.nodeChanged()}},m=function(){return Yh.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()})),pb(t,e);var g={show:function(){l.show()},hide:function(){l.hide()},enable:function(){hb(e,!1)},disable:function(){hb(e,!0)},isDisabled:function(){return Nd.isDisabled(a)}};return{editorContainer:a.element.dom,api:g}}}),tM=function(t,e){return Ti($k,(function(n,r){var o=function(t){return{hide:function(){return bi(t,ei())},getValue:function(){return ff.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)}))},eM=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=T(r,["primary"]),i=Mr(Lp(_(_({},o),{type:"togglebutton",onAction:h})));return ND(i,n.backstage.shared.providers,[tM(t,e)])}(t,e,r):function(t,e,n){var r=e.original;r.primary;var o=T(r,["primary"]),i=Mr(Bp(_(_({},o),{type:"button",onAction:h})));return RD(i,n.backstage.shared.providers,[tM(t,e)])}(t,e,r)},nM=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=Qh(Uw.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:cc([Hg.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return wi(t),!0}))},onLeft:function(t,e){return e.cut(),z.none()},onRight:function(t,e){return e.cut(),z.none()}})])})),o=function(t,e,n){var r=U(e,(function(e){return Qh(eM(t,e,n))}));return{asSpecs:function(){return U(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return st(e,(function(e,n){return e.primary?z.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(x(Nd.isDisabled)):z.none()}))}}}(r,t.commands,e);return[{title:z.none(),items:[r.asSpec()]},{title:z.none(),items:o.asSpecs()}]},rM=nM,oM=function(t,e,n){return void 0===n&&(n=.01),e.bottom-t.y>=n&&t.bottom-e.y>=n},iM=function(t){var e=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=we(zt.fromDom(t.startContainer),t.startOffset).element;return(Ht(n)?he(n):z.some(n)).filter(Lt).map((function(t){return t.dom.getBoundingClientRect()})).getOr(e)}return e}(t.selection.getRng());if(t.inline){var n=wn();return Tn(n.left+e.left,n.top+e.top,e.width,e.height)}var r=An(zt.fromDom(t.getBody()));return Tn(r.x+e.left,r.y+e.top,e.width,e.height)},uM=function(t,e,n,r){void 0===r&&(r=0);var o=Sn(window),i=En(zt.fromDom(t.getContentAreaContainer())),u=Kv(t)||Yv(t)||Qv(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 Tn(c,o.y,s,o.height);var l=function(t,e,n,r,o,i){var u=zt.fromDom(t.getContainer()),a=Zu(u,".tox-editor-header").getOr(u),c=En(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?En(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 Tn(c,f,s,d-f)},aM={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"]},cM={maxHeightFunction:ts(),maxWidthFunction:oA()},sM=function(t){return"node"===t},lM=function(t,e,n,r,o){var i=iM(t),u=r.lastElement().exists((function(t){return ce(n,t)}));return function(t,e){var n=t.selection.getRng(),r=we(zt.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&ce(r.element,e)}(t,n)?u?$h:jh:u?function(t,e,n){var r=qe(t,"position");Fe(t,"position",e);var o=n(t);return r.each((function(e){return Fe(t,"position",e)})),o}(e,r.getMode(),(function(){return oM(i,En(e))&&!r.isReposition()?Kh:$h})):("fixed"===r.getMode()?o.y+wn().top:o.y)+(Qe(e)+12)<=i.y?jh:Uh},fM=function(t,e,n,r){var o=function(e){return function(r,o,i,u,a){var c=lM(t,u,e,n,a),s=_(_({},r),{y:a.y,height:a.height});return _(_({},c(s,o,i,u,a)),{alwaysFit:!0})}},i=function(t){return sM(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))}}},dM=function(t,e){var n=G(e,(function(e){return e.predicate(t.dom)})),r=q(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},mM=function(t,e,n){var r=dM(t,e);if(r.contextForms.length>0)return z.some({elem:t,toolbars:[r.contextForms[0]]});var o=dM(t,n);if(o.contextForms.length>0)return z.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 F(t,(function(t){return t.position===e}))},n=function(e){return G(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),u=U(n("selection"),(function(t){return _(_({},t),{position:"node"})}));return i.concat(u)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return z.some({elem:t,toolbars:i})}return z.none()},gM=function(t,e,n){return t(e)?z.none():bo(e,(function(t){if(Lt(t)){var e=dM(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 K(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 G(t,(function(t){return t.position===e}))}))}(r);return i.length>0?z.some({elem:t,toolbars:i}):z.none()}return z.none()}),t)},hM=function(t,e){var n={},r=[],o=[],i={},u={},a=function(t,a){var c=Mr(Dr("ContextForm",qp,a));n[t]=c,c.launch.map((function(n){i["form:"+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,Dr("ContextToolbar",Gp,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),u[t]=n}))},s=lt(t);return W(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}},pM=$i("forward-slide"),vM=$i("backward-slide"),bM=$i("change-slide-event"),yM=function(t,e,n,r){var o,i,u=r.backstage,a=u.shared,c=ie().deviceType.isTouch,s=Hc(),l=Hc(),f=Hc(),d=Wu((o={sink:n,onEscape:function(){return t.focus(),z.some(!0)}},i=so([]),Mh.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),Mh.getContent(t).each((function(t){Xe(t.element,"visibility")})),Eu(t.element,"tox-pop--resizing"),Xe(t.element,"width")},inlineBehaviours:cc([qg("context-toolbar-events",[zi(jo(),(function(t,e){"width"===e.event.raw.propertyName&&(Eu(t.element,"tox-pop--resizing"),Xe(t.element,"width"))})),Ti(bM,(function(t,e){var n=t.element;Xe(n,"width");var r=an(n);Mh.setContent(t,e.event.contents),_u(n,"tox-pop--resizing");var o=an(n);Fe(n,"width",r+"px"),Mh.getContent(t).each((function(t){e.event.focus.bind((function(t){return vc(t),wc(n)})).orThunk((function(){return Hg.focusIn(t),yc(ke(n))}))})),Yh.setTimeout((function(){Fe(t.element,"width",o+"px")}),0)})),Ti(pM,(function(t,e){Mh.getContent(t).each((function(e){i.set(i.get().concat([{bar:e,focus:yc(ke(t.element))}]))})),yi(t,bM,{contents:e.event.forwardContents,focus:z.none()})})),Ti(vM,(function(t,e){at(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),yi(t,bM,{contents:qu(e.bar),focus:e.focus})}))}))]),Hg.config({mode:"special",onEscape:function(t){return at(i.get()).fold((function(){return o.onEscape()}),(function(e){return bi(t,vM),z.some(!0)}))}})]),lazySink:function(){return Nn.value(o.sink)}}))),m=function(){var e=f.get().getOr("node"),n=sM(e)?1:0;return uM(t,a,e,n)},g=function(){return!(t.removed||c()&&u.isContextMenuOpen())},p=function(){if(g()){var e=m(),n=Ct(f.get(),"node")?function(t,e){return e.filter(Ae).map(An).getOrThunk((function(){return iM(t)}))}(t,s.get()):iM(t);return e.height<=0||!oM(n,e)}return!0},v=function(){s.clear(),l.clear(),f.clear(),Mh.hide(d)},b=function(){if(Mh.isOpen(d)){var t=d.element;Xe(t,"display"),p()?Fe(t,"display","none"):(l.set(0),Mh.reposition(d))}},y=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:cc([Hg.config({mode:"acyclic"}),qg("pop-dialog-wrap-events",[Bi((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return Hg.focusIn(e)}))})),Pi((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},w=jt((function(){return hM(e,(function(t){var e=x([t]);yi(d,pM,{forwardContents:y(e)})}))})),x=function(e){var n=t.ui.registry.getAll().buttons,o=w(),i=_(_({},n),o.formNavigators),u=tb(t)===Xp.scrolling?Xp.scrolling:Xp.default,c=J(U(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return VD(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,z.some(["form:"]))}(i,e):function(t,e){return rM(t,e)}(e,a.providers)})));return EA({type:u,uid:$i("context-toolbar"),initGroups:c,onEscape:z.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:os(12,0,aM),layouts:{onLtr:function(){return[Xa]},onRtl:function(){return[Ka]}},overrides:cM}:{bubble:os(0,12,aM,1/12),layouts:fM(t,n,r,e),overrides:cM}}(t,e,c(),{lastElement:s.get,isReposition:function(){return Ct(l.get(),0)},getMode:function(){return Cl.getMode(n)}});return Yn(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;Xe(u,"display"),function(t){return Ct(kt(t,s.get(),ce),!0)}(e)||(Eu(u,"tox-pop--transition"),Cl.reset(n,d)),Mh.showWithinBounds(d,y(r),{anchor:i,transition:{classes:["tox-pop--transition"],mode:"placement"}},(function(){return z.some(m())})),e.fold(s.clear,s.set),p()&&Fe(u,"display","none")}},k=dp((function(){t.hasFocus()&&!t.removed&&(Au(d.element,"tox-pop--transition")?k.throttle():function(t,e){var n=zt.fromDom(e.getBody()),r=function(t){return ce(t,n)},o=zt.fromDom(e.selection.getNode());return function(t){return!r(t)&&!le(n,t)}(o)?z.none():mM(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return gM(r,o,t)}))}(w(),t).fold(v,(function(t){S(t.toolbars,z.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();yt(n.lookupTable,e.toolbarKey).each((function(n){S([n],Ot(e.target!==t,e.target)),Mh.getContent(d).each(Hg.focusIn)}))})),t.on("focusout",(function(e){Yh.setEditorTimeout(t,(function(){wc(n.element).isNone()&&wc(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){wc(d.element).fold(k.throttle,h)}))}))},wM={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:[""]},xM=(eD=["Infinity","[0-9]+\\."+(tD=function(t){return"(?:"+t+")?"})("[0-9]+")+tD("[eE][+-]?[0-9]+"),"\\.[0-9]+"+tD("[eE][+-]?[0-9]+"),"[0-9]+"+tD("[eE][+-]?[0-9]+")].join("|"),new RegExp("^([+-]?(?:"+eD+"))(.*)$")),CM=function(t,e){return z.from(xM.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return F(e,(function(e){return F(wM[e],(function(e){return t===e}))}))}(r,e)?z.some({value:n,unit:r}):z.none()}))},SM=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=Hc();return U(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(Ct(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})},kM={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 CM(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 z.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},OM=function(t){SM(t,kM),function(t){return z.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=zt.fromDom(t.selection.getNode());return yo(e,(function(t){return z.some(t).filter(Lt).bind((function(t){return Be(t,"lang").map((function(e){return{code:e,customCode:Be(t,"data-mce-lang").getOrUndefined(),title:""}}))}))}))},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(e){var n=Lc();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 SM(t,e)}))},_M=function(t,e){!function(t,e){var n=QA(0,e,iD(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=QA(0,e,cD(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=_({type:"advanced"},e.styleselect),r=QA(0,e,hD(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=QA(0,e,gD(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=QA(0,e,dD(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)},TM=function(t){return XA(t,"NodeChange",(function(e){e.setDisabled(!t.queryCommandState("outdent"))}))},EM=function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:TM(t),onAction:YA(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:YA(t,"indent")})}(t)},AM=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},DM=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:$A(t,e.name),onAction:AM(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:$A(t,n),onAction:AM(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:YA(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:YA(t,e.action),onSetup:$A(t,e.name)})}))}(t)},MM=function(t){DM(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:YA(t,e.action)})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:AM(t,"code")})}(t)},RM=function(t,e){return XA(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())}))},NM=function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:RM(t,"hasUndo"),onAction:YA(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:RM(t,"hasRedo"),onAction:YA(t,"redo")})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:RM(t,"hasUndo"),onAction:YA(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:RM(t,"hasRedo"),onAction:YA(t,"redo")})}(t)},zM=function(t){return XA(t,"VisualAid",(function(e){e.setActive(t.hasVisual)}))},BM=function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:YA(t,"mceToggleVisualAid")})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:zM(t),onAction:YA(t,"mceToggleVisualAid")})}(t)},PM=function(t,e){!function(t){W([{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:YA(t,e.cmd),onSetup:$A(t,e.name)})})),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:YA(t,"JustifyNone")})}(t),MM(t),_M(t,e),NM(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=so(null),n=so(null);My(t,"forecolor","forecolor","Text color",e),My(t,"backcolor","hilitecolor","Background color",n),Ry(t,"forecolor","forecolor","Text color"),Ry(t,"backcolor","hilitecolor","Background color")}(t),BM(t),EM(t),OM(t)},IM=function(t,e){return{type:"makeshift",x:t,y:e}},LM=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},HM=function(t,e){var n=Vv.DOM.getPos(t);return function(t,e,n){return IM(t.x+e,t.y+n)}(e,n.x,n.y)},FM=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(LM(t)){var e=t.touches[0];return IM(e.pageX,e.pageY)}return IM(t.pageX,t.pageY)}(e):HM(t.getContentAreaContainer(),function(t){if(LM(t)){var e=t.touches[0];return IM(e.clientX,e.clientY)}return IM(t.clientX,t.clientY)}(e)):VM(t)},VM=function(t){return{type:"selection",root:zt.fromDom(t.selection.getNode())}},jM=function(t,e,n){switch(n){case"node":return function(t){return{type:"node",node:z.some(zt.fromDom(t.selection.getNode())),root:zt.fromDom(t.getBody())}}(t);case"point":return FM(t,e);case"selection":return VM(t)}},UM=function(t,e,n,r,o,i){var u=n(),a=jM(t,e,i);rO(u,Kp.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),Mh.showMenuAt(o,{anchor:a},{menu:{markers:rv("normal")},data:t})}))},WM={onLtr:function(){return[$a,ja,Ua,Wa,qa,Ga,jh,Uh,Vh,Hh,Fh,Lh]},onRtl:function(){return[$a,Ua,ja,qa,Wa,Ga,jh,Uh,Fh,Lh,Vh,Hh]}},qM={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"]},GM=function(t,e,n,r,o,i,u){var a=function(t,e,n){var r=jM(t,e,n);return _({bubble:os(0,"point"===n?12:0,qM),layouts:WM,overrides:{maxWidthFunction:oA(),maxHeightFunction:ts()}},r)}(t,e,i);rO(n,Kp.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),Mh.showMenuWithinBounds(o,{anchor:a},{menu:{markers:rv("normal"),highlightImmediately:u},data:n,type:"horizontal"},(function(){return z.some(uM(t,r.shared,"node"===i?"node":"selection"))})),t.fire("contexttoolbar-hide")}))},$M=function(t,e,n,r,o,i){var u=ie(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),l=u.deviceType.isTouch(),f=function(){var u=n();GM(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(){Yh.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 Ks(t.getWin(),Ds.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()},XM=function(t){return"string"==typeof t?t.split(/[ ,]/):t},KM=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},YM=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return z.from(t.getParam(e)).map(XM).getOrThunk((function(){return G(XM(n),(function(t){return wt(r,t)}))}))}(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},JM=function(t){return o(t)?"|"===t:"separator"===t.type},QM={type:"separator"},ZM=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 QM;case"submenu":return _(_({type:"nestedmenuitem"},n(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return o(e)?e:U(e,ZM)}});default:return _(_({type:"menuitem"},n(t)),{onAction:(e=t.onAction,function(){return e()})})}},tR=function(t,e){if(0===e.length)return t;var n=at(t).filter((function(t){return!JM(t)})).fold((function(){return[]}),(function(t){return[QM]}));return t.concat(n).concat(e).concat([QM])},eR=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},nR=function(t,e){return eR(t,e)?t.selection.getStart(!0):e.target},rR=function(t,e,n){var r=ie().deviceType.isTouch,i=Wu(Mh.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([qg("dismissContextMenu",[Ti(li(),(function(e,n){Wl.close(e),t.focus()}))])])})),u=function(t){return Mh.hide(i)},a=function(e){if(KM(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!KM(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=eR(t,e)?"selection":"point";if(Mt(n)){var o=nR(t,e);return nw(zt.fromDom(o),n)?"node":r}return r}(t,e);(r()?$M:UM)(t,e,(function(){var n=nR(t,e),r=t.ui.registry.getAll(),i=YM(t);return function(t,e,n){var r=X(e,(function(e,r){return yt(t,r.toLowerCase()).map((function(t){var r=t.update(n);if(o(r))return tR(e,r.split(" "));if(r.length>0){var i=U(r,ZM);return tR(e,i)}return e})).getOrThunk((function(){return e.concat([r])}))}),[]);return r.length>0&&JM(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)}))},oR=lo([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),iR=function(t){return function(e){return e.translate(-t.left,-t.top)}},uR=function(t){return function(e){return e.translate(t.left,t.top)}},aR=function(t){return function(e,n){return X(t,(function(t,e){return e(t)}),en(e,n))}},cR=function(t,e,n){return t.fold(aR([uR(n),iR(e)]),aR([iR(e)]),aR([]))},sR=function(t,e,n){return t.fold(aR([uR(n)]),aR([]),aR([uR(e)]))},lR=function(t,e,n){return t.fold(aR([]),aR([iR(n)]),aR([uR(e),iR(n)]))},fR=function(t,e,n){var r=t.fold((function(t,e){return{position:z.some("absolute"),left:z.some(t+"px"),top:z.some(e+"px")}}),(function(t,e){return{position:z.some("absolute"),left:z.some(t-n.left+"px"),top:z.some(e-n.top+"px")}}),(function(t,e){return{position:z.some("fixed"),left:z.some(t+"px"),top:z.some(e+"px")}}));return _({right:z.none(),bottom:z.none()},r)},dR=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(lR,mR),o(sR,gR),o(cR,hR))},mR=oR.offset,gR=oR.absolute,hR=oR.fixed,pR=function(t,e){var n=ze(t,e);return s(n)?NaN:parseInt(n,10)},vR=function(t,e,n,r){return function(t,e){var n=t.element,r=pR(n,e.leftAttr),o=pR(n,e.topAttr);return isNaN(r)||isNaN(o)?z.none():z.some(en(r,o))}(t,e).fold((function(){return n}),(function(t){return hR(t.left+r.left,t.top+r.top)}))},bR=function(t,e,n,r,o,i){var u=vR(t,e,n,r),a=e.mustSnap?xR(t,e,u,o,i):CR(t,e,u,o,i),c=cR(u,o,i);return function(t,e,n){var r=t.element;Ne(r,e.leftAttr,n.left+"px"),Ne(r,e.topAttr,n.top+"px")}(t,e,c),a.fold((function(){return{coord:hR(c.left,c.top),extra:z.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},yR=function(t,e){!function(t,e){var n=t.element;Ie(n,e.leftAttr),Ie(n,e.topAttr)}(t,e)},wR=function(t,e,n,r){return st(t,(function(t){var o=t.sensor;return function(t,e,n,r,o,i){var u=sR(t,o,i),a=sR(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)?z.some({output:dR(t.output,e,n,r),extra:t.extra}):z.none()}))},xR=function(t,e,n,r,o){var i=e.getSnapPoints(t);return wR(i,n,r,o).orThunk((function(){return X(i,(function(t,e){var i=e.sensor,u=function(t,e,n,r,o,i){var u=sR(t,o,i),a=sR(e,o,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return en(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:z.some(u),snap:z.some(e)}}),(function(n){return(u.left+u.top)/2<=(n.left+n.top)/2?{deltas:z.some(u),snap:z.some(e)}:t}))}),{deltas:z.none(),snap:z.none()}).snap.map((function(t){return{output:dR(t.output,n,r,o),extra:t.extra}}))}))},CR=function(t,e,n,r,o){var i=e.getSnapPoints(t);return wR(i,n,r,o)},SR=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=fe(t.element),u=wn(i),a=BT(o),c=function(t,e,n){return{coord:dR(t.output,t.output,e,n),extra:t.extra}}(r,u,a),s=fR(c.coord,0,a);je(o,s)}}}),kR=function(t,e){t.getSystem().addToGui(e),function(t){he(t.element).filter(Lt).each((function(e){qe(e,"z-index").each((function(t){Ne(e,"data-initial-z-index",t)})),Fe(e,"z-index",Ue(t.element,"z-index"))}))}(e)},OR=function(t){!function(t){he(t.element).filter(Lt).each((function(t){Be(t,"data-initial-z-index").fold((function(){return Xe(t,"z-index")}),(function(e){return Fe(t,"z-index",e)})),Ie(t,"data-initial-z-index")}))}(t),t.getSystem().removeFromGui(t)},_R=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}))},TR=Zr("snaps",[Lr("getSnapPoints"),pa("onSensor"),Lr("leftAttr"),Lr("topAttr"),to("lazyViewport",Dn),to("mustSnap",!1)]),ER=[to("useFixed",S),Lr("blockerClass"),to("getTarget",b),to("onDrag",h),to("repositionTarget",!0),to("onDrop",h),uo("getBounds",Dn),TR],AR=function(t){return(e=qe(t,"left"),n=qe(t,"top"),r=qe(t,"position"),o=function(t,e,n){return("fixed"===n?hR:mR)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?z.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):z.none()).getOrThunk((function(){var e=rn(t);return gR(e.left,e.top)}));var e,n,r,o},DR=function(t,e,n,r,o,i,u){return function(t,e,n,r,o){var i=o.bounds,u=sR(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=gR(a,c);return e.fold((function(){var t=lR(s,n,r);return mR(t.left,t.top)}),v(s),(function(){var t=cR(s,n,r);return hR(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 mR(t+e,n+u)}),(function(t,n){return gR(t+e,n+u)}),(function(t,n){return hR(t+e,n+u)}))),c=cR(a,r,o);return hR(c.left,c.top)}),(function(e){var u=bR(t,e,n,i,r,o);return u.extra.each((function(n){e.onSensor(t,n)})),u.coord})),r,o,u)},MR=function(t,e){return{bounds:t.getBounds(),height:Ze(e.element),width:cn(e.element)}},RR=function(t,e,n,r,o){var i=n.update(r,o),u=n.getStartData().getOrThunk((function(){return MR(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=fe(t.element),u=wn(i),a=BT(o),c=AR(o),s=DR(t,e.snaps,c,u,a,r,n),l=fR(s,0,a);je(o,l)}e.onDrag(t,o,r)}(t,e,u,n)}))},NR=function(t,e,n,r){e.each(OR),n.snaps.each((function(e){yR(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},zR=function(t){return function(e,n){var r=function(t){n.setStartData(MR(e,t))};return ki(E([Ti(ui(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r),!0))}},BR=Object.freeze({__proto__:null,getData:function(t){return z.from(en(t.x,t.y))},getDelta:function(t,e){return en(e.left-t.left,e.top-t.top)}}),PR=function(t,e,n){return[Ti(Ao(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return NR(r,z.some(c),t,e)},u=rw(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(n){u.cancel(),RR(r,t,e,BR,n)}},c=_R(r,t.blockerClass,function(t){return ki([Ti(Ao(),t.forceDrop),Ti(Ro(),t.drop),Ti(Do(),(function(e,n){t.move(n.event)})),Ti(Mo(),t.delayDrop)])}(a));n(r),kR(r,c)}}))]},IR=E(E([],ER,!0),[wa("dragger",{handlers:zR(PR)})],!1),LR=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return z.some(en(e.clientX,e.clientY))}(e):z.none()},getDelta:function(t,e){return en(e.left-t.left,e.top-t.top)}}),HR=function(t,e,n){var r=Hc(),o=function(n){NR(n,r.get(),t,e),r.clear()};return[Ti(Oo(),(function(i,u){u.stop();var a=function(){return o(i)},c={drop:a,delayDrop:h,forceDrop:a,move:function(n){RR(i,t,e,LR,n)}},s=_R(i,t.blockerClass,function(t){return ki([Ti(Oo(),t.forceDrop),Ti(To(),t.drop),Ti(Eo(),t.drop),Ti(_o(),(function(e,n){t.move(n.event)}))])}(c));r.set(s);n(i),kR(i,s)})),Ti(_o(),(function(n,r){r.stop(),RR(n,t,e,LR,r.event)})),Ti(To(),(function(t,e){e.stop(),o(t)})),Ti(Eo(),o)]},FR=IR,VR=E(E([],ER,!0),[wa("dragger",{handlers:zR(HR)})],!1),jR=E(E([],ER,!0),[wa("dragger",{handlers:zR((function(t,e,n){return E(E([],PR(t,e,n),!0),HR(t,e,n),!0)}))})],!1),UR=dc({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:FR,touch:VR,mouseOrTouch:jR}),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:z.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=z.none(),e=z.none(),n=v({});return lu({readState:n,reset:function(){t=z.none(),e=z.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=z.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=z.some(t)}})}}),apis:SR}),WR=function(t,e,n,r,o,i){return t.fold((function(){return UR.snap({sensor:gR(n-20,r-20),range:en(o,i),output:gR(z.some(n),z.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,u=t.element.dom.getBoundingClientRect();return UR.snap({sensor:gR(o,i),range:en(40,40),output:gR(z.some(n-u.width/2),z.some(r-u.height/2)),extra:{td:e}})}))},qR=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 ce(t,e)}))})(e.get(),o)||(e.set(o),n(o))},mustSnap:!0}},GR=function(t){return Qh(Jh.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:cc([UR.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),Rx.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},$R=function(t,e){var n=so([]),r=so([]),o=so(!1),i=Hc(),u=Hc(),a=function(t){var n=An(t);return WR(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=An(t);return WR(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=qR((function(){return U(n.get(),(function(t){return a(t)}))}),i,(function(e){u.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=qR((function(){return U(r.get(),(function(t){return c(t)}))}),u,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=GR(s),d=GR(l),m=Wu(f.asSpec()),g=Wu(d.asSpec()),h=function(e,n,r,o){var i=r(n);UR.snapTo(e,i);!function(e,n,r,o){var i=n.dom.getBoundingClientRect();Xe(e.element,"display");var u=ge(zt.fromDom(t.getBody())).dom.innerHeight,a=r(i),c=o(i,u);(a||c)&&Fe(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")};ie().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()&&(Dl(m),Dl(g),o.set(!1)),i.clear(),u.clear()})))},XR=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},KR=function(t,e,n){e.delimiter||(e.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:cc([Hg.config({mode:"flow",selector:"div[role=button]"}),Nd.config({disabled:n.isDisabled}),vb(),Sw.config({}),Wg.config({}),qg("elementPathEvents",[Bi((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return Hg.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&&!XR(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?Wg.set(r,(i=U(a||[],(function(e,r){return Jh.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([yb(n.isDisabled),vb()])})})),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},X(i.slice(1),(function(t,e){var n=t;return n.push(u),n.push(e),n}),[i[0]]))):Wg.set(r,[])}))}))])]),components:[]}};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(nD||(nD={}));var YR=function(t,e,n){var r=zt.fromDom(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=XD(r+e.top,Gv(t),Xv(t)),n===nD.Both&&(i.width=XD(o+e.left,qv(t),$v(t))),i}(t,e,n,Qe(r),an(r));dt(o,(function(t,e){return Fe(r,e,$D(t))})),function(t){t.fire("ResizeEditor")}(t)},JR=function(t,e,n,r){var o=en(20*n,20*r);return YR(t,o,e),z.some(!0)},QR=function(t,e){var n=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?nD.None:"both"===n?nD.Both:nD.Vertical}(t);return n===nD.None?z.none():z.some(ap("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize")},behaviours:[UR.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){return YR(t,o,n)},blockerClass:"tox-blocker"}),Hg.config({mode:"special",onLeft:function(){return JR(t,n,-1,0)},onRight:function(){return JR(t,n,1,0)},onUp:function(){return JR(t,n,0,-1)},onDown:function(){return JR(t,n,0,1)}}),Sw.config({}),Yg.config({})]},e.icons))},ZR=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(KR(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return Wg.set(t,[Vu(e.translate(["{0} "+r,n[r]]))])};return Jh.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:cc([yb(e.isDisabled),vb(),Sw.config({}),Wg.config({}),ff.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),qg("wordcount-events",[Li((function(t){var e=ff.getValue(t),n="words"===e.mode?"characters":"words";ff.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),Bi((function(e){t.on("wordCountUpdate",(function(t){var n=ff.getValue(e).mode;ff.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[Jo()]=["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=Zh.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=QR(t,e);return r.concat(o.toArray())}()}},tN=function(t){var e,n,r,o,i=t.inline,u=i?ZD:qD,a=sb(t)?aE:NT,c=z.none(),s=ie(),l=s.browser.isIE()?["tox-platform-ie"]:[],f=s.deviceType.isTouch()?["tox-platform-touch"]:[],d=ob(t),m=ab(t),g=Zh.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[ss]=d?Dc.BottomToTop:Dc.TopToBottom,e)},v=function(){return c.bind(PA.getHeader)},b=function(){Fe(G.element,"width",document.body.clientWidth+"px")},y=Wu((n=ce(De(),m)&&"grid"===Ue(m,"display"),r={dom:_({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(f)},g),behaviours:cc([Cl.config({useFixed:function(){return a.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:ki([Ti(ai(),b)])},Yn(r,n?o:{}))),w=function(){return Nn.value(y)},x=Qh({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(t){return PA.getThrobber(t)})).getOrDie("Could not find throbber element")},S=yT(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=tb(t),T=PA.parts.toolbar(_({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}),R=t.getParam("statusbar",!0,"boolean")&&!i?z.some(ZR(t,S.shared.providers)):z.none(),N={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[A,D]},B=Qv(t),P=Yv(t),I=Kv(t),L=PA.parts.header({dom:_({tag:"div",classes:["tox-editor-header"]},p),components:J([I?[k]:[],B?[E]:P?[T]:[],ub(t)?[]:[x.asSpec()]]),sticky:sb(t),editor:t,sharedBackstage:S.shared}),H=J([d?[]:[L],i?[]:[N],d?[L]:[]]),F=J([[{dom:{tag:"div",classes:["tox-editor-container"]},components:H}],i?[]:R.toArray(),[M]]),V=cb(t),j=_(_({role:"application"},Zh.isRtl()?{dir:"rtl"}:{}),V?{"aria-hidden":"true"}:{}),U=Wu(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:_({visibility:"hidden"},V?{opacity:"0",border:"0"}:{}),attributes:j},components:F,behaviours:cc([vb(),Nd.config({disableClass:"tox-tinymce--disabled"}),Hg.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=z.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 q=vw(U),G=vw(y);!function(t,e,n){var r=function(t,r){W([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){W([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(ql(),{target:t.target})},u=pc(),a=Vc(u,"touchstart",i),c=Vc(u,"touchmove",(function(t){return r(oi(),t)})),s=Vc(u,"touchend",(function(t){return r(ii(),t)})),l=Vc(u,"mousedown",i),f=Vc(u,"mouseup",(function(t){0===t.raw.button&&o($l(),{target:t.target})})),d=function(t){return o(ql(),{target:zt.fromDom(t.target)})},m=function(t){0===t.button&&o($l(),{target:zt.fromDom(t.target)})},g=function(){W(t.editorManager.get(),(function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})}))},h=function(t){return r(ui(),Uc(t))},p=function(t){o(Gl(),{}),r(ai(),Uc(t))},v=function(){return o(Gl(),{})},b=function(e){e.state&&o(ql(),{target:zt.fromDom(t.getContainer())})},y=function(t){o(ql(),{target:zt.fromDom(t.relatedTarget.getContainer())})};t.on("PostRender",(function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("mousedown",g),t.on("ScrollWindow",h),t.on("ResizeWindow",p),t.on("ResizeEditor",v),t.on("AfterProgressState",b),t.on("DismissPopups",y)})),t.on("remove",(function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("mousedown",g),t.off("ScrollWindow",h),t.off("ResizeWindow",p),t.off("ResizeEditor",v),t.off("AfterProgressState",b),t.off("DismissPopups",y),l.unbind(),a.unbind(),c.unbind(),s.unbind(),f.unbind()})),t.on("detach",(function(){zl(e),zl(n),e.destroy(),n.destroy()}))}(t,q,G);var $=function(){var e=$D(KD(t)),n=$D(function(t){return YD(t).getOr(Wv(t))}(t));return t.inline||($e("div","width",n)&&Fe(U.element,"width",n),$e("div","height",e)?Fe(U.element,"height",e):Fe(U.element,"height","200px")),e};return{mothership:q,uiMothership:G,backstage:S,renderUI:function(){a.setup(t,S.shared,v),PM(t,S),rR(t,w,S),function(t){var e=t.ui.registry.getAll().sidebars;W(lt(e),(function(n){var r=e[n],o=function(){return Ct(z.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),XE(t,C,S.shared),mt(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=Jv(t),s={menuItems:r,menus:lb(t),menubar:fb(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:O===Xp.floating,buttons:n,sidebar:i};yM(t,o,y,{backstage:S}),$R(t,y);var l=t.getElement(),f=$(),d={mothership:q,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}}}}},eN=v([Lr("lazySink"),$r("dragBlockClass"),uo("getBounds",Dn),to("useTabstopAt",k),to("eventOrder",{}),df("modalBehaviours",[Hg]),va("onExecute"),ya("onEscape")]),nN={sketch:b},rN=v([jf({name:"draghandle",overrides:function(t,e){return{behaviours:cc([UR.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})])}}}),Ff({schema:[Lr("dom")],name:"title"}),Ff({factory:nN,schema:[Lr("dom")],name:"close"}),Ff({factory:nN,schema:[Lr("dom")],name:"body"}),jf({factory:nN,schema:[Lr("dom")],name:"footer"}),Vf({factory:{sketch:function(t,e){return _(_({},t),{dom:e.dom,components:e.components})}},schema:[to("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),to("components",[])],name:"blocker"})]),oN=hd({name:"ModalDialog",configFields:eN(),partFields:rN(),factory:function(t,e,n,r){var o,i=Hc(),u=$i("modal-events"),a=_(_({},t.eventOrder),((o={})[ci()]=[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(_(_({},o),{components:o.components.concat([qu(e)]),behaviours:cc([Yg.config({}),qg("dialog-blocker-events",[zi(zo(),(function(){Hg.focusIn(e)}))])])}));Tl(n,u),Hg.focusIn(e)},hide:function(t){i.clear(),he(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){Dl(t)}))}))},getBody:function(e){return ed(e,t,"body")},getFooter:function(e){return ed(e,t,"footer")},setIdle:function(t){WE.unblock(t)},setBusy:function(t,e){WE.block(t,e)}},eventOrder:a,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:gf(t.modalBehaviours,[Wg.config({}),Hg.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),WE.config({getRoot:i.get}),qg(u,[Bi((function(e){var n,r,o,i,u,a;n=e.element,r=ed(e,t,"title").element,o=Be(n,"id").fold((function(){var t=$i("dialog-label");return Ne(r,"id",t),t}),b),Ne(n,"aria-labelledby",o),i=e.element,u=ed(e,t,"body").element,a=z.from(ze(i,"id")).fold((function(){var t=$i("dialog-describe");return Ne(u,"id",t),t}),b),Ne(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)}}}),iN=mr([Vr("type"),Vr("name")].concat(wv)),uN=Cr,aN=[Br("name","name",Qn((function(){return $i("button-name")})),xr),Yr("icon"),oo("align","end",["start","end"]),io("primary",!1),io("disabled",!1)],cN=E(E([],aN,!0),[Vr("text")],!1),sN=E([jr("type",["submit","cancel","custom"])],cN,!0),lN=E([jr("type",["menu"]),Yr("text"),Yr("tooltip"),Yr("icon"),Gr("items",iN)],aN,!0),fN=zr("type",{submit:sN,cancel:sN,custom:sN,menu:lN}),dN=[Vr("type"),Vr("text"),jr("level",["info","warn","error","success"]),Vr("icon"),to("url","")],mN=mr(dN),gN=[Vr("type"),Vr("text"),io("disabled",!1),io("primary",!1),Br("name","name",Qn((function(){return $i("button-name")})),xr),Yr("icon"),io("borderless",!1)],hN=mr(gN),pN=[Vr("type"),Vr("name"),Vr("label"),io("disabled",!1)],vN=mr(pN),bN=Cr,yN=[Vr("type"),Vr("name")],wN=yN.concat([Yr("label")]),xN=wN.concat([to("columns","auto")]),CN=mr(xN),SN=vr([Vr("value"),Vr("text"),Vr("icon")]),kN=mr(wN),ON=xr,_N=mr(wN),TN=xr,EN=yN.concat([ro("tag","textarea"),Vr("scriptId"),Vr("scriptUrl"),function(t,e){return eo(t,e,Or)}("settings",void 0)]),AN=yN.concat([ro("tag","textarea"),Ur("init")]),DN=Er((function(t){return Dr("customeditor.old",dr(AN),t).orThunk((function(){return Dr("customeditor.new",dr(EN),t)}))})),MN=xr,RN=mr(wN),NN=gr(ur),zN=function(t){return[Vr("type"),Fr("columns"),t]},BN=[Vr("type"),Vr("html"),oo("presets","presentation",["presentation","document"])],PN=mr(BN),IN=wN.concat([io("sandboxed",!0)]),LN=mr(IN),HN=xr,FN=wN.concat([Hr("currentState",mr([Lr("blob"),Vr("url")]))]),VN=mr(FN),jN=wN.concat([Yr("inputMode"),Yr("placeholder"),io("maximized",!1),io("disabled",!1)]),UN=mr(jN),WN=xr,qN=function(t){return[Vr("type"),Vr("label"),t]},GN=[Vr("text"),Vr("value")],$N=[Vr("text"),Gr("items",function(t,e){return n=jt(e),{extract:function(t,e){return n().extract(t,e)},toString:function(){return n().toString()}};var n}(0,(function(){return XN})))],XN=hr([mr(GN),mr($N)]),KN=wN.concat([Gr("items",XN),io("disabled",!1)]),YN=mr(KN),JN=xr,QN=wN.concat([qr("items",[Vr("text"),Vr("value")]),no("size",1),io("disabled",!1)]),ZN=mr(QN),tz=xr,ez=wN.concat([io("constrain",!0),io("disabled",!1)]),nz=mr(ez),rz=mr([Vr("width"),Vr("height")]),oz=[Vr("type"),Gr("header",xr),Gr("cells",gr(xr))],iz=mr(oz),uz=wN.concat([Yr("placeholder"),io("maximized",!1),io("disabled",!1)]),az=mr(uz),cz=xr,sz=wN.concat([oo("filetype","file",["image","media","file"]),to("disabled",!1)]),lz=mr(sz),fz=mr([Vr("value"),to("meta",{})]),dz=function(t){return Br("items","items",{tag:"required",process:{}},gr(Er((function(e){return Dr("Checking item of "+t,mz,e).fold((function(t){return Nn.error(Nr(t))}),(function(t){return Nn.value(t)}))}))))},mz=lr((function(){return Tr("type",{alertbanner:mN,bar:mr((t=dz("bar"),[Vr("type"),t])),button:hN,checkbox:vN,colorinput:kN,colorpicker:_N,dropzone:RN,grid:mr(zN(dz("grid"))),iframe:LN,input:UN,listbox:YN,selectbox:ZN,sizeinput:nz,textarea:az,urlinput:lz,customeditor:DN,htmlpanel:PN,imagetools:VN,collection:CN,label:mr(qN(dz("label"))),table:iz,panel:hz});var t})),gz=[Vr("type"),to("classes",[]),Gr("items",mz)],hz=mr(gz),pz=[Br("name","name",Qn((function(){return $i("tab-name")})),xr),Vr("title"),Gr("items",mz)],vz=[Vr("type"),qr("tabs",pz)],bz=mr(vz),yz=cN,wz=fN,xz=mr([Vr("title"),Hr("body",Tr("type",{panel:hz,tabpanel:bz})),ro("size","normal"),Gr("buttons",wz),to("initialData",{}),uo("onAction",h),uo("onChange",h),uo("onSubmit",h),uo("onClose",h),uo("onCancel",h),to("onTabChange",h)]),Cz=mr(E([jr("type",["cancel","custom"])],yz,!0)),Sz=mr([Vr("title"),Vr("url"),Kr("height"),Kr("width"),Qr("buttons",Cz),uo("onAction",h),uo("onCancel",h),uo("onClose",h),uo("onMessage",h)]),kz=function(t){return i(t)?[t].concat(Q(bt(t),kz)):u(t)?Q(t,kz):[]},Oz=function(t){return o(t.type)&&o(t.name)},_z={checkbox:bN,colorinput:ON,colorpicker:TN,dropzone:NN,input:WN,iframe:HN,sizeinput:rz,selectbox:tz,listbox:JN,size:rz,textarea:cz,urlinput:fz,customeditor:MN,collection:SN,togglemenuitem:uN},Tz=function(t){var e=function(t){return G(kz(t),Oz)}(t),n=Q(e,(function(t){return function(t){return z.from(_z[t.type])}(t).fold((function(){return[]}),(function(e){return[Hr(t.name,e)]}))}));return mr(n)},Ez=function(t){return{internalDialog:Mr(Dr("dialog",xz,t)),dataValidator:Tz(t),initialData:t.initialData}},Az={open:function(t,e){var n=Ez(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(Mr(Dr("dialog",Sz,e)))},redial:function(t){return Ez(t)}},Dz=function(t){var e=[],n={};return dt(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?Nn.error(e):Nn.value(n)},Mz=function(t,e){var n=Qh(OS.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:U(t.items,(function(t){return O_(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([Hg.config({mode:"acyclic",useTabstopAt:x(ZS)}),NS(n),jS(n,{postprocess:function(t){return Dz(t).fold((function(t){return console.error(t),{}}),b)}})])}},Rz=gd({name:"TabButton",configFields:[to("uid",void 0),Lr("value"),Br("dom","dom",tr((function(){return{attributes:{role:"tab",id:$i("aria"),"aria-selected":"false"}}})),br()),$r("action"),to("domModification",{}),df("tabButtonBehaviours",[Yg,Hg,ff]),Lr("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:lh(t.action),behaviours:gf(t.tabButtonBehaviours,[Yg.config({}),Hg.config({mode:"execution",useSpace:!0,useEnter:!0}),ff.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),Nz=v([Lr("tabs"),Lr("dom"),to("clickToDismiss",!1),df("tabbarBehaviours",[Wd,Hg]),ga(["tabClass","selectedClass"])]),zz=Uf({factory:Rz,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){Wd.dehighlight(t,e),yi(t,hi(),{tabbar:t,button:e})},n=function(t,e){Wd.highlight(t,e),yi(t,gi(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=Wd.isHighlighted(o,r);(i&&t.clickToDismiss?e:i?h:n)(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),Bz=v([zz]),Pz=hd({name:"Tabbar",configFields:Nz(),partFields:Bz(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:gf(t.tabbarBehaviours,[Wd.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){Ne(e.element,"aria-selected","true")},onDehighlight:function(t,e){Ne(e.element,"aria-selected","false")}}),Hg.config({mode:"flow",getInitial:function(t){return Wd.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),Iz=gd({name:"Tabview",configFields:[df("tabviewBehaviours",[Wg])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:gf(t.tabviewBehaviours,[Wg.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),Lz=v([to("selectFirst",!0),pa("onChangeTab"),pa("onDismissTab"),to("tabs",[]),df("tabSectionBehaviours",[])]),Hz=Ff({factory:Pz,schema:[Lr("dom"),Wr("markers",[Lr("tabClass"),Lr("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),Fz=Ff({factory:Iz,name:"tabview"}),Vz=v([Hz,Fz]),jz=hd({name:"TabSection",configFields:Lz(),partFields:Vz(),factory:function(t,e,n,r){var o=function(e,n){td(e,t,"tabbar").each((function(t){n(t).each(wi)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:mf(t.tabSectionBehaviours),events:ki(J([t.selectFirst?[Bi((function(t,e){o(t,Wd.getFirst)}))]:[],[Ti(gi(),(function(e,n){!function(e){var n=ff.getValue(e);td(e,t,"tabview").each((function(r){K(t.tabs,(function(t){return t.value===n})).each((function(n){var o=n.view();Be(e.element,"id").each((function(t){Ne(r.element,"aria-labelledby",t)})),Wg.set(r,o),t.onChangeTab(r,e,o)}))}))}(n.event.button)})),Ti(hi(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return td(e,t,"tabview").map((function(t){return Wg.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=Wd.getCandidates(t);return K(n,(function(t){return ff.getValue(t)===e})).filter((function(e){return!Wd.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),Uz=function(t,e){Fe(t,"height",e+"px"),ie().browser.isIE()?Xe(t,"flex-basis"):Fe(t,"flex-basis",e+"px")},Wz=function(t,e,n){Ju(t,'[role="dialog"]').each((function(t){Zu(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Fe(e,"height","0"),Fe(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=me(t).dom,i=Ju(t,".tox-dialog-wrap").getOr(t);r="fixed"===Ue(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var u=Qe(e),a=e.dom.offsetLeft>=n.dom.offsetLeft+an(n)?Math.max(Qe(n),u):u,c=parseInt(Ue(t,"margin-top"),10)||0,s=parseInt(Ue(t,"margin-bottom"),10)||0;return r-(Qe(t)+c+s-a)}(t,e,r))})).each((function(t){Uz(e,t)}))}))}))},qz=function(t){return Zu(t,'[role="tabpanel"]')},Gz=function(t){var e;return{smartTabHeight:(e=Hc(),{extraEvents:[Bi((function(n){var r=n.element;qz(r).each((function(o){Fe(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){(function(t){return ut(ot(t,(function(t,e){return t>e?-1:t<e?1:0})))})(function(t,e,n){return U(t,(function(r,o){Wg.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return Wg.set(n,[]),i.height}))}(t,o,n)).fold(e.clear,e.set)})),Wz(r,o,e),Xe(o,"visibility"),function(t,e){ut(t).each((function(t){return jz.showTab(e,t.value)}))}(t,n),Yh.requestAnimationFrame((function(){Wz(r,o,e)}))}))})),Ti(ai(),(function(t){var n=t.element;qz(n).each((function(t){Wz(n,t,e)}))})),Ti(Iw,(function(t,n){var r=t.element;qz(r).each((function(t){var n=yc(ke(t));Fe(t,"visibility","hidden");var o=qe(t,"height").map((function(t){return parseInt(t,10)}));Xe(t,"height"),Xe(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(i),Wz(r,t,e)):o.each((function(e){Uz(t,e)})),Xe(t,"visibility"),n.each(vc)}))}))],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},$z=function(t,e){var n=so({}),r=function(t){var e=ff.getValue(t),r=Dz(e).getOr({}),o=n.get(),i=Yn(o,r);n.set(i)},o=function(t){var e=n.get();ff.setValue(t,e)},i=so(null),u=U(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:U(t.items,(function(t){return O_(n,t,e)})),formBehaviours:cc([Hg.config({mode:"acyclic",useTabstopAt:x(ZS)}),qg("TabView.form.events",[Bi(o),Pi(r)]),gc.config({channels:ho([{key:"send-data-to-section",value:{onReceive:r}},{key:"send-data-to-view",value:{onReceive:o}}])})])}}))]}}})),a=Gz(u).smartTabHeight;return jz.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=ff.getValue(e);yi(t,Pw,{name:r,oldName:i.get()}),i.set(r)},tabs:u,components:[jz.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({})])}),jz.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:a.selectFirst,tabSectionBehaviours:cc([qg("tabpanel",a.extraEvents),Hg.config({mode:"acyclic"}),yd.config({find:function(t){return ut(jz.getViewItems(t))}}),ff.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"],{})}}})])})},Xz=$i("update-dialog"),Kz=$i("update-title"),Yz=$i("update-body"),Jz=$i("update-footer"),Qz=$i("body-send-message"),Zz=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:_(_({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:cc([zS(0),wD.config({channel:Yz,updateState:function(t,e){return z.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[$z(t.body,n)];default:return[Mz(t.body,n)]}},initialData:t})])}},tB=Db.deviceType.isTouch(),eB=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},nB=function(t,e){return oN.parts.close(Jh.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({})])}))},rB=function(){return oN.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},oB=function(t,e){return oN.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:qE("<p>"+e.translate(t)+"</p>")}]}]})},iB=function(t){return oN.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},uB=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})]},aB=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return oN.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),z.some(!0)},useTabstopAt:function(t){return!ZS(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:_({position:"relative"},t.extraStyles)},components:E([t.header,t.body],t.footer.toArray(),!0),parts:{blocker:{dom:qE('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:tB?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:cc(E([Yg.config({}),qg("dialog-events",t.dialogEvents.concat([zi(zo(),(function(t,e){Hg.focusIn(t)}))])),qg("scroll-lock",[Bi((function(){_u(De(),i)})),Pi((function(){Eu(De(),i)}))])],t.extraBehaviours,!0)),eventOrder:_((e={},e[Jo()]=["dialog-events"],e[ci()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[si()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},cB=function(t){return Jh.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:[ap("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){bi(t,Mw)}})},sB=function(t,e,n){var r=function(t){return[Vu(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:_({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:cc([wD.config({channel:Kz,renderComponents:r})])}},lB=function(){return{dom:qE('<div class="tox-dialog__draghandle"></div>')}},fB=function(t,e){return function(t,e){var n=oN.parts.title(sB(t,z.none(),e)),r=oN.parts.draghandle(lB()),o=oN.parts.close(cB(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return pw.sketch({dom:qE('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},dB=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:qE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},mB=function(t,e,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){oN.setBusy(t(),(function(t,r){return dB(n.message,r,e)}))},onUnblock:function(){oN.setIdle(t())}}},gB=function(t,e,n,r){var o;return Wu(aB(_(_({},t),{lazySink:r.shared.getSink,extraBehaviours:E([wD.config({channel:Xz,updateState:function(t,e){return z.some(e)},initialData:e}),qS({})],t.extraBehaviours,!0),onEscape:function(t){bi(t,Mw)},dialogEvents:n,eventOrder:(o={},o[Yo()]=[wD.name(),gc.name()],o[ci()]=["scroll-lock",wD.name(),"messages","dialog-events","alloy.base.behaviour"],o[si()]=["alloy.base.behaviour","dialog-events","messages",wD.name(),"scroll-lock"],o)})))},hB=function(t){return U(t,(function(t){return"menu"===t.type?function(t){var e=U(t.items,(function(t){var e=so(!1);return _(_({},t),{storage:e})}));return _(_({},t),{items:e})}(t):t}))},pB=function(t){return X(t,(function(t,e){return"menu"===e.type?X(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},vB=function(t,e){return[Mi(zo(),QS),t(Dw,(function(t,n){e.onClose(),n.onClose()})),t(Mw,(function(t,e,n,r){e.onCancel(t),bi(r,Dw)})),Ti(Bw,(function(t,n){return e.onUnblock()})),Ti(zw,(function(t,n){return e.onBlock(n.event)}))]},bB=function(t,e){var n=function(e,n){return Ti(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event,e)}))}))},r=function(t,e){wD.getState(t).get().each((function(n){e(n,t)}))};return E(E([],vB(n,e),!0),[n(Rw,(function(t,e,n){e.onAction(t,{name:n.name})}))],!1)},yB=function(t,e,n){var r=function(e,n){return Ti(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){wD.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return E(E([],vB(r,e),!0),[r(Nw,(function(t,e){return e.onSubmit(t)})),r(Aw,(function(t,e,n){e.onChange(t,{name:n.name})})),r(Rw,(function(t,e,r,o){var i=function(){return Hg.focusIn(o)},u=function(t){return Pe(t,"disabled")||Be(t,"aria-disabled").exists((function(t){return"true"===t}))},a=ke(o.element),c=yc(a);e.onAction(t,{name:r.name,value:r.value}),yc(a).fold(i,(function(t){u(t)?i():c.exists((function(e){return le(t,e)&&u(e)}))?i():n().toOptional().filter((function(e){return!le(e.element,t)})).each(i)}))})),r(Pw,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),Pi((function(e){var n=t();ff.setValue(e,n.getData())}))],!1)},wB=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=q(n,(function(t){return"start"===t.align})),o=function(t,e){return pw.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:U(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},xB=function(t,e){return{dom:qE('<div class="tox-dialog__footer"></div>'),components:[],behaviours:cc([wD.config({channel:Jz,initialData:t,updateState:function(t,n){var r=U(n.buttons,(function(t){var n=Qh(function(t,e){return mO(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return z.some({lookupByName:function(t,e){return function(t,e,n){return K(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:wB})])}},CB=function(t,e){return oN.parts.footer(xB(t,e))},SB=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=yd.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return OS.getField(n,e).fold((function(){var r=t.getFooter();return wD.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return z.some(t)}))}return z.none()},kB=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=ff.getValue(r),i=mt(n,(function(t){return t.get()}));return _(_({},o),i)},setData:function(e){r((function(r){var o=i.getData(),u=_(_({},o),e),a=function(t,e){var n=t.getRoot();return wD.getState(n).get().map((function(t){return Mr(Dr("data",t.dataValidator,e))})).getOr(e)}(t,u),c=t.getFormWrapper();ff.setValue(c,a),dt(n,(function(t,e){wt(u,e)&&t.set(u[e])}))}))},disable:function(e){SB(t,e).each(Nd.disable)},enable:function(e){SB(t,e).each(Nd.enable)},focus:function(e){SB(t,e).each(Yg.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){yi(e,zw,{message:t})}))},unblock:function(){r((function(t){bi(t,Bw)}))},showTab:function(e){r((function(n){var r=t.getBody();wD.getState(r).get().exists((function(t){return t.isTabPanel()}))&&yd.getCurrent(r).each((function(t){jz.showTab(t,e)}))}))},redial:function(t){r((function(n){var r=e(t);n.getSystem().broadcastOn([Xz],r),n.getSystem().broadcastOn([Kz],r.internalDialog),n.getSystem().broadcastOn([Yz],r.internalDialog),n.getSystem().broadcastOn([Jz],r.internalDialog),i.setData(r.initialData)}))},close:function(){r((function(t){bi(t,Dw)}))}};return i},OB=function(t,e,n){var r=fB(t.internalDialog.title,n),o=function(t,e){var n=Zz(t,z.none(),e,!1);return oN.parts.body(n)}({body:t.internalDialog.body},n),i=hB(t.internalDialog.buttons),u=pB(i),a=CB({buttons:i},n),c=yB((function(){return m}),mB((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:z.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=gB(l,t,c,n),d={getRoot:v(f),getBody:function(){return oN.getBody(f)},getFooter:function(){return oN.getFooter(f)},getFormWrapper:function(){var t=oN.getBody(f);return yd.getCurrent(t).getOr(t)}},m=kB(d,e.redial,u);return{dialog:f,instanceApi:m}},_B=function(t,e,n,r){var o,i,u,a,c,s=$i("dialog-label"),l=$i("dialog-content"),f=Qh((u={title:t.internalDialog.title,draggable:!0},a=s,c=n.shared.providers,pw.sketch({dom:qE('<div class="tox-dialog__header"></div>'),components:[sB(u,z.some(a),c),lB(),cB(c)],containerBehaviours:cc([UR.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=Qh(function(t,e,n,r){return Zz(t,z.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=hB(t.internalDialog.buttons),g=pB(m),h=Qh(function(t,e){return xB(t,e)}({buttons:m},n)),p=yB((function(){return y}),{onBlock:function(t){WE.block(b,(function(e,r){return dB(t.message,r,n.shared.providers)}))},onUnblock:function(){WE.unblock(b)},onClose:function(){return e.closeWindow()}},n.shared.getSink),b=Wu({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[Yo()]=[wD.name(),gc.name()],i[Jo()]=["execute-on-form"],i[ci()]=["reflecting","execute-on-form"],i),behaviours:cc([Hg.config({mode:"cyclic",onEscape:function(t){return bi(t,Dw),z.some(!0)},useTabstopAt:function(t){return!ZS(t)&&("button"!==Pt(t)||"disabled"!==ze(t,"disabled"))}}),wD.config({channel:Xz,updateState:function(t,e){return z.some(e)},initialData:t}),Yg.config({}),qg("execute-on-form",p.concat([zi(zo(),(function(t,e){Hg.focusIn(t)}))])),WE.config({getRoot:function(){return z.some(b)}}),Wg.config({}),qS({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),y=kB({getRoot:v(b),getFooter:function(){return h.get(b)},getBody:function(){return d.get(b)},getFormWrapper:function(){var t=d.get(b);return yd.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:b,instanceApi:y}},TB=tinymce.util.Tools.resolve("tinymce.util.URI"),EB=["insertContent","setContent","execCommand","close","block","unblock"],AB=function(t){return i(t)&&-1!==EB.indexOf(t.mceAction)},DB=function(t,e,n,r){var u,a,s,l=fB(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({}),Yg.config({})])})]}],behaviours:cc([Hg.config({mode:"acyclic",useTabstopAt:x(ZS)})])};return oN.parts.body(e)}(t),d=t.buttons.bind((function(t){return 0===t.length?z.none():z.some(CB({buttons:t},r))})),m=bB((function(){return C}),mB((function(){return w}),r.shared.providers,e)),g=_(_({},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 TB(t.url,{base_uri:new TB(window.location.href)}),v=p.protocol+"://"+p.host+(p.port?":"+p.port:""),b=Lc(),y=[qg("messages",[Bi((function(){var e=Vc(zt.fromDom(window),"message",(function(e){if(p.isSameOrigin(new TB(e.raw.origin))){var r=e.raw.data;AB(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!AB(t)&&i(t)&&wt(t,"mceAction")}(r)&&t.onMessage(C,r)}}));b.set(e)})),Pi(b.clear)]),gc.config({channels:(u={},u[Qz]={onReceive:function(t,e){Zu(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,v)}))}},u)})],w=gB({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){yi(e,zw,{message:t})}))},unblock:function(){s((function(t){bi(t,Bw)}))},close:function(){s((function(t){bi(t,Dw)}))},sendMessage:function(t){s((function(e){e.getSystem().broadcastOn([Qz],t)}))}});return{dialog:w,instanceApi:C}},MB=function(t,e,n){return e&&n?[]:[ZT.config({contextual:{lazyContext:function(){return z.some(En(zt.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=sb(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){oN.hide(c),r()},i=Qh(mO({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:z.none()},"cancel",t.backstage)),u=rB(),a=nB(o,e.providers),c=Wu(aB({lazySink:function(){return e.getSink()},header:eB(u,a),body:oB(n,e.providers),footer:z.some(iB(uB([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ti(Mw,o)],eventOrder:{}}));oN.show(c);var s=i.get(c);Yg.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){oN.hide(s),r(t)},i=Qh(mO({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:z.none()},"submit",t.backstage)),u=mO({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:z.none()},"cancel",t.backstage),a=rB(),c=nB((function(){return o(!1)}),e.providers),s=Wu(aB({lazySink:function(){return e.getSink()},header:eB(a,c),body:oB(n,e.providers),footer:z.some(iB(uB([],[u,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ti(Mw,(function(){return o(!1)})),Ti(Nw,(function(){return o(!0)}))],eventOrder:{}}));oN.show(s);var l=i.get(s);Yg.focus(l)}}}(t),u=function(t,r){return Az.openUrl((function(t){var o=DB(t,{closeWindow:function(){oN.hide(o.dialog),r(o.instanceApi)}},n,e);return oN.show(o.dialog),o.instanceApi}),t)},a=function(t,n){return Az.open((function(t,r,o){var i=r,u=OB({dataValidator:o,initialData:i,internalDialog:t},{redial:Az.redial,closeWindow:function(){oN.hide(u.dialog),n(u.instanceApi)}},e);return oN.show(u.dialog),u.instanceApi.setData(i),u.instanceApi}),t)},c=function(t,o,i,u){return Az.open((function(t,a,c){var s=Mr(Dr("data",c,a)),l=Hc(),f=e.shared.header.isPositionedAtTop(),d=function(){return l.on((function(t){Mh.reposition(t),ZT.refresh(t)}))},m=_B({dataValidator:c,initialData:s,internalDialog:t},{redial:Az.redial,closeWindow:function(){l.on(Mh.hide),n.off("ResizeEditor",d),l.clear(),i(m.instanceApi)}},e,u),g=Wu(Mh.sketch(_(_({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:cc(E([qg("window-manager-inline-events",[Ti(li(),(function(t,e){bi(m.dialog,Mw)}))])],MB(n,r,f),!0)),isExtraPart:function(t,e){return function(t){return nw(t,".tox-alert-dialog")||nw(t,".tox-confirm-dialog")}(e)}})));return l.set(g),Mh.showWithin(g,qu(m.dialog),{anchor:o},z.some(De())),r&&f||(ZT.refresh(g),n.on("ResizeEditor",d)),m.instanceApi.setData(s),Hg.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=tN(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;ew(t,r.shared);var u=RB({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:v(u),getNotificationManagerImpl:function(){return lp(t,{backstage:r},n)},ui:i()}}))}()}).call(this,n(26))},619: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>'}})},620: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)}},_=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},T=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},R=function(t,e){return e>=0&&e<t.length?x.some(t[e]):x.none()},N=function(t){return R(t,0)},z=function(t){return R(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 P,I=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?I():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:I},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=(P=/^\s+|\s+$/g,function(t){return t.replace(P,"")}),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(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)}))},_t=function(t,e){t.dom.appendChild(e.dom)},Tt=function(t,e){O(e,(function(e){_t(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 Tt(n,r),Et(t),n},Mt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Rt=tinymce.util.Tools.resolve("tinymce.util.Tools"),Nt=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},Pt=zt(/^(OL|UL|DL)$/),It=zt(/^(OL|UL)$/),Lt=Nt("ol"),Ht=zt(/^(LI|DT|DD)$/),Ft=zt(/^(DT|DD)$/),Vt=zt(/^(TH|TD)$/),jt=Nt("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,Rt.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.querySelectorAll("ol,ul,dl"),Pt)}(e):_(n,(function(t){return Pt(t)&&e!==t}))},oe=function(t){var e=t.selection.getSelectedBlocks();return _(function(t,e){var n=Rt.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.selection.getSelectedBlocks(),It);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){_t(t.item,e.list)},ge=function(t,e){var n={list:rt.fromTag(e,t),item:rt.fromTag("li",t)};return _t(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){_t(t.list,e),t.item=e}(e,function(t,e,n){var r=rt.fromTag("li",t);return bt(r,e),Tt(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),Tt(t.item,e.content)}))}(o,n),r=o,le(z(e),N(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))}))},_e=function(t,e){var n=Ce(e);return function(t,e){var n=T(e,(function(e,n){return n.depth>e.length?pe(t,e,n):he(t,e,n)}),[]);return N(n).map((function(t){return t.list}))}(t.contentDocument,n).toArray()},Te=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,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 N(e).exists(ye)?_e(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 _(oe(t),Ft)}(t),rt.fromDom),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();Te(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")},Re=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Ne=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=Ne.create("span",{"data-mce-type":"bookmark"});r.hasChildNodes()?(o=Math.min(o,r.childNodes.length-1),n?r.insertBefore(i,r.childNodes[o]):Ne.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,Ne.remove(n),!r.hasChildNodes()&&Ne.isBlock(r)&&r.appendChild(Ne.create("br"))),t[e?"startContainer":"endContainer"]=r,t[e?"startOffset":"endOffset"]=o)};e(!0),e();var n=Ne.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),te(n)},Pe=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Ie=function(t){return/\btox\-/.test(t.className)},Le=function(t,e,n){var r=function(t){var r=E(t.parents,Pt,Vt).filter((function(t){return t.nodeName===e&&!Ie(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){Rt.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"]),Rt.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 Rt.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;Re.isBookmarkNode(e)&&(Pt(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);Rt.each(c,(function(r){var i,a=r.previousSibling,c=r.parentNode;Ht(c)||(a&&Pt(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){Rt.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&&Pt(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=Pt(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,!0):n;Rt.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,Pe(n),o)}else Fe(t.dom,e,r),fe(t,Pe(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)||Ie(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,Pe(n),i)}else Me(t);else je(t,n,r),fe(t,Pe(n),e)}(t,r,e,i)},Xe=Mt.DOM,Ke=function(t,e){var n=Rt.grep(t.select("ol,ul",e));Rt.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"));Pt(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&&!Pt(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)){Pt(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,Pt,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 T(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)}))}()},621: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)}},_=Array.prototype.slice,T=Array.prototype.indexOf,E=Array.prototype.push,A=function(t,e){return n=t,r=e,T.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},R=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},N=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=[],o=0,i=t.length;o<i;o++){var u=t[o];(e(u,o)?n:r).push(u)}return{pass:n,fail:r}},B=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},P=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 N(t,(function(t,r){n=e(n,t,r)})),n},L=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)},H=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()},F=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},V=function(t,e){return F(R(t,e))},j=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},U=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},W=function(t){return[t]},q=function(t,e){return e>=0&&e<t.length?O.some(t[e]):O.none()},G=function(t){return q(t,0)},$=function(t){return q(t,t.length-1)},X=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()},K=function(){return(K=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 Y(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 J=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}},Q=function(){return Z(0,0)},Z=function(t,e){return{major:t,minor:e}},tt={nu:Z,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Q():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 Z(r(1),r(2))}(t,n)},unknown:Q},et=function(t,e){var n=String(e).toLowerCase();return L(t,(function(t){return t.search(n)}))},nt=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},rt=function(t,e){return-1!==t.indexOf(e)},ot=function(t,e){return nt(t,e,0)},it=function(t,e){return nt(t,e,t.length-e.length)},ut=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),at=function(t){return t.length>0},ct=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,st=function(t){return function(e){return rt(e,t)}},lt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return rt(t,"edge/")&&rt(t,"chrome")&&rt(t,"safari")&&rt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ct],search:function(t){return rt(t,"chrome")&&!rt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return rt(t,"msie")||rt(t,"trident")}},{name:"Opera",versionRegexes:[ct,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:st("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:st("firefox")},{name:"Safari",versionRegexes:[ct,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(rt(t,"safari")||rt(t,"mobile/"))&&rt(t,"applewebkit")}}],ft=[{name:"Windows",search:st("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return rt(t,"iphone")||rt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:st("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:st("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:st("linux"),versionRegexes:[]},{name:"Solaris",search:st("sunos"),versionRegexes:[]},{name:"FreeBSD",search:st("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:st("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],dt={browsers:m(lt),oses:m(ft)},mt=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")}},gt={unknown:function(){return mt({current:void 0,version:tt.unknown()})},nu:mt,edge:m("Edge"),chrome:m("Chrome"),ie:m("IE"),opera:m("Opera"),firefox:m("Firefox"),safari:m("Safari")},ht=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")}},pt={unknown:function(){return ht({current:void 0,version:tt.unknown()})},nu:ht,windows:m("Windows"),ios:m("iOS"),android:m("Android"),linux:m("Linux"),osx:m("OSX"),solaris:m("Solaris"),freebsd:m("FreeBSD"),chromeos:m("ChromeOS")},vt=function(t,e,n){var r=dt.browsers(),o=dt.oses(),i=e.bind((function(t){return function(t,e){return X(e.brands,(function(e){var n=e.brand.toLowerCase();return L(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:tt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return et(t,e).map((function(t){var n=tt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(gt.unknown,gt.nu),u=function(t,e){return et(t,e).map((function(t){var n=tt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(pt.unknown,pt.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}},bt=function(t){return window.matchMedia(t).matches},yt=J((function(){return vt(navigator.userAgent,O.from(navigator.userAgentData),bt)})),wt=function(){return yt()},xt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Ct={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 xt(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return xt(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return xt(n)},fromDom:xt,fromPoint:function(t,e,n){return O.from(t.dom.elementFromPoint(e,n)).map(xt)}},St=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")},kt=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Ot=function(t,e){var n=void 0===e?document:e.dom;return kt(n)?O.none():O.from(n.querySelector(t)).map(Ct.fromDom)},_t=function(t,e){return t.dom===e.dom},Tt=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},Et=function(t,e){return wt().browser.isIE()?Tt(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},At=St,Dt=Object.keys,Mt=Object.hasOwnProperty,Rt=function(t,e){for(var n=Dt(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Nt=function(t,e){return zt(t,(function(t,n){return{k:n,v:e(t,n)}}))},zt=function(t,e){var n={};return Rt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Bt=function(t,e){var n={};return function(t,e,n,r){Rt(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},Pt=function(t,e){var n=[];return Rt(t,(function(t,r){n.push(e(t,r))})),n},It=function(t){return Pt(t,g)},Lt=function(t){return Dt(t).length},Ht=function(t,e){return Ft(t,e)?O.from(t[e]):O.none()},Ft=function(t,e){return Mt.call(t,e)},Vt=function(t,e){return Ft(t,e)&&void 0!==t[e]&&null!==t[e]},jt=["tfoot","thead","tbody","colgroup"],Ut=function(t,e,n){return{element:t,rowspan:e,colspan:n}},Wt=function(t,e,n){return{element:t,cells:e,section:n}},qt=function(t,e,n){return{element:t,isNew:e,isLocked:n}},Gt=function(t,e,n,r){return{element:t,cells:e,section:n,isNew:r}};"undefined"!=typeof window?window:Function("return this;")();var $t=function(t){return t.dom.nodeName.toLowerCase()},Xt=function(t){return t.dom.nodeType},Kt=function(t){return function(e){return Xt(e)===t}},Yt=function(t){return 8===Xt(t)||"#comment"===$t(t)},Jt=Kt(1),Qt=Kt(3),Zt=Kt(9),te=Kt(11),ee=function(t){return function(e){return Jt(e)&&$t(e)===t}},ne=function(t){return Ct.fromDom(t.dom.ownerDocument)},re=function(t){return Zt(t)?t:ne(t)},oe=function(t){return O.from(t.dom.parentNode).map(Ct.fromDom)},ie=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=Ct.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},ue=function(t){return O.from(t.dom.previousSibling).map(Ct.fromDom)},ae=function(t){return O.from(t.dom.nextSibling).map(Ct.fromDom)},ce=function(t){return R(t.dom.childNodes,Ct.fromDom)},se=function(t,e){var n=t.dom.childNodes;return O.from(n[e]).map(Ct.fromDom)},le=l(Element.prototype.attachShadow)&&l(Node.prototype.getRootNode),fe=m(le),de=le?function(t){return Ct.fromDom(t.dom.getRootNode())}:re,me=function(t){var e,n=de(t);return te(e=n)&&s(e.dom.host)?O.some(n):O.none()},ge=function(t){return Ct.fromDom(t.dom.host)},he=function(t){return s(t.dom.shadowRoot)},pe=function(t){var e=Qt(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return me(Ct.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=pe,r=ge,function(t){return n(r(t))}))},ve=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return Ct.fromDom(e)},be=function(t,e){var n=[];return N(ce(t),(function(t){e(t)&&(n=n.concat([t])),n=n.concat(be(t,e))})),n},ye=function(t,e,n){return function(t,e,n){return B(ie(t,n),e)}(t,(function(t){return St(t,e)}),n)},we=function(t,e){return function(t,e){return B(ce(t),e)}(t,(function(t){return St(t,e)}))},xe=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return kt(n)?[]:R(n.querySelectorAll(t),Ct.fromDom)}(e,t)};function Ce(t,e,n,r,o){return t(n,r)?O.some(n):l(o)&&o(n)?O.none():e(n,r,o)}var Se=function(t,e,n){for(var r=t.dom,o=l(n)?n:w;r.parentNode;){r=r.parentNode;var i=Ct.fromDom(r);if(e(i))return O.some(i);if(o(i))break}return O.none()},ke=function(t,e,n){return Se(t,(function(t){return St(t,e)}),n)},Oe=function(t,e){return function(t,e){return L(t.dom.childNodes,(function(t){return e(Ct.fromDom(t))})).map(Ct.fromDom)}(t,(function(t){return St(t,e)}))},_e=function(t,e){return Ot(e,t)},Te=function(t,e,n){return Ce((function(t,e){return St(t,e)}),ke,t,e,n)},Ee=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+"")},Ae=function(t,e,n){Ee(t.dom,e,n)},De=function(t,e){var n=t.dom;Rt(e,(function(t,e){Ee(n,e,t)}))},Me=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Re=function(t,e){return O.from(Me(t,e))},Ne=function(t,e){t.dom.removeAttribute(e)},ze=function(t){return I(t.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{})},Be=function(t,e,n){return void 0===n&&(n=h),t.exists((function(t){return n(t,e)}))},Pe=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()},Le=function(t,e){return t?O.some(e):O.none()},He=function(t){return void 0!==t.style&&l(t.style.getPropertyValue)},Fe=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);He(t)&&t.style.setProperty(e,n)},Ve=function(t,e,n){var r=t.dom;Fe(r,e,n)},je=function(t,e){var n=t.dom;Rt(e,(function(t,e){Fe(n,e,t)}))},Ue=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||pe(t)?r:We(n,e)},We=function(t,e){return He(t)?t.style.getPropertyValue(e):""},qe=function(t,e){var n=t.dom,r=We(n,e);return O.from(r).filter((function(t){return t.length>0}))},Ge=function(t,e){!function(t,e){He(t)&&t.style.removeProperty(e)}(t.dom,e),Be(Re(t,"style").map(ut),"")&&Ne(t,"style")},$e=function(t,e,n){return void 0===n&&(n=0),Re(t,e).map((function(t){return parseInt(t,10)})).getOr(n)},Xe=function(t,e){return $e(t,e,1)},Ke=function(t){return ee("col")(t)?$e(t,"span",1)>1:Xe(t,"colspan")>1},Ye=function(t){return Xe(t,"rowspan")>1},Je=function(t,e){return parseInt(Ue(t,e),10)},Qe=m(10),Ze=m(10),tn=function(t,e){return en(t,e,x)},en=function(t,e,n){return V(ce(t),(function(t){return St(t,e)?n(t)?[t]:[]:en(t,e,n)}))},nn=function(t,e){return function(t,e,n){if(void 0===n&&(n=w),n(e))return O.none();if(A(t,$t(e)))return O.some(e);return ke(e,t.join(","),(function(t){return St(t,"table")||n(t)}))}(["td","th"],t,e)},rn=function(t){return tn(t,"th,td")},on=function(t){return St(t,"colgroup")?we(t,"col"):V(cn(t),(function(t){return we(t,"col")}))},un=function(t,e){return Te(t,"table",e)},an=function(t){return tn(t,"tr")},cn=function(t){return un(t).fold(m([]),(function(t){return we(t,"colgroup")}))},sn=function(t,e){return R(t,(function(t){if("colgroup"===$t(t)){var n=R(on(t),(function(t){var e=$e(t,"span",1);return Ut(t,1,e)}));return Wt(t,n,"colgroup")}n=R(rn(t),(function(t){var e=$e(t,"rowspan",1),n=$e(t,"colspan",1);return Ut(t,e,n)}));return Wt(t,n,e(t))}))},ln=function(t){return oe(t).map((function(t){var e=$t(t);return function(t){return A(jt,t)}(e)?e:"tbody"})).getOr("tbody")},fn=function(t){var e=an(t),n=Y(Y([],cn(t),!0),e,!0);return sn(n,ln)},dn=function(t,e,n){var r=t.cells,o=r.slice(0,e),i=r.slice(e),u=o.concat(n).concat(i);return hn(t,u)},mn=function(t,e,n){return dn(t,e,[n])},gn=function(t,e,n){t.cells[e]=n},hn=function(t,e){return Gt(t.element,e,t.section,t.isNew)},pn=function(t,e){return t.cells[e]},vn=function(t,e){return pn(t,e).element},bn=function(t){return t.cells.length},yn=function(t){var e=z(t,(function(t){return"colgroup"===t.section}));return{rows:e.fail,cols:e.pass}},wn=function(t,e,n){var r=R(t.cells,n);return Gt(e(t.element),r,t.section,!0)},xn="data-snooker-locked-cols",Cn=function(t){return Re(t,xn).bind((function(t){return O.from(t.match(/\d+/g))})).map((function(t){return U(t,x)}))},Sn=function(t){var e=I(yn(t).rows,(function(t,e){return N(e.cells,(function(e,n){e.isLocked&&(t[n]=!0)})),t}),{});return function(t,e){var n=_.call(t,0);return n.sort(e),n}(Pt(e,(function(t,e){return parseInt(e,10)})))},kn=function(t,e){return t+","+e},On=function(t,e){var n=V(t.all,(function(t){return t.cells}));return B(n,e)},_n=function(t){var e={},n=[],r=G(t).map((function(t){return t.element})).bind(un).bind(Cn).getOr({}),o=0,i=0,u=0,a=z(t,(function(t){return"colgroup"===t.section})),c=a.pass,s=a.fail;N(s,(function(t){var a=[];N(t.cells,(function(t){for(var n=0;void 0!==e[kn(u,n)];)n++;for(var o=Vt(r,n.toString()),c=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,u,n,o),s=0;s<t.colspan;s++)for(var l=0;l<t.rowspan;l++){var f=n+s,d=kn(u+l,f);e[d]=c,i=Math.max(i,f+1)}a.push(c)})),o++,n.push(Wt(t.element,a,t.section)),u++}));var l=$(c).map((function(t){var e=function(t){var e={},n=0;return N(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);return{colgroups:[function(t,e){return{element:t,columns:e}}(t.element,It(e))],columns:e}})).getOrThunk((function(){return{colgroups:[],columns:{}}})),f=l.columns,d=l.colgroups;return{grid:function(t,e){return{rows:t,columns:e}}(o,i),access:e,all:n,columns:f,colgroups:d}},Tn={fromTable:function(t){var e=fn(t);return _n(e)},generate:_n,getAt:function(t,e,n){return O.from(t.access[kn(e,n)])},findItem:function(t,e,n){var r=On(t,(function(t){return n(e,t.element)}));return r.length>0?O.some(r[0]):O.none()},filterItems:On,justCells:function(t){return V(t.all,(function(t){return t.cells}))},justColumns:function(t){return It(t.columns)},hasColumns:function(t){return Dt(t.columns).length>0},getColumnAt:function(t,e){return O.from(t.columns[e])}},En=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},An=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},Dn=function(t,e,n){var r=Tn.findItem(t,e,_t),o=Tn.findItem(t,n,_t);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}))}))},Mn=function(t,e,n){return Dn(t,e,n).bind((function(e){return function(t,e){for(var n=!0,r=p(An,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)}))},Rn=function(t,e,n){return Dn(t,e,n).map((function(e){var n=Tn.filterItems(t,p(En,e));return R(n,(function(t){return t.element}))}))},Nn=function(t,e){return Tn.findItem(t,e,(function(t,e){return Et(e,t)})).map((function(t){return t.element}))},zn=function(t,e,n){return un(t).bind((function(r){return function(t,e,n,r){return Tn.findItem(t,e,_t).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)}))},Bn=function(t,e,n){var r=In(t);return Rn(r,e,n)},Pn=function(t,e,n,r,o){var i=In(t),u=_t(t,n)?O.some(e):Nn(i,e),a=_t(t,o)?O.some(r):Nn(i,r);return u.bind((function(t){return a.bind((function(e){return Rn(i,t,e)}))}))},In=Tn.fromTable,Ln=function(t,e){oe(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},Hn=function(t,e){ae(t).fold((function(){oe(t).each((function(t){Vn(t,e)}))}),(function(t){Ln(t,e)}))},Fn=function(t,e){(function(t){return se(t,0)})(t).fold((function(){Vn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Vn=function(t,e){t.dom.appendChild(e.dom)},jn=function(t,e){Ln(t,e),Vn(e,t)},Un=function(t,e){N(e,(function(n,r){var o=0===r?t:e[r-1];Hn(o,n)}))},Wn=function(t,e){N(e,(function(e){Vn(t,e)}))},qn=function(t){t.dom.textContent="",N(ce(t),(function(t){Gn(t)}))},Gn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},$n=function(t){var e,n=ce(t);n.length>0&&(e=t,N(n,(function(t){Ln(e,t)}))),Gn(t)},Xn=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}}}(Qt,"text"),Kn=function(t){return Xn.get(t)},Yn=function(t){return Xn.getOption(t)},Jn=function(t,e){return Xn.set(t,e)},Qn=["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 Zn(){return{up:m({selector:ke,closest:Te,predicate:Se,all:ie}),down:m({selector:xe,predicate:be}),styles:m({get:Ue,getRaw:qe,set:Ve,remove:Ge}),attrs:m({get:Me,set:Ae,remove:Ne,copyTo:function(t,e){var n=ze(t);De(e,n)}}),insert:m({before:Ln,after:Hn,afterAll:Un,append:Vn,appendAll:Wn,prepend:Fn,wrap:jn}),remove:m({unwrap:$n,remove:Gn}),create:m({nu:Ct.fromTag,clone:function(t){return Ct.fromDom(t.dom.cloneNode(!1))},text:Ct.fromText}),query:m({comparePosition:function(t,e){return t.dom.compareDocumentPosition(e.dom)},prevSibling:ue,nextSibling:ae}),property:m({children:ce,name:$t,parent:oe,document:function(t){return re(t).dom},isText:Qt,isComment:Yt,isElement:Jt,isSpecial:function(t){var e=$t(t);return A(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],e)},getLanguage:function(t){return Jt(t)?Re(t,"lang"):O.none()},getText:Kn,setText:Jn,isBoundary:function(t){return!!Jt(t)&&("body"===$t(t)||A(Qn,$t(t)))},isEmptyTag:function(t){return!!Jt(t)&&A(["br","img","hr","input"],$t(t))},isNonEditable:function(t){return Jt(t)&&"false"===Me(t,"contenteditable")}}),eq:_t,is:At}}var tr,er,nr=function(t,e,n,r){var o=e(t,n);return P(r,(function(n,r){var o=e(t,r);return rr(t,n,o)}),o)},rr=function(t,e,n){return e.bind((function(e){return n.filter(p(t.eq,e))}))},or=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,nr):O.none()},ir=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 H(t,r).fold((function(){return t}),(function(e){return t.slice(0,e+1)}))},a=u(o),c=u(i),s=L(a,(function(e){return D(c,function(t,e){return p(t.eq,e)}(t,e))}));return{firstpath:a,secondpath:c,shared:s}},ur=Zn(),ar=function(t,e){return or(ur,(function(e,n){return t(n)}),e)},cr=function(t){return ke(t,"table")},sr=function(t,e,n){var r=function(t){return function(e){return void 0!==n&&n(e)||_t(e,t)}};return _t(t,e)?O.some({boxes:O.some([t]),start:t,finish:e}):cr(t).bind((function(o){return cr(e).bind((function(i){if(_t(o,i))return O.some({boxes:Bn(o,t,e),start:t,finish:e});if(Et(o,i)){var u=(a=ye(e,"td,th",r(o))).length>0?a[a.length-1]:e;return O.some({boxes:Pn(o,t,o,e,i),start:t,finish:u})}if(Et(i,o)){var a,c=(a=ye(t,"td,th",r(i))).length>0?a[a.length-1]:t;return O.some({boxes:Pn(i,t,o,e,i),start:t,finish:c})}return function(t,e,n){return ir(ur,t,e,n)}(t,e).shared.bind((function(u){return Te(u,"table",n).bind((function(n){var u=ye(e,"td,th",r(n)),a=u.length>0?u[u.length-1]:e,c=ye(t,"td,th",r(n)),s=c.length>0?c[c.length-1]:t;return O.some({boxes:Pn(n,t,o,e,i),start:s,finish:a})}))}))}))}))},lr=function(t,e){var n=xe(t,e);return n.length>0?O.some(n):O.none()},fr=function(t,e,n){return _e(t,e).bind((function(e){return _e(t,n).bind((function(t){return ar(cr,[e,t]).map((function(n){return{first:e,last:t,table:n}}))}))}))},dr=function(t,e,n,r,o){return function(t,e){return L(t,(function(t){return St(t,e)}))}(t,o).bind((function(t){return zn(t,e,n).bind((function(t){return function(t,e){return ke(t,"table").bind((function(n){return _e(n,e).bind((function(e){return sr(e,t).bind((function(t){return t.boxes.map((function(e){return{boxes:e,start:t.start,finish:t.finish}}))}))}))}))}(t,r)}))}))},mr=function(t,e){return lr(t,e)},gr=function(t,e,n){return fr(t,e,n).bind((function(e){var n=function(e){return _t(t,e)},r=ke(e.first,"thead,tfoot,tbody,table",n),o=ke(e.last,"thead,tfoot,tbody,table",n);return r.bind((function(t){return o.bind((function(n){return _t(t,n)?function(t,e,n){var r=In(t);return Mn(r,e,n)}(e.table,e.first,e.last):O.none()}))}))}))},hr=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 N(t,(function(r,o){var u=Dt(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=Dt(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!j(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},pr=hr([{none:[]},{multiple:["elements"]},{single:["element"]}]),vr=function(t,e,n,r){return t.fold(e,n,r)},br=pr.none,yr=pr.multiple,wr=pr.single,xr=tinymce.util.Tools.resolve("tinymce.PluginManager"),Cr=function(t,e){return Ct.fromDom(t.dom.cloneNode(e))},Sr=function(t){return Cr(t,!1)},kr=function(t){return Cr(t,!0)},Or=function(t,e){var n=Ct.fromTag(e),r=ze(t);return De(n,r),n},_r=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Ue(n,t);return parseFloat(o)||0}return r},r=function(t,e){return I(e,(function(e,n){var r=Ue(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;He(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=function(){var t=wt().browser;return t.isIE()||t.isEdge()},Er=function(t,e){return function(t){var e=parseFloat(t);return isNaN(e)?O.none():O.some(e)}(t).getOr(e)},Ar=function(t,e,n){return Er(Ue(t,e),n)},Dr=function(t){return Ue(t,"box-sizing")},Mr=function(t,e,n,r){return e-Ar(t,"padding-"+n,0)-Ar(t,"padding-"+r,0)-Ar(t,"border-"+n+"-width",0)-Ar(t,"border-"+r+"-width",0)},Rr=function(t,e){var n=t.dom,r=n.getBoundingClientRect().width||n.offsetWidth;return"border-box"===e?r:Mr(t,r,"left","right")},Nr=_r("width",(function(t){return t.dom.offsetWidth})),zr=function(t){return Nr.get(t)},Br=function(t){return Nr.getOuter(t)},Pr=function(t){return Rr(t,"content-box")},Ir=function(t){return Tr()?Rr(t,Dr(t)):Ar(t,"width",t.dom.offsetWidth)},Lr=function(t,e){void 0===e&&(e=x);var n=t.grid,r=M(n.columns,g),o=M(n.rows,g);return R(r,(function(n){return Hr((function(){return V(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)}))}))},Hr=function(t,e,n){var r=t();return L(r,e).orThunk((function(){return O.from(r[0]).orThunk(n)})).map((function(t){return t.element}))},Fr=function(t){var e=t.grid,n=M(e.rows,g),r=M(e.columns,g);return R(n,(function(e){return Hr((function(){return V(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)}))}))},Vr=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=_.call(t,0);return e.reverse(),e}(t.slice(0,e));return X(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 X(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}))}))},jr=function(t,e){return function(n){return"rtl"===Ur(n)?e:t}},Ur=function(t){return"rtl"===Ue(t,"direction")?"rtl":"ltr"},Wr=_r("height",(function(t){var e=t.dom;return pe(t)?e.getBoundingClientRect().height:e.offsetHeight})),qr=function(t){return Wr.get(t)},Gr=function(t){return Wr.getOuter(t)},$r=function(t){return Tr()?function(t,e){var n=t.dom,r=n.getBoundingClientRect().height||n.offsetHeight;return"border-box"===e?r:Mr(t,r,"top","bottom")}(t,Dr(t)):Ar(t,"height",t.dom.offsetHeight)},Xr=function(t,e){return{left:t,top:e,translate:function(n,r){return Xr(t+n,e+r)}}},Kr=Xr,Yr=function(t,e){return void 0!==t?t:void 0!==e?e:0},Jr=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return Kr(n.offsetLeft,n.offsetTop);var i=Yr(null==r?void 0:r.pageYOffset,o.scrollTop),u=Yr(null==r?void 0:r.pageXOffset,o.scrollLeft),a=Yr(o.clientTop,n.clientTop),c=Yr(o.clientLeft,n.clientLeft);return Qr(t).translate(u-c,i-a)},Qr=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?Kr(n.offsetLeft,n.offsetTop):pe(t)?function(t){var e=t.getBoundingClientRect();return Kr(e.left,e.top)}(e):Kr(0,0)},Zr=function(t,e){return{row:t,y:e}},to=function(t,e){return{col:t,x:e}},eo=function(t){return Jr(t).left+Br(t)},no=function(t){return Jr(t).left},ro=function(t,e){return to(t,no(e))},oo=function(t,e){return to(t,eo(e))},io=function(t){return Jr(t).top},uo=function(t,e){return Zr(t,io(e))},ao=function(t,e){return Zr(t,io(e)+Gr(e))},co=function(t,e,n){if(0===n.length)return[];var r=R(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])},so={delta:g,positions:function(t){return co(uo,ao,t)},edge:io},lo={delta:g,edge:no,positions:function(t){return co(ro,oo,t)}},fo={delta:function(t){return-t},edge:eo,positions:function(t){return co(oo,ro,t)}},mo=jr(lo,fo),go={delta:function(t,e){return mo(e).delta(t,e)},positions:function(t,e){return mo(e).positions(t,e)},edge:function(t){return mo(t).edge(t)}},ho={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:[""]},po=(tr=function(t){return"(?:"+t+")?"},er=["Infinity","[0-9]+\\."+tr("[0-9]+")+tr("[eE][+-]?[0-9]+"),"\\.[0-9]+"+tr("[eE][+-]?[0-9]+"),"[0-9]+"+tr("[eE][+-]?[0-9]+")].join("|"),new RegExp("^([+-]?(?:"+er+"))(.*)$")),vo=function(t,e){return O.from(po.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return D(e,(function(e){return D(ho[e],(function(e){return t===e}))}))}(r,e)?O.some({value:n,unit:r}):O.none()}))},bo=/(\d+(\.\d+)?)%/,yo=/(\d+(\.\d+)?)px|em/,wo=ee("col"),xo=function(t,e,n){var r,o=(r=t,O.from(r.dom.parentElement).map(Ct.fromDom)).getOrThunk((function(){return ve(ne(t))}));return e(t)/n(o)*100},Co=function(t,e){Ve(t,"width",e+"px")},So=function(t,e){Ve(t,"width",e+"%")},ko=function(t,e){Ve(t,"height",e+"px")},Oo=function(t,e,n,r){var o=parseFloat(t);return it(t,"%")&&"table"!==$t(e)?function(t,e,n,r){var o=un(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},_o=function(t){var e=function(t){return $r(t)+"px"}(t);return e?Oo(e,t,qr,ko):qr(t)},To=function(t,e){return qe(t,e).orThunk((function(){return Re(t,e).map((function(t){return t+"px"}))}))},Eo=function(t){return To(t,"width")},Ao=function(t){return xo(t,zr,Pr)},Do=function(t){return wo(t)?zr(t):Ir(t)},Mo=function(t){return function(t,e,n){return n(t)/Xe(t,e)}(t,"rowspan",_o)},Ro=function(t,e,n){Ve(t,"width",e+n)},No=function(t){return xo(t,zr,Pr)+"%"},zo=m(bo),Bo=ee("col"),Po=function(t){return Eo(t).getOrThunk((function(){return Do(t)+"px"}))},Io=function(t){return(e=t,To(e,"height")).getOrThunk((function(){return Mo(t)+"px"}));var e},Lo=function(t,e,n,r,o,i){return t.filter(r).fold((function(){return i(Vr(n,e))}),(function(t){return o(t)}))},Ho=function(t,e,n,r){var o=Lr(t),i=Tn.hasColumns(t)?function(t){return R(Tn.justColumns(t),(function(t){return O.from(t.element)}))}(t):o,u=[O.some(go.edge(e))].concat(R(go.positions(o,e),(function(t){return t.map((function(t){return t.x}))}))),a=y(Ke);return R(i,(function(t,e){return Lo(t,e,u,a,(function(t){if(function(t){var e=wt().browser,n=e.isChrome()||e.isFirefox();return!Bo(t)||n}(t))return n(t);var i,c,s=(i=o[e],c=g,null!=i?c(i):O.none());return Lo(s,e,u,a,(function(t){return r(O.some(zr(t)))}),r)}),r)}))},Fo=function(t){return t.map((function(t){return t+"px"})).getOr("")},Vo=function(t,e,n){return Ho(t,e,Do,(function(t){return t.getOrThunk(n.minCellWidth)}))},jo=function(t,e,n,r,o){var i=Fr(t),u=[O.some(n.edge(e))].concat(R(n.positions(i,e),(function(t){return t.map((function(t){return t.y}))})));return R(i,(function(t,e){return Lo(t,e,u,y(Ye),r,o)}))},Uo=function(t,e){return function(){return pe(t)?e(t):parseFloat(qe(t,"width").getOr("0"))}},Wo=function(t){var e=Uo(t,zr),n=m(0);return{width:e,pixelWidth:e,getWidths:function(e,n){return Vo(e,t,n)},getCellDelta:n,singleColumnWidth:m([0]),minCellWidth:n,setElementWidth:d,adjustTableWidth:d,isRelative:!0,label:"none"}},qo=function(t){var e=Uo(t,(function(t){return parseFloat(No(t))})),n=Uo(t,zr);return{width:e,pixelWidth:n,getWidths:function(e,n){return function(t,e,n){return Ho(t,e,Ao,(function(t){return t.fold((function(){return n.minCellWidth()}),(function(t){return t/n.pixelWidth()*100}))}))}(e,t,n)},getCellDelta:function(t){return t/n()*100},singleColumnWidth:function(t,e){return[100-t]},minCellWidth:function(){return Qe()/n()*100},setElementWidth:So,adjustTableWidth:function(n){var r=e();So(t,r+n/100*r)},isRelative:!0,label:"percent"}},Go=function(t){var e=Uo(t,zr);return{width:e,pixelWidth:e,getWidths:function(e,n){return Vo(e,t,n)},getCellDelta:g,singleColumnWidth:function(t,e){return[Math.max(Qe(),t+e)-t]},minCellWidth:Qe,setElementWidth:Co,adjustTableWidth:function(n){var r=e()+n;Co(t,r)},isRelative:!1,label:"pixel"}},$o=function(t){return Eo(t).fold((function(){return Wo(t)}),(function(e){return function(t,e){return null!==zo().exec(e)?qo(t):Go(t)}(t,e)}))},Xo=Go,Ko=qo,Yo=function(t,e,n){var r=t[n].element,o=Ct.fromTag("td");Vn(o,Ct.fromTag("br")),(e?Vn:Fn)(r,o)},Jo=function(t,e){var n=function(t){return St(t.element,e)},r=kr(t),o=fn(r),i=$o(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 Rt(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=en(r,"th,td",(function(t){return St(t,c)}));return N(s,Gn),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()?Yo(t,a,u):a=!0}}(o,u,a,n),function(t,e,n,r){Rt(n.columns,(function(t){(t.column<e.minCol||t.column>e.maxCol)&&Gn(t.element)}));var o=B(tn(t,"tr"),(function(t){return 0===t.dom.childElementCount}));N(o,Gn),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||N(tn(t,"th,td"),(function(t){Ne(t,"rowspan"),Ne(t,"colspan")})),Ne(t,xn),Ne(t,"data-snooker-col-series"),$o(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=Vo(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},Qo=function(t){return"img"===$t(t)?1:Yn(t).fold((function(){return ce(t).length}),(function(t){return t.length}))},Zo=["img","br"],ti=function(t){return Yn(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome()||A(Zo,$t(t))},ei=function(t){return e=ti,(n=function(t){for(var r=0;r<t.childNodes.length;r++){var o=Ct.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},ni=function(t){return ri(t,ti)},ri=function(t,e){var n=function(t){for(var r=ce(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)},oi={scope:["row","col"]},ii=function(t){return function(){var e=Ct.fromTag("td",t.dom);return Vn(e,Ct.fromTag("br",t.dom)),e}},ui=function(t){return function(){return Ct.fromTag("col",t.dom)}},ai=function(t){return function(){return Ct.fromTag("colgroup",t.dom)}},ci=function(t){return function(){return Ct.fromTag("tr",t.dom)}},si=function(t,e,n){var r=function(t,e){var n=Or(t,e),r=ce(kr(t));return Wn(n,r),n}(t,e);return Rt(n,(function(t,e){null===t?Ne(r,e):Ae(r,e,t)})),r},li=function(t){return t},fi=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,He(o)&&He(i)&&(i.style.cssText=o.style.cssText),Ge(e,"height"),1!==t.colspan&&Ge(e,"width")};return{col:function(n){var o=Ct.fromTag($t(n.element),e.dom);return r(n,o),t(n.element,o),o},colgroup:ai(e),row:ci(e),cell:function(o){var i=Ct.fromTag($t(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 ei(t).map((function(r){var o=n.join(","),i=ye(r,o,(function(e){return _t(e,t)}));return P(i,(function(t,e){var n=Sr(e);return Ne(n,"contenteditable"),Vn(t,n),n}),e)})).getOr(e)}(o.element,i,u):i;return Vn(a,Ct.fromTag("br")),r(o,i),function(t,e){Rt(oi,(function(n,r){return Re(t,r).filter((function(t){return A(n,t)})).each((function(t){return Ae(e,r,t)}))}))}(o.element,i),t(o.element,i),i},replace:si,colGap:ui(e),gap:ii(e)}},di=function(t){return{col:ui(t),colgroup:ai(t),row:ci(t),cell:ii(t),replace:li,colGap:ui(t),gap:ii(t)}},mi=function(t){return R(t,Ct.fromDom)},gi=function(t){return Ct.fromDom(t.getBody())},hi=function(t){return t.getBoundingClientRect().width},pi=function(t){return t.getBoundingClientRect().height},vi=function(t){return function(e){return _t(e,gi(t))}},bi=function(t){return/^\d+(\.\d+)?$/.test(t)?t+"px":t},yi=function(t){Ne(t,"data-mce-style");var e=function(t){return Ne(t,"data-mce-style")};N(rn(t),e),N(on(t),e)},wi=function(t){return Ct.fromDom(t.selection.getStart())},xi=function(t){return vr(t.get(),m([]),g,W)},Ci=function(t){var e=function(t,e){return Re(t,e).exists((function(t){return parseInt(t,10)>1}))},n=xi(t);return n.length>0&&j(n,(function(t){return e(t,"rowspan")||e(t,"colspan")}))?O.some(n):O.none()},Si=function(t,e,n){return vr(e.get(),O.none,(function(e){return e.length<=1?O.none():gr(t,n.firstSelectedSelector,n.lastSelectedSelector).map((function(t){return{bounds:t,cells:e}}))}),O.none)},ki={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]"},Oi=function(t,e,n){return{element:n,mergable:Si(e,t,ki),unmergable:Ci(t),selection:xi(t)}},_i=function(t){return function(e,n){var r,o=$t(e),i="col"===o||"colgroup"===o?un(r=e).bind((function(t){return mr(t,ki.firstSelectedSelector)})).fold(m(r),(function(t){return t[0]})):e;return Te(i,t,n)}},Ti=_i("th,td,caption"),Ei=_i("th,td"),Ai=function(t){return xi(t)},Di=function(t,e,n){t.on("BeforeGetContent",(function(n){!0===n.selection&&vr(e.get(),d,(function(e){n.preventDefault(),function(t){return un(t[0]).map((function(t){var e=Jo(t,"[data-mce-selected]");return yi(e),[e]}))}(e).each((function(e){n.content="text"===n.format?function(t){return R(t,(function(t){return t.dom.innerText})).join("")}(e):function(t,e){return R(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=Ai(e);G(o).each((function(e){un(e).each((function(o){var i,u,a,c=B((i=r.content,(a=(u||document).createElement("div")).innerHTML=i,ce(Ct.fromDom(a))),(function(t){return"meta"!==$t(t)})),s=ee("table");if(1===c.length&&s(c[0])){r.preventDefault();var l=Ct.fromDom(t.getDoc()),f=di(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()}))}}))}))}}))},Mi=hr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Ri=K({},Mi),Ni=function(t,e,n,r,o){var i=t.slice(0),u=function(t,e){return 0===t.length?Ri.none():1===t.length?Ri.only(0):0===e?Ri.left(0,1):e===t.length-1?Ri.right(e-1,e):e>0&&e<t.length-1?Ri.middle(e-1,e,e+1):Ri.none()}(t,e),a=m(R(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)}))},zi=function(t,e,n){for(var r=0,o=t;o<e;o++)r+=void 0!==n[o]?n[o]:0;return r},Bi=function(t,e){var n=Tn.justCells(t);return R(n,(function(t){var n=zi(t.row,t.row+t.rowspan,e);return{element:t.element,height:n,rowspan:t.rowspan}}))},Pi=function(t,e){return Tn.hasColumns(t)?function(t,e){var n=Tn.justColumns(t);return R(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 R(n,(function(t){var n=zi(t.column,t.column+t.colspan,e);return{element:t.element,width:n,colspan:t.colspan}}))}(t,e)},Ii=function(t,e,n){var r=Pi(t,e);N(r,(function(t){n.setElementWidth(t.element,t.width)}))},Li=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=Ni(a,n,s,o,r),f=R(l,(function(t,e){return t+a[e]}));Ii(i,f,o),r.resizeTable(o.adjustTableWidth,s,c)},Hi=function(t,e,n,r){var o=Tn.fromTable(t),i=function(t,e,n){return jo(t,e,n,Mo,(function(t){return t.getOrThunk(Ze)}))}(o,t,r),u=R(i,(function(t,r){return n===r?Math.max(e+t,Ze()):t})),a=Bi(o,u),c=function(t,e){return R(t.all,(function(t,n){return{element:t.element,height:e[n]}}))}(o,u);N(c,(function(t){ko(t.element,t.height)})),N(a,(function(t){ko(t.element,t.height)}));var s=P(u,(function(t,e){return t+e}),0);ko(t,s)},Fi=function(t){return R(t,m(0))},Vi=function(t,e,n,r,o){return o(t.slice(0,e)).concat(r).concat(o(t.slice(n)))},ji=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}},Ui=ji((function(t){return t<0})),Wi=ji(x),qi=function(){var t=function(t,e,n,r){var o=(100+n)/100,i=Math.max(r,(t[e]+n)/o);return R(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=Ui(t,e,r,o);return Vi(t,e,n+1,[i,0],Fi)}(e,n,r,o,i)};return{resizeTable:function(t,e){return t(e)},clampTableDelta:Ui,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=Ui(e,r,o,i);return Fi(e.slice(0,r)).concat([a])},calcRedestributedWidths:function(t,e,n,r){if(r){var o=(e+n)/e,i=R(t,(function(t){return t/o}));return{delta:100*o-100,newSizes:i}}return{delta:n,newSizes:t}}}},Gi=function(){var t=function(t,e,n,r,o){var i=Wi(t,r>=0?n:e,r,o);return Vi(t,e,n+1,[i,-i],Fi)};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 Ui(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 Fi(t);var u=r/t.length;return R(t,m(u))},calcRedestributedWidths:function(t,e,n,r){return{delta:0,newSizes:t}}}},$i=function(t,e){var n=O.from(t.dom.documentElement).map(Ct.fromDom).getOr(t);return{parent:m(n),view:m(t),origin:m(Kr(0,0)),isResizable:e}},Xi=function(t,e,n){return{parent:m(e),view:m(t),origin:m(Kr(0,0)),isResizable:n}},Ki=hr([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),Yi=function(t,e,n){var r=n.substring(0,n.length-t.length),o=parseFloat(r);return r===o.toString()?e(o):Ki.invalid(n)},Ji=K(K({},Ki),{from:function(t){return it(t,"%")?Yi("%",Ki.percent,t):it(t,"px")?Yi("px",Ki.pixels,t):Ki.invalid(t)}}),Qi=function(t,e,n){return t.fold((function(){return e}),(function(t){return function(t,e,n){var r=n/e;return R(t,(function(t){return Ji.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 R(t,(function(t){return Ji.from(t).fold((function(){return t}),(function(t){return t/e*100+"%"}),(function(t){return t+"%"}))}))}(e,n)}))},Zi=function(t,e,n){var r=Ji.from(n),o=j(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):Qi(r,t,e);return nu(o)},tu=function(t,e){return 0===t.length?e:P(t,(function(t,e){return Ji.from(e).fold(m(0),g,g)+t}),0)},eu=function(t,e){return Ji.from(t).fold(m(t),(function(t){return t+e+"px"}),(function(t){return t+e+"%"}))},nu=function(t){if(0===t.length)return t;var e=P(t,(function(t,e){var n=Ji.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([eu(n[n.length-1],Math.round(e.remainder))])},ru=Ji.from,ou=function(t){return ru(t).fold(m("px"),m("px"),m("%"))},iu=function(t,e,n){var r=Tn.fromTable(t),o=r.all,i=Tn.justCells(r),u=Tn.justColumns(r);e.each((function(e){var n=ou(e),o=zr(t),a=function(t,e){return Ho(t,e,Po,Fo)}(r,t),c=Zi(a,o,e);Tn.hasColumns(r)?function(t,e,n){N(e,(function(e,r){var o=tu([t[r]],Qe());Ve(e.element,"width",o+n)}))}(c,u,n):function(t,e,n){N(e,(function(e){var r=t.slice(e.column,e.colspan+e.column),o=tu(r,Qe());Ve(e.element,"width",o+n)}))}(c,i,n),Ve(t,"width",e)})),n.each((function(e){var n=ou(e),u=qr(t),a=function(t,e,n){return jo(t,e,n,Io,Fo)}(r,t,so);!function(t,e,n,r){N(n,(function(e){var n=t.slice(e.row,e.rowspan+e.row),o=tu(n,Ze());Ve(e.element,"height",o+r)})),N(e,(function(e,n){Ve(e.element,"height",t[n])}))}(Zi(a,u,e),o,i,n),Ve(t,"height",e)}))},uu=function(t){return Eo(t).exists((function(t){return bo.test(t)}))},au=function(t){return Eo(t).exists((function(t){return yo.test(t)}))},cu=function(t){return Eo(t).isNone()},su=function(t){return Tn.fromTable(t).grid},lu=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=B(e,(function(e){return e!==t}))},trigger:function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o={};N(t,(function(t,e){o[t]=n[e]})),N(e,(function(t){t(o)}))}}},fu=function(t){return{registry:Nt(t,(function(t){return{bind:t.bind,unbind:t.unbind}})),trigger:Nt(t,(function(t){return t.trigger}))}},du=function(t){return t.slice(0).sort()},mu=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+".");N(e,(function(e){if(!r(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")}))}("required",e),o=du(e),L(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=Dt(r);j(e,(function(t){return A(o,t)}))||function(t,e){throw new Error("All required keys ("+du(t).join(", ")+") were not specified. Specified keys were: "+du(e).join(", ")+".")}(e,o),t(e,o);var i=B(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 ("+du(t).join(", ")+") were not.")}(i,n.label),r}},gu=function(t,e){var n=B(e,(function(e){return!A(t,e)}));n.length>0&&function(t){throw new Error("Unsupported keys for object: "+du(t).join(", "))}(n)},hu=function(t){return function(t,e){return mu(t,e,{validate:l,label:"function"})}(gu,t)},pu=hu(["compare","extract","mutate","sink"]),vu=hu(["element","start","stop","destroy"]),bu=hu(["forceDrop","drop","move","delayDrop"]),yu=function(){var t=O.none(),e=fu({move:lu(["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}},wu=function(){var t,e=(t=fu({move:lu(["info"])}),{onEvent:d,reset:d,events:t.registry}),n=yu(),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}},xu=function(t,e,n){var r,o,i,a,c=!1,s=fu({start:lu([]),stop:lu([])}),l=wu(),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(bu({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}},Cu=function(t){var e,n,r=Ct.fromDom(function(t){if(fe()&&s(t.target)){var e=Ct.fromDom(t.target);if(Jt(e)&&he(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return G(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)},Su=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(Cu(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:p(ku,t,e,i,o)}},ku=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Ou=x,_u=function(t,e,n){return function(t,e,n,r){return Su(t,e,n,r,!1)}(t,e,Ou,n)},Tu=Cu,Eu=function(t,e){var n=Me(t,e);return void 0===n||""===n?[]:n.split(" ")},Au=function(t){return void 0!==t.dom.classList},Du=function(t,e){return function(t,e,n){var r=Eu(t,e).concat([n]);return Ae(t,e,r.join(" ")),!0}(t,"class",e)},Mu=function(t,e){Au(t)?t.dom.classList.add(e):Du(t,e)},Ru=function(t,e){return Au(t)&&t.dom.classList.contains(e)},Nu=function(t){var e=t.replace(/\./g,"-");return{resolve:function(t){return e+"-"+t}}},zu=Nu("ephox-dragster"),Bu=zu.resolve,Pu=pu({compare:function(t,e){return Kr(e.left-t.left,e.top-t.top)},extract:function(t){return O.some(Kr(t.x,t.y))},sink:function(t,e){var n=function(t){var e=K({layerClass:Bu("blocker")},t),n=Ct.fromTag("div");Ae(n,"role","presentation"),je(n,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Mu(n,Bu("blocker")),Mu(n,e.layerClass);return{element:m(n),destroy:function(){Gn(n)}}}(e),r=_u(n.element(),"mousedown",t.forceDrop),o=_u(n.element(),"mouseup",t.drop),i=_u(n.element(),"mousemove",t.move),u=_u(n.element(),"mouseout",t.delayDrop);return vu({element:n.element,start:function(t){Vn(t,n.element())},stop:function(){Gn(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]")},Lu=function(t,e){return void 0===e&&(e=!1),!wt().browser.isIE()&&pe(t)?t.dom.isContentEditable:Iu(t).fold(m(e),(function(t){return"true"===Hu(t)}))},Hu=function(t){return t.dom.contentEditable},Fu=Nu("ephox-snooker"),Vu=Fu.resolve,ju=function(){var t=fu({drag:lu(["xDelta","yDelta","target"])}),e=O.none(),n=function(){var t=fu({drag:lu(["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}},Uu=Vu("resizer-bar"),Wu=Vu("resizer-rows"),qu=Vu("resizer-cols"),Gu=function(t){var e=xe(t.parent(),"."+Uu);N(e,Gn)},$u=function(t,e,n){var r=t.origin();N(e,(function(e){e.each((function(e){var o=n(r,e);Mu(o,Uu),Vn(t.parent(),o)}))}))},Xu=function(t,e,n,r){$u(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=Ct.fromTag("div"),je(s,{position:"absolute",left:i-a/2+"px",top:u+"px",height:c+"px",width:a+"px"}),De(s,{"data-column":o,role:"presentation"}),s);return Mu(l,qu),l}))},Ku=function(t,e,n,r){$u(t,e,(function(t,e){var o=function(t,e,n,r,o){var i=Ct.fromTag("div");return je(i,{position:"absolute",left:e+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),De(i,{"data-row":t,role:"presentation"}),i}(e.row,n.left-t.left,e.y-t.top,r,7);return Mu(o,Wu),o}))},Yu=function(t,e,n,r,o){var i=Jr(n),u=e.isResizable,a=r.length>0?so.positions(r,n):[],c=a.length>0?function(t,e){return V(t.all,(function(t,n){return e(t.element)?[n]:[]}))}(t,u):[],s=B(a,(function(t,e){return D(c,(function(t){return e===t}))}));Ku(e,s,i,Br(n));var l=o.length>0?go.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)})),B(n,(function(n){var r=Tn.filterItems(t,(function(t){return t.column===n}));return j(r,(function(t){return e(t.element)}))}))}(t,u):[],d=B(l,(function(t,e){return D(f,(function(t){return e===t}))}));Xu(e,d,i,Gr(n))},Ju=function(t,e){if(Gu(t),t.isResizable(e)){var n=Tn.fromTable(e),r=Fr(n),o=Lr(n);Yu(n,t,e,r,o)}},Qu=function(t,e){var n=xe(t.parent(),"."+Uu);N(n,e)},Zu=function(t){Qu(t,(function(t){Ve(t,"display","none")}))},ta=function(t){Qu(t,(function(t){Ve(t,"display","block")}))},ea=Vu("resizer-bar-dragging"),na=function(t){var e=ju(),n=function(t,e){void 0===e&&(e={});var n=void 0!==e.mode?e.mode:Pu;return xu(t,n,e)}(e,{}),r=O.none(),o=function(t,e){return O.from(Me(t,e))};e.events.drag.bind((function(t){o(t.target,"data-row").each((function(e){var n=Je(t.target,"top");Ve(t.target,"top",n+t.yDelta+"px")})),o(t.target,"data-column").each((function(e){var n=Je(t.target,"left");Ve(t.target,"left",n+t.xDelta+"px")}))}));var i=function(t,e){return Je(t,e)-$e(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))})),Ju(t,n)}))}))}));var u=function(r,o){l.trigger.startAdjust(),e.assign(r),Ae(r,"data-initial-"+o,Je(r,o)),Mu(r,ea),Ve(r,"opacity","0.2"),n.go(t.parent())},a=_u(t.parent(),"mousedown",(function(t){var e;e=t.target,Ru(e,Wu)&&u(t.target,"top"),function(t){return Ru(t,qu)}(t.target)&&u(t.target,"left")})),c=function(e){return _t(e,t.view())},s=_u(t.view(),"mouseover",(function(e){var n;(n=e.target,Te(n,"table",c).filter(Lu)).fold((function(){pe(e.target)&&Gu(t)}),(function(e){r=O.some(e),Ju(t,e)}))})),l=fu({adjustHeight:lu(["table","delta","row"]),adjustWidth:lu(["table","delta","column"]),startAdjust:lu([])});return{destroy:function(){a.unbind(),s.unbind(),n.destroy(),Gu(t)},refresh:function(e){Ju(t,e)},on:n.on,off:n.off,hideBars:p(Zu,t),showBars:p(ta,t),events:l.registry}},ra=function(t,e,n){var r=so,o=go,i=na(t),u=fu({beforeResize:lu(["table","type"]),afterResize:lu(["table","type"]),startDrag:lu([])});return i.events.adjustHeight.bind((function(t){var e=t.table;u.trigger.beforeResize(e,"row");var n=r.delta(t.delta,e);Hi(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);Li(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}},oa=function(t,e){return t.fire("newrow",{node:e})},ia=function(t,e){return t.fire("newcell",{node:e})},ua=function(t,e,n){t.fire("TableModified",K(K({},n),{table:e}))},aa={structure:!1,style:!0},ca={structure:!0,style:!1},sa={structure:!0,style:!0},la={"border-collapse":"collapse",width:"100%"},fa=M(5,(function(t){var e=t+1+"px";return{title:e,value:e}})),da=R(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(function(t){return{title:t,value:t.toLowerCase()}})),ma={border:"1"},ga=function(t){return t.getParam("table_sizing_mode","auto")},ha=function(t){return t.getParam("table_responsive_width")},pa=function(t){return t.getParam("table_border_widths",fa,"array")},va=function(t){return t.getParam("table_border_styles",da,"array")},ba=function(t){return t.getParam("table_default_attributes",ma,"object")},ya=function(t){return t.getParam("table_default_styles",function(t){var e;if(Ta(t)){var n=t.dom,r=null!==(e=n.getParent(t.selection.getStart(),n.isBlock))&&void 0!==e?e:t.getBody(),o=Pr(Ct.fromDom(r));return K(K({},la),{width:o+"px"})}return Ea(t)?Bt(la,(function(t,e){return"width"!==e})):la}(t),"object")},wa=function(t){return t.getParam("table_cell_advtab",!0,"boolean")},xa=function(t){return t.getParam("table_row_advtab",!0,"boolean")},Ca=function(t){return t.getParam("table_advtab",!0,"boolean")},Sa=function(t){return t.getParam("table_style_by_css",!1,"boolean")},ka=function(t){return t.getParam("table_cell_class_list",[],"array")},Oa=function(t){return t.getParam("table_class_list",[],"array")},_a=function(t){return"relative"===ga(t)||!0===ha(t)},Ta=function(t){return"fixed"===ga(t)||!1===ha(t)},Ea=function(t){return"responsive"===ga(t)},Aa=function(t){return t.getParam("table_use_colgroups",!1,"boolean")},Da=function(t){var e=t.getParam("table_header_type","section","string");return A(["section","cells","sectionCells","auto"],e)?e:"section"},Ma=function(t){var e=t.getParam("table_column_resizing","preservetable","string");return L(["preservetable","resizetable"],(function(t){return t===e})).getOr("preservetable")},Ra=function(t){return"preservetable"===Ma(t)},Na=function(t){return"resizetable"===Ma(t)},za=function(t){var e=t.getParam("table_clone_elements");return r(e)?O.some(e.split(/[ ,]/)):Array.isArray(e)?O.some(e):O.none()},Ba=function(t){return t.getParam("table_background_color_map",[],"array")},Pa=function(t){return t.getParam("table_border_color_map",[],"array")},Ia=function(t,e){return _a(t)?Ko(e):Ta(t)?Xo(e):$o(e)},La=function(t){Ne(t,"width")},Ha=function(t){var e=No(t);iu(t,O.some(e),O.none()),La(t)},Fa=function(t){var e=function(t){return zr(t)+"px"}(t);iu(t,O.some(e),O.none()),La(t)},Va=function(t){Ge(t,"width");var e=on(t),n=e.length>0?e:rn(t);N(n,(function(t){Ge(t,"width"),La(t)})),La(t)},ja=function(){var t=Ct.fromTag("div");return je(t,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Vn(ve(Ct.fromDom(document)),t),t},Ua=function(t){return"false"!==Me(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 Ra(t)?Gi():qi()},f=function(r,o,i){var u=it(o,"e");if(""===n&&Ha(r),i!==e&&""!==n){Ve(r,"width",n);var a=l(),c=s(r),f=Ra(t)||u?function(t){return su(t).columns}(r)-1:0;Li(r,i-e,f,a,c)}else if(function(t){return/^(\d+(\.\d+)?)%$/.test(t)}(n)){var d=parseFloat(n.replace("%",""));Ve(r,"width",i*d/e+"%")}(function(t){return/^(\d+(\.\d+)?)px$/.test(t)})(n)&&function(t){var e=Tn.fromTable(t);Tn.hasColumns(e)||N(rn(t),(function(t){var e=Ue(t,"width");Ve(t,"width",e),Ne(t,"width")}))}(r)};return t.on("init",(function(){var e=function(t,e){return t.inline?Xi(gi(t),ja(),e):$i(Ct.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=ra(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,hi(n),pi(n),"bar-"+e.type)})),a.events.afterResize.bind((function(e){var n=e.table,r=n.dom;yi(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,hi(r),pi(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=Ct.fromDom(o);N(t.dom.select(".mce-clonedresizable"),(function(e){t.dom.addClass(e,"mce-"+Ma(t)+"-columns")})),!au(i)&&Ta(t)?Fa(i):!uu(i)&&_a(t)&&Ha(i),cu(i)&&ot(r.origin,"bar-")&&Ha(i),e=r.width,n=Ea(t)?"":function(t,e){var n=t.dom.getStyle(e,"width")||t.dom.getAttrib(e,"width");return O.from(n).filter(at)}(t,o).getOr("")}})),t.on("ObjectResized",(function(e){var n=e.target;if(a(n)){var r=Ct.fromDom(n),o=e.origin;ot(o,"corner-")&&f(r,o,e.width),yi(r),ua(t,r.dom,aa)}})),t.on("SwitchMode",(function(){c().each((function(e){t.mode.isReadOnly()?e.hideBars():e.showBars()}))})),{lazyResize:c,lazyWire:function(){return u.getOr($i(Ct.fromDom(t.getBody()),Ua))},destroy:function(){i.each((function(t){t.destroy()})),u.each((function(e){!function(t,e){t.inline&&Gn(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=Zn(),Ja=function(t,e){1===Xe(t,"colspan")&&function(t){return Eo(t).bind((function(t){return vo(t,["fixed","relative","empty"])}))}(t).each((function(n){var r=n.value/2;Ro(t,r,n.unit),Ro(e,r,n.unit)}))},Qa=ee("th"),Za=function(t){return j(t,(function(t){return Qa(t.element)}))},tc=function(t,e){return t&&e?"sectionCells":t?"section":"cells"},ec=function(t){var e="thead"===t.section,n=Be(nc(t.cells),"th");return e||n?{type:"header",subType:tc(e,n)}:"tfoot"===t.section?{type:"footer"}:{type:"body"}},nc=function(t){var e=B(t,(function(t){return Qa(t.element)}));return 0===e.length?O.some("td"):e.length===t.length?O.some("th"):O.none()},rc=function(t,e,n){return qt(n(t.element,e),!0,t.isLocked)},oc=function(t,e){return t.section!==e?Gt(t.element,t.cells,e,t.isNew):t},ic=function(){return{transformRow:oc,transformCell:function(t,e,n){var r=n(t.element,e),o="td"!==$t(r)?function(t,e){var n=Or(t,e);Ln(t,n);var r=ce(t);return Wn(n,r),Gn(t),n}(r,"td"):r;return qt(o,t.isNew,t.isLocked)}}},uc=function(){return{transformRow:oc,transformCell:rc}},ac=function(){return{transformRow:function(t,e){return oc(t,"thead"===e?"tbody":e)},transformCell:rc}},cc=function(t,e){switch(function(t){return X(t.all,(function(t){var e=ec(t);return"header"===e.type?O.from(e.subType):O.none()}))}(Tn.fromTable(t)).getOr(e)){case"section":return ic();case"sectionCells":return uc();case"cells":return ac()}},sc=ic,lc=uc,fc=ac,dc=function(){return{transformRow:g,transformCell:rc}},mc=function(t,e,n,r){n===r?Ne(t,e):Ae(t,e,n)},gc=function(t,e,n){$(we(t,e)).fold((function(){return Fn(t,n)}),(function(t){return Hn(t,n)}))},hc=function(t,e){var n=[],r=[],o=function(t){return R(t,(function(t){t.isNew&&n.push(t.element);var e=t.element;return qn(e),N(t.cells,(function(t){t.isNew&&r.push(t.element),mc(t.element,"colspan",t.colspan,1),mc(t.element,"rowspan",t.rowspan,1),Vn(e,t.element)})),e}))},i=function(t){return V(t,(function(t){return R(t.cells,(function(t){return mc(t.element,"span",t.colspan,1),t.element}))}))},u=function(e,n){var r=function(t,e){var n=Oe(t,e).getOrThunk((function(){var n=Ct.fromTag(e,ne(t).dom);return"thead"===e?gc(t,"caption,colgroup",n):"colgroup"===e?gc(t,"caption",n):Vn(t,n),n}));return qn(n),n}(t,n),u=("colgroup"===n?i:o)(e);Wn(r,u)},a=function(e,n){e.length>0?u(e,n):function(e){Oe(t,e).each(Gn)}(n)},c=[],s=[],l=[],f=[];return N(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}},pc=function(t,e){if(0===t.length)return 0;var n=t[0];return H(t,(function(t){return!e(n.element,t.element)})).getOr(t.length)},vc=function(t,e,n,r){var o=function(t,e){return t[e]}(t,e),i="colgroup"===o.section;return{colspan:pc(o.cells.slice(n),r),rowspan:i?1:pc(function(t,e){return R(t,(function(t){return pn(t,e)}))}(t.slice(e),n),r)}},bc=function(t,e){var n=R(t,(function(t){return R(t.cells,w)}));return R(t,(function(r,o){var i=V(r.cells,(function(r,i){if(!1===n[o][i]){var u=vc(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)}))},yc=function(t,e,n){var r=[];N(t.colgroups,(function(o){for(var i=[],u=0;u<t.grid.columns;u++){var a=Tn.getColumnAt(t,u).map((function(t){return qt(t.element,n,!1)})).getOrThunk((function(){return qt(e.colGap(),!0,!1)}));i.push(a)}r.push(Gt(o.element,i,"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 qt(t.element,n,t.isLocked)})).getOrThunk((function(){return qt(e.gap(),!0,!1)}));i.push(a)}var c=t.all[o],s=Gt(c.element,i,c.section,n);r.push(s)}return r},wc=function(t){return bc(t,_t)},xc=function(t,e){return X(t.all,(function(t){return L(t.cells,(function(t){return _t(e,t.element)}))}))},Cc=function(t,e,n){var r=R(e.selection,(function(e){return nn(e).bind((function(e){return xc(t,e)})).filter(n)})),o=Pe(r);return Le(o.length>0,o)},Sc=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(dc);return e(l,a).map((function(e){var n=function(t,e){return yc(t,e,!1)}(l,c),r=t(n,e,_t,o(c),f),i=Sn(r.grid);return{info:e,grid:wc(r.grid),cursor:r.cursor,lockedColumns:i}})).bind((function(t){var e=hc(u,t.grid),o=O.from(null==s?void 0:s.sizing).getOrThunk((function(){return $o(u)})),a=O.from(null==s?void 0:s.resize).getOrThunk(Gi);return n(u,t.grid,t.info,{sizing:o,resize:a,section:f}),r(u),Ju(i,u),Ne(u,xn),t.lockedColumns.length>0&&Ae(u,xn,t.lockedColumns.join(",")),O.some({cursor:t.cursor,newRows:e.newRows,newCells:e.newCells})}))}},kc=function(t,e){return Cc(t,e,x).map((function(t){return{cells:t,generators:e.generators,clipboard:e.clipboard}}))},Oc=function(t,e){return Cc(t,e,x)},_c=function(t,e){return Cc(t,e,(function(t){return!t.isLocked}))},Tc=function(t,e){return j(e,(function(e){return function(t,e){return xc(t,e).exists((function(t){return!t.isLocked}))}(t,e)}))},Ec=function(t,e){return function(t,e){return e.mergable}(0,e).filter((function(e){return Tc(t,e.cells)}))},Ac=function(t,e){return function(t,e){return e.unmergable}(0,e).filter((function(e){return Tc(t,e)}))},Dc=function(t,e,n,r){for(var o=yn(t).rows,i=!0,u=0;u<o.length;u++)for(var a=0;a<bn(o[0]);a++){var c=o[u],s=pn(c,a),l=n(s.element,e);!0===l&&!1===i?gn(c,a,qt(r(),!0,s.isLocked)):!0===l&&(i=!1)}return t},Mc=function(t,e,n,r){var o=yn(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);N(i,(function(t){for(var i=O.none(),u=e;u<o.length;u++)for(var a=function(e){var a=o[u],c=pn(a,e);n(c.element,t.element)&&(i.isNone()&&(i=O.some(r())),i.each((function(t){gn(a,e,qt(t,!0,c.isLocked))})))},c=0;c<bn(o[0]);c++)a(c)}))}return t},Rc=function(t){return{isValue:x,isError:w,getOr:m(t),getOrThunk:m(t),getOrDie:m(t),or:function(e){return Rc(t)},orThunk:function(e){return Rc(t)},fold:function(e,n){return n(t)},map:function(e){return Rc(e(t))},mapError:function(e){return Rc(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}},zc={value:Rc,error:Nc,fromOption:function(t,e){return t.fold((function(){return Nc(e)}),Rc)}},Bc=function(t,e){return{rowDelta:0,colDelta:bn(t[0])-bn(e[0])}},Pc=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 qt(o(),!0,r(t))}))},Lc=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=wn(o,t,g),i=Ic(e.cells.length,e,n,(function(t){return Ft(r,t.toString())}));return hn(e,i)})))},Hc=function(t,e,n,r){return R(t,(function(t){var o=Ic(e,t,n,w);return dn(t,r,o)}))},Fc=function(t,e,n){var r=e.colDelta<0?Hc:g,o=e.rowDelta<0?Lc:g,i=Sn(t),u=bn(t[0]),a=D(i,(function(t){return t===u-1})),c=r(t,Math.abs(e.colDelta),n,a?u-1:u),s=Sn(c);return o(c,Math.abs(e.rowDelta),n,U(s,x))},Vc=function(t,e,n,r){var o=p(r,pn(t[e],n).element),i=t[e];return t.length>1&&bn(i)>1&&(n>0&&o(vn(i,n-1))||n<i.cells.length-1&&o(vn(i,n+1))||e>0&&o(vn(t[e-1],n))||e<t.length-1&&o(vn(t[e+1],n)))},jc=function(t,e,n){return B(n,(function(n){return n>=t.column&&n<=bn(e[0])+t.column}))},Uc=function(t,e,n,r,o){var i=Sn(e),u=function(t,e,n){var r=bn(e[0]),o=yn(e).cols.length+t.row,i=M(r-t.column,(function(e){return e+t.column}));return{row:o,column:L(i,(function(t){return j(n,(function(e){return e!==t}))})).getOr(r-1)}}(t,e,i),a=yn(n).rows,c=jc(u,a,i);return function(t,e,n){if(t.row>=e.length||t.column>bn(e[0]))return zc.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=bn(n[0]),u=n.length;return zc.value({rowDelta:r.length-u,colDelta:o.length-i})}(u,e,a).map((function(t){var n=K(K({},t),{colDelta:t.colDelta-c.length}),i=Fc(e,n,r),s=Sn(i),l=jc(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+bn(n[0])+i.length,l=U(i,x),f=u;f<c;f++)for(var d=0,m=a;m<s;m++)if(l[m])d++;else{Vc(e,f,m,o)&&Dc(e,vn(e[f],m),o,r.cell);var g=m-a-d,h=pn(n[f-u],g),p=h.element,v=r.replace(p);gn(e[f],m,qt(v,!0,h.isLocked))}return e}(u,i,a,r,o,l)}))},Wc=function(t,e,n,r,o){!function(t,e,n,r){e>0&&e<t[0].cells.length&&N(t,(function(t){var o=t.cells[e-1],i=t.cells[e];n(i.element,o.element)&&gn(t,e,qt(r(),!0,i.isLocked))}))}(e,t,o,r.cell);var i=Pc(n,e),u=Fc(n,i,r),a=Pc(e,u),c=Fc(e,a,r);return R(c,(function(e,n){return dn(e,t,u[n].cells)}))},qc=function(t,e,n,r,o){Mc(e,t,o,r.cell);var i=Sn(e),u=Bc(e,n),a=K(K({},u),{colDelta:u.colDelta-i.length}),c=Fc(e,a,r),s=yn(c),l=s.cols,f=s.rows,d=Sn(c),m=Bc(n,e),g=K(K({},m),{colDelta:m.colDelta+d.length}),h=function(t,e,n){return R(t,(function(t){return I(n,(function(n,r){var o=Ic(1,t,e,x)[0];return mn(n,r,o)}),t)}))}(n,r,d),p=Fc(h,g,r);return l.concat(f.slice(0,t)).concat(p).concat(f.slice(t,f.length))},Gc=function(t,e,n,r,o){var i=yn(t),u=i.rows,a=i.cols,c=u.slice(0,e),s=u.slice(e),l=function(t,e,n,r){return wn(t,(function(t){return r(t,n)}),e)}(u[n],(function(t,n){return e>0&&e<u.length&&r(vn(u[e-1],n),vn(u[e],n))?pn(u[e],n):qt(o(t.element,r),!0,t.isLocked)}),r,o);return a.concat(c).concat([l]).concat(s)},$c=function(t,e,n,r,o){return R(t,(function(t){var i=e>0&&e<bn(t)&&r(vn(t,e-1),vn(t,e)),u=function(t,e,n,r,o,i,u){if("colgroup"!==n&&r)return pn(t,e);var a=pn(t,o);return qt(u(a.element,i),!0,!1)}(t,e,t.section,i,n,r,o);return mn(t,e,u)}))},Xc=function(t,e,n,r){return function(t,e,n,r){return void 0!==vn(t[e],n)&&e>0&&r(vn(t[e-1],n),vn(t[e],n))}(t,e,n,r)||function(t,e,n){return e>0&&n(vn(t,e-1),vn(t,e))}(t[e],n,r)},Kc=function(t,e,n,r){var o=function(t){return function(t){return"row"===t?Ye(e):Ke(e)}(t)?t+"group":t};return t?Qa(e)?o(n):null:r&&Qa(e)?o("row"===n?"col":"row"):null},Yc=function(t,e,n){return qt(n(t.element,e),!0,t.isLocked)},Jc=function(t,e,n,r,o,i,u){return R(t,(function(t,a){return function(t,e){var n=t.cells,r=R(n,e);return Gt(t.element,r,t.section,t.isNew)}(t,(function(t,c){if(function(t){return D(e,(function(e){return n(t.element,e.element)}))}(t)){var s=u(t,a,c)?o(t,n,r):t;return i(s,a,c).each((function(t){var e,n;e=s.element,n={scope:O.from(t)},Rt(n,(function(t,n){t.fold((function(){Ne(e,n)}),(function(t){Ee(e.dom,n,t)}))}))})),s}return t}))}))},Qc=function(t,e,n){return V(t,(function(r,o){return Xc(t,o,e,n)?[]:[pn(r,e)]}))},Zc=function(t,e,n,r,o){var i=yn(t).rows,u=V(e,(function(t){return Qc(i,t,r)})),a=R(t,(function(t){return Za(t.cells)})),c=function(t,e){return j(e,g)&&Za(t)?x:function(t,n,r){return!("th"===$t(t.element)&&e[n])}}(u,a),s=function(t,e){return function(n,r){return O.some(Kc(t,n.element,"row",e[r]))}}(n,a);return Jc(t,u,r,o,Yc,s,c)},ts=function(t,e,n,r,o,i,u){var a=yn(t),c=a.cols,s=a.rows,l=s[e[0]],f=V(e,(function(t){return function(t,e,n){var r=t[e];return V(r.cells,(function(r,o){return Xc(t,e,o,n)?[]:[r]}))}(s,t,o)})),d=R(l.cells,(function(t,e){return Za(Qc(s,e,o))})),m=Y([],s,!0);N(e,(function(t){m[t]=u.transformRow(s[t],n)}));var h=c.concat(m),p=function(t,e){return j(e,g)&&Za(t.cells)?x:function(t,n,r){return!("th"===$t(t.element)&&e[r])}}(l,d),v=function(t,e){return function(n,r,o){return O.some(Kc(t,n.element,"col",e[o]))}}(r,d);return Jc(h,f,o,i,u.transformCell,v,p)},es=function(t,e,n,r){var o=yn(t).rows,i=R(e,(function(t){return pn(o[t.row],t.column)}));return Jc(t,i,n,r,Yc,O.none,x)},ns=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}))},rs=ee("col"),os=ee("colgroup"),is=function(t){return"tr"===$t(t)||os(t)},us=function(t){return{element:t,colspan:$e(t,"colspan",1),rowspan:$e(t,"rowspan",1)}},as=function(t){return Re(t,"scope").map((function(t){return t.substr(0,3)}))},cs=function(t,e){void 0===e&&(e=us);var n=function(n){if(is(n))return os((o={element:n}).element)?t.colgroup(o):t.row(o);var o,i=function(e){return rs(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)}))}}},ss=function(t){return function(e){var n=[],r=function(r){var o="td"===t?{scope:null}:{},i=e.replace(r,t,o);return n.push({item:r,sub:i}),i};return{replaceOrInit:function(t,e){return is(t)||rs(t)?t:function(t,e){return L(n,(function(n){return e(n.item,t)}))}(t,e).fold((function(){return r(t)}),(function(n){return e(t,n.item)?n.sub:r(t)}))}}}},ls=function(t){return{unmerge:function(e){var n=as(e);return n.each((function(t){return Ae(e,"scope",t)})),function(){var r=t.cell({element:e,colspan:1,rowspan:1});return Ge(r,"width"),Ge(e,"width"),n.each((function(t){return Ae(r,"scope",t)})),r}},merge:function(t){return Ge(t[0],"width"),function(){var e=Pe(R(t,as));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 Ae(t[0],"scope",e+"group")})),m(t[0])}}},fs=["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"],ds=Zn(),ms=function(t){return function(t,e){var n=t.property().name(e);return A(fs,n)}(ds,t)},gs=function(t){return function(t,e){var n=t.property().name(e);return A(["ol","ul"],n)}(ds,t)},hs=function(t){return function(t,e){return A(["br","img","hr","input"],t.property().name(e))}(ds,t)},ps=function(t){var e,n=function(t){return"br"===$t(t)},r=function(t){return ni(t).bind((function(e){var r=ae(e).map((function(t){return!!ms(t)||!!hs(t)&&"img"!==$t(t)})).getOr(!1);return oe(e).map((function(o){return!0===r||function(t){return"li"===$t(t)||Se(t,gs).isSome()}(o)||n(e)||ms(o)&&!_t(t,o)?[]:[Ct.fromTag("br")]}))})).getOr([])},o=0===(e=V(t,(function(t){var e=ce(t);return function(t){return j(t,(function(t){return n(t)||Qt(t)&&0===Kn(t).trim().length}))}(e)?[]:e.concat(r(t))}))).length?[Ct.fromTag("br")]:e;qn(t[0]),Wn(t[0],o)},vs=function(t){return Lu(t,!0)},bs=function(t){0===rn(t).length&&Gn(t)},ys=function(t,e){return{grid:t,cursor:e}},ws=function(t,e,n){var r,o,i=yn(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(vs).orThunk((function(){return function(t){return X(t,(function(t){return X(t.cells,(function(t){var e=t.element;return Le(vs(e),e)}))}))}(i)}))},xs=function(t,e,n){var r=ws(t,e,n);return ys(t,r)},Cs=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}))},Ss=function(t,e){return function(n,r,o,i,u){var a=Cs(r),c=R(a,(function(t){return t.row})),s=ts(n,c,t,e,o,i.replaceOrInit,u);return xs(s,r[0].row,r[0].column)}},ks=Ss("thead",!0),Os=Ss("tbody",!1),_s=Ss("tfoot",!1),Ts=function(t,e,n){var r=function(t,e){return sn(t,(function(){return e}))}(t,n.section),o=Tn.generate(r);return yc(o,e,!0)},Es=function(t,e,n,r){return function(t,e,n,r){var o=Tn.generate(e),i=r.getWidths(o,r);Ii(o,i,r)}(0,e,0,r.sizing)},As=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;Ii(i,s,r),r.adjustTableWidth(l)}(0,e,n,r.sizing,r.resize)},Ds=function(t,e){return D(e,(function(t){return 0===t.column&&t.isLocked}))},Ms=function(t,e){return D(e,(function(e){return e.column+e.colspan>=t.grid.columns&&e.isLocked}))},Rs=function(t,e){var n=Lr(t),r=ns(e);return I(r,(function(t,e){return t+n[e.column].map(Br).getOr(0)}),0)},Ns=function(t){return function(e,n){return Oc(e,n).filter((function(n){return!(t?Ds:Ms)(e,n)})).map((function(t){return{details:t,pixelDelta:Rs(e,t)}}))}},zs=function(t){return function(e,n){return kc(e,n).filter((function(n){return!(t?Ds:Ms)(e,n.cells)}))}},Bs=ss("th"),Ps=ss("td"),Is=Sc((function(t,e,n,r){var o=e[0].row,i=Cs(e),u=P(i,(function(t,e){return{grid:Gc(t.grid,o,e.row+t.delta,n,r.getOrInit),delta:t.delta+1}}),{grid:t,delta:0}).grid;return xs(u,o,e[0].column)}),Oc,d,d,cs),Ls=Sc((function(t,e,n,r){var o=Cs(e),i=o[o.length-1],u=i.row+i.rowspan,a=P(o,(function(t,e){return Gc(t,u,e.row,n,r.getOrInit)}),t);return xs(a,u,e[0].column)}),Oc,d,d,cs),Hs=Sc((function(t,e,n,r){var o=e.details,i=ns(o),u=i[0].column,a=P(i,(function(t,e){return{grid:$c(t.grid,u,e.column+t.delta,n,r.getOrInit),delta:t.delta+1}}),{grid:t,delta:0}).grid;return xs(a,o[0].row,u)}),Ns(!0),As,d,cs),Fs=Sc((function(t,e,n,r){var o=e.details,i=o[o.length-1],u=i.column+i.colspan,a=ns(o),c=P(a,(function(t,e){return $c(t,u,e.column,n,r.getOrInit)}),t);return xs(c,o[0].row,u)}),Ns(!1),As,d,cs),Vs=Sc((function(t,e,n,r){var o=ns(e.details),i=function(t,e){return V(t,(function(t){var n=t.cells,r=P(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?[Gt(t.element,r,t.section,t.isNew)]:[]}))}(t,R(o,(function(t){return t.column}))),u=i.length>0?i[0].cells.length-1:0;return xs(i,o[0].row,Math.min(o[0].column,u))}),(function(t,e){return _c(t,e).map((function(e){return{details:e,pixelDelta:-Rs(t,e)}}))}),As,bs,cs),js=Sc((function(t,e,n,r){var o=Cs(e),i=function(t,e,n){var r=yn(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 xs(i,Math.min(e[0].row,u),e[0].column)}),Oc,d,bs,cs),Us=Sc((function(t,e,n,r){var o=ns(e),i=R(o,(function(t){return t.column})),u=Zc(t,i,!0,n,r.replaceOrInit);return xs(u,e[0].row,e[0].column)}),_c,d,d,Bs),Ws=Sc((function(t,e,n,r){var o=ns(e),i=R(o,(function(t){return t.column})),u=Zc(t,i,!1,n,r.replaceOrInit);return xs(u,e[0].row,e[0].column)}),_c,d,d,Ps),qs=Sc(ks,_c,d,d,Bs),Gs=Sc(Os,_c,d,d,Ps),$s=Sc(_s,_c,d,d,Ps),Xs=Sc((function(t,e,n,r){var o=es(t,e,n,r.replaceOrInit);return xs(o,e[0].row,e[0].column)}),_c,d,d,Bs),Ks=Sc((function(t,e,n,r){var o=es(t,e,n,r.replaceOrInit);return xs(o,e[0].row,e[0].column)}),_c,d,d,Ps),Ys=Sc((function(t,e,n,r){var o=e.cells;ps(o);var i=function(t,e,n,r){var o=yn(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=pn(a,u).isLocked;gn(a,u,qt(r(),!1,c))}return t}(t,e.bounds,0,r.merge(o));return ys(i,O.from(o[0]))}),Ec,Es,d,ls),Js=Sc((function(t,e,n,r){var o=P(e,(function(t,e){return Dc(t,e,n,r.unmerge(e))}),t);return ys(o,O.from(e[0]))}),Ac,Es,d,ls),Qs=Sc((function(t,e,n,r){var o=function(t,e){var n=Tn.fromTable(t);return yc(n,e,!0)}(e.clipboard,e.generators),i=function(t,e){return{row:t,column:e}}(e.row,e.column);return Uc(i,t,o,e.generators,n).fold((function(){return ys(t,O.some(e.element))}),(function(t){return xs(t,e.row,e.column)}))}),(function(t,e){return nn(e.element).bind((function(n){return xc(t,n).map((function(t){return K(K({},t),{generators:e.generators,clipboard:e.clipboard})}))}))}),Es,d,cs),Zs=Sc((function(t,e,n,r){var o=yn(t).rows,i=e.cells[0].column,u=o[e.cells[0].row],a=Ts(e.clipboard,e.generators,u),c=Wc(i,t,a,e.generators,n);return xs(c,e.cells[0].row,e.cells[0].column)}),zs(!0),d,d,cs),tl=Sc((function(t,e,n,r){var o=yn(t).rows,i=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,u=o[e.cells[0].row],a=Ts(e.clipboard,e.generators,u),c=Wc(i,t,a,e.generators,n);return xs(c,e.cells[0].row,e.cells[0].column)}),zs(!1),d,d,cs),el=Sc((function(t,e,n,r){var o=yn(t).rows,i=e.cells[0].row,u=o[i],a=Ts(e.clipboard,e.generators,u),c=qc(i,t,a,e.generators,n);return xs(c,e.cells[0].row,e.cells[0].column)}),kc,d,d,cs),nl=Sc((function(t,e,n,r){var o=yn(t).rows,i=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,u=o[e.cells[0].row],a=Ts(e.clipboard,e.generators,u),c=qc(i,t,a,e.generators,n);return xs(c,e.cells[0].row,e.cells[0].column)}),kc,d,d,cs),rl=function(t,e){var n=Tn.fromTable(t);return Oc(n,e).bind((function(t){var e=t[t.length-1],r=t[0].column,o=e.column+e.colspan,i=F(R(n.all,(function(t){return B(t.cells,(function(t){return t.column>=r&&t.column<o}))})));return nc(i)})).getOr("")},ol=function(t,e){var n=Tn.fromTable(t);return Oc(n,e).bind(nc).getOr("")},il=function(t,e){var n=Tn.fromTable(t);return Oc(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=R(t,(function(t){return ec(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("")},ul=function(t,e,n){var r=function(t){return"table"===$t(gi(t))},o=za(t),i=Na(t)?d:Ja,u=function(e){switch(Da(t)){case"section":return sc();case"sectionCells":return lc();case"cells":return fc();default:return cc(e,"section")}},a=function(n,r){return r.cursor.fold((function(){var r=rn(n);return G(r).filter(pe).map((function(r){e.clear(n);var o=t.dom.createRng();return o.selectNode(r.dom),t.selection.setRng(o),Ae(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),yi(s);var d=i(),m=Ct.fromDom(t.getDoc()),g=fi(r,m,o),h={sizing:Ia(t,s),resize:Na(t)?qi():Gi(),section:u(s)};return n(s)?e(d,s,l,g,h).bind((function(e){N(e.newRows,(function(e){oa(t,e.dom)})),N(e.newCells,(function(e){ia(t,e.dom)}));var n=a(s,e);return pe(s)&&(yi(s),f||ua(t,s.dom,c)),n.map((function(t){return{rng:t,effect:c}}))})):O.none()}};return{deleteRow:c(js,(function(e){return!1===r(t)||su(e).rows>1}),d,n,ca),deleteColumn:c(Vs,(function(e){return!1===r(t)||su(e).columns>1}),d,n,ca),insertRowsBefore:c(Is,x,d,n,ca),insertRowsAfter:c(Ls,x,d,n,ca),insertColumnsBefore:c(Hs,x,i,n,ca),insertColumnsAfter:c(Fs,x,i,n,ca),mergeCells:c(Ys,x,d,n,ca),unmergeCells:c(Js,x,d,n,ca),pasteColsBefore:c(Zs,x,d,n,ca),pasteColsAfter:c(tl,x,d,n,ca),pasteRowsBefore:c(el,x,d,n,ca),pasteRowsAfter:c(nl,x,d,n,ca),pasteCells:c(Qs,x,d,n,sa),makeCellsHeader:c(Xs,x,d,n,ca),unmakeCellsHeader:c(Ks,x,d,n,ca),makeColumnsHeader:c(Us,x,d,n,ca),unmakeColumnsHeader:c(Ws,x,d,n,ca),makeRowsHeader:c(qs,x,d,n,ca),makeRowsBody:c(Gs,x,d,n,ca),makeRowsFooter:c($s,x,d,n,ca),getTableRowType:il,getTableCellType:ol,getTableColType:rl}},al={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},cl=function(t){var e=Ct.fromTag("colgroup");return M(t,(function(){return Vn(e,Ct.fromTag("col"))})),e},sl=function(t,e,n,r){return M(t,(function(t){return function(t,e,n,r){for(var o=Ct.fromTag("tr"),i=0;i<t;i++){var u=r<e||i<n?Ct.fromTag("th"):Ct.fromTag("td");i<n&&Ae(u,"scope","row"),r<e&&Ae(u,"scope","col"),Vn(u,Ct.fromTag("br")),Vn(o,u)}return o}(e,n,r,t)}))},ll=function(t,e){t.selection.select(e.dom,!0),t.selection.collapse(!0)},fl=function(t,e,n,o,i){var u=ya(t),a={styles:u,attributes:ba(t),colGroups:Aa(t)};return t.undoManager.ignore((function(){var r=function(t,e,n,r,o,i){void 0===i&&(i=al);var u=Ct.fromTag("table"),a="cells"!==o;je(u,i.styles),De(u,i.attributes),i.colGroups&&Vn(u,cl(e));var c=Math.min(t,n);if(a&&n>0){var s=Ct.fromTag("thead");Vn(u,s);var l=sl(n,e,"sectionCells"===o?c:0,r);Wn(s,l)}var f=Ct.fromTag("tbody");Vn(u,f);var d=sl(a?t-c:t,e,a?0:n,r);return Wn(f,d),u}(n,e,i,o,Da(t),a);Ae(r,"data-mce-id","__mce");var u=function(t){var e=Ct.fromTag("div"),n=Ct.fromDom(t.dom.cloneNode(!0));return Vn(e,n),function(t){return t.dom.innerHTML}(e)}(r);t.insertContent(u),t.addVisual()})),_e(gi(t),'table[data-mce-id="__mce"]').map((function(e){return Ta(t)?Fa(e):Ea(t)?Va(e):(_a(t)||function(t){return r(t)&&-1!==t.indexOf("%")}(u.width))&&Ha(e),yi(e),Ne(e,"data-mce-id"),function(t,e){N(xe(e,"tr"),(function(e){oa(t,e.dom),N(xe(e,"th,td"),(function(e){ia(t,e.dom)}))}))}(t,e),function(t,e){_e(e,"td,th").each(p(ll,t))}(t,e),e.dom})).getOr(null)},dl=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 fl(t,n,e,a,u)}return console.error(o),null},ml=function(t){return function(){return t().fold((function(){return[]}),(function(t){return R(t,(function(t){return t.dom}))}))}},gl=function(t){return function(e){var n=e.length>0?O.some(mi(e)):O.none();t(n)}},hl=function(t){return function(e,n,r){void 0===r&&(r={});var o=dl(t,n,e,r,"Invalid values for insertTable - rows and columns values are required to insert a table.");return t.undoManager.add(),o}},pl=function(t,e,n){var r=$e(t,e,1);1===n||r<=1?Ne(t,e):Ae(t,e,Math.min(n,r))},vl=function(t,e){var n=Tn.fromTable(t);return _c(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=B(Tn.justColumns(t),(function(t){return t.column>=e&&t.column<n})),o=R(r,(function(t){var r=kr(t.element);return pl(r,"span",n-e),r})),i=Ct.fromTag("colgroup");return Wn(i,o),[i]}return[]}(n,r,o),u=function(t,e,n){return R(t.all,(function(t){var r=B(t.cells,(function(t){return t.column>=e&&t.column<n})),o=R(r,(function(t){var r=kr(t.element);return pl(r,"colspan",n-e),r})),i=Ct.fromTag("tr");return Wn(i,o),i}))}(n,r,o);return Y(Y([],i,!0),u,!0)}))},bl=function(t,e,n){var r=Tn.fromTable(t);return Oc(r,e).bind((function(t){var e=yc(r,n,!1),o=yn(e).rows.slice(t[0].row,t[t.length-1].row+t[t.length-1].rowspan),i=V(o,(function(t){var e=B(t.cells,(function(t){return!t.isLocked}));return e.length>0?[K(K({},t),{cells:e})]:[]})),u=wc(i);return Le(u.length>0,u)})).map((function(t){return function(t){return R(t,(function(t){var e=Sr(t.element);return N(t.cells,(function(t){var n=kr(t.element);mc(n,"colspan",t.colspan,1),mc(n,"rowspan",t.rowspan,1),Vn(e,n)})),e}))}(t)}))},yl=tinymce.util.Tools.resolve("tinymce.util.Tools"),wl=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))},xl=function(t,e,n){n&&t.formatter.apply("align"+n,{},e)},Cl=function(t,e){yl.each("left center right".split(" "),(function(n){t.formatter.remove("align"+n,{},e)}))},Sl=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],kl=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Ol=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,_l=function(t){return(e=t,n="#",ot(e,n)?function(t,e){return t.substring(e)}(e,n.length):e).toUpperCase();var e,n},Tl=function(t){return function(t){return kl.test(t)||Ol.test(t)}(t)?O.some({value:_l(t)}):O.none()},El=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Al=function(t){return function(t){return{value:t}}(El(t.red)+El(t.green)+El(t.blue))},Dl=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Ml=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Rl=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Nl=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),u=parseInt(n,10),a=parseFloat(r);return Rl(o,i,u,a)},zl=function(t){return Tl(t).orThunk((function(){return function(t){if("transparent"===t)return O.some(Rl(0,0,0,0));var e=Dl.exec(t);if(null!==e)return O.some(Nl(e[1],e[2],e[3],"1"));var n=Ml.exec(t);return null!==n?O.some(Nl(n[1],n[2],n[3],n[4])):O.none()}(t).map(Al)})).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 Al(Rl(o,i,u,a))}))},Bl=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Pl=function(t){var e=Bl(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))}}},Il=function(){var t=Pl(d);return K(K({},t),{on:function(e){return t.get().each(e)}})},Ll=function(t,e,n,r){return function(o){var i=Pl((function(t){return t.unbind()})),u=!at(r),a=function(){var a=Ai(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(j(a,c)),i.set(t.formatter.formatChanged(n,o.setActive,!1,{value:r})))};return t.initialized?a():t.on("init",a),i.clear}},Hl=function(t){return Vt(t,"menu")},Fl=function(t){return R(t,(function(t){var e=t.text||t.title;return Hl(t)?{text:e,items:Fl(t.menu)}:{text:e,value:t.value}}))},Vl=function(t,e,n,r,o){return R(n,(function(n){var i=n.text||n.title;return Hl(n)?{type:"nestedmenuitem",text:i,getSubmenuItems:function(){return Vl(t,e,n.menu,r,o)}}:{text:i,type:"togglemenuitem",onAction:function(){return o(n.value)},onSetup:Ll(t,e,r,n.value)}}))},jl=function(t,e){return function(n){var r;t.execCommand("mceTableApplyCellStyle",!1,((r={})[e]=n,r))}},Ul=function(t){return V(t,(function(t){return Hl(t)?[K(K({},t),{menu:Ul(t.menu)})]:at(t.value)?[t]:[]}))},Wl=function(t,e,n,r,o){return function(i){return i(Vl(t,e,n,r,o))}},ql=function(t,e,n){var r=R(e,(function(t){return{text:t.title,value:"#"+zl(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))}}]},Gl=function(t){return function(){var e="header"===t.queryCommandValue("mceTableRowType")?"body":"header";t.execCommand("mceTableRowType",!1,{type:e})}},$l=function(t){return function(){var e="th"===t.queryCommandValue("mceTableColType")?"td":"th";t.execCommand("mceTableColType",!1,{type:e})}},Xl=[{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:Sl}],Kl=function(t){return Xl.concat(function(t){var e=Fl(ka(t));return e.length>0?O.some({name:"class",type:"listbox",label:"Class",items:e}):O.none()}(t).toArray())},Yl=function(t,e){var n=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(Fl(va(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}},Jl=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))}}}},Ql={normal:Jl(!1),ifTruthy:Jl(!0)},Zl=function(t){return function(e){return ot(e,"rgb")?t.toHex(e):e}},tf=function(t,e){var n=Ct.fromDom(e);return{borderwidth:qe(n,"border-width").getOr(""),borderstyle:qe(n,"border-style").getOr(""),bordercolor:qe(n,"border-color").map(Zl(t)).getOr(""),backgroundcolor:qe(n,"background-color").map(Zl(t)).getOr("")}},ef=function(t){var e=t[0],n=t.slice(1);return N(n,(function(t){N(Dt(e),(function(n){Rt(t,(function(t,r){var o=e[n];""!==o&&n===r&&o!==t&&(e[n]="")}))}))})),e},nf=function(t,e,n,r){return L(t,(function(t){return!c(n.formatter.matchNode(r,e+t))})).getOr("")},rf=p(nf,["left","center","right"],"align"),of=p(nf,["top","middle","bottom"],"valign"),uf=function(t){return un(Ct.fromDom(t)).map((function(e){var n={selection:mi(t.cells)};return il(e,n)})).getOr("")},af=function(t,e){var n=Tn.fromTable(t),r=Tn.justCells(n),o=B(r,(function(t){return D(e,(function(e){return _t(t.element,e)}))}));return R(o,(function(t){return{element:t.element.dom,column:Tn.getColumnAt(n,t.column).map((function(t){return t.element.dom}))}}))},cf=function(t,e,n){var r=1===e.length;N(e,(function(e){var o=e.element,i=r?Ql.normal(t,o):Ql.ifTruthy(t,o);!function(t,e,n){t.setAttrib("scope",n.scope),t.setAttrib("class",n.class),t.setStyle("height",bi(n.height)),e.setStyle("width",bi(n.width))}(i,e.column.map((function(e){return r?Ql.normal(t,e):Ql.ifTruthy(t,e)})).getOr(i),n),wa(t)&&function(t,e){t.setFormat("tablecellbackgroundcolor",e.backgroundcolor),t.setFormat("tablecellbordercolor",e.bordercolor),t.setFormat("tablecellborderstyle",e.borderstyle),t.setFormat("tablecellborderwidth",bi(e.borderwidth))}(i,n),r&&(Cl(t,o),function(t,e){yl.each("top middle bottom".split(" "),(function(n){t.formatter.remove("valign"+n,{},e)}))}(t,o)),n.halign&&xl(t,o,n.halign),n.valign&&function(t,e,n){n&&t.formatter.apply("valign"+n,{},e)}(t,o,n.valign)}))},sf=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){!function(t,e,n,r){var o=Bt(r,(function(t,e){return n[e]!==t}));Lt(o)>0&&e.length>=1&&un(e[0]).each((function(n){var i=af(n,e),u=Lt(Bt(o,(function(t,e){return"scope"!==e&&"celltype"!==e})))>0,a=Ft(o,"celltype");(u||Ft(o,"scope"))&&cf(t,i,r),a&&function(t,e){t.execCommand("mceTableCellType",!1,{type:e.celltype,no_events:!0})}(t,r),ua(t,n.dom,{structure:a,style:u})}))}(t,e,n,o),t.focus()}))},lf=function(t,e){var n=un(e[0]).map((function(n){return R(af(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 K({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:rf(t,e),valign:of(t,e)},n?tf(i,e):{})}(t,e.element,wa(t),e.column)}))}));return ef(n.getOrDie())},ff=function(t,e){var n=Ai(e);if(0!==n.length){var r=lf(t,n),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:Kl(t)},Yl(t,"cell")]},i={type:"panel",items:[{type:"grid",columns:2,items:Kl(t)}]};t.windowManager.open({title:"Cell Properties",size:"normal",body:wa(t)?o:i,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:p(sf,t,n,r)})}},df=[{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"}],mf=function(t){return df.concat(function(t){var e=Fl(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())},gf=function(t,e,n,r){var o=1===e.length;N(e,(function(e){var i=o?Ql.normal(t,e):Ql.ifTruthy(t,e);!function(t,e){t.setAttrib("class",e.class),t.setStyle("height",bi(e.height))}(i,n),xa(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&&(Cl(t,e),xl(t,e,n.align))}))},hf=function(t,e,n,r){var o=r.getData();r.close(),t.undoManager.transact((function(){!function(t,e,n,r){var o=Bt(r,(function(t,e){return n[e]!==t}));if(Lt(o)>0){var i=Ft(o,"type"),u=!i||Lt(o)>1;u&&gf(t,e,r,n),i&&function(t,e){t.execCommand("mceTableRowType",!1,{type:e.type,no_events:!0})}(t,r),un(Ct.fromDom(e[0])).each((function(e){return ua(t,e.dom,{structure:i,style:u})}))}}(t,e,n,o),t.focus()}))},pf=function(t){var e,n,r,o,i=(e=wi(t),n=ki.selected,r=Ei(e),o=r.bind((function(t){return un(t)})).map((function(t){return an(t)})),Ie(r,o,(function(t,e){return B(e,(function(e){return D(mi(e.dom.cells),(function(e){return"1"===Me(e,n)||_t(e,t)}))}))})).getOr([]));if(0!==i.length){var u=R(i,(function(e){return function(t,e,n){var r=t.dom;return K({height:r.getStyle(e,"height")||r.getAttrib(e,"height"),class:r.getAttrib(e,"class",""),type:uf(e),align:rf(t,e)},n?tf(r,e):{})}(t,e.dom,xa(t))})),a=ef(u),c={type:"tabpanel",tabs:[{title:"General",name:"general",items:mf(t)},Yl(t,"row")]},s={type:"panel",items:[{type:"grid",columns:2,items:mf(t)}]};t.windowManager.open({title:"Row Properties",size:"normal",body:xa(t)?c:s,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:a,onSubmit:p(hf,t,R(i,(function(t){return t.dom})),a)})}},vf=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)},bf=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++)bf(t,e.children[i],n,o)},yf=function(t,e,n,r){var o=t.dom,i=r.getData(),u=Bt(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=fl(t,n,r,0,0)}if(Lt(u)>0){!function(t,e,n){var r=t.dom,o={},i={};if(o.class=n.class,i.height=bi(n.height),r.getAttrib(e,"width")&&!Sa(t)?o.width=function(t){return t?t.replace(/px$/,""):""}(n.width):i.width=bi(n.width),Sa(t)?(i["border-width"]=bi(n.border),i["border-spacing"]=bi(n.cellspacing)):(o.border=n.border,o.cellpadding=n.cellpadding,o.cellspacing=n.cellspacing),Sa(t)&&e.children)for(var u=0;u<e.children.length;u++)bf(r,e.children[u],{"border-width":bi(n.border),padding:bi(n.cellpadding)}),Ca(t)&&bf(r,e.children[u],{"border-color":n.bordercolor});Ca(t)&&(i["background-color"]=n.backgroundcolor,i["border-color"]=n.bordercolor,i["border-style"]=n.borderstyle),o.style=r.serializeStyle(K(K({},ya(t)),i)),r.setAttribs(e,K(K({},ba(t)),o))}(t,e,i);var a=o.select("caption",e)[0];(a&&!i.caption||!a&&i.caption)&&t.execCommand("mceTableToggleCaption"),""===i.align?Cl(t,e):xl(t,e,i.align)}if(t.focus(),t.addVisual(),Lt(u)>0){var c=Ft(u,"caption"),s=!c||Lt(u)>1;ua(t,e,{structure:c,style:s})}}))},wf=function(t,e){var n,r=t.dom,o=function(t,e){var n,r,o,i,u=ya(t),a=ba(t),c=e?(n=t.dom,{borderstyle:Ht(u,"border-style").getOr(""),bordercolor:Zl(n)(Ht(u,"border-color").getOr("")),backgroundcolor:Zl(n)(Ht(u,"background-color").getOr(""))}):{};return K(K(K(K(K(K({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),c),(i=u["border-width"],Sa(t)&&i?{border:i}:Ht(a,"border").fold((function(){return{}}),(function(t){return{border:t}})))),(r=Ht(u,"border-spacing").or(Ht(a,"cellspacing")).fold((function(){return{}}),(function(t){return{cellspacing:t}})),o=Ht(u,"border-padding").or(Ht(a,"cellpadding")).fold((function(){return{}}),(function(t){return{cellpadding:t}})),K(K({},r),o)))}(t,Ca(t));!1===e?(n=r.getParent(t.selection.getStart(),"table",t.getBody()))?o=function(t,e,n){var r=t.dom,o=Sa(t)?r.getStyle(e,"border-spacing")||r.getAttrib(e,"cellspacing"):r.getAttrib(e,"cellspacing")||r.getStyle(e,"border-spacing"),i=Sa(t)?wl(r,e,"padding")||r.getAttrib(e,"cellpadding"):r.getAttrib(e,"cellpadding")||wl(r,e,"padding");return K({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=qe(Ct.fromDom(n),"border-width");return Sa(t)&&r.isSome()?r.getOr(""):e.getAttrib(n,"border")||wl(t.dom,n,"border-width")||wl(t.dom,n,"border")}(r,e),caption:!!r.select("caption",e)[0],class:r.getAttrib(e,"class",""),align:rf(t,e)},n?tf(r,e):{})}(t,n,Ca(t)):Ca(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""):(o.cols="1",o.rows="1",Ca(t)&&(o.borderstyle="",o.bordercolor="",o.backgroundcolor=""));var i=Fl(Oa(t));i.length>0&&o.class&&(o.class=o.class.replace(/\s*mce\-item\-table\s*/g,""));var u={type:"grid",columns:2,items:vf(t,i,e)},a=Ca(t)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[u]},Yl(t,"table")]}:{type:"panel",items:[u]};t.windowManager.open({title:"Table Properties",size:"normal",body:a,onSubmit:p(yf,t,n,o),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o})},xf=function(t){return Ti(wi(t),vi(t))},Cf=function(t,e,n,i,u){var a=vi(t),c=function(t){return un(t,a)},s=function(e){return function(t){return Ei(wi(t),vi(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=Oi(i,n,r);t(n,o,e).each(l)}))},m=function(){return s((function(e,n){var r=Oi(i,e,n),o=fi(d,Ct.fromDom(t.getDoc()),O.none());return bl(e,r,o)}))},g=function(){return s((function(t,e){var n=Oi(i,t,e);return vl(t,n)}))},h=function(e,n){return n().each((function(n){var r=R(n,(function(t){return kr(t)}));s((function(n,o){var u=di(Ct.fromDom(t.getDoc())),a=function(t,e,n,r){return{selection:xi(t),clipboard:n,generators:r}}(i,0,r,u);e(n,a).each(l)}))}))},v=function(t){return function(e,n){return Ht(n,"type").each((function(e){f(t(e),n.no_events)}))}};Rt({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 xf(t).each((function(e){un(e,a).filter(y(a)).each((function(e){var n=Ct.fromText("");if(Hn(e,n),Gn(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=Ai(i),o=j(r,(function(e){return t.formatter.match("tablecellclass",{value:n},e.dom)}))?t.formatter.remove:t.formatter.apply;N(r,(function(t){return o("tablecellclass",{value:n},t.dom)})),ua(t,e.dom,aa)}))},mceTableToggleClass:function(e,n){s((function(e){t.formatter.toggle("tableclass",{value:n},e.dom),ua(t,e.dom,aa)}))},mceTableToggleCaption:function(){xf(t).each((function(e){un(e,a).each((function(n){Oe(n,"caption").fold((function(){var e=Ct.fromTag("caption");Vn(e,Ct.fromText("Caption")),function(t,e,n){se(t,n).fold((function(){Vn(t,e)}),(function(t){Ln(t,e)}))}(n,e,0),t.selection.setCursorLocation(e.dom,0)}),(function(r){ee("caption")(e)&&Ot("td",n).each((function(e){return t.selection.setCursorLocation(e.dom,0)})),Gn(r)})),ua(t,n.dom,ca)}))}))},mceTableSizingMode:function(e,n){return function(e){return xf(t).each((function(n){Ea(t)||Ta(t)||_a(t)||un(n,a).each((function(n){"relative"!==e||uu(n)?"fixed"!==e||au(n)?"responsive"!==e||cu(n)||Va(n):Fa(n):Ha(n),yi(n),ua(t,n.dom,ca)}))}))}(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)})),Rt({mceTableProps:p(wf,t,!1),mceTableRowProps:p(pf,t),mceTableCellProps:p(ff,t,i)},(function(e,n){return t.addCommand(n,(function(){return e()}))})),t.addCommand("mceInsertTable",(function(e,n){o(n)&&Dt(n).length>0?dl(t,n.rows,n.columns,n.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):wf(t,!0)})),t.addCommand("mceTableApplyCellStyle",(function(e,n){var u=function(t){return"tablecell"+t.toLowerCase().replace("-","")};if(o(n)){var a=Ai(i);if(0!==a.length){var s=Bt(n,(function(e,n){return t.formatter.has(u(n))&&r(e)}));(function(t){for(var e in t)if(Mt.call(t,e))return!1;return!0})(s)||(Rt(s,(function(e,n){N(a,(function(r){Ql.normal(t,r.dom).setFormat(u(n),e)}))})),c(a[0]).each((function(e){return ua(t,e.dom,aa)})))}}}))},Sf={remove_similar:!0,inherit:!1},kf=K({selector:"td,th"},Sf),Of={tablecellbackgroundcolor:K({styles:{backgroundColor:"%value"}},kf),tablecellverticalalign:K({styles:{"vertical-align":"%value"}},kf),tablecellbordercolor:K({styles:{borderColor:"%value"}},kf),tablecellclass:K({classes:["%value"]},kf),tableclass:K({selector:"table",classes:["%value"]},Sf),tablecellborderstyle:K({styles:{borderStyle:"%value"}},kf),tablecellborderwidth:K({styles:{borderWidth:"%value"}},kf)},_f=hr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),Tf=K(K({},_f),{none:function(t){return void 0===t&&(t=void 0),_f.none(t)}}),Ef=function(t,e,n,r,o){void 0===o&&(o=x);var i=1===r;if(!i&&n<=0)return Tf.first(t[0]);if(i&&n>=t.length-1)return Tf.last(t[t.length-1]);var u=n+r,a=t[u];return o(a)?Tf.middle(e,a):Ef(t,e,u,r,o)},Af=function(t,e){return un(t,e).bind((function(e){var n=rn(e);return H(n,(function(e){return _t(t,e)})).map((function(t){return{index:t,all:n}}))}))},Df=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Mf=hr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Rf={before:Mf.before,on:Mf.on,after:Mf.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(g,g,g)}},Nf=hr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),zf={domRange:Nf.domRange,relative:Nf.relative,exact:Nf.exact,exactFromRange:function(t){return Nf.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e,n=function(t){return t.match({domRange:function(t){return Ct.fromDom(t.startContainer)},relative:function(t,e){return Rf.getStart(t)},exact:function(t,e,n,r){return t}})}(t);return e=n,Ct.fromDom(re(e).dom.defaultView)},range:Df},Bf=function(t,e){var n=t.document.createRange();return n.selectNode(e.dom),n},Pf=function(t,e){var n=t.document.createRange();return If(n,e),n},If=function(t,e){return t.selectNodeContents(e.dom)},Lf=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},Hf=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Ff=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Vf=hr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),jf=function(t,e,n){return e(Ct.fromDom(n.startContainer),n.startOffset,Ct.fromDom(n.endContainer),n.endOffset)},Uf=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 Vf.rtl(Ct.fromDom(t.endContainer),t.endOffset,Ct.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return jf(0,Vf.ltr,n)})):jf(0,Vf.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:J((function(){return Lf(t,e,n)})),rtl:J((function(){return O.some(Lf(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:J((function(){return Hf(t,e,n,r,o)})),rtl:J((function(){return O.some(Hf(t,r,o,e,n))}))}}})}(t,e))},Wf=function(t,e){return Uf(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}})};Vf.ltr,Vf.rtl;var qf=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},Gf=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=Kn(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)},$f=function(t,e,n,r){return Qt(e)?function(t,e,n,r){var o=t.dom.createRange();o.selectNode(e.dom);var i=o.getClientRects();return X(i,(function(t){return qf(t,n,r)?O.some(t):O.none()})).map((function(o){return Gf(t,e,n,r,o)}))}(t,e,n,r):function(t,e,n,r){var o=t.dom.createRange(),i=ce(e);return X(i,(function(e){return o.selectNode(e.dom),qf(o.getBoundingClientRect(),n,r)?$f(t,e,n,r):O.none()}))}(t,e,n,r)},Xf=function(t,e){return e-t.left<t.right-e},Kf=function(t,e,n){var r=t.dom.createRange();return r.selectNode(e.dom),r.collapse(n),r},Yf=function(t,e,n){var r=t.dom.createRange();r.selectNode(e.dom);var o=r.getBoundingClientRect(),i=Xf(o,n);return(!0===i?ei:ni)(e).map((function(e){return Kf(t,e,i)}))},Jf=function(t,e,n){var r=e.dom.getBoundingClientRect(),o=Xf(r,n);return O.some(Kf(t,e,o))},Qf=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)}))},Zf=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))},td=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 $f(t,e,u,a)}(t,e,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},ed=function(t,e,n){return Ct.fromPoint(t,e,n).bind((function(r){var o=function(){return function(t,e,n){return(0===ce(e).length?Jf:Yf)(t,e,n)}(t,r,e)};return 0===ce(r).length?o():td(t,r,e,n).orThunk(o)}))},nd=document.caretPositionFromPoint?Qf:document.caretRangeFromPoint?Zf:ed,rd=function(t,e){var n=$t(t);return"input"===n?Rf.after(t):A(["br","img"],n)?0===e?Rf.before(t):Rf.after(t):Rf.on(t,e)},od=function(t,e){var n=t.fold(Rf.before,rd,Rf.after),r=e.fold(Rf.before,rd,Rf.after);return zf.relative(n,r)},id=function(t,e,n,r){var o=rd(t,e),i=rd(n,r);return zf.relative(o,i)},ud=function(t,e,n,r){var o=function(t,e,n,r){var o=ne(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=_t(t,n)&&e===r;return o.collapsed&&!i},ad=function(t){return O.from(t.getSelection())},cd=function(t,e){ad(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))},sd=function(t,e,n,r,o){var i=Hf(t,e,n,r,o);cd(t,i)},ld=function(t,e){return Uf(t,e).match({ltr:function(e,n,r,o){sd(t,e,n,r,o)},rtl:function(e,n,r,o){ad(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){sd(t,r,o,e,n)}else sd(t,r,o,e,n)}))}})},fd=function(t,e,n,r,o){var i=id(e,n,r,o);ld(t,i)},dd=function(t,e,n){var r=od(e,n);ld(t,r)},md=function(t){var e=zf.getWin(t).dom,n=function(t,n,r,o){return Hf(e,t,n,r,o)},r=function(t){return t.match({domRange:function(t){var e=Ct.fromDom(t.startContainer),n=Ct.fromDom(t.endContainer);return id(e,t.startOffset,n,t.endOffset)},relative:od,exact:id})}(t);return Uf(e,r).match({ltr:n,rtl:n})},gd=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return O.some(Df(Ct.fromDom(e.startContainer),e.startOffset,Ct.fromDom(n.endContainer),n.endOffset))}return O.none()},hd=function(t){if(null===t.anchorNode||null===t.focusNode)return gd(t);var e=Ct.fromDom(t.anchorNode),n=Ct.fromDom(t.focusNode);return ud(e,t.anchorOffset,n,t.focusOffset)?O.some(Df(e,t.anchorOffset,n,t.focusOffset)):gd(t)},pd=function(t,e,n){void 0===n&&(n=!0);var r=(n?Pf:Bf)(t,e);cd(t,r)},vd=function(t){return function(t){return ad(t).filter((function(t){return t.rangeCount>0})).bind(hd)}(t).map((function(t){return zf.exact(t.start,t.soffset,t.finish,t.foffset)}))},bd=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(Ff):O.none()}(Wf(t,e))},yd=function(t,e,n){return function(t,e,n){var r=Ct.fromDom(t.document);return nd(r,e,n).map((function(t){return Df(Ct.fromDom(t.startContainer),t.startOffset,Ct.fromDom(t.endContainer),t.endOffset)}))}(t,e,n)},wd=tinymce.util.Tools.resolve("tinymce.util.VK"),xd=function(t,e,n){return Sd(t,e,function(t,e,n){return Af(t,n).fold((function(){return Tf.none(t)}),(function(n){return Ef(n.all,t,n.index,1,e)}))}(n,Lu))},Cd=function(t,e,n){return Sd(t,e,function(t,e,n){return Af(t,n).fold((function(){return Tf.none()}),(function(n){return Ef(n.all,t,n.index,-1,e)}))}(n,Lu))},Sd=function(t,e,n){return n.fold(O.none,O.none,(function(t,e){return ei(e).map((function(t){return function(t,e){var n=zf.exact(e,0,e,0);return md(n)}(0,t)}))}),(function(n){return t.execCommand("mceTableInsertRowAfter"),xd(t,e,n)}))},kd=["table","li","dl"],Od=function(t,e){return{selection:t,kill:e}},_d=function(t,e,n,r){return{start:Rf.on(t,e),finish:Rf.on(n,r)}},Td=function(t,e){var n=Wf(t,e);return Df(Ct.fromDom(n.startContainer),n.startOffset,Ct.fromDom(n.endContainer),n.endOffset)},Ed=_d,Ad=function(t,e,n,r,o){return _t(n,r)?O.none():sr(n,r,e).bind((function(e){var r=e.boxes.getOr([]);return r.length>1?(o(t,r,e.start,e.finish),O.some(Od(O.some(Ed(n,0,n,Qo(n))),!0))):O.none()}))},Dd=function(t,e){return{item:t,mode:e}},Md=function(t,e,n,r){return void 0===r&&(r=Rd),t.property().parent(e).map((function(t){return Dd(t,r)}))},Rd=function(t,e,n,r){return void 0===r&&(r=Nd),n.sibling(t,e).map((function(t){return Dd(t,r)}))},Nd=function(t,e,n,r){void 0===r&&(r=Nd);var o=t.property().children(e);return n.first(o).map((function(t){return Dd(t,r)}))},zd=[{current:Md,next:Rd,fallback:O.none()},{current:Rd,next:Nd,fallback:O.some(Md)},{current:Nd,next:Nd,fallback:O.some(Rd)}],Bd=function(t,e,n,r,o){return void 0===o&&(o=zd),L(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 Bd(t,e,n,r)}))}))}))},Pd=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()}}},Id=function(){return{sibling:function(t,e){return t.query().nextSibling(e)},first:function(t){return t.length>0?O.some(t[0]):O.none()}}},Ld=function(t,e,n,r,o,i){return Bd(t,e,r,o).bind((function(e){return i(e.item)?O.none():n(e.item)?O.some(e.item):Ld(t,e.item,n,e.mode,o,i)}))},Hd=function(t){return function(e){return 0===t.property().children(e).length}},Fd=function(t,e,n,r){return Ld(t,e,n,Rd,Pd(),r)},Vd=function(t,e,n,r){return Ld(t,e,n,Rd,Id(),r)},jd=Zn(),Ud=function(t,e){return function(t,e,n){return Fd(t,e,Hd(t),n)}(jd,t,e)},Wd=function(t,e){return function(t,e,n){return Vd(t,e,Hd(t),n)}(jd,t,e)},qd=hr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Gd=function(t){return Te(t,"tr")},$d=K(K({},qd),{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 _t(n,e)?_t(r,n)&&Qo(n)===o?i(e):qd.none("in same cell"):ar(Gd,[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)?qd.success():i(e)}),(function(t){return i(e)}))}))})).getOr(qd.none("default"))},cata:function(t,e,n,r,o){return t.fold(e,n,r,o)}}),Xd=function(t,e){return H(t,p(_t,e))},Kd=function(t){return"br"===$t(t)},Yd=function(t,e,n){return e(t,n).bind((function(t){return Qt(t)&&0===Kn(t).trim().length?Yd(t,e,n):O.some(t)}))},Jd=function(t,e,n,r){return function(t,e){return se(t,e).filter(Kd).orThunk((function(){return se(t,e-1).filter(Kd)}))}(e,n).bind((function(e){return r.traverse(e).fold((function(){return Yd(e,r.gather,t).map(r.relative)}),(function(t){return function(t){return oe(t).bind((function(e){var n=ce(e);return Xd(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 Rf.on(t.parent,t.index)}))}))}))},Qd=function(t,e,n,r){return(Kd(e)?function(t,e,n){return n.traverse(e).orThunk((function(){return Yd(e,n.gather,t)})).map(n.relative)}(t,e,r):Jd(t,e,n,r)).map((function(t){return{start:t,finish:t}}))},Zd=function(t,e){return{left:t.left,top:t.top+e,right:t.right,bottom:t.bottom+e}},tm=function(t,e){return{left:t.left,top:t.top-e,right:t.right,bottom:t.bottom-e}},em=function(t,e,n){return{left:t.left+e,top:t.top+n,right:t.right+e,bottom:t.bottom+n}},nm=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}},rm=function(t,e){return O.some(t.getRect(e))},om=function(t,e,n){return Jt(e)?rm(t,e).map(nm):Qt(e)?function(t,e,n){return n>=0&&n<Qo(e)?t.getRangedRect(e,n,e,n+1):n>0?t.getRangedRect(e,n-1,e,n):O.none()}(t,e,n).map(nm):O.none()},im=function(t,e){return Jt(e)?rm(t,e).map(nm):Qt(e)?t.getRangedRect(e,0,e,Qo(e)).map(nm):O.none()},um=hr([{none:[]},{retry:["caret"]}]),am=function(t,e,n){return(r=e,o=ms,Ce((function(t,e){return e(t)}),Se,r,o,i)).fold(w,(function(e){return im(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},cm={point:function(t){return t.bottom},adjuster:function(t,e,n,r,o){var i=Zd(o,5);return Math.abs(n.bottom-r.bottom)<1?um.retry(i):n.top>o.bottom?um.retry(i):n.top===o.bottom?um.retry(Zd(o,1)):am(t,e,o)?um.retry(em(i,5,0)):um.none()},move:Zd,gather:Wd},sm=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"===$t(t)})).isSome()}(t,r.left,e.point(r))?function(t,e,n,r,o){return sm(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 im(t,i).bind((function(u){return e.adjuster(t,i,u,n,r).fold(O.none,(function(r){return sm(t,e,n,r,o-1)}))})).orThunk((function(){return O.some(r)}))}),O.none)}))},lm=function(t,e,n){var r=t.move(n,5),o=sm(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)}))},fm={tryUp:p(lm,{point:function(t){return t.top},adjuster:function(t,e,n,r,o){var i=tm(o,5);return Math.abs(n.top-r.top)<1?um.retry(i):n.bottom<o.top?um.retry(i):n.bottom===o.top?um.retry(tm(o,1)):am(t,e,o)?um.retry(em(i,5,0)):um.none()},move:tm,gather:Ud}),tryDown:p(lm,cm),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)},dm=function(t,e,n){return t.getSelection().bind((function(r){return Qd(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 $d.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,Qo(t)))}))}($d.verify(t,r.finish,r.foffset,i.finish,i.foffset,n.failure,e))}))}))},mm=function(t,e,n,r,o,i){return 0===i?O.none():pm(t,e,n,r,o).bind((function(u){var a=t.fromSitus(u),c=$d.verify(t,n,r,a.finish,a.foffset,o.failure,e);return $d.cata(c,(function(){return O.none()}),(function(){return O.some(u)}),(function(u){return _t(n,u)&&0===r?gm(t,n,r,tm,o):mm(t,e,u,0,o,i-1)}),(function(u){return _t(n,u)&&r===Qo(u)?gm(t,n,r,Zd,o):mm(t,e,u,Qo(u),o,i-1)}))}))},gm=function(t,e,n,r,o){return om(t,e,n).bind((function(e){return hm(t,o,r(e,fm.getJumpSize()))}))},hm=function(t,e,n){var r=wt().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(t,n):r.isIE()?e.ieRetry(t,n):O.none()},pm=function(t,e,n,r,o){return om(t,n,r).bind((function(e){return hm(t,o,e)}))},vm=function(t,e){return Se(t,(function(t){return oe(t).exists((function(t){return _t(t,e)}))}),n).isSome();var n},bm=function(t,e,n,r,o){return Te(r,"td,th",e).bind((function(r){return Te(r,"table",e).bind((function(i){return vm(o,i)?function(t,e,n){return dm(t,e,n).bind((function(r){return mm(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()}))}))},ym=function(t,e,n,r,o,i){return wt().browser.isIE()?O.none():i(r,e).orThunk((function(){return bm(t,e,n,r,o).map((function(t){var e=t.range;return Od(O.some(Ed(e.start,e.soffset,e.finish,e.foffset)),!0)}))}))},wm=function(t,e){return Te(t,"tr",e).bind((function(t){return Te(t,"table",e).bind((function(n){var r=xe(n,"tr");return _t(t,r[0])?function(t,e,n){return Fd(jd,t,e,n)}(n,(function(t){return ni(t).isSome()}),e).map((function(t){var e=Qo(t);return Od(O.some(Ed(t,e,t,e)),!0)})):O.none()}))}))},xm=function(t,e){return Te(t,"tr",e).bind((function(t){return Te(t,"table",e).bind((function(n){var r=xe(n,"tr");return _t(t,r[r.length-1])?function(t,e,n){return Vd(jd,t,e,n)}(n,(function(t){return ei(t).isSome()}),e).map((function(t){return Od(O.some(Ed(t,0,t,0)),!0)})):O.none()}))}))},Cm=function(t,e,n,r,o,i,u){return bm(t,n,r,o,i).bind((function(t){return Ad(e,n,t.start,t.finish,u)}))},Sm=function(t,e){return Te(t,"td,th",e)},km={traverse:ae,gather:Wd,relative:Rf.before,otherRetry:fm.tryDown,ieRetry:fm.ieTryDown,failure:$d.failedDown},Om={traverse:ue,gather:Ud,relative:Rf.before,otherRetry:fm.tryUp,ieRetry:fm.ieTryUp,failure:$d.failedUp},_m=function(t){return function(e){return e===t}},Tm=_m(38),Em=_m(40),Am=function(t){return t>=37&&t<=40},Dm={isBackward:_m(37),isForward:_m(39)},Mm={isBackward:_m(39),isForward:_m(37)},Rm=function(t){return{elementFromPoint:function(e,n){return Ct.fromPoint(Ct.fromDom(t.document),e,n)},getRect:function(t){return t.dom.getBoundingClientRect()},getRangedRect:function(e,n,r,o){var i=zf.exact(e,n,r,o);return bd(t,i)},getSelection:function(){return vd(t).map((function(e){return Td(t,e)}))},fromSitus:function(e){var n=zf.relative(e.start,e.finish);return Td(t,n)},situsFromPoint:function(e,n){return yd(t,e,n).map((function(t){return _d(t.start,t.soffset,t.finish,t.foffset)}))},clearSelection:function(){!function(t){ad(t).each((function(t){return t.removeAllRanges()}))}(t)},collapseSelection:function(e){void 0===e&&(e=!1),vd(t).each((function(n){return n.fold((function(t){return t.collapse(e)}),(function(n,r){var o=e?n:r;dd(t,o,o)}),(function(n,r,o,i){var u=e?n:o,a=e?r:i;fd(t,u,a,u,a)}))}))},setSelection:function(e){fd(t,e.start,e.soffset,e.finish,e.foffset)},setRelativeSelection:function(e,n){dd(t,e,n)},selectNode:function(e){pd(t,e,!1)},selectContents:function(e){pd(t,e)},getInnerHeight:function(){return t.innerHeight},getScrollY:function(){var e,n,r,o;return(e=Ct.fromDom(t.document),n=void 0!==e?e.dom:document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop,Kr(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,Ct.fromDom(t.document))}}},Nm=function(t,e){return{rows:t,cols:e}},zm=function(t,e,n,r){var o=function(t,e,n,r){var o=Il(),i=o.clear,u=function(i){o.on((function(o){r.clearBeforeUpdate(e),Sm(i.target,n).each((function(u){sr(o,u,n).each((function(n){var o=n.boxes.getOr([]);if(1===o.length){var a=o[0],c="false"===Hu(a),s=Be(Iu(i.target),a,_t);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),Sm(t.target,n).each(o.set)},mouseover:function(t){u(t)},mouseup:function(t){u(t),i()}}}(Rm(t),e,n,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},Bm=function(t,e,n,r){var o=Rm(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 lr(e,r.selectedSelector).fold((function(){return Am(d)&&!m&&r.clearBeforeUpdate(e),Em(d)&&m?p(Cm,o,e,n,km,c,u,r.selectRange):Tm(d)&&m?p(Cm,o,e,n,Om,c,u,r.selectRange):Em(d)?p(ym,o,n,km,c,u,xm):Tm(d)?p(ym,o,n,Om,c,u,wm):O.none}),(function(t){var n=function(n){return function(){return X(n,(function(n){return function(t,e,n,r,o){return dr(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 fr(e,r.firstSelectedSelector,r.lastSelectedSelector).map((function(t){var n=Em(d)||l.isForward(d)?Rf.after:Rf.before;return o.setRelativeSelection(Rf.on(t.first,0),n(t.table)),r.clear(e),Od(O.none(),!0)}))}),(function(t){return O.some(Od(O.none(),!0))}))}};return Em(d)&&m?n([Nm(1,0)]):Tm(d)&&m?n([Nm(-1,0)]):l.isBackward(d)&&m?n([Nm(0,-1),Nm(-1,0)]):l.isForward(d)&&m?n([Nm(0,1),Nm(1,0)]):Am(d)&&!m?i:O.none}))()},keyup:function(t,o,i,u,a){return lr(e,r.selectedSelector).fold((function(){var c=t.raw,s=c.which;return!0===c.shiftKey&&Am(s)?function(t,e,n,r,o,i,u){return _t(n,o)&&r===i?O.none():Te(n,"td,th",e).bind((function(n){return Te(o,"td,th",e).bind((function(r){return Ad(t,e,n,r,u)}))}))}(e,n,o,i,u,a,r.selectRange):O.none()}),O.none)}}},Pm=function(t,e,n){var r=function(e){Ne(e,t.selected),Ne(e,t.firstSelected),Ne(e,t.lastSelected)},o=function(e){Ae(e,t.selected,"1")},i=function(t){u(t),n()},u=function(e){var n=xe(e,t.selectedSelector+","+t.firstSelectedSelector+","+t.lastSelectedSelector);N(n,r)};return{clearBeforeUpdate:u,clear:i,selectRange:function(n,r,u,a){i(n),N(r,o),Ae(u,t.firstSelected,"1"),Ae(a,t.lastSelected,"1"),e(r,u,a)},selectedSelector:t.selectedSelector,firstSelectedSelector:t.firstSelectedSelector,lastSelectedSelector:t.lastSelectedSelector}},Im=function(t,e,n){var r=Tn.fromTable(t);return Oc(r,e).map((function(t){var e=yc(r,n,!1);return{upOrLeftCells:function(t,e){var n=t.slice(0,e[e.length-1].row+1),r=wc(n);return V(r,(function(t){var n=t.cells.slice(0,e[e.length-1].column+1);return R(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=wc(n);return V(r,(function(t){var n=t.cells.slice(e[0].column+e[0].colspan-1,t.cells.length);return R(n,(function(t){return t.element}))}))}(e,t)}}))},Lm=tinymce.util.Tools.resolve("tinymce.Env"),Hm=function(t){return!1===Ru(Ct.fromDom(t.target),"ephox-snooker-resizer-bar")};function Fm(t,e,n){var r=Pm(ki,(function(e,r,o){n.targets().each((function(n){un(r).each((function(i){var u=za(t),a=fi(d,Ct.fromDom(t.getDoc()),u),c=Im(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=gi(t),u=vi(t),a=zm(o,i,u,r),c=Bm(o,i,u,r),s=function(t,e,n,r){var o=Rm(t);return function(t,i){r.clearBeforeUpdate(e),sr(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=zf.relative(e.start,e.finish),r=Wf(o,n);t.selection.setRng(r)})))},g=function(t){return 0===t.button},h=(l=Bl(Ct.fromDom(i)),f=Bl(0),{touchEnd:function(t){var e=Ct.fromDom(t.target);if("td"===$t(e)||"th"===$t(e)){var n=l.get(),r=f.get();_t(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)&&Hm(t)&&a.mousedown(Tu(t))})),t.on("mouseover",(function(t){var e;(void 0===(e=t).buttons||Lm.browser.isEdge()&&0===e.buttons||0!=(1&e.buttons))&&Hm(t)&&a.mouseover(Tu(t))})),t.on("mouseup",(function(t){g(t)&&Hm(t)&&a.mouseup(Tu(t))})),t.on("touchend",h.touchEnd),t.on("keyup",(function(e){var n=Tu(e);if(n.raw.shiftKey&&Am(n.raw.which)){var r=t.selection.getRng(),o=Ct.fromDom(r.startContainer),i=Ct.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=Ct.fromDom(o.startContainer),u=Ct.fromDom(o.endContainer),a=jr(Dm,Mm)(Ct.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=Ct.fromDom(e.getStart()),o=Ct.fromDom(e.getEnd());ar(un,[n,o]).fold((function(){return r.clear(i)}),d)}))})),{clear:r.clear}}var Vm=function(t,e){var n=Bl(O.none()),r=Bl([]),o=O.none(),i=ee("caption"),u=function(t){return o.forall((function(e){return!e[t]}))},a=function(){return Ti(function(t){return Ct.fromDom(t.selection.getEnd())}(t),vi(t))},c=function(){return Ti(wi(t),vi(t)).bind((function(t){return Ie(un(t),a().bind(un),(function(n,r){return _t(n,r)?i(t)?O.some(function(t){return{element:t,mergable:O.none(),unmergable:O.none(),selection:[t]}}(t)):O.some(Oi(e,n,t)):O.none()})).bind(g)}))},s=function(t){return un(t.element).map((function(e){var n=Tn.fromTable(e),r=Oc(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:Ec(n,t).isSome(),unmergeable:Ac(n,t).isSome(),locked:o}}))},l=function(){n.set(J(c)()),o=n.get().bind(s),N(r.get(),(function(t){return t()}))},f=function(t){return t(),r.set(r.get().concat([t])),function(){r.set(B(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 un(e.element,vi(t)).exists((function(t){return Oe(t,"caption").isSome()}))}))},onSetupTableRowHeaders:v,onSetupTableColumnHeaders:b,targets:n.get}},jm=function(t){var e=function(t,e,n){return{get:function(){return mr(t(),n).fold((function(){return e().fold(br,wr)}),(function(t){return yr(t)}))}}}((function(){return gi(t)}),(function(){return Ei(wi(t),vi(t))}),ki.selectedSelector),n=Vm(t,e),r=Wa(t),o=Fm(t,r.lazyResize,n),i=ul(t,o,r.lazyWire),u=function(){var t=Il(),e=Il();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 Cf(t,i,0,e,u),function(t,e,n){var r=vi(t),o=function(e){return Ei(wi(t)).bind((function(t){return un(t,r).map((function(r){var o=Oi(n,r,t);return e(r,o)}))})).getOr("")};Rt({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),Di(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"===$t(t.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}});var f=Ul(Oa(t));0!==f.length&&t.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return Vl(t,e,f,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)}))},onSetup:n.onSetupTable});var d=Ul(ka(t));0!==d.length&&t.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return Vl(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 Vl(t,e,Sl,"tablecellverticalalign",jl(t,"vertical-align"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return Vl(t,e,pa(t),"tablecellborderwidth",jl(t,"border-width"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return Vl(t,e,va(t),"tablecellborderstyle",jl(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 ql(t,Ba(t),"background-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return ql(t,Pa(t),"border-color")},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleMenuItem("tablerowheader",{text:"Row header",icon:"table-top-header",onAction:Gl(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleMenuItem("tablecolheader",{text:"Column header",icon:"table-left-header",onAction:$l(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=Ul(Oa(t));0!==i.length&&t.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Wl(t,e,i,"tableclass",(function(e){return t.execCommand("mceTableToggleClass",!1,e)})),onSetup:n.onSetupTable});var u=Ul(ka(t));0!==u.length&&t.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Wl(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:Wl(t,e,Sl,"tablecellverticalalign",jl(t,"vertical-align")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Wl(t,e,pa(t),"tablecellborderwidth",jl(t,"border-width")),onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Wl(t,e,va(t),"tablecellborderstyle",jl(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(ql(t,Ba(t),"background-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(e){return e(ql(t,Pa(t),"border-color"))},onSetup:n.onSetupCellOrRow}),t.ui.registry.addToggleButton("tablerowheader",{tooltip:"Row header",icon:"table-top-header",onAction:Gl(t),onSetup:n.onSetupTableRowHeaders}),t.ui.registry.addToggleButton("tablecolheader",{tooltip:"Column header",icon:"table-left-header",onAction:$l(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(ki.firstSelected),t.serializer.addTempAttr(ki.lastSelected),function(t){t.formatter.register(Of)}(t)})),function(t){return t.getParam("table_tab_navigation",!0,"boolean")}(t)&&t.on("keydown",(function(e){!function(t,e,n){if(t.keyCode===wd.TAB){var r=gi(e),o=function(t){var e=$t(t);return _t(t,r)||A(kd,e)},i=e.selection.getRng(),u=Ct.fromDom(t.shiftKey?i.startContainer:i.endContainer);nn(u,o).each((function(r){t.preventDefault(),un(r,o).each(n.clear),e.selection.collapse(t.shiftKey),(t.shiftKey?Cd:xd)(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:hl(t),setClipboardRows:gl(e.setRows),getClipboardRows:ml(e.getRows),setClipboardCols:gl(e.setColumns),getClipboardCols:ml(e.getColumns),resizeHandler:n,selectionTargets:r}}(t,u,r,n)};xr.add("table",jm)}()},622: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,_=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)})),{}},T=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,R=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)},N=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 N(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return N(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return N(n)},fromDom:N,fromPoint:function(t,e,n){return S.from(t.dom.elementFromPoint(e,n)).map(N)}},B=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),P=tinymce.util.Tools.resolve("tinymce.util.Promise"),I=tinymce.util.Tools.resolve("tinymce.util.URI"),L=tinymce.util.Tools.resolve("tinymce.util.XHR"),H=function(t){return t.getParam("image_dimensions",!0,"boolean")},F=function(t,e){return Math.max(parseInt(t,10),parseInt(e,10))},V=function(t){return t&&(t=t.replace(/px$/,"")),t},j=function(t){return t.length>0&&/^[0-9]+$/.test(t)&&(t+="px"),t},U=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},W=function(t){return"IMG"===t.nodeName&&(t.hasAttribute("data-mce-object")||t.hasAttribute("data-mce-placeholder"))},q=function(t,e){return I.isDomSafe(e,"img",t.settings)},G=B.DOM,$=function(t){return t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight?V(t.style.marginLeft):""},X=function(t){return t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom?V(t.style.marginTop):""},K=function(t){return t.style.borderWidth?V(t.style.borderWidth):""},Y=function(t,e){return t.hasAttribute(e)?t.getAttribute(e):""},J=function(t,e){return t.style[e]?t.style[e]:""},Q=function(t){return null!==t.parentNode&&"FIGURE"===t.parentNode.nodeName},Z=function(t,e,n){""===n?t.removeAttribute(e):t.setAttribute(e,n)},tt=function(t){Q(t)?function(t){var e=t.parentNode;G.insertAfter(t,e),G.remove(e)}(t):function(t){var e=G.create("figure",{class:"image"});G.insertAfter(e,t),e.appendChild(t),e.appendChild(G.create("figcaption",{contentEditable:"true"},"Caption")),e.contentEditable="false"}(t)},et=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")},nt=function(t,e){return function(t,n,r){t.style[n]?(t.style[n]=j(r),et(t,e)):Z(t,n,r)}},rt=function(t,e){return t.style[e]?V(t.style[e]):Y(t,e)},ot=function(t,e){var n=j(e);t.style.marginLeft=n,t.style.marginRight=n},it=function(t,e){var n=j(e);t.style.marginTop=n,t.style.marginBottom=n},ut=function(t,e){var n=j(e);t.style.borderWidth=n},at=function(t,e){t.style.borderStyle=e},ct=function(t){return"FIGURE"===t.nodeName},st=function(t){return 0===G.getAttrib(t,"alt").length&&"presentation"===G.getAttrib(t,"role")},lt=function(t){return st(t)?"":Y(t,"alt")},ft=function(t,e){var n=document.createElement("img");return Z(n,"style",e.style),($(n)||""!==e.hspace)&&ot(n,e.hspace),(X(n)||""!==e.vspace)&&it(n,e.vspace),(K(n)||""!==e.border)&&ut(n,e.border),(function(t){return J(t,"borderStyle")}(n)||""!==e.borderStyle)&&at(n,e.borderStyle),t(n.getAttribute("style"))},dt=function(t,e){return{src:Y(e,"src"),alt:lt(e),title:Y(e,"title"),width:rt(e,"width"),height:rt(e,"height"),class:Y(e,"class"),style:t(Y(e,"style")),caption:Q(e),hspace:$(e),vspace:X(e),border:K(e),borderStyle:J(e,"borderStyle"),isDecorative:st(e)}},mt=function(t,e,n,r,o){n[r]!==e[r]&&o(t,r,n[r])},gt=function(t,e,n){if(n){G.setAttrib(t,"role","presentation");var r=z.fromDom(t);R(r,"alt","")}else{if(l(e)){r=z.fromDom(t);o="alt",r.dom.removeAttribute(o)}else{r=z.fromDom(t);R(r,"alt",e)}"presentation"===G.getAttrib(t,"role")&&G.setAttrib(t,"role","")}var o},ht=function(t,e){return function(n,r,o){t(n,o),et(n,e)}},pt=function(t,e,n){var r=dt(t,n);mt(n,r,e,"caption",(function(t,e,n){return tt(t)})),mt(n,r,e,"src",Z),mt(n,r,e,"title",Z),mt(n,r,e,"width",nt(0,t)),mt(n,r,e,"height",nt(0,t)),mt(n,r,e,"class",Z),mt(n,r,e,"style",ht((function(t,e){return Z(t,"style",e)}),t)),mt(n,r,e,"hspace",ht(ot,t)),mt(n,r,e,"vspace",ht(it,t)),mt(n,r,e,"border",ht(ut,t)),mt(n,r,e,"borderStyle",ht(at,t)),function(t,e,n){n.alt===e.alt&&n.isDecorative===e.isDecorative||gt(t,n.alt,n.isDecorative)}(n,r,e)},vt=function(t,e){var n=t.dom.styles.parse(e),r=U(n),o=t.dom.styles.parse(t.dom.styles.serialize(r));return t.dom.styles.serialize(o)},bt=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||W(e))?null:e},yt=function(t,e){var n=t.dom,r=function(t,e){var n,r={};return _(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,T(e,n)&&void 0!==e[n]&&null!==e[n];var e,n}),t.getBody());return o?n.split(o,e):e},wt=function(t,e){var n=function(t,e){var n=document.createElement("img");if(pt(t,o(o({},e),{caption:!1}),n),gt(n,e.alt,e.isDecorative),e.caption){var r=G.create("figure",{class:"image"});return r.appendChild(n),r.appendChild(G.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}((function(e){return vt(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),ct(r)){var i=yt(t,r);t.selection.select(i)}else t.selection.select(r)},xt=function(t,e){var n=bt(t);if(pt((function(e){return vt(t,e)}),e,n),function(t,e){t.dom.setAttrib(e,"src",e.getAttribute("src"))}(t,n),ct(n.parentNode)){var r=n.parentNode;yt(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||!H(t)||t.dom.setAttribs(n,{width:String(n.clientWidth),height:String(n.clientHeight)}),r()},n.onerror=r}(t,e,n)},Ct=function(t,e){var n=bt(t);if(n){var r=dt((function(e){return vt(t,e)}),n),i=o(o({},r),e),u=function(t,e){var n=e.src;return o(o({},e),{src:q(t,n)?n:""})}(t,i);i.src?xt(t,u):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&&wt(t,o(o({},{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),e))},St=(M=function(t,e){return c(t)&&c(e)?St(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)T(o,i)&&(n[i]=M(n[i],o[i]))}return n}),kt=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Ot=tinymce.util.Tools.resolve("tinymce.util.Tools"),_t=function(t){return a(t.value)?t.value:""},Tt=function(t,e){var n=[];return Ot.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=Tt(t.menu,e);n.push({text:r,items:o})}else{var i=e(t);n.push({text:r,value:i})}})),n},Et=function(t){return void 0===t&&(t=_t),function(e){return e?S.from(e).map((function(e){return Tt(e,t)})):S.none()}},At=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(t,"items")}(t)?At(t.items,e):t.value===e?S.some(t):S.none()}))},Dt=Et,Mt=function(t){return Et(_t)(t)},Rt=function(t,e){return t.bind((function(t){return At(t,e)}))},Nt=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"}]}]}]}},zt=function(t){var e=Dt((function(e){return t.convertURL(e.value||e.url,"src")})),n=new P((function(n){!function(t,e){var n=function(t){return t.getParam("image_list",!1)}(t);a(n)?L.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=Mt(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=bt(t);return e?dt((function(e){return vt(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=H(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}}))},Bt=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"}]}]:[]])})]])},Pt=function(t){return{title:"General",name:"general",items:Bt(t)}},It=Bt,Lt=function(t){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},Ht=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}},Ft=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}},Vt=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}})}))},jt=function(t,e){var n=e.getData(),r=n.src.meta;if(void 0!==r){var o=St({},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)&&Rt(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)}},Ut=function(t,e,n,r){Vt(e,r),jt(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=Rt(t.imageList,r.src.value);e.prevImage=o,n.setData({images:o.map((function(t){return t.value})).getOr("")})}(e,n,r)},Wt=function(t,e,n){var r=U(t(n.style)),o=St({},n);return o.vspace=function(t){return t["margin-top"]&&t["margin-bottom"]&&t["margin-top"]===t["margin-bottom"]?V(String(t["margin-top"])):""}(r),o.hspace=function(t){return t["margin-right"]&&t["margin-left"]&&t["margin-right"]===t["margin-left"]?V(String(t["margin-right"])):""}(r),o.border=function(t){return t["border-width"]?V(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},qt=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"),Ut(t,e,n,r)};(i=o,new P((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())}))}))},Gt=function(t,e,n){return function(r,o){"src"===o.name?Ut(t,e,n,r):"images"===o.name?function(t,e,n,r){var o=r.getData(),i=Rt(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,Ut(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=Wt(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=St(Ht(e.image),n.getData()),o=ft(t.normalizeCss,Ft(r,!1));n.setData({style:o})}(t,e,r):"fileinput"===o.name?qt(t,e,n,r):"isDecorative"===o.name&&(r.getData().isDecorative?r.disable("alt"):r.enable("alt"))}},$t=function(t){return function(){t.open=!1}},Xt=function(t){return t.hasAdvTab||t.hasUploadUrl||t.hasUploadHandler?{type:"tabpanel",tabs:A([[Pt(t)],t.hasAdvTab?[Nt(t)]:[],t.hasUploadTab&&(t.hasUploadUrl||t.hasUploadHandler)?[Lt(t)]:[]])}:{type:"panel",items:It(t)}},Kt=function(t){return function(e){var n=function(t){return{prevImage:Rt(t.imageList,t.image.src),prevAlt:t.image.alt,open:!0}}(e);return{title:"Insert/Edit Image",size:"normal",body:Xt(e),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Ht(e.image),onSubmit:t.onSubmit(e),onChange:Gt(t,e,n),onClose:$t(n)}}},Yt=function(t){return function(e){return function(n){var r=St(Ht(e.image),n.getData());t.execCommand("mceUpdateImage",!1,Ft(r,e.hasAccessibilityOptions)),t.editorUpload.uploadImagesAuto(),n.close()}}},Jt=function(t){return function(e){return q(t,e)?function(t){return new P((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:F(n.width,n.clientWidth),height:F(n.height,n.clientHeight)};r(P.resolve(t))},n.onerror=function(){r(P.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)}})):P.resolve({width:"",height:""})}},Qt=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]})}},Zt=function(t){return function(e){t.editorUpload.blobCache.add(e)}},te=function(t){return function(e){t.windowManager.alert(e)}},ee=function(t){return function(e){return vt(t,e)}},ne=function(t){return function(e){return t.dom.parseStyle(e)}},re=function(t){return function(e,n){return t.dom.serializeStyle(e,n)}},oe=function(t){return function(e){return kt(t).upload([e],!1).then((function(t){return 0===t.length?P.reject("Failed to upload image"):!1===t[0].status?P.reject(t[0].error.message):t[0]}))}},ie=function(t){var e={onSubmit:Yt(t),imageSize:Jt(t),addToBlobCache:Zt(t),createBlobCache:Qt(t),alertErr:te(t),normalizeCss:ee(t),parseStyle:ne(t),serializeStyle:re(t),uploadImage:oe(t)};return{open:function(){zt(t).then(Kt(e)).then(t.windowManager.open)}}},ue=function(t){var e=t.attr("class");return e&&/\bimage\b/.test(e)},ae=function(t){return function(e){for(var n=e.length,r=function(e){e.attr("contenteditable",t?"true":null)};n--;){var o=e[n];ue(o)&&(o.attr("contenteditable",t?"false":null),Ot.each(o.getAll("figcaption"),r))}}};r.add("image",(function(t){!function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("figure",ae(!0)),t.serializer.addNodeFilter("figure",ae(!1))}))}(t),function(t){t.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ie(t).open,onSetup:function(e){return e.setActive(d(bt(t))),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:ie(t).open}),t.ui.registry.addContextMenu("image",{update:function(t){return ct(t)||"IMG"===t.nodeName&&!W(t)?["image"]:[]}})}(t),function(t){t.addCommand("mceImage",ie(t).open),t.addCommand("mceUpdateImage",(function(e,n){t.undoManager.transact((function(){return Ct(t,n)}))}))}(t)}))}()},623:function(t,e,n){(function(t){!function(){"use strict";var e,n,r,o=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=(e="array",function(t){return r=typeof(n=t),(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)===e;var n,r}),c=function(t){return!function(t){return null==t}(t)},s=function(t){return function(e){return typeof e===t}}("function"),l=function(){},f=function(t){return function(){return t}},d=function(t){return t},m=f(!1),g=f(!0),h=function(){return p},p={fold:function(t,e){return t()},isSome:m,isNone:g,getOr:r=d,getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(void 0),or:r,orThunk:n,map:h,each:l,bind:h,exists:m,forall:g,filter:function(){return h()},toArray:function(){return[]},toString:f("none()")},v=function(t){var e=f(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:g,isNone:m,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return v(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:p},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},b={some:v,none:h,from:function(t){return null==t?p:v(t)}},y={},w={exports:y};!function(e,n,r,o){!function(t,o){"object"==typeof n&&void 0!==r?r.exports=o():"function"==typeof e&&e.amd?e(o):(t="undefined"!=typeof globalThis?globalThis:t||self).EphoxContactWrapper=o()}(this,(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},n={exports:{}};!function(t){!function(e){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._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 a(e.promise,t)}u(e.promise,r)}else(1===t._state?u:a)(e.promise,t._value)}))):t._deferreds.push(e)}function u(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 o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){a(t,e)}var r,i}function a(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,a(e,t))}))}catch(t){if(n)return;n=!0,a(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((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])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},t.exports?t.exports=o:e.Promise||(e.Promise=o)}(e)}(n);var r=n.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||r}}))}(void 0,y,w);var x=w.exports.boltExport,C=function(t,e){return O(document.createElement("canvas"),t,e)},S=function(t){var e=C(t.width,t.height);return k(e).drawImage(t,0,0),e},k=function(t){return t.getContext("2d")},O=function(t,e,n){return t.width=e,t.height=n,t},_=function(t){return new x((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=function(t){return new x((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()}))},E=function(t){return new x((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)}))},A=function(t,e,n){return e=e||"image/png",s(HTMLCanvasElement.prototype.toBlob)?new x((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):E(t.toDataURL(e,n))},D=function(t){URL.revokeObjectURL(t.src)},M=function(t){return function(t){var e=t.src;return 0===e.indexOf("data:")?E(e):T(e)}(t)},R=Array.prototype.indexOf,N=function(t,e){return n=t,r=e,R.call(n,r)>-1;var n,r},z=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},B=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,m)},P=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},I=Object.keys;(function(t){if(!a(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={};z(t,(function(r,o){var i=I(r);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],c=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(!a(c))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!==c.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+c.length+" ("+c+"), got "+i);var a=function(t){var r=I(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!P(e,(function(t){return N(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:a,log:function(t){console.log(t,{constructors:e,constructor:u,params:n})}}}}))})([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var L=function(t,e,n){var r=e.type,o=f(r),i=f(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 x.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return A(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(S)}}},H=function(t){return function(t){return new x((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return L(function(t){return _(t).then((function(t){D(t);var e=C(function(t){return t.naturalWidth||t.width}(t),function(t){return t.naturalHeight||t.height}(t));return k(e).drawImage(t,0,0),e}))}(t),t,e)}))},F=function(t,e){return A(t,e).then((function(e){return L(x.resolve(t),e,t.toDataURL())}))},V=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},j=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=V(Math.abs(o*a)+Math.abs(i*u)),s=V(Math.abs(o*u)+Math.abs(i*a)),l=C(c,s),f=k(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),F(l,e)},U=function(t,e,n){var r=C(t.width,t.height),o=k(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),F(r,e)},W=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return U(n,t.getType(),e)}))}(t,e)},q=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return j(n,t.getType(),e)}))}(t,e)},G=function(t,e,n){return void 0===n&&(n=!1),new x((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=I(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()}))},$=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],X=[{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."}],K=function(t,e){var n,r,o=(n=function(t,e){return c(t)?t[e]:void 0},r=t,z(e,(function(t,e){r=n(r,t,e)})),r);return b.from(o)},Y=function(t){var e=function(t){return"ImageProxy HTTP error: "+B($,(function(e){return t===e.code})).fold(f("Unknown ImageProxy error"),(function(t){return t.message}))}(t);return x.reject(e)},J=function(t){return B(X,(function(e){return e.type===t})).fold(f("Unknown service error"),(function(t){return t.message}))},Q=function(t){return"ImageProxy Service error: "+function(t){try{return b.some(JSON.parse(t))}catch(t){return b.none()}}(t).bind((function(t){return K(t,["error","type"]).map(J)})).getOr("Invalid JSON in service error message")},Z=function(t){return function(t){return new x((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=Q(t);return x.reject(e)}))},tt=function(t){return t<200||t>=300},et=function(t,e){var n={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return G(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 tt(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)?Z(n):Y(e)):x.resolve(t.blob);var e,n}))},nt=function(t,e,n){return void 0===n&&(n=!1),e?et(t,e):function(t,e){return G(t,{},e).then((function(t){return tt(t.status)?Y(t.status):x.resolve(t.blob)}))}(t,n)},rt=function(t){return H(t)},ot=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},it={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 ot(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return ot(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return ot(n)},fromDom:ot,fromPoint:function(t,e,n){return b.from(t.dom.elementFromPoint(e,n)).map(ot)}};"undefined"!=typeof window?window:Function("return this;")();var ut=function(t,e){return function(t,e){return B(t.dom.childNodes,(function(t){return e(it.fromDom(t))})).map(it.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)}))},at=tinymce.util.Tools.resolve("tinymce.util.Delay"),ct=tinymce.util.Tools.resolve("tinymce.util.Promise"),st=tinymce.util.Tools.resolve("tinymce.util.URI"),lt=function(t){return t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions")},ft=function(t){return t.getParam("imagetools_proxy")},dt=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)},mt=function(t){return{w:t.naturalWidth,h:t.naturalHeight}},gt=0,ht=function(t){return ut(it.fromDom(t),"img")},pt=function(t,e){return t.dom.is(e,"figure")},vt=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")},bt=function(t,e){var n=function(e){return vt(t,e)&&(Ct(t,e)||St(t,e)||c(ft(t)))};return pt(t,e)?ht(e).bind((function(t){return n(t.dom)?b.some(t.dom):b.none()})):n(e)?b.some(e):b.none()},yt=function(t,e){t.notificationManager.open({text:e,type:"error"})},wt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&pt(t,n)?ht(n):vt(t,e)?b.some(it.fromDom(e)):b.none()},xt=function(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return c(r)?t.dom.encode(r[n]):null},Ct=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new st(n).host===t.documentBaseURI.host},St=function(t,e){return-1!==u.inArray(function(t){return t.getParam("imagetools_cors_hosts",[],"string[]")}(t),new st(e.src).host)},kt=function(t,e){if(St(t,e))return nt(e.src,null,function(t,e){return-1!==u.inArray(function(t){return t.getParam("imagetools_credentials_hosts",[],"string[]")}(t),new st(e.src).host)}(t,e));if(!Ct(t,e)){var n=ft(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 nt(r,o,!1)}return M(e)},Ot=function(t,e){return function(t){return b.from(t.getParam("imagetools_fetch_image",null,"function"))}(t).fold((function(){return kt(t,e)}),(function(t){return t(e)}))},_t=function(t,e){var n=t.editorUpload.blobCache.getByUri(e.src);return n?ct.resolve(n.blob()):Ot(t,e)},Tt=function(t){at.clearTimeout(t.get())},Et=function(t,e,n,r,o,i,u){return n.toBlob().then((function(a){var s,l,f,d,m=t.editorUpload.blobCache;s=i.src;var g=e.type===a.type;return function(t){return t.getParam("images_reuse_filename",!1,"boolean")}(t)&&(d=m.getByUri(s),c(d)?(s=d.uri(),l=d.name(),f=d.filename()):(l=xt(t,s,2),f=xt(t,s,1))),d=m.create({id:"imagetools"+gt++,blob:a,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():(Tt(o),function(t,e){var n=at.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}))},At=function(t,e,n,r){return function(){return wt(t).fold((function(){yt(t,"Could not find selected image")}),(function(o){return t._scanForImages().then((function(){return _t(t,o.dom)})).then((function(i){return rt(i).then(n).then((function(n){return Et(t,i,n,!1,e,o.dom,r)}))})).catch((function(e){yt(t,e)}))}))}},Dt=function(t,e,n){return function(){var r=wt(t).map((function(t){var e=dt(t.dom);return e?{w:e.h,h:e.w}:null})).getOrNull();return At(t,e,(function(t){return q(t,n)}),r)()}},Mt=function(t,e,n){return function(){return At(t,e,(function(t){return W(t,n)}))()}},Rt=function(t,e,n,r,o){return function(t){return _(t)}(o).then((function(t){var e=mt(t);return r.w===e.w&&r.h===e.h||dt(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(rt).then((function(r){return Et(t,o,r,!0,e,n)}))},Nt=function(t,e){return function(){var n=wt(t),r=n.map((function(t){return mt(t.dom)}));n.each((function(o){bt(t,o.dom).each((function(i){_t(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){Rt(t,e,n.dom,r,i)}))})),o.close()},onCancel:l,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")}}})}))}))}))}};i.add("imagetools",(function(t){var e=o(0),n=o(null);!function(t,e){u.each({mceImageRotateLeft:Dt(t,e,-90),mceImageRotateRight:Dt(t,e,90),mceImageFlipVertical:Mt(t,e,"v"),mceImageFlipHorizontal:Mt(t,e,"h"),mceEditImage:Nt(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 wt(t).exists((function(e){return bt(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();z(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 bt(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:lt(t),predicate:function(e){return bt(t,e).isSome()},position:"node",scope:"node"})}(t),function(t,e,n){t.on("NodeChange",(function(r){var o=n.get(),i=bt(t,r.element);o&&!i.exists((function(t){return o.src===t.src}))&&(Tt(e),t.editorUpload.uploadImagesAuto(),n.set(null)),i.each(n.set)}))}(t,e,n)}))}()}).call(this,n(26))},624: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},_=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))},T=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},R=function(t){return t.getParam("default_link_target")},N=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")},P=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},I=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=tinymce.util.Tools.resolve("tinymce.util.URI"),Y=function(t){return t&&"a"===t.nodeName.toLowerCase()},J=function(t){return Y(t)&&!!tt(t)},Q=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},Z=function(t){return/^\w+:/i.test(t)},tt=function(t){var e=t.getAttribute("data-mce-href");return e||t.getAttribute("href")},et=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):""},nt=function(t,e){return e=e||t.selection.getNode(),ut(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},rt=function(t,e){return function(t){return t.replace(/\uFEFF/g,"")}(e?e.innerText||e.textContent:t.getContent({format:"text"}))},ot=function(t){return L.grep(t,J).length>0},it=function(t){var e=t.schema.getTextInlineElements();return 0===Q(t.selection.getRng(),(function(t){return 1===t.nodeType&&!Y(t)&&!$(e,t.nodeName.toLowerCase())})).length},ut=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},at=function(t,e){var n=U({},e);if(!(z(t).length>0)&&!1===P(t)){var r=et(n.rel,"_blank"===n.target);n.rel=r||null}return x.from(n.target).isNone()&&!1===N(t)&&(n.target=R(t)),n.href=function(t,e){return"http"!==e&&"https"!==e||Z(t)?t:e+"://"+t}(n.href,M(t)),n},ct=function(t,e,n){var r=t.selection.getNode(),o=nt(t,r),i=at(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){ut(e)?mt(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)}))},st=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)}))},lt=function(t,e,n){var r=function(t,e){var n=e.href;return U(U({},e),{href:K.isDomSafe(n,"a",t.settings)?n:""})}(t,n);t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,st(r)):ct(t,e,r)},ft=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var e=t.selection.getNode();ut(e)?dt(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)},dt=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))}},mt=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)}},gt=function(t){return $(e=t,n="items")&&void 0!==e[n]&&null!==e[n];var e,n},ht=function(t,e){return T(e,(function(e){return gt(e)?ht(t,e.items):D(e.value===t,e)}))},pt=function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?ht(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()},vt=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 pt(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()}}},bt=tinymce.util.Tools.resolve("tinymce.util.Delay"),yt=tinymce.util.Tools.resolve("tinymce.util.Promise"),wt=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()},xt=function(t,e){return function(n){var r=n.href;return 1===t&&!Z(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()}},Ct=function(t,e){return T([wt,xt(M(t),I(t))],(function(t){return t(e)})).fold((function(){return yt.resolve(e)}),(function(n){return new yt((function(r){!function(t,e,n){var r=t.selection.getRng();bt.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)}))}))}))},St=function(t){var e=t.dom.select("a:not([href])"),n=_(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()},kt=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?j.sanitize(e):x.none()},Ot=tinymce.util.Tools.resolve("tinymce.util.XHR"),_t=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 yt((function(t){a(n)?Ot.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===P(t)?j.sanitizeWith((function(t){return et(j.getValue(t),r)})):j.sanitize)(n)}return x.none()},Et=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],At=function(t){var e=N(t);return c(e)?j.sanitize(e).orThunk((function(){return x.some(Et)})):!1===e?x.none():x.some(Et)},Dt=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?x.some(r):x.none()},Mt=function(t,e){return _t(t).then((function(n){var r=function(t,e){var n=t.dom,r=it(t)?x.some(rt(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=Dt(n,e,"rel"),a=Dt(n,e,"class");return{url:o,text:r,title:Dt(n,e,"title"),target:i,rel:u,linkClass:a}}(t,e);return{anchor:r,catalogs:{targets:At(t),rels:Tt(t,r.target),classes:kt(t),anchor:St(t),link:n},optNode:x.from(e),flags:{titleEnabled:B(t)}}}))},Rt=function(t){(function(t){var e=nt(t);return Mt(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(R(n))),u=t.catalogs,a=vt(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 ft(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};Ct(t,i).then((function(e){lt(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)},zt=function(t,e){return t.dom.getParent(e,"a[href]")},Bt=function(t){return zt(t,t.selection.getStart())},Pt=function(t,e){if(e){var n=tt(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(){Rt(t)}},Lt=function(t){return function(){Pt(t,Bt(t))}},Ht=function(t,e){return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}},Ft=function(t){return function(e){var n=function(){return e.setActive(!t.mode.isReadOnly()&&null!==nt(t,t.selection.getNode()))};return n(),Ht(t,n)}},Vt=function(t){return function(e){var n=function(){return e.setDisabled(null===nt(t,t.selection.getNode()))};return n(),Ht(t,n)}},jt=function(t){return function(e){var n=function(e){return ot(e)||(n=t.selection.getRng(),Q(n,J).length>0);var n},r=t.dom.getParents(t.selection.getStart());return e.setDisabled(!n(r)),Ht(t,(function(t){return e.setDisabled(!n(t.parents))}))}},Ut=function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!nt(t,n)),d};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Ft(t)},label:"Link",predicate:function(e){return!!nt(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=nt(t);return e?tt(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!nt(t,n)),Ft(t)(e)},onAction:function(e){var n=e.getValue(),r=function(e){var n=nt(t),r=it(t);if(!n&&r){var o=rt(t.selection,n);return x.some(o.length>0?o:e)}return x.none()}(n);lt(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){ft(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){Lt(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:Ft(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Lt(t),onSetup:Vt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return ft(t)},onSetup:jt(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Lt(t),onSetup:Vt(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 ft(t)},onSetup:jt(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(e){return ot(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})}(t),Ut(t),function(t){t.on("click",(function(e){var n=zt(t,e.target);n&&o.metaKeyPressed(e)&&(e.preventDefault(),Pt(t,n))})),t.on("keydown",(function(e){var n=Bt(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),Pt(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)}))}()},625: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)}))}()},626:function(t,e){!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("contextmenu",(function(){}))}()},627: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},_=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},T=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,R,N,z,B=(M=3,function(t){return function(t){return t.dom.nodeType}(t)===M}),P=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)},I=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 I(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return I(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return I(n)},fromDom:I,fromPoint:function(t,e,n){return w.from(t.dom.elementFromPoint(e,n)).map(I)}},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=(R=B,N="text",{get:function(t){if(!R(t))throw new Error("Can only get "+N+" value of a "+N+" node");return z(t).getOr("")},getOption:z=function(t){return R(t)?w.from(t.dom.nodeValue):w.none()},set:function(t,e){if(!R(t))throw new Error("Can only set raw "+N+" value of a "+N+" 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,(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(t,(function(t,n){T(t,(function(t){var r=L.fromDom(e.cloneNode(!1));P(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;_(["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)}))}()},628: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)){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)}}))}()},629:function(t,e){!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("textcolor",(function(){}))}()},74: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(26))},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.e11063688d1dd8dc177b.js.map