;/*!node_modules/tinymce/tinymce.js*/ amis.define("node_modules/tinymce/tinymce",function(e,t,n){!function(e){"use strict";function t(e){for(var t=[],n=1;nt;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;n>t;t++)for(var i=arguments[t],a=0,u=i.length;u>a;a++,o++)r[o]=i[a];return r}function i(t,n){void 0===n&&(n={});var r,o=0,i={};r=n.maxLoadTime||5e3;var a=function(e){n.referrerPolicy=e},u=function(e){t.getElementsByTagName("head")[0].appendChild(e)},c=function(a,c,s){var l,f,d,h,m=function(e){h.status=e,h.passed=[],h.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},g=function(){for(var e=h.passed,t=e.length;t--;)e[t]();m(2)},p=function(){for(var e=h.failed,t=e.length;t--;)e[t]();m(3)},v=function(){var t=e.navigator.userAgent.match(/WebKit\/(\d*)/);return!!(t&&parseInt(t[1],10)<536)},y=function(e,t){e()||((new Date).getTime()-d0)return f=t.createElement("style"),f.textContent='@import "'+a+'"',C(),void u(f);b()}u(l),l.href=a}},s=function(e){return ai.nu(function(t){c(e,F(t,U(di.value(e))),F(t,U(di.error(e))))})},l=function(e){return e.fold(j,j)},f=function(e,t,n){ci(gt(e,s)).get(function(e){var r=yt(e,function(e){return e.isValue()});r.fail.length>0?n(r.fail.map(l)):t(r.pass.map(l))})};return{load:c,loadAll:f,_setReferrerPolicy:a}}function a(e){var t,n,r,o,i,a,u,c,s,l,f,d,h,m={},g={},p=[],v={},y={},b=function(t,n,r){var o=e[t];return o?o=su(o,/[, ]/,su(o.toUpperCase(),/[, ]/)):(o=uu[t],o||(o=su(n," ",su(n.toUpperCase()," ")),o=fu(o,r),uu[t]=o)),o};e=e||{},r=gu(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),t=pu(e.valid_styles),n=pu(e.invalid_styles,"map"),c=pu(e.valid_classes,"map"),o=b("whitespace_elements","pre script noscript style textarea video audio iframe object code"),i=b("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=b("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=b("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=b("non_empty_elements","td th iframe video audio object script pre code",a),f=b("move_caret_before_on_enter_elements","table",l),d=b("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"),s=b("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",d),h=b("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),lu((e.special||"script noscript noframes noembed title style textarea xmp").split(" "),function(e){y[e]=new RegExp("]*>","gi")});var C=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},w=function(e){var t,n,r,o,i,a,u,c,s,l,f,d,h,g,v,y,b,w,x,E=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,z=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(e)for(e=mu(e,","),m["@"]&&(y=m["@"].attributes,b=m["@"].attributesOrder),t=0,n=e.length;n>t;t++)if(i=E.exec(e[t])){if(g=i[1],s=i[2],v=i[3],c=i[5],d={},h=[],a={attributes:d,attributesOrder:h},"#"===g&&(a.paddEmpty=!0),"-"===g&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),y){for(w in y)d[w]=y[w];h.push.apply(h,b)}if(c)for(c=mu(c,"|"),r=0,o=c.length;o>r;r++)if(i=z.exec(c[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),g=i[3],x=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){delete d[l],h.splice(hu(h,l),1);continue}g&&("="===g&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:x}),u.defaultValue=x),":"===g&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:x}),u.forcedValue=x),"<"===g&&(u.validValues=su(x,"?"))),k.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=C(l),a.attributePatterns.push(u)):(d[l]||h.push(l),d[l]=u)}y||"@"!==s||(y=d,b=h),v&&(a.outputName=s,m[v]=a),k.test(s)?(a.pattern=C(s),p.push(a)):m[s]=a}},x=function(e){m={},p=[],w(e),lu(r,function(e,t){g[t]=e.children})},E=function(e){var t=/^(~)?(.+)$/;e&&(uu.text_block_elements=uu.block_elements=null,lu(mu(e,","),function(e){var n=t.exec(e),r="~"===n[1],o=r?"span":"div",i=n[2];if(g[i]=g[o],v[i]=o,r||(s[i.toUpperCase()]={},s[i]={}),!m[i]){var a=m[o];a=fu({},a),delete a.removeEmptyAttrs,delete a.removeEmpty,m[i]=a}lu(g,function(e,t){e[o]&&(g[t]=e=fu({},g[t]),e[i]=e[o])})}))},z=function(t){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;uu[e.schema]=null,t&&lu(mu(t,","),function(e){var t,r,o=n.exec(e);o&&(r=o[1],t=r?g[o[2]]:g[o[2]]={"#comment":{}},t=g[o[2]],lu(mu(o[3],"|"),function(e){"-"===r?delete t[e]:t[e]={}}))})},k=function(e){var t,n=m[e];if(n)return n;for(t=p.length;t--;)if(n=p[t],n.pattern.test(e))return n};e.valid_elements?x(e.valid_elements):(lu(r,function(e,t){m[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},g[t]=e.children}),"html5"!==e.schema&&lu(mu("strong/b em/i"),function(e){e=mu(e,"/"),m[e[1]].outputName=e[0]}),lu(mu("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){m[e]&&(m[e].removeEmpty=!0)}),lu(mu("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){m[e].paddEmpty=!0}),lu(mu("span"),function(e){m[e].removeEmptyAttrs=!0})),E(e.custom_elements),z(e.valid_children),w(e.extended_valid_elements),z("+ol[ul|ol],+ul[ul|ol]"),lu({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(e,t){m[t]&&(m[t].parentsRequired=mu(e))}),e.invalid_elements&&lu(du(e.invalid_elements),function(e){m[e]&&delete m[e]}),k("span")||w("span[!data-mce-type|*]");var N=function(){return t},S=function(){return n},T=function(){return c},A=function(){return u},R=function(){return s},B=function(){return d},D=function(){return h},M=function(){return a},_=function(){return i},P=function(){return l},O=function(){return f},H=function(){return o},L=function(){return y},I=function(e,t){var n=g[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},V=function(e,t){var n,r,o=k(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},F=function(){return v};return{children:g,elements:m,getValidStyles:N,getValidClasses:T,getBlockElements:R,getInvalidStyles:S,getShortEndedElements:M,getTextBlockElements:B,getTextInlineElements:D,getBoolAttrs:A,getElementRule:k,getSelfClosingElements:_,getNonEmptyElements:P,getMoveCaretBeforeOnEnterElements:O,getWhiteSpaceElements:H,getSpecialElements:L,isValidChild:I,isValid:V,getCustomElements:F,addValidElements:w,setValidElements:x,addCustomElements:E,addValidChildren:z}}function u(){function e(n,r){return t.push(n+" ")>Ha.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function c(e){return e[Mu]=!0,e}function s(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||Uu)-(~e.sourceIndex||Uu);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function l(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function f(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function d(e){return c(function(t){return t=+t,c(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function h(e){return e&&typeof e.getElementsByTagName!==Fu&&e}function m(){}function g(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function p(e,t,n){var r=t.dir,o=n&&"parentNode"===r,i=Ou++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,a){var u,c,s=[Pu,i];if(a){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||o){if(c=t[Mu]||(t[Mu]={}),(u=c[r])&&u[0]===Pu&&u[1]===i)return s[2]=u[2];if(c[r]=s,s[2]=e(t,n,a))return!0}}}function v(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function y(e,t,n){for(var r=0,o=t.length;o>r;r++)vc(e,t[r],n);return n}function b(e,t,n,r,o){for(var i,a=[],u=0,c=e.length,s=null!=t;c>u;u++)(i=e[u])&&(!n||n(i,r,o))&&(a.push(i),s&&t.push(u));return a}function C(e,t,n,r,o,i){return r&&!r[Mu]&&(r=C(r)),o&&!o[Mu]&&(o=C(o,i)),c(function(i,a,u,c){var s,l,f,d=[],h=[],m=a.length,g=i||y(t||"*",u.nodeType?[u]:u,[]),p=!e||!i&&t?g:b(g,d,e,u,c),v=n?o||(i?e:m||r)?[]:a:p;if(n&&n(p,v,u,c),r)for(s=b(v,h),r(s,[],u,c),l=s.length;l--;)(f=s[l])&&(v[h[l]]=!(p[h[l]]=f));if(i){if(o||e){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?Yu.call(i,f):d[l])>-1&&(i[s]=!(a[s]=f))}}else v=b(v===a?v.splice(m,v.length):v),o?o(null,a,v,c):Ku.apply(a,v)})}function w(e){for(var t,n,r,o=e.length,i=Ha.relative[e[0].type],a=i||Ha.relative[" "],u=i?1:0,c=p(function(e){return e===t},a,!0),s=p(function(e){return Yu.call(t,e)>-1},a,!0),l=[function(e,n,r){return!i&&(r||n!==ja)||((t=n).nodeType?c(e,n,r):s(e,n,r))}];o>u;u++)if(n=Ha.relative[e[u].type])l=[p(v(l),n)];else{if(n=Ha.filter[e[u].type].apply(null,e[u].matches),n[Mu]){for(r=++u;o>r&&!Ha.relative[e[r].type];r++);return C(u>1&&v(l),u>1&&g(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(tc,"$1"),n,r>u&&w(e.slice(u,r)),o>r&&w(e=e.slice(r)),o>r&&g(e))}l.push(n)}return v(l)}function x(e,t){var n=t.length>0,r=e.length>0,o=function(o,i,a,u,c){var s,l,f,d=0,h="0",m=o&&[],g=[],p=ja,v=o||r&&Ha.find.TAG("*",c),y=Pu+=null==p?1:Math.random()||.1,C=v.length;for(c&&(ja=i!==Ka&&i);h!==C&&null!=(s=v[h]);h++){if(r&&s){for(l=0;f=e[l++];)if(f(s,i,a)){u.push(s);break}c&&(Pu=y)}n&&((s=!f&&s)&&d--,o&&m.push(s))}if(d+=h,n&&h!==d){for(l=0;f=t[l++];)f(m,g,i,a);if(o){if(d>0)for(;h--;)m[h]||g[h]||(g[h]=$u.call(u));g=b(g)}Ku.apply(u,g),c&&!o&&g.length>0&&d+t.length>1&&vc.uniqueSort(u)}return c&&(Pu=y,ja=p),m};return n?c(o):o}function E(t,n){var r=this;void 0===n&&(n={});var o,u={},c=e.window,s={},l=0,f=!0,d=!0,h=i(t,{contentCssCors:n.contentCssCors,referrerPolicy:n.referrerPolicy}),m=[],g=n.schema?n.schema:a({}),p=Cu({url_converter:n.url_converter,url_converter_scope:n.url_converter_scope},n.schema),v=n.ownEvents?new Du:Du.Event,y=g.getBlockElements(),b=Kc.overrideDefaults(function(){return{context:t,element:Dt.getRoot()}}),C=function(e){if("string"==typeof e)return!!y[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!y[e.nodeName])}return!1},w=function(e){if(e&&t&&"string"==typeof e){var n=t.getElementById(e);return n&&n.id!==e?t.getElementsByName(e)[1]:n}return e},x=function(e){return"string"==typeof e&&(e=w(e)),b(e)},z=function(e,t,n){var r,i,a=x(e);return a.length&&(r=o[t],i=r&&r.get?r.get(a,t):a.attr(t)),"undefined"==typeof i&&(i=n||""),i},k=function(e){var t=w(e);return t?t.attributes:[]},N=function(e,t,r){var i,a;""===r&&(r=null);var u=x(e);i=u.attr(t),u.length&&(a=o[t],a&&a.set?a.set(u,r,t):u.attr(t,r),i!==r&&n.onSetAttrib&&n.onSetAttrib({attrElm:u,attrName:t,attrValue:r}))},S=function(e,n){if(!Zc||1!==e.nodeType||n)return e.cloneNode(n);if(!n){var r=t.createElement(e.nodeName);return Yc(k(e),function(t){N(r,t.nodeName,z(e,t.nodeName))}),r}return null},T=function(){return n.root_element||t.body},A=function(e){var t=oo(e);return{x:t.x(),y:t.y(),w:t.width(),h:t.height()}},R=function(e,n){return $o.getPos(t.body,w(e),n)},B=function(e,t,r){var o=tt(t)?x(e).css(t,r):x(e).css(t);n.update_styles&&ts(p,o)},D=function(e,t){var r=x(e).css(t);n.update_styles&&ts(p,r)},M=function(e,t,n){var r=x(e);return n?r.css(t):(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"===t&&(t=Ri.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:void 0)},_=function(e){var t,n;return e=w(e),t=M(e,"width"),n=M(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},P=function(e){var t,n;return e=w(e),t=R(e),n=_(e),{x:t.x,y:t.y,w:n.w,h:n.h}},O=function(e,t){var n;if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(Jc.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return vc(t,i[0].ownerDocument||i[0],null,i).length>0},H=function(e,t,n,r){var o,i=[],a=w(e);for(r=void 0===r,n=n||("BODY"!==T().nodeName?T().parentNode:null),ea.is(t,"string")&&(o=t,t="*"===t?function(e){return 1===e.nodeType}:function(e){return O(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},L=function(e,t,n){var r=H(e,t,n,!1);return r&&r.length>0?r[0]:null},I=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return O(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},V=function(e,t){return I(e,t,"nextSibling")},F=function(e,t){return I(e,t,"previousSibling")},U=function(e,r){return vc(e,w(r)||n.root_element||t,[])},j=function(e,t,n){var o,i="string"==typeof e?w(e):e;if(!i)return!1;if(ea.isArray(i)&&(i.length||0===i.length))return o=[],Yc(i,function(e,r){e&&("string"==typeof e&&(e=w(e)),o.push(t.call(n,e,r)))}),o;var a=n?n:r;return t.call(a,i)},q=function(e,t){x(e).each(function(e,n){Yc(t,function(e,t){N(n,t,e)})})},$=function(e,t){var n=x(e);Zc?n.each(function(e,n){if(n.canHaveHTML!==!1){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="
"+t,n.removeChild(n.firstChild)}catch(r){Kc("
").html("
"+t).contents().slice(1).appendTo(n)}return t}}):n.html(t)},W=function(e,n,r,o,i){return j(e,function(e){var a="string"==typeof n?t.createElement(n):n;return q(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&$(a,o)),i?a:e.appendChild(a)})},K=function(e,n,r){return W(t.createElement(e),e,n,r,!0)},X=au.decode,Y=au.encodeAllRaw,G=function(e,t,n){var r,o="";o+="<"+e;for(r in t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+=" "+r+'="'+Y(t[r])+'"');return"undefined"!=typeof n?o+">"+n+"":o+" />"},Z=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},J=function(e,t){var n=x(e);return t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():n.remove(),n.length>1?n.toArray():n[0]},Q=function(e){return j(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},et=function(e){return p.parse(e)},nt=function(e,t){return p.serialize(e,t)},rt=function(n){var r,o;if(Dt!==E.DOM&&t===e.document){if(u[n])return;u[n]=!0}o=t.getElementById("mceDefaultStyles"),o||(o=t.createElement("style"),o.id="mceDefaultStyles",o.type="text/css",r=t.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=n:o.appendChild(t.createTextNode(n))},ot=function(r){var o;return Dt!==E.DOM&&t===e.document?void E.DOM.loadCSS(r):(r||(r=""),o=t.getElementsByTagName("head")[0],void Yc(r.split(","),function(e){var t;e=ea._addCacheSuffix(e),s[e]||(s[e]=!0,t=K("link",$t($t({rel:"stylesheet",type:"text/css",href:e},n.contentCssCors?{crossOrigin:"anonymous"}:{}),n.referrerPolicy?{referrerPolicy:n.referrerPolicy}:{})),o.appendChild(t))}))},it=function(e,t,n){x(e).toggleClass(t,n).each(function(){""===this.className&&Kc(this).attr("class",null)})},at=function(e,t){x(e).addClass(t)},ut=function(e,t){it(e,t,!1)},ct=function(e,t){return x(e).hasClass(t)},st=function(e){x(e).show()},lt=function(e){x(e).hide()},ft=function(e){return"none"===x(e).css("display")},dt=function(e){return(e?e:"mce_")+l++},ht=function(e){var t="string"==typeof e?w(e):e;return No.isElement(t)?t.outerHTML:Kc("
").append(Kc(t).clone()).html()},mt=function(e,t){x(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}J(Kc(this).html(t),!0)})},gt=function(e,t){var n=w(t);return j(e,function(e){var t,r;return t=n.parentNode,r=n.nextSibling,r?t.insertBefore(e,r):t.appendChild(e),e})},pt=function(e,t,n){return j(t,function(t){return ea.is(t,"array")&&(e=e.cloneNode(!0)),n&&Yc(Gc(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},vt=function(e,t){var n;return e.nodeName!==t.toUpperCase()&&(n=K(t),Yc(k(e),function(t){N(n,t.nodeName,z(e,t.nodeName))}),pt(n,e,!0)),n||e},yt=function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},bt=function(e){return p.toHex(ea.trim(e))},Ct=function(e){if(No.isElement(e)){var t="a"===e.nodeName.toLowerCase()&&!z(e,"href")&&z(e,"id");if(z(e,"name")||z(e,"data-mce-bookmark")||t)return!0}return!1},wt=function(e,t){var n,r,o=0;if(Ct(e))return!1;if(e=e.firstChild){var i=new Xc(e,e.parentNode),a=g?g.getWhiteSpaceElements():{};t=t||(g?g.getNonEmptyElements():null);do{if(n=e.nodeType,No.isElement(e)){var u=e.getAttribute("data-mce-bogus");if(u){e=i.next("all"===u);continue}if(r=e.nodeName.toLowerCase(),t&&t[r]){if("br"===r){o++,e=i.next();continue}return!1}if(Ct(e))return!1}if(8===n)return!1;if(3===n&&!Qc.test(e.nodeValue))return!1;if(3===n&&e.parentNode&&a[e.parentNode.nodeName]&&Qc.test(e.nodeValue))return!1;e=i.next()}while(e)}return 1>=o},xt=function(){return t.createRange()},Et=function(e,t,n){var r,o,i,a=xt();return e&&t?(a.setStart(e.parentNode,ns(e)),a.setEnd(t.parentNode,ns(t)),r=a.extractContents(),a=xt(),a.setStart(t.parentNode,ns(t)+1),a.setEnd(e.parentNode,ns(e)+1),o=a.extractContents(),i=e.parentNode,i.insertBefore(Na.trimNode(Dt,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Na.trimNode(Dt,o),e),J(e),n||t):void 0},zt=function(e,r,o,i){if(ea.isArray(e)){for(var a=e.length,u=[];a--;)u[a]=zt(e[a],r,o,i);return u}return!n.collect||e!==t&&e!==c||m.push([e,r,o,i]),v.bind(e,r,o,i||Dt)},kt=function(e,n,r){var o;if(ea.isArray(e)){o=e.length;for(var i=[];o--;)i[o]=kt(e[o],n,r);return i}if(m&&(e===t||e===c))for(o=m.length;o--;){var a=m[o];e!==a[0]||n&&n!==a[1]||r&&r!==a[2]||v.unbind(a[0],a[1],a[2])}return v.unbind(e,n,r)},Nt=function(e,t,n){return v.fire(e,t,n)},St=function(e){if(e&&No.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},Tt=function(e){for(var t=T(),n=null;e&&e!==t&&(n=St(e),null===n);e=e.parentNode);return n},At=function(){if(m)for(var e=m.length;e--;){var t=m[e];v.unbind(t[0],t[1],t[2])}vc.setDocument&&vc.setDocument()},Rt=function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},Bt=function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},Dt={doc:t,settings:n,win:c,files:s,stdMode:f,boxModel:d,styleSheetLoader:h,boundEvents:m,styles:p,schema:g,events:v,isBlock:C,$:b,$$:x,root:null,clone:S,getRoot:T,getViewPort:A,getRect:P,getSize:_,getParent:L,getParents:H,get:w,getNext:V,getPrev:F,select:U,is:O,add:W,create:K,createHTML:G,createFragment:Z,remove:J,setStyle:B,getStyle:M,setStyles:D,removeAllAttribs:Q,setAttrib:N,setAttribs:q,getAttrib:z,getPos:R,parseStyle:et,serializeStyle:nt,addStyle:rt,loadCSS:ot,addClass:at,removeClass:ut,hasClass:ct,toggleClass:it,show:st,hide:lt,isHidden:ft,uniqueId:dt,setHTML:$,getOuterHTML:ht,setOuterHTML:mt,decode:X,encode:Y,insertAfter:gt,replace:pt,rename:vt,findCommonAncestor:yt,toHex:bt,run:j,getAttribs:k,isEmpty:wt,createRng:xt,nodeIndex:ns,split:Et,bind:zt,unbind:kt,fire:Nt,getContentEditable:St,getContentEditableParent:Tt,destroy:At,isChildOf:Rt,dumpRng:Bt};return o=es(p,n,function(){return Dt}),Dt}function z(){var e=this,t=[],n={},r={},o=[],i=function(e,t){var n=bt(o,function(n){return n.name===e&&n.state===t});pt(n,function(e){return e.callback()})},a=function(e){return r[e]?r[e].instance:void 0},u=function(e){var t;return r[e]&&(t=r[e].dependencies),t||[]},c=function(e,t){z.languageLoad!==!1&&g(e,function(){var r=zs.getCode(),o=","+(t||"")+",";!r||t&&-1===o.indexOf(","+r+",")||fs.ScriptLoader.add(n[e]+"/langs/"+r+".js")},"loaded")},s=function(e,n,o){var a=n;return t.push(a),r[e]={instance:a,dependencies:o},i(e,"added"),a},l=function(e){delete n[e],delete r[e]},f=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},d=function(t,n){var r=e.urls[t];pt(n,function(e){fs.ScriptLoader.add(r+"/"+e)})},h=function(e,t,n,r){var o=u(e);pt(o,function(e){var n=f(t,e);m(n.resource,n,void 0,void 0)}),n&&n.call(r?r:fs)},m=function(e,t,o,a,u){if(!n[e]){var c="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==c.indexOf("/")&&-1===c.indexOf("://")&&(c=z.baseURL+"/"+c),n[e]=c.substring(0,c.lastIndexOf("/"));var s=function(){i(e,"loaded"),h(e,t,o,a)};r[e]?s():fs.ScriptLoader.add(c,s,a,u)}},g=function(e,t,i){void 0===i&&(i="added"),qt(r,e)&&"added"===i?t():qt(n,e)&&"loaded"===i?t():o.push({name:e,state:i,callback:t})};return{items:t,urls:n,lookup:r,_listeners:o,get:a,dependencies:u,requireLangPack:c,add:s,remove:l,createUrl:f,addComponents:d,load:m,waitFor:g}}function k(e,t,n,r,o){return e(n,r)?J.some(n):at(o)&&o(n)?J.none():t(n,r,o)}function N(e,t,n){var r=function(){return yf(e)?0===t:0===t},o=function(){return yf(e)?t>=e.data.length:t>=e.childNodes.length},i=function(){var n;return n=xf(e.ownerDocument),n.setStart(e,t),n.setEnd(e,t),n},a=function(){return n||(n=Bf(N(e,t))),n},u=function(){return a().length>0},c=function(n){return n&&e===n.container()&&t===n.offset()},s=function(n){return wf(e,n?t-1:t)};return{container:U(e),offset:U(t),toRange:i,getClientRects:a,isVisible:u,isAtStart:r,isAtEnd:o,isEqual:c,getNode:s}}function S(e,t){var n=function(n){if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return r(n).getOr("")},r=function(t){return e(t)?J.from(t.dom().nodeValue):J.none()},o=function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom().nodeValue=r};return{get:n,getOption:r,set:o}}function T(e,t){void 0===t&&(t=a());var n=function(){};e=e||{},e.fix_self_closing!==!1&&(e.fix_self_closing=!0);var r=e.comment?e.comment:n,o=e.cdata?e.cdata:n,i=e.text?e.text:n,u=e.start?e.start:n,c=e.end?e.end:n,s=e.pi?e.pi:n,l=e.doctype?e.doctype:n,f=function(n,a){void 0===a&&(a="html");var f,d,h,m,g,p,v,y,b,C,w,x,E,z,k,N,S,T,A,R,B,D,M,_,P,O,H,L,I,V,F=0,U=[],j=0,q=au.decode,$=ea.makeMap("src,href,data,background,formaction,poster,xlink:href"),W=/((java|vb)script|mhtml):/i,K="html"===a?0:1,X=function(e){var t,n;for(t=U.length;t--&&U[t].name!==e;);if(t>=0){for(n=U.length-1;n>=t;n--)e=U[n],e.valid&&c(e.name);U.length=t}},Y=function(t){""!==t&&(">"===t.charAt(0)&&(t=" "+t),e.allow_conditional_comments||"[if"!==t.substr(0,3).toLowerCase()||(t=" "+t),r(t))},G=function(e,t){var r=e||"",o=!Pn(r,"--"),i=Gg(n,o,t);return e=n.substr(t,i-t),Y(o?r+e:e),i+1},Z=function(t,n,r,o,i){var a,u,c=/[\s\u0000-\u001F]+/g;if(n=n.toLowerCase(),r=n in w?n:q(r||o||i||""),E&&!y&&Wg(n)===!1){if(a=T[n],!a&&A){for(u=A.length;u--&&(a=A[u],!a.pattern.test(n)););-1===u&&(a=null)}if(!a)return;if(a.validValues&&!(r in a.validValues))return}if($[n]&&!e.allow_script_urls){var s=r.replace(c,"");try{s=decodeURIComponent(s)}catch(l){s=unescape(s)}if(W.test(s))return;if(Kg(e,s))return}y&&(n in $||0===n.indexOf("on"))||(m.map[n]=r,m.push({name:n,value:r}))};for(O=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"),H=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,C=t.getShortEndedElements(),P=e.self_closing_elements||t.getSelfClosingElements(),w=t.getBoolAttrs(),E=e.validate,b=e.remove_internals,V=e.fix_self_closing,L=t.getSpecialElements(),M=n+">";f=O.exec(M);){var J=f[0];if(Fn.length){i(q(n.substr(f.index))),F=f.index+J.length;continue}d=d.toLowerCase(),":"===d.charAt(0)&&(d=d.substr(1)),x=d in C,V&&P[d]&&U.length>0&&U[U.length-1].name===d&&X(d);var Q=Zg(H,f[9]);if(null!==Q){if("all"===Q){F=Xg(t,n,O.lastIndex),O.lastIndex=F;continue}k=!1}if(!E||(z=t.getElementRule(d))){if(k=!0,E&&(T=z.attributes,A=z.attributePatterns),(S=f[9])?(y=-1!==S.indexOf("data-mce-type"),y&&b&&(k=!1),m=[],m.map={},S.replace(H,Z)):(m=[],m.map={}),E&&!y){if(R=z.attributesRequired,B=z.attributesDefault,D=z.attributesForced,_=z.removeEmptyAttrs,_&&!m.length&&(k=!1),D)for(g=D.length;g--;)N=D[g],v=N.name,I=N.value,"{$uid}"===I&&(I="mce_"+j++),m.map[v]=I,m.push({name:v,value:I});if(B)for(g=B.length;g--;)N=B[g],v=N.name,v in m.map||(I=N.value,"{$uid}"===I&&(I="mce_"+j++),m.map[v]=I,m.push({name:v,value:I}));if(R){for(g=R.length;g--&&!(R[g]in m.map););-1===g&&(k=!1)}if(N=m.map["data-mce-bogus"]){if("all"===N){F=Xg(t,n,O.lastIndex),O.lastIndex=F;continue}k=!1}}k&&u(d,m,x)}else k=!1;if(h=L[d]){h.lastIndex=F=f.index+J.length,(f=h.exec(n))?(k&&(p=n.substr(F,f.index-F)),F=f.index+f[0].length):(p=n.substr(F),F=n.length),k&&(p.length>0&&i(p,!0),c(d)),O.lastIndex=F;continue}x||(S&&S.indexOf("/")===S.length-1?k&&c(d):U.push({name:d,valid:k}))}else if(d=f[1])Y(d);else if(d=f[2]){var et=1===K||e.preserve_cdata||U.length>0&&t.isValidChild(U[U.length-1].name,"#cdata");if(!et){F=G("",f.index+2),O.lastIndex=F;continue}o(d)}else if(d=f[3])l(d);else{if((d=f[4])||"=0;g--)d=U[g],d.valid&&c(d.name)};return{parse:f}}function A(){var e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:e,close:e,reposition:e,getArgs:e}}function R(e){var t=[],n=function(){var t=e.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():A()},r=function(){return J.from(t[0])},o=function(e,t){return!(e.type!==t.type||e.text!==t.text||e.progressBar||e.timeout||t.progressBar||t.timeout)},i=function(){t.length>0&&n().reposition(t)},a=function(e){t.push(e)},u=function(e){Et(t,function(t){return t===e}).each(function(e){t.splice(e,1)})},c=function(r){return!e.removed&&Yy.isEditorAttachedToDom(e)?xt(t,function(e){return o(n().getArgs(e),r)}).getOrThunk(function(){e.editorManager.setActive(e);var t=n().open(r,function(){u(t),i()});return a(t),i(),t}):void 0},s=function(){r().each(function(e){n().close(e),u(e),i()})},l=function(){return t},f=function(e){e.on("SkinLoaded",function(){var t=e.settings.service_message;t&&c({text:t,type:"warning",timeout:0})}),e.on("ResizeEditor ResizeWindow NodeChange",function(){wi.requestAnimationFrame(i)}),e.on("remove",function(){pt(t.slice(),function(e){n().close(e)})})};return f(e),{open:c,close:s,getNotifications:l}}function B(){var e=function(){throw new Error("Theme did not provide a WindowManager implementation.")};return{open:e,openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}}function D(e){return{getBookmark:t(Km.getBookmark,e),moveToBookmark:t(Km.moveToBookmark,e)}}function M(e,t){var n=function(t,n){if(!ut(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);var r=t.dom();So(r)&&(r.style[e]=n+"px")},r=function(n){var r=t(n);if(0>=r||null===r){var o=Po(n,e);return parseFloat(o)||0}return r},o=r,i=function(e,t){return wt(t,function(t,n){var r=Po(e,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?t:t+o},0)},a=function(e,t,n){var r=i(e,n),o=t>r?t-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:a}}function _(e,t){var n,r;return{selectorChangedWithUnbind:function(o,i){return n||(n={},r={},t.on("NodeChange",function(t){var o=t.element,i=e.getParents(o,null,e.getRoot()),a={};ea.each(n,function(t,n){ea.each(i,function(o){return e.is(o,n)?(r[n]||(ea.each(t,function(e){e(!0,{node:o,selector:n,parents:i})}),r[n]=t),a[n]=t,!1):void 0})}),ea.each(r,function(e,t){a[t]||(delete r[t],ea.each(e,function(e){e(!1,{node:o,selector:t,parents:i})}))})})),n[o]||(n[o]=[]),n[o].push(i),{unbind:function(){Ow(n,o,i),Ow(r,o,i)}}}}}function P(e,t){var n={},r=function(r,o){var i;o||(o=U(!0)),i=bt(Ax(r),function(t){var n=t.src;return Ri.fileApi?t.hasAttribute("data-mce-bogus")?!1:t.hasAttribute("data-mce-placeholder")?!1:n&&n!==Ri.transparentSrc?0===n.indexOf("blob:")?!e.isUploaded(n)&&o(t):0===n.indexOf("data:")?o(t):!1:!1:!1});var a=gt(i,function(e){if(n[e.src])return new mi(function(t){n[e.src].then(function(n){return"string"==typeof n?n:void t({image:e,blobInfo:n.blobInfo})})});var r=new mi(function(n,r){Tx(t,e,n,r)}).then(function(e){return delete n[e.image.src],e}).catch(function(t){return delete n[e.src],t});return n[e.src]=r,r});return mi.all(a)};return{findAll:r}}function O(t,n){var r={},o=function(e,t){return e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t},i=function(t,r,i,a){var u,c;u=new e.XMLHttpRequest,u.open("POST",n.url),u.withCredentials=n.credentials,u.upload.onprogress=function(e){a(e.loaded/e.total*100)},u.onerror=function(){i("Image upload failed due to a XHR Transport error. Code: "+u.status)},u.onload=function(){var e;return u.status<200||u.status>=300?void i("HTTP Error: "+u.status):(e=JSON.parse(u.responseText),e&&"string"==typeof e.location?void r(o(n.basePath,e.location)):void i("Invalid JSON: "+u.responseText))},c=new e.FormData,c.append("file",t.blob(),t.filename()),u.send(c)},a=function(){return new mi(function(e){e([])})},u=function(e,t){return{url:t,blobInfo:e,status:!0}},c=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},s=function(e,t){ea.each(r[e],function(e){e(t)}),delete r[e]},l=function(e,n,r){return t.markPending(e.blobUri()),new mi(function(o){var i,a,l=function(){};try{var f=function(){i&&(i.close(),a=l)},d=function(n){f(),t.markUploaded(e.blobUri(),n),s(e.blobUri(),u(e,n)),o(u(e,n))},h=function(n){f(),t.removeFailed(e.blobUri()),s(e.blobUri(),c(e,n)),o(c(e,n))};a=function(e){0>e||e>100||(i||(i=r()),i.progressBar.value(e))},n(e,d,h,a)}catch(m){o(c(e,m.message))}})},f=function(e){return e===i},d=function(e){var t=e.blobUri();return new mi(function(e){r[t]=r[t]||[],r[t].push(e)})},h=function(e,r){return e=ea.grep(e,function(e){return!t.isUploaded(e.blobUri()) }),mi.all(ea.map(e,function(e){return t.isPending(e.blobUri())?d(e):l(e,n.handler,r)}))},m=function(e,t){return!n.url&&f(n.handler)?a():h(e,t)};return at(n.handler)===!1&&(n.handler=i),{upload:m}}function H(){var e=1,t=2,n={},r=function(e,t){return{status:e,resultUri:t}},o=function(e){return e in n},i=function(e){var t=n[e];return t?t.resultUri:null},a=function(t){return o(t)?n[t].status===e:!1},u=function(e){return o(e)?n[e].status===t:!1},c=function(t){n[t]=r(e,null)},s=function(e,o){n[e]=r(t,o)},l=function(e){delete n[e]},f=function(){n={}};return{hasBlobUri:o,getResultUri:i,isPending:a,isUploaded:u,markPending:c,markUploaded:s,removeFailed:l,destroy:f}}function L(e){var t={},n=function(e){return e?t[e]:t},r=function(e){return qt(t,e)},o=function(e,n){e&&("string"!=typeof e?ea.each(e,function(e,t){o(t,e)}):(rt(n)||(n=[n]),ea.each(n,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),t[e]=n))},i=function(e){return e&&t[e]&&delete t[e],t};return o(nk.get(e.dom)),o(e.settings.formats),{get:n,has:r,register:o,unregister:i}}function I(e){var t=function(t,n){return Rg.walk(e,t,n)},n=Qx,r=function(t){return xw.normalize(e,t).fold(U(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})};return{walk:t,split:n,normalize:r}}var V=function(){},F=function(e,t){return function(){for(var n=[],r=0;r-1},mt=function(e,t){for(var n=0,r=e.length;r>n;n++){var o=e[n];if(t(o,n))return!0}return!1},gt=function(e,t){for(var n=e.length,r=new Array(n),o=0;n>o;o++){var i=e[o];r[o]=t(i,o)}return r},pt=function(e,t){for(var n=0,r=e.length;r>n;n++){var o=e[n];t(o,n)}},vt=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];t(r,n)}},yt=function(e,t){for(var n=[],r=[],o=0,i=e.length;i>o;o++){var a=e[o],u=t(a,o)?n:r;u.push(a)}return{pass:n,fail:r}},bt=function(e,t){for(var n=[],r=0,o=e.length;o>r;r++){var i=e[r];t(i,r)&&n.push(i)}return n},Ct=function(e,t,n){return vt(e,function(e){n=t(n,e)}),n},wt=function(e,t,n){return pt(e,function(e){n=t(n,e)}),n},xt=function(e,t){for(var n=0,r=e.length;r>n;n++){var o=e[n];if(t(o,n))return J.some(o)}return J.none()},Et=function(e,t){for(var n=0,r=e.length;r>n;n++){var o=e[n];if(t(o,n))return J.some(n)}return J.none()},zt=function(e){for(var t=[],n=0,r=e.length;r>n;++n){if(!rt(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);lt.apply(t,e[n])}return t},kt=function(e,t){return zt(gt(e,t))},Nt=function(e,t){for(var n=0,r=e.length;r>n;++n){var o=e[n];if(t(o,n)!==!0)return!1}return!0},St=function(e){var t=ct.call(e,0);return t.reverse(),t},Tt=function(e,t){return bt(e,function(e){return!ht(t,e)})},At=function(e,t){for(var n={},r=0,o=e.length;o>r;r++){var i=e[r];n[String(i)]=t(i,r)}return n},Rt=function(e,t){var n=ct.call(e,0);return n.sort(t),n},Bt=function(e){return 0===e.length?J.none():J.some(e[0])},Dt=function(e){return 0===e.length?J.none():J.some(e[e.length-1])},Mt=at(Array.from)?Array.from:function(e){return ct.call(e)},_t=Object.keys,Pt=Object.hasOwnProperty,Ot=function(e,t){for(var n=_t(e),r=0,o=n.length;o>r;r++){var i=n[r],a=e[i];t(a,i)}},Ht=function(e,t){return Lt(e,function(e,n){return{k:n,v:t(e,n)}})},Lt=function(e,t){var n={};return Ot(e,function(e,r){var o=t(e,r);n[o.k]=o.v}),n},It=function(e){return function(t,n){e[n]=t}},Vt=function(e,t,n,r){var o={};return Ot(e,function(e,o){(t(e,o)?n:r)(e,o)}),o},Ft=function(e,t){var n={},r={};return Vt(e,t,It(n),It(r)),{t:n,f:r}},Ut=function(e,t){var n={};return Vt(e,t,It(n),V),n},jt=function(e,t){return qt(e,t)?J.from(e[t]):J.none()},qt=function(e,t){return Pt.call(e,t)},$t=function(){return $t=Object.assign||function(e){for(var t,n=1,r=arguments.length;r>n;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},$t.apply(this,arguments)},Wt=function(t,n){var r=n||e.document,o=r.createElement("div");if(o.innerHTML=t,!o.hasChildNodes()||o.childNodes.length>1)throw e.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Yt(o.childNodes[0])},Kt=function(t,n){var r=n||e.document,o=r.createElement(t);return Yt(o)},Xt=function(t,n){var r=n||e.document,o=r.createTextNode(t);return Yt(o)},Yt=function(e){if(null===e||void 0===e)throw new Error("Node cannot be null or undefined");return{dom:U(e)}},Gt=function(e,t,n){var r=e.dom();return J.from(r.elementFromPoint(t,n)).map(Yt)},Zt={fromHtml:Wt,fromTag:Kt,fromText:Xt,fromDom:Yt,fromPoint:Gt},Jt=function(e){var t=e,n=function(){return t},r=function(e){t=e},o=function(){return Jt(n())};return{get:n,set:r,clone:o}},Qt=function(e,t){for(var n=0;n0&&Pr(e,t),Lr(e)},Vr=("undefined"!=typeof e.window?e.window:Function("return this;")(),function(e){var t=e.dom().nodeName;return t.toLowerCase()}),Fr=function(e){return e.dom().nodeType},Ur=function(e){return function(t){return Fr(t)===e}},jr=Ur(rr),qr=Ur(or),$r=function(e){var t=qr(e)?e.dom().parentNode:e.dom();return void 0!==t&&null!==t&&t.ownerDocument.body.contains(t)},Wr=function(e,t){var n=function(n,r){return Wr(e+n,t+r)};return{left:U(e),top:U(t),translate:n}},Kr=Wr,Xr=function(e){var t=e.getBoundingClientRect();return Kr(t.left,t.top)},Yr=function(e,t){return void 0!==e?e:void 0!==t?t:0},Gr=function(e){var t=e.dom().ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement;if(n===e.dom())return Kr(n.offsetLeft,n.offsetTop);var i=Yr(r.pageYOffset,o.scrollTop),a=Yr(r.pageXOffset,o.scrollLeft),u=Yr(o.clientTop,n.clientTop),c=Yr(o.clientLeft,n.clientLeft);return Zr(e).translate(a-c,i-u)},Zr=function(e){var t=e.dom(),n=t.ownerDocument,r=n.body;return r===t?Kr(r.offsetLeft,r.offsetTop):$r(e)?Xr(t):Kr(0,0)},Jr=Xn().browser.isSafari(),Qr=function(t){var n=void 0!==t?t.dom():e.document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return Kr(r,o)},eo=function(t,n,r){var o=void 0!==r?r.dom():e.document,i=o.defaultView;i.scrollTo(t,n)},to=function(e,t){Jr&&at(e.dom().scrollIntoViewIfNeeded)?e.dom().scrollIntoViewIfNeeded(!1):e.dom().scrollIntoView(t)},no=function(t){var n=void 0===t?e.window:t;return J.from(n.visualViewport)},ro=function(e,t,n,r){return{x:U(e),y:U(t),width:U(n),height:U(r),right:U(e+n),bottom:U(t+r)}},oo=function(t){var n=void 0===t?e.window:t,r=n.document,o=Qr(Zt.fromDom(r));return no(n).fold(function(){var e=n.document.documentElement,t=e.clientWidth,r=e.clientHeight;return ro(o.left(),o.top(),t,r)},function(e){return ro(Math.max(e.pageLeft,o.left()),Math.max(e.pageTop,o.top()),e.width,e.height)})},io=function(e){return function(t){return!!t&&t.nodeType===e}},ao=function(e){return!!e&&!Object.getPrototypeOf(e)},uo=io(1),co=function(e){var t=e.map(function(e){return e.toLowerCase()});return function(e){if(e&&e.nodeName){var n=e.nodeName.toLowerCase();return ht(t,n)}return!1}},so=function(e,t){var n=t.toLowerCase().split(" ");return function(t){var r,o;if(uo(t))for(r=0;r0})},Lo=function(e){var t={},n=e.dom();if(So(n))for(var r=0;r=n?-o:0})}).getOr(0):0},jo=function(e,t){return e.children&&ht(e.children,t)},qo=function(e,t,n){var r,o,i=0,a=0,u=e.ownerDocument;if(n=n?n:e,t){if(n===e&&t.getBoundingClientRect&&"static"===Po(Zt.fromDom(e),"position"))return o=t.getBoundingClientRect(),i=o.left+(u.documentElement.scrollLeft||e.scrollLeft)-u.documentElement.clientLeft,a=o.top+(u.documentElement.scrollTop||e.scrollTop)-u.documentElement.clientTop,{x:i,y:a};for(r=t;r&&r!==n&&r.nodeType&&!jo(r,n);)i+=r.offsetLeft||0,a+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType&&!jo(r,n);)i-=r.scrollLeft||0,a-=r.scrollTop||0,r=r.parentNode;a+=Uo(Zt.fromDom(t))}return{x:i,y:a}},$o={getPos:qo},Wo={},Ko={exports:Wo};!function(e,t,n,r){!function(r){if("object"==typeof t&&"undefined"!=typeof n)n.exports=r();else if("function"==typeof e&&e.amd)e([],r);else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,o.EphoxContactWrapper=r()}}(function(){return function(){function e(t,n,o){function i(u,c){if(!n[u]){if(!t[u]){var s="function"==typeof r&&r;if(!c&&s)return s(u,!0);if(a)return a(u,!0);var l=new Error("Cannot find module '"+u+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return i(n||e)},f,f.exports,e,t,n,o)}return n[u].exports}for(var a="function"==typeof r&&r,u=0;u1)for(var n=1;nt;t++)a(e,e._deferreds[t]);e._deferreds=null}function l(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function f(e,t){var n=!1;try{e(function(e){n||(n=!0,u(t,e))},function(e){n||(n=!0,c(t,e))})}catch(r){if(n)return;n=!0,c(t,r)}}var d=setTimeout;i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(r);return a(this,new l(e,t,n)),n},i.all=function(e){var t=Array.prototype.slice.call(e);return new i(function(e,n){function r(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,function(e){r(i,e)},n)}t[i]=a,0===--o&&e(t)}catch(c){n(c)}}if(0===t.length)return e([]);for(var o=t.length,i=0;ir;r++)e[r].then(t,n)})},i._immediateFn="function"==typeof e?function(t){e(t)}:function(e){d(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},"undefined"!=typeof t&&t.exports?t.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,e("timers").setImmediate)},{timers:3}],3:[function(e,t,n){(function(t,r){function o(e,t){this._id=e,this._clearFn=t}var i=e("process/browser.js").nextTick,a=Function.prototype.apply,u=Array.prototype.slice,c={},s=0;n.setTimeout=function(){return new o(a.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new o(a.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof t?t:function(e){var t=s++,r=arguments.length<2?!1:u.call(arguments,1);return c[t]=!0,i(function(){c[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof r?r:function(e){delete c[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(e,t){var n=e("promise-polyfill"),r=function(){return"undefined"!=typeof window?window:Function("return this;")()}();t.exports={boltExport:r.Promise||n}},{"promise-polyfill":2}]},{},[4])(4)})}(void 0,Wo,Ko,void 0);var Xo,Yo,Go,Zo,Jo=Ko.exports.boltExport,Qo=function(t){var n=J.none(),r=[],o=function(e){return Qo(function(t){i(function(n){t(e(n))})})},i=function(e){u()?s(e):r.push(e)},a=function(e){n=J.some(e),c(r),r=[]},u=function(){return n.isSome()},c=function(e){pt(e,s)},s=function(t){n.each(function(n){e.setTimeout(function(){t(n)},0)})};return t(a),{get:i,map:o,isReady:u}},ei=function(e){return Qo(function(t){t(e)})},ti={nu:Qo,pure:ei},ni=function(t){e.setTimeout(function(){throw t},0)},ri=function(e){var t=function(t){e().then(t,ni)},n=function(t){return ri(function(){return e().then(t)})},r=function(t){return ri(function(){return e().then(function(e){return t(e).toPromise()})})},o=function(t){return ri(function(){return e().then(function(){return t.toPromise()})})},i=function(){return ti.nu(t)},a=function(){var t=null;return ri(function(){return null===t&&(t=e()),t})},u=e;return{map:n,bind:r,anonBind:o,toLazy:i,toCached:a,toPromise:u,get:t}},oi=function(e){return ri(function(){return new Jo(e)})},ii=function(e){return ri(function(){return Jo.resolve(e)})},ai={nu:oi,pure:ii},ui=function(e,t){return t(function(t){var n=[],r=0,o=function(o){return function(i){n[o]=i,r++,r>=e.length&&t(n)}};0===e.length?t([]):pt(e,function(e,t){e.get(o(t))})})},ci=function(e){return ui(e,ai.nu)},si=function(e){var t=function(t){return e===t},n=function(){return si(e)},r=function(){return si(e)},o=function(t){return si(t(e))},i=function(){return si(e)},a=function(t){t(e)},u=function(t){return t(e)},c=function(t,n){return n(e)},s=function(t){return t(e)},l=function(t){return t(e)},f=function(){return J.some(e)};return{is:t,isValue:K,isError:W,getOr:U(e),getOrThunk:U(e),getOrDie:U(e),or:n,orThunk:r,fold:c,map:o,mapError:i,each:a,bind:u,exists:s,forall:l,toOption:f}},li=function(e){var t=function(e){return e()},n=function(){return $(String(e))()},r=function(e){return e},o=function(e){return e()},i=function(){return li(e)},a=function(t){return li(t(e))},u=function(){return li(e)},c=function(t){return t(e)};return{is:W,isValue:W,isError:K,getOr:j,getOrThunk:t,getOrDie:n,or:r,orThunk:o,fold:c,map:i,mapError:a,each:V,bind:u,exists:W,forall:K,toOption:J.none}},fi=function(e,t){return e.fold(function(){return li(t)},si)},di={value:si,error:li,fromOption:fi},hi=function(){function t(e,t){return function(){e.apply(t,arguments)}}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void l(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=n(t._value)}catch(o){return void e.reject(o)}e.resolve(r)})}function r(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void u(t(n,e),t(r,this),t(o,this))}this._state=!0,this._value=e,i.call(this)}catch(a){o.call(this,a)}}function o(e){this._state=!1,this._value=e,i.call(this)}function i(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function a(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function u(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}var c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],u(e,t(r,this),t(o,this))},l=s.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){e.setTimeout(t,1)};return s.prototype.catch=function(e){return this.then(null,e)},s.prototype.then=function(e,t){var r=this;return new s(function(o,i){n.call(r,new a(e,t,o,i))})},s.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&c(arguments[0])?arguments[0]:arguments);return new s(function(t,n){function r(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,function(e){r(i,e)},n)}e[i]=a,0===--o&&t(e)}catch(c){n(c)}}if(0===e.length)return t([]);for(var o=e.length,i=0;ir;r++)e[r].then(t,n)})},s},mi=window.Promise?window.Promise:hi(),gi=function(t,n){var r,o=e.window.requestAnimationFrame,i=["ms","moz","webkit"],a=function(t){e.window.setTimeout(t,0)};for(r=0;rt;t++)r[t]=e[t];return r},Mi=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,void 0!==e.length){for(r=0,o=e.length;o>r;r++)if(t.call(n,e[r],r,e)===!1)return 0}else for(r in e)if(e.hasOwnProperty(r)&&t.call(n,e[r],r,e)===!1)return 0;return 1},_i=function(e,t){var n=[];return Mi(e,function(r,o){n.push(t(r,o,e))}),n},Pi=function(e,t){var n=[];return Mi(e,function(r,o){(!t||t(r,o,e))&&n.push(r)}),n},Oi=function(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},Hi=function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);or;r++)if(t.call(n,e[r],r,e))return r;return-1},Ii=function(e,t,n){var r=Li(e,t,n);return-1!==r?e[r]:void 0},Vi=function(e){return e[e.length-1]},Fi={isArray:Bi,toArray:Di,each:Mi,map:_i,filter:Pi,indexOf:Oi,reduce:Hi,findIndex:Li,find:Ii,last:Vi},Ui=/^\s*|\s*$/g,ji=function(e){return null===e||void 0===e?"":(""+e).replace(Ui,"")},qi=function(e,t){return t?"array"===t&&Fi.isArray(e)?!0:typeof e===t:void 0!==e},$i=function(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},Wi=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},Ki=function(e,t,n){var r,o,i,a,u,c=this,s=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],o=c.createNS(e[3].replace(/\.\w+$/,""),n),!o[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},s=1),o[i]=t[i],c.extend(o[i].prototype,t),e[5]&&(r=c.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],u=o[i],o[i]=s?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],u.apply(this,arguments)},o[i].prototype[i]=o[i],c.each(r,function(e,t){o[i].prototype[t]=r[t]}),c.each(t,function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==i&&(o[i].prototype[t]=e)})),c.each(t.static,function(e,t){o[i][t]=e})}},Xi=function(e,t){for(var n=[],r=2;ro;o++){t=c[o];for(a in t)t.hasOwnProperty(a)&&(u=t[a],void 0!==u&&(e[a]=u))}return e},Yi=function(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),Fi.each(e,function(e,o){return t.call(r,e,o,n)===!1?!1:void Yi(e,t,n,r)}))},Gi=function(t,n){var r,o;for(n=n||e.window,t=t.split("."),r=0;rr&&(n=n[t[r]],n);r++);return n},Ji=function(e,t){return!e||qi(e,"array")?e:Fi.map(e.split(t||","),ji)},Qi=function(e){var t=Ri.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e},ea={trim:ji,isArray:Fi.isArray,is:qi,toArray:Fi.toArray,makeMap:$i,each:Fi.each,map:Fi.map,grep:Fi.filter,inArray:Fi.indexOf,hasOwn:Wi,extend:Xi,create:Ki,walk:Yi,createNS:Gi,resolve:Zi,explode:Ji,_addCacheSuffix:Qi},ta=["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"],na=["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"],ra=["td","th"],oa=["thead","tbody","tfoot"],ia=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],aa=["h1","h2","h3","h4","h5","h6"],ua=["li","dd","dt"],ca=["ul","ol","dl"],sa=["pre","script","textarea","style"],la=function(e){var t;return function(n){return t=t?t:At(e,U(!0)),t.hasOwnProperty(Vr(n))}},fa=la(aa),da=la(ta),ha=function(e){return"table"===Vr(e)},ma=function(e){return jr(e)&&!da(e)},ga=function(e){return jr(e)&&"br"===Vr(e)},pa=la(ia),va=la(ca),ya=la(ua),ba=la(na),Ca=la(oa),wa=la(ra),xa=la(sa),Ea=function(e){var t=e.previousSibling&&"SPAN"===e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"===e.nextSibling.nodeName;return t&&n},za=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},ka=function(e,t){var n,r=t.childNodes;if(!No.isElement(t)||!za(t)){for(n=r.length-1;n>=0;n--)ka(e,r[n]);if(No.isDocument(t)===!1){if(No.isText(t)&&t.nodeValue.length>0){var o=ea.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||o>0)return;if(0===o&&Ea(t))return}else if(No.isElement(t)&&(r=t.childNodes,1===r.length&&za(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||ba(Zt.fromDom(t))))return;e.remove(t)}return t}},Na={trimNode:ka},Sa=ea.makeMap,Ta=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Aa=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ra=/[<>&\"\']/g,Ba=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Da={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:"Ÿ"};Go={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Zo={"<":"<",">":">","&":"&",""":'"',"'":"'"};var Ma=function(e){var t;return t=Zt.fromTag("div").dom(),t.innerHTML=e,t.textContent||t.innerText||e},_a=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":Go[e]||"&#"+e.charCodeAt(0)+";"})},ru=function(e,t,n){return n=n||Yo,e.replace(t?Ta:Aa,function(e){return Go[e]||n[e]||e})},ou=function(e,t){var n=_a(t)||Yo,r=function(e,t){return e.replace(t?Ta:Aa,function(e){return void 0!==Go[e]?Go[e]:void 0!==n[e]?n[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})},o=function(e,t){return ru(e,t,n)},i=Sa(e.replace(/\+/g,","));return i.named&&i.numeric?r:i.named?t?o:ru:i.numeric?nu:eu},iu=function(e){return e.replace(Ba,function(e,t){return t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10),t>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Da[t]||String.fromCharCode(t)):Zo[e]||Yo[e]||Ma(e)})},au={encodeRaw:eu,encodeAllRaw:tu,encodeNumeric:nu,encodeNamed:ru,getEncodeFunc:ou,decode:iu},uu={},cu={},su=ea.makeMap,lu=ea.each,fu=ea.extend,du=ea.explode,hu=ea.inArray,mu=function(e,t){return e=ea.trim(e),e?e.split(t||" "):[]},gu=function(e){var t,n,r,o,i,a,u={},c=function(e,n,r){var o,i,a,c=function(e,t){var n,r,o={};for(n=0,r=e.length;r>n;n++)o[e[n]]=t||{};return o};for(r=r||[],n=n||"","string"==typeof r&&(r=mu(r)),e=mu(e),o=e.length;o--;)i=mu([t,n].join(" ")),a={attributes:c(i),attributesOrder:i,children:c(r,cu)},u[e[o]]=a},s=function(e,t){var n,r,o,i;for(e=mu(e),n=e.length,t=mu(t);n--;)for(r=u[e[n]],o=0,i=t.length;i>o;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])};return uu[e]?uu[e]:(t="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"!==e&&(t+=" 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"!==e&&(t+=" xml:lang",a="acronym applet basefont big font strike tt",r=[r,a].join(" "),lu(mu(a),function(e){c(e,"",r)}),i="center dir isindex noframes",n=[n,i].join(" "),o=[n,r].join(" "),lu(mu(i),function(e){c(e,"",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"===e?" 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"===e?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"!==e&&(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"!==e&&(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"!==e&&(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")),lu(mu("a form meter progress dfn"),function(e){u[e]&&delete u[e].children[e]}),delete u.caption.children.table,delete u.script,uu[e]=u,u)},pu=function(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),lu(e,function(e,r){n[r]=n[r.toUpperCase()]="map"===t?su(e,/[, ]/):du(e,/[, ]/)})),n},vu="",yu=" ",bu=function(e,t,n,r){var o=function(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e};return"#"+o(t)+o(n)+o(r)},Cu=function(e,t){var n,r,o,i,a=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,u=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,c=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,l={},f=vu;for(e=e||{},t&&(o=t.getValidStyles(),i=t.getInvalidStyles()),r=("\\\" \\' \\; \\: ; : "+f).split(" "),n=0;n-1&&r||(h[e+t]=-1===n?c[0]:c.join(" "),delete h[e+"-top"+t],delete h[e+"-right"+t],delete h[e+"-bottom"+t],delete h[e+"-left"+t])}},v=function(e){var t,n=h[e];if(n){for(n=n.split(" "),t=n.length;t--;)if(n[t]!==n[0])return!1;return h[e]=n[0],!0}},y=function(e,t,n,r){v(t)&&v(n)&&v(r)&&(h[e]=h[t]+" "+h[n]+" "+h[r],delete h[t],delete h[n],delete h[r])},b=function(e){return d=!0,l[e]},C=function(e,t){return d&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return l[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},w=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},x=function(e){return e.replace(/\\[0-9a-f]+/gi,w)},E=function(t,n,r,o,i,a){if(i=i||a)return i=C(i),"'"+i.replace(/\'/g,"\\'")+"'";if(n=C(n||r||o),!e.allow_script_urls){var u=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(u))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(u))return""}return m&&(n=m.call(g,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,b).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,b)});r=c.exec(t);)if(c.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),i=r[2].replace(s,""),o&&i){if(o=x(o),i=x(i),-1!==o.indexOf(f)||-1!==o.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(i)))continue;"font-weight"===o&&"700"===i?i="bold":("color"===o||"background-color"===o)&&(i=i.toLowerCase()),i=i.replace(a,bu),i=i.replace(u,E),h[o]=d?C(i,!0):i}p("border","",!0),p("border","-width"),p("border","-color"),p("border","-style"),p("padding",""),p("margin",""),y("border","border-width","border-style","border-color"),"medium none"===h.border&&delete h.border,"none"===h["border-image"]&&delete h["border-image"]}return h},serialize:function(e,t){var n,r,a="",u=function(t){var n,r,i,u;if(n=o[t])for(r=0,i=n.length;i>r;r++)t=n[r],u=e[t],u&&(a+=(a.length>0?" ":"")+t+": "+u+";")},c=function(e,t){var n;return n=i["*"],n&&n[e]?!1:(n=i[t],n&&n[e]?!1:!0)};if(t&&o)u("*"),u(t);else for(n in e)r=e[n],!r||i&&!c(n,t)||(a+=(a.length>0?" ":"")+n+": "+r+";");return a}}},wu="mce-data-",xu=/^(?:mouse|contextmenu)|click/,Eu={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1,mozPressure:1},zu=function(e){return e.isDefaultPrevented===Nu||e.isDefaultPrevented===ku},ku=function(){return!1},Nu=function(){return!0},Su=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},Tu=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},Au=function(e,t){if(e.composedPath){var n=e.composedPath();if(n&&n.length>0)return n[0]}return t},Ru=function(t,n){var r,o=n||{};for(r in t)Eu[r]||(o[r]=t[r]);if(o.target||(o.target=o.srcElement||e.document),Ri.experimentalShadowDom&&(o.target=Au(t,o.target)),t&&xu.test(t.type)&&void 0===t.pageX&&void 0!==t.clientX){var i=o.target.ownerDocument||e.document,a=i.documentElement,u=i.body;o.pageX=t.clientX+(a&&a.scrollLeft||u&&u.scrollLeft||0)-(a&&a.clientLeft||u&&u.clientLeft||0),o.pageY=t.clientY+(a&&a.scrollTop||u&&u.scrollTop||0)-(a&&a.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=Nu,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=Nu,t&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=Nu,o.stopPropagation()},zu(o)===!1&&(o.isDefaultPrevented=ku,o.isPropagationStopped=ku,o.isImmediatePropagationStopped=ku),"undefined"==typeof o.metaKey&&(o.metaKey=!1),o},Bu=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)return void t(o);var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){Tu(e,"DOMContentLoaded",a),Tu(e,"load",a),n.domLoaded||(n.domLoaded=!0,t(o))};i()?a():Su(e,"DOMContentLoaded",a),Su(e,"load",a)},Du=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando=wu+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in e.document.documentElement,this.hasFocusIn="onfocusin"in e.document.documentElement,this.count=1}return t.prototype.bind=function(t,n,r,o){var i,a,u,c,s,l,f,d=this,h=e.window,m=function(e){d.executeHandlers(Ru(e||h.event),i)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[d.expando]?i=t[d.expando]:(i=d.count++,t[d.expando]=i,d.events[i]={}),o=o||t;var g=n.split(" ");for(u=g.length;u--;)c=g[u],l=m,s=f=!1,"DOMContentLoaded"===c&&(c="ready"),d.domLoaded&&"ready"===c&&"complete"===t.readyState?r.call(o,Ru({type:c})):(d.hasMouseEnterLeave||(s=d.mouseEnterLeave[c],s&&(l=function(e){var t,n;if(t=e.currentTarget,n=e.relatedTarget,n&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||(e=Ru(e||h.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,d.executeHandlers(e,i))})),d.hasFocusIn||"focusin"!==c&&"focusout"!==c||(f=!0,s="focusin"===c?"focus":"blur",l=function(e){e=Ru(e||h.event),e.type="focus"===e.type?"focusin":"focusout",d.executeHandlers(e,i)}),a=d.events[i][c],a?"ready"===c&&d.domLoaded?r(Ru({type:c})):a.push({func:r,scope:o}):(d.events[i][c]=a=[{func:r,scope:o}],a.fakeName=s,a.capture=f,a.nativeHandler=l,"ready"===c?Bu(t,l,d):Su(t,s||c,l,f)));return t=a=0,r}},t.prototype.unbind=function(e,t,n){var r,o,i,a,u,c;if(!e||3===e.nodeType||8===e.nodeType)return this;if(r=e[this.expando]){if(c=this.events[r],t){var s=t.split(" ");for(i=s.length;i--;)if(u=s[i],o=c[u]){if(n)for(a=o.length;a--;)if(o[a].func===n){var l=o.nativeHandler,f=o.fakeName,d=o.capture;o=o.slice(0,a).concat(o.slice(a+1)),o.nativeHandler=l,o.fakeName=f,o.capture=d,c[u]=o}n&&0!==o.length||(delete c[u],Tu(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in c)o=c[u],Tu(e,o.fakeName||u,o.nativeHandler,o.capture);c={}}for(u in c)return this;delete this.events[r];try{delete e[this.expando]}catch(h){e[this.expando]=null}}return this},t.prototype.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return this;var o=Ru(null,n);o.type=t,o.target=e;do r=e[this.expando],r&&this.executeHandlers(o,r),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!o.isPropagationStopped());return this},t.prototype.clean=function(e){var t,n;if(!e||3===e.nodeType||8===e.nodeType)return this;if(e[this.expando]&&this.unbind(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(this.unbind(e),n=e.getElementsByTagName("*"),t=n.length;t--;)e=n[t],e[this.expando]&&this.unbind(e);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(e,t){var n,r,o,i,a=this.events[t];if(n=a&&a[e.type])for(r=0,o=n.length;o>r;r++)if(i=n[r],i&&i.func.call(i.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return},t.Event=new t,t}(),Mu="sizzle"+-new Date,_u=e.window.document,Pu=0,Ou=0,Hu=u(),Lu=u(),Iu=u(),Vu=function(e,t){return e===t&&($a=!0),0},Fu="undefined",Uu=1<<31,ju={}.hasOwnProperty,qu=[],$u=qu.pop,Wu=qu.push,Ku=qu.push,Xu=qu.slice,Yu=qu.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},Gu="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",Zu="[\\x20\\t\\r\\n\\f]",Ju="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Qu="\\["+Zu+"*("+Ju+")(?:"+Zu+"*([*^$|!~]?=)"+Zu+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Ju+"))|)"+Zu+"*\\]",ec=":("+Ju+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Qu+")*)|.*)\\)|)",tc=new RegExp("^"+Zu+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Zu+"+$","g"),nc=new RegExp("^"+Zu+"*,"+Zu+"*"),rc=new RegExp("^"+Zu+"*([>+~]|"+Zu+")"+Zu+"*"),oc=new RegExp("="+Zu+"*([^\\]'\"]*?)"+Zu+"*\\]","g"),ic=new RegExp(ec),ac=new RegExp("^"+Ju+"$"),uc={ID:new RegExp("^#("+Ju+")"),CLASS:new RegExp("^\\.("+Ju+")"),TAG:new RegExp("^("+Ju+"|[*])"),ATTR:new RegExp("^"+Qu),PSEUDO:new RegExp("^"+ec),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Zu+"*(even|odd|(([+-]|)(\\d*)n|)"+Zu+"*(?:([+-]|)"+Zu+"*(\\d+)|))"+Zu+"*\\)|)","i"),bool:new RegExp("^(?:"+Gu+")$","i"),needsContext:new RegExp("^"+Zu+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Zu+"*((?:-\\d)?\\d*)"+Zu+"*\\)|)(?=[^-]|$)","i")},cc=/^(?:input|select|textarea|button)$/i,sc=/^h\d$/i,lc=/^[^{]+\{\s*\[native \w/,fc=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,dc=/[+~]/,hc=/'|\\/g,mc=new RegExp("\\\\([\\da-f]{1,6}"+Zu+"?|("+Zu+")|.)","ig"),gc=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{Ku.apply(qu=Xu.call(_u.childNodes),_u.childNodes),qu[_u.childNodes.length].nodeType}catch(pc){Ku={apply:qu.length?function(e,t){Wu.apply(e,Xu.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var vc=function(e,t,n,r){var o,i,a,u,c,s,l,f,d,m;if((t?t.ownerDocument||t:_u)!==Ka&&Wa(t),t=t||Ka,n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=t.nodeType)&&9!==u)return[];if(Ya&&!r){if(o=fc.exec(e))if(a=o[1]){if(9===u){if(i=t.getElementById(a),!i||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&Qa(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return Ku.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&Oa.getElementsByClassName)return Ku.apply(n,t.getElementsByClassName(a)),n}if(Oa.qsa&&(!Ga||!Ga.test(e))){if(f=l=Mu,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(s=Va(e),(l=t.getAttribute("id"))?f=l.replace(hc,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+g(s[c]);d=dc.test(e)&&h(t.parentNode)||t,m=s.join(",")}if(m)try{return Ku.apply(n,d.querySelectorAll(m)),n}catch(p){}finally{l||t.removeAttribute("id")}}}return Ua(e.replace(tc,"$1"),t,n,r)};Oa=vc.support={},Ia=vc.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},Wa=vc.setDocument=function(e){function t(e){try{return e.top}catch(t){}return null}var n,r=e?e.ownerDocument||e:_u,o=r.defaultView;return r!==Ka&&9===r.nodeType&&r.documentElement?(Ka=r,Xa=r.documentElement,Ya=!Ia(r),o&&o!==t(o)&&(o.addEventListener?o.addEventListener("unload",function(){Wa()},!1):o.attachEvent&&o.attachEvent("onunload",function(){Wa()})),Oa.attributes=!0,Oa.getElementsByTagName=!0,Oa.getElementsByClassName=lc.test(r.getElementsByClassName),Oa.getById=!0,Ha.find.ID=function(e,t){if(typeof t.getElementById!==Fu&&Ya){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},Ha.filter.ID=function(e){var t=e.replace(mc,gc);return function(e){return e.getAttribute("id")===t}},Ha.find.TAG=Oa.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Fu?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Ha.find.CLASS=Oa.getElementsByClassName&&function(e,t){return Ya?t.getElementsByClassName(e):void 0},Za=[],Ga=[],Oa.disconnectedMatch=!0,Ga=Ga.length&&new RegExp(Ga.join("|")),Za=Za.length&&new RegExp(Za.join("|")),n=lc.test(Xa.compareDocumentPosition),Qa=n||lc.test(Xa.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Vu=n?function(e,t){if(e===t)return $a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!Oa.sortDetached&&t.compareDocumentPosition(e)===n?e===r||e.ownerDocument===_u&&Qa(_u,e)?-1:t===r||t.ownerDocument===_u&&Qa(_u,t)?1:qa?Yu.call(qa,e)-Yu.call(qa,t):0:4&n?-1:1)}:function(e,t){if(e===t)return $a=!0,0;var n,o=0,i=e.parentNode,a=t.parentNode,u=[e],c=[t];if(!i||!a)return e===r?-1:t===r?1:i?-1:a?1:qa?Yu.call(qa,e)-Yu.call(qa,t):0;if(i===a)return s(e,t);for(n=e;n=n.parentNode;)u.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;u[o]===c[o];)o++;return o?s(u[o],c[o]):u[o]===_u?-1:c[o]===_u?1:0},r):Ka},vc.matches=function(e,t){return vc(e,null,null,t)},vc.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Ka&&Wa(e),t=t.replace(oc,"='$1']"),!(!Oa.matchesSelector||!Ya||Za&&Za.test(t)||Ga&&Ga.test(t)))try{var n=Ja.call(e,t);if(n||Oa.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return vc(t,Ka,null,[e]).length>0},vc.contains=function(e,t){return(e.ownerDocument||e)!==Ka&&Wa(e),Qa(e,t)},vc.attr=function(e,t){(e.ownerDocument||e)!==Ka&&Wa(e);var n=Ha.attrHandle[t.toLowerCase()],r=n&&ju.call(Ha.attrHandle,t.toLowerCase())?n(e,t,!Ya):void 0;return void 0!==r?r:Oa.attributes||!Ya?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},vc.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},vc.uniqueSort=function(e){var t,n=[],r=0,o=0;if($a=!Oa.detectDuplicates,qa=!Oa.sortStable&&e.slice(0),e.sort(Vu),$a){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return qa=null,e},La=vc.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=La(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=La(t);return n},Ha=vc.selectors={cacheLength:50,createPseudo:c,match:uc,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(mc,gc),e[3]=(e[3]||e[4]||e[5]||"").replace(mc,gc),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4) },CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||vc.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&vc.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return uc.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&ic.test(n)&&(t=Va(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(mc,gc).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Hu[e+" "];return t||(t=new RegExp("(^|"+Zu+")"+e+"("+Zu+"|$)"))&&Hu(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Fu&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var o=vc.attr(r,e);return null==o?"!="===t:t?(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o+" ").indexOf(n)>-1:"|="===t?o===n||o.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,c){var s,l,f,d,h,m,g=i!==a?"nextSibling":"previousSibling",p=t.parentNode,v=u&&t.nodeName.toLowerCase(),y=!c&&!u;if(p){if(i){for(;g;){for(f=t;f=f[g];)if(u?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;m=g="only"===e&&!m&&"nextSibling"}return!0}if(m=[a?p.firstChild:p.lastChild],a&&y){for(l=p[Mu]||(p[Mu]={}),s=l[e]||[],h=s[0]===Pu&&s[1],d=s[0]===Pu&&s[2],f=h&&p.childNodes[h];f=++h&&f&&f[g]||(d=h=0)||m.pop();)if(1===f.nodeType&&++d&&f===t){l[e]=[Pu,h,d];break}}else if(y&&(s=(t[Mu]||(t[Mu]={}))[e])&&s[0]===Pu)d=s[1];else for(;(f=++h&&f&&f[g]||(d=h=0)||m.pop())&&((u?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(y&&((f[Mu]||(f[Mu]={}))[e]=[Pu,d]),f!==t)););return d-=o,d===r||d%r===0&&d/r>=0}}},PSEUDO:function(e,t){var n,r=Ha.pseudos[e]||Ha.setFilters[e.toLowerCase()]||vc.error("unsupported pseudo: "+e);return r[Mu]?r(t):r.length>1?(n=[e,e,"",t],Ha.setFilters.hasOwnProperty(e.toLowerCase())?c(function(e,n){for(var o,i=r(e,t),a=i.length;a--;)o=Yu.call(e,i[a]),e[o]=!(n[o]=i[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:c(function(e){var t=[],n=[],r=Fa(e.replace(tc,"$1"));return r[Mu]?c(function(e,t,n,o){for(var i,a=r(e,null,o,[]),u=e.length;u--;)(i=a[u])&&(e[u]=!(t[u]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),!n.pop()}}),has:c(function(e){return function(t){return vc(e,t).length>0}}),contains:c(function(e){return e=e.replace(mc,gc),function(t){return(t.textContent||t.innerText||La(t)).indexOf(e)>-1}}),lang:c(function(e){return ac.test(e||"")||vc.error("unsupported lang: "+e),e=e.replace(mc,gc).toLowerCase(),function(t){var n;do if(n=Ya?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.window.location&&e.window.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===Xa},focus:function(e){return e===Ka.activeElement&&(!Ka.hasFocus||Ka.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!Ha.pseudos.empty(e)},header:function(e){return sc.test(e.nodeName)},input:function(e){return cc.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:d(function(){return[0]}),last:d(function(e,t){return[t-1]}),eq:d(function(e,t,n){return[0>n?n+t:n]}),even:d(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:d(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:d(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:d(function(e,t,n){for(var r=0>n?n+t:n;++r2&&"ID"===(a=i[0]).type&&Oa.getById&&9===t.nodeType&&Ya&&Ha.relative[i[1].type]){if(t=(Ha.find.ID(a.matches[0].replace(mc,gc),t)||[])[0],!t)return n;s&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=uc.needsContext.test(e)?0:i.length;o--&&(a=i[o],!Ha.relative[u=a.type]);)if((c=Ha.find[u])&&(r=c(a.matches[0].replace(mc,gc),dc.test(i[0].type)&&h(t.parentNode)||t))){if(i.splice(o,1),e=r.length&&g(i),!e)return Ku.apply(n,r),n;break}}return(s||Fa(e,l))(r,t,!Ya,n,dc.test(e)&&h(t.parentNode)||t),n},Oa.sortStable=Mu.split("").sort(Vu).join("")===Mu,Oa.detectDuplicates=!!$a,Wa(),Oa.sortDetached=!0;var yc=e.document,bc=Array.prototype.push,Cc=Array.prototype.slice,wc=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,xc=Du.Event,Ec=ea.makeMap("children,contents,next,prev"),zc=function(e){return"undefined"!=typeof e},kc=function(e){return"string"==typeof e},Nc=function(e){return e&&e===e.window},Sc=function(e,t){var n,r,o;for(t=t||yc,o=t.createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},Tc=function(e,t,n,r){var o;if(kc(t))t=Sc(t,jc(e[0]));else if(t.length&&!t.nodeType){if(t=Kc.makeArray(t),r)for(o=t.length-1;o>=0;o--)Tc(e,t[o],n,r);else for(o=0;oo&&(i=e[o],t.call(i,o,i)!==!1);o++);return e},Uc=function(e,t){var n=[];return Fc(e,function(e,r){t(r,e)&&n.push(r)}),n},jc=function(e){return e?9===e.nodeType?e:e.ownerDocument:yc};Hc.fn=Hc.prototype={constructor:Hc,selector:"",context:null,length:0,init:function(t,n){var r,o,i=this;if(!t)return i;if(t.nodeType)return i.context=i[0]=t,i.length=1,i;if(n&&n.nodeType)i.context=n;else{if(n)return Kc(t).attr(n);i.context=n=e.document}if(kc(t)){if(i.selector=t,r="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:wc.exec(t),!r)return Kc(n).find(t);if(r[1])for(o=Sc(t,jc(n)).firstChild;o;)bc.call(i,o),o=o.nextSibling;else{if(o=jc(n).getElementById(r[2]),!o)return i;if(o.id!==r[2])return i.find(t);i.length=1,i[0]=o}}else this.add(t,!1);return i},toArray:function(){return ea.toArray(this)},add:function(e,t){var n,r,o=this;if(kc(e))return o.add(Kc(e));if(t!==!1)for(n=Kc.unique(o.toArray().concat(Kc.makeArray(e))),o.length=n.length,r=0;rt;t++)Kc.find(e,this[t],r);return Kc(r)},filter:function(e){return Kc("function"==typeof e?Uc(this.toArray(),function(t,n){return e(n,t)}):Kc.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof Kc&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&Kc(r).is(e)){t.push(r);break}if(r===e){t.push(r);break}r=r.parentNode}}),Kc(t)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):(t=this[0],t&&(n=t.ownerDocument,r=n.documentElement,t.getBoundingClientRect&&(o=t.getBoundingClientRect(),i=o.left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:bc,sort:Array.prototype.sort,splice:Array.prototype.splice},ea.extend(Hc,{extend:ea.extend,makeArray:function(e){return Nc(e)||e.nodeType?[e]:ea.toArray(e)},inArray:Lc,isArray:ea.isArray,each:Fc,trim:Vc,grep:Uc,find:vc,expr:vc.selectors,unique:vc.uniqueSort,text:vc.getText,contains:vc.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?Kc.find.matchesSelector(t[0],e)?[t[0]]:[]:Kc.find.matches(e,t)}});var qc=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof Kc&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&Kc(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},$c=function(e,t,n,r){var o=[];for(r instanceof Kc&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(void 0!==r){if(e===r)break;if("string"==typeof r&&Kc(e).is(r))break}o.push(e)}return o},Wc=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};Fc({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return qc(e,"parentNode")},next:function(e){return Wc(e,"nextSibling",1)},prev:function(e){return Wc(e,"previousSibling",1)},children:function(e){return $c(e.firstChild,"nextSibling",1)},contents:function(e){return ea.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){Hc.fn[e]=function(n){var r=this,o=[];r.each(function(){var e=t.call(o,this,n,o);e&&(Kc.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(Ec[e]||(o=Kc.unique(o)),0===e.indexOf("parents")&&(o=o.reverse()));var i=Kc(o);return n?i.filter(n):i}}),Fc({parentsUntil:function(e,t){return qc(e,"parentNode",t)},nextUntil:function(e,t){return $c(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return $c(e,"previousSibling",1,t).slice(1)}},function(e,t){Hc.fn[e]=function(n,r){var o=this,i=[];o.each(function(){var e=t.call(i,this,n,i);e&&(Kc.isArray(e)?i.push.apply(i,e):i.push(e))}),this.length>1&&(i=Kc.unique(i),(0===e.indexOf("parents")||"prevUntil"===e)&&(i=i.reverse()));var a=Kc(i);return r?a.filter(r):a}}),Hc.fn.is=function(e){return!!e&&this.filter(e).length>0},Hc.fn.init.prototype=Hc.fn,Hc.overrideDefaults=function(e){var t,n=function(r,o){return t=t||e(),0===arguments.length&&(r=t.element),o||(o=t.context),new n.fn.init(r,o)};return Kc.extend(n,this),n},Hc.attrHooks=Pc,Hc.cssHooks=Oc;var Kc=Hc,Xc=function(){function e(e,t){this.node=e,this.rootNode=t,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 e.prototype.current=function(){return this.node},e.prototype.next=function(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node},e.prototype.prev=function(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node},e.prototype.prev2=function(e){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",e),this.node},e.prototype.findSibling=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==this.rootNode){if(o=e[n])return o;for(i=e.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},e.prototype.findPreviousNode=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if(i=e.parentNode,i&&i!==this.rootNode)return i}},e}(),Yc=ea.each,Gc=ea.grep,Zc=Ri.ie,Jc=/^([a-z0-9],?)+$/i,Qc=/^[ \t\r\n]*$/,es=function(e,t,n){var r=t.keep_values,o={set:function(e,r,o){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||n(),r,o,e[0])),e.attr("data-mce-"+o,r).attr(o,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},i={style:{set:function(t,n){return null!==n&&"object"==typeof n?void t.css(n):(r&&t.attr("data-mce-style",n),void(null!==n&&"string"==typeof n?(t.removeAttr("style"),t.css(e.parse(n))):t.attr("style",n)))},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serialize(e.parse(n),t[0].nodeName)}}};return r&&(i.href=i.src=o),i},ts=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},ns=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};!function(t){t.DOM=t(e.document),t.nodeIndex=ns}(E||(E={}));var rs=E,os=rs.DOM,is=ea.each,as=ea.grep,us=0,cs=1,ss=2,ls=3,fs=function(){function t(e){void 0===e&&(e={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=e}return t.prototype._setReferrerPolicy=function(e){this.settings.referrerPolicy=e},t.prototype.loadScript=function(t,n,r){var o,i,a=os,u=function(){a.remove(i),o&&(o.onreadystatechange=o.onload=o=null),n()},c=function(){at(r)?r():"undefined"!=typeof e.console&&e.console.log&&e.console.log("Failed to load script: "+t)};i=a.uniqueId(),o=e.document.createElement("script"),o.id=i,o.type="text/javascript",o.src=ea._addCacheSuffix(t),this.settings.referrerPolicy&&a.setAttrib(o,"referrerpolicy",this.settings.referrerPolicy),o.onload=u,o.onerror=c,(e.document.getElementsByTagName("head")[0]||e.document.body).appendChild(o)},t.prototype.isDone=function(e){return this.states[e]===ss},t.prototype.markDone=function(e){this.states[e]=ss},t.prototype.add=function(e,t,n,r){var o=this.states[e];void 0===o&&(this.queue.push(e),this.states[e]=us),t&&(this.scriptLoadedCallbacks[e]||(this.scriptLoadedCallbacks[e]=[]),this.scriptLoadedCallbacks[e].push({success:t,failure:r,scope:n||this}))},t.prototype.load=function(e,t,n,r){return this.add(e,t,n,r)},t.prototype.remove=function(e){delete this.states[e],delete this.scriptLoadedCallbacks[e]},t.prototype.loadQueue=function(e,t,n){this.loadScripts(this.queue,e,t,n)},t.prototype.loadScripts=function(e,t,n,r){var o,i=this,a=[],u=function(e,t){is(i.scriptLoadedCallbacks[t],function(t){at(t[e])&&t[e].call(t.scope)}),i.scriptLoadedCallbacks[t]=void 0};i.queueLoadedCallbacks.push({success:t,failure:r,scope:n||this}),(o=function(){var t=as(e);if(e.length=0,is(t,function(e){return i.states[e]===ss?void u("success",e):i.states[e]===ls?void u("failure",e):void(i.states[e]!==cs&&(i.states[e]=cs,i.loading++,i.loadScript(e,function(){i.states[e]=ss,i.loading--,u("success",e),o()},function(){i.states[e]=ls,i.loading--,a.push(e),u("failure",e),o()})))}),!i.loading){var n=i.queueLoadedCallbacks.slice(0);i.queueLoadedCallbacks.length=0,is(n,function(e){0===a.length?at(e.success)&&e.success.call(e.scope):at(e.failure)&&e.failure.call(e.scope,a)})}})()},t.ScriptLoader=new t,t}(),ds=function(e){return nt(e)&&qt(e,"raw")},hs=function(e){return rt(e)&&e.length>1},ms={},gs=Jt("en"),ps=function(){return jt(ms,gs.get())},vs=function(){return Ht(ms,function(e){return $t({},e)})},ys=function(e){e&&gs.set(e)},bs=function(){return gs.get()},Cs=function(e,t){var n=ms[e];n||(ms[e]=n={}),Ot(t,function(e,t){n[t.toLowerCase()]=e})},ws=function(e){var t=ps().getOr({}),n=function(e){return at(e)?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||void 0===e},o=function(e){var r=n(e);return jt(t,r.toLowerCase()).map(n).getOr(r)},i=function(e){return e.replace(/{context:\w+}$/,"")},a=function(e){return e};if(r(e))return a("");if(ds(e))return a(n(e.raw));if(hs(e)){var u=e.slice(1),c=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return qt(u,t)?n(u[t]):e});return a(i(c))}return a(i(o(e)))},xs=function(){return ps().bind(function(e){return jt(e,"_dir")}).exists(function(e){return"rtl"===e})},Es=function(e){return qt(ms,e)},zs={getData:vs,setCode:ys,getCode:bs,add:Cs,translate:ws,isRtl:xs,hasCode:Es};!function(e){e.PluginManager=e(),e.ThemeManager=e()}(z||(z={}));var ks=z,Ns=function(t,n){var r=null,o=function(){null!==r&&(e.clearTimeout(r),r=null)},i=function(){for(var o=[],i=0;i0?Ao(e,t,r.join(" ")):_o(e,t),!1},Bs=function(e){return void 0!==e.dom().classList},Ds=function(e){return Ts(e,"class")},Ms=function(e,t){return As(e,"class",t)},_s=function(e,t){return Rs(e,"class",t)},Ps=function(e,t){Bs(e)?e.dom().classList.add(t):Ms(e,t)},Os=function(e){var t=Bs(e)?e.dom().classList:Ds(e);0===t.length&&_o(e,"class")},Hs=function(e,t){if(Bs(e)){var n=e.dom().classList;n.remove(t)}else _s(e,t);Os(e)},Ls=function(e,t){return Bs(e)&&e.dom().classList.contains(t)},Is=function(e,t){var n=[];return pt(kr(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(Is(e,t))}),n},Vs=function(e,t){return sr(t,e)},Fs=function(e,t,n){for(var r=e.dom(),o=at(n)?n:U(!1);r.parentNode;){r=r.parentNode;var i=Zt.fromDom(r);if(t(i))return J.some(i);if(o(i))break}return J.none()},Us=function(e,t,n){var r=function(e,t){return t(e)};return k(r,Fs,e,t,n)},js=function(e,t,n){return Fs(e,function(e){return ur(e,t)},n)},qs=function(e,t){return lr(t,e)},$s=function(e,t,n){return k(ur,js,e,t,n)},Ws=U("mce-annotation"),Ks=U("data-mce-annotation"),Xs=U("data-mce-annotation-uid"),Ys=function(e,t){var n=e.selection.getRng(),r=Zt.fromDom(n.startContainer),o=Zt.fromDom(e.getBody()),i=t.fold(function(){return"."+Ws()},function(e){return"["+Ks()+'="'+e+'"]'}),a=Nr(r,n.startOffset).getOr(r),u=$s(a,i,function(e){return fr(e,o)}),c=function(e,t){return Mo(e,t)?J.some(Bo(e,t)):J.none()};return u.bind(function(t){return c(t,""+Xs()).bind(function(n){return c(t,""+Ks()).map(function(t){var r=Zs(e,n);return{uid:n,name:t,elements:r}})})})},Gs=function(e){return jr(e)&&Ls(e,Ws())},Zs=function(e,t){var n=Zt.fromDom(e.getBody());return Vs(n,"["+Xs()+'="'+t+'"]')},Js=function(e,t){var n=Zt.fromDom(e.getBody()),r=Vs(n,"["+Ks()+'="'+t+'"]'),o={};return pt(r,function(e){var t=Bo(e,Xs()),n=o.hasOwnProperty(t)?o[t]:[];o[t]=n.concat([e])}),o},Qs=function(e){var t=Jt({}),n=function(){return{listeners:[],previous:Jt(J.none())}},r=function(e,t){o(e,function(e){return t(e),e})},o=function(e,r){var o=t.get(),i=o.hasOwnProperty(e)?o[e]:n(),a=r(i);o[e]=a,t.set(o)},i=function(e,t,n){r(e,function(r){pt(r.listeners,function(r){return r(!0,e,{uid:t,nodes:gt(n,function(e){return e.dom()})})})})},a=function(e){r(e,function(t){pt(t.listeners,function(t){return t(!1,e)})})},u=Ss(function(){var n=t.get(),r=Rt(_t(n));pt(r,function(t){o(t,function(n){var r=n.previous.get();return Ys(e,J.some(t)).fold(function(){r.isSome()&&(a(t),n.previous.set(J.none()))},function(e){var t=e.uid,o=e.name,a=e.elements;r.is(t)||(i(o,t,a),n.previous.set(J.some(t)))}),{previous:n.previous,listeners:n.listeners}})})},30);e.on("remove",function(){u.cancel()}),e.on("NodeChange",function(){u.throttle()});var c=function(e,t){o(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})};return{addListener:c}},el=function(e,t){var n=function(e){return J.from(e.attr(Ks())).bind(t.lookup)};e.on("init",function(){e.serializer.addNodeFilter("span",function(e){pt(e,function(e){n(e).each(function(t){t.persistent===!1&&e.unwrap()})})})})},tl=function(){var e={},t=function(t,n){e[t]={name:t,settings:n}},n=function(t){return e.hasOwnProperty(t)?J.from(e[t]).map(function(e){return e.settings}):J.none()};return{register:t,lookup:n}},nl=0,rl=function(e){var t=new Date,n=t.getTime(),r=Math.floor(1e9*Math.random());return nl++,e+"_"+r+nl+String(n)},ol=function(e,t){pt(t,function(t){Ps(e,t)})},il=function(t,n){var r=n||e.document,o=r.createElement("div");return o.innerHTML=t,kr(Zt.fromDom(o))},al=function(e){return e.dom().innerHTML},ul=function(e,t){var n=pr(e),r=n.dom(),o=Zt.fromDom(r.createDocumentFragment()),i=il(t,r);Or(o,i),Hr(e),Mr(e,o)},cl=function(e,t){return Zt.fromDom(e.dom().cloneNode(t))},sl=function(e){return cl(e,!1)},ll=function(e){return cl(e,!0)},fl=vu,dl=function(e){return e===fl},hl=function(e){return e.replace(new RegExp(fl,"g"),"")},ml={isZwsp:dl,ZWSP:fl,trim:hl},gl=No.isElement,pl=No.isText,vl=function(e){return pl(e)&&(e=e.parentNode),gl(e)&&e.hasAttribute("data-mce-caret")},yl=function(e){return pl(e)&&ml.isZwsp(e.data)},bl=function(e){return vl(e)||yl(e)},Cl=function(e){return e.firstChild!==e.lastChild||!No.isBr(e.firstChild)},wl=function(e,t){var n,r,o,i;if(n=e.ownerDocument,o=n.createTextNode(ml.ZWSP),i=e.parentNode,t){if(r=e.previousSibling,pl(r)){if(bl(r))return r;if(Sl(r))return r.splitText(r.data.length-1)}i.insertBefore(o,e)}else{if(r=e.nextSibling,pl(r)){if(bl(r))return r;if(Nl(r))return r.splitText(1),r}e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o)}return o},xl=function(e){var t=e.container();return e&&No.isText(t)?t.data.charAt(e.offset())===ml.ZWSP||e.isAtStart()&&yl(t.previousSibling):!1},El=function(e){var t=e.container();return e&&No.isText(t)?t.data.charAt(e.offset()-1)===ml.ZWSP||e.isAtEnd()&&yl(t.nextSibling):!1},zl=function(){var t=e.document.createElement("br");return t.setAttribute("data-mce-bogus","1"),t},kl=function(e,t,n){var r,o,i;return r=t.ownerDocument,o=r.createElement(e),o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(zl()),i=t.parentNode,n?i.insertBefore(o,t):t.nextSibling?i.insertBefore(o,t.nextSibling):i.appendChild(o),o},Nl=function(e){return pl(e)&&e.data[0]===ml.ZWSP},Sl=function(e){return pl(e)&&e.data[e.data.length-1]===ml.ZWSP},Tl=function(e){var t=e.getElementsByTagName("br"),n=t[t.length-1];No.isBogus(n)&&n.parentNode.removeChild(n)},Al=function(e){return e&&e.hasAttribute("data-mce-caret")?(Tl(e),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null},Rl=function(e){return vl(e.startContainer)},Bl=No.isContentEditableTrue,Dl=No.isContentEditableFalse,Ml=No.isBr,_l=No.isText,Pl=No.matchNodeNames(["script","style","textarea"]),Ol=No.matchNodeNames(["img","input","textarea","hr","iframe","video","audio","object"]),Hl=No.matchNodeNames(["table"]),Ll=bl,Il=function(e){return Ll(e)?!1:_l(e)?Pl(e.parentNode)?!1:!0:Ol(e)||Ml(e)||Hl(e)||Fl(e)},Vl=function(e){return No.isElement(e)&&"true"===e.getAttribute("unselectable")},Fl=function(e){return Vl(e)===!1&&Dl(e)},Ul=function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(Fl(e))return!1;if(Bl(e))return!0}return!0},jl=function(e){return Fl(e)?wt(Mt(e.getElementsByTagName("*")),function(e,t){return e||Bl(t)},!1)!==!0:!1},ql=function(e){return Ol(e)||jl(e)},$l=function(e,t){return Il(e)&&Ul(e,t)},Wl=Math.round,Kl=function(e){return e?{left:Wl(e.left),top:Wl(e.top),bottom:Wl(e.bottom),right:Wl(e.right),width:Wl(e.width),height:Wl(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Xl=function(e,t){return e=Kl(e),t?e.right=e.left:(e.left=e.left+e.width,e.right=e.left),e.width=0,e},Yl=function(e,t){return e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right},Gl=function(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2},Zl=function(e,t){return e.bottom-e.height/2t.bottom?!1:Gl(t.top-e.bottom,e,t)},Jl=function(e,t){return e.top>t.bottom?!0:e.bottom=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},ef=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},tf=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},nf=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),rf=function(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&nf.test(e)},of=function(e,t,n){return e.isSome()&&t.isSome()?J.some(n(e.getOrDie(),t.getOrDie())):J.none()},af=function(e,t,n,r){return e.isSome()&&t.isSome()&&n.isSome()?J.some(r(e.getOrDie(),t.getOrDie(),n.getOrDie())):J.none()},uf=function(e,t){return e?J.some(t):J.none()},cf=[].slice,sf=function(){for(var e=[],t=0;t0?n[0]:e.getBoundingClientRect()),!zf(e)&&bf(e)&&Tf(t)?Nf(e):Tf(t)&&zf(e)?Sf(e):t},Rf=function(e,t){var n=Xl(e,t);return n.width=1,n.right=n.left+1,n},Bf=function(e){var t,n,r=[],o=function(e){0!==e.height&&(r.length>0&&Yl(e,r[r.length-1])||r.push(e)) },i=function(e,t){var n=xf(e.ownerDocument);if(t0&&(n.setStart(e,t-1),n.setEnd(e,t),kf(n)||o(Rf(Af(n),!1))),t=i.length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Uf(n)),a=jf(e,n),a=Fi.filter(a,q(No.isBogus)),u=u.concat(Fi.map(a,function(e){return Uf(e)})),u.reverse().join("/")+","+o},$f=function(e,t,n){var r=Lf(e);return r=Fi.filter(r,function(e,t){return!_f(e)||!_f(r[t-1])}),r=Fi.filter(r,No.matchNodeNames([t])),r[n]},Wf=function(e,t){for(var n,r=e,o=0;_f(r);){if(n=r.data.length,t>=o&&o+n>=t){e=r,t-=o;break}if(!_f(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return _f(e)&&t>e.data.length&&(t=e.data.length),Mf(e,t)},Kf=function(e,t){var n,r,o;return t?(n=t.split(","),t=n[0].split("/"),o=n.length>1?n[1]:"before",r=Fi.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),$f(e,t[1],parseInt(t[2],10))):null},e),r?_f(r)?Wf(r,parseInt(o,10)):(o="after"===o?Of(r)+1:Of(r),Mf(r.parentNode,o)):null):null},Xf=function(e,t){No.isText(t)&&0===t.data.length&&e.remove(t)},Yf=function(e,t,n){t.insertNode(n),Xf(e,n.previousSibling),Xf(e,n.nextSibling)},Gf=function(e,t,n){var r=J.from(n.firstChild),o=J.from(n.lastChild);t.insertNode(n),r.each(function(t){return Xf(e,t.previousSibling)}),o.each(function(t){return Xf(e,t.nextSibling)})},Zf=function(e,t,n){No.isDocumentFragment(n)?Gf(e,t,n):Yf(e,t,n)},Jf=No.isContentEditableFalse,Qf=function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&No.isText(r);r=r.previousSibling)o+=e(r.data).length;return o},ed=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],c=[],s=0,l=e.getRoot();for(No.isText(a)?c.push(n?Qf(t,a,u):u):(i=a.childNodes,u>=i.length&&i.length&&(s=1,u=Math.max(0,i.length-1)),c.push(e.nodeIndex(i[u],n)+s));a&&a!==l;a=a.parentNode)c.push(e.nodeIndex(a,n));return c},td=function(e,t,n,r){var o=t.dom,i={};return i.start=ed(o,e,n,r,!0),t.isCollapsed()||(i.end=ed(o,e,n,r,!1)),i},nd=function(e,t,n){var r=0;return ea.each(e.select(t),function(e){return"all"!==e.getAttribute("data-mce-bogus")?e===n?!1:void r++:void 0}),r},rd=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],No.isElement(n)&&"TR"===n.nodeName&&(o=n.childNodes,n=o[Math.min(t?r:r-1,o.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))},od=function(e){return rd(e,!0),rd(e,!1),e},id=function(e,t){var n;if(No.isElement(e)&&(e=tf(e,t),Jf(e)))return e;if(bl(e)){if(No.isText(e)&&vl(e)&&(e=e.parentNode),n=e.previousSibling,Jf(n))return n;if(n=e.nextSibling,Jf(n))return n}},ad=function(e){return id(e.startContainer,e.startOffset)||id(e.endContainer,e.endOffset)},ud=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Jf(r)||"IMG"===o)return{name:o,index:nd(n.dom,o,r)};var a=ad(i);return a?(o=a.tagName,{name:o,index:nd(n.dom,o,a)}):td(e,n,t,i)},cd=function(e){var t=e.getRng();return{start:qf(e.dom.getRoot(),Mf.fromRangeStart(t)),end:qf(e.dom.getRoot(),Mf.fromRangeEnd(t))}},sd=function(e){return{rng:e.getRng()}},ld=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,""):e.create("span",r)},fd=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:nd(n,u,a)};var c=od(r.cloneRange());if(!i){c.collapse(!1);var s=ld(n,o+"_end",t);Zf(n,c,s)}r=od(r),r.collapse(!0);var l=ld(n,o+"_start",t);return Zf(n,r,l),e.moveToBookmark({id:o,keep:1}),{id:o}},dd=function(e,t,n){return 2===t?ud(ml.trim,n,e):3===t?cd(e):t?sd(e):fd(e,!1)},hd={getBookmark:dd,getUndoBookmark:t(ud,j,!0),getPersistentBookmark:fd},md=function(e,t,n){void 0===n&&(n=W);var r=new Xc(e,t),o=function(e){var t;do t=r[e]();while(t&&!No.isText(t)&&!n(t));return J.from(t).filter(No.isText)};return{current:function(){return J.from(r.current()).filter(No.isText)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},gd=function(e,t){var n=t?t:function(t){return e.isBlock(t)||No.isBr(t)||No.isContentEditableFalse(t)},r=function(e,t,n,o){if(No.isText(e)){var i=o(e,t,e.data);if(-1!==i)return J.some({container:e,offset:i})}return n().bind(function(e){return r(e.container,e.offset,n,o)})},o=function(e,t,o,i){var a=md(e,i,n);return r(e,t,function(){return a.prev().map(function(e){return{container:e,offset:e.length}})},o).getOrNull()},i=function(e,t,o,i){var a=md(e,i,n);return r(e,t,function(){return a.next().map(function(e){return{container:e,offset:0}})},o).getOrNull()};return{backwards:o,forwards:i}},pd="_mce_caret",vd=function(e){return No.isElement(e)&&e.id===pd},yd=function(e,t){for(;t&&t!==e;){if(t.id===pd)return t;t=t.parentNode}return null},bd=No.isElement,Cd=No.isText,wd=function(e){var t=e.parentNode;t&&t.removeChild(e)},xd=function(e){try{return e.nodeValue}catch(t){return""}},Ed=function(e,t){0===t.length?wd(e):e.nodeValue=t},zd=function(e){var t=ml.trim(e);return{count:e.length-t.length,text:t}},kd=function(e,t){return Bd(e),t},Nd=function(e,t){var n=zd(e.data.substr(0,t.offset())),r=zd(e.data.substr(t.offset())),o=n.text+r.text;return o.length>0?(Ed(e,o),Mf(e,t.offset()-n.count)):t},Sd=function(e,t){var n=t.container(),r=dt(Mt(n.childNodes),e).map(function(e){return e")},Hd=function(e){return e.getParam("document_base_url","")},Ld=function(e){return _d(e,"body_id","tinymce")},Id=function(e){return _d(e,"body_class","")},Vd=function(e){return e.getParam("content_security_policy","")},Fd=function(e){return e.getParam("br_in_pre",!0)},Ud=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return t===!1?"":t===!0?"p":t},jd=function(e){return e.getParam("forced_root_block_attrs",{})},qd=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},$d=function(e){return e.getParam("no_newline_selector","")},Wd=function(e){return e.getParam("keep_styles",!0)},Kd=function(e){return e.getParam("end_container_on_empty_block",!1)},Xd=function(e){return ea.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))},Yd=function(e){return ea.explode(e.getParam("font_size_classes",""))},Gd=function(e){return e.getParam("images_dataimg_filter",U(!0),"function")},Zd=function(e){return e.getParam("automatic_uploads",!0,"boolean")},Jd=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},Qd=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},eh=function(e){return e.getParam("icons","","string")},th=function(e){return e.getParam("icons_url","","string")},nh=function(e){return e.getParam("images_upload_url","","string")},rh=function(e){return e.getParam("images_upload_base_path","","string")},oh=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},ih=function(e){return e.getParam("images_upload_handler",null,"function")},ah=function(e){return e.getParam("content_css_cors",!1,"boolean")},uh=function(e){return e.getParam("referrer_policy","","string")},ch=function(e){return e.getParam("language","en","string")},sh=function(e){return e.getParam("language_url","","string")},lh=function(e){return e.getParam("indent_use_margin",!1)},fh=function(e){return e.getParam("indentation","40px","string")},dh=function(e){var t=e.settings.content_css;return tt(t)?gt(t.split(","),On):rt(t)?t:t===!1||e.inline?[]:["default"]},hh=function(e){return e.getParam("directionality",zs.isRtl()?"rtl":void 0)},mh=function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")},gh=function(e){return e.getParam("object_resizing")},ph=function(e){return e.getParam("resize_img_proportional",!0,"boolean")},vh=function(e){return e.getParam("placeholder",Md.getAttrib(e.getElement(),"placeholder"),"string")},yh={getIframeAttrs:Pd,getDocType:Od,getDocumentBaseUrl:Hd,getBodyId:Ld,getBodyClass:Id,getContentSecurityPolicy:Vd,shouldPutBrInPre:Fd,getForcedRootBlock:Ud,getForcedRootBlockAttrs:jd,getBrNewLineSelector:qd,getNoNewLineSelector:$d,shouldKeepStyles:Wd,shouldEndContainerOnEmptyBlock:Kd,getFontStyleValues:Xd,getFontSizeClasses:Yd,getIconPackName:eh,getIconsUrl:th,getImagesDataImgFilter:Gd,isAutomaticUploadsEnabled:Zd,shouldReuseFileName:Jd,shouldReplaceBlobUris:Qd,getImageUploadUrl:nh,getImageUploadBasePath:rh,getImagesUploadCredentials:oh,getImagesUploadHandler:ih,shouldUseContentCssCors:ah,getReferrerPolicy:uh,getLanguageCode:ch,getLanguageUrl:sh,shouldIndentUseMargin:lh,getIndentation:fh,getContentCss:dh,getDirectionality:hh,getInlineBoundarySelector:mh,getObjectResizing:gh,getResizeImgProportional:ph,getPlaceholder:vh},bh=Xn().browser,Ch=No.isContentEditableFalse,wh=function(e){return No.isElement(e)&&/^(TD|TH)$/i.test(e.tagName)},xh=function(e,t,n){var r,o,i,a,u,c=Xl(t.getBoundingClientRect(),n);return"BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,i=e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,i=e.scrollTop-u.top),c.left+=o,c.right+=o,c.top+=i,c.bottom+=i,c.width=1,a=t.offsetWidth-t.clientWidth,a>0&&(n&&(a*=-1),c.left+=a,c.right+=a),c},Eh=function(e){var t,n,r,o,i;for(t=Kc("*[contentEditable=false]",e),o=0;o0?u:"p",s=function(e,r){var o,u;if(l(),wh(r))return null;if(!n(r))return i=wl(r,e),u=r.ownerDocument.createRange(),Ch(i.nextSibling)?(u.setStart(i,0),u.setEnd(i,0)):(u.setStart(i,1),u.setEnd(i,1)),u;i=kl(c,r,e),o=xh(t,r,e),Kc(i).css("top",o.top);var s=Kc('
').css(o).appendTo(t)[0];return a.set(J.some({caret:s,element:r,before:e})),a.get().each(function(t){e&&Kc(t.caret).addClass("mce-visual-caret-before")}),f(),u=r.ownerDocument.createRange(),u.setStart(i,0),u.setEnd(i,0),u},l=function(){Eh(t),i&&(Dd.remove(i),i=null),a.get().each(function(e){Kc(e.caret).remove(),a.set(J.none())}),wi.clearInterval(o)},f=function(){o=wi.setInterval(function(){r()?Kc("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden"):Kc("div.mce-visual-caret",t).addClass("mce-visual-caret-hidden")},500)},d=function(){a.get().each(function(e){var n=xh(t,e.element,e.before);Kc(e.caret).css($t({},n))})},h=function(){return wi.clearInterval(o)},m=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;}"};return{show:s,hide:l,getCss:m,reposition:d,destroy:h}},kh=function(){return bh.isIE()||bh.isEdge()||bh.isFirefox()},Nh=function(e){return Ch(e)||No.isTable(e)&&kh()},Sh=No.isContentEditableFalse,Th=No.matchStyleValues("display","block table table-cell table-caption list-item"),Ah=bl,Rh=vl,Bh=No.isElement,Dh=Il,Mh=function(e){return e>0},_h=function(e){return 0>e},Ph=function(e,t){for(var n;n=e(t);)if(!Rh(n))return n;return null},Oh=function(e,t,n,r,o){var i=new Xc(e,r);if(_h(t)){if((Sh(e)||Rh(e))&&(e=Ph(i.prev,!0),n(e)))return e;for(;e=Ph(i.prev,o);)if(n(e))return e}if(Mh(t)){if((Sh(e)||Rh(e))&&(e=Ph(i.next,!0),n(e)))return e;for(;e=Ph(i.next,o);)if(n(e))return e}return null},Hh=function(e,t){for(;e&&e!==t;){if(Th(e))return e;e=e.parentNode}return null},Lh=function(e,t,n){return Hh(e.container(),n)===Hh(t.container(),n)},Ih=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),Bh(n)?n.childNodes[r+e]:null):null},Vh=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},Fh=function(e,t,n){return Hh(t,e)===Hh(n,e)},Uh=function(e,t,n){var r,o;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],Ah(r)&&(r=r[o]),Sh(r)){if(Fh(t,r,n))return r;break}if(Dh(r))break;n=n.parentNode}return null},jh=t(Vh,!0),qh=t(Vh,!1),$h=function(e,n,r){var o,i,a,u,c=t(Uh,!0,n),s=t(Uh,!1,n);if(i=r.startContainer,a=r.startOffset,vl(i)){if(Bh(i)||(i=i.parentNode),u=i.getAttribute("data-mce-caret"),"before"===u&&(o=i.nextSibling,Nh(o)))return jh(o);if("after"===u&&(o=i.previousSibling,Nh(o)))return qh(o)}if(!r.collapsed)return r;if(No.isText(i)){if(Ah(i)){if(1===e){if(o=s(i))return jh(o);if(o=c(i))return qh(o)}if(-1===e){if(o=c(i))return qh(o);if(o=s(i))return jh(o)}return r}if(Sl(i)&&a>=i.data.length-1)return 1===e&&(o=s(i))?jh(o):r;if(Nl(i)&&1>=a)return-1===e&&(o=c(i))?qh(o):r;if(a===i.data.length)return o=s(i),o?jh(o):r;if(0===a)return o=c(i),o?qh(o):r}return r},Wh=function(e,t){return J.from(Ih(e?0:-1,t)).filter(Sh)},Kh=function(e,t,n){var r=$h(e,t,n);return-1===e?N.fromRangeStart(r):N.fromRangeEnd(r)},Xh=function(e){return J.from(e.getNode()).map(Zt.fromDom)},Yh=function(e){return J.from(e.getNode(!0)).map(Zt.fromDom)},Gh=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Zh=function(e,t){var n=Lh(e,t);return!n&&No.isBr(e.getNode())?!0:n};!function(e){e[e.Backwards=-1]="Backwards",e[e.Forwards=1]="Forwards"}(Df||(Df={}));var Jh=No.isContentEditableFalse,Qh=No.isText,em=No.isElement,tm=No.isBr,nm=Il,rm=ql,om=$l,im=function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n},am=function(e,t){return e.hasChildNodes()&&t0)return Mf(c,--s);if(Mh(e)&&s0&&(o=am(c,s-1),nm(o)))return!rm(o)&&(i=Oh(o,e,om,o))?Qh(i)?Mf(i,i.data.length):Mf.after(i):Qh(o)?Mf(o,o.data.length):Mf.before(o);if(Mh(e)&&s=1;o--){if(u=i.childNodes,Pm(s,i,r))return!0;if(c[o]>u.length-1)return Pm(s,i,r)?!0:_m(i,r);i=u[c[o]]}3===i.nodeType&&(a=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(c[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},Hm=function(e){return No.isText(e)&&e.data.length>0},Lm=function(e,t,n){var r,o,i,a,u,c,s=e.get(n.id+"_"+t),l=n.keep;if(s){if(r=s.parentNode,"start"===t?(l?s.hasChildNodes()?(r=s.firstChild,o=1):Hm(s.nextSibling)?(r=s.nextSibling,o=0):Hm(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=e.nodeIndex(s)+1):o=e.nodeIndex(s),u=r,c=o):(l?s.hasChildNodes()?(r=s.firstChild,o=1):Hm(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=e.nodeIndex(s)):o=e.nodeIndex(s),u=r,c=o),!l){for(a=s.previousSibling,i=s.nextSibling,ea.each(ea.grep(s.childNodes),function(e){No.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});s=e.get(n.id+"_"+t);)e.remove(s,!0);a&&i&&a.nodeType===i.nodeType&&No.isText(a)&&!Ri.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),"start"===t?(u=a,c=o):(u=a,c=o))}return J.some(Mf(u,c))}return J.none()},Im=function(e,t){var n=e.createRng();return Om(e,!0,t,n)&&Om(e,!1,t,n)?J.some(n):J.none()},Vm=function(e,t){var n=Lm(e,"start",t),r=Lm(e,"end",t);return of(n,r.or(n),function(t,n){var r=e.createRng();return r.setStart(Rm(e,t.container()),t.offset()),r.setEnd(Rm(e,n.container()),n.offset()),r})},Fm=function(e,t){return J.from(e.select(t.name)[t.index]).map(function(t){var n=e.createRng();return n.selectNode(t),n})},Um=function(e,t){var n=e.dom;if(t){if(Am(t))return Im(n,t);if(km(t))return J.some(Bm(n,t));if(Sm(t))return Vm(n,t);if(Tm(t))return Fm(n,t);if(Nm(t))return J.some(t.rng)}return J.none()},jm={resolve:Um},qm=function(e,t,n){return hd.getBookmark(e,t,n)},$m=function(e,t){jm.resolve(e,t).each(function(t){e.setRng(t)})},Wm=function(e){return No.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Km={getBookmark:qm,moveToBookmark:$m,isBookmarkNode:Wm},Xm=function(e){return function(t){return e===t}},Ym=Xm(yu),Gm=function(e){return""!==e&&-1!==" \f\n\r ".indexOf(e)},Zm=function(e){return!Gm(e)&&!Ym(e)},Jm=function(e){return!!e.nodeType},Qm=function(e){return e&&/^(IMG)$/.test(e.nodeName)},eg=function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!Qm(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(i=u.childNodes,a=0:i0:i=n.length?t=n.length-1:0>t&&(t=0),n[t]||e},Tg=function(e,t){return Sg(e,t-1)},Ag=function(e,t,n){var r=t.startContainer,o=t.startOffset,i=t.endContainer,a=t.endOffset,u=e.select("td[data-mce-selected],th[data-mce-selected]");if(u.length>0)return void Ng(u,function(e){n([e])});var c=function(e){var t;return t=e[0],3===t.nodeType&&t===r&&o>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===a&&e.length>0&&t===i&&3===t.nodeType&&e.splice(e.length-1,1),e},s=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},l=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},f=function(e,t,r){for(var o=r?"nextSibling":"previousSibling",i=e,a=i.parentNode;i&&i!==t;i=a){a=i.parentNode;var u=s(i===e?i:i[o],o);u.length&&(r||u.reverse(),n(c(u)))}};if(1===r.nodeType&&r.hasChildNodes()&&(r=Sg(r,o)),1===i.nodeType&&i.hasChildNodes()&&(i=Tg(i,a)),r===i)return n(c([r]));for(var d=e.findCommonAncestor(r,i),h=r;h;h=h.parentNode){if(h===i)return f(r,d,!0);if(h===d)break}for(var h=i;h;h=h.parentNode){if(h===r)return f(i,d);if(h===d)break}var m=l(r,d)||r,g=l(i,d)||i;f(r,m,!0);var p=s(m===r?m:m.nextSibling,"nextSibling",g===i?g.nextSibling:g);p.length&&n(c(p)),f(i,g)},Rg={walk:Ag},Bg=S(qr,"text"),Dg=function(e){return Bg.get(e)},Mg=function(e){return qr(e)&&Dg(e)===vu},_g=function(e,t,n,r){return br(t).fold(function(){return"skipping"},function(o){return"br"===r||Mg(t)?"valid":Gs(t)?"existing":vd(t)?"caret":rg(e,n,r)&&rg(e,Vr(o),n)?"valid":"invalid-child"})},Pg=function(e,t){var n=kg(e,t,[{inline:!0}]);t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t)},Og=function(e,t,n,o){var i=t.uid,a=void 0===i?rl("mce-annotation"):i,u=r(t,["uid"]),c=Zt.fromTag("span",e);Ps(c,Ws()),Ao(c,""+Xs(),a),Ao(c,""+Ks(),n);var s=o(a,u),l=s.attributes,f=void 0===l?{}:l,d=s.classes,h=void 0===d?[]:d;return Ro(c,f),ol(c,h),c},Hg=function(e,t,n,r,o){var i=[],a=Og(e.getDoc(),o,n,r),u=Jt(J.none()),c=function(){u.set(J.none())},s=function(){return u.get().getOrThunk(function(){var e=sl(a);return i.push(e),u.set(J.some(e)),e})},l=function(e){pt(e,f)},f=function(t){var n=_g(e,t,"span",Vr(t));switch(n){case"invalid-child":c();var r=kr(t);l(r),c();break;case"valid":var o=s();_r(t,o)}},d=function(e){var t=gt(e,Zt.fromDom);l(t)};return Rg.walk(e.dom,t,function(e){c(),d(e)}),i},Lg=function(e,t,n,r){e.undoManager.transact(function(){var o=e.selection.getRng();if(o.collapsed&&Pg(e,o),e.selection.getRng().collapsed){var i=Og(e.getDoc(),r,t,n.decorate);ul(i,yu),e.selection.getRng().insertNode(i.dom()),e.selection.select(i.dom())}else{var a=hd.getPersistentBookmark(e.selection,!1),u=e.selection.getRng();Hg(e,u,t,n.decorate,r),e.selection.moveToBookmark(a)}})},Ig=function(e){var t=tl();el(e,t);var n=Qs(e);return{register:function(e,n){t.register(e,n)},annotate:function(n,r){t.lookup(n).each(function(t){Lg(e,n,t,r)})},annotationChanged:function(e,t){n.addListener(e,t)},remove:function(t){Ys(e,J.some(t)).each(function(e){var t=e.elements;pt(t,Ir)})},getAll:function(t){var n=Js(e,t);return Ht(n,function(e){return gt(e,function(e){return e.dom()})})}}},Vg=/^[ \t\r\n]*$/,Fg={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Ug=function(e,t,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(e[r])return e[r];if(e!==t){var i=e[o];if(i)return i;for(var a=e.parent;a&&a!==t;a=a.parent)if(i=a[o])return i}},jg=function(e){if(!Vg.test(e.value))return!1;var t=e.parent;return t&&("span"!==t.name||t.attr("style"))&&/^[ ]+$/.test(e.value)?!1:!0},qg=function(e){var t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t},$g=function(){function e(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}return e.create=function(t,n){var r=new e(t,Fg[t]||1);if(n)for(var o in n)r.attr(o,n[o]);return r},e.prototype.replace=function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},e.prototype.attr=function(e,t){var n,r=this;if("string"!=typeof e){for(var o in e)r.attr(o,e[o]);return r}if(n=r.attributes){if(void 0!==t){if(null===t){if(e in n.map){delete n.map[e];for(var i=n.length;i--;)if(n[i].name===e)return n.splice(i,1),r}return r}if(e in n.map){for(var i=n.length;i--;)if(n[i].name===e){n[i].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,r}return n.map[e]}},e.prototype.clone=function(){var t,n=this,r=new e(n.name,n.type);if(t=n.attributes){var o=[];o.map={};for(var i=0,a=t.length;a>i;i++){var u=t[i];"id"!==u.name&&(o[o.length]={name:u.name,value:u.value},o.map[u.name]=u.value)}r.attributes=o}return r.value=n.value,r.shortEnded=n.shortEnded,r},e.prototype.wrap=function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},e.prototype.unwrap=function(){for(var e=this,t=e.firstChild;t;){var n=t.next;e.insert(t,e,!0),t=n}e.remove()},e.prototype.remove=function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e },e.prototype.append=function(e){var t=this;e.parent&&e.remove();var n=t.lastChild;return n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},e.prototype.insert=function(e,t,n){e.parent&&e.remove();var r=t.parent||this;return n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},e.prototype.getAll=function(e){for(var t=this,n=[],r=t.firstChild;r;r=Ug(r,t))r.name===e&&n.push(r);return n},e.prototype.empty=function(){var e=this;if(e.firstChild){for(var t=[],n=e.firstChild;n;n=Ug(n,e))t.push(n);for(var r=t.length;r--;){var n=t[r];n.parent=n.firstChild=n.lastChild=n.next=n.prev=null}}return e.firstChild=e.lastChild=null,e},e.prototype.isEmpty=function(e,t,n){void 0===t&&(t={});var r=this,o=r.firstChild;if(qg(r))return!1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(e[o.name])return!1;if(qg(o))return!1}if(8===o.type)return!1;if(3===o.type&&!jg(o))return!1;if(3===o.type&&o.parent&&t[o.parent.name]&&Vg.test(o.value))return!1;if(n&&n(o))return!1}while(o=Ug(o,r));return!0},e.prototype.walk=function(e){return Ug(this,null,e)},e}(),Wg=function(e){return 0===e.indexOf("data-")||0===e.indexOf("aria-")},Kg=function(e,t){return e.allow_html_data_urls?!1:/^data:image\//i.test(t)?e.allow_svg_data_urls===!1&&/^data:image\/svg\+xml/i.test(t):/^data:/i.test(t)},Xg=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g,i.lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r},Yg=function(e,t){return/^\s*\[if [\w\W]+\]>.*/.test(e.substr(t))},Gg=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&Yg(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/;a.lastIndex=n;var u=a.exec(e);return u?u.index+u[0].length:r.length},Zg=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};!function(e){e.findEndTag=Xg}(T||(T={}));var Jg,Qg=T,ep=function(e,t){var n=new RegExp(["\\s?("+e.join("|")+')="[^"]+"'].join("|"),"gi");return t.replace(n,"")},tp=function(e,t){var n,r,o,i,a,u=t,c=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,s=e.schema;for(u=ep(e.getTempAttrs(),u),a=s.getShortEndedElements();i=c.exec(u);)r=c.lastIndex,o=i[0].length,n=a[i[1]]?r:Qg.findEndTag(s,u,r),u=u.substring(0,r-o)+u.substring(n),c.lastIndex=r-o;return ml.trim(u)},np=tp,rp={trimExternal:np,trimInternal:tp},op="html",ip=function(e,t){var n=yh.getForcedRootBlock(e),r=new RegExp("^(<"+n+"[^>]*>( | |\\s| |
|)<\\/"+n+">[\r\n]*|
[\r\n]*)$");return t.replace(r,"")},ap=function(e,t,n){var r;if(t.format=t.format?t.format:op,t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)r=ea.trim(rp.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=ml.trim(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);r=ip(e,e.serializer.serialize(n,t))}return t.content="text"===t.format||xa(Zt.fromDom(n))?r:ea.trim(r),t.no_events||e.fire("GetContent",t),t.content},up=function(e,t){return void 0===t&&(t={}),J.from(e.getBody()).fold(U("tree"===t.format?new $g("body",11):""),function(n){return ap(e,t,n)})},cp=ea.makeMap,sp=function(e){var t,n,r,o,i,a=[];return e=e||{},t=e.indent,n=cp(e.indent_before||""),r=cp(e.indent_after||""),o=au.getEncodeFunc(e.entity_encoding||"raw",e.entities),i="html"===e.element_format,{start:function(e,u,c){var s,l,f,d;if(t&&n[e]&&a.length>0&&(d=a[a.length-1],d.length>0&&"\n"!==d&&a.push("\n")),a.push("<",e),u)for(s=0,l=u.length;l>s;s++)f=u[s],a.push(" ",f.name,'="',o(f.value,!0),'"');a[a.length]=!c||i?">":" />",c&&t&&r[e]&&a.length>0&&(d=a[a.length-1],d.length>0&&"\n"!==d&&a.push("\n"))},end:function(e){var n;a.push(""),t&&r[e]&&a.length>0&&(n=a[a.length-1],n.length>0&&"\n"!==n&&a.push("\n"))},text:function(e,t){e.length>0&&(a[a.length]=t?e:o(e))},cdata:function(e){a.push("")},comment:function(e){a.push("")},pi:function(e,n){n?a.push(""):a.push(""),t&&a.push("\n")},doctype:function(e){a.push("",t?"\n":"")},reset:function(){a.length=0},getContent:function(){return a.join("").replace(/\n$/,"")}}},lp=function(e,t){void 0===t&&(t=a());var n=sp(e);e=e||{},e.validate="validate"in e?e.validate:!0;var r=function(r){var o,i;i=e.validate,o={3:function(e){n.text(e.value,e.raw)},8:function(e){n.comment(e.value)},7:function(e){n.pi(e.name,e.value)},10:function(e){n.doctype(e.value)},4:function(e){n.cdata(e.value)},11:function(e){if(e=e.firstChild)do a(e);while(e=e.next)}},n.reset();var a=function(e){var r,u,c,s,l,f,d,h,m,g=o[e.type];if(g)g(e);else{if(r=e.name,u=e.shortEnded,c=e.attributes,i&&c&&c.length>1&&(f=[],f.map={},m=t.getElementRule(e.name))){for(d=0,h=m.attributesOrder.length;h>d;d++)s=m.attributesOrder[d],s in c.map&&(l=c.map[s],f.map[s]=l,f.push({name:s,value:l}));for(d=0,h=c.length;h>d;d++)s=c[d].name,s in f.map||(l=c.map[s],f.map[s]=l,f.push({name:s,value:l}));c=f}if(n.start(e.name,c,u),!u){if(e=e.firstChild)do a(e);while(e=e.next);n.end(r)}}};return 1!==r.type||e.inner?o[11](r):a(r),n.getContent()};return{serialize:r}},fp=function(e,t){t(e),e.firstChild&&fp(e.firstChild,t),e.next&&fp(e.next,t)},dp=function(e,t,n){var r={},o={},i=[];n.firstChild&&fp(n.firstChild,function(n){pt(e,function(e){e.name===n.name&&(r[e.name]?r[e.name].nodes.push(n):r[e.name]={filter:e,nodes:[n]})}),pt(t,function(e){"string"==typeof n.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(n):o[e.name]={filter:e,nodes:[n]})})});for(var a in r)r.hasOwnProperty(a)&&i.push(r[a]);for(var u in o)o.hasOwnProperty(u)&&i.push(o[u]);return i},hp=function(e,t,n){var r=dp(e,t,n);pt(r,function(e){pt(e.filter.callbacks,function(t){t(e.nodes,e.filter.name,{})})})},mp=function(e){var t=pr(e).dom();return e.dom()===t.activeElement},gp=function(t){var n=void 0!==t?t.dom():e.document;return J.from(n.activeElement).map(Zt.fromDom)},pp=function(e){return gp(pr(e)).filter(function(t){return e.dom().contains(t.dom())})},vp=function(t){if(!rt(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var n=[],r={};return pt(t,function(o,i){var a=_t(o);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],c=o[u];if(void 0!==r[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!rt(c))throw new Error("case arguments must be an array");n.push(u),r[u]=function(){var r=arguments.length;if(r!==c.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+c.length+" ("+c+"), got "+r);for(var o=new Array(r),a=0;an?n:0>e?0:e},Ip=function(e){return Op.range(e.start(),Lp(e.soffset(),e.start()),e.finish(),Lp(e.foffset(),e.finish()))},Vp=function(e,t){return!No.isRestrictedNode(t.dom())&&(gr(e,t)||fr(e,t))},Fp=function(e){return function(t){return Vp(e,t.start())&&Vp(e,t.finish())}},Up=function(e){return e.inline===!0||Hp.isIE()},jp=function(e){return Op.range(Zt.fromDom(e.startContainer),e.startOffset,Zt.fromDom(e.endContainer),e.endOffset)},qp=function(e){var t=e.getSelection(),n=t&&0!==t.rangeCount?J.from(t.getRangeAt(0)):J.none();return n.map(jp)},$p=function(e){var t=yr(e);return qp(t.dom()).filter(Fp(e))},Wp=function(e,t){return J.from(t).filter(Fp(e)).map(Ip)},Kp=function(t){var n=e.document.createRange();try{return n.setStart(t.start().dom(),t.soffset()),n.setEnd(t.finish().dom(),t.foffset()),J.some(n)}catch(r){return J.none()}},Xp=function(e){var t=Up(e)?$p(Zt.fromDom(e.getBody())):J.none();e.bookmark=t.isSome()?t:e.bookmark},Yp=function(e,t){var n=Zt.fromDom(e.getBody()),r=Up(e)?J.from(t):J.none(),o=r.map(jp).filter(Fp(n));e.bookmark=o.isSome()?o:e.bookmark},Gp=function(e){var t=e.bookmark?e.bookmark:J.none();return t.bind(function(t){return Wp(Zt.fromDom(e.getBody()),t)}).bind(Kp)},Zp=function(e){Gp(e).each(function(t){e.selection.setRng(t)})},Jp={store:Xp,storeNative:Yp,readRange:qp,restore:Zp,getRng:Gp,getBookmark:$p,validate:Wp},Qp=function(e){var t=e.className.toString();return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")},ev={isEditorUIElement:Qp},tv=function(e){return"nodechange"===e.type&&e.selectionChange},nv=function(t,n){var r=function(){n.throttle()};rs.DOM.bind(e.document,"mouseup",r),t.on("remove",function(){rs.DOM.unbind(e.document,"mouseup",r)})},rv=function(e){e.on("focusout",function(){Jp.store(e)})},ov=function(e,t){e.on("mouseup touchend",function(){t.throttle()})},iv=function(e,t){var n=Xn().browser;n.isIE()?rv(e):ov(e,t),e.on("keyup NodeChange",function(t){tv(t)||Jp.store(e)})},av=function(e){var t=Ns(function(){Jp.store(e)},0);e.on("init",function(){e.inline&&nv(e,t),iv(e,t)}),e.on("remove",function(){t.cancel()})},uv={register:av},cv=rs.DOM,sv=function(e){return ev.isEditorUIElement(e)},lv=function(e){var t=e.classList;return void 0!==t?t.contains("tox-edit-area")||t.contains("tox-edit-area__iframe")||t.contains("mce-content-body"):!1},fv=function(e,t){var n=e?e.settings.custom_ui_selector:"",r=cv.getParent(t,function(t){return sv(t)||(n?e.dom.is(t,n):!1)});return null!==r},dv=function(){try{return e.document.activeElement}catch(t){return e.document.body}},hv=function(t,n){var r=n.editor;uv.register(r),r.on("focusin",function(){var e=this,n=t.focusedEditor;n!==e&&(n&&n.fire("blur",{focusedEditor:e}),t.setActive(e),t.focusedEditor=e,e.fire("focus",{blurredEditor:n}),e.focus(!0))}),r.on("focusout",function(){var e=this;wi.setEditorTimeout(e,function(){var n=t.focusedEditor;fv(e,dv())||n!==e||(e.fire("blur",{focusedEditor:null}),t.focusedEditor=null)})}),Jg||(Jg=function(n){var r,o=t.activeEditor;r=n.target,o&&r.ownerDocument===e.document&&(r===e.document.body||fv(o,r)||t.focusedEditor!==o||(o.fire("blur",{focusedEditor:null}),t.focusedEditor=null))},cv.bind(e.document,"focusin",Jg))},mv=function(t,n){t.focusedEditor===n.editor&&(t.focusedEditor=null),t.activeEditor||(cv.unbind(e.document,"focusin",Jg),Jg=null)},gv=function(e){e.on("AddEditor",t(hv,e)),e.on("RemoveEditor",t(mv,e))},pv={setup:gv,isEditorUIElement:sv,isEditorContentAreaElement:lv,isUIElement:fv},vv=function(e,t){return e.dom.getParent(t,function(t){return"true"===e.dom.getContentEditable(t)})},yv=function(e){return e.collapsed?J.from(tf(e.startContainer,e.startOffset)).map(Zt.fromDom):J.none()},bv=function(e,t){return yv(t).bind(function(t){return Ca(t)?J.some(t):gr(e,t)===!1?J.some(e):J.none()})},Cv=function(e,t){bv(Zt.fromDom(e.getBody()),t).bind(function(e){return zm.firstPositionIn(e.dom())}).fold(function(){e.selection.normalize()},function(t){return e.selection.setRng(t.toRange())})},wv=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},xv=function(e){return mp(e)||pp(e).isSome()},Ev=function(e){return e.iframeElement&&mp(Zt.fromDom(e.iframeElement))},zv=function(e){var t=e.getBody();return t&&xv(Zt.fromDom(t))},kv=function(e){return gp().filter(function(t){return!pv.isEditorContentAreaElement(t.dom())&&pv.isUIElement(e,t.dom())}).isSome()},Nv=function(e){return e.inline?zv(e):Ev(e)},Sv=function(e){return Nv(e)||kv(e)},Tv=function(e){var t=e.selection,n=e.getBody(),r=t.getRng();e.quirks.refreshContentEditable(),void 0!==e.bookmark&&Nv(e)===!1&&Jp.getRng(e).each(function(t){e.selection.setRng(t),r=t});var o=vv(e,t.getNode());return e.$.contains(n,o)?(wv(o),Cv(e,r),void Av(e)):(e.inline||(Ri.opera||wv(n),e.getWin().focus()),(Ri.gecko||e.inline)&&(wv(n),Cv(e,r)),void Av(e))},Av=function(e){return e.editorManager.setActive(e)},Rv=function(e,t){e.removed||(t?Av(e):Tv(e))},Bv={focus:Rv,hasFocus:Nv,hasEditorOrUiFocus:Sv},Dv="html",Mv=function(e){return e instanceof $g},_v=function(e){Bv.hasFocus(e)&&zm.firstPositionIn(e.getBody()).each(function(t){var n=t.getNode(),r=No.isTable(n)?zm.firstPositionIn(n).getOr(t):t;e.selection.setRng(r.toRange())})},Pv=function(e,t){e.dom.setHTML(e.getBody(),t),_v(e)},Ov=function(e,t,n,r){var o,i;return 0===n.length||/^\s+$/.test(n)?(i='
',"TABLE"===t.nodeName?n=""+i+"":/^(UL|OL)$/.test(t.nodeName)&&(n="
  • "+i+"
  • "),o=yh.getForcedRootBlock(e),o&&e.schema.isValidChild(t.nodeName.toLowerCase(),o.toLowerCase())?(n=i,n=e.dom.createHTML(o,e.settings.forced_root_block_attrs,n)):n||(n='
    '),Pv(e,n),e.fire("SetContent",r)):("raw"!==r.format&&(n=lp({validate:e.validate},e.schema).serialize(e.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=xa(Zt.fromDom(t))?n:ea.trim(n),Pv(e,r.content),r.no_events||e.fire("SetContent",r)),r.content},Hv=function(e,t,n,r){hp(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=lp({validate:e.validate},e.schema).serialize(n);return r.content=xa(Zt.fromDom(t))?o:ea.trim(o),Pv(e,r.content),r.no_events||e.fire("SetContent",r),n},Lv=function(e,t,n){return void 0===n&&(n={}),n.format=n.format?n.format:Dv,n.set=!0,n.content=Mv(t)?"":t,Mv(t)||n.no_events||(e.fire("BeforeSetContent",n),t=n.content),J.from(e.getBody()).fold(U(t),function(r){return Mv(t)?Hv(e,r,t,n):Ov(e,r,t,n)})},Iv=function(e,t){return e.fire("PreProcess",t)},Vv=function(e,t){return e.fire("PostProcess",t)},Fv=function(e){return e.fire("remove")},Uv=function(e){return e.fire("detach")},jv=function(e,t){return e.fire("SwitchMode",{mode:t})},qv=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},$v=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},Wv=function(e){return e.fire("PreInit")},Kv=function(e){return e.fire("PostRender")},Xv=function(e){return e.fire("Init")},Yv=function(e,t){return e.fire("PlaceholderToggle",{state:t})},Gv=function(e,t,n){return e.fire(t,n)},Zv=rs.DOM,Jv=function(e){Zv.setStyle(e.id,"display",e.orgDisplay)},Qv=function(e){return J.from(e).each(function(e){return e.destroy()})},ey=function(e){e.contentAreaContainer=e.formElement=e.container=e.editorContainer=null,e.bodyElement=e.contentDocument=e.contentWindow=null,e.iframeElement=e.targetElm=null,e.selection&&(e.selection=e.selection.win=e.selection.dom=e.selection.dom.doc=null)},ty=function(e){var t=e.formElement;t&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,t._mceOldSubmit=null),Zv.unbind(t,"submit reset",e.formEventDelegate))},ny=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&Zv.remove(o.nextSibling),Fv(e),e.editorManager.remove(e),!e.inline&&r&&Jv(e),Uv(e),Zv.remove(e.getContainer()),Qv(t),Qv(n),e.destroy()}},ry=function(e,t){var n=e.selection,r=e.dom;if(!e.destroyed){if(!t&&!e.removed)return void e.remove();t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Qv(n),Qv(r)),ty(e),ey(e),e.destroyed=!0}},oy=Object.prototype.hasOwnProperty,iy=function(e,t){var n=nt(e)&&nt(t);return n?uy(e,t):t},ay=function(e){return function(){for(var t=new Array(arguments.length),n=0;n0})},py=function(e){return bt(e,t(ht,hy))},vy=function(e,t){var n=Ft(t,function(t,n){return ht(e,n)});return cy(n.t,n.f)},yy=function(e,t,n){void 0===n&&(n={});var r=e.sections(),o=r.hasOwnProperty(t)?r[t]:{};return ea.extend({},n,o)},by=function(e,t){return e.sections().hasOwnProperty(t)},Cy=function(e,t,n){var r=e.sections();return by(e,t)&&r[t].theme===n},wy=function(e,t){return by(e,t)?e.sections()[t]:{}},xy=function(e,t){return jt(e,"toolbar_mode").orThunk(function(){return jt(e,"toolbar_drawer").map(function(e){return e===!1?"wrap":e})}).getOr(t)},Ey=function(e,t,n,r,o){var i={id:t,theme:"silver",toolbar_mode:xy(e,"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:"",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 $t($t({},i),r?my:{})},zy=function(e,t){var n={resize:!1,toolbar_mode:xy(e,"scrolling"),toolbar_sticky:!1},r={menubar:!1};return $t($t($t({},my),n),t?r:{})},ky=function(e,t){var n=t.external_plugins?t.external_plugins:{};return e&&e.external_plugins?ea.extend({},e.external_plugins,n):n},Ny=function(e,t){return[].concat(gy(e)).concat(gy(t))},Sy=function(e,t,n,r){var o=gy(n.forced_plugins),i=gy(r.plugins),a=wy(t,"mobile"),u=a.plugins?gy(a.plugins):i,c=e&&Cy(t,"mobile","mobile")?py(u):e&&by(t,"mobile")?u:i,s=Ny(o,c);return ea.extend(r,{plugins:s.join(" ")})},Ty=function(e,t){return e&&by(t,"mobile")},Ay=function(e,t,n,r,o){var i=e?{mobile:zy(o,t)}:{},a=vy(["mobile"],uy(i,o)),u=ea.extend(n,r,a.settings(),Ty(e,a)?yy(a,"mobile"):{},{validate:!0,external_plugins:ky(r,a.settings())});return Sy(e,a,r,u)},Ry=function(e,t,n,r,o){var i=Ey(o,t,n,ly,e);return Ay(fy||dy,fy,i,r,o)},By=function(e,t,n){return J.from(t.settings[n]).filter(e)},Dy=function(e){var t={};return"string"==typeof e?pt(e.split(e.indexOf("=")>0?/[;,](?![^=;,]*(?:[;,]|$))/:","),function(e){var n=e.split("=");t[ea.trim(n[0])]=ea.trim(n.length>1?n[1]:n[0])}):t=e,t},My=function(e){return function(t){return rt(t)&&Nt(t,e)}},_y=function(e,t,n,r){var o=t in e.settings?e.settings[t]:n;return"hash"===r?Dy(o):"string"===r?By(tt,e,t).getOr(n):"number"===r?By(ut,e,t).getOr(n):"boolean"===r?By(it,e,t).getOr(n):"object"===r?By(nt,e,t).getOr(n):"array"===r?By(rt,e,t).getOr(n):"string[]"===r?By(My(tt),e,t).getOr(n):"function"===r?By(at,e,t).getOr(n):o},Py=function(){var e={},t=function(t,n){e[t]=n},n=function(t){return e[t]?e[t]:{icons:{}}},r=function(t){return qt(e,t)};return{add:t,get:n,has:r}},Oy=Py(),Hy=function(e,t){var n=t.dom();return n[e]},Ly=function(e,t){return parseInt(Po(t,e),10)},Iy=t(Hy,"clientWidth"),Vy=t(Hy,"clientHeight"),Fy=t(Ly,"margin-top"),Uy=t(Ly,"margin-left"),jy=function(e){return e.dom().getBoundingClientRect()},qy=function(e,t,n){var r=Iy(e),o=Vy(e);return t>=0&&n>=0&&r>=t&&o>=n},$y=function(e,t,n,r){var o=jy(t),i=e?o.left+t.dom().clientLeft+Uy(t):0,a=e?o.top+t.dom().clientTop+Fy(t):0,u=n-i,c=r-a;return{x:u,y:c}},Wy=function(e,t,n){var r=Zt.fromDom(e.getBody()),o=e.inline?r:vr(r),i=$y(e.inline,o,t,n);return qy(o,i.x,i.y)},Ky=function(e){return J.from(e).map(Zt.fromDom)},Xy=function(e){var t=e.inline?e.getBody():e.getContentAreaContainer();return Ky(t).map(function(e){return gr(pr(e),e)}).getOr(!1)},Yy={isXYInContentArea:Wy,isEditorAttachedToDom:Xy},Gy=ks.PluginManager,Zy=ks.ThemeManager,Jy=function(e){var t=[],n=function(){var t=e.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():B()},r=function(e,t){return function(){return t?t.apply(e,arguments):void 0}},o=function(t){e.fire("OpenWindow",{dialog:t})},i=function(t){e.fire("CloseWindow",{dialog:t})},a=function(e){t.push(e),o(e)},u=function(n){i(n),t=bt(t,function(e){return e!==n}),0===t.length&&e.focus()},c=function(){return J.from(t[t.length-1])},s=function(t){e.editorManager.setActive(e),Jp.store(e);var n=t();return a(n),n},l=function(e,t){return s(function(){return n().open(e,t,u)})},f=function(e){return s(function(){return n().openUrl(e,u)})},d=function(e,t,o){n().alert(e,r(o?o:this,t))},h=function(e,t,o){n().confirm(e,r(o?o:this,t))},m=function(){c().each(function(e){n().close(e),u(e)})};return e.on("remove",function(){pt(t,function(e){n().close(e)})}),{open:l,openUrl:f,alert:d,confirm:h,close:m}},Qy=function(e,t){e.notificationManager.open({type:"error",text:t})},eb=function(e,t){e._skinLoaded?Qy(e,t):e.on("SkinLoaded",function(){Qy(e,t)})},tb=function(e,t){eb(e,zs.translate(["Failed to upload image: {0}",t]))},nb=function(t,n,r){Gv(t,n,{message:r}),e.console.error(r)},rb=function(e,t,n){return n?"Failed to load "+e+": "+n+" from url "+t:"Failed to load "+e+" url: "+t},ob=function(e,t,n){nb(e,"PluginLoadError",rb("plugin",t,n))},ib=function(e,t,n){nb(e,"IconsLoadError",rb("icons",t,n))},ab=function(e,t,n){nb(e,"LanguageLoadError",rb("language",t,n))},ub=function(e,t,n){var r=zs.translate(["Failed to initialize plugin: {0}",t]);cb(r,n),eb(e,r)},cb=function(){for(var t=[],n=1;n',"action-next":'',"action-prev":'',"align-center":'',"align-justify":'',"align-left":'',"align-none":'',"align-right":'',"arrow-left":'',"arrow-right":'',bold:'',bookmark:'',"border-width":'',brightness:'',browse:'',cancel:'',"change-case":'',"character-count":'',"checklist-rtl":'',checklist:'',checkmark:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',close:'',"code-sample":'',"color-levels":'',"color-picker":'',"color-swatch-remove-color":'',"color-swatch":'',"comment-add":'',comment:'',contrast:'',copy:'',crop:'',cut:'',"document-properties":'',drag:'',duplicate:'',"edit-block":'',"edit-image":'',"embed-page":'',embed:'',emoji:'',fill:'',"flip-horizontally":'',"flip-vertically":'',"format-painter":'',format:'',fullscreen:'',gallery:'',gamma:'',help:'',"highlight-bg-color":'',home:'',"horizontal-rule":'',"image-options":'',image:'',indent:'',info:'',"insert-character":'',"insert-time":'',invert:'',italic:'',line:'',link:'',"list-bull-circle":'',"list-bull-default":'',"list-bull-square":'',"list-num-default-rtl":'',"list-num-default":'',"list-num-lower-alpha-rtl":'',"list-num-lower-alpha":'',"list-num-lower-greek-rtl":'',"list-num-lower-greek":'',"list-num-lower-roman-rtl":'',"list-num-lower-roman":'',"list-num-upper-alpha-rtl":'',"list-num-upper-alpha":'',"list-num-upper-roman-rtl":'',"list-num-upper-roman":'',lock:'',ltr:'',"more-drawer":'',"new-document":'',"new-tab":'',"non-breaking":'',notice:'',"ordered-list-rtl":'',"ordered-list":'',orientation:'',outdent:'',"page-break":'',paragraph:'',"paste-text":'',paste:'',"permanent-pen":'',plus:'',preferences:'',preview:'',print:'',quote:'',redo:'',reload:'',"remove-formatting":'',remove:'',"resize-handle":'',resize:'',"restore-draft":'',"rotate-left":'',"rotate-right":'',rtl:'',save:'',search:'',"select-all":'',selected:'',settings:'',sharpen:'',"sort-asc":'',"sort-dsc":'',sourcecode:'',"spell-check":'',"strike-through":'',subscript:'',superscript:'',"table-cell-properties":'',"table-cell-select-all":'',"table-cell-select-inner":'',"table-delete-column":'',"table-delete-row":'',"table-delete-table":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',"table-left-header":'',"table-merge-cells":'',"table-row-properties":'',"table-split-cells":'',"table-top-header":'',table:'',template:'',"temporary-placeholder":'',"text-color":'',toc:'',translate:'',underline:'',undo:'',unlink:'',unlock:'',"unordered-list":'',unselected:'',upload:'',user:'',visualblocks:'',visualchars:'',warning:'',"zoom-in":'',"zoom-out":''} },fb=function(e){return/^[a-z0-9\-]+$/i.test(e)},db=function(e){var t=yh.getContentCss(e),n=e.editorManager.baseURL+"/skins/content",r=e.editorManager.suffix,o="content"+r+".css",i=e.inline===!0;return gt(t,function(t){return fb(t)&&!i?n+"/"+t+"/"+o:e.documentBaseURI.toAbsolute(t)})},hb=function(e){e.contentCSS=e.contentCSS.concat(db(e))};!function(e){e.isBookmarkNode=Km.isBookmarkNode}(D||(D={}));var mb=D,gb=function(e,t,n){if(n.collapsed)return!1;if(Ri.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(No.isElement(r))return mt(r.getClientRects(),function(n){return Ql(n,e,t)})}return mt(n.getClientRects(),function(n){return Ql(n,e,t)})},pb={isXYWithinRange:gb},vb={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return Ri.mac?e.metaKey:e.ctrlKey&&!e.altKey}},yb=No.isContentEditableFalse,bb=No.isContentEditableTrue,Cb=function(e,t){for(;t&&t!==e;){if(bb(t)||yb(t))return t;t=t.parentNode}return null},wb=function(t,n){var r,o,i,a,u,c,s,l,f,d,h,m,g,p,v,y,b,C=n.dom,w=ea.each,x=n.getDoc(),E=e.document,z=Math.abs,k=Math.round,N=n.getBody();a={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var S=function(e){return e&&("IMG"===e.nodeName||n.dom.is(e,"figure.image"))},T=function(e,t){if("longpress"===e.type||0===e.type.indexOf("touch")){var n=e.touches[0];return S(e.target)&&!pb.isXYWithinRange(n.clientX,n.clientY,t)}return S(e.target)&&!pb.isXYWithinRange(e.clientX,e.clientY,t)},A=function(e){var t=e.target;T(e,n.selection.getRng())&&!e.isDefaultPrevented()&&n.selection.select(t)},R=function(e){return n.dom.is(e,"figure.image")?e.querySelector("img"):e},B=function(e){var t=yh.getObjectResizing(n);return t===!1||Ri.iOS?!1:("string"!=typeof t&&(t="table,img,figure.image,div"),"false"===e.getAttribute("data-mce-resize")?!1:e===n.getBody()?!1:ur(Zt.fromDom(e),t))},D=function(e){var t,a,w,x,E;t=e.screenX-c,a=e.screenY-s,p=t*u[2]+d,v=a*u[3]+h,p=5>p?5:p,v=5>v?5:v,w=S(r)&&yh.getResizeImgProportional(n)!==!1?!vb.modifierPressed(e):vb.modifierPressed(e),w&&(z(t)>z(a)?(v=k(p*m),p=k(v/m)):(p=k(v/m),v=k(p*m))),C.setStyles(R(o),{width:p,height:v}),x=u.startPos.x+t,E=u.startPos.y+a,x=x>0?x:0,E=E>0?E:0,C.setStyles(i,{left:x,top:E,display:"block"}),i.innerHTML=p+" × "+v,u[2]<0&&o.clientWidth<=p&&C.setStyle(o,"left",l+(d-p)),u[3]<0&&o.clientHeight<=v&&C.setStyle(o,"top",f+(h-v)),t=N.scrollWidth-y,a=N.scrollHeight-b,t+a!==0&&C.setStyles(i,{left:x-t,top:E-a}),g||(qv(n,r,d,h),g=!0)},M=function(){g=!1;var e=function(e,t){t&&(r.style[e]||!n.schema.isValid(r.nodeName.toLowerCase(),e)?C.setStyle(R(r),e,t):C.setAttrib(R(r),e,t))};e("width",p),e("height",v),C.unbind(x,"mousemove",D),C.unbind(x,"mouseup",M),E!==x&&(C.unbind(E,"mousemove",D),C.unbind(E,"mouseup",M)),C.remove(o),C.remove(i),_(r),$v(n,r,p,v),C.setAttrib(r,"style",C.getAttrib(r,"style")),n.nodeChanged()},_=function(e){var t,g,z,k,S;P(),L(),t=C.getPos(e,N),l=t.x,f=t.y,S=e.getBoundingClientRect(),g=S.width||S.right-S.left,z=S.height||S.bottom-S.top,r!==e&&(r=e,p=v=0),k=n.fire("ObjectSelected",{target:e}),B(e)&&!k.isDefaultPrevented()?w(a,function(e,t){var n,a=function(t){c=t.screenX,s=t.screenY,d=R(r).clientWidth,h=R(r).clientHeight,m=h/d,u=e,e.startPos={x:g*e[0]+l,y:z*e[1]+f},y=N.scrollWidth,b=N.scrollHeight,o=r.cloneNode(!0),C.addClass(o,"mce-clonedresizable"),C.setAttrib(o,"data-mce-bogus","all"),o.contentEditable=!1,o.unSelectabe=!0,C.setStyles(o,{left:l,top:f,margin:0}),o.removeAttribute("data-mce-selected"),N.appendChild(o),C.bind(x,"mousemove",D),C.bind(x,"mouseup",M),E!==x&&(C.bind(E,"mousemove",D),C.bind(E,"mouseup",M)),i=C.add(N,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},d+" × "+h)};n=C.get("mceResizeHandle"+t),n&&C.remove(n),n=C.add(N,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),11===Ri.ie&&(n.contentEditable=!1),C.bind(n,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),a(e)}),e.elm=n,C.setStyles(n,{left:g*e[0]+l-n.offsetWidth/2,top:z*e[1]+f-n.offsetHeight/2})}):P(),r.setAttribute("data-mce-selected","1")},P=function(){var e,t;L(),r&&r.removeAttribute("data-mce-selected");for(e in a)t=C.get("mceResizeHandle"+e),t&&(C.unbind(t),C.remove(t))},O=function(e){var r,o,i=function(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)};return g||n.removed?void 0:(w(C.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),o="mousedown"===e.type?e.target:t.getNode(),o=C.$(o).closest("table,img,figure.image,hr")[0],i(o,N)&&(I(),r=t.getStart(!0),i(r,o)&&i(t.getEnd(!0),o))?void _(o):void P())},H=function(e){return yb(Cb(n.getBody(),e))},L=function(){for(var e in a){var t=a[e];t.elm&&(C.unbind(t.elm),delete t.elm)}},I=function(){try{n.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};n.on("init",function(){if(I(),Ri.browser.isIE()||Ri.browser.isEdge()){n.on("mousedown click",function(e){var t=e.target,r=t.nodeName;g||!/^(TABLE|IMG|HR)$/.test(r)||H(t)||(2!==e.button&&n.selection.select(t,"TABLE"===r),"mousedown"===e.type&&n.nodeChanged())});var e=function(e){var t=function(e){wi.setEditorTimeout(n,function(){return n.selection.select(e)})};return H(e.target)?(e.preventDefault(),void t(e.target)):void(/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target)))};C.bind(N,"mscontrolselect",e),n.on("remove",function(){return C.unbind(N,"mscontrolselect",e)})}var t=wi.throttle(function(e){n.composing||O(e)});n.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),n.on("keyup compositionend",function(e){r&&"TABLE"===r.nodeName&&t(e)}),n.on("hide blur",P),n.on("contextmenu longpress",A,!0)}),n.on("remove",L);var V=function(){r=o=null};return{isResizable:B,showResizeRect:_,hideResizeRect:P,updateResizeRect:O,destroy:V}},xb=M("height",function(e){var t=e.dom();return $r(e)?t.getBoundingClientRect().height:t.offsetHeight}),Eb=function(e){return xb.get(e)},zb=function(e,t){var n=e.view(t);return n.fold(U([]),function(t){var n=e.owner(t),r=zb(e,n);return[t].concat(r)})},kb=function(e,t){var n=t.owner(e);return zb(t,n)},Nb=function(t){var n=t.dom()===e.document?J.none():J.from(t.dom().defaultView.frameElement);return n.map(Zt.fromDom)},Sb=function(e){return pr(e)},Tb=Object.freeze({__proto__:null,view:Nb,owner:Sb}),Ab=function(t){var n=Zt.fromDom(e.document),r=Qr(n),o=kb(t,Tb),i=Zr(t),a=Ct(o,function(e,t){var n=Zr(t);return{left:e.left+n.left(),top:e.top+n.top()}},{left:0,top:0});return Kr(a.left+i.left()+r.left(),a.top+i.top()+r.top())},Rb=function(e){return"textarea"===Vr(e)},Bb=function(e,t){var n=e.fire("ScrollIntoView",t);return n.isDefaultPrevented()},Db=function(e,t){e.fire("AfterScrollIntoView",t)},Mb=function(e,t){var n=kr(e);if(0===n.length||Rb(e))return{element:e,offset:t};if(t'+ml.ZWSP+"");return Rr(n.element,r),_b(r,function(){return Lr(r)})},Ob=function(e){return _b(Zt.fromDom(e),V)},Hb=function(e,t,n,r){Fb(e,function(){return Ib(e,t,n,r)},n)},Lb=function(e,t,n,r,o){var i={elm:r.element.dom(),alignToTop:o};if(!Bb(e,i)){var a=Qr(t).top();n(t,a,r,o),Db(e,i)}},Ib=function(e,t,n,r){var o=Zt.fromDom(e.getBody()),i=Zt.fromDom(e.getDoc());Io(o);var a=Pb(Zt.fromDom(n.startContainer),n.startOffset);Lb(e,i,t,a,r),a.cleanup()},Vb=function(e,t,n,r){var o=Zt.fromDom(e.getDoc());Lb(e,o,n,Ob(t),r)},Fb=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(Zt.fromDom(r),Zt.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n)},Ub=function(e,t,n,r){var o=e.pos;if(n)eo(o.left(),o.top(),r);else{var i=o.top()-t+e.height;eo(o.left(),i,r)}},jb=function(e,t,n,r,o){var i=n+t,a=r.pos.top(),u=r.bottom,c=u-a>=n;if(t>a)Ub(r,n,o!==!1,e);else if(a>i){var s=c?o!==!1:o===!0;Ub(r,n,s,e)}else u>i&&!c&&Ub(r,n,o===!0,e)},qb=function(e,t,n,r){var o=e.dom().defaultView.innerHeight;jb(e,t,o,n,r)},$b=function(t,n,r,o){var i=t.dom().defaultView.innerHeight;jb(t,n,i,r,o);var a=Ab(r.element),u=oo(e.window);a.top()u.bottom()&&to(r.element,o===!0)},Wb=function(e,t,n){return Hb(e,qb,t,n)},Kb=function(e,t,n){return Vb(e,t,qb,n)},Xb=function(e,t,n){return Hb(e,$b,t,n)},Yb=function(e,t,n){return Vb(e,t,$b,n)},Gb=function(e,t,n){var r=e.inline?Kb:Yb;r(e,t,n)},Zb=function(e,t,n){var r=e.inline?Wb:Xb;r(e,t,n)},Jb={scrollElementIntoView:Gb,scrollRangeIntoView:Zb},Qb=function(e){return No.isContentEditableTrue(e)||No.isContentEditableFalse(e)},eC=function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null},tC=function(e,t,n){var r,o,i;if(r=n.elementFromPoint(e,t),o=n.body.createTextRange(),r&&"HTML"!==r.tagName||(r=n.body),o.moveToElementText(r),i=ea.toArray(o.getClientRects()),i=i.sort(function(e,n){return e=Math.abs(Math.max(e.top-t,e.bottom-t)),n=Math.abs(Math.max(n.top-t,n.bottom-t)),e-n}),i.length>0){t=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,t),o.collapse(!0),o}catch(a){}}return null},nC=function(e,t){var n=e&&e.parentElement?e.parentElement():null;return No.isContentEditableFalse(eC(n,t,Qb))?null:e},rC=function(e,t,n){var r,o,i=n;if(i.caretPositionFromPoint)o=i.caretPositionFromPoint(e,t),o&&(r=n.createRange(),r.setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(a){r=tC(e,t,n)}return nC(r,n.body)}return r},oC={fromPoint:rC},iC=function(e,t){return gt(t,function(t){var n=e.fire("GetSelectionRange",{range:t});return n.range!==t?n.range:t})},aC={processRanges:iC},uC=function(t,n){var r=n||e.document,o=r.createDocumentFragment();return pt(t,function(e){o.appendChild(e.dom())}),Zt.fromDom(o)},cC=function(e){return e.slice(0,-1)},sC=function(e,t,n){return gr(t,e)?cC(Cr(e,function(e){return n(e)||fr(e,t)})):[]},lC=function(e,t){return sC(e,t,U(!1))},fC=function(e,t){return[e].concat(lC(e,t))},dC={parentsUntil:sC,parents:lC,parentsAndSelf:fC},hC=function(e){var t=e.startContainer,n=e.startOffset;return No.isText(t)?0===n?J.some(Zt.fromDom(t)):J.none():J.from(t.childNodes[n]).map(Zt.fromDom)},mC=function(e){var t=e.endContainer,n=e.endOffset;return No.isText(t)?n===t.data.length?J.some(Zt.fromDom(t)):J.none():J.from(t.childNodes[n-1]).map(Zt.fromDom)},gC=function(e){return Sr(e).fold(U([e]),function(t){return[e].concat(gC(t))})},pC=function(e){return Tr(e).fold(U([e]),function(t){return"br"===Vr(t)?wr(t).map(function(t){return[e].concat(pC(t))}).getOr([]):[e].concat(pC(t))})},vC=function(e,n){return of(hC(n),mC(n),function(n,r){var o=xt(gC(e),t(fr,n)),i=xt(pC(e),t(fr,r));return o.isSome()&&i.isSome()}).getOr(!1)},yC=function(e,t,n,r){var o=n,i=new Xc(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==ea.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},bC=function(e){var t=e.selection.getSel();return t&&t.rangeCount>0},CC=Yn("element","width","rows"),wC=Yn("element","cells"),xC=Yn("x","y"),EC=function(e,t){var n=parseInt(Bo(e,t),10);return isNaN(n)?1:n},zC=function(e,t,n,r,o){for(var i=EC(o,"rowspan"),a=EC(o,"colspan"),u=e.rows(),c=n;n+i>c;c++){u[c]||(u[c]=wC(ll(r),[]));for(var s=t;t+a>s;s++){var l=u[c].cells();l[s]=c===n&&s===t?o:sl(o)}}},kC=function(e,t,n){var r=e.rows(),o=r[n]?r[n].cells():[];return!!o[t]},NC=function(e,t,n){for(;kC(e,t,n);)t++;return t},SC=function(e){return wt(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},TC=function(e,t){for(var n=e.rows(),r=0;r=u;u++){var c=a[u].cells(),s=r>t?c.slice(t,r+1):c.slice(r,t+1);i.push(wC(a[u].element(),s))}return i},RC=function(e,t,n){var r=t.x(),o=t.y(),i=n.x(),a=n.y(),u=a>o?AC(e,r,o,i,a):AC(e,r,a,i,o);return CC(e.element(),SC(u),u)},BC=function(e,t){var n=sl(e.element()),r=Zt.fromTag("tbody");return Or(r,t),Mr(n,r),n},DC=function(e){return gt(e.rows(),function(e){var t=gt(e.cells(),function(e){var t=ll(e);return _o(t,"colspan"),_o(t,"rowspan"),t}),n=sl(e.element());return Or(n,t),n})},MC=function(e){var t=CC(sl(e),0,[]);return pt(Vs(e,"tr"),function(e,n){pt(Vs(e,"td,th"),function(r,o){zC(t,NC(t,o,n),n,e,r)})}),CC(t.element(),SC(t.rows()),t.rows())},_C=function(e){return BC(e,DC(e))},PC=function(e,t,n){return TC(e,t).bind(function(t){return TC(e,n).map(function(n){return RC(e,t,n)})})},OC={fromDom:MC,toDom:_C,subsection:PC},HC=function(e){var t=[];if(e)for(var n=0;n1},VC={getRanges:HC,getSelectedNodes:LC,hasMultipleRanges:IC},FC=function(e){return bt(VC.getSelectedNodes(e),wa)},UC=function(e){return Vs(e,"td[data-mce-selected],th[data-mce-selected]")},jC=function(e,t){var n=UC(t),r=FC(e);return n.length>0?n:r},qC=function(e){return jC(VC.getRanges(e.selection.getSel()),Zt.fromDom(e.getBody()))},$C={getCellsFromRanges:FC,getCellsFromElement:UC,getCellsFromElementOrRanges:jC,getCellsFromEditor:qC},WC=function(e){return xt(e,function(e){return"ul"===Vr(e)||"ol"===Vr(e)})},KC=function(e,t){return xt(e,function(e){return"li"===Vr(e)&&vC(e,t)}).fold(U([]),function(){return WC(e).map(function(e){return[Zt.fromTag("li"),Zt.fromTag(Vr(e))]}).getOr([])})},XC=function(e,t){var n=wt(t,function(e,t){return Mr(t,e),t},e);return t.length>0?uC([n]):n},YC=function(e){return ya(e)?br(e).filter(va).fold(U([]),function(t){return[e,t]}):va(e)?[e]:[]},GC=function(e,t){var n=Zt.fromDom(t.commonAncestorContainer),r=dC.parentsAndSelf(n,e),o=bt(r,function(e){return ma(e)||fa(e)}),i=KC(r,t),a=o.concat(i.length?i:YC(n));return gt(a,sl)},ZC=function(){return uC([])},JC=function(e,t){return XC(Zt.fromDom(t.cloneContents()),GC(e,t))},QC=function(e,n){return js(n,"table",t(fr,e))},ew=function(e,t){return QC(e,t[0]).bind(function(e){var n=t[0],r=t[t.length-1],o=OC.fromDom(e);return OC.subsection(o,n,r).map(function(e){return uC([OC.toDom(e)])})}).getOrThunk(ZC)},tw=function(e,t){return t.length>0&&t[0].collapsed?ZC():JC(e,t[0])},nw=function(e,t){var n=$C.getCellsFromElementOrRanges(t,e);return n.length>0?ew(e,n):tw(e,t)},rw={read:nw},ow=function(e){return J.from(e.selection.getRng()).map(function(t){var n=e.dom.add(e.getBody(),"div",{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},t.cloneContents()),r=ml.trim(n.innerText);return e.dom.remove(n),r}).getOr("")},iw=function(e,t){var n,r=e.selection.getRng(),o=e.dom.create("body"),i=e.selection.getSel(),a=aC.processRanges(e,VC.getRanges(i));return n=t.contextual?rw.read(Zt.fromDom(e.getBody()),a).dom():r.cloneContents(),n&&o.appendChild(n),e.selection.serializer.serialize(o,t)},aw=function(e,t){if(void 0===t&&(t={}),t.get=!0,t.format=t.format||"html",t.selection=!0,t=e.fire("BeforeGetContent",t),t.isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return ow(e);t.getInner=!0;var n=iw(e,t);return"tree"===t.format?n:(t.content=e.selection.isCollapsed()?"":n,e.fire("GetContent",t),t.content)},uw={getContent:aw},cw=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},sw={isEq:cw},lw=function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null},fw=function(e,t,n){return null!==lw(e,t,n)},dw=function(e,t,n){return fw(e,t,function(e){return e.nodeName===n})},hw=function(e){return e&&"TABLE"===e.nodeName},mw=function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)},gw=function(e,t){return bl(e)&&fw(e,t,vd)===!1},pw=function(e,t,n){for(var r=new Xc(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(No.isBr(t))return!0},vw=function(e,t){return e.previousSibling&&e.previousSibling.nodeName===t},yw=function(e,t){for(;t&&t!==e;){if(No.isContentEditableFalse(t))return!0;t=t.parentNode}return!1},bw=function(e,t,n,r,o){var i,a,u=e.getRoot(),c=e.schema.getNonEmptyElements(),s=e.getParent(o.parentNode,e.isBlock)||u;if(r&&No.isBr(o)&&t&&e.isEmpty(s))return J.some(N(o.parentNode,e.nodeIndex(o)));for(var l=new Xc(o,s);a=l[r?"prev":"next"]();){if("false"===e.getContentEditableParent(a)||gw(a,u))return J.none();if(No.isText(a)&&a.nodeValue.length>0)return dw(a,u,"A")===!1?J.some(N(a,r?a.nodeValue.length:0)):J.none();if(e.isBlock(a)||c[a.nodeName.toLowerCase()])return J.none();i=a}return n&&i?J.some(N(i,0)):J.none()},Cw=function(e,t,n,r){var o,i,a,u,c,s,l=e.getRoot(),f=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],s=No.isElement(o)&&i===o.childNodes.length,u=e.schema.getNonEmptyElements(),c=n,bl(o))return J.none();if(No.isElement(o)&&i>o.childNodes.length-1&&(c=!1),No.isDocument(o)&&(o=l,i=0),o===l){if(c&&(a=o.childNodes[i>0?i-1:0])){if(bl(a))return J.none();if(u[a.nodeName]||hw(a))return J.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=No.isText(o)&&s?o.data.length:0,!t&&o===l.lastChild&&hw(o))return J.none();if(yw(l,o)||bl(o))return J.none();if(o.hasChildNodes()&&hw(o)===!1){a=o;var d=new Xc(o,l);do{if(No.isContentEditableFalse(a)||bl(a)){f=!1;break}if(No.isText(a)&&a.nodeValue.length>0){i=c?0:a.nodeValue.length,o=a,f=!0;break}if(u[a.nodeName.toLowerCase()]&&!mw(a)){i=e.nodeIndex(a),o=a.parentNode,c||i++,f=!0;break}}while(a=c?d.next():d.prev())}}}return t&&(No.isText(o)&&0===i&&bw(e,s,t,!0,o).each(function(e){o=e.container(),i=e.offset(),f=!0}),No.isElement(o)&&(a=o.childNodes[i],a||(a=o.childNodes[i-1]),!a||!No.isBr(a)||vw(a,"A")||pw(e,a,!1)||pw(e,a,!0)||bw(e,s,t,!0,a).each(function(e){o=e.container(),i=e.offset(),f=!0}))),c&&!t&&No.isText(o)&&i===o.nodeValue.length&&bw(e,s,t,!1,o).each(function(e){o=e.container(),i=e.offset(),f=!0}),f?J.some(N(o,i)):J.none()},ww=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=N.fromRangeStart(t);return Cw(e,n,!0,r).each(function(e){n&&N.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||Cw(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),sw.isEq(t,r)?J.none():J.some(r)},xw={normalize:ww},Ew=function(e,t){e.insertData(0,t)},zw=function(e){return 0===e.dom().length?(Lr(e),J.none()):J.some(e)},kw=function(e,t){var n=J.from(t.firstChild).map(Zt.fromDom),r=J.from(t.lastChild).map(Zt.fromDom);e.deleteContents(),e.insertNode(t);var o=n.bind(wr).filter(qr).bind(zw),i=r.bind(xr).filter(qr).bind(zw);of(o,n.filter(qr),function(e,t){Ew(t.dom(),e.dom().data),Lr(e)}),of(i,r.filter(qr),function(t,n){var r=n.dom().length;n.dom().appendData(t.dom().data),e.setEnd(n.dom(),r),Lr(t)}),e.collapse(!1)},Nw=function(e,t){return e=e||{format:"html"},e.set=!0,e.selection=!0,e.content=t,e},Sw=function(e,t,n){if(n=Nw(n,t),!n.no_events&&(n=e.fire("BeforeSetContent",n),n.isDefaultPrevented()))return void e.fire("SetContent",n);var r=e.selection.getRng();kw(r,r.createContextualFragment(n.content)),e.selection.setRng(r),Jb.scrollRangeIntoView(e,r),n.no_events||e.fire("SetContent",n)},Tw={setContent:Sw},Aw=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return J.from(i).map(Zt.fromDom).map(function(e){return r&&t.collapsed?e:Nr(e,o(e,a)).getOr(e)}).bind(function(e){return jr(e)?J.some(e):br(e)}).map(function(e){return e.dom()}).getOr(e)},Rw=function(e,t,n){return Aw(e,t,!0,n,function(e,t){return Math.min(Ar(e),t)})},Bw=function(e,t,n){return Aw(e,t,!1,n,function(e,t){return t>0?t-1:t})},Dw=function(e,t){for(var n=e;e&&No.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},Mw=function(e,t){var n,r,o,i,a;return t?(r=t.startContainer,o=t.endContainer,i=t.startOffset,a=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(r===o&&2>a-i&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Dw(r.nextSibling,!0):r.parentNode,o=0===a?Dw(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n):e},_w=function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||Rw(i,t,t.collapsed),e.isBlock),r=e.getParent(r||Bw(i,t,t.collapsed),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r){o=n;for(var u=new Xc(n,i);(o=u.next())&&o!==r;)e.isBlock(o)&&a.push(o)}return r&&n!==r&&r!==i&&a.push(r),a},Pw=function(e,t,n){return J.from(t).map(function(t){var r=e.nodeIndex(t),o=e.createRng();return o.setStart(t.parentNode,r),o.setEnd(t.parentNode,r+1),n&&(yC(e,o,t,!0),yC(e,o,t,!1)),o})},Ow=function(e,t,n){if(e&&e.hasOwnProperty(t)){var r=bt(e[t],function(e){return e!==n});0===r.length?delete e[t]:e[t]=r}},Hw=function(e){return!!e.select},Lw=function(e){return!(!e||!e.ownerDocument)&&gr(Zt.fromDom(e.ownerDocument),Zt.fromDom(e))},Iw=function(e){return e?Hw(e)?!0:Lw(e.startContainer)&&Lw(e.endContainer):!1},Vw=function(e,t,n,r){var o,i,a,u,c=_(e,r).selectorChangedWithUnbind,s=function(t,n){var o=e.createRng();t?(o.setStart(t,n),o.setEnd(t,n),w(o),y(!1)):(yC(e,o,r.getBody(),!0),w(o))},l=function(e){return uw.getContent(r,e)},f=function(e,t){return Tw.setContent(r,e,t)},d=function(e){return Rw(r.getBody(),C(),e)},h=function(e){return Bw(r.getBody(),C(),e)},m=function(e,t){return o.getBookmark(e,t)},g=function(e){return o.moveToBookmark(e)},p=function(t,n){return Pw(e,t,n).each(w),t},v=function(){var e=C(),t=b();return!e||e.item?!1:e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed},y=function(e){var t=C();t.collapse(!!e),w(t)},b=function(){return t.getSelection?t.getSelection():t.document.selection},C=function(){var n,o,i,c,s=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!t)return null;if(c=t.document,"undefined"==typeof c||null===c)return null;if(void 0!==r.bookmark&&Bv.hasFocus(r)===!1){var l=Jp.getRng(r);if(l.isSome())return l.map(function(e){return aC.processRanges(r,[e])[0]}).getOr(c.createRange())}try{(n=b())&&!No.isRestrictedNode(n.anchorNode)&&(o=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():c.createRange())}catch(f){}return o=aC.processRanges(r,[o])[0],o||(o=c.createRange?c.createRange():c.body.createTextRange()),o.setStart&&9===o.startContainer.nodeType&&o.collapsed&&(i=e.getRoot(),o.setStart(i,0),o.setEnd(i,0)),a&&u&&(0===s(o.START_TO_START,o,a)&&0===s(o.END_TO_END,o,a)?o=u:(a=null,u=null)),o},w=function(e,t){var n,o,i;if(Iw(e)){var c=Hw(e)?e:null;if(c){u=null;try{c.select()}catch(s){}}else{if(n=b(),i=r.fire("SetSelectionRange",{range:e,forward:t}),e=i.range,n){u=e;try{n.removeAllRanges(),n.addRange(e)}catch(s){}t===!1&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),a=n.rangeCount>0?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||Ri.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(o=e.startContainer.childNodes[e.startOffset],o&&"IMG"===o.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),(n.anchorNode!==e.startContainer||n.focusNode!==e.endContainer)&&n.setBaseAndExtent(o,0,o,1))),r.fire("AfterSetSelectionRange",{range:e,forward:t})}}},x=function(t){return f(e.getOuterHTML(t)),t},E=function(){return Mw(r.getBody(),C())},z=function(t,n){return _w(e,C(),t,n)},k=function(){var t,n,r=b();return r&&r.anchorNode&&r.focusNode?(t=e.createRng(),t.setStart(r.anchorNode,r.anchorOffset),t.collapse(!0),n=e.createRng(),n.setStart(r.focusNode,r.focusOffset),n.collapse(!0),t.compareBoundaryPoints(t.START_TO_START,n)<=0):!0},N=function(){var t=C(),n=b();if(!VC.hasMultipleRanges(n)&&bC(r)){var o=xw.normalize(e,t);return o.each(function(e){w(e,k())}),o.getOr(t)}return t},S=function(e,t){return c(e,t),M},T=function(){for(var t,n=e.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){t=n;break}n=n.parentNode}return t},A=function(e,t){return Jb.scrollElementIntoView(r,e,t)},R=function(e,t){return w(oC.fromPoint(e,t,r.getDoc()))},B=function(){var e=C();return e.collapsed?Mf.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},D=function(){t=a=u=null,i.destroy()},M={bookmarkManager:null,controlSelection:null,dom:e,win:t,serializer:n,editor:r,collapse:y,setCursorLocation:s,getContent:l,setContent:f,getBookmark:m,moveToBookmark:g,select:p,isCollapsed:v,isForward:k,setNode:x,getNode:E,getSel:b,setRng:w,getRng:C,getStart:d,getEnd:h,getSelectedBlocks:z,normalize:N,selectorChanged:S,selectorChangedWithUnbind:c,getScrollContainer:T,scrollIntoView:A,placeCaretAt:R,getBoundingClientRect:B,destroy:D};return o=mb(M),i=wb(M,r),M.bookmarkManager=o,M.controlSelection=i,M},Fw=function(e,t){pt(t,function(t){e.attr(t,null)})},Uw=function(e,t,n){e.addNodeFilter("font",function(e){pt(e,function(e){var r=t.parse(e.attr("style")),o=e.attr("color"),i=e.attr("face"),a=e.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=n[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",t.serialize(r)),Fw(e,["color","face","size"])})})},jw=function(e,t){e.addNodeFilter("strike",function(e){pt(e,function(e){var n=t.parse(e.attr("style"));n["text-decoration"]="line-through",e.name="span",e.attr("style",t.serialize(n))})})},qw=function(e,t){var n=Cu();t.convert_fonts_to_spans&&Uw(e,n,ea.explode(t.font_size_legacy_values)),jw(e,n)},$w=function(e,t){t.inline_styles&&qw(e,t)},Ww={register:$w},Kw=function(e,t,n,r){var o=e.padd_empty_with_br||t.insert;o&&n[r.name]?r.empty().append(new $g("br",1)).shortEnded=!0:r.empty().append(new $g("#text",3)).value=yu},Xw=function(e){return Yw(e,"#text")&&e.firstChild.value===yu},Yw=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},Gw=function(e,t){var n=e.getElementRule(t.name);return n&&n.paddEmpty},Zw=function(e,t,n,r){return r.isEmpty(t,n,function(t){return Gw(e,t)})},Jw=function(e,t){return e&&(t[e.name]||"br"===e.name)},Qw=function(e,t){var n=e.schema;t.remove_trailing_brs&&e.addNodeFilter("br",function(e,r,o){var i,a,u,c,s,l,f,d,h=e.length,m=ea.extend({},n.getBlockElements()),g=n.getNonEmptyElements(),p=n.getNonEmptyElements();for(m.body=1,i=0;h>i;i++)if(a=e[i],u=a.parent,m[a.parent.name]&&a===u.lastChild){for(s=a.prev;s;){if(l=s.name,"span"!==l||"bookmark"!==s.attr("data-mce-type")){if("br"!==l)break;if("br"===l){a=null;break}}s=s.prev}a&&(a.remove(),Zw(n,g,p,u)&&(f=n.getElementRule(u.name),f&&(f.removeEmpty?u.remove():f.paddEmpty&&Kw(t,o,m,u))))}else{for(c=a;u&&u.firstChild===c&&u.lastChild===c&&(c=u,!m[u.name]);)u=u.parent;c===u&&t.padd_empty_with_br!==!0&&(d=new $g("#text",3),d.value=yu,a.replace(d))}}),e.addAttributeFilter("href",function(e){var n,r=e.length,o=function(e){var t=e.split(" ").filter(function(e){return e.length>0});return t.concat(["noopener"]).sort().join(" ")},i=function(e){var t=e?ea.trim(e):"";return/\b(noopener)\b/g.test(t)?t:o(t)};if(!t.allow_unsafe_link_target)for(;r--;)n=e[r],"a"===n.name&&"_blank"===n.attr("target")&&n.attr("rel",i(n.attr("rel")))}),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if(o=e[i],"a"===o.name&&o.firstChild&&!o.attr("href")){r=o.parent,t=o.lastChild;do n=t.prev,r.insert(t,o),t=n;while(t)}}),t.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if(t=e[r],n=t.parent,"ul"===n.name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new $g("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),t.validate&&n.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t,r,o,i,a,u,c,s=e.length,l=n.getValidClasses();s--;){for(t=e[s],r=t.attr("class").split(" "),a="",o=0;o1){for(i.reverse(),a=u=c(i[0].clone()),f=0;f0)return void(n.value=o);if(r=n.next){if(3===r.type&&r.value.length){n=n.prev;continue}if(!a[r.name]&&"script"!==r.name&&"style"!==r.name){n=n.prev;continue}}i=n.prev,n.remove(),n=i}},P=function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n};s=Qg({validate:z,allow_script_urls:e.allow_script_urls,allow_conditional_comments:e.allow_conditional_comments,preserve_cdata:e.preserve_cdata,self_closing_elements:P(t.getSelfClosingElements()),cdata:function(e){b.append(M("#cdata",4)).value=e },text:function(e,t){var n;y||(e=e.replace(R," "),Jw(b.lastChild,v)&&(e=e.replace(T,""))),0!==e.length&&(n=M("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(M("#comment",8)).value=e},pi:function(e,t){b.append(M(e,7)).value=t,_(b)},doctype:function(e){var t;t=b.append(M("#doctype",10)),t.value=e,_(b)},start:function(e,n,o){var a,u,c,s,l;if(c=z?t.getElementRule(e):{}){for(a=M(c.outputName||e,1),a.attributes=n,a.shortEnded=o,b.append(a),l=E[b.name],l&&E[a.name]&&!l[a.name]&&C.push(a),u=r.length;u--;)s=r[u].name,s in n.map&&(g=i[s],g?g.push(a):i[s]=[a]);v[e]&&_(a),o||(b=a),!y&&S[e]&&(y=!0)}},end:function(n){var r,o,i,a,u;if(o=z?t.getElementRule(n):{}){if(v[n]&&!y){if(r=b.firstChild,r&&3===r.type)if(i=r.value.replace(T,""),i.length>0)r.value=i,r=r.next;else for(a=r.next,r.remove(),r=a;r&&3===r.type;)i=r.value,a=r.next,(0===i.length||B.test(i))&&(r.remove(),r=a),r=a;if(r=b.lastChild,r&&3===r.type)if(i=r.value.replace(A,""),i.length>0)r.value=i,r=r.prev;else for(a=r.prev,r.remove(),r=a;r&&3===r.type;)i=r.value,a=r.prev,(0===i.length||B.test(i))&&(r.remove(),r=a),r=a}if(y&&S[n]&&(y=!1),o.removeEmpty&&Zw(t,x,S,b))return u=b.parent,v[b.name]?b.empty().remove():b.unwrap(),void(b=u);o.paddEmpty&&(Xw(b)||Zw(t,x,S,b))&&Kw(e,c,v,b),b=b.parent}}},t);var O=b=new $g(c.context||e.root_name,11);if(s.parse(a,c.format),z&&C.length&&(c.context?c.invalid=!0:u(C)),N&&("body"===O.name||c.isRootContent)&&D(),!c.invalid){for(p in o)if(o.hasOwnProperty(p)){for(g=n[p],l=o[p],h=l.length;h--;)l[h].parent||l.splice(h,1);for(f=0,d=g.length;d>f;f++)g[f](l,p,c)}for(f=0,d=r.length;d>f;f++)if(g=r[f],g.name in i){for(l=i[g.name],h=l.length;h--;)l[h].parent||l.splice(h,1);for(h=0,m=g.callbacks.length;m>h;h++)g.callbacks[h](l,g.name,c)}}return O},m={schema:t,addAttributeFilter:f,getAttributeFilters:d,addNodeFilter:s,getNodeFilters:l,filterNode:c,parse:h};return Qw(m,e),Ww.register(m,e),m},ix=function(e,t,n){e.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)n=e[r],n.attr("tabindex",n.attr("data-mce-tabindex")),n.attr(t,null)}),e.addAttributeFilter("src,href,style",function(e,r){for(var o,i,a=e.length,u="data-mce-"+r,c=t.url_converter,s=t.url_converter_scope;a--;)o=e[a],i=o.attr(u),void 0!==i?(o.attr(r,i.length>0?i:null),o.attr(u,null)):(i=o.attr(r),"style"===r?i=n.serializeStyle(n.parseStyle(i),o.name):c&&(i=c.call(s,i,r,o.name)),o.attr(r,i.length>0?i:null))}),e.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)t=e[r],n=t.attr("class"),n&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",n.length>0?n:null))}),e.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)if(r=e[o],"bookmark"===r.attr("data-mce-type")&&!n.cleanup){var i=J.from(r.firstChild).exists(function(e){return!ml.isZwsp(e.value)});i?r.unwrap():r.remove()}}),e.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)t=e[n].firstChild,t&&(t.value=au.decode(t.value))}),e.addNodeFilter("script,style",function(e,n){for(var r,o,i,a=e.length,u=function(e){return e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};a--;)r=e[a],o=r.firstChild?r.firstChild.value:"","script"===n?(i=r.attr("type"),i&&r.attr("type","mce-no/type"===i?null:i.replace(/^mce\-/,"")),"xhtml"===t.element_format&&o.length>0&&(r.firstChild.value="// ")):"xhtml"===t.element_format&&o.length>0&&(r.firstChild.value="")}),e.addNodeFilter("#comment",function(e){for(var r,o=e.length;o--;)r=e[o],t.preserve_cdata&&0===r.value.indexOf("[CDATA[")?(r.name="#cdata",r.type=4,r.value=n.decode(r.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===r.value.indexOf("mce:protected ")&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(r.value).substr(14))}),e.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)n=e[r],7===n.type?n.remove():1===n.type&&("input"!==t||n.attr("type")||n.attr("type","text"))}),e.addAttributeFilter("data-mce-type",function(t){pt(t,function(t){"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(e.schema.getNonEmptyElements())?t.remove():t.unwrap())})}),e.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(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})},ax=function(e){var t,n,r=function(e){return e&&"br"===e.name};t=e.lastChild,r(t)&&(n=t.prev,r(n)&&(t.remove(),n.remove()))},ux={register:ix,trimTrailingBr:ax},cx=function(t,n,r){var o,i,a,u=t.dom;return n=n.cloneNode(!0),o=e.document.implementation,o.createHTMLDocument&&(i=o.createHTMLDocument(""),ea.each("BODY"===n.nodeName?n.childNodes:[n],function(e){i.body.appendChild(i.importNode(e,!0))}),n="BODY"!==n.nodeName?i.body.firstChild:i.body,a=u.doc,u.doc=i),Iv(t,$t($t({},r),{node:n})),a&&(u.doc=a),n},sx=function(e,t){return e&&e.hasEventListeners("PreProcess")&&!t.no_events},lx=function(e,t,n){return sx(e,n)?cx(e,t,n):t},fx={process:lx},dx=function(e,t,n){-1===ea.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},hx=function(e,t,n){if(!t.no_events&&e){var r=Vv(e,$t($t({},t),{content:n}));return r.content}return n},mx=function(e,t,n){var r=ml.trim(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||xa(Zt.fromDom(t))?r:ea.trim(r)},gx=function(e,t,n){var r=n.selection?$t({forced_root_block:!1},n):n,o=e.parse(t,r);return ux.trimTrailingBr(o),o},px=function(e,t,n){var r=lp(e,t);return r.serialize(n)},vx=function(e,t,n,r,o){var i=px(t,n,r);return hx(e,o,i)},yx=function(e,n){var r=["data-mce-selected"],o=n&&n.dom?n.dom:rs.DOM,i=n&&n.schema?n.schema:a(e);e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0;var u=ox(e,i);ux.register(u,e,o);var c=function(t,r){void 0===r&&(r={});var a=$t({format:"html"},r),c=fx.process(n,t,a),s=mx(o,c,a),l=gx(u,s,a);return"tree"===a.format?l:vx(n,e,i,l,a)};return{schema:i,addNodeFilter:u.addNodeFilter,addAttributeFilter:u.addAttributeFilter,serialize:c,addRules:function(e){i.addValidElements(e)},setRules:function(e){i.setValidElements(e)},addTempAttr:t(dx,u,r),getTempAttrs:function(){return r},getNodeFilters:u.getNodeFilters,getAttributeFilters:u.getAttributeFilters}},bx=function(e,t){var n=yx(e,t);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}},Cx=function(t){return new mi(function(n,r){var o=function(){r("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var i=new e.XMLHttpRequest;i.open("GET",t,!0),i.responseType="blob",i.onload=function(){200===this.status?n(this.response):o()},i.onerror=o,i.send()}catch(a){o()}})},wx=function(e){var t,n,r=decodeURIComponent(e).split(",");return n=/data:([^;]+)/.exec(r[0]),n&&(t=n[1]),{type:t,data:r[1]}},xx=function(t){return new mi(function(n){var r,o,i,a=wx(t);try{r=e.atob(a.data)}catch(u){return void n(new e.Blob([]))}for(o=new Uint8Array(r.length),i=0;i'))},Ix=function(e){return qr(e)?Dg(e)===yu:ga(e)},Vx=function(e){return 1===bt(kr(e),Ix).length},Fx=function(e){Tr(e).each(function(t){wr(t).each(function(n){da(e)&&ga(t)&&da(n)&&Lr(t)})})},Ux={removeTrailingBr:Hx,fillWithPaddingBr:Lx,isPaddedElement:Vx,trimBlockTrailingBr:Fx},jx=ug,qx=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o=0;i--){if(a=u[i].selector,!a||u[i].defaultBlock)return!0;for(o=r.length-1;o>=0;o--)if(c.is(r[o],a))return!0}return!1},Jx=function(e,t){return e.splitText(t)},Qx=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&No.isText(t)?n>0&&nn?(o-=n,t=r=Jx(r,o).previousSibling,o=r.nodeValue.length,n=0):o=0):(No.isText(t)&&n>0&&n0&&o=e.data.length,i=0===t;e.replaceData(t,n,eE(r,i,o))}},nE=function(e,t){var n=e.data.slice(t),r=n.length-Hn(n).length;return tE(e,t,r)},rE=function(e,t){var n=e.data.slice(0,t),r=n.length-Ln(n).length;return tE(e,t-r,r)},oE=function(e,t,n){var r=Ln(e.data).length;return e.appendData(t.data),Lr(Zt.fromDom(t)),n&&nE(e,r),e},iE=function(e,t,n){return js(e,t,n).isSome()},aE=function(e,n){var r=Zt.fromDom(e),o=Zt.fromDom(n);return iE(o,"pre,code",t(fr,r))},uE=function(e,t){return No.isText(t)&&/^[ \t\r\n]*$/.test(t.data)&&aE(e,t)===!1},cE=function(e){return No.isElement(e)&&"A"===e.nodeName&&e.hasAttribute("name")},sE=function(e,t){return Il(t)&&uE(e,t)===!1||cE(t)||lE(t)},lE=No.hasAttribute("data-mce-bookmark"),fE=No.hasAttribute("data-mce-bogus"),dE=No.hasAttributeValue("data-mce-bogus","all"),hE=function(e,t){var n,r=0;if(sE(e,e))return!1;if(n=e.firstChild,!n)return!0;var o=new Xc(n,e);do{if(t){if(dE(n)){n=o.next(!0);continue}if(fE(n)){n=o.next();continue}}if(No.isBr(n))r++,n=o.next();else{if(sE(e,n))return!1;n=o.next()}}while(n);return 1>=r},mE=function(e,t){return void 0===t&&(t=!0),hE(e.dom(),t)},gE={isEmpty:mE},pE=function(e,t){var n=e.container(),r=e.offset();return Mf.isTextPosition(e)===!1&&n===t.parentNode&&r>Mf.before(t).offset()},vE=function(e,t){return pE(t,e)?Mf(t.container(),t.offset()-1):t},yE=function(e){return No.isText(e)?Mf(e,0):Mf.before(e)},bE=function(e){return No.isText(e)?Mf(e,e.data.length):Mf.after(e)},CE=function(e){return Il(e.previousSibling)?J.some(bE(e.previousSibling)):e.previousSibling?zm.lastPositionIn(e.previousSibling):J.none()},wE=function(e){return Il(e.nextSibling)?J.some(yE(e.nextSibling)):e.nextSibling?zm.firstPositionIn(e.nextSibling):J.none()},xE=function(e,t){var n=Mf.before(t.previousSibling?t.previousSibling:t.parentNode);return zm.prevPosition(e,n).fold(function(){return zm.nextPosition(e,Mf.after(t))},J.some)},EE=function(e,t){return zm.nextPosition(e,Mf.after(t)).fold(function(){return zm.prevPosition(e,Mf.before(t))},J.some)},zE=function(e,t){return CE(t).orThunk(function(){return wE(t)}).orThunk(function(){return xE(e,t)})},kE=function(e,t){return wE(t).orThunk(function(){return CE(t)}).orThunk(function(){return EE(e,t)})},NE=function(e,t,n){return e?kE(t,n):zE(t,n)},SE=function(e,n,r){return NE(e,n,r).map(t(vE,r))},TE=function(e,t,n){n.fold(function(){e.focus()},function(n){e.selection.setRng(n.toRange(),t)})},AE=function(e){return function(t){return t.dom()===e}},RE=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(Vr(t))},BE=function(e){if(gE.isEmpty(e)){var t=Zt.fromHtml('
    ');return Hr(e),Mr(e,t),J.some(Mf.before(t.dom()))}return J.none()},DE=function(e,t,n){var r=wr(e).filter(qr),o=xr(e).filter(qr);return Lr(e),af(r,o,t,function(e,t,r){var o=e.dom(),i=t.dom(),a=o.data.length;return oE(o,i,n),r.container()===i?Mf(o,a):r}).orThunk(function(){return n&&(r.each(function(e){return rE(e.dom(),e.dom().length)}),o.each(function(e){return nE(e.dom(),0)})),t})},ME=function(e,t){return qt(e.schema.getTextInlineElements(),Vr(t))},_E=function(e,n,r,o){void 0===o&&(o=!0);var i=SE(n,e.getBody(),r.dom()),a=Fs(r,t(RE,e),AE(e.getBody())),u=DE(r,i,ME(e,r));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):a.bind(BE).fold(function(){o&&TE(e,n,u)},function(t){o&&TE(e,n,J.some(t))})},PE={deleteElement:_E},OE=ml.ZWSP,HE="_mce_caret",LE=function(e,t){return e.importNode(t,!0)},IE=function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==OE||e.childNodes.length>1)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t},VE=function(e){return IE(e).length>0},FE=function(e){if(e){var t=new Xc(e,e);for(e=t.current();e;e=t.next())if(No.isText(e))return e}return null},UE=function(e){var t=Zt.fromTag("span");return Ro(t,{id:HE,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Mr(t,Zt.fromText(OE)),t},jE=function(e){var t=FE(e);return t&&t.nodeValue.charAt(0)===OE&&t.deleteData(0,1),t},qE=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(VE(t))PE.deleteElement(e,!1,Zt.fromDom(t),n);else{var i=o.getRng(),a=r.getParent(t,r.isBlock),u=jE(t);i.startContainer===u&&i.startOffset>0&&i.setStart(u,i.startOffset-1),i.endContainer===u&&i.endOffset>0&&i.setEnd(u,i.endOffset-1),r.remove(t,!0),a&&r.isEmpty(a)&&Ux.fillWithPaddingBr(Zt.fromDom(a)),o.setRng(i)}},$E=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)qE(e,t,n);else if(t=yd(e.getBody(),o.getStart()),!t)for(;t=r.get(HE);)qE(e,t,!1)},WE=function(e,n,r){var o=e.dom,i=o.getParent(r,t(ng,e));i&&o.isEmpty(i)?r.parentNode.replaceChild(n,r):(Ux.removeTrailingBr(Zt.fromDom(r)),o.isEmpty(r)?r.parentNode.replaceChild(n,r):o.insertAfter(n,r))},KE=function(e,t){return e.appendChild(t),t},XE=function(e,t){var n=Ct(e,function(e,t){return KE(e,t.cloneNode(!1))},t);return KE(n,n.ownerDocument.createTextNode(OE))},YE=function(e,t,n){var r,o,i,a,u,c,s,l=e.selection;r=l.getRng(),a=r.startOffset,c=r.startContainer,s=c.nodeValue,o=yd(e.getBody(),l.getStart()),o&&(i=FE(o));var f=/[^\s\u00a0\u00ad\u200b\ufeff]/;s&&a>0&&a
    ").append(t.childNodes)};t=No.matchNodeNames(["pre"]),r.collapsed||(n=e.selection.getSelectedBlocks(),oz(rz(rz(n,t),o),function(e){i(e.previousSibling,e)}))});var uz,cz=ea.each,sz=function(e){this.compare=function(t,n){if(t.nodeName!==n.nodeName)return!1;var r=function(t){var n={};return cz(e.getAttribs(t),function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=e.getAttrib(t,o))}),n},o=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(n=t[r],"undefined"==typeof n)return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return o(r(t),r(n))&&o(e.parseStyle(e.getAttrib(t,"style")),e.parseStyle(e.getAttrib(n,"style")))?!Km.isBookmarkNode(t)&&!Km.isBookmarkNode(n):!1}},lz=/^(src|href|style)$/,fz=ea.each,dz=ug,hz=function(e){return/^(TH|TD)$/.test(e.nodeName)},mz=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},gz=function(e,t,n){var r,o;if(r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],No.isElement(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return No.isText(r)&&n&&o>=r.nodeValue.length&&(r=new Xc(r,e.getBody()).next()||r),No.isText(r)&&!n&&0===o&&(r=new Xc(r,e.getBody()).prev()||r),r},pz=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},vz=function(e,t,n,r,o){var i=Zt.fromDom(t),a=Zt.fromDom(e.create(r,o)),u=n?zr(i):Er(i);return Or(a,u),n?(Rr(i,a),Dr(a,i)):(Br(i,a),Mr(a,i)),a.dom()},yz=function(e,t,n){return dz(t,n.inline)?!0:dz(t,n.block)?!0:n.selector?No.isElement(t)&&e.is(t,n.selector):void 0},bz=function(e,t){return t.links&&"A"===e.nodeName},Cz=function(e,t,n,r){return t=tg(t,n,r),!t||"BR"===t.nodeName||e.isBlock(t)},wz=function(e,t,n){var r,o=t.parentNode,i=e.dom,a=yh.getForcedRootBlock(e);n.block&&(a?o===i.getRoot()&&(n.list_block&&dz(t,n.list_block)||fz(ea.grep(t.childNodes),function(t){rg(e,a,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=pz(i,t,a),i.setAttribs(r,e.settings.forced_root_block_attrs)):r=0})):i.isBlock(t)&&!i.isBlock(o)&&(Cz(i,t,!1)||Cz(i,t.firstChild,!0,!0)||t.insertBefore(i.create("br"),t.firstChild),Cz(i,t,!0)||Cz(i,t.lastChild,!1,!0)||t.appendChild(i.create("br")))),n.selector&&n.inline&&!dz(n.inline,t)||i.remove(t,!0)},xz=function(e,t,n,r,o){var i,a=e.dom;if(!yz(a,r,t)&&!bz(r,t))return!1;var u=r;if("all"!==t.remove){fz(t.styles,function(e,r){e=cg(a,ag(e,n),r),"number"==typeof r&&(r=e,o=null),(t.remove_similar||!o||dz(sg(a,o,r),e))&&a.setStyle(u,r,""),i=!0}),i&&""===a.getAttrib(u,"style")&&(u.removeAttribute("style"),u.removeAttribute("data-mce-style")),fz(t.attributes,function(e,r){var i;if(e=ag(e,n),"number"==typeof r&&(r=e,o=null),t.remove_similar||!o||dz(a.getAttrib(o,r),e)){if("class"===r&&(e=a.getAttrib(u,r),e&&(i="",fz(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(i+=(i?" ":"")+e)}),i)))return void a.setAttrib(u,r,i);"class"===r&&u.removeAttribute("className"),lz.test(r)&&u.removeAttribute("data-mce-"+r),u.removeAttribute(r)}}),fz(t.classes,function(e){e=ag(e,n),(!o||a.hasClass(o,e))&&a.removeClass(u,e)});for(var c=a.getAttribs(u),s=0;so&&!xz(e,u[o],n,t,t);o++);if(c.deep&&r.length){for(o=0,i=r.length;i>o;o++)m(r[o]);f&&(s=a)}},g=function(e){var t=l.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return h(n)&&(n=n[e?"firstChild":"lastChild"]),No.isText(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),l.remove(t,!0),n},p=function(t){var n,r,o=t.commonAncestorContainer,i=kg(e,t,u,!0);if(c.split){if(i=Qx(i),n=gz(e,i,!0),r=gz(e,i),n!==r){if(/^(TR|TH|TD)$/.test(n.nodeName)&&n.firstChild&&(n="TR"===n.nodeName?n.firstChild.firstChild||n:n.firstChild||n),o&&/^T(HEAD|BODY|FOOT|R)$/.test(o.nodeName)&&hz(r)&&r.firstChild&&(r=r.firstChild||r),mz(l,n,r)){var a=J.from(n.firstChild).getOr(n);return d(vz(l,a,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void g(!0)}if(mz(l,r,n)){var a=J.from(r.lastChild).getOr(r);return d(vz(l,a,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void g(!1)}n=pz(l,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=pz(l,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=l.createRng();s.setStartAfter(n),s.setEndBefore(r),Rg.walk(l,s,function(e){pt(e,function(e){Km.isBookmarkNode(e)||Km.isBookmarkNode(e.parentNode)||d(e)})}),d(n),d(r),n=g(!0),r=g()}else n=r=d(n);i.startContainer=n.parentNode?n.parentNode:n,i.startOffset=l.nodeIndex(n),i.endContainer=r.parentNode?r.parentNode:r,i.endOffset=l.nodeIndex(r)+1}Rg.walk(l,i,function(t){fz(t,function(t){m(t),No.isElement(t)&&"underline"===e.dom.getStyle(t,"text-decoration")&&t.parentNode&&"underline"===lg(l,t.parentNode)&&xz(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,t)})})};if(r)return void(Jm(r)?(a=l.createRng(),a.setStartBefore(r),a.setEndAfter(r),p(a)):p(r));if("false"!==l.getContentEditable(f.getNode()))f.isCollapsed()&&c.inline&&!l.select("td[data-mce-selected],th[data-mce-selected]").length?GE(e,t,n,o):(i=hd.getPersistentBookmark(e.selection,!0),p(f.getRng()),f.moveToBookmark(i),c.inline&&Yx(e,t,n,f.getStart())&&eg(l,f,f.getRng()),e.nodeChanged());else{r=f.getNode();for(var v=0,y=u.length;y>v&&(!u[v].ceFalseOverride||!xz(e,u[v],n,r,r));v++);}},Nz=ea.each,Sz=function(e){return No.isElement(e)&&!Km.isBookmarkNode(e)&&!vd(e)&&!No.isBogus(e)},Tz=function(e,t){var n;for(n=e;n;n=n[t]){if(No.isText(n)&&0!==n.nodeValue.length)return e;if(No.isElement(n)&&!Km.isBookmarkNode(n))return n}return e},Az=function(e,t,n){var r,o,i=new sz(e);if(t&&n&&(t=Tz(t,"previousSibling"),n=Tz(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)o=r,r=r.nextSibling,t.appendChild(o);return e.remove(n),ea.each(ea.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},Rz=function(e,t,n){Nz(e.childNodes,function(e){Sz(e)&&(t(e)&&n(e),e.hasChildNodes()&&Rz(e,t,n))})},Bz=function(e,n){return t(function(t,n){return!(!n||!sg(e,n,t))},n)},Dz=function(e,n,r){return t(function(t,n,r){e.setStyle(r,t,n),""===r.getAttribute("style")&&r.removeAttribute("style"),Mz(e,r)},n,r)},Mz=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},_z=function(e,t){if(1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType){var n=lg(e,t.parentNode);e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null)}},Pz=function(e,n,r,o){n.styles&&(n.styles.color||n.styles.textDecoration)&&(ea.walk(o,t(_z,e),"childNodes"),_z(e,o))},Oz=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&Rz(r,Bz(e,"fontSize"),Dz(e,"backgroundColor",ag(t.styles.backgroundColor,n)))},Hz=function(e,t,n,r){("sub"===t.inline||"sup"===t.inline)&&(Rz(r,Bz(e,"fontSize"),Dz(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},Lz=function(e,t,n,r){r&&t.merge_siblings!==!1&&(r=Az(e,tg(r),r),r=Az(e,r,tg(r,!0)))},Iz=function(e,t,n){if(t.clear_child_styles){var r=t.links?"*:not(a)":"*";Nz(e.select(r,n),function(n){Sz(n)&&Nz(t.styles,function(t,r){e.setStyle(n,r,"")})})}},Vz=function(e,t,n,r){Nz(t,function(t){Nz(e.dom.select(t.inline,r),function(r){Sz(r)&&xz(e,t,n,r,t.exact?r:null)}),Iz(e.dom,t,r)})},Fz=function(e,t,n,r,o){Xx(e,o.parentNode,n,r)&&xz(e,t,r,o)||t.merge_with_parents&&e.dom.getParent(o.parentNode,function(i){return Xx(e,i,n,r)?(xz(e,t,r,o),!0):void 0})},Uz=function(t,n,r,o){var i=e.document.createRange();return i.setStart(t,n),i.setEnd(r,o),i},jz=function(e){var t=Mf.fromRangeStart(e),n=Mf.fromRangeEnd(e),r=e.commonAncestorContainer;return zm.fromPosition(!1,r,n).map(function(o){return!Lh(t,n,r)&&Lh(t,o,r)?Uz(t.container(),t.offset(),o.container(),o.offset()):e}).getOr(e)},qz=function(e){return e.collapsed?e:jz(e)},$z={normalize:qz},Wz=ea.each,Kz=function(e){return e&&1===e.nodeType&&!Km.isBookmarkNode(e)&&!vd(e)&&!No.isBogus(e)},Xz=function(e,t,n,r){var o,i,a=e.formatter.get(t),u=a[0],c=!r&&e.selection.isCollapsed(),s=e.dom,l=e.selection,f=function(e,t){if(t=t||u,e){if(t.onformat&&t.onformat(e,t,n,r),Wz(t.styles,function(t,r){s.setStyle(e,r,ag(t,n))}),t.styles){var o=s.getAttrib(e,"style");o&&s.setAttrib(e,"data-mce-style",o)}Wz(t.attributes,function(t,r){s.setAttrib(e,r,ag(t,n))}),Wz(t.classes,function(t){t=ag(t,n),s.hasClass(e,t)||s.addClass(e,t)})}},d=function(e,t){var n=!1;return u.selector?(Wz(e,function(e){return"collapsed"in e&&e.collapsed!==c?void 0:s.is(t,e.selector)&&!vd(t)?(f(t,e),n=!0,!1):void 0}),n):!1},h=function(r,o,i,c){var s,l,h=[],m=!0;s=u.inline||u.block,l=r.create(s),f(l),Rg.walk(r,o,function(o){var i,g=function(o){var p=!1,v=m,y=o.nodeName.toLowerCase(),b=o.parentNode.nodeName.toLowerCase();if(No.isElement(o)&&r.getContentEditable(o)&&(v=m,m="true"===r.getContentEditable(o),p=!0),ug(y,"br"))return i=0,void(u.block&&r.remove(o)); if(u.wrapper&&Xx(e,o,t,n))return void(i=0);if(m&&!p&&u.block&&!u.wrapper&&ng(e,y)&&rg(e,b,s))return o=r.rename(o,s),f(o),h.push(o),void(i=0);if(u.selector){var C=d(a,o);if(!u.inline||C)return void(i=0)}!m||p||!rg(e,s,y)||!rg(e,b,s)||!c&&3===o.nodeType&&1===o.nodeValue.length&&65279===o.nodeValue.charCodeAt(0)||vd(o)||u.inline&&r.isBlock(o)?(i=0,Wz(ea.grep(o.childNodes),g),p&&(m=v),i=0):(i||(i=r.clone(l,!1),o.parentNode.insertBefore(i,o),h.push(i)),i.appendChild(o))};Wz(o,g)}),u.links===!0&&Wz(h,function(e){var t=function(e){"A"===e.nodeName&&f(e,u),Wz(ea.grep(e.childNodes),t)};t(e)}),Wz(h,function(o){var i,c=function(e){var t=0;return Wz(e.childNodes,function(e){ig(e)||Km.isBookmarkNode(e)||t++}),t},s=function(e){var t=!1;return Wz(e.childNodes,function(e){return Kz(e)?(t=e,!1):void 0}),t},l=function(e){var t,n;return t=s(e),t&&!Km.isBookmarkNode(t)&&Wx(r,t,u)&&(n=r.clone(t,!1),f(n),r.replace(n,e,!0),r.remove(t,!0)),n||e};return i=c(o),(h.length>1||!r.isBlock(o))&&0===i?void r.remove(o,!0):void((u.inline||u.wrapper)&&(u.exact||1!==i||(o=l(o)),Vz(e,a,n,o),Fz(e,u,t,n,o),Oz(r,u,n,o),Pz(r,u,n,o),Hz(r,u,n,o),Lz(r,u,n,o)))})};if("false"!==s.getContentEditable(l.getNode())){if(u){if(r)Jm(r)?d(a,r)||(i=s.createRng(),i.setStartBefore(r),i.setEndAfter(r),h(s,kg(e,i,a),null,!0)):h(s,r,null,!0);else if(c&&u.inline&&!s.select("td[data-mce-selected],th[data-mce-selected]").length)YE(e,t,n);else{var m=e.selection.getNode();e.settings.forced_root_block||!a[0].defaultBlock||s.getParent(m,s.isBlock)||Xz(e,a[0].defaultBlock),e.selection.setRng($z.normalize(e.selection.getRng())),o=hd.getPersistentBookmark(e.selection,!0),h(s,kg(e,l.getRng(),a)),l.moveToBookmark(o),eg(s,l,l.getRng()),e.nodeChanged()}az(t,e)}}else{r=l.getNode();for(var g=0,p=a.length;p>g;g++)if(a[g].ceFalseOverride&&s.is(r,a[g].selector))return void f(r,a[g])}},Yz=function(e,t){var n=Jt({});e.set({}),t.on("NodeChange",function(r){Gz(t,r.element,n,e.get())})},Gz=function(e,t,n,r){var o=_t(n.get()),i={},a={},u=bt(fg(e.dom,t),function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")});Ot(r,function(t,n){ea.each(u,function(r){return e.formatter.matchNode(r,n,{},t.similar)?(-1===o.indexOf(n)&&(pt(t.callbacks,function(e){e(!0,{node:r,format:n,parents:u})}),i[n]=t.callbacks),a[n]=t.callbacks,!1):qx(e,r,n)?!1:void 0})});var c=Zz(n.get(),a,t,u);n.set($t($t({},i),c))},Zz=function(e,t,n,r){return Ft(e,function(e,o){return qt(t,o)?!0:(pt(e,function(e){e(!1,{node:n,format:o,parents:r})}),!1)}).t},Jz=function(e,t,n,r){var o=e.get();pt(t.split(","),function(e){o[e]||(o[e]={similar:r,callbacks:[]}),o[e].callbacks.push(n)}),e.set(o)},Qz=function(e,t,n){var r=e.get();pt(t.split(","),function(e){r[e].callbacks=bt(r[e].callbacks,function(e){return e!==n}),0===r[e].callbacks.length&&delete r[e]}),e.set(r)},ek=function(e,t,n,r,o){return null===t.get()&&Yz(t,e),Jz(t,n,r,o),{unbind:function(){return Qz(t,n,r)}}},tk=function(e){var t={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",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",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",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"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],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},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(){return!0},onformat:function(t,n,r){ea.each(r,function(n,r){e.setAttrib(t,r,n)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",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 ea.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t},nk={get:tk},rk=ea.each,ok=rs.DOM,ik=function(e,t){var n,r,o,i=t&&t.schema||a({}),u=function(e,t){t.classes.length&&ok.addClass(e,t.classes.join(" ")),ok.setAttribs(e,t.attrs)},c=function(e){var t;return r="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=ok.create(r.name),u(t,r),t},s=function(e,t){var n="string"!=typeof e?e.nodeName.toLowerCase():e,r=i.getElementRule(n),o=r&&r.parentsRequired;return o&&o.length?t&&-1!==ea.inArray(o,t)?t:o[0]:!1},l=function(e,t,n){var r,o,i,a=t.length>0&&t[0],u=a&&a.name;if(i=s(e,u))u===i?(o=t[0],t=t.slice(1)):o=i;else if(a)o=t[0],t=t.slice(1);else if(!n)return e;return o&&(r=c(o),r.appendChild(e)),n&&(r||(r=ok.create("div"),r.appendChild(e)),ea.each(n,function(t){var n=c(t);r.insertBefore(n,e)})),l(r,t,o&&o.siblings)};return e&&e.length?(r=e[0],n=c(r),o=ok.create("div"),o.appendChild(l(n,e.slice(1),r.siblings)),o):""},ak=function(e){var t,n={classes:[],attrs:{}};return e=n.selector=ea.trim(e),"*"!==e&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,r,o,i){switch(t){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==ea.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);a&&(n.attrs[a[1]]=a[2])}return""})),n.name=t||"div",n},uk=function(e){return e&&"string"==typeof e?(e=e.split(/\s*,\s*/)[0],e=e.replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),ea.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=ea.map(e.split(/(?:~\+|~|\+)/),ak),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},ck=function(e,t){var n,r,o,i,a,u,c="";if(u=e.settings.preview_styles,u===!1)return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var s=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof t){if(t=e.formatter.get(t),!t)return;t=t[0]}return"preview"in t&&(u=t.preview,u===!1)?"":(n=t.block||t.inline||"span",i=uk(t.selector),i.length?(i[0].name||(i[0].name=n),n=t.selector,r=ik(i,e)):r=ik([n],e),o=ok.select(n,r)[0]||r.firstChild,rk(t.styles,function(e,t){e=s(e),e&&ok.setStyle(o,t,e)}),rk(t.attributes,function(e,t){e=s(e),e&&ok.setAttrib(o,t,e)}),rk(t.classes,function(e){e=s(e),ok.hasClass(o,e)||ok.addClass(o,e)}),e.fire("PreviewFormats"),ok.setStyles(r,{position:"absolute",left:-65535}),e.getBody().appendChild(r),a=ok.getStyle(e.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,rk(u.split(" "),function(t){var n=ok.getStyle(o,t,!0);if(!("background-color"===t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=ok.getStyle(e.getBody(),t,!0),"#ffffff"===ok.toHex(n).toLowerCase())||"color"===t&&"#000000"===ok.toHex(n).toLowerCase())){if("font-size"===t&&/em|%$/.test(n)){if(0===a)return;var r=parseFloat(n)/(/%$/.test(n)?100:1);n=r*a+"px"}"border"===t&&n&&(c+="padding:0 2px;"),c+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),ok.remove(r),c)},sk=function(e,t,n,r,o){var i=t.get(n);!Yx(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?Xz(e,n,r,o):kz(e,n,r,o)},lk=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;6>=t;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])},fk={setup:lk},dk=function(e){var n=L(e),r=Jt(null);return fk.setup(e),JE(e),{get:n.get,has:n.has,register:n.register,unregister:n.unregister,apply:t(Xz,e),remove:t(kz,e),toggle:t(sk,e,n),match:t(Yx,e),matchAll:t(Gx,e),matchNode:t(Xx,e),canApply:t(Zx,e),formatChanged:t(ek,e,r),getCssText:t(ck,e)}},hk=0,mk=1,gk=2,pk=function(e,t){var n=e.length+t.length+2,r=new Array(n),o=new Array(n),i=function(e,t,n){return{start:e,end:t,diag:n}},a=function(n,r,o,i,u){var s=c(n,r,o,i);if(null===s||s.start===r&&s.diag===r-i||s.end===n&&s.diag===n-o)for(var l=n,f=o;r>l||i>f;)r>l&&i>f&&e[l]===t[f]?(u.push([hk,e[l]]),++l,++f):r-n>i-o?(u.push([gk,e[l]]),++l):(u.push([mk,t[f]]),++f);else{a(n,s.start,o,s.start-s.diag,u);for(var d=s.start;du-r&&o>u&&e[u]===t[u-r];)++u;return i(n,u,r)},c=function(n,i,a,c){var s=i-n,l=c-a;if(0===s||0===l)return null;var f=s-l,d=l+s,h=(d%2===0?d:d+1)/2;r[1+h]=n,o[1+h]=i+1;var m,g,p,v,y;for(m=0;h>=m;++m){for(g=-m;m>=g;g+=2){for(p=g+h,r[p]=g===-m||g!==m&&r[p-1]v&&c>y&&e[v]===t[y];)r[p]=++v,++y;if(f%2!==0&&g>=f-m&&f+m>=g&&o[p-f]<=r[p])return u(o[p-f],g+n-a,i,c)}for(g=f-m;f+m>=g;g+=2){for(p=g+h-f,o[p]=g===f-m||g!==f+m&&o[p+1]<=o[p-1]?o[p+1]-1:o[p-1],v=o[p]-1,y=v-n+a-g;v>=n&&y>=a&&e[v]===t[y];)o[p]=v--,y--;if(f%2===0&&g>=-m&&m>=g&&o[p]<=r[p+f])return u(o[p],g+n-a,i,c)}}},s=[];return a(0,e.length,0,t.length,s),s},vk={KEEP:hk,DELETE:gk,INSERT:mk,diff:pk},yk=function(e){return No.isElement(e)?e.outerHTML:No.isText(e)?au.encodeRaw(e.data,!1):No.isComment(e)?"":""},bk=function(t){var n,r,o;for(o=e.document.createElement("div"),n=e.document.createDocumentFragment(),t&&(o.innerHTML=t);r=o.firstChild;)n.appendChild(r);return n},Ck=function(e,t,n){var r=bk(t);if(e.hasChildNodes()&&n0})},zk=function(e,t){var n=gt(Mt(t.childNodes),yk);return xk(vk.diff(n,e),t),t},kk={read:Ek,write:zk},Nk=Jt(J.none()),Sk=function(){return Nk.get().getOrThunk(function(){var t=e.document.implementation.createHTMLDocument("undo");return Nk.set(J.some(t)),t})},Tk=function(e){return-1!==e.indexOf("")},Ak=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},Rk=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},Bk=function(e){var t,n,r;return t=kk.read(e.getBody()),r=kt(t,function(t){var n=rp.trimInternal(e.serializer,t);return n.length>0?[n]:[]}),n=r.join(""),Tk(n)?Ak(r):Rk(n)},Dk=function(e,t,n){"fragmented"===t.type?kk.write(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},Mk=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},_k=function(e){var t=Zt.fromTag("body",Sk());return ul(t,Mk(e)),pt(Vs(t,"*[data-mce-bogus]"),Ir),al(t)},Pk=function(e,t){return Mk(e)===Mk(t)},Ok=function(e,t){return _k(e)===_k(t)},Hk=function(e,t){return e&&t?Pk(e,t)?!0:Ok(e,t):!1},Lk={createFragmentedLevel:Ak,createCompleteLevel:Rk,createFromEditor:Bk,applyToEditor:Dk,isEq:Hk},Ik=function(e){return 0===e.get()},Vk=function(e,t,n){Ik(n)&&(e.typing=t)},Fk=function(e,t){e.typing&&(Vk(e,!1,t),e.add())},Uk=function(e){e.typing&&(e.typing=!1,e.add())},jk=function(e,t,n){Ik(t)&&n.set(J.some(hd.getUndoBookmark(e.selection)))},qk=function(e,t,n,r,o,i,a){var u=e.settings,c=Lk.createFromEditor(e);if(i=i||{},i=ea.extend(i,c),Ik(r)===!1||e.removed)return null;var s=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:s,originalEvent:a}).isDefaultPrevented())return null;if(s&&Lk.isEq(s,i))return null;if(t.data[n.get()]&&o.get().each(function(e){t.data[n.get()].beforeBookmark=e}),u.custom_undo_redo_levels&&t.data.length>u.custom_undo_redo_levels){for(var l=0;l0&&(e.setDirty(!0),e.fire("change",f)),i},$k=function(e,t,n){t.data=[],n.set(0),t.typing=!1,e.fire("ClearUndos")},Wk=function(e,t,n,r,o){if(t.transact(r)){var i=t.data[n.get()].bookmark,a=t.data[n.get()-1];Lk.applyToEditor(e,a,!0),t.transact(o)&&(t.data[n.get()-1].beforeBookmark=i)}},Kk=function(e,t,n){var r;return t.get()0&&(r.set(r.get()-1),o=t.data[r.get()],Lk.applyToEditor(e,o,!0),e.setDirty(!0),e.fire("Undo",{level:o})),o},Yk=function(e){e.clear(),e.add()},Gk=function(e,t,n){return n.get()>0||t.typing&&t.data[0]&&!Lk.isEq(Lk.createFromEditor(e),t.data[0])},Zk=function(e,t){return t.get()=33&&36>=i||i>=37&&40>=i||45===i||n.ctrlKey)&&(o(),e.nodeChanged()),(46===i||8===i)&&e.nodeChanged(),r.get()&&t.typing&&Lk.isEq(Lk.createFromEditor(e),t.data[0])===!1&&(e.isDirty()===!1&&(e.setDirty(!0),e.fire("change",{level:t.data[0],lastLevel:null})),e.fire("TypingUndo"),r.set(!1),e.nodeChanged()))}),e.on("keydown",function(e){var i=e.keyCode;if(!e.isDefaultPrevented()){if(i>=33&&36>=i||i>=37&&40>=i||45===i)return void(t.typing&&o(e));var a=e.ctrlKey&&!e.altKey||e.metaKey;!(16>i||i>20)||224===i||91===i||t.typing||a||(t.beforeChange(),Vk(t,!0,n),t.add({},e),r.set(!0))}}),e.on("mousedown",function(e){t.typing&&o(e)});var i=function(e){return"insertReplacementText"===e.inputType},a=function(e){return"insertText"===e.inputType&&null===e.data};e.on("input",function(e){e.inputType&&(i(e)||a(e))&&o(e)}),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()})},tN=function(e){e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo")},nN=function(e){var t=Jt(J.none()),n=Jt(0),r=Jt(0),o={data:[],typing:!1,beforeChange:function(){jk(e,n,t)},add:function(i,a){return qk(e,o,r,n,t,i,a)},undo:function(){return Xk(e,o,n,r)},redo:function(){return Kk(e,r,o.data)},clear:function(){$k(e,o,r)},reset:function(){Yk(o)},hasUndo:function(){return Gk(e,o,r)},hasRedo:function(){return Zk(o,r)},transact:function(e){return Jk(o,n,e)},ignore:function(e){Qk(n,e)},extra:function(t,n){Wk(e,o,r,t,n)}};return eN(e,o,n),tN(e),o},rN=[9,27,vb.HOME,vb.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,vb.DOWN,vb.UP,vb.LEFT,vb.RIGHT].concat(Ri.browser.isFirefox()?[224]:[]),oN="data-mce-placeholder",iN=function(e){return"keydown"===e.type||"keyup"===e.type},aN=function(e){var t=e.keyCode;return t===vb.BACKSPACE||t===vb.DELETE},uN=function(e){if(iN(e)){var t=e.keyCode;return!aN(e)&&(vb.metaKeyPressed(e)||e.altKey||t>=112&&123>=t||ht(rN,t))}return!1},cN=function(e){return iN(e)&&!(aN(e)||"keyup"===e.type&&229===e.keyCode)},sN=function(e,t,n){if(gE.isEmpty(Zt.fromDom(t),!1)){var r=""===n,o=t.firstElementChild;return o?e.getStyle(t.firstElementChild,"padding-left")||e.getStyle(t.firstElementChild,"padding-right")?!1:r?!e.isBlock(o):n===o.nodeName.toLowerCase():!0}return!1},lN=function(e){var t=e.dom,n=yh.getForcedRootBlock(e),r=yh.getPlaceholder(e),o=function(i,a){if(!uN(i)){var u=e.getBody(),c=cN(i)?!1:sN(t,u,n),s=""!==t.getAttrib(u,oN);(s!==c||a)&&(t.setAttrib(u,oN,c?r:null),t.setAttrib(u,"aria-placeholder",c?r:null),Yv(e,c),e.on(c?"keydown":"keyup",o),e.off(c?"keyup":"keydown",o))}};r&&e.on("init",function(n){o(n,!0),e.on("change SetContent ExecCommand",o),e.on("remove",function(){var n=e.getBody();t.setAttrib(n,oN,null),t.setAttrib(n,"aria-placeholder",null)})})},fN=5,dN=400,hN=function(e){return void 0===e.touches||1!==e.touches.length?J.none():J.some(e.touches[0])},mN=function(e,t){var n=Math.abs(e.clientX-t.x()),r=Math.abs(e.clientY-t.y());return n>fN||r>fN},gN=function(e){var t=Jt(J.none()),n=Jt(!1),r=Ss(function(t){e.fire("longpress",$t($t({},t),{type:"longpress"})),n.set(!0)},dN);e.on("touchstart",function(e){hN(e).each(function(o){r.cancel();var i={x:U(o.clientX),y:U(o.clientY),target:U(e.target)};r.throttle(e),n.set(!1),t.set(J.some(i))})},!0),e.on("touchmove",function(o){r.cancel(),hN(o).each(function(r){t.get().each(function(o){mN(r,o)&&(t.set(J.none()),n.set(!1),e.fire("longpresscancel"))})})},!0),e.on("touchend touchcancel",function(o){r.cancel(),"touchcancel"!==o.type&&t.get().filter(function(e){return e.target().isEqualNode(o.target)}).each(function(){n.get()?o.preventDefault():e.fire("tap",$t($t({},o),{type:"tap"}))})},!0)},pN={setup:gN},vN=function(e,t){return e.hasOwnProperty(t.nodeName)},yN=function(e,t){return No.isText(t)?!0:No.isElement(t)?!vN(e,t)&&!Km.isBookmarkNode(t):!1},bN=function(e,t,n){return mt(dC.parents(Zt.fromDom(n),Zt.fromDom(t)),function(t){return vN(e,t.dom())})},CN=function(e,t){if(No.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||vN(e,t.nextSibling)))return!0}return!1},wN=function(e){var t,n,r,o,i,a,u,c,s,l,f=e.dom,d=e.selection,h=e.schema,m=h.getBlockElements(),g=d.getStart(),p=e.getBody(),v=yh.getForcedRootBlock(e);if(g&&No.isElement(g)&&v&&(l=p.nodeName.toLowerCase(),h.isValidChild(l,v.toLowerCase())&&!bN(m,p,g))){for(t=d.getRng(),n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=Bv.hasFocus(e),g=p.firstChild;g;)if(yN(m,g)){if(CN(m,g)){u=g,g=g.nextSibling,f.remove(u);continue}a||(a=f.create(v,yh.getForcedRootBlockAttrs(e)),g.parentNode.insertBefore(a,g),c=!0),u=g,g=g.nextSibling,a.appendChild(u)}else a=null,g=g.nextSibling;c&&s&&(t.setStart(n,r),t.setEnd(o,i),d.setRng(t),e.nodeChanged())}},xN=function(e){yh.getForcedRootBlock(e)&&e.on("NodeChange",t(wN,e))},EN={setup:xN},zN=No.isText,kN=function(e){return zN(e)&&e.data[0]===ml.ZWSP},NN=function(e){return zN(e)&&e.data[e.data.length-1]===ml.ZWSP},SN=function(e){return e.ownerDocument.createTextNode(ml.ZWSP)},TN=function(e){if(zN(e.previousSibling))return NN(e.previousSibling)?e.previousSibling:(e.previousSibling.appendData(ml.ZWSP),e.previousSibling);if(zN(e))return kN(e)?e:(e.insertData(0,ml.ZWSP),e);var t=SN(e);return e.parentNode.insertBefore(t,e),t},AN=function(e){if(zN(e.nextSibling))return kN(e.nextSibling)?e.nextSibling:(e.nextSibling.insertData(0,ml.ZWSP),e.nextSibling);if(zN(e))return NN(e)?e:(e.appendData(ml.ZWSP),e);var t=SN(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t},RN=function(e,t){return e?TN(t):AN(t)},BN=t(RN,!0),DN=t(RN,!1),MN=function(e,t){return No.isText(e.container())?RN(t,e.container()):RN(t,e.getNode())},_N=function(e,t){var n=t.get();return n&&e.container()===n&&yl(n)},PN=function(e,t){return t.fold(function(t){Dd.remove(e.get());var n=BN(t);return e.set(n),J.some(Mf(n,n.length-1))},function(t){return zm.firstPositionIn(t).map(function(t){if(_N(t,e))return Mf(e.get(),1);Dd.remove(e.get());var n=MN(t,!0);return e.set(n),Mf(n,1)})},function(t){return zm.lastPositionIn(t).map(function(t){if(_N(t,e))return Mf(e.get(),e.get().length-1);Dd.remove(e.get());var n=MN(t,!1);return e.set(n),Mf(n,n.length-1)})},function(t){Dd.remove(e.get());var n=DN(t);return e.set(n),J.some(Mf(n,1))})},ON={renderCaret:PN},HN=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,LN=function(e){return HN.test(e)},IN=function(e,t){return ur(Zt.fromDom(t),yh.getInlineBoundarySelector(e))},VN=function(e){return"rtl"===rs.DOM.getStyle(e,"direction",!0)||LN(e.textContent)},FN=function(e,t,n){return bt(rs.DOM.getParents(n.container(),"*",t),e)},UN=function(e,t,n){var r=FN(e,t,n);return J.from(r[r.length-1])},jN=function(e,t,n){var r=Hh(t,e),o=Hh(n,e);return r&&r===o},qN=function(e){return xl(e)||El(e)},$N=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?yl(n)?No.isText(n.nextSibling)?Mf(n.nextSibling,0):Mf.after(n):xl(t)?Mf(n,r+1):t:yl(n)?No.isText(n.previousSibling)?Mf(n.previousSibling,n.previousSibling.data.length):Mf.before(n):El(t)?Mf(n,r-1):t},WN=t($N,!0),KN=t($N,!1),XN={isInlineTarget:IN,findRootInline:UN,isRtl:VN,isAtZwsp:qN,normalizePosition:$N,normalizeForwards:WN,normalizeBackwards:KN,hasSameParentBlock:jN},YN=function(e,t){for(var n=0;n0&&t(a,Fi.last(s))&&c++,a.line=c,o(a))return!0;s.push(a)}};return(u=Fi.last(i.getClientRects()))?(a=i.getNode(),l(a),IS(e,r,l,a),s):s},FS=function(e,t){return t.line>e},US=function(e,t){return t.line===e},jS=t(VS,uz.Up,Zl,Jl),qS=t(VS,uz.Down,Jl,Zl),$S=function(e,t,n,r){var o,i,a,u,c,s,l=lm(t),f=[],d=0,h=function(t){return Fi.last(1===e?t.getClientRects():t.getClientRects())};1===e?(o=l.next,i=Jl,a=Zl,u=Mf.after(r)):(o=l.prev,i=Zl,a=Jl,u=Mf.before(r)),s=h(u);do if(u.isVisible()&&(c=h(u),!a(c,s))){if(f.length>0&&i(c,Fi.last(f))&&d++,c=Kl(c),c.position=u,c.line=d,n(c))return f;f.push(c)}while(u=o(u));return f},WS=function(e){return function(t){return FS(e,t)}},KS=function(e){return function(t){return US(e,t)}},XS=No.isContentEditableFalse,YS=Oh,GS=function(e,t){return Math.abs(e.left-t)},ZS=function(e,t){return Math.abs(e.right-t)},JS=function(e,t){return e>=t.left&&e<=t.right},QS=function(e,t){return Fi.reduce(e,function(e,n){var r,o;return r=Math.min(GS(e,t),ZS(e,t)),o=Math.min(GS(n,t),ZS(n,t)),JS(t,n)?n:JS(t,e)?e:o===r&&XS(n.node)?n:r>o?n:e})},eT=function(e,t,n,r){for(;r=YS(r,e,$l,t);)if(n(r))return},tT=function(e,n){var r=[],o=function(e,t){var o;return o=bt(HS([t]),function(t){return!e(t,n)}),r=r.concat(o),0===o.length};return r.push(n),eT(uz.Up,e,t(o,Zl),n.node),eT(uz.Down,e,t(o,Jl),n.node),r},nT=function(e){return bt(Mt(e.getElementsByTagName("*")),Nh)},rT=function(e,t){return{node:e.node,before:GS(e,t)=e.top&&n<=e.bottom});return r=QS(i,t),r&&(r=QS(tT(e,r),t),r&&Nh(r.node))?rT(r,t):null},iT=No.isContentEditableTrue,aT=No.isContentEditableFalse,uT=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},cT=function(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t},sT=function(e,t){var n=e.fire("BeforeObjectSelected",{target:t});return n.isDefaultPrevented()?null:cT(t)},lT=function(e,t,n){var r=$h(1,e.getBody(),t),o=Mf.fromRangeStart(r),i=o.getNode();if(aT(i))return uT(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(aT(a))return uT(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return aT(e)||iT(e)});return aT(u)?uT(1,e,u,!1,n):null},fT=function(e,t,n){if(!t||!t.collapsed)return t;var r=lT(e,t,n);return r?r:t},dT=function(e,t,n){return J.from(n.container()).filter(No.isText).exists(function(r){var o=e?0:-1;return t(r.data.charAt(n.offset()+o))})},hT=t(dT,!0,Gm),mT=t(dT,!1,Gm),gT=function(e){var t=e.container();return No.isText(t)&&0===t.data.length},pT=function(e,t){return function(n){return J.from(Ih(e?0:-1,n)).filter(t).isSome()}},vT=function(e){return"IMG"===e.nodeName&&"block"===Po(Zt.fromDom(e),"display")},yT=function(e){return No.isContentEditableFalse(e)&&!No.isBogusAll(e)},bT=pT(!0,vT),CT=pT(!1,vT),wT=pT(!0,No.isTable),xT=pT(!1,No.isTable),ET=pT(!0,yT),zT=pT(!1,yT);!function(e){e[e.Br=0]="Br",e[e.Block=1]="Block",e[e.Wrap=2]="Wrap",e[e.Eol=3]="Eol"}(LS||(LS={}));var kT,NT,ST=function(e,t){return e===Df.Backwards?St(t):t},TT=function(e,t,n){return e===Df.Forwards?t.next(n):t.prev(n)},AT=function(e,t,n,r){return No.isBr(r.getNode(t===Df.Forwards))?LS.Br:Lh(n,r)===!1?LS.Block:LS.Wrap},RT=function(e,t,n,r){for(var o,i=lm(n),a=r,u=[];a&&(o=TT(t,i,a));){if(No.isBr(o.getNode(!1)))return t===Df.Forwards?{positions:ST(t,u).concat([o]),breakType:LS.Br,breakAt:J.some(o)}:{positions:ST(t,u),breakType:LS.Br,breakAt:J.some(o)};if(o.isVisible()){if(e(a,o)){var c=AT(n,t,a,o);return{positions:ST(t,u),breakType:c,breakAt:J.some(o)}}u.push(o),a=o}else a=o}return{positions:ST(t,u),breakType:LS.Eol,breakAt:J.none()}},BT=function(e,t,n,r){return t(n,r).breakAt.map(function(r){var o=t(n,r).positions;return e===Df.Backwards?o.concat(r):[r].concat(o)}).getOr([])},DT=function(e,t){return wt(e,function(e,n){return e.fold(function(){return J.some(n)},function(r){return of(Bt(r.getClientRects()),Bt(n.getClientRects()),function(e,o){var i=Math.abs(t-e.left),a=Math.abs(t-o.left);return i>=a?n:r}).or(e)})},J.none())},MT=function(e,t){return Bt(t.getClientRects()).bind(function(t){return DT(e,t.left)})},_T=t(RT,N.isAbove,-1),PT=t(RT,N.isBelow,1),OT=function(e,t){return _T(e,t).breakAt.isNone()},HT=function(e,t){return PT(e,t).breakAt.isNone()},LT=t(BT,-1,_T),IT=t(BT,1,PT),VT=function(e){return zm.firstPositionIn(e).map(function(t){return[t].concat(PT(e,t).positions) }).getOr([])},FT=function(e){return zm.lastPositionIn(e).map(function(t){return _T(e,t).positions.concat(t)}).getOr([])},UT=No.isContentEditableFalse,jT=ef,qT=function(e,t,n,r){var o=e===Df.Forwards,i=o?ET:zT;if(!r.collapsed){var a=jT(r);if(UT(a))return uT(e,t,a,e===Df.Backwards,!0)}var u=Rl(r),c=Kh(e,t.getBody(),r);if(i(c))return sT(t,c.getNode(!o));var s=XN.normalizePosition(o,n(c));if(!s)return u?r:null;if(i(s))return uT(e,t,s.getNode(!o),o,!0);var l=n(s);return l&&i(l)&&Zh(s,l)?uT(e,t,l.getNode(!o),o,!0):u?fT(t,s.toRange(),!0):null},$T=function(e,t,n,r){var o,i,a,u,c,s,l,f,d;if(d=jT(r),o=Kh(e,t.getBody(),r),i=n(t.getBody(),WS(1),o),a=bt(i,KS(1)),c=Fi.last(o.getClientRects()),(ET(o)||wT(o))&&(d=o.getNode()),(zT(o)||xT(o))&&(d=o.getNode(!0)),!c)return null;if(s=c.left,u=QS(a,s),u&&UT(u.node))return l=Math.abs(s-u.left),f=Math.abs(s-u.right),uT(e,t,u.node,f>l,!0);if(d){var h=$S(e,t.getBody(),WS(1),d);if(u=QS(bt(h,KS(1)),s))return fT(t,u.position.toRange(),!0);if(u=Fi.last(bt(h,KS(0))))return fT(t,u.position.toRange(),!0)}},WT=function(e){var t=e.dom.create(yh.getForcedRootBlock(e));return(!Ri.ie||Ri.ie>=11)&&(t.innerHTML='
    '),t},KT=function(e,n,r){var o,i,a,u=lm(e.getBody()),c=t(Gh,u.next),s=t(Gh,u.prev);if(r.collapsed&&e.settings.forced_root_block){if(o=e.dom.getParent(r.startContainer,"PRE"),!o)return;i=1===n?c(Mf.fromRangeStart(r)):s(Mf.fromRangeStart(r)),i||(a=WT(e),1===n?e.$(o).after(a):e.$(o).before(a),e.selection.select(a,!0),e.selection.collapse())}},XT=function(e,n){var r,o=lm(e.getBody()),i=t(Gh,o.next),a=t(Gh,o.prev),u=n?Df.Forwards:Df.Backwards,c=n?i:a,s=e.selection.getRng();return(r=qT(u,e,c,s))?r:(r=KT(e,u,s),r?r:null)},YT=function(e,t){var n,r=t?1:-1,o=t?qS:jS,i=e.selection.getRng();return(n=$T(r,e,o,i))?n:(n=KT(e,r,i),n?n:null)},GT=function(e,t){return function(){var n=XT(e,t);return n?(e.selection.setRng(n),!0):!1}},ZT=function(e,t){return function(){var n=YT(e,t);return n?(e.selection.setRng(n),!0):!1}},JT=function(e){return function(t){return e?zT(t):ET(t)}},QT=function(e,t){return function(){var n=t?Mf.fromRangeEnd(e.selection.getRng()):Mf.fromRangeStart(e.selection.getRng()),r=t?PT(e.getBody(),n):_T(e.getBody(),n),o=t?Dt(r.positions):Bt(r.positions);return o.filter(JT(t)).fold(U(!1),function(t){return e.selection.setRng(t.toRange()),!0})}},eA=function(e,t){return{left:e.left-t,top:e.top-t,right:e.right+2*t,bottom:e.bottom+2*t,width:e.width+t,height:e.height+t}},tA=function(e,t){return kt(t,function(t){var n=eA(Kl(t.getBoundingClientRect()),-1);return[{x:n.left,y:e(n),cell:t},{x:n.right,y:e(n),cell:t}]})},nA=function(e,t,n){return wt(e,function(e,r){return e.fold(function(){return J.some(r)},function(e){var o=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-n)),i=Math.sqrt(Math.abs(r.x-t)+Math.abs(r.y-n));return J.some(o>i?r:e)})},J.none())},rA=function(e,t,n,r,o){var i=Vs(Zt.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),a=bt(tA(e,i),function(e){return t(e,o)});return nA(a,r,o).map(function(e){return e.cell})},oA=function(e){return e.bottom},iA=function(e){return e.top},aA=function(e,t){return e.yt},cA=t(rA,oA,aA),sA=t(rA,iA,uA),lA=function(e,t){return Bt(t.getClientRects()).bind(function(t){return cA(e,t.left,t.top)}).bind(function(e){return MT(FT(e),t)})},fA=function(e,t){return Dt(t.getClientRects()).bind(function(t){return sA(e,t.left,t.top)}).bind(function(e){return MT(VT(e),t)})},dA=function(e,t){e.selection.setRng(t),Jb.scrollRangeIntoView(e,t)},hA=function(e,t,n){return n.breakAt.map(function(n){return e(t,n).breakAt.isSome()}).getOr(!1)},mA=function(e){return e.breakType===LS.Wrap&&0===e.positions.length},gA=function(e){return e.breakType===LS.Br&&1===e.positions.length},pA=function(e,t,n){var r=e(t,n);return mA(r)||!No.isBr(n.getNode())&&gA(r)?!hA(e,t,r):r.breakAt.isNone()},vA=t(pA,_T),yA=t(pA,PT),bA=function(e,t,n){var r=Mf.fromRangeStart(t);return zm.positionIn(!e,n).map(function(e){return e.isEqual(r)}).getOr(!1)},CA=function(e,t,n){var r=e.selection.getRng(),o=t?1:-1;if(kh()&&bA(t,r,n)){var i=uT(o,e,n,!t,!0);return dA(e,i),!0}return!1},wA=function(e,t,n){return lA(t,n).orThunk(function(){return Bt(n.getClientRects()).bind(function(n){return DT(LT(e,Mf.before(t)),n.left)})}).getOr(Mf.before(t))},xA=function(e,t,n){return fA(t,n).orThunk(function(){return Bt(n.getClientRects()).bind(function(n){return DT(IT(e,Mf.after(t)),n.left)})}).getOr(Mf.after(t))},EA=function(e,t){var n=t.getNode(e);return No.isElement(n)&&"TABLE"===n.nodeName?J.some(n):J.none()},zA=function(e,t,n,r){var o=yh.getForcedRootBlock(t);o?t.undoManager.transact(function(){var r=Zt.fromTag(o);Ro(r,yh.getForcedRootBlockAttrs(t)),Mr(r,Zt.fromTag("br")),e?Br(Zt.fromDom(n),r):Rr(Zt.fromDom(n),r);var i=t.dom.createRng();i.setStart(r.dom(),0),i.setEnd(r.dom(),0),dA(t,i)}):dA(t,r.toRange())},kA=function(e,t,n){var r=t?EA(!0,n):EA(!1,n),o=t===!1;r.fold(function(){return dA(e,n.toRange())},function(r){return zm.positionIn(o,e.getBody()).filter(function(e){return e.isEqual(n)}).fold(function(){return dA(e,n.toRange())},function(){return zA(t,e,r,n)})})},NA=function(e,t,n,r){var o=e.selection.getRng(),i=Mf.fromRangeStart(o),a=e.getBody();if(!t&&vA(r,i)){var u=wA(a,n,i);return kA(e,t,u),!0}if(t&&yA(r,i)){var u=xA(a,n,i);return kA(e,t,u),!0}return!1},SA=function(e,t){return function(){return J.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind(function(n){return J.from(e.dom.getParent(n,"table")).map(function(n){return CA(e,t,n)})}).getOr(!1)}},TA=function(e,t){return function(){return J.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind(function(n){return J.from(e.dom.getParent(n,"table")).map(function(r){return NA(e,t,r,n)})}).getOr(!1)}},AA=function(e){return ht(["figcaption"],Vr(e))},RA=function(t){var n=e.document.createRange();return n.setStartBefore(t.dom()),n.setEndBefore(t.dom()),n},BA=function(e,t,n){n?Mr(e,t):Dr(e,t)},DA=function(e,t){var n=Zt.fromTag("br");return BA(e,n,t),RA(n)},MA=function(e,t,n,r){var o=Zt.fromTag(n),i=Zt.fromTag("br");return Ro(o,r),Mr(o,i),BA(e,o,t),RA(i)},_A=function(e,t,n,r){return""===t?DA(e,r):MA(e,r,t,n)},PA=function(e,n){var r=t(fr,n);return Us(Zt.fromDom(e.container()),da,r).filter(AA)},OA=function(e,t,n){return t?HT(e.dom(),n):OT(e.dom(),n)},HA=function(e,t){var n=Zt.fromDom(e.getBody()),r=Mf.fromRangeStart(e.selection.getRng()),o=yh.getForcedRootBlock(e),i=yh.getForcedRootBlockAttrs(e);return PA(r,n).exists(function(){if(OA(n,t,r)){var a=_A(n,o,i,t);return e.selection.setRng(a),!0}return!1})},LA=function(e,t){return function(){return e.selection.isCollapsed()?HA(e,t):!1}},IA=function(e){return gt(e,function(e){return $t({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:V},e)})},VA=function(e,t){return t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey},FA=function(e,t){return kt(IA(e),function(e){return VA(e,t)?[e]:[]})},UA=function(e){for(var t=[],n=1;n0})},bD=function(e){var t=xD(e);return!e.mode.isReadOnly()&&(t.length>1||yD(e,t))},CD=function(e){return va(e)||ya(e)},wD=function(e){return br(e).map(CD).getOr(!1)},xD=function(e){return bt(gt(e.selection.getSelectedBlocks(),Zt.fromDom),function(e){return!CD(e)&&!wD(e)&&mD(e)})},ED=function(e,t){var n=e.dom,r=e.selection,o=e.formatter,i=yh.getIndentation(e),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),c=yh.shouldIndentUseMargin(e),s=yh.getForcedRootBlock(e);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),pt(xD(e),function(e){vD(n,t,c,u,a,e.dom())})},zD=function(e,t,n){return zm.navigateIgnore(e,t,n,gT)},kD=function(e,t){return xt(dC.parentsAndSelf(Zt.fromDom(t.container()),e),da)},ND=function(e,t,n){return zD(e,t.dom(),n).forall(function(e){return kD(t,n).fold(function(){return Lh(e,n,t.dom())===!1},function(r){return Lh(e,n,t.dom())===!1&&gr(r,Zt.fromDom(e.container()))})})},SD=function(e,t,n){return kD(t,n).fold(function(){return zD(e,t.dom(),n).forall(function(e){return Lh(e,n,t.dom())===!1})},function(t){return zD(e,t.dom(),n).isNone()})},TD=t(SD,!1),AD=t(SD,!0),RD=t(ND,!1),BD=t(ND,!0),DD=function(e){if(e.selection.isCollapsed()&&bD(e)){var t=e.dom,n=e.selection.getRng(),r=Mf.fromRangeStart(n),o=t.getParent(n.startContainer,t.isBlock);if(null!==o&&TD(Zt.fromDom(o),r))return ED(e,"outdent"),!0}return!1},MD={backspaceDelete:DD},_D=function(e,t,n){qA.execute([{keyCode:vb.BACKSPACE,action:qA.action(MD.backspaceDelete,e,!1)},{keyCode:vb.BACKSPACE,action:qA.action(oB.backspaceDelete,e,!1)},{keyCode:vb.DELETE,action:qA.action(oB.backspaceDelete,e,!0)},{keyCode:vb.BACKSPACE,action:qA.action(sB.backspaceDelete,e,!1)},{keyCode:vb.DELETE,action:qA.action(sB.backspaceDelete,e,!0)},{keyCode:vb.BACKSPACE,action:qA.action(yB.backspaceDelete,e,t,!1)},{keyCode:vb.DELETE,action:qA.action(yB.backspaceDelete,e,t,!0)},{keyCode:vb.BACKSPACE,action:qA.action(lD.backspaceDelete,e,!1)},{keyCode:vb.DELETE,action:qA.action(lD.backspaceDelete,e,!0)},{keyCode:vb.BACKSPACE,action:qA.action(hD.backspaceDelete,e,!1)},{keyCode:vb.DELETE,action:qA.action(hD.backspaceDelete,e,!0)},{keyCode:vb.BACKSPACE,action:qA.action(BR.backspaceDelete,e,!1)},{keyCode:vb.DELETE,action:qA.action(BR.backspaceDelete,e,!0)},{keyCode:vb.BACKSPACE,action:qA.action(ER.backspaceDelete,e,!1)},{keyCode:vb.DELETE,action:qA.action(ER.backspaceDelete,e,!0)},{keyCode:vb.BACKSPACE,action:qA.action(zB.backspaceDelete,e,!1)},{keyCode:vb.DELETE,action:qA.action(zB.backspaceDelete,e,!0)}],n).each(function(){n.preventDefault()})},PD=function(e,t){qA.execute([{keyCode:vb.BACKSPACE,action:qA.action(oB.paddEmptyElement,e)},{keyCode:vb.DELETE,action:qA.action(oB.paddEmptyElement,e)}],t)},OD=function(e,t){e.on("keydown",function(n){n.isDefaultPrevented()===!1&&_D(e,t,n)}),e.on("keyup",function(t){t.isDefaultPrevented()===!1&&PD(e,t)})},HD={setup:OD},LD=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}},ID=function(e,t){var n,r,o=t,i=e.dom,a=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var u=LD(t.firstChild);u&&/^(UL|OL|DL)$/.test(u.nodeName)&&t.insertBefore(i.doc.createTextNode(yu),t.firstChild)}if(r=i.createRng(),t.normalize(),t.hasChildNodes()){for(var c=new Xc(t,t);n=c.current();){if(No.isText(n)){r.setStart(n,0),r.setEnd(n,0);break}if(a[n.nodeName.toLowerCase()]){r.setStartBefore(n),r.setEndBefore(n);break}o=n,n=c.next()}n||(r.setStart(o,0),r.setEnd(o,0))}else No.isBr(t)?t.nextSibling&&i.isBlock(t.nextSibling)?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)):(r.setStart(t,0),r.setEnd(t,0));e.selection.setRng(r),Jb.scrollRangeIntoView(e,r)}},VD=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},FD=function(e){return J.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},UD=function(e){return FD(e).fold(U(""),function(e){return e.nodeName.toUpperCase()})},jD=function(e){return FD(e).filter(function(e){return ya(Zt.fromDom(e))}).isSome()},qD={moveToCaretPosition:ID,getEditableRoot:VD,getParentBlock:FD,getParentBlockName:UD,isListItemParentBlock:jD},$D=function(e,t){return e.firstChild&&e.firstChild.nodeName===t},WD=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},KD=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},XD=function(e){return KD(e)&&KD(e.parentNode)},YD=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},GD=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!No.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},ZD=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){XD(n)&&(o="LI");var u=o?t(o):i.create("BR");if(GD(n,r,!0)&&GD(n,r,!1))WD(n,"LI")?i.insertAfter(u,YD(n)):i.replace(u,n);else if(GD(n,r,!0))WD(n,"LI")?(i.insertAfter(u,YD(n)),u.appendChild(i.doc.createTextNode(" ")),u.appendChild(n)):n.parentNode.insertBefore(u,n);else if(GD(n,r,!1))i.insertAfter(u,YD(n));else{n=YD(n);var c=a.cloneRange();c.setStartAfter(r),c.setEndAfter(n);var s=c.extractContents();"LI"===o&&$D(s,"LI")?(u=s.firstChild,i.insertAfter(s,n)):(i.insertAfter(s,n),i.insertAfter(u,n))}i.remove(r),qD.moveToCaretPosition(e,u)}},JD={insert:ZD},QD=function(e){pt(Is(Zt.fromDom(e),qr),function(e){var t=e.dom();t.nodeValue=ml.trim(t.nodeValue)})},eM=function(e,t){return t&&"A"===t.nodeName&&e.isEmpty(t)},tM=function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)},nM=function(e){e.innerHTML='
    '},rM=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},oM=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},iM=function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;No.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)o=i[r],!o.hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):eM(e,o)&&e.remove(o)}},aM=function(e,t,n){return No.isText(t)===!1?n:e?1===n&&t.data.charAt(n-1)===ml.ZWSP?0:n:n===t.data.length-1&&t.data.charAt(n)===ml.ZWSP?t.data.length:n},uM=function(e){var t=e.cloneRange();return t.setStart(e.startContainer,aM(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,aM(!1,e.endContainer,e.endOffset)),t},cM=function(e){do No.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)},sM=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},lM=function(e,t,n){J.from(n.style).map(e.dom.parseStyle).each(function(n){var r=Lo(Zt.fromDom(t)),o=$t($t({},r),n);e.dom.setStyles(t,o)});var r=J.from(n.class).map(function(e){return e.split(/\s+/)}),i=J.from(t.className).map(function(e){return bt(e.split(/\s+/),function(e){return""!==e})});of(r,i,function(n,r){var i=bt(r,function(e){return!ht(n,e)}),a=o(n,i);e.dom.setAttrib(t,"class",a.join(" "))});var a=["style","class"],u=Ut(n,function(e,t){return!ht(a,t)});e.dom.setAttribs(t,u)},fM=function(e,t){var n=yh.getForcedRootBlock(e);if(n&&n.toLowerCase()===t.tagName.toLowerCase()){var r=yh.getForcedRootBlockAttrs(e);lM(e,t,r)}},dM=function(e,t,n,r,o){var i,a,u,c,s,l,f=t||"P",d=e.dom,h=sM(d,r);if(a=d.getParent(r,d.isBlock),!a||!oM(d,a)){if(a=a||h,l=a===e.getBody()||tM(a)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=d.create(f),fM(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==a;)c=c.parentNode;for(;c&&!d.isBlock(c);)u=c,c=c.previousSibling;if(u&&e.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),fM(e,i),u.parentNode.insertBefore(i,u),c=u;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r},hM=function(e,t){var n;t.normalize(),n=t.lastChild,(!n||/^(left|right)$/gi.test(e.getStyle(n,"float",!0)))&&e.add(t,"br") },mM=function(e,t){var n,r,o,i,a,u,c,s,l,f,d,h,m,g=e.dom,p=e.schema,v=p.getNonEmptyElements(),y=e.selection.getRng(),b=function(t){var n,i,u,c=o,s=p.getTextInlineElements();if(n=t||"TABLE"===f||"HR"===f?g.create(t||h):a.cloneNode(!1),u=n,yh.shouldKeepStyles(e)===!1)g.setAttrib(n,"style",null),g.setAttrib(n,"class",null);else do if(s[c.nodeName]){if(vd(c)||Km.isBookmarkNode(c))continue;i=c.cloneNode(!1),g.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(u=i,n.appendChild(i))}while((c=c.parentNode)&&c!==r);return fM(e,n),nM(u),n},C=function(e){var t,n,r=aM(e,o,i);if(No.isText(o)&&(e?r>0:ro.childNodes.length-1,o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o,i=m&&No.isText(o)?o.nodeValue.length:0),(r=sM(g,o))?((h&&!u||!h&&u)&&(o=dM(e,h,y,o,i)),a=g.getParent(o,g.isBlock),l=a?g.getParent(a.parentNode,g.isBlock):null,f=a?a.nodeName.toUpperCase():"",d=l?l.nodeName.toUpperCase():"","LI"!==d||x||(a=l,l=l.parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&g.isEmpty(a)?void JD.insert(e,b,l,a,h):void(h&&a===e.getBody()||(h=h||"P",vl(a)?(c=Al(a),g.isEmpty(a)&&nM(a),fM(e,c),qD.moveToCaretPosition(e,c)):C()?w():C(!0)?(c=a.parentNode.insertBefore(b(),a),qD.moveToCaretPosition(e,rM(a,"HR")?c:a)):(n=uM(y).cloneRange(),n.setEndAfter(a),s=n.extractContents(),QD(s),cM(s),c=s.firstChild,g.insertAfter(s,a),iM(g,v,c),hM(g,a),g.isEmpty(a)&&nM(a),c.normalize(),g.isEmpty(c)?(g.remove(c),w()):(fM(e,c),qD.moveToCaretPosition(e,c))),g.setAttrib(c,"id",""),e.fire("NewBlock",{newBlock:c})))):void 0},gM={insert:mM},pM=function(e,t,n){for(var r,o=new Xc(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0},vM=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},yM=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},bM=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();xw.normalize(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,c=a.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=u>c.childNodes.length-1;c=c.childNodes[Math.min(u,c.childNodes.length-1)]||c,u=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():"",h=!(!t||!t.ctrlKey);"LI"!==d||h||(l=f),c&&3===c.nodeType&&u>=c.nodeValue.length&&(pM(e.schema,c,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Zf(i,a,n),vM(i,o,n),yM(i,o,n,r),e.undoManager.add()},CM=function(e,t){var n=Zt.fromTag("br");Rr(Zt.fromDom(t),n),e.undoManager.add()},wM=function(e,t){EM(e.getBody(),t)||Br(Zt.fromDom(t),Zt.fromTag("br"));var n=Zt.fromTag("br");Br(Zt.fromDom(t),n),vM(e.dom,e.selection,n.dom()),yM(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},xM=function(e){return No.isBr(e.getNode())},EM=function(e,t){return xM(Mf.after(t))?!0:zm.nextPosition(e,Mf.after(t)).map(function(e){return No.isBr(e.getNode())}).getOr(!1)},zM=function(e){return e&&"A"===e.nodeName&&"href"in e},kM=function(e){return e.fold(U(!1),zM,zM,U(!1))},NM=function(e){var n=t(XN.isInlineTarget,e),r=Mf.fromRangeStart(e.selection.getRng());return vS.readLocation(n,e.getBody(),r).filter(kM)},SM=function(e,n){n.fold(V,t(CM,e),t(wM,e),V)},TM=function(e,n){var r=NM(e);r.isSome()?r.each(t(SM,e)):bM(e,n)},AM={insert:TM},RM=function(e,t){return qD.getParentBlock(e).filter(function(e){return t.length>0&&ur(Zt.fromDom(e),t)}).isSome()},BM=function(e){return RM(e,yh.getBrNewLineSelector(e))},DM=function(e){return RM(e,yh.getNoNewLineSelector(e))},MM={shouldInsertBr:BM,shouldBlockNewLine:DM},_M=yp.generate([{br:[]},{block:[]},{none:[]}]),PM=function(e){return MM.shouldBlockNewLine(e)},OM=function(e){return function(t){var n=""===yh.getForcedRootBlock(t);return n===e}},HM=function(e){return function(t){return qD.isListItemParentBlock(t)===e}},LM=function(e,t){return function(n){var r=qD.getParentBlockName(n)===e.toUpperCase();return r===t}},IM=function(e){return LM("pre",e)},VM=function(){return LM("summary",!0)},FM=function(e){return function(t){return yh.shouldPutBrInPre(t)===e}},UM=function(e){return MM.shouldInsertBr(e)},jM=function(e,t){return t},qM=function(e){var t=yh.getForcedRootBlock(e),n=qD.getEditableRoot(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t?t:"P")},$M=function(e,t){return function(n,r){var o=wt(e,function(e,t){return e&&t(n,r)},!0);return o?J.some(t):J.none()}},WM=function(e,t){return GN.evaluateUntil([$M([PM],_M.none()),$M([VM()],_M.br()),$M([IM(!0),FM(!1),jM],_M.br()),$M([IM(!0),FM(!1)],_M.block()),$M([IM(!0),FM(!0),jM],_M.block()),$M([IM(!0),FM(!0)],_M.br()),$M([HM(!0),jM],_M.br()),$M([HM(!0)],_M.block()),$M([OM(!0),jM,qM],_M.block()),$M([OM(!0)],_M.br()),$M([UM],_M.br()),$M([OM(!1),jM],_M.br()),$M([qM],_M.block())],[e,!(!t||!t.shiftKey)]).getOr(_M.none())},KM={getAction:WM},XM=function(e,t){KM.getAction(e,t).fold(function(){AM.insert(e,t)},function(){gM.insert(e,t)},V)},YM={insert:XM},GM=function(e,t){t.isDefaultPrevented()||(t.preventDefault(),Uk(e.undoManager),e.undoManager.transact(function(){e.selection.isCollapsed()===!1&&e.execCommand("Delete"),YM.insert(e,t)}))},ZM=function(e){e.on("keydown",function(t){t.keyCode===vb.ENTER&&GM(e,t)})},JM={setup:ZM},QM=function(e,t){var n=t.container(),r=t.offset();return No.isText(n)?(n.insertData(r,e),J.some(N(n,r+e.length))):Xh(t).map(function(n){var r=Zt.fromText(e);return t.isAtEnd()?Br(n,r):Rr(n,r),N(r.dom(),e.length)})},e_=t(QM,yu),t_=t(QM," "),n_=function(e){return N.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},r_=function(e,t){var n=bt(dC.parentsAndSelf(Zt.fromDom(t.container()),e),da);return Bt(n).getOr(e)},o_=function(e,t){return n_(t)?mT(t):mT(t)||zm.prevPosition(r_(e,t).dom(),t).exists(mT)},i_=function(e,t){return n_(t)?hT(t):hT(t)||zm.nextPosition(r_(e,t).dom(),t).exists(hT)},a_=function(e){return ht(["pre","pre-wrap"],e)},u_=function(e){return Xh(e).bind(function(e){return Us(e,jr)}).exists(function(e){return a_(Po(e,"white-space"))})},c_=function(e,t){return zm.prevPosition(e.dom(),t).isNone()},s_=function(e,t){return zm.nextPosition(e.dom(),t).isNone()},l_=function(e,t){return c_(e,t)||s_(e,t)||TD(e,t)||AD(e,t)||PR(e,t)||_R(e,t)},f_=function(e,t){return u_(t)?!1:l_(e,t)||o_(e,t)||i_(e,t)},d_=function(e,t){return u_(t)?!1:TD(e,t)||RD(e,t)||PR(e,t)||o_(e,t)},h_=function(e){var t=e.container(),n=e.offset();return No.isText(t)&&n0&&n=0&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1},e}(),W_=function(e){e.on("click",function(t){e.dom.getParent(t.target,"details")&&t.preventDefault()})},K_=function(e){e.parser.addNodeFilter("details",function(e){pt(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),e.serializer.addNodeFilter("details",function(e){pt(e,function(e){var t=e.attr("data-mce-open");e.attr("open",tt(t)?t:null),e.attr("data-mce-open",null)})})},X_=function(e){W_(e),K_(e)},Y_=function(e){return No.isElement(e)&&pa(Zt.fromDom(e))},G_=function(e){var t=e.selection.getRng(),n=N.fromRangeStart(t),r=N.fromRangeEnd(t);if(N.isElementPosition(n)){var o=n.container();Y_(o)&&zm.firstPositionIn(o).each(function(e){return t.setStart(e.container(),e.offset())})}if(N.isElementPosition(r)){var o=n.container();Y_(o)&&zm.lastPositionIn(o).each(function(e){return t.setEnd(e.container(),e.offset())})}e.selection.setRng($z.normalize(t))},Z_=function(e){e.on("click",function(t){t.detail>=3&&G_(e)})},J_=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),t=e.ownerDocument,n=t.documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},Q_=function(e){return e.inline?J_(e.getBody()):{left:0,top:0}},eP=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}},tP=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},o={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:o},nP=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=J_(e.getContentAreaContainer()),r=tP(e);return{left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}return{left:t.pageX,top:t.pageY}},rP=function(e,t,n){return{pageX:n.left-e.left+t.left,pageY:n.top-e.top+t.top}},oP=function(e,t){return rP(Q_(e),eP(e),nP(e,t))},iP={calc:oP},aP=No.isContentEditableFalse,uP=No.isContentEditableTrue,cP=function(e,t){return aP(t)&&t!==e},sP=function(e,t,n){return t===n||e.dom.isChildOf(t,n)?!1:!aP(t)},lP=function(e){var t=e.cloneNode(!0);return t.removeAttribute("data-mce-selected"),t},fP=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i},dP=function(e,t){e.parentNode!==t&&t.appendChild(e)},hP=function(e,t,n,r,o,i){var a=0,u=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>o&&(a=t.pageX+n-o),t.pageY+r>i&&(u=t.pageY+r-i),e.style.width=n-a+"px",e.style.height=r-u+"px"},mP=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},gP=function(e){return 0===e.button},pP=function(e){return e.element},vP=function(e,t){return{pageX:t.pageX-e.relX,pageY:t.pageY+5}},yP=function(e,t){return function(n){if(gP(n)){var r=xt(t.dom.getParents(n.target),ff.or(aP,uP)).getOr(null);if(cP(t.getBody(),r)){var o=t.dom.getPos(r),i=t.getBody(),a=t.getDoc().documentElement;e.element=r,e.screenX=n.screenX,e.screenY=n.screenY,e.maxX=(t.inline?i.scrollWidth:a.offsetWidth)-2,e.maxY=(t.inline?i.scrollHeight:a.offsetHeight)-2,e.relX=n.pageX-o.x,e.relY=n.pageY-o.y,e.width=r.offsetWidth,e.height=r.offsetHeight,e.ghost=fP(t,r,e.width,e.height)}}}},bP=function(e,t){var n=wi.throttle(function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)},0);return function(r){var o=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(pP(e)&&!e.dragging&&o>10){var i=t.fire("dragstart",{target:e.element});if(i.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){var a=vP(e,iP.calc(t,r));dP(e.ghost,t.getBody()),hP(e.ghost,a,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY)}}},CP=function(e){var t=e.getSel().getRangeAt(0),n=t.startContainer;return 3===n.nodeType?n.parentNode:n},wP=function(e,t){return function(n){if(e.dragging&&sP(t,CP(t.selection),e.element)){var r=lP(e.element),o=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});o.isDefaultPrevented()||(r=o.targetClone,t.undoManager.transact(function(){mP(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()}))}EP(e)}},xP=function(e,t){return function(){e.dragging&&t.fire("dragend"),EP(e)}},EP=function(e){e.dragging=!1,e.element=null,mP(e.ghost)},zP=function(t){var n,r,o,i,a,u,c={};n=rs.DOM,u=e.document,r=yP(c,t),o=bP(c,t),i=wP(c,t),a=xP(c,t),t.on("mousedown",r),t.on("mousemove",o),t.on("mouseup",i),n.bind(u,"mousemove",o),n.bind(u,"mouseup",a),t.on("remove",function(){n.unbind(u,"mousemove",o),n.unbind(u,"mouseup",a)})},kP=function(e){e.on("drop",function(t){var n="undefined"!=typeof t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(aP(n)||aP(e.dom.getContentEditableParent(n)))&&t.preventDefault()})},NP=function(e){zP(e),kP(e)},SP={init:NP},TP=function(t){var n=Ns(function(){if(!t.removed&&t.getBody().contains(e.document.activeElement)){var n=t.selection.getRng();if(n.collapsed){var r=fT(t,t.selection.getRng(),!1);t.selection.setRng(r)}}},0);t.on("focus",function(){n.throttle()}),t.on("blur",function(){n.cancel()})},AP={setup:TP},RP=No.isContentEditableTrue,BP=No.isContentEditableFalse,DP=function(e,t){for(var n=e.getBody();t&&t!==n;){if(RP(t)||BP(t))return t;t=t.parentNode}return null},MP=function(e){var t,n=function(t){return e.dom.isBlock(t)},r=e.getBody(),o=zh(e,r,n,function(){return Bv.hasFocus(e)}),i="sel-"+e.dom.uniqueId(),a=function(t){return e.dom.hasClass(t,"mce-offscreen-selection")},u=function(){var t=e.dom.get(i);return t?t.getElementsByTagName("*")[0]:t},c=function(t){t&&e.selection.setRng(t)},s=function(){return e.selection.getRng()},l=function(t,n,r,i){void 0===i&&(i=!0);var a;return a=e.fire("ShowCaret",{target:n,direction:t,before:r}),a.isDefaultPrevented()?null:(i&&e.selection.scrollIntoView(n,-1===t),o.show(r,n))},f=function(t){t.hasAttribute("data-mce-caret")&&(Al(t),c(s()),e.selection.scrollIntoView(t))},d=function(){e.on("mouseup",function(t){var n=s();n.collapsed&&Yy.isXYInContentArea(e,t.clientX,t.clientY)&&c(lT(e,n,!1))}),e.on("click",function(t){var n;n=DP(e,t.target),n&&(BP(n)&&(t.preventDefault(),e.focus()),RP(n)&&e.dom.isChildOf(n,e.selection.getNode())&&v())}),e.on("blur NewBlock",function(){v()}),e.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n=function(e){e.on("tap",function(t){var n=DP(e,t.target);BP(n)&&(t.preventDefault(),p(sT(e,n)))},!0)},i=function(e){var t=lm(e);if(!e.firstChild)return!1;var n=Mf.before(e.firstChild),r=t.next(n);return r&&!ET(r)&&!zT(r)},f=function(t,n){var r=e.dom.getParent(t,e.dom.isBlock),o=e.dom.getParent(n,e.dom.isBlock);return r===o},d=function(t,n){var r=e.dom.getParent(t,e.dom.isBlock),o=e.dom.getParent(n,e.dom.isBlock);return r&&e.dom.isChildOf(r,o)&&BP(DP(e,r))===!1?!0:r&&!f(r,o)&&i(r)};n(e),e.on("mousedown",function(t){var n,o=t.target;if((o===r||"HTML"===o.nodeName||e.dom.isChildOf(o,r))&&Yy.isXYInContentArea(e,t.clientX,t.clientY)!==!1)if(n=DP(e,o))BP(n)?(t.preventDefault(),p(sT(e,n))):(v(),RP(n)&&t.shiftKey||pb.isXYWithinRange(t.clientX,t.clientY,e.selection.getRng())||(b(),e.selection.placeCaretAt(t.clientX,t.clientY)));else if(Nh(o)===!1){v(),b();var i=oT(r,t.clientX,t.clientY);if(i&&!d(t.target,i.node)){t.preventDefault();var a=l(1,i.node,i.before,!1);e.getBody().focus(),c(a)}}}),e.on("keypress",function(t){if(!vb.modifierPressed(t))switch(t.keyCode){default:BP(e.selection.getNode())&&t.preventDefault()}}),e.on("GetSelectionRange",function(e){var n=e.range;if(t){if(!t.parentNode)return void(t=null);n=n.cloneRange(),n.selectNode(t),e.range=n}}),e.on("SetSelectionRange",function(e){e.range=g(e.range);var t=p(e.range,e.forward);t&&(e.range=t)});var h=function(e){return"mcepastebin"===e.id};e.on("AfterSetSelectionRange",function(e){var t=e.range;m(t)||h(t.startContainer.parentNode)||b(),a(t.startContainer.parentNode)||v()}),e.on("copy",function(e){var t=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!Ri.ie){var n=u();n&&(e.preventDefault(),t.clearData(),t.setData("text/html",n.outerHTML),t.setData("text/plain",n.outerText))}}),SP.init(e),AP.setup(e)},h=function(e){return bl(e)||Nl(e)||Sl(e)},m=function(e){return h(e.startContainer)||h(e.endContainer)},g=function(t){var n=e.schema.getShortEndedElements(),r=e.dom.createRng(),o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset;return qt(n,o.nodeName.toLowerCase())?0===i?r.setStartBefore(o):r.setStartAfter(o):r.setStart(o,i),qt(n,a.nodeName.toLowerCase())?0===u?r.setEndBefore(a):r.setEndAfter(a):r.setEnd(a,u),r},p=function(n,o){var a,u,c,s,f,d,h,g,p,v,y=e.$,C=e.dom;if(!n)return null;if(n.collapsed){if(!m(n))if(o===!1){if(g=Kh(-1,r,n),Nh(g.getNode(!0)))return l(-1,g.getNode(!0),!1,!1);if(Nh(g.getNode()))return l(-1,g.getNode(),!g.isAtEnd(),!1)}else{if(g=Kh(1,r,n),Nh(g.getNode()))return l(1,g.getNode(),!g.isAtEnd(),!1);if(Nh(g.getNode(!0)))return l(1,g.getNode(!0),!1,!1)}return null}if(s=n.startContainer,f=n.startOffset,d=n.endOffset,3===s.nodeType&&0===f&&BP(s.parentNode)&&(s=s.parentNode,f=C.nodeIndex(s),s=s.parentNode),1!==s.nodeType)return null;if(d===f+1&&s===n.endContainer&&(a=s.childNodes[f]),!BP(a))return null;if(p=v=a.cloneNode(!0),h=e.fire("ObjectSelected",{target:a,targetClone:p}),h.isDefaultPrevented())return null;u=qs(Zt.fromDom(e.getBody()),"#"+i).fold(function(){return y([])},function(e){return y([e.dom()])}),p=h.targetClone,0===u.length&&(u=y('
    ').attr("id",i),u.appendTo(e.getBody())),n=e.dom.createRng(),p===v&&Ri.ie?(u.empty().append('

     

    ').append(p),n.setStartAfter(u[0].firstChild.firstChild),n.setEndAfter(p)):(u.empty().append(yu).append(p).append(yu),n.setStart(u[0].firstChild,1),n.setEnd(u[0].lastChild,0)),u.css({top:C.getPos(a,e.getBody()).y}),u[0].focus(),c=e.selection.getSel(),c.removeAllRanges(),c.addRange(n);var w=Zt.fromDom(a);return pt(Vs(Zt.fromDom(e.getBody()),"*[data-mce-selected]"),function(e){fr(w,e)||_o(e,"data-mce-selected")}),e.dom.getAttrib(a,"data-mce-selected")||a.setAttribute("data-mce-selected","1"),t=a,b(),n},v=function(){t&&(t.removeAttribute("data-mce-selected"),qs(Zt.fromDom(e.getBody()),"#"+i).each(Lr),t=null),qs(Zt.fromDom(e.getBody()),"#"+i).each(Lr),t=null},y=function(){o.destroy(),t=null},b=function(){o.hide()};return Ri.ceFalse&&d(),{showCaret:l,showBlockCaretContainer:f,hideFakeCaret:b,destroy:y}},_P=function(t){var n=ea.each,r=vb.BACKSPACE,o=vb.DELETE,i=t.dom,a=t.selection,u=t.settings,c=t.parser,s=Ri.gecko,l=Ri.ie,f=Ri.webkit,d="data:text/mce-internal,",h=l?"Text":"URL",m=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(r){}},g=function(e){return e.isDefaultPrevented()},p=function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&a.select(e.target),n=t.selection.getContent(),n.length>0&&(r=d+escape(t.id)+","+escape(n),e.dataTransfer.setData(h,r)))},v=function(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(h),t&&t.indexOf(d)>=0)?(t=t.substr(d.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null},y=function(e,n){t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:e,internal:n}):t.execCommand("mceInsertContent",!1,e)},b=function(){var e=function(e){var t=i.create("body"),n=e.cloneContents();return t.appendChild(n),a.serializer.serialize(t,{format:"html"})},n=function(n){var r=e(n),o=i.createRng();o.selectNode(t.getBody());var a=e(o);return r===a};t.on("keydown",function(e){var a,u,c=e.keyCode;if(!g(e)&&(c===o||c===r)){if(a=t.selection.isCollapsed(),u=t.getBody(),a&&!i.isEmpty(u))return;if(!a&&!n(t.selection.getRng()))return;e.preventDefault(),t.setContent(""),u.firstChild&&i.isBlock(u.firstChild)?t.selection.setCursorLocation(u.firstChild,0):t.selection.setCursorLocation(u,0),t.nodeChanged()}})},C=function(){t.shortcuts.add("meta+a",null,"SelectAll")},w=function(){t.inline||i.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(bl(n.startContainer))return;a.placeCaretAt(e.clientX,e.clientY)}else a.setRng(n)})},x=function(){t.on("keydown",function(e){if(!g(e)&&e.keyCode===r){if(!t.getBody().getElementsByTagName("hr").length)return;if(a.isCollapsed()&&0===a.getRng().startOffset){var n=a.getNode(),o=n.previousSibling;if("HR"===n.nodeName)return i.remove(n),void e.preventDefault();o&&o.nodeName&&"hr"===o.nodeName.toLowerCase()&&(i.remove(o),e.preventDefault())}}})},E=function(){e.Range.prototype.getClientRects||t.on("mousedown",function(e){if(!g(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),wi.setEditorTimeout(t,function(){n.focus()})}})},z=function(){t.on("click",function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==i.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&i.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),a.select(n))})},k=function(){var e=function(){var e=i.getAttribs(a.getStart().cloneNode(!1));return function(){var r=a.getStart();r!==t.getBody()&&(i.setAttrib(r,"style",null),n(e,function(e){r.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!a.isCollapsed()&&i.getParent(a.getStart(),i.isBlock)!==i.getParent(a.getEnd(),i.isBlock)};t.on("keypress",function(n){var o;return g(n)||8!==n.keyCode&&46!==n.keyCode||!r()?void 0:(o=e(),t.getDoc().execCommand("delete",!1,null),o(),n.preventDefault(),!1)}),i.bind(t.getDoc(),"cut",function(n){var o;!g(n)&&r()&&(o=e(),wi.setEditorTimeout(t,function(){o()}))})},N=function(){t.on("keydown",function(e){if(!g(e)&&e.keyCode===r&&a.isCollapsed()&&0===a.getRng().startOffset){var t=a.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},S=function(){t.on("keydown",function(e){var n,r,o,u,c;if(!g(e)&&e.keyCode===vb.BACKSPACE&&(n=a.getRng(),r=n.startContainer,o=n.startOffset,u=i.getRoot(),c=r,n.collapsed&&0===o)){for(;c&&c.parentNode&&c.parentNode.firstChild===c&&c.parentNode!==u;)c=c.parentNode;"BLOCKQUOTE"===c.tagName&&(t.formatter.toggle("blockquote",null,c),n=i.createRng(),n.setStart(r,0),n.setEnd(r,0),a.setRng(n))}})},T=function(){var e=function(){m("StyleWithCSS",!1),m("enableInlineTableEditing",!1),u.object_resizing||m("enableObjectResizing",!1)};u.readonly||t.on("BeforeExecCommand mousedown",e)},A=function(){var e=function(){n(i.select("a"),function(e){var t=e.parentNode,n=i.getRoot();if(t.lastChild===e){for(;t&&!i.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}i.add(t,"br",{"data-mce-bogus":1})}})};t.on("SetContent ExecCommand",function(t){("setcontent"===t.type||"mceInsertLink"===t.command)&&e()})},R=function(){u.forced_root_block&&t.on("init",function(){m("DefaultParagraphSeparator",yh.getForcedRootBlock(t))})},B=function(){t.on("keyup focusin mouseup",function(e){vb.modifierPressed(e)||a.normalize()},!0)},D=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},M=function(){t.inline||t.on("keydown",function(){e.document.activeElement===e.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(Ri.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}}))},P=function(){Ri.mac&&t.on("keydown",function(e){if(vb.metaKeyPressed(e)&&!e.shiftKey&&(37===e.keyCode||39===e.keyCode)){e.preventDefault();var n=t.selection.getSel();n.modify("move",37===e.keyCode?"backward":"forward","lineboundary")}})},O=function(){m("AutoUrlDetect",!1)},H=function(){t.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},L=function(){t.on("init",function(){t.dom.bind(t.getBody(),"submit",function(e){e.preventDefault()})})},I=function(){c.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()})},V=function(){t.on("dragstart",function(e){p(e)}),t.on("drop",function(e){if(!g(e)){var n=v(e);if(n&&n.id!==t.id){e.preventDefault();var r=oC.fromPoint(e.x,e.y,t.getDoc());a.setRng(r),y(n.html,!0)}}})},F=function(){},U=function(){var e;return!s||t.removed?!1:(e=t.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount)};return S(),b(),Ri.windowsPhone||B(),f&&(w(),z(),R(),L(),N(),I(),Ri.iOS?(M(),_(),H()):C()),Ri.ie>=11&&(_(),N()),Ri.ie&&(C(),O(),V()),s&&(x(),E(),k(),T(),A(),D(),P(),N()),{refreshContentEditable:F,isHidden:U}},PP=rs.DOM,OP=function(e,t){var n=Zt.fromDom(e.getDoc().head),r=Zt.fromTag("style");Ao(r,"type","text/css"),Mr(r,Zt.fromText(t)),Mr(n,r)},HP=function(e){var t=ox(e.settings,e.schema);return t.addAttributeFilter("src,href,style,tabindex",function(t,n){for(var r,o,i=t.length,a=e.dom,u="data-mce-"+n;i--;)if(r=t[i],o=r.attr(n),o&&!r.attr(u)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?(o=a.serializeStyle(a.parseStyle(o),r.name),o.length||(o=null),r.attr(u,o),r.attr(n,o)):"tabindex"===n?(r.attr(u,o),r.attr(n,null)):r.attr(u,e.convertURL(o,n,r.name))}}),t.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)t=e[r],n=t.attr("type")||"no/type",0!==n.indexOf("mce-")&&t.attr("type","mce-"+n)}),e.settings.preserve_cdata&&t.addNodeFilter("#cdata",function(t){for(var n,r=t.length;r--;)n=t[r],n.type=8,n.name="#comment",n.value="[CDATA["+e.dom.encode(n.value)+"]]"}),t.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t){for(var n,r=t.length,o=e.schema.getNonEmptyElements();r--;)n=t[r],n.isEmpty(o)&&0===n.getAll("br").length&&(n.append(new $g("br",1)).shortEnded=!0)}),t},LP=function(e){e.settings.auto_focus&&wi.setEditorTimeout(e,function(){var t;t=e.settings.auto_focus===!0?e:e.editorManager.get(e.settings.auto_focus),t.destroyed||t.focus()},100)},IP=function(e){var t=e.dom.getRoot();e.inline||bC(e)&&e.selection.getStart(!0)!==t||zm.firstPositionIn(t).each(function(t){var n=t.getNode(),r=No.isTable(n)?zm.firstPositionIn(n).getOr(t):t;Ri.browser.isIE()?Jp.storeNative(e,r.toRange()):e.selection.setRng(r.toRange())})},VP=function(e){e.bindPendingEventDelegates(),e.initialized=!0,Xv(e),e.focus(!0),IP(e),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),LP(e)},FP=function(e){return e.inline?PP.styleSheetLoader:e.dom.styleSheetLoader},UP=function(t,n){var r,o,i=t.settings,u=t.getElement(),c=t.getDoc();i.inline||(t.getElement().style.visibility=t.orgVisibility),n||t.inline||(c.open(),c.write(t.iframeHTML),c.close()),t.inline&&(t.on("remove",function(){var e=this.getBody();PP.removeClass(e,"mce-content-body"),PP.removeClass(e,"mce-edit-focus"),PP.setAttrib(e,"contentEditable",null)}),PP.addClass(u,"mce-content-body"),t.contentDocument=c=e.document,t.contentWindow=e.window,t.bodyElement=u,t.contentAreaContainer=u,i.root_name=u.nodeName.toLowerCase()),r=t.getBody(),r.disabled=!0,t.readonly=!!i.readonly,t.readonly||(t.inline&&"static"===PP.getStyle(r,"position",!0)&&(r.style.position="relative"),r.contentEditable=t.getParam("content_editable_state",!0)),r.disabled=!1,t.editorUpload=Px(t),t.schema=a(i),t.dom=rs(c,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:i.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:yh.shouldUseContentCssCors(t),referrerPolicy:yh.getReferrerPolicy(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=HP(t),t.serializer=bx(i,t),t.selection=Vw(t.dom,t.getWin(),t.serializer,t),t.annotator=Ig(t),t.formatter=dk(t),t.undoManager=nN(t),t._nodeChangeDispatcher=new $_(t),t._selectionOverrides=MP(t),pN.setup(t),X_(t),Z_(t),q_.setup(t),EN.setup(t),lN(t),Wv(t),i.browser_spellcheck||i.gecko_spellcheck||(c.body.spellcheck=!1,PP.setAttrib(r,"spellcheck","false")),t.quirks=_P(t),Kv(t); var s=yh.getDirectionality(t);void 0!==s&&(r.dir=s),i.protect&&t.on("BeforeSetContent",function(e){ea.each(i.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type}),t.contentStyles.length>0&&(o="",ea.each(t.contentStyles,function(e){o+=e+"\r\n"}),t.dom.addStyle(o)),FP(t).loadAll(t.contentCSS,function(){VP(t)},function(){VP(t)}),i.content_style&&OP(t,i.content_style)},jP={initContentBody:UP},qP=rs.DOM,$P=function(t,n){if(e.document.domain!==e.window.location.hostname&&Ri.browser.isIE()){var r=Mx.uuid("mce");t[r]=function(){jP.initContentBody(t)};var o='javascript:(function(){document.open();document.domain="'+e.document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+r+"(true);})()";return qP.setAttrib(n,"src",o),!0}return!1},WP=function(e,t,n,r){var o=Zt.fromTag("iframe");return Ro(o,r),Ro(o,{id:e+"_ifr",frameBorder:"0",allowTransparency:"true",title:t}),Ps(o,"tox-edit-area__iframe"),o},KP=function(e){var t,n,r;return r=yh.getDocType(e)+"",yh.getDocumentBaseUrl(e)!==e.documentBaseUrl&&(r+=''),r+='',t=yh.getBodyId(e),n=yh.getBodyClass(e),yh.getContentSecurityPolicy(e)&&(r+=''),r+='
    '},XP=function(e,t){var n=e.editorManager.translate("Rich Text Area. Press ALT-0 for help."),r=WP(e.id,n,t.height,yh.getIframeAttrs(e)).dom();r.onload=function(){r.onload=null,e.fire("load")};var o=$P(e,r);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=r,e.iframeHTML=KP(e),qP.add(t.iframeContainer,r),o},YP=function(e,t){var n=XP(e,t);t.editorContainer&&(qP.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=qP.isHidden(t.editorContainer)),e.getElement().style.display="none",qP.setAttrib(e.id,"aria-hidden","true"),n||jP.initContentBody(e)},GP={init:YP},ZP=rs.DOM,JP=function(e,t,n){var r=Gy.get(n),o=Gy.urls[n]||e.documentBaseUrl.replace(/\/$/,"");if(n=ea.trim(n),r&&-1===ea.inArray(t,n)){if(ea.each(Gy.dependencies(n),function(n){JP(e,t,n)}),e.plugins[n])return;try{var i=new r(e,o,e.$);e.plugins[n]=i,i.init&&(i.init(e,o),t.push(n))}catch(a){sb.pluginInitError(e,n,a)}}},QP=function(e){return e.replace(/^\-/,"")},eO=function(e){var t=[];ea.each(e.settings.plugins.split(/[ ,]/),function(n){JP(e,t,QP(n))})},tO=function(e){var t=ea.trim(e.settings.icons),n=e.ui.registry.getAll().icons,r=lb(),o=$t($t({},r),Oy.get(t).icons);Ot(o,function(t,r){qt(n,r)||e.ui.registry.addIcon(r,t)})},nO=function(e){var t=e.settings.theme;if(tt(t)){e.settings.theme=QP(t);var n=Zy.get(t);e.theme=new n(e,Zy.urls[t]),e.theme.init&&e.theme.init(e,Zy.urls[t]||e.documentBaseUrl.replace(/\/$/,""),e.$)}else e.theme={}},rO=function(e){return e.theme.renderUI()},oO=function(e){var t=e.getElement(),n=e.settings.theme,r=n(e,t);return r.editorContainer.nodeType&&(r.editorContainer.id=r.editorContainer.id||e.id+"_parent"),r.iframeContainer&&r.iframeContainer.nodeType&&(r.iframeContainer.id=r.iframeContainer.id||e.id+"_iframecontainer"),r.height=r.iframeHeight?r.iframeHeight:t.offsetHeight,r},iO=function(e){return{editorContainer:e,iframeContainer:e}},aO=function(e){var t=ZP.create("div");return ZP.insertAfter(t,e),iO(t)},uO=function(e){var t=e.getElement();return e.inline?iO(null):aO(t)},cO=function(e){var t=e.getElement();return e.orgDisplay=t.style.display,tt(e.settings.theme)?rO(e):at(e.settings.theme)?oO(e):uO(e)},sO=function(e){e.fire("ScriptsLoaded"),tO(e),nO(e),eO(e);var t=cO(e);return e.editorContainer=t.editorContainer?t.editorContainer:null,hb(e),e.inline?jP.initContentBody(e):GP.init(e,t)},lO={init:sO},fO=rs.DOM,dO=function(e){return"-"===e.charAt(0)},hO=function(e,t){var n=yh.getLanguageCode(t),r=yh.getLanguageUrl(t);if(zs.hasCode(n)===!1&&"en"!==n){var o=""!==r?r:t.editorManager.baseURL+"/langs/"+n+".js";e.add(o,V,void 0,function(){sb.languageLoadError(t,o,n)})}},mO=function(e,t,n,r){var o=t.settings,i=o.theme;if(tt(i)){if(!dO(i)&&!Zy.urls.hasOwnProperty(i)){var a=o.theme_url;a?Zy.load(i,t.documentBaseURI.toAbsolute(a)):Zy.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){Zy.waitFor(i,r)})}else r()},gO=function(e){return J.from(yh.getIconsUrl(e)).filter(function(e){return e.length>0}).map(function(e){return{url:e,name:J.none()}})},pO=function(e){return J.from(yh.getIconPackName(e)).filter(function(e){return e.length>0&&!Oy.has(e)}).map(function(t){return{url:e.editorManager.baseURL+"/icons/"+t+"/icons.js",name:J.some(t)}})},vO=function(e,t){gO(t).orThunk(function(){return pO(t)}).each(function(n){e.add(n.url,V,void 0,function(){sb.iconsLoadError(t,n.url,n.name.getOrUndefined())})})},yO=function(e,t,n){rt(t.plugins)&&(t.plugins=t.plugins.join(" ")),ea.each(t.external_plugins,function(n,r){Gy.load(r,n,V,void 0,function(){sb.pluginLoadError(e,n,r)}),t.plugins+=" "+r}),ea.each(t.plugins.split(/[ ,]/),function(t){if(t=ea.trim(t),t&&!Gy.urls[t])if(dO(t)){t=t.substr(1,t.length);var r=Gy.dependencies(t);ea.each(r,function(t){var r={prefix:"plugins/",resource:t,suffix:"/plugin"+n+".js"},o=Gy.createUrl(r,t);Gy.load(o.resource,o,V,void 0,function(){sb.pluginLoadError(e,o.prefix+o.resource+o.suffix,o.resource)})})}else{var o={prefix:"plugins/",resource:t,suffix:"/plugin"+n+".js"};Gy.load(t,o,V,void 0,function(){sb.pluginLoadError(e,o.prefix+o.resource+o.suffix,t)})}})},bO=function(e,t){var n=fs.ScriptLoader;mO(n,e,t,function(){hO(n,e),vO(n,e),yO(e,e.settings,t),n.loadQueue(function(){e.removed||lO.init(e)},e,function(){e.removed||lO.init(e)})})},CO=function(t){var n=t.settings,r=t.id;zs.setCode(yh.getLanguageCode(t));var o=function(){fO.unbind(e.window,"ready",o),t.render()};if(!Du.Event.domLoaded)return void fO.bind(e.window,"ready",o);if(t.getElement()&&Ri.contentEditable){n.inline?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var i=t.getElement().form||fO.getParent(r,"form");i&&(t.formElement=i,n.hidden_input&&!No.isTextareaOrInput(t.getElement())&&(fO.insertAfter(fO.create("input",{type:"hidden",name:r}),r),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},fO.bind(i,"submit reset",t.formEventDelegate),t.on("reset",function(){t.resetContent()}),!n.submit_patch||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=Jy(t),t.notificationManager=R(t),"xml"===n.encoding&&t.on("GetContent",function(e){e.save&&(e.content=fO.encode(e.content))}),n.add_form_submit_trigger&&t.on("submit",function(){t.initialized&&t.save()}),n.add_unload_trigger&&(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),bO(t,t.suffix)}},wO={render:CO},xO=function(e){return e.firstChild&&e.firstChild===e.lastChild},EO=function(e){return"br"===e.name||e.value===yu},zO=function(e,t){var n=e.getBlockElements();return n[t.name]&&xO(t)&&EO(t.firstChild)},kO=function(e,t){var n=e.getNonEmptyElements();return t&&(t.isEmpty(n)||zO(e,t))},NO=function(e,t){var n=t.firstChild,r=t.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),kO(e,r)&&(r=r.prev),n&&n===r?"ul"===n.name||"ol"===n.name:!1},SO=function(e){var t=e.firstChild,n=e.lastChild;return t&&"META"===t.nodeName&&t.parentNode.removeChild(t),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),e},TO=function(e,t,n){var r=t.serialize(n),o=e.createFragment(r);return SO(o)},AO=function(e){return ea.grep(e.childNodes,function(e){return"LI"===e.nodeName})},RO=function(e){return e.data===yu||No.isBr(e)},BO=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&RO(e.firstChild)},DO=function(e){return!e.firstChild||BO(e)},MO=function(e){return e.length>0&&DO(e[e.length-1])?e.slice(0,-1):e},_O=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},PO=function(e,t){return!!_O(e,t)},OO=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]},HO=function(e,t){var n=Mf.before(e),r=lm(t),o=r.next(n);return o?o.toRange():null},LO=function(e,t){var n=Mf.after(e),r=lm(t),o=r.prev(n);return o?o.toRange():null},IO=function(e,t,n,r){var o=OO(e,r),i=e.parentNode;return i.insertBefore(o[0],e),ea.each(t,function(t){i.insertBefore(t,e)}),i.insertBefore(o[1],e),i.removeChild(e),LO(t[t.length-1],n)},VO=function(e,t,n){var r=e.parentNode;return ea.each(t,function(t){r.insertBefore(t,e)}),HO(e,n)},FO=function(e,t,n,r){return r.insertAfter(t.reverse(),e),LO(t[0],n)},UO=function(e,t,n,r){var o=TO(t,e,r),i=_O(t,n.startContainer),a=MO(AO(o.firstChild)),u=1,c=2,s=t.getRoot(),l=function(e){var r=Mf.fromRangeStart(n),o=lm(t.getRoot()),a=e===u?o.prev(r):o.next(r);return a?_O(t,a.getNode())!==i:!0};return l(u)?VO(i,a,s):l(c)?FO(i,a,s,t):IO(i,a,s,n)},jO={isListFragment:NO,insertAtCaret:UO,isParentBlockLi:PO,trimListItems:MO,listItems:AO},qO=function(e,t){return No.isText(e)&&e.nodeValue[t-1]===yu},$O=function(e,t){var n,r;n=e.startContainer,r=e.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(r>0?t=t.replace(/^ /," "):o("previousSibling")||(t=t.replace(/^ /," ")),r|)$/," "):o("nextSibling")||(t=t.replace(/( | )(
    |)$/," "))),t},WO=function(e,t){var n,r;return n=e.startContainer,r=e.startOffset,3===n.nodeType&&e.collapsed&&(n.data[r]===yu?(n.deleteData(r,1),/[\u00a0| ]$/.test(t)||(t+=" ")):n.data[r-1]===yu&&(n.deleteData(r-1,1),/[\u00a0| ]$/.test(t)||(t=" "+t))),t},KO=No.matchNodeNames(["td","th"]),XO=function(e,t){var n=e.selection.getRng(),r=n.startContainer,o=n.startOffset;n.collapsed&&qO(r,o)&&No.isText(r)&&(r.insertData(o-1," "),r.deleteData(o,1),n.setStart(r,o),n.setEnd(r,o),e.selection.setRng(n)),e.selection.setContent(t)},YO=function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):XO(e,t)}},GO=function(e,t){J.from(e.getParent(t,"td,th")).map(Zt.fromDom).each(Ux.trimBlockTrailingBr)},ZO=function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new sz(r);ea.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}},JO=function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")},QO=function(e){ea.each(e.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")})},eH=function(e){return!!e.getAttribute("data-mce-fragment")},tH=function(e,t){return t&&!e.schema.getShortEndedElements()[t.nodeName]},nH=function(e,t){var n,r,o,i,a,u=e.dom,c=e.selection,s=function(t){for(var n=e.getBody();t&&t!==n;t=t.parentNode)if("false"===e.dom.getContentEditable(t))return t;return null};if(t){if(e.selection.scrollIntoView(t),n=s(t))return u.remove(t),void c.select(n);var l=u.createRng();i=t.previousSibling,i&&3===i.nodeType?(l.setStart(i,i.nodeValue.length),Ri.ie||(a=t.nextSibling,a&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a)))):(l.setStartBefore(t),l.setEndBefore(t));var f=function(t){var n=Mf.fromRangeStart(t),r=lm(e.getBody());return n=r.next(n),n?n.toRange():void 0};r=u.getParent(t,u.isBlock),u.remove(t),r&&u.isEmpty(r)&&(e.$(r).empty(),l.setStart(r,0),l.setEnd(r,0),KO(r)||eH(r)||!(o=f(l))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(l=o,u.remove(r))),c.setRng(l)}},rH=function(e,t,n){var r,o,i,a,u,c,s,l,f,d,h,m=e.selection,g=e.dom;if(/^ | $/.test(t)&&(t=$O(m.getRng(),t)),r=e.parser,h=n.merge,o=lp({validate:e.settings.validate},e.schema),d='​',c={content:t,format:"html",selection:!0,paste:n.paste},c=e.fire("BeforeSetContent",c),c.isDefaultPrevented())return void e.fire("SetContent",{content:c.content,format:"html",selection:!0,paste:n.paste});t=c.content,-1===t.indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d),l=m.getRng();var p=l.startContainer||(l.parentElement?l.parentElement():null),v=e.getBody();p===v&&m.isCollapsed()&&g.isBlock(v.firstChild)&&tH(e,v.firstChild)&&g.isEmpty(v.firstChild)&&(l=g.createRng(),l.setStart(v.firstChild,0),l.setEnd(v.firstChild,0),m.setRng(l)),m.isCollapsed()||(e.selection.setRng($z.normalize(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),t=WO(e.selection.getRng(),t)),i=m.getNode();var y={context:i.nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,y),n.paste===!0&&jO.isListFragment(e.schema,u)&&jO.isParentBlockLi(g,i))return l=jO.insertAtCaret(o,g,e.selection.getRng(),u),e.selection.setRng(l),void e.fire("SetContent",c);if(JO(u),f=u.lastChild,"mce_marker"===f.attr("id"))for(s=f,f=f.prev;f;f=f.walk(!0))if(3===f.type||!g.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(s,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),y.invalid){for(XO(e,d),i=m.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)i=f,f=f.parentNode;t=i===a?a.innerHTML:g.getOuterHTML(i),t=o.serialize(r.parse(t.replace(//i,function(){return o.serialize(u)}))),i===a?g.setHTML(a,t):g.setOuterHTML(i,t)}else t=o.serialize(u),YO(e,t,i);ZO(e,h),nH(e,g.get("mce_marker")),QO(e.getBody()),GO(e.dom,e.selection.getStart()),e.fire("SetContent",c),e.addVisual()},oH=function(e){var t;return"string"!=typeof e?(t=ea.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:t}):{content:e,details:{}}},iH=function(e,t){var n=oH(t);rH(e,n.content,n.details)},aH={insertAtCaret:iH},uH=function(e,t){e.getDoc().execCommand(t,!1,null)},cH=function(e){MD.backspaceDelete(e,!1)||oB.backspaceDelete(e,!1)||sB.backspaceDelete(e,!1)||yB.backspaceDelete(e,!1)||ER.backspaceDelete(e,!1)||lD.backspaceDelete(e)||BR.backspaceDelete(e,!1)||zB.backspaceDelete(e,!1)||(uH(e,"Delete"),QA.paddEmptyBody(e))},sH=function(e){oB.backspaceDelete(e,!0)||sB.backspaceDelete(e,!0)||yB.backspaceDelete(e,!0)||ER.backspaceDelete(e,!0)||lD.backspaceDelete(e)||BR.backspaceDelete(e,!0)||zB.backspaceDelete(e,!0)||uH(e,"ForwardDelete")},lH={deleteCommand:cH,forwardDeleteCommand:sH},fH=function(e,t,n){for(var r=e.dom(),o=at(n)?n:U(!1);r.parentNode;){r=r.parentNode;var i=Zt.fromDom(r),a=t(i);if(a.isSome())return a;if(o(i))break}return J.none()},dH=function(e,t,n){var r=t(e);return r.orThunk(function(){return n(e)?J.none():fH(e,t,n)})},hH={"font-size":"size","font-family":"face"},mH=function(e,t,n){var r=function(t){return Ho(t,e).orThunk(function(){return"font"===Vr(t)?jt(hH,e).bind(function(e){return Do(t,e)}):J.none()})},o=function(e){return fr(Zt.fromDom(t),e)};return dH(Zt.fromDom(n),function(e){return r(e)},o)},gH=function(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n},pH=function(e,t){return/[0-9.]+px$/.test(e)?gH(72*parseInt(e,10)/96,t||0)+"pt":e},vH=function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},yH=function(e,t){return J.from(rs.DOM.getStyle(t,e,!0))},bH=function(e){return function(t,n){return J.from(n).map(Zt.fromDom).filter(jr).bind(function(n){return mH(e,t,n.dom()).or(yH(e,n.dom()))}).getOr("")}},CH={getFontSize:bH("font-size"),getFontFamily:F(vH,bH("font-family")),toPt:pH},wH=function(e){return zm.firstPositionIn(e.getBody()).map(function(e){var t=e.container();return No.isText(t)?t.parentNode:t})},xH=function(e,t){return e.startContainer===t&&0===e.startOffset},EH=function(e){return J.from(e.selection.getRng()).bind(function(t){var n=e.getBody();return xH(t,n)?J.none():J.from(e.selection.getStart(!0))})},zH=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(n>=1&&7>=n){var r=yh.getFontStyleValues(e),o=yh.getFontSizeClasses(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},kH=function(e){var t=e.split(/\s*,\s*/);return gt(t,function(e){return-1===e.indexOf(" ")||Pn(e,'"')||Pn(e,"'")?e:"'"+e+"'"}).join(",")},NH=function(e,t){var n=zH(e,t);e.formatter.toggle("fontname",{value:kH(n)}),e.nodeChanged()},SH=function(e){return EH(e).fold(function(){return wH(e).map(function(t){return CH.getFontFamily(e.getBody(),t)}).getOr("")},function(t){return CH.getFontFamily(e.getBody(),t)})},TH=function(e,t){e.formatter.toggle("fontsize",{value:zH(e,t)}),e.nodeChanged()},AH=function(e){return EH(e).fold(function(){return wH(e).map(function(t){return CH.getFontSize(e.getBody(),t)}).getOr("")},function(t){return CH.getFontSize(e.getBody(),t)})},RH=ea.each,BH=ea.map,DH=ea.inArray,MH=function(){function e(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e)}return e.prototype.execCommand=function(e,t,n,r){var o,i,a=!1,u=this;if(!u.editor.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus?Jp.restore(u.editor):u.editor.focus(),r=u.editor.fire("BeforeExecCommand",{command:e,ui:t,value:n}),r.isDefaultPrevented())return!1;if(i=e.toLowerCase(),o=u.commands.exec[i])return o(i,t,n),u.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0;if(RH(this.editor.plugins,function(r){return r.execCommand&&r.execCommand(e,t,n)?(u.editor.fire("ExecCommand",{command:e,ui:t,value:n}),a=!0,!1):void 0}),a)return a;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(e,t,n))return u.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0;try{a=u.editor.getDoc().execCommand(e,t,n)}catch(c){}return a?(u.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0):!1}},e.prototype.queryCommandState=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.state[e])return t(e);try{return this.editor.getDoc().queryCommandState(e)}catch(n){}return!1}},e.prototype.queryCommandValue=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.value[e])return t(e);try{return this.editor.getDoc().queryCommandValue(e)}catch(n){}}},e.prototype.addCommands=function(e,t){var n=this;t=t||"exec",RH(e,function(e,r){RH(r.toLowerCase().split(","),function(r){n.commands[t][r]=e})})},e.prototype.addCommand=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.exec[e]=function(e,o,i,a){return t.call(n||r.editor,o,i,a)}},e.prototype.queryCommandSupported=function(e){if(e=e.toLowerCase(),this.commands.exec[e])return!0;try{return this.editor.getDoc().queryCommandSupported(e)}catch(t){}return!1},e.prototype.addQueryStateHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.state[e]=function(){return t.call(n||r.editor)}},e.prototype.addQueryValueHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.value[e]=function(){return t.call(n||r.editor)}},e.prototype.hasCustomCommand=function(e){return e=e.toLowerCase(),!!this.commands.exec[e]},e.prototype.execNativeCommand=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(e,t,n)},e.prototype.isFormatMatch=function(e){return this.editor.formatter.match(e)},e.prototype.toggleFormat=function(e,t){this.editor.formatter.toggle(e,t?{value:t}:void 0),this.editor.nodeChanged()},e.prototype.storeSelection=function(e){this.selectionBookmark=this.editor.selection.getBookmark(e)},e.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},e.prototype.setupCommands=function(e){var t=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){e.undoManager.add()},"Cut,Copy,Paste":function(n){var r,o=e.getDoc();try{t.execNativeCommand(n)}catch(i){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var a=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");Ri.mac&&(a=a.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:a,type:"error"})}},unlink:function(){if(e.selection.isCollapsed()){var t=e.dom.getParent(e.selection.getStart(),"a");return void(t&&e.dom.remove(t,!0))}e.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),RH("left,center,right,justify".split(","),function(t){r!==t&&e.formatter.remove("align"+t)}),"none"!==r&&t.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r,o;t.execNativeCommand(n),r=e.dom.getParent(e.selection.getNode(),"ol,ul"),r&&(o=r.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(o.nodeName)&&(t.storeSelection(),e.dom.split(o,r),t.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){t.toggleFormat(e)},"ForeColor,HiliteColor":function(e,n,r){t.toggleFormat(e,r)},FontName:function(t,n,r){NH(e,r)},FontSize:function(t,n,r){TH(e,r)},RemoveFormat:function(t){e.formatter.remove(t)},mceBlockQuote:function(){t.toggleFormat("blockquote")},FormatBlock:function(e,n,r){return t.toggleFormat(r||"p")},mceCleanup:function(){var t=e.selection.getBookmark();e.setContent(e.getContent()),e.selection.moveToBookmark(t)},mceRemoveNode:function(n,r,o){var i=o||e.selection.getNode();i!==e.getBody()&&(t.storeSelection(),e.dom.remove(i,!0),t.restoreSelection())},mceSelectNodeDepth:function(t,n,r){var o=0;e.dom.getParent(e.selection.getNode(),function(t){return 1===t.nodeType&&o++===r?(e.selection.select(t),!1):void 0},e.getBody())},mceSelectNode:function(t,n,r){e.selection.select(r)},mceInsertContent:function(t,n,r){aH.insertAtCaret(e,r)},mceInsertRawHTML:function(t,n,r){e.selection.setContent("tiny_mce_marker");var o=e.getContent();e.setContent(o.replace(/tiny_mce_marker/g,function(){return r}))},mceInsertNewLine:function(t,n,r){YM.insert(e,r)},mceToggleFormat:function(e,n,r){t.toggleFormat(r)},mceSetContent:function(t,n,r){e.setContent(r)},"Indent,Outdent":function(t){ED(e,t)},mceRepaint:function(){},InsertHorizontalRule:function(){e.execCommand("mceInsertContent",!1,"
    ")},mceToggleVisualAid:function(){e.hasVisual=!e.hasVisual,e.addVisual()},mceReplaceContent:function(t,n,r){e.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,e.selection.getContent({format:"text"})))},mceInsertLink:function(t,n,r){var o;"string"==typeof r&&(r={href:r}),o=e.dom.getParent(e.selection.getNode(),"a"),r.href=r.href.replace(/ /g,"%20"),o&&r.href||e.formatter.remove("link"),r.href&&e.formatter.apply("link",r,o)},selectAll:function(){var t=e.dom.getParent(e.selection.getStart(),No.isContentEditableTrue);if(t){var n=e.dom.createRng();n.selectNodeContents(t),e.selection.setRng(n)}},"delete":function(){lH.deleteCommand(e)},forwardDelete:function(){lH.forwardDeleteCommand(e)},mceNewDocument:function(){e.setContent("")},InsertLineBreak:function(t,n,r){return AM.insert(e,r),!0}});var n=function(t){return function(){var n=e.selection.isCollapsed()?[e.dom.getParent(e.selection.getNode(),e.dom.isBlock)]:e.selection.getSelectedBlocks(),r=BH(n,function(n){return!!e.formatter.matchNode(n,t)});return-1!==DH(r,!0)}};t.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return t.isFormatMatch(e)},mceBlockQuote:function(){return t.isFormatMatch("blockquote")},Outdent:function(){return bD(e)},"InsertUnorderedList,InsertOrderedList":function(t){var n=e.dom.getParent(e.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===t&&"UL"===n.tagName||"insertorderedlist"===t&&"OL"===n.tagName)}},"state"),t.addCommands({Undo:function(){e.undoManager.undo()},Redo:function(){e.undoManager.redo()}}),t.addQueryValueHandler("FontName",function(){return SH(e)},this),t.addQueryValueHandler("FontSize",function(){return AH(e)},this)},e}(),_H=ea.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"," "),PH=function(){function e(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||W}return e.isNative=function(e){return!!_H[e.toLowerCase()]},e.prototype.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),t=t||{},t.type=e,t.target||(t.target=this.scope),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=K},t.stopPropagation=function(){t.isPropagationStopped=K},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=K},t.isDefaultPrevented=W,t.isPropagationStopped=W,t.isImmediatePropagationStopped=W),this.settings.beforeFire&&this.settings.beforeFire(t),n=this.bindings[e])for(r=0,o=n.length;o>r;r++){if(i=n[r],i.once&&this.off(e,i.func),t.isImmediatePropagationStopped())return t.stopPropagation(),t;if(i.func.call(this.scope,t)===!1)return t.preventDefault(),t}return t},e.prototype.on=function(e,t,n,r){var o,i,a;if(t===!1&&(t=W),t){var u={func:t};for(r&&ea.extend(u,r),i=e.toLowerCase().split(" "),a=i.length;a--;)e=i[a],o=this.bindings[e],o||(o=this.bindings[e]=[],this.toggleEvent(e,!0)),n?o.unshift(u):o.push(u)}return this},e.prototype.off=function(e,t){var n,r,o,i,a;if(e)for(i=e.toLowerCase().split(" "),n=i.length;n--;){if(e=i[n],r=this.bindings[e],!e){for(o in this.bindings)this.toggleEvent(o,!1),delete this.bindings[o];return this}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),this.bindings[e]=r);else r.length=0;r.length||(this.toggleEvent(e,!1),delete this.bindings[e])}}else{for(e in this.bindings)this.toggleEvent(e,!1);this.bindings={}}return this},e.prototype.once=function(e,t,n){return this.on(e,t,n,{once:!0})},e.prototype.has=function(e){return e=e.toLowerCase(),!(!this.bindings[e]||0===this.bindings[e].length)},e}(),OH=function(e){return e._eventDispatcher||(e._eventDispatcher=new PH({scope:e,toggleEvent:function(t,n){PH.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,n)}})),e._eventDispatcher},HH={fire:function(e,t,n){var r=this;if(r.removed&&"remove"!==e&&"detach"!==e)return t;var o=OH(r).fire(e,t);if(n!==!1&&r.parent)for(var i=r.parent();i&&!o.isPropagationStopped();)i.fire(e,o,!1),i=i.parent();return o},on:function(e,t,n){return OH(this).on(e,t,n)},off:function(e,t){return OH(this).off(e,t)},once:function(e,t){return OH(this).once(e,t)},hasEventListeners:function(e){return OH(this).has(e)}},LH="data-mce-contenteditable",IH=function(e,t,n){Ls(e,t)&&n===!1?Hs(e,t):n&&Ps(e,t)},VH=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},FH=function(e,t){e.dom().contentEditable=t?"true":"false"},UH=function(e){pt(Vs(e,'*[contenteditable="true"]'),function(e){Ao(e,LH,"true"),FH(e,!1)})},jH=function(e){pt(Vs(e,"*["+LH+'="true"]'),function(e){_o(e,LH),FH(e,!0)})},qH=function(e){J.from(e.selection.getNode()).each(function(e){e.removeAttribute("data-mce-selected")})},$H=function(e){e.selection.setRng(e.selection.getRng())},WH=function(e,t){var n=Zt.fromDom(e.getBody());IH(n,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),qH(e),e.readonly=!0,FH(n,!1),UH(n)):(e.readonly=!1,FH(n,!0),jH(n),VH(e,"StyleWithCSS",!1),VH(e,"enableInlineTableEditing",!1),VH(e,"enableObjectResizing",!1),Bv.hasEditorOrUiFocus(e)&&e.focus(),$H(e),e.nodeChanged())},KH=function(e){return e.readonly},XH=function(e){e.parser.addAttributeFilter("contenteditable",function(t){KH(e)&&pt(t,function(e){e.attr(LH,e.attr("contenteditable")),e.attr("contenteditable","false")})}),e.serializer.addAttributeFilter(LH,function(t){KH(e)&&pt(t,function(e){e.attr("contenteditable",e.attr(LH))})}),e.serializer.addTempAttr(LH)},YH=function(e){e.serializer?XH(e):e.on("PreInit",function(){XH(e)})},GH=function(e){return"click"===e.type},ZH=function(e,t){return null!==e.dom.getParent(t,"a")},JH=function(e,t){var n=t.target;GH(t)&&!vb.metaKeyPressed(t)&&ZH(e,n)&&t.preventDefault()},QH=function(e){e.on("ShowCaret",function(t){KH(e)&&t.preventDefault()}),e.on("ObjectSelected",function(t){KH(e)&&t.preventDefault()})},eL=rs.DOM,tL=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=eL.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},nL=function(e){return!e.hidden&&!KH(e)},rL=function(e,t,n){nL(e)?e.fire(t,n):KH(e)&&JH(e,n)},oL=function(e,t){var n,r;if(e.delegates||(e.delegates={}),!e.delegates[t]&&!e.removed)if(n=tL(e,t),e.settings.event_root){if(kT||(kT={},e.editorManager.on("removeEditor",function(){var t;if(!e.editorManager.activeEditor&&kT){for(t in kT)e.dom.unbind(tL(e,t));kT=null}})),kT[t])return;r=function(n){for(var r=n.target,o=e.editorManager.get(),i=o.length;i--;){var a=o[i].getBody();(a===r||eL.isChildOf(r,a))&&rL(o[i],t,n)}},kT[t]=r,eL.bind(n,t,r)}else r=function(n){rL(e,t,n)},eL.bind(n,t,r),e.delegates[t]=r},iL=$t($t({},HH),{bindPendingEventDelegates:function(){var e=this;ea.each(e._pendingNativeEvents,function(t){oL(e,t)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(t?n.initialized?oL(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(tL(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e,t=this,n=t.getBody(),r=t.dom;if(t.delegates){for(e in t.delegates)t.dom.unbind(tL(t,e),e,t.delegates[e]);delete t.delegates}!t.inline&&n&&r&&(n.onload=null,r.unbind(t.getWin()),r.unbind(t.getDoc())),r&&(r.unbind(n),r.unbind(t.getContainer()))}}),aL=["design","readonly"],uL=function(t,n,r,o){var i=r[n.get()],a=r[o];try{a.activate()}catch(u){return void e.console.error("problem while activating editor mode "+o+":",u)}i.deactivate(),i.editorReadOnly!==a.editorReadOnly&&WH(t,a.editorReadOnly),n.set(o),jv(t,o)},cL=function(e,t,n,r){if(r!==n.get()){if(!qt(t,r))throw new Error("Editor mode '"+r+"' is invalid");e.initialized?uL(e,n,t,r):e.on("init",function(){return uL(e,n,t,r)})}},sL=function(t,n,r){var o;if(ht(aL,n))throw new Error("Cannot override default mode "+n);return $t($t({},t),(o={},o[n]=$t($t({},r),{deactivate:function(){try{r.deactivate()}catch(t){e.console.error("problem while deactivating editor mode "+n+":",t)}}}),o))},lL=function(e){var t=Jt("design"),n=Jt({design:{activate:V,deactivate:V,editorReadOnly:!1},readonly:{activate:V,deactivate:V,editorReadOnly:!0}});return YH(e),QH(e),{isReadOnly:function(){return KH(e)},set:function(r){return cL(e,n.get(),t,r)},get:function(){return t.get()},register:function(e,t){n.set(sL(n.get(),e,t))}}},fL=ea.each,dL=ea.explode,hL={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},mL=ea.makeMap("alt,ctrl,shift,meta,access"),gL=function(){function e(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var t=this;e.on("keyup keypress keydown",function(e){!t.hasModifier(e)&&!t.isFunctionKey(e)||e.isDefaultPrevented()||(fL(t.shortcuts,function(n){return t.matchShortcut(e,n)?(t.pendingPatterns=n.subpatterns.slice(0),"keydown"===e.type&&t.executeShortcutAction(n),!0):void 0}),t.matchShortcut(e,t.pendingPatterns[0])&&(1===t.pendingPatterns.length&&"keydown"===e.type&&t.executeShortcutAction(t.pendingPatterns[0]),t.pendingPatterns.shift())) })}return e.prototype.add=function(e,t,n,r){var o,i=this;return o=n,"string"==typeof n?n=function(){i.editor.execCommand(o,!1,null)}:ea.isArray(o)&&(n=function(){i.editor.execCommand(o[0],o[1],o[2])}),fL(dL(ea.trim(e)),function(e){var o=i.createShortcut(e,t,n,r);i.shortcuts[o.id]=o}),!0},e.prototype.remove=function(e){var t=this.createShortcut(e);return this.shortcuts[t.id]?(delete this.shortcuts[t.id],!0):!1},e.prototype.parseShortcut=function(e){var t,n,r={};fL(dL(e.toLowerCase(),"+"),function(e){e in mL?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=hL[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode];for(n in mL)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,Ri.mac?r.ctrl=!0:r.shift=!0),r.meta&&(Ri.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},e.prototype.createShortcut=function(e,t,n,r){var o;return o=ea.map(dL(e,">"),this.parseShortcut),o[o.length-1]=ea.extend(o[o.length-1],{func:n,scope:r||this.editor}),ea.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},e.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},e.prototype.isFunctionKey=function(e){return"keydown"===e.type&&e.keyCode>=112&&e.keyCode<=123},e.prototype.matchShortcut=function(e,t){return t?t.ctrl!==e.ctrlKey||t.meta!==e.metaKey?!1:t.alt!==e.altKey||t.shift!==e.shiftKey?!1:e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode?(e.preventDefault(),!0):!1:!1},e.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},e}(),pL=function(){var e={},t={},n={},r={},o={},i={},a={},u=function(e,t){return function(n,r){return e[n.toLowerCase()]=$t($t({},r),{type:t})}},c=function(e,t){return r[e.toLowerCase()]=t};return{addButton:u(e,"button"),addGroupToolbarButton:u(e,"grouptoolbarbutton"),addToggleButton:u(e,"togglebutton"),addMenuButton:u(e,"menubutton"),addSplitButton:u(e,"splitbutton"),addMenuItem:u(t,"menuitem"),addNestedMenuItem:u(t,"nestedmenuitem"),addToggleMenuItem:u(t,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:c,getAll:function(){return{buttons:e,menuItems:t,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}}},vL=function(){var e=pL();return{addAutocompleter:e.addAutocompleter,addButton:e.addButton,addContextForm:e.addContextForm,addContextMenu:e.addContextMenu,addContextToolbar:e.addContextToolbar,addIcon:e.addIcon,addMenuButton:e.addMenuButton,addMenuItem:e.addMenuItem,addNestedMenuItem:e.addNestedMenuItem,addSidebar:e.addSidebar,addSplitButton:e.addSplitButton,addToggleButton:e.addToggleButton,addGroupToolbarButton:e.addGroupToolbarButton,addToggleMenuItem:e.addToggleMenuItem,getAll:e.getAll}},yL=ea.each,bL=ea.trim,CL="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),wL={ftp:21,http:80,https:443,mailto:25},xL=function(){function t(n,r){n=bL(n),this.settings=r||{};var o=this.settings.base_uri,i=this;if(/^([\w\-]+):([^\/]{2})/i.test(n)||/^\s*#/.test(n))return void(i.source=n);var a=0===n.indexOf("//");if(0!==n.indexOf("/")||a||(n=(o?o.protocol||"http":"http")+"://mce_host"+n),!/^[\w\-]*:?\/\//.test(n)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(e.document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)n="//mce_host"+i.toAbsPath(u,n);else{var c=/([^#?]*)([#?]?.*)/.exec(n);n=(o&&o.protocol||"http")+"://mce_host"+i.toAbsPath(u,c[1])+c[2]}}n=n.replace(/@@/g,"(mce_at)");var s=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(n);yL(CL,function(e,t){var n=s[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),i[e]=n}),o&&(i.protocol||(i.protocol=o.protocol),i.userInfo||(i.userInfo=o.userInfo),i.port||"mce_host"!==i.host||(i.port=o.port),i.host&&"mce_host"!==i.host||(i.host=o.host),i.source=""),a&&(i.protocol="")}return t.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},t.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},t.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[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(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=wL[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},t.prototype.toRelPath=function(e,t){var n,r,o,i=0,a="",u=e.substring(0,e.lastIndexOf("/")).split("/");if(n=t.split("/"),u.length>=n.length)for(r=0,o=u.length;o>r;r++)if(r>=n.length||u[r]!==n[r]){i=r+1;break}if(u.lengthr;r++)if(r>=u.length||u[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=u.length-(i-1);o>r;r++)a+="../";for(r=i-1,o=n.length;o>r;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},t.prototype.toAbsPath=function(e,t){var n,r,o,i=0,a=[];r=/\/$/.test(t)?"/":"";var u=e.split("/"),c=t.split("/");for(yL(u,function(e){e&&a.push(e)}),u=a,n=c.length-1,a=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?i>0?i--:a.push(c[n]):i++);return n=u.length-i,o=0>=n?St(a).join("/"):u.slice(0,n).join("/")+"/"+St(a).join("/"),0!==o.indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},t.prototype.getURI=function(e){void 0===e&&(e=!1);var t;return(!this.source||e)&&(t="",e||(t+=this.protocol?this.protocol+"://":"//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source},t}(),EL=rs.DOM,zL=ea.extend,kL=ea.each,NL=ea.resolve,SL=Ri.ie,TL=function(){function e(e,t,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,zL(this,iL),this.settings=Ry(this,e,this.documentBaseUrl,n.defaultSettings,t),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&&(fs.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),rs.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),ks.languageLoad=this.settings.language_load,ks.baseURL=n.baseURL,this.id=e,this.setDirty(!1),this.documentBaseURI=new xL(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new gL(this),this.editorCommands=new MH(this),this.settings.cache_suffix&&(Ri.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:vL()};var o=this,i=lL(o);this.mode=i,this.setMode=i.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Kc.overrideDefaults(function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}})}return e.prototype.render=function(){wO.render(this)},e.prototype.focus=function(e){Bv.focus(this,e)},e.prototype.hasFocus=function(){return Bv.hasFocus(this)},e.prototype.execCallback=function(e){for(var t=[],n=1;n0?OL[0]:null),jL.focusedEditor===e&&(jL.focusedEditor=null),t.length!==OL.length},FL=function(e){return e&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(VL(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null),e},UL="CSS1Compat"!==e.document.compatMode,jL=$t($t({},HH),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Kc,majorVersion:"5",minorVersion:"2.2",releaseDate:"2020-04-23",editors:PL,i18n:zs,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,n,r=this,o="";n=xL.getDocumentBaseUrl(e.document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"));var i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,o=i.suffix;else{for(var a=e.document.getElementsByTagName("script"),u=0;u0&&BL(RL(n),function(t){var n;(n=AL.get(t))?r.push(n):BL(e.document.forms,function(e){BL(e.elements,function(e){e.name===t&&(t="mce_editor_"+ML++,AL.setAttrib(e,"id",t),r.push(e))})})});break;case"textareas":case"specific_textareas":BL(AL.select("textarea"),function(e){t.editor_deselector&&c(e,t.editor_deselector)||(!t.editor_selector||c(e,t.editor_selector))&&r.push(e)})}return r},l=function(e){n=e},f=function(){var e,n=0,r=[],c=function(t,i,a){var u=new TL(t,i,o);r.push(u),u.on("init",function(){++n===e.length&&l(r)}),u.targetElm=u.targetElm||a,u.render()};return AL.unbind(window,"ready",f),u("onpageload"),e=Kc.unique(s(t)),t.types?void BL(t.types,function(n){ea.each(e,function(e){return AL.is(e,n.selector)?(c(a(e),DL({},t,n),e),!1):!0})}):(ea.each(e,function(e){FL(o.get(e.id))}),e=ea.grep(e,function(e){return!o.get(e.id)}),void(0===e.length?l([]):BL(e,function(e){i(t,e)?sb.initError("Could not initialize inline editor on invalid inline target element",e):c(a(e),t,e)})))};return o.settings=t,AL.bind(window,"ready",f),new mi(function(e){n?e(n):l=function(t){e(t)}})},get:function(e){return 0===arguments.length?OL.slice(0):tt(e)?xt(OL,function(t){return t.id===e}).getOr(null):ut(e)&&OL[e]?OL[e]:null},add:function(e){var t,n=this;return t=PL[e.id],t===e?e:(null===n.get(e.id)&&(HL(e.id)&&(PL[e.id]=e),PL.push(e),OL.push(e)),IL(!0),n.activeEditor=e,n.fire("AddEditor",{editor:e}),NT||(NT=function(e){var t=n.fire("BeforeUnload");return t.returnValue?(e.preventDefault(),e.returnValue=t.returnValue,t.returnValue):void 0},window.addEventListener("beforeunload",NT)),e)},createEditor:function(e,t){return this.add(new TL(e,t,this))},remove:function(e){var t,n,r=this;if(e)return tt(e)?void BL(AL.select(e),function(e){n=r.get(e.id),n&&r.remove(n)}):(n=e,ot(r.get(n.id))?null:(VL(n)&&r.fire("RemoveEditor",{editor:n}),0===OL.length&&window.removeEventListener("beforeunload",NT),n.remove(),IL(OL.length>0),n));for(t=OL.length-1;t>=0;t--)r.remove(OL[t])},execCommand:function(e,t,n){var r=this,o=r.get(n);switch(e){case"mceAddEditor":return r.get(n)||new TL(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",0,n),!0)}return r.activeEditor?r.activeEditor.execCommand(e,t,n):!1},triggerSave:function(){BL(OL,function(e){e.save()})},addI18n:function(e,t){zs.add(e,t)},translate:function(e){return zs.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e},_setBaseUrl:function(e){this.baseURL=new xL(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new xL(this.baseURL)}});jL.setup(),function(e){e.compareRanges=sw.isEq,e.getCaretRangeFromPoint=oC.fromPoint,e.getSelectedNode=ef,e.getNode=tf}(I||(I={}));var qL,$L,WL=I,KL=function(t,n,r){void 0===r&&(r=1e3);var o=!1,i=null,a=function(t){return function(){for(var n=[],r=0;r=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},tI=function(e,t,n){return oI(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},nI=function(e,t){var n,r,o,i;return n=ZL(e.x,t.x),r=ZL(e.y,t.y),o=GL(e.x+e.w,t.x+t.w),i=GL(e.y+e.h,t.y+t.h),0>o-n||0>i-r?null:oI(n,r,o-n,i-r)},rI=function(e,t,n){var r,o,i,a,u,c,s,l,f,d;return u=e.x,c=e.y,s=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=ZL(0,t.x-u),o=ZL(0,t.y-c),i=ZL(0,s-f),a=ZL(0,l-d),u+=r,c+=o,n&&(s+=r,l+=o,u-=i,c-=a),s-=i,l-=a,oI(u,c,s-u,l-c)},oI=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},iI=function(e){return oI(e.left,e.top,e.width,e.height)},aI={inflate:tI,relativePosition:QL,findBestRelativePosition:eI,intersect:nI,clamp:rI,create:oI,fromClientRect:iI},uI=ea.each,cI=ea.extend,sI=function(){};sI.extend=qL=function(e){var t,n,r,o=this,i=o.prototype,a=function(){var e,t,n,r=this;if(!$L&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)},u=function(){return this},c=function(e,t){return function(){var n,r=this,o=r._super;return r._super=i[e],n=t.apply(r,arguments),r._super=o,n}};$L=!0,t=new o,$L=!1,e.Mixins&&(uI(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),i.Mixins&&(e.Mixins=i.Mixins.concat(e.Mixins))),e.Methods&&uI(e.Methods.split(","),function(t){e[t]=u}),e.Properties&&uI(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this;return void 0!==e?(t[n]=e,t):t[n]}}),e.Statics&&uI(e.Statics,function(e,t){a[t]=e}),e.Defaults&&i.Defaults&&(e.Defaults=cI({},i.Defaults,e.Defaults));for(n in e)r=e[n],t[n]="function"==typeof r&&i[n]?c(n,r):r;return a.prototype=t,a.constructor=a,a.extend=qL,a};var lI,fI=Math.min,dI=Math.max,hI=Math.round,mI=function(e){var t={},n=0,r=0,o=0,i=function(e,t,n){var r,o,i,a,u,c;return r=0,o=0,i=0,e/=255,t/=255,n/=255,u=fI(e,fI(t,n)),c=dI(e,dI(t,n)),u===c?(i=u,{h:0,s:0,v:100*i}):(a=e===u?t-n:n===u?e-t:n-e,r=e===u?3:n===u?1:5,r=60*(r-a/(c-u)),o=(c-u)/c,i=c,{h:hI(r),s:hI(100*o),v:hI(100*i)})},a=function(e,t,i){var a,u,c,s;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,i=parseInt(i,10)/100,t=dI(0,fI(t,1)),i=dI(0,fI(i,1)),0===t)return void(n=r=o=hI(255*i));switch(a=e/60,u=i*t,c=u*(1-Math.abs(a%2-1)),s=i-u,Math.floor(a)){case 0:n=u,r=c,o=0;break;case 1:n=c,r=u,o=0;break;case 2:n=0,r=u,o=c;break;case 3:n=0,r=c,o=u;break;case 4:n=c,r=0,o=u;break;case 5:n=u,r=0,o=c;break;default:n=r=o=0}n=hI(255*(n+s)),r=hI(255*(r+s)),o=hI(255*(o+s))},u=function(){var e=function(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e};return"#"+e(n)+e(r)+e(o)},c=function(){return{r:n,g:r,b:o}},s=function(){return i(n,r,o)},l=function(e){var i;return"object"==typeof e?"r"in e?(n=e.r,r=e.g,o=e.b):"v"in e&&a(e.h,e.s,e.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(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(e))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=0>n?0:n>255?255:n,r=0>r?0:r>255?255:r,o=0>o?0:o>255?255:o,t};return e&&l(e),t.toRgb=c,t.toHsv=s,t.toHex=u,t.parse=l,t},gI=function(e){var t=JSON.stringify(e);return tt(t)?t.replace(/[\u0080-\uFFFF]/g,function(e){var t=e.charCodeAt(0).toString(16);return"\\u"+"0000".substring(t.length)+t}):t},pI={serialize:gI,parse:function(e){try{return JSON.parse(e)}catch(t){}}},vI={callbacks:{},count:0,send:function(e){var t=this,n=rs.DOM,r=void 0!==e.count?e.count:t.count,o="tinymce_jsonp_"+r;t.callbacks[r]=function(i){n.remove(o),delete t.callbacks[r],e.callback(i)},n.add(n.doc.body,"script",{id:o,src:e.url,type:"text/javascript"}),t.count++}},yI=$t($t({},HH),{send:function(t){var n,r=0,o=function(){!t.async||4===n.readyState||r++>1e4?(t.success&&1e4>r&&200===n.status?t.success.call(t.success_scope,""+n.responseText,n,t):t.error&&t.error.call(t.error_scope,r>1e4?"TIMED_OUT":"GENERAL",n,t),n=null):wi.setTimeout(o,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=t.async!==!1,t.data=t.data||"",yI.fire("beforeInitialize",{settings:t}),n=new e.XMLHttpRequest){if(n.overrideMimeType&&n.overrideMimeType(t.content_type),n.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(n.withCredentials=!0),t.content_type&&n.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&ea.each(t.requestheaders,function(e){n.setRequestHeader(e.key,e.value)}),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n=yI.fire("beforeSend",{xhr:n,settings:t}).xhr,n.send(t.data),!t.async)return o();wi.setTimeout(o,10)}}}),bI=ea.extend,CI=function(){function e(e){this.settings=bI({},e),this.count=0}return e.sendRPC=function(t){return(new e).send(t)},e.prototype.send=function(e){var t=e.error,n=e.success,r=bI(this.settings,e);r.success=function(e,o){e=pI.parse(e),"undefined"==typeof e&&(e={error:"JSON Parse error."}),e.error?t.call(r.error_scope||r.scope,e.error,o):n.call(r.success_scope||r.scope,e.result)},r.error=function(e,n){t&&t.call(r.error_scope||r.scope,e,n)},r.data=pI.serialize({id:e.id||"c"+this.count++,method:e.method,params:e.params}),r.content_type="application/json",yI.send(r)},e}(),wI=function(){return function(){var e={},t=[],n={getItem:function(t){var n=e[t];return n?n:null},setItem:function(n,r){t.push(n),e[n]=String(r)},key:function(e){return t[e]},removeItem:function(n){t=t.filter(function(e){return e===n}),delete e[n]},clear:function(){t=[],e={}},length:0};return Object.defineProperty(n,"length",{get:function(){return t.length},configurable:!1,enumerable:!1}),n}()};try{lI=e.window.localStorage}catch(pc){lI=wI()}var xI=lI,EI={geom:{Rect:aI},util:{Promise:mi,Delay:wi,Tools:ea,VK:vb,URI:xL,Class:sI,EventDispatcher:PH,Observable:HH,I18n:zs,XHR:yI,JSON:pI,JSONRequest:CI,JSONP:vI,LocalStorage:xI,Color:mI},dom:{EventUtils:Du,Sizzle:vc,DomQuery:Kc,TreeWalker:Xc,TextSeeker:gd,DOMUtils:rs,ScriptLoader:fs,RangeUtils:WL,Serializer:bx,ControlSelection:wb,BookmarkManager:mb,Selection:Vw,Event:Du.Event},html:{Styles:Cu,Entities:au,Node:$g,Schema:a,SaxParser:Qg,DomParser:ox,Writer:sp,Serializer:lp},Env:Ri,AddOnManager:ks,Annotator:Ig,Formatter:dk,UndoManager:nN,EditorCommands:MH,WindowManager:Jy,NotificationManager:R,EditorObservable:iL,Shortcuts:gL,Editor:TL,FocusManager:ev,EditorManager:jL,DOM:rs.DOM,ScriptLoader:fs.ScriptLoader,PluginManager:ks.PluginManager,ThemeManager:ks.ThemeManager,IconManager:Oy,Resource:YL,trim:ea.trim,isArray:ea.isArray,is:ea.is,toArray:ea.toArray,makeMap:ea.makeMap,each:ea.each,map:ea.map,grep:ea.grep,inArray:ea.inArray,extend:ea.extend,create:ea.create,walk:ea.walk,createNS:ea.createNS,resolve:ea.resolve,explode:ea.explode,_addCacheSuffix:ea._addCacheSuffix,isOpera:Ri.opera,isWebKit:Ri.webkit,isIE:Ri.ie,isGecko:Ri.gecko,isMac:Ri.mac},zI=ea.extend(jL,EI),kI=function(e){if("object"==typeof n)try{n.exports=e}catch(t){}},NI=function(e){window.tinymce=e,window.tinyMCE=e};NI(zI),kI(zI)}(window)}); ;/*!node_modules/tinymce/themes/silver/theme.js*/ amis.define("node_modules/tinymce/themes/silver/theme",function(){!function(n){"use strict";function t(n){for(var t=[],e=1;et;t++)n+=arguments[t].length;for(var o=Array(n),r=0,t=0;e>t;t++)for(var i=arguments[t],u=0,a=i.length;a>u;u++,r++)o[r]=i[u];return o}function r(n,t){var e=function(t,e){if(!It(e)&&!e.match(/^[0-9]+$/))throw new Error(n+".set accepts only positive integer values. Value was "+e);var o=t.dom();Ts(o)&&(o.style[n]=e+"px")},o=function(e){var o=t(e);if(0>=o||null===o){var r=Vs(e,n);return parseFloat(r)||0}return o},r=o,i=function(n,t){return $t(t,function(t,e){var o=Vs(n,e),r=void 0===o?0:parseInt(o,10);return isNaN(r)?t:t+r},0)},u=function(n,t,e){var o=i(n,e),r=t>o?t-o:0;return r};return{set:e,get:o,getOuter:r,aggregate:i,max:u}}function i(n,t,e,o,r){return n(e,o)?St.some(e):Ft(r)&&r(e)?St.none():t(e,o,r)}function u(n,t){var e=function(e){if(!n(e))throw new Error("Can only get "+t+" value of a "+t+" node");return o(e).getOr("")},o=function(t){return n(t)?St.from(t.dom().nodeValue):St.none()},r=function(e,o){if(!n(e))throw new Error("Can only set raw "+t+" value of a "+t+" node");e.dom().nodeValue=o};return{get:e,getOption:o,set:r}}function a(n){return void 0!==n.uid}function c(n,t,e){var o=t.backstage,r=ZS(n),i=function(n){switch(n){case"bc-bc":return BS;case"tc-tc":return ES;case"tc-bc":return td;case"bc-tc":default:return ed}},u=function(n){Xt(n,function(n){return n.moveTo(0,0)})},a=function(n){n.length>0&&(ce(n).each(function(n){return n.moveRel(null,"banner")}),Xt(n,function(t,e){e>0&&t.moveRel(n[e-1].getEl(),"bc-tc")}))},c=function(n){u(n),a(n)},s=function(n,u){var a=!n.closeButton&&n.timeout&&(n.timeout>0||n.timeout<0),c=function(){u(),bS.hide(f)},s=of(hC.sketch({text:n.text,level:Lt(["success","error","warning","warn","info"],n.type)?n.type:void 0,progress:n.progressBar===!0,icon:St.from(n.icon),closeButton:!a,onAction:c,iconProvider:o.shared.providers.icons,translationProvider:o.shared.providers.translate})),f=of(bS.sketch(vt({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:t.backstage.shared.getSink,fireDismissalEventInstead:{}},r?{}:{fireRepositionEventInstead:{}})));return e.add(f),n.timeout>0&&DS.setTimeout(function(){c()},n.timeout),{close:c,moveTo:function(n,t){bS.showAt(f,{anchor:"makeshift",x:n,y:t},rf(s))},moveRel:function(n,e){if("banner"!==e){var o=i(e),r={anchor:"node",root:Bs(),node:St.some(Xr.fromDom(n)),layouts:{onRtl:function(){return[o]},onLtr:function(){return[o]}}};bS.showAt(f,r,rf(s))}else bS.showAt(f,t.backstage.shared.anchors.banner(),rf(s))},text:function(n){hC.updateText(s,n)},settings:n,getEl:function(){return s.element().dom()},progressBar:{value:function(n){hC.updateProgress(s,n)}}}},f=function(n){n.close()},l=function(n){return n.settings};return{open:s,close:f,reposition:c,getArgs:l}}function s(n){var t=10,e=10,o=Sc("size-label"),r=KO(o,t,e),i=sC({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:o}},components:[nf("0x0")],behaviours:bd([ew.config({})])});return{type:"widget",data:{value:Sc("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[GO().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:$O(r).concat(i.asSpec()),behaviours:bd([rw("insert-table-picker",[ba(XO,function(n,o,u){var a=u.event().row(),c=u.event().col();JO(r,a,c,t,e),ew.set(i.get(n),[QO(a,c)])}),ba(YO,function(t,e,o){n.onAction({numRows:o.event().row()+1,numColumns:o.event().col()+1}),ea(t,Pu())})]),Xx.config({initSize:{numRows:t,numColumns:e},mode:"flatgrid",selector:'[role="button"]'})])})]}}function f(n){void 0===n&&(n=10);var t=x_.getItem(w_),e=Bt(t)?JSON.parse(t):[],o=function(t){var e=n-t.length;return 0>e?t.slice(0,n):t},r=o(e),i=function(t){zt(r,t).each(u),r.unshift(t),r.length>n&&r.pop(),x_.setItem(w_,JSON.stringify(r))},u=function(n){r.splice(n,1)},a=function(){return r.slice(0)};return{add:i,state:a}}function l(n,t){var e=eT.getColors(t.colorinput.getColors(),t.colorinput.hasCustomColors()),o=t.colorinput.getColorCols(),r="color",i=xT(Sc("menu-value"),e,function(t){n.onAction({value:t})},o,r,FO.CLOSE_ON_EXECUTE,function(){return!1},t.shared.providers),u=vt(vt({},i),{markers:iT(r),movement:ST(o,r)});return{type:"widget",data:{value:Sc("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[GO().widget(oS.sketch(u))]}}function d(t,e){var o=null,r=function(){for(var r=[],i=0;il;++l){for(var d=l*u,m=Math.min(d+u,c),g=new Array(m-d),p=d,h=0;m>p;++h,++p)g[h]=a[p].charCodeAt(0);f[l]=new Uint8Array(g)}return St.some(new n.Blob(f,{type:r}))}function C(n){return new VF(function(t,e){S(n).fold(function(){e("uri is not base64: "+n)},t)})}function k(t,e,o){return e=e||"image/png",n.HTMLCanvasElement.prototype.toBlob?new VF(function(n,r){t.toBlob(function(t){t?n(t):r()},e,o)}):C(t.toDataURL(e,o))}function O(n,t,e){return t=t||"image/png",n.toDataURL(t,e)}function _(n){return w(n).then(function(n){E(n);var t=p(y(n),x(n)),e=v(t);return e.drawImage(n,0,0),t})}function T(t){return new VF(function(e){var o=new n.FileReader;o.onloadend=function(){e(o.result)},o.readAsDataURL(t)})}function E(t){n.URL.revokeObjectURL(t.src)}function B(n,t,e){function o(){return VF.resolve(t)}function r(){return e}function i(){return e.split(",")[1]}function u(t,e){return n.then(function(n){return k(n,t,e)})}function a(t,e){return n.then(function(n){return O(n,t,e)})}function c(n,t){return a(n,t).then(function(n){return n.split(",")[1]})}function s(){return n.then(h)}var f=t.type,l=ft(f);return{getType:l,toBlob:o,toDataURL:r,toBase64:i,toAdjustedBlob:u,toAdjustedDataURL:a,toAdjustedBase64:c,toCanvas:s}}function D(n){return T(n).then(function(t){return B(_(n),n,t)})}function A(n,t){return k(n,t).then(function(t){return B(VF.resolve(n),t,n.toDataURL())})}function M(n,t,e){var o="string"==typeof n?parseFloat(n):n;return o>e?o=e:t>o&&(o=t),o}function F(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]}function I(n,t){for(var e,o=[],r=new Array(25),i=0;5>i;i++){for(var u=0;5>u;u++)o[u]=t[u+5*i];for(var u=0;5>u;u++){e=0;for(var a=0;5>a;a++)e+=n[u+5*a]*o[a];r[u+5*i]=e}}return r}function R(n,t){var e;return t=M(t,-1,1),t*=100,0>t?e=127+t/100*127:(e=t%1,e=0===e?NF[t]:NF[Math.floor(t)]*(1-e)+NF[Math.floor(t)+1]*e,e=127*e+127),I(n,[e/127,0,0,0,.5*(127-e),0,e/127,0,0,.5*(127-e),0,0,e/127,0,.5*(127-e),0,0,0,1,0,0,0,0,0,1])}function V(n,t){return t=M(255*t,-255,255),I(n,[1,0,0,0,t,0,1,0,0,t,0,0,1,0,t,0,0,0,1,0,0,0,0,0,1])}function H(n,t,e,o){return t=M(t,0,2),e=M(e,0,2),o=M(o,0,2),I(n,[t,0,0,0,0,0,e,0,0,0,0,0,o,0,0,0,0,0,1,0,0,0,0,0,1])}function N(n,t){return n.toCanvas().then(function(e){return P(e,n.getType(),t)})}function P(n,t,e){function o(n,t){for(var e,o,r,i,u=n.data,a=t[0],c=t[1],s=t[2],f=t[3],l=t[4],d=t[5],m=t[6],g=t[7],p=t[8],h=t[9],v=t[10],b=t[11],y=t[12],x=t[13],w=t[14],S=t[15],C=t[16],k=t[17],O=t[18],_=t[19],T=0;Te?n=e:t>n&&(n=t),n}for(var r=Math.round(Math.sqrt(e.length)),i=Math.floor(r/2),u=n.data,a=t.data,c=n.width,s=n.height,f=0;s>f;f++)for(var l=0;c>l;l++){for(var d=0,m=0,g=0,p=0;r>p;p++)for(var h=0;r>h;h++){var v=o(l+h-i,0,c-1),b=o(f+p-i,0,s-1),y=4*(b*c+v),x=e[p*r+h];d+=u[y]*x,m+=u[y+1]*x,g+=u[y+2]*x}var w=4*(f*c+l);a[w]=o(d,0,255),a[w+1]=o(m,0,255),a[w+2]=o(g,0,255)}return t}var r=v(n),i=r.getImageData(0,0,n.width,n.height),u=r.getImageData(0,0,n.width,n.height);return u=o(i,u,e),r.putImageData(u,0,0),A(n,t)}function j(n){var t=function(t,e,o){function r(n,t){for(var e=n.data,o=0;oi||i>2)&&(i=.5>i?.5:2,a=!0),(.5>u||u>2)&&(u=.5>u?.5:2,a=!0);var c=Y(n,i,u);return a?c.then(function(n){return X(n,t,e)}):c}function Y(n,t,e){return new VF(function(o){var r=y(n),i=x(n),u=Math.floor(r*t),a=Math.floor(i*e),c=p(u,a),s=v(c);s.drawImage(n,0,0,r,i,0,0,u,a),o(c)})}function q(n,t){return n.toCanvas().then(function(e){return K(e,n.getType(),t)})}function K(n,t,e){var o=p(n.width,n.height),r=v(o),i=0,u=0;return e=0>e?360+e:e,(90===e||270===e)&&b(o,o.height,o.width),(90===e||180===e)&&(i=o.width),(270===e||180===e)&&(u=o.height),r.translate(i,u),r.rotate(e*Math.PI/180),r.drawImage(n,0,0),A(o,t)}function J(n,t){return n.toCanvas().then(function(e){return $(e,n.getType(),t)})}function $(n,t,e){var o=p(n.width,n.height),r=v(o);return"v"===e?(r.scale(1,-1),r.drawImage(n,0,-o.height)):(r.scale(-1,1),r.drawImage(n,-o.width,0)),A(o,t)}function Q(n,t,e,o,r){return n.toCanvas().then(function(i){return Z(i,n.getType(),t,e,o,r)})}function Z(n,t,e,o,r,i){var u=p(r,i),a=v(u);return a.drawImage(n,-e,-o),A(u,t)}function nt(n,t,e){return n.toCanvas().then(function(o){return X(o,t,e).then(function(t){return A(t,n.getType())})})}function tt(n){var t,e,o,r,i,u,a,c,s=Math.max;return t=n.documentElement,e=n.body,o=s(t.scrollWidth,e.scrollWidth),r=s(t.clientWidth,e.clientWidth),i=s(t.offsetWidth,e.offsetWidth),u=s(t.scrollHeight,e.scrollHeight),a=s(t.clientHeight,e.clientHeight),c=s(t.offsetHeight,e.offsetHeight),{width:i>o?r:o,height:c>u?a:u}}function et(n){var t,e;if(n.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),e=0;e").css({position:"absolute",top:0,left:0,width:m.width,height:m.height,zIndex:2147483647,opacity:1e-4,cursor:d}).appendTo(f.body),cR(f).on("mousemove touchmove",a).on("mouseup touchend",u),e.start(t)},a=function(n){return et(n),n.button!==r?u(n):(n.deltaX=n.screenX-c,n.deltaY=n.screenY-s,n.preventDefault(),void e.drag(n))},u=function(n){et(n),cR(f).off("mousemove touchmove",a).off("mouseup touchend",u),o.remove(),e.stop&&e.stop(n)},this.destroy=function(){cR(l).off()},cR(l).on("mousedown touchstart",i)}function rt(){function n(n){var t;return t=i.splice(++u),i.push(n),{state:n,removed:t}}function t(){return o()?i[--u]:void 0}function e(){return r()?i[++u]:void 0}function o(){return u>0}function r(){return-1!==u&&ue;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},vt.apply(this,arguments)},bt=function(){return yt},yt=function(){var n=function(n){return n.isNone()},t=function(n){return n()},e=function(n){return n},o={fold:function(n){return n()},is:gt,isSome:gt,isNone:pt,getOr:e,getOrThunk:t,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:ft(null),getOrUndefined:ft(void 0),or:e,orThunk:t,map:bt,each:at,bind:bt,exists:gt,forall:pt,filter:bt,equals:n,equals_:n,toArray:function(){return[]},toString:ft("none()")};return Object.freeze&&Object.freeze(o),o}(),xt=function(n){var t=ft(n),e=function(){return r},o=function(t){return t(n)},r={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:pt,isNone:gt,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return xt(t(n))},each:function(t){t(n)},bind:o,exists:o,forall:o,filter:function(t){return t(n)?r:yt},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(gt,function(t){return e(n,t)})}};return r},wt=function(n){return null===n||void 0===n?yt:xt(n)},St={some:xt,none:bt,from:wt},Ct=function(n){var t=function(t){return n===t},e=function(){return Ct(n)},o=function(){return Ct(n)},r=function(t){return Ct(t(n))},i=function(){return Ct(n)},u=function(t){t(n)},a=function(t){return t(n)},c=function(t,e){return e(n)},s=function(t){return t(n)},f=function(t){return t(n)},l=function(){return St.some(n)};return{is:t,isValue:pt,isError:gt,getOr:ft(n),getOrThunk:ft(n),getOrDie:ft(n),or:e,orThunk:o,fold:c,map:r,mapError:i,each:u,bind:a,exists:s,forall:f,toOption:l}},kt=function(n){var t=function(n){return n()},e=function(){return mt(String(n))()},o=function(n){return n},r=function(n){return n()},i=function(){return kt(n)},u=function(t){return kt(t(n))},a=function(){return kt(n)},c=function(t){return t(n)};return{is:gt,isValue:gt,isError:pt,getOr:lt,getOrThunk:t,getOrDie:e,or:o,orThunk:r,fold:c,map:i,mapError:u,each:at,bind:a,exists:gt,forall:pt,toOption:St.none}},Ot=function(n,t){return n.fold(function(){return kt(t)},Ct)},_t={value:Ct,error:kt,fromOption:Ot},Tt=function(n){if(null===n)return"null";var t=typeof n;return"object"===t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t},Et=function(n){return function(t){return Tt(t)===n}},Bt=Et("string"),Dt=Et("object"),At=Et("array"),Mt=Et("boolean"),Ft=Et("function"),It=Et("number"),Rt=function(n,t){if(At(n)){for(var e=0,o=n.length;o>e;++e)if(t(n[e])!==!0)return!1;return!0}return!1},Vt=Array.prototype.slice,Ht=Array.prototype.indexOf,Nt=Array.prototype.push,Pt=function(n,t){return Ht.call(n,t)},zt=function(n,t){var e=Pt(n,t);return-1===e?St.none():St.some(e)},Lt=function(n,t){return Pt(n,t)>-1},jt=function(n,t){for(var e=0,o=n.length;o>e;e++){var r=n[e];if(t(r,e))return!0}return!1},Ut=function(n,t){for(var e=[],o=0;n>o;o++)e.push(t(o));return e},Wt=function(n,t){for(var e=[],o=0;or;r++){var i=n[r];o[r]=t(i,r)}return o},Xt=function(n,t){for(var e=0,o=n.length;o>e;e++){var r=n[e];t(r,e)}},Yt=function(n,t){for(var e=n.length-1;e>=0;e--){var o=n[e];t(o,e)}},qt=function(n,t){for(var e=[],o=[],r=0,i=n.length;i>r;r++){var u=n[r],a=t(u,r)?e:o;a.push(u)}return{pass:e,fail:o}},Kt=function(n,t){for(var e=[],o=0,r=n.length;r>o;o++){var i=n[o];t(i,o)&&e.push(i)}return e},Jt=function(n,t,e){return Yt(n,function(n){e=t(e,n)}),e},$t=function(n,t,e){return Xt(n,function(n){e=t(e,n)}),e},Qt=function(n,t){for(var e=0,o=n.length;o>e;e++){var r=n[e];if(t(r,e))return St.some(r)}return St.none()},Zt=function(n,t){for(var e=0,o=n.length;o>e;e++){var r=n[e];if(t(r,e))return St.some(e)}return St.none()},ne=function(n){for(var t=[],e=0,o=n.length;o>e;++e){if(!At(n[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+n);Nt.apply(t,n[e])}return t},te=function(n,t){return ne(Gt(n,t))},ee=function(n,t){for(var e=0,o=n.length;o>e;++e){var r=n[e];if(t(r,e)!==!0)return!1}return!0},oe=function(n){var t=Vt.call(n,0);return t.reverse(),t},re=function(n,t){return Kt(n,function(n){return!Lt(t,n)})},ie=function(n,t){for(var e={},o=0,r=n.length;r>o;o++){var i=n[o];e[String(i)]=t(i,o)}return e},ue=function(n){return[n]},ae=function(n,t){var e=Vt.call(n,0);return e.sort(t),e},ce=function(n){return 0===n.length?St.none():St.some(n[0])},se=function(n){return 0===n.length?St.none():St.some(n[n.length-1])},fe=Ft(Array.from)?Array.from:function(n){return Vt.call(n)},le=function(n,t){for(var e=0;eo;o++){var i=e[o],u=n[i];t(u,i)}},pe=function(n,t){return he(n,function(n,e){return{k:e,v:t(n,e)}})},he=function(n,t){var e={};return ge(n,function(n,o){var r=t(n,o);e[r.k]=r.v}),e},ve=function(n,t){var e=[];return ge(n,function(n,o){e.push(t(n,o))}),e},be=function(n,t){for(var e=de(n),o=0,r=e.length;r>o;o++){var i=e[o],u=n[i];if(t(u,i,n))return St.some(u)}return St.none()},ye=function(n){return ve(n,function(n){return n})},xe=function(n,t){return we(n,t)?St.from(n[t]):St.none()},we=function(n,t){return me.call(n,t)},Se=function(n,t){return we(n,t)&&void 0!==n[t]&&null!==n[t]},Ce=function(t){if(!At(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=[],o={};return Xt(t,function(r,i){var u=de(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!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!At(c))throw new Error("case arguments must be an array");e.push(a),o[a]=function(){var o=arguments.length;if(o!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+o);for(var r=new Array(o),u=0;u0?io(e.errors):ro(e.values,t)},ao=function(n,t){return Ue.svalue(n.length>0?Be(t,De.apply(void 0,n)):t)},co=function(n){return st(Ue.serror,ne)(n)},so=function(n,t){var e=Ue.partition(n);return e.errors.length>0?co(e.errors):ao(e.values,t)},fo=function(n){var t=Ue.partition(n);return t.errors.length>0?co(t.errors):Ue.svalue(t.values)},lo={consolidateObj:so,consolidateArr:fo},mo=function(n){return Dt(n)&&de(n).length>100?" removed due to size":JSON.stringify(n,null,2)},go=function(n){var t=n.length>10?n.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):n;return Gt(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()})},po=function(n,t){return Ue.serror([{path:n,getErrorInfo:t}])},ho=function(n,t,e){return po(n,function(){return'Could not find valid *strict* value for "'+t+'" in '+mo(e)})},vo=function(n,t){return po(n,function(){return'Choice schema did not contain choice key: "'+t+'"'})},bo=function(n,t,e){return po(n,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+mo(t)})},yo=function(n,t){return po(n,function(){return"There are unsupported fields: ["+t.join(", ")+"] specified"})},xo=function(n,t){return po(n,function(){return t})},wo=ke.generate([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),So=function(n,t,e){return xe(t,e).fold(function(){return ho(n,e,t)},Ue.svalue)},Co=function(n,t,e){var o=xe(n,t).fold(function(){return e(n)},lt);return Ue.svalue(o)},ko=function(n,t){return Ue.svalue(xe(n,t))},Oo=function(n,t,e){var o=xe(n,t).map(function(t){return t===!0?e(n):t});return Ue.svalue(o)},_o=function(n,t,e,o){return e.fold(function(e,r,i,u){var a=function(t){var i=u.extract(n.concat([e]),o,t);return Ue.map(i,function(n){return Qe(r,o(n))})},c=function(t){return t.fold(function(){var n=Qe(r,o(St.none()));return Ue.svalue(n)},function(t){var i=u.extract(n.concat([e]),o,t);return Ue.map(i,function(n){return Qe(r,o(St.some(n)))})})};return function(){return i.fold(function(){return Ue.bind(So(n,t,e),a)},function(n){return Ue.bind(Co(t,e,n),a)},function(){return Ue.bind(ko(t,e),c)},function(n){return Ue.bind(Oo(t,e,n),c)},function(n){var o=n(t),r=Ue.map(Co(t,e,ft({})),function(n){return Be(o,n)});return Ue.bind(r,a)})}()},function(n,e){var r=e(t);return Ue.svalue(Qe(n,o(r)))})},To=function(n,t,e,o){var r=Gt(e,function(e){return _o(n,t,e,o)});return lo.consolidateObj(r,{})},Eo=function(n){var t=function(t,e,o){return n().extract(t,e,o)},e=function(){return n().toString()};return{extract:t,toString:e}},Bo=function(n){var t=function(t,e,o){return Ue.bindError(n(o,e),function(n){return xo(t,n)})},e=function(){return"val"};return{extract:t,toString:e}},Do=function(n){var t=de(n);return Kt(t,function(t){return Se(n,t)})},Ao=function(n){var t=Mo(n),e=Jt(n,function(n,t){return t.fold(function(t){return Be(n,eo(t,!0))},ft(n))},{}),o=function(n,o,r){var i=Mt(r)?[]:Do(r),u=Kt(i,function(n){return!Se(e,n)});return 0===u.length?t.extract(n,o,r):yo(n,u)};return{extract:o,toString:t.toString}},Mo=function(n){var t=function(t,e,o){return To(t,o,n,e)},e=function(){var t=Gt(n,function(n){return n.fold(function(n,t,e,o){return n+" -> "+o.toString()},function(n){return"state("+n+")"})});return"obj{\n"+t.join("\n")+"}"};return{extract:t,toString:e}},Fo=function(n){var t=function(t,e,o){var r=Gt(o,function(o,r){return n.extract(t.concat(["["+r+"]"]),e,o)});return lo.consolidateArr(r)},e=function(){return"array("+n.toString()+")"};return{extract:t,toString:e}},Io=function(n){var t=function(t,e,o){for(var r=[],i=0,u=n;i1)throw n.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Wr(r.childNodes[0])},jr=function(t,e){var o=e||n.document,r=o.createElement(t); return Wr(r)},Ur=function(t,e){var o=e||n.document,r=o.createTextNode(t);return Wr(r)},Wr=function(n){if(null===n||void 0===n)throw new Error("Node cannot be null or undefined");return{dom:ft(n)}},Gr=function(n,t,e){var o=n.dom();return St.from(o.elementFromPoint(t,e)).map(Wr)},Xr={fromHtml:Lr,fromTag:jr,fromText:Ur,fromDom:Wr,fromPoint:Gr},Yr=function(n,t,e){return 0!==(n.compareDocumentPosition(t)&e)},qr=function(t,e){return Yr(t,e,n.Node.DOCUMENT_POSITION_PRECEDING)},Kr=function(t,e){return Yr(t,e,n.Node.DOCUMENT_POSITION_CONTAINED_BY)},Jr={documentPositionPreceding:qr,documentPositionContainedBy:Kr},$r=function(n,t){for(var e=0;e0&&Ba(u);var a={};return Xt(n,function(n){a[n]=ft(o[n])}),Xt(t,function(n){a[n]=ft(Object.prototype.hasOwnProperty.call(o,n)?St.some(o[n]):St.none())}),a}},Fa=function(n){return Xr.fromDom(n.dom().ownerDocument)},Ia=function(n){return Xr.fromDom(n.dom().ownerDocument.documentElement)},Ra=function(n){return Xr.fromDom(n.dom().ownerDocument.defaultView)},Va=function(n){return St.from(n.dom().parentNode).map(Xr.fromDom)},Ha=function(n){return St.from(n.dom().offsetParent).map(Xr.fromDom)},Na=function(n){return St.from(n.dom().nextSibling).map(Xr.fromDom)},Pa=function(n){return Gt(n.dom().childNodes,Xr.fromDom)},za=function(n,t){var e=n.dom().childNodes;return St.from(e[t]).map(Xr.fromDom)},La=function(n){return za(n,0)},ja=(_a("element","offset"),function(t,e){var o=e||n.document,r=o.createElement("div");return r.innerHTML=t,Pa(Xr.fromDom(r))}),Ua=function(n,t){var e=Va(n);e.each(function(e){e.dom().insertBefore(t.dom(),n.dom())})},Wa=function(n,t){var e=Na(n);e.fold(function(){var e=Va(n);e.each(function(n){Xa(n,t)})},function(n){Ua(n,t)})},Ga=function(n,t){var e=La(n);e.fold(function(){Xa(n,t)},function(e){n.dom().insertBefore(t.dom(),e.dom())})},Xa=function(n,t){n.dom().appendChild(t.dom())},Ya=function(n,t,e){za(n,e).fold(function(){Xa(n,t)},function(n){Ua(n,t)})},qa=function(n,t){Xt(t,function(t){Ua(n,t)})},Ka=function(n,t){Xt(t,function(t){Xa(n,t)})},Ja=function(n){n.dom().textContent="",Xt(Pa(n),function(n){$a(n)})},$a=function(n){var t=n.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Qa=function(n){var t=Pa(n);t.length>0&&qa(n,t),$a(n)},Za=function(n){return n.dom().innerHTML},nc=function(n,t){var e=Fa(n),o=e.dom(),r=Xr.fromDom(o.createDocumentFragment()),i=ja(t,o);Ka(r,i),Ja(n),Xa(n,r)},tc=function(n){var t=Xr.fromTag("div"),e=Xr.fromDom(n.dom().cloneNode(!0));return Xa(t,e),Za(t)},ec=("undefined"!=typeof n.window?n.window:Function("return this;")(),function(n){var t=n.dom().nodeName;return t.toLowerCase()}),oc=function(n){return n.dom().nodeType},rc=function(n){return function(t){return oc(t)===n}},ic=rc(Gi),uc=rc(Xi),ac=function(t,e,o){if(!(Bt(o)||Mt(o)||It(o)))throw n.console.error("Invalid call to Attr.set. Key ",e,":: Value ",o,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,o+"")},cc=function(n,t,e){ac(n.dom(),t,e)},sc=function(n,t){var e=n.dom();ge(t,function(n,t){ac(e,t,n)})},fc=function(n,t){var e=n.dom().getAttribute(t);return null===e?void 0:e},lc=function(n,t){return St.from(fc(n,t))},dc=function(n,t){var e=n.dom();return e&&e.hasAttribute?e.hasAttribute(t):!1},mc=function(n,t){n.dom().removeAttribute(t)},gc=function(n,t){return Xr.fromDom(n.dom().cloneNode(t))},pc=function(n){return gc(n,!1)},hc=function(n){var t=pc(n);return tc(t)},vc=function(n){return hc(n)},bc=function(n,t,e){return Zi(t,n.element())&&!Zi(t,e)},yc=ca([fa(Au(),function(t,e){var o=e.event().originator(),r=e.event().target();return bc(t,o,r)?(n.console.warn(Au()+" did not get interpreted by the desired target. \nOriginator: "+vc(o)+"\nTarget: "+vc(r)+"\nCheck the "+Au()+" event handlers"),!1):!0})]),xc=Object.freeze({__proto__:null,events:yc}),wc=0,Sc=function(n){var t=new Date,e=t.getTime(),o=Math.floor(1e9*Math.random());return wc++,n+"_"+o+wc+String(e)},Cc=ft("alloy-id-"),kc=ft("data-alloy-id"),Oc=Cc(),_c=kc(),Tc=function(n,t){var e=Sc(Oc+n);return Ec(t,e),e},Ec=function(n,t){Object.defineProperty(n.dom(),_c,{value:t,writable:!0})},Bc=function(n){var t=ic(n)?n.dom()[_c]:null;return St.from(t)},Dc=function(n){return Sc(n)},Ac=lt,Mc=function(n){var t=function(t){return function(){throw new Error("The component must be in a context to send: "+t+(n?"\n"+vc(n().element())+" is not in context.":""))}};return{debugInfo:ft("fake"),triggerEvent:t("triggerEvent"),triggerFocus:t("triggerFocus"),triggerEscape:t("triggerEscape"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),broadcast:t("broadcast"),broadcastOn:t("broadcastOn"),broadcastEvent:t("broadcastEvent"),isConnected:ft(!1)}},Fc=Mc(),Ic=function(n,t,e){var o=e.toString(),r=o.indexOf(")")+1,i=o.indexOf("("),u=o.substring(i+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:t,parameters:Rc(u.slice(0,1).concat(u.slice(3)))}},n},Rc=function(n){return Gt(n,function(n){return Mi(n,"/*")?n.substring(0,n.length-"/*".length):n})},Vc=function(n,t){var e=n.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:t,parameters:Rc(i)}},n},Hc=function(n,t){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Rc(i.slice(1))}},n},Nc=Sc("alloy-premade"),Pc=function(n){return eo(Nc,n)},zc=function(n){return xe(n,Nc)},Lc=function(n){return Hc(function(t){for(var e=[],o=1;oa?-1:a>c?1:0});return _t.value(r)}catch(i){return _t.error([i])}},Qc=function(n,t){return{handler:n,purpose:ft(t)}},Zc=function(n,t){return{cHandler:n,purpose:ft(t)}},ns=function(n,e){return Zc(t.apply(void 0,[n.handler].concat(e)),n.purpose())},ts=function(n){return n.cHandler},es=function(n,t){return{name:ft(n),handler:ft(t)}},os=function(n,t){var e={};return Xt(n,function(n){e[n.name()]=n.handlers(t)}),e},rs=function(n,t,e){var o=vt(vt({},e),os(t,n));return Yc(o,es)},is=function(n,t,e,o){var r=rs(n,e,o);return ss(r,t)},us=function(n){var t=fu(n);return function(n,e){for(var o=[],r=2;r1?Kt(t[e],function(t){return jt(n,function(n){return n.name()===t})}).join(" > "):n[0].name();return eo(e,Qc(r,i))})});return uo(e,{})},fs=function(n){return Ko("custom.definition",Mo([Po("dom","dom",Ye(),Mo([fr("tag"),Br("styles",{}),Br("classes",[]),Br("attributes",{}),wr("value"),wr("innerHtml")])),fr("components"),fr("uid"),Br("events",{}),Br("apis",{}),Po("eventOrder","eventOrder",Xe({"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]}),tr()),wr("domModification")]),n)},ls=function(n){return vt(vt({},n.dom),{uid:n.uid,domChildren:Gt(n.components,function(n){return n.element()})})},ds=function(n){return n.domModification.fold(function(){return qc({})},qc)},ms=function(n){return n.events},gs=function(n,t){var e=fc(n,t);return void 0===e||""===e?[]:e.split(" ")},ps=function(n,t,e){var o=gs(n,t),r=o.concat([e]);return cc(n,t,r.join(" ")),!0},hs=function(n,t,e){var o=Kt(gs(n,t),function(n){return n!==e});return o.length>0?cc(n,t,o.join(" ")):mc(n,t),!1},vs=function(n){return void 0!==n.dom().classList},bs=function(n){return gs(n,"class")},ys=function(n,t){return ps(n,"class",t)},xs=function(n,t){return hs(n,"class",t)},ws=function(n,t){vs(n)?n.dom().classList.add(t):ys(n,t)},Ss=function(n){var t=vs(n)?n.dom().classList:bs(n);0===t.length&&mc(n,"class")},Cs=function(n,t){if(vs(n)){var e=n.dom().classList;e.remove(t)}else xs(n,t);Ss(n)},ks=function(n,t){return vs(n)&&n.dom().classList.contains(t)},Os=function(n,t){Xt(t,function(t){ws(n,t)})},_s=function(n,t){Xt(t,function(t){Cs(n,t)})},Ts=function(n){return void 0!==n.style&&Ft(n.style.getPropertyValue)},Es=function(n){var t=uc(n)?n.dom().parentNode:n.dom();return void 0!==t&&null!==t&&t.ownerDocument.body.contains(t)},Bs=Ae(function(){return Ds(Xr.fromDom(n.document))}),Ds=function(n){var t=n.dom().body;if(null===t||void 0===t)throw new Error("Body is not available yet");return Xr.fromDom(t)},As=function(t,e,o){if(!Bt(o))throw n.console.error("Invalid call to CSS.set. Property ",e,":: Value ",o,":: Element ",t),new Error("CSS value must be a string: "+o);Ts(t)&&t.style.setProperty(e,o)},Ms=function(n,t){Ts(n)&&n.style.removeProperty(t)},Fs=function(n,t,e){var o=n.dom();As(o,t,e)},Is=function(n,t){var e=n.dom();ge(t,function(n,t){As(e,t,n)})},Rs=function(n,t){var e=n.dom();ge(t,function(n,t){n.fold(function(){Ms(e,t)},function(n){As(e,t,n)})})},Vs=function(t,e){var o=t.dom(),r=n.window.getComputedStyle(o),i=r.getPropertyValue(e),u=""!==i||Es(t)?i:Hs(o,e);return null===u?void 0:u},Hs=function(n,t){return Ts(n)?n.style.getPropertyValue(t):""},Ns=function(n,t){var e=n.dom(),o=Hs(e,t);return St.from(o).filter(function(n){return n.length>0})},Ps=function(n){var t={},e=n.dom();if(Ts(e))for(var o=0;o0?Jc(e,i,t,o):r;return Kc(o,u)},Js=function(n,t,e){var o={"alloy.base.behaviour":ms(n)};return is(e,n.eventOrder,t,o).getOrDie()},$s=function(n){var t=function(){return b},e=zr(Fc),o=Jo(fs(n)),r=qs(n),i=Gc(r),u=Xc(r),a=Ks(o,i,u),c=Gs(a),s=Js(o,i,u),f=zr(o.components),l=function(n){e.set(n)},d=function(){e.set(Mc(t))},m=function(){var n=Pa(c),t=te(n,function(n){return e.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});f.set(t)},g=function(t){var e=u,o=Ft(e[t.name()])?e[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(n,null,2))};return o()},p=function(n){return Ft(u[n.name()])},h=function(){return o.apis},v=function(n){return u[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},b={getSystem:e.get,config:g,hasConfigured:p,spec:ft(n),readState:v,getApis:h,connect:l,disconnect:d,element:ft(c),syncComponents:m,components:f.get,events:ft(s)};return b},Qs=function(n){var t=xe(n,"components").getOr([]);return Gt(t,of)},Zs=function(n){var t=Ac(n),o=t.events,r=e(t,["events"]),i=Qs(r),u=vt(vt({},r),{events:vt(vt({},xc),o),components:i});return _t.value($s(u))},nf=function(n){var t=Xr.fromText(n);return tf({element:t})},tf=function(n){var t=$o("external.component",Ao([fr("element"),wr("uid")]),n),e=zr(Mc()),o=function(n){e.set(n)},r=function(){e.set(Mc(function(){return i}))};t.uid.each(function(n){Ec(t.element,n)});var i={getSystem:e.get,config:St.none,hasConfigured:ft(!1),connect:o,disconnect:r,getApis:function(){return{}},element:ft(t.element),spec:ft(n),readState:ft("No state"),syncComponents:at,components:ft([]),events:ft({})};return Pc(i)},ef=Dc,of=function(n){return zc(n).fold(function(){var t=n.hasOwnProperty("uid")?n:vt({uid:ef("")},n);return Zs(t).getOrDie()},function(n){return n})},rf=Pc,uf=r("height",function(n){var t=n.dom();return Es(n)?t.getBoundingClientRect().height:t.offsetHeight}),af=function(n){return uf.get(n)},cf=function(n){return uf.getOuter(n)},sf=function(n,t){var e=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],o=uf.max(n,t,e);Fs(n,"max-height",o+"px")},ff=function(n,t){var e=function(e,o){return ff(n+e,t+o)};return{left:ft(n),top:ft(t),translate:e}},lf=ff,df=function(n){var t=n.getBoundingClientRect();return lf(t.left,t.top)},mf=function(n,t){return void 0!==n?n:void 0!==t?t:0},gf=function(n){var t=n.dom().ownerDocument,e=t.body,o=t.defaultView,r=t.documentElement;if(e===n.dom())return lf(e.offsetLeft,e.offsetTop);var i=mf(o.pageYOffset,r.scrollTop),u=mf(o.pageXOffset,r.scrollLeft),a=mf(r.clientTop,e.clientTop),c=mf(r.clientLeft,e.clientLeft);return pf(n).translate(u-c,i-a)},pf=function(n){var t=n.dom(),e=t.ownerDocument,o=e.body;return o===t?lf(o.offsetLeft,o.offsetTop):Es(n)?df(t):lf(0,0)},hf=r("width",function(n){return n.dom().offsetWidth}),vf=function(n,t){hf.set(n,t)},bf=function(n){return hf.get(n)},yf=function(n){return hf.getOuter(n)},xf=function(n,t){var e=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],o=hf.max(n,t,e);Fs(n,"max-width",o+"px")},wf=function(n,t,e,o,r,i,u){return{target:ft(n),x:ft(t),y:ft(e),stop:o,prevent:r,kill:i,raw:ft(u)}},Sf=function(n){var t=Xr.fromDom(n.target),e=function(){n.stopPropagation()},o=function(){n.preventDefault()},r=st(o,e);return wf(t,n.clientX,n.clientY,e,o,r,n)},Cf=function(n,t){return function(e){n(e)&&t(Sf(e))}},kf=function(n,e,o,r,i){var u=Cf(o,r);return n.dom().addEventListener(e,u,i),{unbind:t(Tf,n,e,u,i)}},Of=function(n,t,e,o){return kf(n,t,e,o,!1)},_f=function(n,t,e,o){return kf(n,t,e,o,!0)},Tf=function(n,t,e,o){n.dom().removeEventListener(t,e,o)},Ef=(Ui().browser.isSafari(),function(t){var e=void 0!==t?t.dom():n.document,o=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return lf(o,r)}),Bf=function(t,e,o){var r=void 0!==o?o.dom():n.document,i=r.defaultView;i.scrollTo(t,e)},Df=function(t){var e=void 0===t?n.window:t;return St.from(e.visualViewport)},Af=function(n,t,e,o){return{x:ft(n),y:ft(t),width:ft(e),height:ft(o),right:ft(n+e),bottom:ft(t+o)}},Mf=function(t){var e=void 0===t?n.window:t,o=e.document,r=Ef(Xr.fromDom(o));return Df(e).fold(function(){var n=e.document.documentElement,t=n.clientWidth,o=n.clientHeight;return Af(r.left(),r.top(),t,o)},function(n){return Af(Math.max(n.pageLeft,r.left()),Math.max(n.pageTop,r.top()),n.width,n.height)})},Ff=function(n,t){var e=n.view(t);return e.fold(ft([]),function(t){var e=n.owner(t),o=Ff(n,e);return[t].concat(o)})},If=function(n,t){var e=t.owner(n),o=Ff(t,e);return St.some(o)},Rf=function(t){var e=t.dom()===n.document?St.none():St.from(t.dom().defaultView.frameElement);return e.map(Xr.fromDom)},Vf=function(n){return Fa(n)},Hf=Object.freeze({__proto__:null,view:Rf,owner:Vf}),Nf=function(e){var o=Xr.fromDom(n.document),r=Ef(o),i=If(e,Hf);return i.fold(t(gf,e),function(n){var t=pf(e),o=Jt(n,function(n,t){var e=pf(t);return{left:n.left+e.left(),top:n.top+e.top()}},{left:0,top:0});return lf(o.left+t.left()+r.left(),o.top+t.top()+r.top())})},Pf=_a("point","width","height"),zf=_a("x","y","width","height"),Lf=function(n,t,e,o){return{x:ft(n),y:ft(t),width:ft(e),height:ft(o),right:ft(n+e),bottom:ft(t+o)}},jf=function(n){var t=gf(n),e=yf(n),o=cf(n);return Lf(t.left(),t.top(),e,o)},Uf=function(n){var t=Nf(n),e=yf(n),o=cf(n);return Lf(t.left(),t.top(),e,o)},Wf=function(){return Mf(n.window)},Gf=function(n,t,e){for(var o=n.dom(),r=Ft(e)?e:ft(!1);o.parentNode;){o=o.parentNode;var i=Xr.fromDom(o);if(t(i))return St.some(i);if(r(i))break}return St.none()},Xf=function(n,t,e){var o=function(n,t){return t(n)};return i(o,Gf,n,t,e)},Yf=function(n,t){var e=function(n){for(var o=0;o-1});return t.bind(function(n){var t=fc(n,"id"),e=Fa(n);return Jf(e,'[aria-owns="'+t+'"]')})},Zf=function(){var n=Sc("aria-owns"),t=function(t){cc(t,"aria-owns",n)},e=function(n){mc(n,"aria-owns")};return{id:ft(n),link:t,unlink:e}},nl=function(n,t){return Qf(t).exists(function(t){return tl(n,t)})},tl=function(n,t){return qf(t,function(t){return Zi(t,n.element())},ft(!1))||nl(n,t)},el="unknown";!function(n){n[n.STOP=0]="STOP",n[n.NORMAL=1]="NORMAL",n[n.LOGGING=2]="LOGGING"}(Me||(Me={}));var ol,rl=zr({}),il=function(t,e){var o=[],r=(new Date).getTime();return{logEventCut:function(n,t,e){o.push({outcome:"cut",target:t,purpose:e})},logEventStopped:function(n,t,e){o.push({outcome:"stopped",target:t,purpose:e})},logNoParent:function(n,t,e){o.push({outcome:"no-parent",target:t,purpose:e})},logEventNoHandlers:function(n,t){o.push({outcome:"no-handlers-left",target:t})},logEventResponse:function(n,t,e){o.push({outcome:"response",purpose:e,target:t})},write:function(){var i=(new Date).getTime();Lt(["mousemove","mouseover","mouseout",Lu()],t)||n.console.log(t,{event:t,time:i-r,target:e.dom(),sequence:Gt(o,function(n){return Lt(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+vc(n.target)+")":n.outcome})})}}},ul=function(n,t,e){var o=xe(rl.get(),n).orThunk(function(){var t=de(rl.get());return le(t,function(t){return n.indexOf(t)>-1?St.some(rl.get()[t]):St.none()})}).getOr(Me.NORMAL);switch(o){case Me.NORMAL:return e(ll());case Me.LOGGING:var r=il(n,t),i=e(r);return r.write(),i;case Me.STOP:return!0}},al=["alloy/data/Fields","alloy/debugging/Debugging"],cl=function(){var n=new Error;if(void 0!==n.stack){var t=n.stack.split("\n");return Qt(t,function(n){return n.indexOf("alloy")>0&&!jt(al,function(t){return n.indexOf(t)>-1})}).getOr(el)}return el},sl={logEventCut:at,logEventStopped:at,logNoParent:at,logEventNoHandlers:at,logEventResponse:at,write:at},fl=function(n,t,e){return ul(n,t,e)},ll=ft(sl),dl=ft([fr("menu"),fr("selectedMenu")]),ml=ft([fr("item"),fr("selectedItem")]),gl=(ft(Mo(ml().concat(dl()))),ft(Mo(ml()))),pl=br("initSize",[fr("numColumns"),fr("numRows")]),hl=function(){return lr("markers",gl())},vl=function(){return br("markers",[fr("backgroundMenu")].concat(dl()).concat(ml()))},bl=function(n){return br("markers",Gt(n,fr))},yl=function(n,t,e){cl();return Po(t,t,e,Xo(function(n){return _t.value(function(){for(var t=[],e=0;e=o?St.some(t):St.none():o>=t?St.some(t):St.none()}).map(function(n){return n+r}).getOr(o)},r=o("left",n.x()),i=o("top",n.y()),u=o("right",n.right()),a=o("bottom",n.bottom());return Lf(r,i,u-r,a-i)},Ul=function(n){return n.x()},Wl=function(n,t){return n.x()+n.width()/2-t.width()/2},Gl=function(n,t){return n.x()+n.width()-t.width()},Xl=function(n,t){return n.y()-t.height()},Yl=function(n){return n.y()+n.height()},ql=function(n,t){return n.y()+n.height()/2-t.height()/2},Kl=function(n){return n.x()+n.width()},Jl=function(n,t){return n.x()-t.width()},$l=function(n,t,e){return Tl(Ul(n),Yl(n),e.southeast(),Ml(),Ll(n,{left:1,top:3}),"layout-se")},Ql=function(n,t,e){return Tl(Gl(n,t),Yl(n),e.southwest(),Fl(),Ll(n,{right:0,top:3}),"layout-sw")},Zl=function(n,t,e){return Tl(Ul(n),Xl(n,t),e.northeast(),Il(),Ll(n,{left:1,bottom:2}),"layout-ne")},nd=function(n,t,e){return Tl(Gl(n,t),Xl(n,t),e.northwest(),Rl(),Ll(n,{right:0,bottom:2}),"layout-nw")},td=function(n,t,e){return Tl(Wl(n,t),Xl(n,t),e.north(),Hl(),Ll(n,{bottom:2}),"layout-n")},ed=function(n,t,e){return Tl(Wl(n,t),Yl(n),e.south(),Vl(),Ll(n,{top:3}),"layout-s")},od=function(n,t,e){return Tl(Kl(n),ql(n,t),e.east(),Nl(),Ll(n,{left:0}),"layout-e")},rd=function(n,t,e){return Tl(Jl(n,t),ql(n,t),e.west(),Pl(),Ll(n,{right:1}),"layout-w")},id=function(){return[$l,Ql,Zl,nd,ed,td,od,rd]},ud=function(){return[Ql,$l,nd,Zl,ed,td,od,rd]},ad=function(){return[Zl,nd,$l,Ql,td,ed]},cd=function(){return[nd,Zl,Ql,$l,td,ed]},sd=function(){return[$l,Ql,Zl,nd,ed,td]},fd=function(){return[Ql,$l,nd,Zl,ed,td]},ld=function(n,t,e){return Oa(function(o){e(o,n,t)})},dd=function(n,t,e){return ka(function(o){e(o,n,t)})},md=function(n,t,e,o,r,i){var u=Ao(n),a=Tr(t,[Er("config",n)]);return vd(u,a,t,e,o,r,i)},gd=function(n,t,e,o,r,i){var u=n,a=Tr(t,[Sr("config",n)]);return vd(u,a,t,e,o,r,i)},pd=function(n,t,e){var o=function(o){for(var r=[],i=1;io?e:e>r?o:r},$d=function(n,t,e){return Math.min(Math.max(n,t),e)},Qd=Ma(["x","y","width","height","maxHeight","maxWidth","direction","classes","label","candidateYforTest"],[]),Zd=ke.generate([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),nm=function(n,t,e,o,r){var i=r.x(),u=r.y(),a=r.width(),c=r.height(),s=n>=i,f=t>=u,l=s&&f,d=i+a>=n+e,m=u+c>=t+o,g=d&&m,p=Math.abs(Math.min(e,s?i+a-n:i-(n+e))),h=Math.abs(Math.min(o,f?u+c-t:u-(t+o))),v=Math.max(r.x(),r.right()-e),b=Math.max(r.y(),r.bottom()-o),y=$d(n,r.x(),v),x=$d(t,r.y(),b);return{originInBounds:l,sizeInBounds:g,limitX:y,limitY:x,deltaW:p,deltaH:h}},tm=function(n,t,e,o){var r=n.x(),i=n.y(),u=n.bubble().offset(),a=u.left(),c=u.top(),s=jl(o,n.boundsRestriction(),u),f=s.y(),l=s.bottom(),d=s.x(),m=s.right(),g=r+a,p=i+c,h=nm(g,p,t,e,s),v=h.originInBounds,b=h.sizeInBounds,y=h.limitX,x=h.limitY,w=h.deltaW,S=h.deltaH,C=ft(x+S-f),k=ft(l-x),O=Dl(n.direction(),k,k,C),_=ft(y+w-d),T=ft(m-y),E=Al(n.direction(),T,T,_),B=Qd({x:y,y:x,width:w,height:S,maxHeight:O,maxWidth:E,direction:n.direction(),classes:{on:n.bubble().classesOn(),off:n.bubble().classesOff()},label:n.label(),candidateYforTest:p});return v&&b?Zd.fit(B):Zd.nofit(B,w,S)},em=function(n,e,o,r,i){var u=o.width(),a=o.height(),c=function(n,t,c,s){var f=n(e,o,r),l=tm(f,u,a,i);return l.fold(Zd.fit,function(n,e,o){var r=o>s||e>c;return r?Zd.nofit(n,e,o):Zd.nofit(t,c,s)})},s=$t(n,function(n,e){var o=t(c,e);return n.fold(Zd.fit,o)},Zd.nofit(Qd({x:e.x(),y:e.y(),width:o.width(),height:o.height(),maxHeight:o.height(),maxWidth:o.width(),direction:Ml(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y()}),-1,-1));return s.fold(lt,lt)},om=function(n){return{width:ft(yf(n)),height:ft(cf(n))}},rm=function(n,t,e,o){Ls(t,"max-height"),Ls(t,"max-width");var r=om(t);return em(o.preference(),n,r,e,o.bounds())},im=function(n,t){var e=t.classes();_s(n,e.off),Os(n,e.on)},um=function(n,t,e){var o=e.maxHeightFunction();o(n,t.maxHeight())},am=function(n,t,e){var o=e.maxWidthFunction();o(n,t.maxWidth())},cm=function(n,t,e){Nd(n,Ld(e.origin(),t))},sm=function(n,t){sf(n,Math.floor(t))},fm=ft(function(n,t){sm(n,t),Is(n,{"overflow-x":"hidden","overflow-y":"auto"})}),lm=ft(function(n,t){sm(n,t)}),dm=Ma(["bounds","origin","preference","maxHeightFunction","maxWidthFunction"],[]),mm=function(n,t,e){return void 0===n[t]?e:n[t]},gm=function(n,t,e,o,r,i){var u=mm(i,"maxHeightFunction",fm()),a=mm(i,"maxWidthFunction",at),c=n.anchorBox(),s=n.origin(),f=dm({bounds:Ud(s,r),origin:s,preference:o,maxHeightFunction:u,maxWidthFunction:a});pm(c,t,e,f)},pm=function(n,t,e,o){var r=rm(n,t,e,o);cm(t,r,o),im(t,r),um(t,r,o),am(t,r,o)},hm=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],vm=function(n,t,e){var o=function(n){return xe(e,n).getOr([])},r=function(n,t,e){var r=re(hm,e);return{offset:function(){return lf(n,t)},classesOn:function(){return te(e,o)},classesOff:function(){return te(r,o)}}};return{southeast:function(){return r(-n,t,["top","alignLeft"])},southwest:function(){return r(n,t,["top","alignRight"])},south:function(){return r(-n/2,t,["top","alignCentre"])},northeast:function(){return r(-n,-t,["bottom","alignLeft"])},northwest:function(){return r(n,-t,["bottom","alignRight"])},north:function(){return r(-n/2,-t,["bottom","alignCentre"])},east:function(){return r(n,-t/2,["valignCentre","left"])},west:function(){return r(-n,-t/2,["valignCentre","right"])},innerNorthwest:function(){return r(-n,t,["top","alignRight"])},innerNortheast:function(){return r(n,t,["top","alignLeft"])},innerNorth:function(){return r(-n/2,t,["top","alignCentre"])},innerSouthwest:function(){return r(-n,-t,["bottom","alignRight"])},innerSoutheast:function(){return r(n,-t,["bottom","alignLeft"])},innerSouth:function(){return r(-n/2,-t,["bottom","alignCentre"])},innerWest:function(){return r(n,-t/2,["valignCentre","right"])},innerEast:function(){return r(-n,-t/2,["valignCentre","left"])}}},bm=function(){return vm(0,0,{})},ym=function(n){return n},xm=function(n,t){return function(e){return"rtl"===wm(e)?t:n}},wm=function(n){return"rtl"===Vs(n,"direction")?"rtl":"ltr"};!function(n){n.TopToBottom="toptobottom",n.BottomToTop="bottomtotop"}(ol||(ol={}));var Sm,Cm="data-alloy-vertical-dir",km=function(n){return qf(n,function(n){return ic(n)&&fc(n,Cm)===ol.BottomToTop})},Om=function(){return Tr("layouts",[fr("onLtr"),fr("onRtl"),wr("onBottomLtr"),wr("onBottomRtl")])},_m=function(n,t,e,o,r,i,u){var a=u.map(km).getOr(!1),c=t.layouts.map(function(t){return t.onLtr(n)}),s=t.layouts.map(function(t){return t.onRtl(n)}),f=a?t.layouts.bind(function(t){return t.onBottomLtr.map(function(t){return t(n)})}).or(c).getOr(r):c.getOr(e),l=a?t.layouts.bind(function(t){return t.onBottomRtl.map(function(t){return t(n)})}).or(s).getOr(i):s.getOr(o),d=xm(f,l);return d(n)},Tm=function(n,t,e){var o=t.hotspot,r=jd(e,o.element()),i=_m(n.element(),t,sd(),fd(),ad(),cd(),St.some(t.hotspot.element()));return St.some(ym({anchorBox:r,bubble:t.bubble.getOr(bm()),overrides:t.overrides,layouts:i,placer:St.none()}))},Em=[fr("hotspot"),wr("bubble"),Br("overrides",{}),Om(),kl("placement",Tm)],Bm=function(n,t,e){var o=Wd(e,t.x,t.y),r=Lf(o.left(),o.top(),t.width,t.height),i=_m(n.element(),t,id(),ud(),id(),ud(),St.none());return St.some(ym({anchorBox:r,bubble:t.bubble,overrides:t.overrides,layouts:i,placer:St.none()}))},Dm=[fr("x"),fr("y"),Br("height",0),Br("width",0),Br("bubble",bm()),Br("overrides",{}),Om(),kl("placement",Bm)],Am="",Mm=" ",Fm=_a("start","soffset","finish","foffset"),Im={create:Fm},Rm=ke.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Vm=function(n,t,e,o){return n.fold(t,e,o)},Hm=function(n){return n.fold(lt,lt,lt)},Nm=Rm.before,Pm=Rm.on,zm=Rm.after,Lm={before:Nm,on:Pm,after:zm,cata:Vm,getStart:Hm},jm=ke.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Um=function(n){return jm.exact(n.start(),n.soffset(),n.finish(),n.foffset())},Wm=function(n){return n.match({domRange:function(n){return Xr.fromDom(n.startContainer)},relative:function(n){return Lm.getStart(n)},exact:function(n){return n}})},Gm=jm.domRange,Xm=jm.relative,Ym=jm.exact,qm=function(n){var t=Wm(n);return Ra(t)},Km=Im.create,Jm={domRange:Gm,relative:Xm,exact:Ym,exactFromRange:Um,getWin:qm,range:Km},$m=function(n,t){t.fold(function(t){n.setStartBefore(t.dom())},function(t,e){n.setStart(t.dom(),e)},function(t){n.setStartAfter(t.dom())})},Qm=function(n,t){t.fold(function(t){n.setEndBefore(t.dom())},function(t,e){n.setEnd(t.dom(),e)},function(t){n.setEndAfter(t.dom())})},Zm=function(n,t,e){var o=n.document.createRange();return $m(o,t),Qm(o,e),o},ng=function(n,t,e,o,r){var i=n.document.createRange();return i.setStart(t.dom(),e),i.setEnd(o.dom(),r),i},tg=function(n){return{left:ft(n.left),top:ft(n.top),right:ft(n.right),bottom:ft(n.bottom),width:ft(n.width),height:ft(n.height)}},eg=function(n){var t=n.getClientRects(),e=t.length>0?t[0]:n.getBoundingClientRect();return e.width>0||e.height>0?St.some(e).map(tg):St.none()},og=ke.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),rg=function(n,t,e){return t(Xr.fromDom(e.startContainer),e.startOffset,Xr.fromDom(e.endContainer),e.endOffset)},ig=function(n,t){return t.match({domRange:function(n){return{ltr:ft(n),rtl:St.none}},relative:function(t,e){return{ltr:Ae(function(){return Zm(n,t,e)}),rtl:Ae(function(){return St.some(Zm(n,e,t))})}},exact:function(t,e,o,r){return{ltr:Ae(function(){return ng(n,t,e,o,r)}),rtl:Ae(function(){return St.some(ng(n,o,r,t,e))})}}})},ug=function(n,t){var e=t.ltr();if(e.collapsed){var o=t.rtl().filter(function(n){return n.collapsed===!1});return o.map(function(n){return og.rtl(Xr.fromDom(n.endContainer),n.endOffset,Xr.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return rg(n,og.ltr,e)})}return rg(n,og.ltr,e)},ag=function(n,t){var e=ig(n,t);return ug(n,e)},cg=function(n,t){var e=ag(n,t);return e.match({ltr:function(t,e,o,r){var i=n.document.createRange();return i.setStart(t.dom(),e),i.setEnd(o.dom(),r),i},rtl:function(t,e,o,r){var i=n.document.createRange();return i.setStart(o.dom(),r),i.setEnd(t.dom(),e),i}})},sg=(og.ltr,og.rtl,u(uc,"text")),fg=function(n){return sg.get(n)},lg=function(n){return sg.getOption(n)},dg=function(n){return"img"===ec(n)?1:lg(n).fold(function(){return Pa(n).length},function(n){return n.length})},mg=function(n){return lg(n).filter(function(n){return 0!==n.trim().length||n.indexOf(Mm)>-1}).isSome()},gg=["img","br"],pg=function(n){var t=mg(n);return t||Lt(gg,ec(n))},hg=function(n){return vg(n,pg)},vg=function(n,t){var e=function(n){for(var o=Pa(n),r=o.length-1;r>=0;r--){var i=o[r];if(t(i))return St.some(i);var u=e(i);if(u.isSome())return u}return St.none()};return e(n)},bg=function(n,t){return $i(t,n)},yg=function(n,t,e,o){var r=Fa(n),i=r.dom().createRange();return i.setStart(n.dom(),t),i.setEnd(e.dom(),o),i},xg=function(n,t,e,o){var r=yg(n,t,e,o),i=Zi(n,e)&&t===o;return r.collapsed&&!i},wg=function(n){if(n.rangeCount>0){var t=n.getRangeAt(0),e=n.getRangeAt(n.rangeCount-1);return St.some(Im.create(Xr.fromDom(t.startContainer),t.startOffset,Xr.fromDom(e.endContainer),e.endOffset))}return St.none()},Sg=function(n){var t=Xr.fromDom(n.anchorNode),e=Xr.fromDom(n.focusNode);return xg(t,n.anchorOffset,e,n.focusOffset)?St.some(Im.create(t,n.anchorOffset,e,n.focusOffset)):wg(n)},Cg=function(n){return St.from(n.getSelection()).filter(function(n){return n.rangeCount>0}).bind(Sg)},kg=function(n,t){var e=cg(n,t);return eg(e)},Og=_a("element","offset"),_g=function(n,t){var e=Pa(n);if(0===e.length)return Og(n,t);if(tn&&(r=0,u=e+n),0>t&&(i=0,a=o+t);var c=Fg(lf(r,i));return St.some(Pf(c,u,a))},Ng=function(n,t,e,o,r){return n.map(function(n){var i=[t,n.point()],u=Gd(o,function(){return Mg(i)},function(){return Mg(i)},function(){return Ag(i)}),a=zf(u.left(),u.top(),n.width(),n.height()),c=e.showAbove?ad():sd(),s=(e.showAbove,fd()),f=_m(r,e,c,s,c,s,St.none());return ym({anchorBox:a,bubble:e.bubble.getOr(bm()),overrides:e.overrides,layouts:f,placer:St.none()})})},Pg={capRect:Hg,calcNewAnchor:Ng},zg=_a("element","offset"),Lg=function(n,t){return uc(n)?zg(n,t):_g(n,t)},jg=function(n,t){var e=t.getSelection.getOrThunk(function(){return function(){return Cg(n)}});return e().map(function(n){var t=Lg(n.start(),n.soffset()),e=Lg(n.finish(),n.foffset());return Jm.range(t.element(),t.offset(),e.element(),e.offset())})},Ug=function(n,t,e){var o=Ra(t.root).dom(),r=Vg(n,e,t),i=jg(o,t).bind(function(n){var t=kg(o,Jm.exactFromRange(n)).orThunk(function(){var t=Xr.fromText(Am);return Ua(n.start(),t),kg(o,Jm.exact(t,0,t,1)).map(function(n){return $a(t),n})});return t.bind(function(n){return Pg.capRect(n.left(),n.top(),n.width(),n.height())})}),u=jg(o,t).bind(function(n){return ic(n.start())?St.some(n.start()):Va(n.start())}),a=u.getOr(n.element());return Pg.calcNewAnchor(i,r,t,e,a)},Wg=[wr("getSelection"),fr("root"),wr("bubble"),Om(),Br("overrides",{}),Br("showAbove",!1),kl("placement",Ug)],Gg=function(n,t,e){var o=Vg(n,e,t);return t.node.bind(function(r){var i=r.dom().getBoundingClientRect(),u=Pg.capRect(i.left,i.top,i.width,i.height),a=t.node.getOr(n.element());return Pg.calcNewAnchor(u,o,t,e,a)})},Xg=[fr("node"),fr("root"),wr("bubble"),Om(),Br("overrides",{}),Br("showAbove",!1),kl("placement",Gg)],Yg=function(n){return n.x()+n.width()},qg=function(n,t){return n.x()-t.width()},Kg=function(n,t){return n.y()-t.height()+n.height()},Jg=function(n){return n.y()},$g=function(n,t,e){return Tl(Yg(n),Jg(n),e.southeast(),Ml(),Ll(n,{left:0,top:2}),"link-layout-se")},Qg=function(n,t,e){return Tl(qg(n,t),Jg(n),e.southwest(),Fl(),Ll(n,{right:1,top:2}),"link-layout-sw")},Zg=function(n,t,e){return Tl(Yg(n),Kg(n,t),e.northeast(),Il(),Ll(n,{left:0,bottom:3}),"link-layout-ne")},np=function(n,t,e){return Tl(qg(n,t),Kg(n,t),e.northwest(),Rl(),Ll(n,{right:1,bottom:3}),"link-layout-nw")},tp=function(){return[$g,Qg,Zg,np]},ep=function(){return[Qg,$g,np,Zg]},op=function(n,t,e){var o=jd(e,t.item.element()),r=_m(n.element(),t,tp(),ep(),tp(),ep(),St.none());return St.some(ym({anchorBox:o,bubble:bm(),overrides:t.overrides,layouts:r,placer:St.none()}))},rp=[fr("item"),Om(),Br("overrides",{}),kl("placement",op)],ip=nr("anchor",{selection:Wg,node:Xg,hotspot:Em,submenu:rp,makeshift:Dm}),up=function(){var t=n.document.documentElement;return Yd(0,0,t.clientWidth,t.clientHeight)},ap=function(n){var t=gf(n.element()),e=n.element().dom().getBoundingClientRect();return Xd(t.left(),t.top(),e.width,e.height)},cp=function(n,t,e,o,r){var i=Kd(e.anchorBox,t);gm(i,r.element(),e.bubble,e.layouts,o,e.overrides)},sp=function(n,t,e,o,r){fp(n,t,e,o,r,St.none())},fp=function(n,t,e,o,r,i){var u=i.map(jf);return lp(n,t,e,o,r,u)},lp=function(n,t,e,o,r,i){var u=$o("positioning anchor.info",ip,o);Vd(function(){Fs(r.element(),"position","fixed");var e=Ns(r.element(),"visibility");Fs(r.element(),"visibility","hidden");var o=t.useFixed()?up():ap(n),a=u.placement,c=i.map(ft).or(t.getBounds);a(n,u,o).each(function(t){var e=t.placer.getOr(cp);e(n,o,t,c,r)}),e.fold(function(){Ls(r.element(),"visibility")},function(n){Fs(r.element(),"visibility",n)}),Ns(r.element(),"left").isNone()&&Ns(r.element(),"top").isNone()&&Ns(r.element(),"right").isNone()&&Ns(r.element(),"bottom").isNone()&&Ns(r.element(),"position").is("fixed")&&Ls(r.element(),"position")},r.element())},dp=function(n,t){return t.useFixed()?"fixed":"absolute"},mp=Object.freeze({__proto__:null,position:sp,positionWithin:fp,positionWithinBounds:lp,getMode:dp}),gp=[Br("useFixed",gt),wr("getBounds")],pp=xd({fields:gp,name:"positioning",active:Dd,apis:mp}),hp=function(n){ea(n,Yu());var t=n.components();Xt(t,hp)},vp=function(n){var t=n.components();Xt(t,vp),ea(n,Xu())},bp=function(n,t){Xa(n.element(),t.element())},yp=function(n){Xt(n.components(),function(n){return $a(n.element())}),Ja(n.element()),n.syncComponents()},xp=function(n,t){var e=n.components();yp(n);var o=re(e,t);Xt(o,function(t){hp(t),n.getSystem().removeFromWorld(t)}),Xt(t,function(t){t.getSystem().isConnected()?bp(n,t):(n.getSystem().addToWorld(t),bp(n,t),Es(n.element())&&vp(t)),n.syncComponents()})},wp=function(n,t){Sp(n,t,Xa)},Sp=function(n,t,e){n.getSystem().addToWorld(t),e(n.element(),t.element()),Es(n.element())&&vp(t),n.syncComponents()},Cp=function(n){hp(n),$a(n.element()),n.getSystem().removeFromWorld(n)},kp=function(n){var t=Va(n.element()).bind(function(t){return n.getSystem().getByDom(t).toOption()});Cp(n),t.each(function(n){n.syncComponents()})},Op=function(n){var t=n.components();Xt(t,Cp),Ja(n.element()),n.syncComponents()},_p=function(n,t){Ep(n,t,Xa)},Tp=function(n,t){Ep(n,t,Wa)},Ep=function(n,t,e){e(n,t.element());var o=Pa(t.element());Xt(o,function(n){t.getByDom(n).each(vp)})},Bp=function(n){var t=Pa(n.element());Xt(t,function(t){n.getByDom(t).each(hp)}),$a(n.element())},Dp=function(n,t,e,o){e.get().each(function(){Op(n)});var r=t.getAttachPoint(n);wp(r,n);var i=n.getSystem().build(o);return wp(n,i),e.set(i),i},Ap=function(n,t,e,o){var r=Dp(n,t,e,o);return t.onOpen(n,r),r},Mp=function(n,t,e,o){return e.get().map(function(){return Dp(n,t,e,o)})},Fp=function(n,t,e,o,r){zp(n,t),Ap(n,t,e,o),r(),jp(n,t)},Ip=function(n,t,e){e.get().each(function(o){Op(n),kp(n),t.onClose(n,o),e.clear()})},Rp=function(n,t,e){return e.isOpen()},Vp=function(n,t,e,o){return Rp(n,t,e)&&e.get().exists(function(e){return t.isPartOf(n,e,o)})},Hp=function(n,t,e){return e.get()},Np=function(n,t,e,o){Ns(n.element(),t).fold(function(){mc(n.element(),e)},function(t){cc(n.element(),e,t)}),Fs(n.element(),t,o)},Pp=function(n,t,e){if(dc(n.element(),e)){var o=fc(n.element(),e);Fs(n.element(),t,o)}else Ls(n.element(),t)},zp=function(n,t){var e=t.getAttachPoint(n);Fs(n.element(),"position",pp.getMode(e)),Np(n,"visibility",t.cloakVisibilityAttr,"hidden")},Lp=function(n){return jt(["top","left","right","bottom"],function(t){return Ns(n,t).isSome()})},jp=function(n,t){Lp(n.element())||Ls(n.element(),"position"),Pp(n,"visibility",t.cloakVisibilityAttr)},Up=Object.freeze({__proto__:null,cloak:zp,decloak:jp,open:Ap,openWhileCloaked:Fp,close:Ip,isOpen:Rp,isPartOf:Vp,getState:Hp,setContent:Mp}),Wp=function(n,t){return ca([da(Pu(),function(e){Ip(e,n,t)})])},Gp=Object.freeze({__proto__:null,events:Wp}),Xp=[xl("onOpen"),xl("onClose"),fr("isPartOf"),fr("getAttachPoint"),Br("cloakVisibilityAttr","data-precloak-visibility")],Yp=function(){var n=zr(St.none()),t=ft("not-implemented"),e=function(){return n.get().isSome()},o=function(t){n.set(St.some(t))},r=function(){return n.get()},i=function(){n.set(St.none())};return Uc({readState:t,isOpen:e,clear:i,set:o,get:r})},qp=Object.freeze({__proto__:null,init:Yp}),Kp=xd({fields:Xp,name:"sandboxing",active:Gp,apis:Up,state:qp}),Jp=ft("dismiss.popups"),$p=ft("reposition.popups"),Qp=ft("mouse.released"),Zp=Ao([Br("isExtraPart",ft(!1)),Tr("fireEventInstead",[Br("event",qu())])]),nh=function(n){var t,e=$o("Dismissal",Zp,n);return t={},t[Jp()]={schema:Ao([fr("target")]),onReceive:function(n,t){if(Kp.isOpen(n)){var o=Kp.isPartOf(n,t.target)||e.isExtraPart(n,t.target);o||e.fireEventInstead.fold(function(){return Kp.close(n)},function(t){return ea(n,t.event)})}}},t},th=Ao([Tr("fireEventInstead",[Br("event",Ku())]),hr("doReposition")]),eh=function(n){var t,e=$o("Reposition",th,n);return t={},t[$p()]={onReceive:function(n){Kp.isOpen(n)&&e.fireEventInstead.fold(function(){return e.doReposition(n)},function(t){return ea(n,t.event)})}},t},oh=function(n,t,e){t.store.manager.onLoad(n,t,e)},rh=function(n,t,e){t.store.manager.onUnload(n,t,e)},ih=function(n,t,e,o){t.store.manager.setValue(n,t,e,o)},uh=function(n,t,e){return t.store.manager.getValue(n,t,e)},ah=function(n,t,e){return e},ch=Object.freeze({__proto__:null,onLoad:oh,onUnload:rh,setValue:ih,getValue:uh,getState:ah}),sh=function(n,t){var e=n.resetOnDom?[Sa(function(e){oh(e,n,t)}),Ca(function(e){rh(e,n,t)})]:[dd(n,t,oh)];return ca(e)},fh=Object.freeze({__proto__:null,events:sh}),lh=function(){var n=zr(null),t=function(){return{mode:"memory",value:n.get()}},e=function(){return null===n.get()},o=function(){n.set(null)};return Uc({set:n.set,get:n.get,isNotSet:e,clear:o,readState:t})},dh=function(){var n=function(){};return Uc({readState:n})},mh=function(){var n=zr({}),t=zr({}),e=function(){return{mode:"dataset",dataByValue:n.get(),dataByText:t.get()}},o=function(){n.set({}),t.set({})},r=function(e){return xe(n.get(),e).orThunk(function(){return xe(t.get(),e)})},i=function(e){var o=n.get(),r=t.get(),i={},u={};Xt(e,function(n){i[n.value]=n,xe(n,"meta").each(function(t){xe(t,"text").each(function(t){u[t]=n})})}),n.set(vt(vt({},o),i)),t.set(vt(vt({},r),u))};return Uc({readState:e,lookup:r,update:i,clear:o})},gh=function(n){return n.store.manager.state(n)},ph=Object.freeze({__proto__:null,memory:lh,dataset:mh,manual:dh,init:gh}),hh=function(n,t,e,o){var r=t.store;e.update([o]),r.setValue(n,o),t.onSetValue(n,o)},vh=function(n,t,e){var o=t.store,r=o.getDataKey(n);return e.lookup(r).fold(function(){return o.getFallbackEntry(r)},function(n){return n})},bh=function(n,t,e){var o=t.store;o.initialValue.each(function(o){hh(n,t,e,o)})},yh=function(n,t,e){e.clear()},xh=[wr("initialValue"),fr("getFallbackEntry"),fr("getDataKey"),fr("setValue"),kl("manager",{setValue:hh,getValue:vh,onLoad:bh,onUnload:yh,state:mh})],wh=function(n,t){return t.store.getValue(n)},Sh=function(n,t,e,o){t.store.setValue(n,o),t.onSetValue(n,o)},Ch=function(n,t){t.store.initialValue.each(function(e){t.store.setValue(n,e)})},kh=[fr("getValue"),Br("setValue",at),wr("initialValue"),kl("manager",{setValue:Sh,getValue:wh,onLoad:Ch,onUnload:at,state:jc.init})],Oh=function(n,t,e,o){e.set(o),t.onSetValue(n,o)},_h=function(n,t,e){return e.get()},Th=function(n,t,e){t.store.initialValue.each(function(n){e.isNotSet()&&e.set(n)})},Eh=function(n,t,e){e.clear()},Bh=[wr("initialValue"),kl("manager",{setValue:Oh,getValue:_h,onLoad:Th,onUnload:Eh,state:lh})],Dh=[Dr("store",{mode:"memory"},nr("mode",{memory:Bh,manual:kh,dataset:xh})),xl("onSetValue"),Br("resetOnDom",!1)],Ah=xd({fields:Dh,name:"representing",active:fh,apis:ch,extra:{setValueFrom:function(n,t){var e=Ah.getValue(t);Ah.setValue(n,e)}},state:ph}),Mh=function(n,t){return Nr(n,{},Gt(t,function(t){return vr(t.name(),"Cannot configure "+t.name()+" for "+n)}).concat([Pr("dump",lt)]))},Fh=function(n){return n.dump},Ih=function(n,t){return vt(vt({},n.dump),bd(t))},Rh={field:Mh,augment:Ih,get:Fh},Vh="placeholder",Hh=ke.generate([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Nh=function(n){return we(n,"uiType")},Ph=function(n,t,e,o){return n.exists(function(n){return n!==e.owner})?Hh.single(!0,ft(e)):xe(o,e.name).fold(function(){throw new Error("Unknown placeholder component: "+e.name+"\nKnown: ["+de(o)+"]\nNamespace: "+n.getOr("none")+"\nSpec: "+JSON.stringify(e,null,2))},function(n){return n.replace()})},zh=function(n,t,e,o){return Nh(e)&&e.uiType===Vh?Ph(n,t,e,o):Hh.single(!1,ft(e))},Lh=function(n,t,e,o){var r=zh(n,t,e,o);return r.fold(function(r,i){var u=Nh(e)?i(t,e.config,e.validated):i(t),a=xe(u,"components").getOr([]),c=te(a,function(e){return Lh(n,t,e,o)});return[vt(vt({},u),{components:c})]},function(n,o){if(Nh(e)){var r=o(t,e.config,e.validated),i=e.validated.preprocess.getOr(lt);return i(r)}return o(t)})},jh=function(n,t,e,o){return te(e,function(e){return Lh(n,t,e,o)})},Uh=function(n,t){var e=!1,o=function(){return e},r=function(){if(e)throw new Error("Trying to use the same placeholder more than once: "+n);return e=!0,t},i=function(){return t.fold(function(n){return n},function(n){return n})};return{name:ft(n),required:i,used:o,replace:r}},Wh=function(n,t,e,o){var r=pe(o,function(n,t){return Uh(t,n)}),i=jh(n,t,e,r);return ge(r,function(e){if(e.used()===!1&&e.required())throw new Error("Placeholder: "+e.name()+" was not found in components list\nNamespace: "+n.getOr("none")+"\nComponents: "+JSON.stringify(t.components,null,2))}),i},Gh=Hh.single,Xh=Hh.multiple,Yh=ft(Vh),qh=ke.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Kh=Br("factory",{sketch:lt}),Jh=Br("schema",[]),$h=fr("name"),Qh=Po("pname","pname",Ke(function(n){return""}),tr()),Zh=Pr("schema",function(){return[wr("preprocess")]}),nv=Br("defaults",ft({})),tv=Br("overrides",ft({})),ev=Mo([Kh,Jh,$h,Qh,nv,tv]),ov=Mo([Kh,Jh,$h,nv,tv]),rv=Mo([Kh,Jh,$h,Qh,nv,tv]),iv=Mo([Kh,Zh,$h,fr("unit"),Qh,nv,tv]),uv=function(n){return n.fold(St.some,St.none,St.some,St.some)},av=function(n){var t=function(n){return n.name};return n.fold(t,t,t,t)},cv=function(n){return n.fold(lt,lt,lt,lt)},sv=function(n,t){return function(e){var o=$o("Converting part type",t,e);return n(o)}},fv=sv(qh.required,ev),lv=sv(qh.external,ov),dv=sv(qh.optional,rv),mv=sv(qh.group,iv),gv=ft("entirety"),pv=Object.freeze({__proto__:null,required:fv,external:lv,optional:dv,group:mv,asNamedPart:uv,name:av,asCommon:cv,original:gv}),hv=function(n,t,e,o){return Be(t.defaults(n,e,o),e,{uid:n.partUids[t.name]},t.overrides(n,e,o))},vv=function(n,t,e){var o={},r={};return Xt(e,function(n){n.fold(function(n){o[n.pname]=Gh(!0,function(t,e,o){return n.factory.sketch(hv(t,n,e,o))})},function(n){var e=t.parts[n.name];r[n.name]=ft(n.factory.sketch(hv(t,n,e[gv()]),e))},function(n){o[n.pname]=Gh(!1,function(t,e,o){return n.factory.sketch(hv(t,n,e,o))})},function(n){o[n.pname]=Xh(!0,function(t,e,o){var r=t[n.name];return Gt(r,function(e){return n.factory.sketch(Be(n.defaults(t,e,o),e,n.overrides(t,e)))})})})}),{internals:ft(o),externals:ft(r)}},bv=function(n,t){var e={};return Xt(t,function(t){uv(t).each(function(t){var o=yv(n,t.pname);e[t.name]=function(e){var r=$o("Part: "+t.name+" in "+n,Mo(t.schema),e);return vt(vt({},o),{config:e,validated:r})}})}),e},yv=function(n,t){return{uiType:Yh(),owner:n,name:t} },xv=function(n,t,e){return{uiType:Yh(),owner:n,name:t,config:e,validated:{}}},wv=function(n){return te(n,function(n){return n.fold(St.none,St.some,St.none,St.none).map(function(n){return br(n.name,n.schema.concat([Ol(gv())]))}).toArray()})},Sv=function(n){return Gt(n,av)},Cv=function(n,t,e){return vv(n,t,e)},kv=function(n,t,e){return Wh(St.some(n),t,t.components,e)},Ov=function(n,t,e){var o=t.partUids[e];return n.getSystem().getByUid(o).toOption()},_v=function(n,t,e){return Ov(n,t,e).getOrDie("Could not find part: "+e)},Tv=function(n,t,e){var o={},r=t.partUids,i=n.getSystem();return Xt(e,function(n){o[n]=ft(i.getByUid(r[n]))}),o},Ev=function(n,t){var e=n.getSystem();return pe(t.partUids,function(n){return ft(e.getByUid(n))})},Bv=function(n){return de(n.partUids)},Dv=function(n,t,e){var o={},r=t.partUids,i=n.getSystem();return Xt(e,function(n){o[n]=ft(i.getByUid(r[n]).getOrDie())}),o},Av=function(n,t){var e=Sv(t);return oo(Gt(e,function(t){return{key:t,value:n+"-"+t}}))},Mv=function(n){return Po("partUids","partUids",Je(function(t){return Av(t.uid,n)}),tr())},Fv=Object.freeze({__proto__:null,generate:bv,generateOne:xv,schemas:wv,names:Sv,substitutes:Cv,components:kv,defaultUids:Av,defaultUidsSchema:Mv,getAllParts:Ev,getAllPartNames:Bv,getPart:Ov,getPartOrDie:_v,getParts:Tv,getPartsOrDie:Dv}),Iv=function(n,t){var e=n.length>0?[br("parts",n)]:[];return e.concat([fr("uid"),Br("dom",{}),Br("components",[]),Ol("originalSpec"),Br("debug.sketcher",{})]).concat(t)},Rv=function(n,t,e,o,r){var i=Iv(o,r);return $o(n+" [SpecSchema]",Ao(i.concat(t)),e)},Vv=function(n,t,e,o){var r=Pv(o),i=Rv(n,t,r,[],[]);return e(i,r)},Hv=function(n,t,e,o,r){var i=Pv(r),u=wv(e),a=Mv(e),c=Rv(n,t,i,u,[a]),s=Cv(n,c,e),f=kv(n,c,s.internals());return o(c,f,i,s.externals())},Nv=function(n){return we(n,"uid")},Pv=function(n){return Nv(n)?n:vt(vt({},n),{uid:Dc("uid")})},zv=Ao([fr("name"),fr("factory"),fr("configFields"),Br("apis",{}),Br("extraApis",{})]),Lv=Ao([fr("name"),fr("factory"),fr("configFields"),fr("partFields"),Br("apis",{}),Br("extraApis",{})]),jv=function(n){var t=$o("Sketcher for "+n.name,zv,n),e=function(n){return Vv(t.name,t.configFields,t.factory,n)},o=pe(t.apis,Lc),r=pe(t.extraApis,function(n,t){return Vc(n,t)});return vt(vt({name:ft(t.name),configFields:ft(t.configFields),sketch:e},o),r)},Uv=function(n){var t=$o("Sketcher for "+n.name,Lv,n),e=function(n){return Hv(t.name,t.configFields,t.partFields,t.factory,n)},o=bv(t.name,t.partFields),r=pe(t.apis,Lc),i=pe(t.extraApis,function(n,t){return Vc(n,t)});return vt(vt({name:ft(t.name),partFields:ft(t.partFields),configFields:ft(t.configFields),sketch:e,parts:ft(o)},r),i)},Wv=function(n){for(var t=[],e=function(n){t.push(n)},o=0;o0?St.some(e[e.length-1]):St.none();return o.bind(function(t){return n.getSystem().getByDom(t).toOption()})},db=function(n,t,e,o){var r=bg(n.element(),"."+t.itemClass),i=Zt(r,function(n){return ks(n,t.highlightClass)});return i.bind(function(t){var e=Jd(t,o,0,r.length-1);return n.getSystem().getByDom(r[e]).toOption()})},mb=function(n,t,e){return db(n,t,e,-1)},gb=function(n,t,e){return db(n,t,e,1)},pb=function(n,t){var e=bg(n.element(),"."+t.itemClass);return Wv(Gt(e,function(t){return n.getSystem().getByDom(t).toOption()}))},hb=Object.freeze({__proto__:null,dehighlightAll:nb,dehighlight:tb,highlight:eb,highlightFirst:ob,highlightLast:rb,highlightAt:ib,highlightBy:ub,isHighlighted:ab,getHighlighted:cb,getFirst:fb,getLast:lb,getPrevious:mb,getNext:gb,getCandidates:pb}),vb=[fr("highlightClass"),fr("itemClass"),xl("onHighlight"),xl("onDehighlight")],bb=xd({fields:vb,name:"highlighting",apis:hb}),yb=function(){return[8]},xb=function(){return[9]},wb=function(){return[13]},Sb=function(){return[27]},Cb=function(){return[32]},kb=function(){return[37]},Ob=function(){return[38]},_b=function(){return[39]},Tb=function(){return[40]},Eb=function(n,t,e){var o=oe(n.slice(0,t)),r=oe(n.slice(t+1));return Qt(o.concat(r),e)},Bb=function(n,t,e){var o=oe(n.slice(0,t));return Qt(o,e)},Db=function(n,t,e){var o=n.slice(0,t),r=n.slice(t+1);return Qt(r.concat(o),e)},Ab=function(n,t,e){var o=n.slice(t+1);return Qt(o,e)},Mb=function(n){return function(t){var e=t.raw();return Lt(n,e.which)}},Fb=function(n){return function(t){return ee(n,function(n){return n(t)})}},Ib=function(n){var t=n.raw();return t.shiftKey===!0},Rb=function(n){var t=n.raw();return t.ctrlKey===!0},Vb=dt(Ib),Hb=function(n,t){return{matches:n,classification:t}},Nb=function(n,t){var e=Qt(n,function(n){return n.matches(t)});return e.map(function(n){return n.classification})},Pb=function(n,t,e){var o=t.exists(function(n){return e.exists(function(t){return Zi(t,n)})});o||oa(n,Ju(),{prevFocus:t,newFocus:e})},zb=function(){var n=function(n){return Rd(n.element())},t=function(t,e){var o=n(t);t.getSystem().triggerFocus(e,t.element());var r=n(t);Pb(t,o,r)};return{get:n,set:t}},Lb=function(){var n=function(n){return bb.getHighlighted(n).map(function(n){return n.element()})},t=function(t,e){var o=n(t);t.getSystem().getByDom(e).fold(at,function(n){bb.highlight(t,n)});var r=n(t);Pb(t,o,r)};return{get:n,set:t}};!function(n){n.OnFocusMode="onFocus",n.OnEnterOrSpaceMode="onEnterOrSpace",n.OnApiMode="onApi"}(Sm||(Sm={}));var jb,Ub=function(n,t,e,o,r){var i=function(){return n.concat([Br("focusManager",zb()),Dr("focusInside","onFocus",Xo(function(n){return Lt(["onFocus","onEnterOrSpace","onApi"],n)?_t.value(n):_t.error("Invalid value for focusInside")})),kl("handler",c),kl("state",t),kl("sendFocusIn",r)])},u=function(n,t,e,o,r){var i=e(n,t,o,r);return Nb(i,t.event()).bind(function(e){return e(n,t,o,r)})},a=function(n,t){var i=n.focusInside!==Sm.OnFocusMode?St.none():r(n).map(function(e){return da(Au(),function(o,r){e(o,n,t),r.stop()})}),a=function(e,o){var i=Mb(Cb().concat(wb()))(o.event());n.focusInside===Sm.OnEnterOrSpaceMode&&i&&uu(e,o)&&r(n).each(function(r){r(e,n,t),o.stop()})};return ca(i.toArray().concat([da(Cu(),function(o,r){u(o,r,e,n,t).fold(function(){a(o,r)},function(){r.stop()})}),da(ku(),function(e,r){u(e,r,o,n,t).each(function(){r.stop()})})]))},c={schema:i,processKey:u,toEvents:a};return c},Wb=function(n){var e=[wr("onEscape"),wr("onEnter"),Br("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Br("firstTabstop",0),Br("useTabstopAt",ft(!0)),wr("visibilitySelector")].concat([n]),o=function(n,t){var e=n.visibilitySelector.bind(function(n){return $f(t,n)}).getOr(t);return af(e)>0},r=function(n,t){var e=bg(n.element(),t.selector),r=Kt(e,function(n){return o(t,n)});return St.from(r[t.firstTabstop])},i=function(n,t){return t.focusManager.get(n).bind(function(n){return $f(n,t.selector)})},u=function(n,t){return o(n,t)&&n.useTabstopAt(t)},a=function(n,t){r(n,t).each(function(e){t.focusManager.set(n,e)})},c=function(n,t,e,o,r){return r(t,e,function(n){return u(o,n)}).fold(function(){return o.cyclic?St.some(!0):St.none()},function(t){return o.focusManager.set(n,t),St.some(!0)})},s=function(n,e,o,r){var u=bg(n.element(),o.selector);return i(n,o).bind(function(e){var i=Zt(u,t(Zi,e));return i.bind(function(t){return c(n,u,t,o,r)})})},f=function(n,t,e){var o=e.cyclic?Eb:Bb;return s(n,t,e,o)},l=function(n,t,e){var o=e.cyclic?Db:Ab;return s(n,t,e,o)},d=function(n,t,e){return e.onEnter.bind(function(e){return e(n,t)})},m=function(n,t,e){return e.onEscape.bind(function(e){return e(n,t)})},g=ft([Hb(Fb([Ib,Mb(xb())]),f),Hb(Mb(xb()),l),Hb(Mb(Sb()),m),Hb(Fb([Vb,Mb(wb())]),d)]),p=ft([]);return Ub(e,jc.init,g,p,function(){return St.some(a)})},Gb=Wb(Pr("cyclic",ft(!1))),Xb=Wb(Pr("cyclic",ft(!0))),Yb=function(n,t,e){return ia(n,e,Ru()),St.some(!0)},qb=function(n,t,e){return qv(e)&&Mb(Cb())(t.event())?St.none():Yb(n,t,e)},Kb=function(){return St.some(!0)},Jb=[Br("execute",qb),Br("useSpace",!1),Br("useEnter",!0),Br("useControlEnter",!1),Br("useDown",!1)],$b=function(n,t,e){return e.execute(n,t,n.element())},Qb=function(n,t,e){var o=e.useSpace&&!qv(n.element())?Cb():[],r=e.useEnter?wb():[],i=e.useDown?Tb():[],u=o.concat(r).concat(i);return[Hb(Mb(u),$b)].concat(e.useControlEnter?[Hb(Fb([Rb,Mb(wb())]),$b)]:[])},Zb=function(n,t,e){return e.useSpace&&!qv(n.element())?[Hb(Mb(Cb()),Kb)]:[]},ny=Ub(Jb,jc.init,Qb,Zb,function(){return St.none()}),ty=function(){var n=zr(St.none()),t=function(t,e){n.set(St.some({numRows:ft(t),numColumns:ft(e)}))},e=function(){return n.get().map(function(n){return n.numRows()})},o=function(){return n.get().map(function(n){return n.numColumns()})};return Uc({readState:function(){return n.get().map(function(n){return{numRows:String(n.numRows()),numColumns:String(n.numColumns())}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:t,getNumRows:e,getNumColumns:o})},ey=function(n){return n.state(n)},oy=Object.freeze({__proto__:null,flatgrid:ty,init:ey}),ry=function(n){return function(t,e,o,r){var i=n(t.element());return cy(i,t,e,o,r)}},iy=function(n,t){var e=xm(n,t);return ry(e)},uy=function(n,t){var e=xm(t,n);return ry(e)},ay=function(n){return function(t,e,o,r){return cy(n,t,e,o,r)}},cy=function(n,t,e,o,r){var i=o.focusManager.get(t).bind(function(e){return n(t.element(),e,o,r)});return i.map(function(n){return o.focusManager.set(t,n),!0})},sy=ay,fy=ay,ly=ay,dy=function(n){return n.offsetWidth<=0&&n.offsetHeight<=0},my=function(n){var t=n.dom();return!dy(t)},gy=function(n,t){return Zt(n,t).map(function(t){return{index:ft(t),candidates:ft(n)}})},py=function(n,t,e){var o=function(n){return Zi(n,t)},r=bg(n,e),i=Kt(r,my);return gy(i,o)},hy=function(n,t){return Zt(n,function(n){return Zi(t,n)})},vy=function(n,t,e,o){var r=Math.floor(t/e),i=t%e;return o(r,i).bind(function(t){var o=t.row()*e+t.column();return o>=0&&o1?St.some(n.slice(1)):St.none()})},g=function(n){return xe(e.get(),n)},p=function(n){return h(n).bind(cS)},h=function(n){return xe(t.get(),n)},v=function(t){return xe(n.get(),t)},b=function(n){var t=r.get();return re(de(t),n)},y=function(){return o.get().bind(p)},x=function(){return t.get()};return{setMenuBuilt:a,setContents:c,expand:d,refresh:g,collapse:m,lookupMenu:h,lookupItem:v,otherMenus:b,getPrimary:y,getMenus:x,clear:i,isClear:u,getTriggeringPath:l}},cS=function(n){return"prepared"===n.type?St.some(n.menu):St.none()},sS={init:aS,extractPreparedMenu:cS},fS=function(n){var t,e=zr(St.none()),o=function(t,e,o){return pe(o,function(o,r){var i=function(){return oS.sketch(vt(vt({dom:o.dom},o),{value:r,items:o.items,markers:n.markers,fakeFocus:n.fakeFocus,onHighlight:n.onHighlight,focusManager:n.fakeFocus?Lb():zb()}))};return r===e?{type:"prepared",menu:t.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}})},r=sS.init(),i=function(t){var e=o(t,n.data.primary,n.data.menus),i=c();return r.setContents(n.data.primary,e,n.data.expansions,i),r.getPrimary()},u=function(n){return Ah.getValue(n).value},a=function(n,t,e){return le(t,function(n){if(!n.getSystem().isConnected())return St.none();var t=bb.getCandidates(n);return Qt(t,function(n){return u(n)===e})})},c=function(){return pe(n.data.menus,function(n){return te(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})},s=function(n,t){bb.highlight(n,t),bb.getHighlighted(t).orThunk(function(){return bb.getFirst(t)}).each(function(t){ia(n,t.element(),Vu())})},f=function(n,t){return Wv(Gt(t,function(t){return n.lookupMenu(t).bind(function(n){return"prepared"===n.type?St.some(n.menu):St.none()})}))},l=function(t,e,o){var r=f(e,e.otherMenus(o));Xt(r,function(e){_s(e.element(),[n.markers.backgroundMenu]),n.stayInDom||ew.remove(t,e)})},d=function(t){return e.get().getOrThunk(function(){var o={},r=bg(t.element(),"."+n.markers.item),i=Kt(r,function(n){return"true"===fc(n,"aria-haspopup")});return Xt(i,function(n){t.getSystem().getByDom(n).each(function(n){var t=u(n);o[t]=n})}),e.set(St.some(o)),o})},m=function(n,t){var e=d(n);ge(e,function(n,e){var o=Lt(t,e);cc(n.element(),"aria-expanded",o)})},g=function(t,e,o){return St.from(o[0]).bind(function(r){return e.lookupMenu(r).bind(function(r){if("notbuilt"===r.type)return St.none();var i=r.menu,u=f(e,o.slice(1));return Xt(u,function(t){ws(t.element(),n.markers.backgroundMenu)}),Es(i.element())||ew.append(t,rf(i)),_s(i.element(),[n.markers.backgroundMenu]),s(t,i),l(t,e,o),St.some(i)})})};!function(n){n[n.HighlightSubmenu=0]="HighlightSubmenu",n[n.HighlightParent=1]="HighlightParent"}(t||(t={}));var p=function(n,t,e){if("notbuilt"===e.type){var o=n.getSystem().build(e.nbMenu());return r.setMenuBuilt(t,o),o}return e.menu},h=function(e,o,i){void 0===i&&(i=t.HighlightSubmenu);var a=u(o);return r.expand(a).bind(function(u){return m(e,u),St.from(u[0]).bind(function(a){return r.lookupMenu(a).bind(function(c){var s=p(e,a,c);return Es(s.element())||ew.append(e,rf(s)),n.onOpenSubmenu(e,o,s,oe(u)),i===t.HighlightSubmenu?(bb.highlightFirst(s),g(e,r,u)):(bb.dehighlightAll(s),St.some(o))})})})},v=function(t,e){var o=u(e);return r.collapse(o).bind(function(o){return m(t,o),g(t,r,o).map(function(o){return n.onCollapseMenu(t,e,o),o})})},b=function(n,t){var e=u(t);return r.refresh(e).bind(function(t){return m(n,t),g(n,r,t)})},y=function(n,e){return qv(e.element())?St.none():h(n,e,t.HighlightSubmenu)},x=function(n,t){return qv(t.element())?St.none():v(n,t)},w=function(t,e){return v(t,e).orThunk(function(){return n.onEscape(t,e).map(function(){return t})})},S=function(t){return function(e,o){return $f(o.getSource(),"."+n.markers.item).bind(function(n){return e.getSystem().getByDom(n).toOption().bind(function(n){return t(e,n).map(function(){return!0})})})}},C=ca([da(tS(),function(n,t){var e=t.event().item();r.lookupItem(u(e)).each(function(){var e=t.event().menu();bb.highlight(n,e);var o=u(t.event().item());r.refresh(o).each(function(t){return l(n,r,t)})})}),Oa(function(e,o){var r=o.event().target();e.getSystem().getByDom(r).each(function(o){var r=u(o);0===r.indexOf("collapse-item")&&v(e,o),h(e,o,t.HighlightSubmenu).fold(function(){n.onExecute(e,o)},function(){})})}),Sa(function(t){i(t).each(function(e){ew.append(t,rf(e)),n.onOpenMenu(t,e),n.highlightImmediately&&s(t,e)})})].concat(n.navigateOnHover?[da(Pw(),function(e,o){var r=o.event().item();b(e,r),h(e,r,t.HighlightParent),n.onHover(e,r)})]:[])),k=function(n){return bb.getHighlighted(n).bind(bb.getHighlighted)},O=function(n){k(n).each(function(t){v(n,t)})},_=function(n){r.getPrimary().each(function(t){s(n,t)})},T=function(n){return St.from(n.components()[0]).filter(function(n){return"menu"===fc(n.element(),"role")})},E=function(t){var e=r.getPrimary().bind(function(n){return k(t).bind(function(n){var e=u(n),o=ye(r.getMenus()),i=Wv(Gt(o,sS.extractPreparedMenu));return r.getTriggeringPath(e,function(n){return a(t,i,n)})}).map(function(t){return{primary:n,triggeringPath:t} })});e.fold(function(){T(t).each(function(e){n.onRepositionMenu(t,e,[])})},function(e){var o=e.primary,r=e.triggeringPath;n.onRepositionMenu(t,o,r)})},B={collapseMenu:O,highlightPrimary:_,repositionMenus:E};return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:Ih(n.tmenuBehaviours,[Xx.config({mode:"special",onRight:S(y),onLeft:S(x),onEscape:S(w),focusIn:function(n){r.getPrimary().each(function(t){ia(n,t.element(),Vu())})}}),bb.config({highlightClass:n.markers.selectedMenu,itemClass:n.markers.menu}),Qv.config({find:function(n){return bb.getHighlighted(n)}}),ew.config({})]),eventOrder:n.eventOrder,apis:B,events:C}},lS=ft("collapse-item"),dS=function(n,t,e){return{primary:n,menus:t,expansions:e}},mS=function(n,t){return{primary:n,menus:eo(n,t),expansions:{}}},gS=function(n){return{value:Sc(lS()),meta:{text:n}}},pS=jv({name:"TieredMenu",configFields:[Cl("onExecute"),Cl("onEscape"),Sl("onOpenMenu"),Sl("onOpenSubmenu"),xl("onRepositionMenu"),xl("onCollapseMenu"),Br("highlightImmediately",!0),br("data",[fr("primary"),fr("menus"),fr("expansions")]),Br("fakeFocus",!1),xl("onHighlight"),xl("onHover"),vl(),fr("dom"),Br("navigateOnHover",!0),Br("stayInDom",!1),Mh("tmenuBehaviours",[Xx,bb,Qv,ew]),Br("eventOrder",{})],apis:{collapseMenu:function(n,t){n.collapseMenu(t)},highlightPrimary:function(n,t){n.highlightPrimary(t)},repositionMenus:function(n,t){n.repositionMenus(t)}},factory:fS,extraApis:{tieredData:dS,singleData:mS,collapseItem:gS}}),hS=function(n,t,e,o,r){var i=function(){return n.lazySink(t)},u="horizontal"===o.type?{layouts:{onLtr:function(){return sd()},onRtl:function(){return fd()}}}:{},a=function(n){return 2===n.length},c=function(n){return a(n)?u:{}};return pS.sketch({dom:{tag:"div"},data:o.data,markers:o.menu.markers,highlightImmediately:o.menu.highlightImmediately,onEscape:function(){return Kp.close(t),n.onEscape.map(function(n){return n(t)}),St.some(!0)},onExecute:function(){return St.some(!0)},onOpenMenu:function(n,t){pp.positionWithinBounds(i().getOrDie(),e,t,r())},onOpenSubmenu:function(n,t,e,o){var r=i().getOrDie();pp.position(r,vt({anchor:"submenu",item:t},c(o)),e)},onRepositionMenu:function(n,t,o){var u=i().getOrDie();pp.positionWithinBounds(u,e,t,r()),Xt(o,function(n){var t=c(n.triggeringPath);pp.position(u,vt({anchor:"submenu",item:n.triggeringItem},t),n.triggeredMenu)})}})},vS=function(n,t){var e=function(t,e){var o=n.getRelated(t);return o.exists(function(n){return tl(n,e)})},o=function(n,t){Kp.setContent(n,t)},r=function(n,t,e){i(n,t,e,St.none())},i=function(n,t,e,o){u(n,t,e,function(){return o.map(function(n){return jf(n)})})},u=function(t,e,o,r){var i=n.lazySink(t).getOrDie();Kp.openWhileCloaked(t,o,function(){return pp.positionWithinBounds(i,e,t,r())}),Ah.setValue(t,St.some({mode:"position",anchor:e,getBounds:r}))},a=function(n,t,e){c(n,t,e,function(){return St.none()})},c=function(t,e,o,r){var i=hS(n,t,e,o,r);Kp.open(t,i),Ah.setValue(t,St.some({mode:"menu",menu:i}))},s=function(n){Kp.isOpen(n)&&(Ah.setValue(n,St.none()),Kp.close(n))},f=function(n){return Kp.getState(n)},l=function(t){Kp.isOpen(t)&&Ah.getValue(t).each(function(e){switch(e.mode){case"menu":Kp.getState(t).each(function(n){pS.repositionMenus(n)});break;case"position":var o=n.lazySink(t).getOrDie();pp.positionWithinBounds(o,e.anchor,t,e.getBounds())}})},d={setContent:o,showAt:r,showWithin:i,showWithinBounds:u,showMenuAt:a,showMenuWithinBounds:c,hide:s,getContent:f,reposition:l,isOpen:Kp.isOpen};return{uid:n.uid,dom:n.dom,behaviours:Ih(n.inlineBehaviours,[Kp.config({isPartOf:function(n,t,o){return tl(t,o)||e(n,o)},getAttachPoint:function(t){return n.lazySink(t).getOrDie()},onOpen:function(t){n.onShow(t)},onClose:function(t){n.onHide(t)}}),Ah.config({store:{mode:"memory",initialValue:St.none()}}),Ed.config({channels:vt(vt({},nh(vt({isExtraPart:t.isExtraPart},n.fireDismissalEventInstead.map(function(n){return{fireEventInstead:{event:n.event}}}).getOr({})))),eh(vt(vt({},n.fireRepositionEventInstead.map(function(n){return{fireEventInstead:{event:n.event}}}).getOr({})),{doReposition:l})))})]),eventOrder:n.eventOrder,apis:d}},bS=jv({name:"InlineView",configFields:[fr("lazySink"),xl("onShow"),xl("onHide"),Or("onEscape"),Mh("inlineBehaviours",[Kp,Ah,Ed]),Tr("fireDismissalEventInstead",[Br("event",qu())]),Tr("fireRepositionEventInstead",[Br("event",Ku())]),Br("getRelated",St.none),Br("isExtraPart",gt),Br("eventOrder",St.none)],factory:vS,apis:{showAt:function(n,t,e,o){n.showAt(t,e,o)},showWithin:function(n,t,e,o,r){n.showWithin(t,e,o,r)},showWithinBounds:function(n,t,e,o,r){n.showWithinBounds(t,e,o,r)},showMenuAt:function(n,t,e,o){n.showMenuAt(t,e,o)},showMenuWithinBounds:function(n,t,e,o,r){n.showMenuWithinBounds(t,e,o,r)},hide:function(n,t){n.hide(t)},isOpen:function(n,t){return n.isOpen(t)},getContent:function(n,t){return n.getContent(t)},setContent:function(n,t,e){n.setContent(t,e)},reposition:function(n,t){n.reposition(t)}}}),yS=function(n){return n.x()},xS=function(n,t){return n.x()+n.width()/2-t.width()/2},wS=function(n,t){return n.x()+n.width()-t.width()},SS=function(n){return n.y()},CS=function(n,t){return n.y()+n.height()-t.height()},kS=function(n,t,e){return Tl(wS(n,t),CS(n,t),e.innerSoutheast(),Rl(),Ll(n,{right:0,bottom:3}),"layout-inner-se")},OS=function(n,t,e){return Tl(yS(n),CS(n,t),e.innerSouthwest(),Il(),Ll(n,{left:1,bottom:3}),"layout-inner-sw")},_S=function(n,t,e){return Tl(wS(n,t),SS(n),e.innerNortheast(),Fl(),Ll(n,{right:0,top:2}),"layout-inner-ne")},TS=function(n,t,e){return Tl(yS(n),SS(n),e.innerNorthwest(),Ml(),Ll(n,{left:1,top:2}),"layout-inner-nw")},ES=function(n,t,e){return Tl(xS(n,t),SS(n),e.innerNorth(),Vl(),Ll(n,{top:2}),"layout-inner-n")},BS=function(n,t,e){return Tl(xS(n,t),CS(n,t),e.innerSouth(),Hl(),Ll(n,{bottom:3}),"layout-inner-s")},DS=tinymce.util.Tools.resolve("tinymce.util.Delay"),AS=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),MS=tinymce.util.Tools.resolve("tinymce.EditorManager"),FS=function(n){var t=n.settings,e=t.skin,o=t.skin_url;if(e!==!1){var r=e?e:"oxide";o=o?n.documentBaseURI.toAbsolute(o):MS.baseURL+"/skins/ui/"+r}return o},IS=function(n){return n.getParam("readonly",!1,"boolean")},RS=function(n){return n.getParam("skin")===!1},VS=function(n){return n.getParam("height",Math.max(n.getElement().offsetHeight,200))},HS=function(n){return n.getParam("width",AS.DOM.getStyle(n.getElement(),"width"))},NS=function(n){return St.from(n.settings.min_width).filter(It)},PS=function(n){return St.from(n.settings.min_height).filter(It)},zS=function(n){return St.from(n.getParam("max_width")).filter(It)},LS=function(n){return St.from(n.getParam("max_height")).filter(It)},jS=function(n){return St.from(n.getParam("style_formats")).filter(At)},US=function(n){return n.getParam("style_formats_merge",!1,"boolean")},WS=function(n){return n.getParam("removed_menuitems","")},GS=function(n){return n.getParam("menubar",!0,"boolean")!==!1},XS=function(n){var t=n.getParam("toolbar",!0),e=t===!0,o=Bt(t),r=At(t)&&t.length>0;return!qS(n)&&(r||o||e)},YS=function(n){var t=de(n.settings),e=Kt(t,function(n){return/^toolbar([1-9])$/.test(n)}),o=Gt(e,function(t){return n.getParam(t,!1,"string")}),r=Kt(o,function(n){return"string"==typeof n});return r.length>0?St.some(r):St.none()},qS=function(n){return YS(n).fold(function(){var t=n.getParam("toolbar",[],"string[]");return t.length>0},function(){return!0})};!function(n){n["default"]="wrap",n.floating="floating",n.sliding="sliding",n.scrolling="scrolling"}(jb||(jb={}));var KS,JS=function(n){return n.getParam("toolbar_mode","","string")};!function(n){n.top="top",n.bottom="bottom"}(KS||(KS={}));var $S,QS=function(n){return n.getParam("toolbar_groups",{},"object")},ZS=function(n){return n.getParam("toolbar_location",KS.top,"string")!==KS.bottom},nC=function(n){return n.getParam("fixed_toolbar_container","","string")},tC=function(n){var t=nC(n);return t.length>0&&n.inline?Jf(Bs(),t):St.none()},eC=function(n){return n.inline&&tC(n).isSome()},oC=function(n){var t=tC(n);return t.getOr(Bs())},rC=function(n){return n.inline&&!GS(n)&&!XS(n)&&!qS(n)},iC=function(n){var t=n.getParam("toolbar_sticky",!1,"boolean");return(t||n.inline)&&!eC(n)&&!rC(n)},uC=function(n){return n.getParam("draggable_modal",!1,"boolean")},aC=function(n){var t=Iw(n.action),e=n.dom.tag,o=function(t){return xe(n.dom,"attributes").bind(function(n){return xe(n,t)})},r=function(){if("button"===e){var n=o("type").getOr("button"),t=o("role").map(function(n){return{role:n}}).getOr({});return vt({type:n},t)}var r=o("role").getOr("button");return{role:r}};return{uid:n.uid,dom:n.dom,components:n.components,events:t,behaviours:Rh.augment(n.buttonBehaviours,[mw.config({}),Xx.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:r()},eventOrder:n.eventOrder}},cC=jv({name:"Button",factory:aC,configFields:[Br("uid",void 0),fr("dom"),Br("components",[]),Rh.field("buttonBehaviours",[mw,Xx]),wr("action"),wr("role"),Br("eventOrder",{})]}),sC=function(n){var t=a(n)&&Se(n,"uid")?n.uid:Dc("memento"),e=function(n){return n.getSystem().getByUid(t).getOrDie()},o=function(n){return n.getSystem().getByUid(t).toOption()},r=function(){return vt(vt({},n),{uid:t})};return{get:e,getOpt:o,asSpec:r}},fC=function(n){return St.from(n()["temporary-placeholder"]).getOr("!not found!")},lC=function(n,t){return St.from(t()[n]).getOrThunk(function(){return fC(t)})},dC=function(n,t,e){return St.from(t()[n]).or(e).getOrThunk(function(){return fC(t)})},mC=function(n,t){return le(n,function(n){return St.from(t()[n])}).getOrThunk(function(){return fC(t)})},gC={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},pC=function(n){var t=sC({dom:{tag:"p",innerHtml:n.translationProvider(n.text)},behaviours:bd([ew.config({})])}),e=function(n){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+n+"%"}}}},o=function(n){return{dom:{tag:"div",classes:["tox-text"],innerHtml:n+"%"}}},r=sC({dom:{tag:"div",classes:n.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[e(0)]},o(0)],behaviours:bd([ew.config({})])}),i=function(n,t){n.getSystem().isConnected()&&r.getOpt(n).each(function(n){ew.set(n,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[e(t)]},o(t)])})},u=function(n,e){if(n.getSystem().isConnected()){var o=t.get(n);ew.set(o,[nf(e)])}},a={updateProgress:i,updateText:u},c=ne([n.icon.toArray(),n.level.toArray(),n.level.bind(function(n){return St.from(gC[n])}).toArray()]);return{uid:n.uid,dom:{tag:"div",attributes:{role:"alert"},classes:n.level.map(function(n){return["tox-notification","tox-notification--in","tox-notification--"+n]}).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:mC(c,n.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[t.asSpec()],behaviours:bd([ew.config({})])}].concat(n.progress?[r.asSpec()]:[]).concat(n.closeButton?[cC.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:lC("close",n.iconProvider),attributes:{"aria-label":n.translationProvider("Close")}}}],action:function(t){n.onAction(t)}})]:[]),apis:a}},hC=jv({name:"Notification",factory:pC,configFields:[wr("level"),fr("progress"),fr("icon"),fr("onAction"),fr("text"),fr("iconProvider"),fr("translationProvider"),Ir("closeButton",!0)],apis:{updateProgress:function(n,t,e){n.updateProgress(t,e)},updateText:function(n,t,e){n.updateText(t,e)}}}),vC=function(t,e){var o=null,r=function(){null!==o&&(n.clearTimeout(o),o=null)},i=function(){for(var r=[],i=0;i
    ',n.getDoc());return Xa(e,Xr.fromDom(t.extractContents())),t.insertNode(e.dom()),Va(e).each(function(n){return n.dom().normalize()}),hg(e).map(function(t){n.selection.setCursorLocation(t.dom(),dg(t))}),e})},kC=function(n){return $f(n,SC)},OC=function(n){return n.collapsed&&3===n.startContainer.nodeType},_C=function(n){return n.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},TC=function(n){return""!==n&&-1!=="  \f\n\r ".indexOf(n)},EC=function(n,t){return n.substring(t.length)},BC=function(n,t,e){var o;for(o=t-1;o>=0;o--){var r=n.charAt(o);if(TC(r))return St.none();if(r===e)break}return St.some(o)},DC=function(n,t,e,o){if(void 0===o&&(o=0),!OC(t))return St.none();var r=function(n,t,o){return BC(o,t,e).getOr(t)},i=n.getParent(t.startContainer,n.isBlock)||n.getRoot();return wC(n,t.startContainer,t.startOffset,r,i).bind(function(n){var r=t.cloneRange();if(r.setStart(n.container,n.offset),r.setEnd(t.endContainer,t.endOffset),r.collapsed)return St.none();var i=_C(r),u=i.lastIndexOf(e);return 0!==u||EC(i,e).length0?NC(t[t.length-1]):RC(n,t.length)},PC=function(n,t){var e=n.childNodes;return e.length>0&&t0&&HC(n)&&e.length===t?NC(e[e.length-1]):RC(n,t)},zC=function(n,t){return wC(n,t.container,t.offset,function(n,t){return 0===t?-1:t},n.getRoot()).filter(function(n){var t=n.container.data.charAt(n.offset-1);return!TC(t)}).isSome()},LC=function(n){return function(t){var e=PC(t.startContainer,t.startOffset);return!zC(n,e)}},jC=function(n,t,e){return le(e.triggerChars,function(e){return AC(n,t,e)})},UC=function(n,t){var e=t(),o=n.selection.getRng();return jC(n.dom,o,e).bind(function(e){return WC(n,t,e)})},WC=function(n,t,e,o){void 0===o&&(o={});var r=t(),i=n.selection.getRng(),u=i.startContainer.nodeValue,a=Kt(r.lookupByChar(e.triggerChar),function(t){return e.text.length>=t.minChars&&t.matches.getOrThunk(function(){return LC(n.dom)})(e.range,u,e.text)});if(0===a.length)return St.none();var c=IC.all(Gt(a,function(n){var t=n.fetch(e.text,n.maxResults,o);return t.then(function(t){return{matchText:e.text,items:t,columns:n.columns,onAction:n.onAction}})}));return St.some({lookupData:c,context:e})},GC=Mo([mr("type"),kr("text")]),XC=function(n){return Ko("separatormenuitem",GC,n)},YC=Mo([Pr("type",function(){return"autocompleteitem"}),Pr("active",function(){return!1}),Pr("disabled",function(){return!1}),Br("meta",{}),mr("value"),kr("text"),kr("icon")]),qC=Mo([mr("type"),mr("ch"),Ar("minChars",1),Br("columns",1),Ar("maxResults",10),Or("matches"),hr("fetch"),hr("onAction")]),KC=function(n){return Ko("Autocompleter.Separator",GC,n)},JC=function(n){return Ko("Autocompleter.Item",YC,n)},$C=function(n){return Ko("Autocompleter",qC,n)},QC=function(n){var t={};return Xt(n,function(n){t[n]={}}),de(t)},ZC=function(n){var t=n.ui.registry.getAll().popups,e=pe(t,function(n){return $C(n).fold(function(n){throw new Error(Qo(n))},function(n){return n})}),o=QC(ve(e,function(n){return n.ch})),r=ye(e),i=function(n){return Kt(r,function(t){return t.ch===n})};return{dataset:e,triggerChars:o,lookupByChar:i}},nk=[Ir("disabled",!1),kr("text"),kr("shortcut"),Po("value","value",Ke(function(){return Sc("menuitem-value")}),tr()),Br("meta",{})],tk=Mo([mr("type"),Rr("onSetup",function(){return at}),Rr("onAction",at),kr("icon")].concat(nk)),ek=function(n){return Ko("menuitem",tk,n)},ok=Mo([mr("type"),hr("getSubmenuItems"),Rr("onSetup",function(){return at}),kr("icon")].concat(nk)),rk=function(n){return Ko("nestedmenuitem",ok,n)},ik=Mo([mr("type"),Ir("active",!1),Rr("onSetup",function(){return at}),hr("onAction")].concat(nk)),uk=function(n){return Ko("togglemenuitem",ik,n)},ak=Mo([mr("type"),Ir("active",!1),kr("icon")].concat(nk)),ck=function(n){return Ko("choicemenuitem",ak,n)},sk=["inserttable","colorswatch"],fk=Mo([mr("type"),gr("fancytype",sk),Rr("onAction",at)]),lk=function(n){return Ko("fancymenuitem",fk,n)},dk=function(n,t,e){var o=bg(n.element(),"."+e);if(o.length>0){var r=Zt(o,function(n){var e=n.dom().getBoundingClientRect().top,r=o[0].dom().getBoundingClientRect().top;return Math.abs(e-r)>t}).getOr(o.length);return St.some({numColumns:r,numRows:Math.ceil(o.length/r)})}return St.none()},mk=function(n,t){return bd([rw(n,t)])},gk=function(n){return mk(Sc("unnamed-events"),n)},pk={namedEvents:mk,unnamedEvents:gk},hk=[fr("lazySink"),fr("tooltipDom"),Br("exclusive",!0),Br("tooltipComponents",[]),Br("delay",300),Fr("mode","normal",["normal","follow-highlight"]),Br("anchor",function(n){return{anchor:"hotspot",hotspot:n,layouts:{onLtr:ft([ed,td,$l,Zl,Ql,nd]),onRtl:ft([ed,td,$l,Zl,Ql,nd])}}}),xl("onHide"),xl("onShow")],vk=function(){var t=zr(St.none()),e=zr(St.none()),o=function(){return e.get()},r=function(n){e.set(St.some(n))},i=function(){e.set(St.none())},u=function(){t.get().each(function(t){n.clearTimeout(t)})},a=function(e,o){u(),t.set(St.some(n.setTimeout(function(){e()},o)))},c=function(){return e.get().isSome()},s=ft("not-implemented");return Uc({getTooltip:o,isShowing:c,setTooltip:r,clearTooltip:i,clearTimer:u,resetTimer:a,readState:s})},bk=Object.freeze({__proto__:null,init:vk}),yk=Sc("tooltip.exclusive"),xk=Sc("tooltip.show"),wk=Sc("tooltip.hide"),Sk=function(n){n.getSystem().broadcastOn([yk],{})},Ck=function(n,t,e,o){e.getTooltip().each(function(n){n.getSystem().isConnected()&&ew.set(n,o)})},kk=Object.freeze({__proto__:null,hideAllExclusive:Sk,setComponents:Ck}),Ok=function(n,t){var e=function(e){t.getTooltip().each(function(o){kp(o),n.onHide(e,o),t.clearTooltip()}),t.clearTimer()},o=function(e){if(!t.isShowing()){Sk(e);var o=n.lazySink(e).getOrDie(),r=e.getSystem().build({dom:n.tooltipDom,components:n.tooltipComponents,events:ca("normal"===n.mode?[da(xu(),function(){ea(e,xk)}),da(bu(),function(){ea(e,wk)})]:[]),behaviours:bd([ew.config({})])});t.setTooltip(r),wp(o,r),n.onShow(e,r),pp.position(o,n.anchor(e),r)}};return ca(ne([[da(xk,function(e){t.resetTimer(function(){o(e)},n.delay)}),da(wk,function(o){t.resetTimer(function(){e(o)},n.delay)}),da(Iu(),function(n,t){var o=t;Lt(o.channels(),yk)&&e(n)}),Ca(function(n){e(n)})],"normal"===n.mode?[da(wu(),function(n){ea(n,xk)}),da(Mu(),function(n){ea(n,wk)}),da(xu(),function(n){ea(n,xk)}),da(bu(),function(n){ea(n,wk)})]:[da(na(),function(n){ea(n,xk)}),da(ta(),function(n){ea(n,wk)})]]))},_k=Object.freeze({__proto__:null,events:Ok}),Tk=xd({fields:hk,name:"tooltipping",active:_k,state:bk,apis:kk}),Ek=tinymce.util.Tools.resolve("tinymce.util.I18n"),Bk="tox-menu-nav__js",Dk="tox-collection__item",Ak="tox-swatch",Mk={normal:Bk,color:Ak},Fk="tox-collection__item--enabled",Ik="tox-collection__group-heading",Rk="tox-collection__item-icon",Vk="tox-collection__item-label",Hk="tox-collection__item-accessory",Nk="tox-collection__item-caret",Pk="tox-collection__item-checkmark",zk="tox-collection__item--active",Lk="tox-collection__item-icon-rtl",jk=function(n){return xe(Mk,n).getOr(Bk)},Uk=tinymce.util.Tools.resolve("tinymce.Env"),Wk=function(n){var t={alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"},e={meta:"Ctrl",access:"Shift+Alt"},o=Uk.mac?t:e,r=n.split("+"),i=Gt(r,function(n){var t=n.toLowerCase().trim();return we(o,t)?o[t]:n});return i.join(Uk.mac?"":"+")},Gk={convertText:Wk},Xk=function(n){return{dom:{tag:"div",classes:[Rk],innerHtml:n}}},Yk=function(n){return{dom:{tag:"div",classes:[Vk]},components:[nf(Ek.translate(n))]}},qk=function(n){return{dom:{tag:"div",classes:[Vk],innerHtml:n}}},Kk=function(n,t){return{dom:{tag:"div",classes:[Vk]},components:[{dom:{tag:n.tag,styles:n.styles},components:[nf(Ek.translate(t))]}]}},Jk=function(n){return{dom:{tag:"div",classes:[Hk],innerHtml:Gk.convertText(n)}}},$k=function(n){return{dom:{tag:"div",classes:[Rk,Pk],innerHtml:lC("checkmark",n)}}},Qk=function(n){return{dom:{tag:"div",classes:[Nk],innerHtml:lC("chevron-right",n)}}},Zk=function(n){return{dom:{tag:"div",classes:[Nk],innerHtml:lC("chevron-down",n)}}},nO=function(n,t,e,r){var i="custom",u="remove",a=function(){var a=Ak,c=e.getOr(""),s=n.map(function(n){return{title:r.translate(n)}}).getOr({}),f={tag:"div",attributes:s,classes:[a]};return t===i?vt(vt({},f),{tag:"button",classes:o(f.classes,["tox-swatches__picker-btn"]),innerHtml:c}):t===u?vt(vt({},f),{classes:o(f.classes,["tox-swatch--remove"]),innerHtml:c}):vt(vt({},f),{attributes:vt(vt({},f.attributes),{"data-mce-color":t}),styles:{"background-color":t}})};return{dom:a(),optComponents:[]}},tO=function(n,t,e,o,r){var i=e?n.checkMark.orThunk(function(){return t.or(St.some("")).map(Xk)}):St.none(),u=n.ariaLabel.map(function(n){return{attributes:{title:Ek.translate(n)}}}).getOr({}),a=vt({tag:"div",classes:[Bk,Dk].concat(r?[Lk]:[])},u),c=n.htmlContent.fold(function(){return n.textContent.map(o)},function(n){return St.some(qk(n))}),s={dom:a,optComponents:[i,c,n.shortcutContent.map(Jk),n.caret]};return s},eO=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],oO=["list-bull-circle","list-bull-default","list-bull-square"],rO=function(n,e,o,r){void 0===r&&(r=St.none());var i=function(n){return n.map(function(n){return Ek.isRtl()&&Lt(eO,n)?n+"-rtl":n})},u=Ek.isRtl()&&n.iconContent.exists(function(n){return Lt(oO,n)}),a=i(n.iconContent).map(function(n){return dC(n,e.icons,r)}),c=St.from(n.meta).fold(function(){return Yk},function(n){return we(n,"style")?t(Kk,n.style):Yk});return"color"===n.presets?nO(n.ariaLabel,n.value,a,e):tO(n,a,o,c,u)},iO=["input","button","textarea","select"],uO=function(n,t){t.disabled&&gO(n,t)},aO=function(n,t){return t.useNative===!0&&Lt(iO,ec(n.element()))},cO=function(n){return dc(n.element(),"disabled")},sO=function(n){cc(n.element(),"disabled","disabled")},fO=function(n){mc(n.element(),"disabled")},lO=function(n){return"true"===fc(n.element(),"aria-disabled")},dO=function(n){cc(n.element(),"aria-disabled","true")},mO=function(n){cc(n.element(),"aria-disabled","false")},gO=function(n,t){t.disableClass.each(function(t){ws(n.element(),t)});var e=aO(n,t)?sO:dO;e(n),t.onDisabled(n)},pO=function(n,t){t.disableClass.each(function(t){Cs(n.element(),t)});var e=aO(n,t)?fO:mO;e(n),t.onEnabled(n)},hO=function(n,t){return aO(n,t)?cO(n):lO(n)},vO=function(n,t,e,o){var r=o?gO:pO;r(n,t,e)},bO=Object.freeze({__proto__:null,enable:pO,disable:gO,isDisabled:hO,onLoad:uO,set:vO}),yO=function(n,t){return qc({classes:t.disabled?t.disableClass.map(ue).getOr([]):[]})},xO=function(n,t){return ca([sa(Ru(),function(t){return hO(t,n)}),dd(n,t,uO)])},wO=Object.freeze({__proto__:null,exhibit:yO,events:xO}),SO=[Br("disabled",!1),Br("useNative",!0),wr("disableClass"),xl("onDisabled"),xl("onEnabled")],CO=xd({fields:SO,name:"disabling",active:wO,apis:bO}),kO=function(n){return CO.config({disabled:n,disableClass:"tox-collection__item--state-disabled"})},OO=function(n){return CO.config({disabled:n})},_O=function(n){return CO.config({disabled:n,disableClass:"tox-tbtn--disabled"})},TO=function(n){return CO.config({disabled:n,disableClass:"tox-tbtn--disabled",useNative:!1})},EO={item:kO,button:OO,splitButton:_O,toolbarButton:TO},BO=function(n,t){var e=n.getApi(t);return function(n){n(e)}},DO=function(n,t){return Sa(function(e){var o=BO(n,e);o(function(e){var o=n.onSetup(e);null!==o&&void 0!==o&&t.set(o)})})},AO=function(n,t){return Ca(function(e){return BO(n,e)(t.get())})};!function(n){n[n.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",n[n.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}($S||($S={}));var MO,FO=$S,IO=function(n,t){return Oa(function(e,o){BO(n,e)(n.onAction),n.triggersSubmenu||t!==FO.CLOSE_ON_EXECUTE||(ea(e,Pu()),o.stop())})},RO={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},VO=function(n){return te(n,function(n){return n.toArray()})},HO=function(n,t,e){var o=zr(at);return{type:"item",dom:t.dom,components:VO(t.optComponents),data:n.data,eventOrder:RO,hasSubmenu:n.triggersSubmenu,itemBehaviours:bd([rw("item-events",[IO(n,e),DO(n,o),AO(n,o)]),EO.item(n.disabled),ew.config({})].concat(n.itemBehaviours))}},NO=function(n){return{value:n.value,meta:vt({text:n.text.getOr("")},n.meta)}},PO=function(n,t){return xe(n,"tooltipWorker").map(function(n){return[Tk.config({lazySink:t.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(n){return{anchor:"submenu",item:n,overrides:{maxHeightFunction:lm}}},mode:"follow-highlight",onShow:function(t){n(function(n){Tk.setComponents(t,[tf({element:Xr.fromDom(n)})])})}})]}).getOr([])},zO=function(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},LO=function(n){return AS.DOM.encode(n)},jO=function(n,t){var e=Ek.translate(n),o=LO(e);if(t.length>0){var r=new RegExp(zO(t),"gi");return o.replace(r,function(n){return''+n+""})}return o},UO=function(n,t,e,o,r,i,u,a){void 0===a&&(a=!0);var c=rO({presets:o,textContent:St.none(),htmlContent:e?n.text.map(function(n){return jO(n,t)}):St.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:St.none(),checkMark:St.none(),caret:St.none(),value:n.value},u.providers,a,n.icon);return HO({data:NO(n),disabled:n.disabled,getApi:function(){return{}},onAction:function(){return r(n.value,n.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:PO(n.meta,u)},c,i)},WO=function(n,t,e,o,r,i,u){var a=function(n){return{setActive:function(t){Mw.set(n,t)},isActive:function(){return Mw.isOn(n)},isDisabled:function(){return CO.isDisabled(n)},setDisabled:function(t){return CO.set(n,t)}}},c=rO({presets:e,textContent:t?n.text:St.none(),htmlContent:St.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:t?n.shortcut:St.none(),checkMark:t?St.some($k(u.icons)):St.none(),caret:St.none(),value:n.value},u,!0);return Be(HO({data:NO(n),disabled:n.disabled,getApi:a,onAction:function(){return o(n.value)},onSetup:function(n){return n.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},c,i),{toggling:{toggleClass:Fk,toggleOnExecute:!1,selected:n.active}})},GO=ft(bv(Gw(),Xw())),XO=Sc("cell-over"),YO=Sc("cell-execute"),qO=function(n,t,e){var o,r=function(e){return oa(e,XO,{row:n,col:t})},i=function(e){return oa(e,YO,{row:n,col:t})},u=function(n,t){t.stop(),i(n)};return of({dom:{tag:"div",attributes:(o={role:"button"},o["aria-labelledby"]=e,o)},behaviours:bd([rw("insert-table-picker-cell",[da(xu(),mw.focus),da(Ru(),i),da(Tu(),u),da(Hu(),u)]),Mw.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),mw.config({onFocus:r})])})},KO=function(n,t,e){for(var o=[],r=0;t>r;r++){for(var i=[],u=0;e>u;u++)i.push(qO(r,u,n));o.push(i)}return o},JO=function(n,t,e,o,r){for(var i=0;o>i;i++)for(var u=0;r>u;u++)Mw.set(n[i][u],t>=i&&e>=u)},$O=function(n){return te(n,function(n){return Gt(n,rf)})},QO=function(n,t){return nf(t+1+"x"+(n+1))},ZO=function(n){return{value:ft(n)}},n_=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,t_=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,e_=function(n){return n_.test(n)||t_.test(n)},o_=function(n){var t=n.value().replace(n_,function(n,t,e,o){return t+t+e+e+o+o});return{value:ft(t)}},r_=function(n){var t=o_(n),e=t_.exec(t.value());return null===e?["FFFFFF","FF","FF","FF"]:e},i_=function(n){var t=n.toString(16);return 1===t.length?"0"+t:t},u_=function(n){var t=i_(n.red())+i_(n.green())+i_(n.blue());return ZO(t)},a_=Math.min,c_=Math.max,s_=Math.round,f_=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,l_=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,d_=function(n,t,e,o){return{red:ft(n),green:ft(t),blue:ft(e),alpha:ft(o)}},m_=function(n){var t=parseInt(n,10);return t.toString()===n&&t>=0&&255>=t},g_=function(n){var t,e,o,r=(n.hue()||0)%360,i=n.saturation()/100,u=n.value()/100;if(i=c_(0,a_(i,1)),u=c_(0,a_(u,1)),0===i)return t=e=o=s_(255*u),d_(t,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),f=u-c;switch(Math.floor(a)){case 0:t=c,e=s,o=0;break;case 1:t=s,e=c,o=0;break;case 2:t=0,e=c,o=s;break;case 3:t=0,e=s,o=c;break;case 4:t=s,e=0,o=c;break;case 5:t=c,e=0,o=s;break;default:t=e=o=0}return t=s_(255*(t+f)),e=s_(255*(e+f)),o=s_(255*(o+f)),d_(t,e,o,1)},p_=function(n){var t=r_(n),e=parseInt(t[1],16),o=parseInt(t[2],16),r=parseInt(t[3],16);return d_(e,o,r,1)},h_=function(n,t,e,o){var r=parseInt(n,10),i=parseInt(t,10),u=parseInt(e,10),a=parseFloat(o);return d_(r,i,u,a)},v_=function(n){if("transparent"===n)return St.some(d_(0,0,0,0));var t=f_.exec(n);if(null!==t)return St.some(h_(t[1],t[2],t[3],"1"));var e=l_.exec(n);return null!==e?St.some(h_(e[1],e[2],e[3],e[4])):St.none()},b_=function(n){return"rgba("+n.red()+","+n.green()+","+n.blue()+","+n.alpha()+")"},y_=ft(d_(255,0,0,1)),x_=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),w_="tinymce-custom-colors",S_="choiceitem",C_=[{type:S_,text:"Light Green",value:"#BFEDD2"},{type:S_,text:"Light Yellow",value:"#FBEEB8"},{type:S_,text:"Light Red",value:"#F8CAC6"},{type:S_,text:"Light Purple",value:"#ECCAFA"},{type:S_,text:"Light Blue",value:"#C2E0F4"},{type:S_,text:"Green",value:"#2DC26B"},{type:S_,text:"Yellow",value:"#F1C40F"},{type:S_,text:"Red",value:"#E03E2D"},{type:S_,text:"Purple",value:"#B96AD9"},{type:S_,text:"Blue",value:"#3598DB"},{type:S_,text:"Dark Turquoise",value:"#169179"},{type:S_,text:"Orange",value:"#E67E23"},{type:S_,text:"Dark Red",value:"#BA372A"},{type:S_,text:"Dark Purple",value:"#843FA1"},{type:S_,text:"Dark Blue",value:"#236FA1"},{type:S_,text:"Light Gray",value:"#ECF0F1"},{type:S_,text:"Medium Gray",value:"#CED4D9"},{type:S_,text:"Gray",value:"#95A5A6"},{type:S_,text:"Dark Gray",value:"#7E8C8D"},{type:S_,text:"Navy Blue",value:"#34495E"},{type:S_,text:"Black",value:"#000000"},{type:S_,text:"White",value:"#ffffff"}],k_=f(10),O_=function(t){var e=[],o=n.document.createElement("canvas");o.height=1,o.width=1;for(var r=o.getContext("2d"),i=function(n,t){var e=255,o=t/255,r=Math.round(n*o+e*(1-o));return("0"+r.toString(16)).slice(-2).toUpperCase()},u=function(n){if(/^[0-9A-Fa-f]{6}$/.test(n))return"#"+n.toUpperCase();r.clearRect(0,0,o.width,o.height),r.fillStyle="#FFFFFF",r.fillStyle=n,r.fillRect(0,0,1,1);var t=r.getImageData(0,0,1,1).data,e=t[0],u=t[1],a=t[2],c=t[3]; return"#"+i(e,c)+i(u,c)+i(a,c)},a=0;a0&&e.push(o),o=[],we(n.dom,"innerHtml")&&o.push(n)):o.push(n)}),o.length>0&&e.push(o),Gt(e,function(n){return{dom:{tag:"div",classes:["tox-collection__group"]},components:n}})},mT=function(n,t){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===n?["tox-collection--list"]:["tox-collection--grid"])},components:[oS.parts().items({preprocess:function(e){return"auto"!==n&&n>1?sT({tag:"div",classes:["tox-collection__group"]},n)(e):dT(e,function(n,e){return"separator"===t[e].type})}})]}},gT=function(n){return{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[oS.parts().items({preprocess:function(t){return dT(t,function(t,e){return"separator"===n[e].type})}})]}},pT=function(n){return void 0!==n.icon||"togglemenuitem"===n.type||"choicemenuitem"===n.type},hT=function(n){return jt(n,pT)},vT=function(t){return n.console.error(Qo(t)),n.console.log(t),St.none()},bT=function(n,t,e){var o=gT(e);return{value:n,dom:o.dom,components:o.components,items:e}},yT=function(n,t,e,o,r){if("color"===r){var i=fT(o);return{value:n,dom:i.dom,components:i.components,items:e}}if("normal"===r&&"auto"===o){var i=mT(o,e);return{value:n,dom:i.dom,components:i.components,items:e}}if("normal"===r&&1===o){var i=mT(1,e);return{value:n,dom:i.dom,components:i.components,items:e}}if("normal"===r){var i=mT(o,e);return{value:n,dom:i.dom,components:i.components,items:e}}if("listpreview"===r&&"auto"!==o){var i=lT(o);return{value:n,dom:i.dom,components:i.components,items:e}}return{value:n,dom:uT(t,o,r),components:aT,items:e}},xT=function(n,t,e,o,r,i,u,a){var c=hT(t),s="color"!==r?"normal":"color",f=wT(t,e,o,s,i,u,a);return yT(n,c,f,o,r)},wT=function(n,t,e,o,r,i,u){return Wv(Gt(n,function(n){return"choiceitem"===n.type?ck(n).fold(vT,function(a){return St.some(WO(a,1===e,o,t,i(n.value),r,u))}):St.none()}))},ST=function(n,t){var e=iT(t);if(1===n)return{mode:"menu",moveOnTab:!0};if("auto"===n)return{mode:"grid",selector:"."+e.item,initSize:{numColumns:1,numRows:1}};var o="color"===t?"tox-swatches__row":"tox-collection__group";return{mode:"matrix",rowSelector:"."+o}},CT=function(n,t){return 1===n?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===n?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===t?".tox-swatches__row":".tox-collection__group",cell:"color"===t?"."+Ak:"."+Dk}}},kT={inserttable:s,colorswatch:l},OT=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)?St.some(n[t]):St.none()},_T=function(n,t){return OT(kT,n.fancytype).map(function(e){return e(n,t)})},TT=function(n,t,e,o){void 0===o&&(o=!0);var r=function(n){return{isDisabled:function(){return CO.isDisabled(n)},setDisabled:function(t){return CO.set(n,t)}}},i=rO({presets:"normal",iconContent:n.icon,textContent:n.text,htmlContent:St.none(),ariaLabel:n.text,caret:St.none(),checkMark:St.none(),shortcutContent:n.shortcut},e,o);return HO({data:NO(n),getApi:r,disabled:n.disabled,onAction:n.onAction,onSetup:n.onSetup,triggersSubmenu:!1,itemBehaviours:[]},i,t)},ET=function(n,t,e,o,r){void 0===o&&(o=!0),void 0===r&&(r=!1);var i=r?Zk(e.icons):Qk(e.icons),u=function(n){return{isDisabled:function(){return CO.isDisabled(n)},setDisabled:function(t){return CO.set(n,t)}}},a=rO({presets:"normal",iconContent:n.icon,textContent:n.text,htmlContent:St.none(),ariaLabel:n.text,caret:St.some(i),checkMark:St.none(),shortcutContent:n.shortcut},e,o);return HO({data:NO(n),getApi:u,disabled:n.disabled,onAction:at,onSetup:n.onSetup,triggersSubmenu:!0,itemBehaviours:[]},a,t)},BT=function(n){var t=n.text.fold(function(){return{}},function(n){return{innerHtml:n}});return{type:"separator",dom:vt({tag:"div",classes:[Dk,Ik]},t),components:[]}},DT=function(n,t,e){var o=function(n){return{setActive:function(t){Mw.set(n,t)},isActive:function(){return Mw.isOn(n)},isDisabled:function(){return CO.isDisabled(n)},setDisabled:function(t){return CO.set(n,t)}}},r=rO({iconContent:St.none(),textContent:n.text,htmlContent:St.none(),ariaLabel:n.text,checkMark:St.some($k(e.icons)),caret:St.none(),shortcutContent:n.shortcut,presets:"normal",meta:n.meta},e,!0);return Be(HO({data:NO(n),disabled:n.disabled,getApi:o,onAction:n.onAction,onSetup:n.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t),{toggling:{toggleClass:Fk,toggleOnExecute:!1,selected:n.active}})},AT=UO,MT=BT,FT=TT,IT=ET,RT=DT,VT=_T;!function(n){n[n.ContentFocus=0]="ContentFocus",n[n.UiFocus=1]="UiFocus"}(MO||(MO={}));var HT=function(n){return void 0!==n.icon||"togglemenuitem"===n.type||"choicemenuitem"===n.type},NT=function(n){return jt(n,HT)},PT=function(t,e,o,r,i){var u=o.shared.providers,a=function(n){return i?vt(vt({},n),{shortcut:St.none(),icon:n.text.isSome()?St.none():n.icon}):n};switch(t.type){case"menuitem":return ek(t).fold(vT,function(n){return St.some(FT(a(n),e,u,r))});case"nestedmenuitem":return rk(t).fold(vT,function(n){return St.some(IT(a(n),e,u,r,i))});case"togglemenuitem":return uk(t).fold(vT,function(n){return St.some(RT(a(n),e,u))});case"separator":return XC(t).fold(vT,function(n){return St.some(MT(n))});case"fancymenuitem":return lk(t).fold(vT,function(n){return VT(a(n),o)});default:return n.console.error("Unknown item in general menu",t),St.none()}},zT=function(n,t,e,o,r,i){var u=1===o,a=!u||NT(n);return Wv(Gt(n,function(n){return"separator"===n.type?KC(n).fold(vT,function(n){return St.some(MT(n))}):JC(n).fold(vT,function(n){return St.some(AT(n,t,u,"normal",e,r,i,a))})}))},LT=function(n,t,e,o,r){var i=NT(t),u=Wv(Gt(t,function(n){var t=function(n){return r?!n.hasOwnProperty("text"):i},u=function(n){return PT(n,e,o,t(n),r)};return u("nestedmenuitem"===n.type&&n.getSubmenuItems().length<=0?vt(vt({},n),{disabled:!0}):n)})),a=r?bT:yT;return a(n,i,u,1,"normal")},jT=function(n){return pS.singleData(n.value,n)},UT=function(n,t,e,o){var r=e===MO.ContentFocus?Lb():zb(),i=ST(t,o),u=iT(o);return{dom:n.dom,components:n.components,items:n.items,value:n.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:e===MO.ContentFocus,focusManager:r,menuBehaviours:pk.unnamedEvents("auto"!==t?[]:[Sa(function(n){dk(n,4,u.item).each(function(t){var e=t.numColumns,o=t.numRows;Xx.setGridSize(n,o,e)})})])}},WT=function(t,e){var o=zr(St.none()),r=zr(!1),i=of(bS.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:bd([rw("dismissAutocompleter",[da(qu(),function(){return s()})])]),lazySink:e.getSink})),u=function(){return bS.isOpen(i)},a=function(){return o.get().isSome()},c=function(){a()&&bS.hide(i)},s=function(){if(a()){var n=o.get().map(function(n){return n.element});kC(n.getOr(Xr.fromDom(t.selection.getNode()))).each(Qa),c(),o.set(St.none()),r.set(!1)}},f=Ae(function(){return ZC(t)}),l=function(o,i){var u=le(i,function(n){return St.from(n.columns)}).getOr(1);return te(i,function(i){var a=i.items;return zT(a,i.matchText,function(e,u){var a=t.selection.getRng();AC(t.dom,a,o).fold(function(){return n.console.error("Lost context. Cursor probably moved")},function(n){var t=n.range,o={hide:function(){s()},reload:function(n){c(),p(n)}};r.set(!0),i.onAction(o,t,e,u),r.set(!1)})},u,FO.BUBBLE_TO_SANDBOX,e)})},d=function(n){if(!a()){var e=CC(t,n.range);o.set(St.some({triggerChar:n.triggerChar,element:e,matchLength:n.text.length})),r.set(!1)}},m=function(n,e,o,r){n.matchLength=e.text.length;var u=le(o,function(n){return St.from(n.columns)}).getOr(1);bS.showAt(i,{anchor:"node",root:Xr.fromDom(t.getBody()),node:St.from(n.element)},oS.sketch(UT(yT("autocompleter-value",!0,r,u,"normal"),u,MO.ContentFocus,"normal"))),bS.getContent(i).each(bb.highlightFirst)},g=function(n){return o.get().map(function(e){return AC(t.dom,t.selection.getRng(),e.triggerChar).bind(function(e){return WC(t,f,e,n)})}).getOrThunk(function(){return UC(t,f)})},p=function(n){g(n).fold(s,function(n){d(n.context),n.lookupData.then(function(t){o.get().map(function(e){var o=n.context;if(e.triggerChar===o.triggerChar){var r=l(o.triggerChar,t);r.length>0?m(e,o,t,r):o.text.length-e.matchLength>=10?s():c()}})})})},h=bC(function(n){27!==n.which&&p()},50),v={onKeypress:h,cancelIfNecessary:s,isMenuOpen:u,isActive:a,isProcessingAction:r.get,getView:function(){return bS.getContent(i)}};FC.setup(v,t)},GT={register:WT},XT=ft(!0),YT=function(n,t,e){return Of(n,t,XT,e)},qT=function(n,t,e){return _f(n,t,XT,e)},KT=Sf,JT=function(n,t,e){return $f(n,t,e).isSome()},$T=5,QT=400,ZT=function(n){var t=n.raw();return void 0===t.touches||1!==t.touches.length?St.none():St.some(t.touches[0])},nE=function(n,t){var e=Math.abs(n.clientX-t.x()),o=Math.abs(n.clientY-t.y());return e>$T||o>$T},tE=function(n){var t=zr(St.none()),e=zr(!1),o=d(function(t){n.triggerEvent(Nu(),t),e.set(!0)},QT),r=function(n){return ZT(n).each(function(r){o.cancel();var i={x:ft(r.clientX),y:ft(r.clientY),target:n.target};o.schedule(n),e.set(!1),t.set(St.some(i))}),St.none()},i=function(n){return o.cancel(),ZT(n).each(function(n){t.get().each(function(e){nE(n,e)&&t.set(St.none())})}),St.none()},u=function(r){o.cancel();var i=function(n){return Zi(n.target(),r.target())};return t.get().filter(i).map(function(){return e.get()?(r.prevent(),!1):n.triggerEvent(Hu(),r)})},a=oo([{key:du(),value:r},{key:mu(),value:i},{key:gu(),value:u}]),c=function(n,t){return xe(a,t).bind(function(t){return t(n)})};return{fireIfReady:c}},eE=function(n){var t=n.raw();return t.which===yb()[0]&&!Lt(["input","textarea"],ec(n.target()))&&!JT(n.target(),'[contenteditable="true"]')},oE=Ui().browser.isFirefox(),rE=Ao([hr("triggerEvent"),Br("stopBackspace",!0)]),iE=function(n,t){return oE?qT(n,"focus",t):YT(n,"focusin",t)},uE=function(n,t){return oE?qT(n,"blur",t):YT(n,"focusout",t)},aE=function(t,e){var o=$o("Getting GUI events settings",rE,e),r=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],i=tE(o),u=Gt(r.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(n){return YT(t,n,function(t){i.fireIfReady(t,n).each(function(n){n&&t.kill()});var e=o.triggerEvent(n,t);e&&t.kill()})}),a=zr(St.none()),c=YT(t,"paste",function(t){i.fireIfReady(t,"paste").each(function(n){n&&t.kill()});var e=o.triggerEvent("paste",t);e&&t.kill(),a.set(St.some(n.setTimeout(function(){o.triggerEvent(Fu(),t)},0)))}),s=YT(t,"keydown",function(n){var t=o.triggerEvent("keydown",n);t?n.kill():o.stopBackspace===!0&&eE(n)&&n.prevent()}),f=iE(t,function(n){var t=o.triggerEvent("focusin",n);t&&n.kill()}),l=zr(St.none()),d=uE(t,function(t){var e=o.triggerEvent("focusout",t);e&&t.kill(),l.set(St.some(n.setTimeout(function(){o.triggerEvent(Mu(),t)},0)))}),m=function(){Xt(u,function(n){n.unbind()}),s.unbind(),f.unbind(),d.unbind(),c.unbind(),a.get().each(n.clearTimeout),l.get().each(n.clearTimeout)};return{unbind:m}},cE=function(n,t){var e=xe(n,"target").map(function(n){return n()}).getOr(t);return zr(e)},sE=function(n,t){var e=zr(!1),o=zr(!1),r=function(){e.set(!0)},i=function(){o.set(!0)};return{stop:r,cut:i,isStopped:e.get,isCut:o.get,event:ft(n),setSource:t.set,getSource:t.get}},fE=function(n){var t=zr(!1),e=function(){t.set(!0)};return{stop:e,cut:at,isStopped:t.get,isCut:ft(!1),event:ft(n),setSource:mt("Cannot set source of a broadcasted event"),getSource:mt("Cannot get source of a broadcasted event")}},lE=ke.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),dE=function(n,t,e,o,r,i){var u=n(t,o),a=sE(e,r);return u.fold(function(){return i.logEventNoHandlers(t,o),lE.complete()},function(n){var e=n.descHandler(),o=ts(e);return o(a),a.isStopped()?(i.logEventStopped(t,n.element(),e.purpose()),lE.stopped()):a.isCut()?(i.logEventCut(t,n.element(),e.purpose()),lE.complete()):Va(n.element()).fold(function(){return i.logNoParent(t,n.element(),e.purpose()),lE.complete()},function(o){return i.logEventResponse(t,n.element(),e.purpose()),lE.resume(o)})})},mE=function(n,t,e,o,r,i){return dE(n,t,e,o,r,i).fold(function(){return!0},function(o){return mE(n,t,e,o,r,i)},function(){return!1})},gE=function(n,t,e,o,r){var i=cE(e,o);return dE(n,t,e,o,i,r)},pE=function(n,t){var e=fE(t);return Xt(n,function(n){var t=n.descHandler(),o=ts(t);o(e)}),e.isStopped()},hE=function(n,t,e,o){var r=e.target();return vE(n,t,e,r,o)},vE=function(n,t,e,o,r){var i=cE(e,o);return mE(n,t,e,o,i,r)},bE=_a("element","descHandler"),yE=function(n,t){return{id:ft(n),descHandler:ft(t)}},xE=function(n){var t=n.dom,o=t.attributes,r=e(t,["attributes"]);return{uid:n.uid,dom:vt({tag:"div",attributes:vt({role:"presentation"},o)},r),components:n.components,behaviours:Fh(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},wE=jv({name:"Container",factory:xE,configFields:[Br("components",[]),Mh("containerBehaviours",[]),Br("events",{}),Br("domModification",{}),Br("eventOrder",{})]}),SE=function(n){var t=function(t){return Va(n.element()).fold(function(){return!0},function(n){return Zi(t,n)})},e=g(),o=function(n,o){return e.find(t,n,o)},r=aE(n.element(),{triggerEvent:function(n,t){return fl(n,t.target(),function(e){return hE(o,n,t,e)})}}),i={debugInfo:ft("real"),triggerEvent:function(n,t,e){fl(n,t,function(r){return vE(o,n,e,t,r)})},triggerFocus:function(n,t){Bc(n).fold(function(){Ad(n)},function(){fl(Au(),n,function(e){return gE(o,Au(),{originator:ft(t),kill:at,prevent:at,target:ft(n)},n,e),!1})})},triggerEscape:function(n,t){i.triggerEvent("keydown",n.element(),t.event())},getByUid:function(n){return h(n)},getByDom:function(n){return v(n)},build:of,addToGui:function(n){c(n)},removeFromGui:function(n){s(n)},addToWorld:function(n){u(n)},removeFromWorld:function(n){a(n)},broadcast:function(n){d(n)},broadcastOn:function(n,t){m(n,t)},broadcastEvent:function(n,t){p(n,t)},isConnected:ft(!0)},u=function(n){n.connect(i),uc(n.element())||(e.register(n),Xt(n.components(),u),i.triggerEvent(Lu(),n.element(),{target:ft(n.element())}))},a=function(n){uc(n.element())||(Xt(n.components(),a),e.unregister(n)),n.disconnect()},c=function(t){wp(n,t)},s=function(n){kp(n)},f=function(){r.unbind(),$a(n.element())},l=function(n){var t=e.filter(Iu());Xt(t,function(t){var e=t.descHandler(),o=ts(e);o(n)})},d=function(n){l({universal:ft(!0),data:ft(n)})},m=function(n,t){l({universal:ft(!1),channels:ft(n),data:ft(t)})},p=function(n,t){var o=e.filter(n);return pE(o,t)},h=function(n){return e.getById(n).fold(function(){return _t.error(new Error('Could not find component with uid: "'+n+'" in system.'))},_t.value)},v=function(n){var t=Bc(n).getOr("not found");return h(t)};return u(n),{root:ft(n),element:n.element,destroy:f,add:c,remove:s,getByUid:h,getByDom:v,addToWorld:u,removeFromWorld:a,broadcast:d,broadcastOn:m,broadcastEvent:p}},CE=Sc("form-component-change"),kE=Sc("form-close"),OE=Sc("form-cancel"),_E=Sc("form-action"),TE=Sc("form-submit"),EE=Sc("form-block"),BE=Sc("form-unblock"),DE=Sc("form-tabchange"),AE=Sc("form-resize"),ME=function(n,t){return wE.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+n.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[cC.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:lC(n.icon,t.icons),attributes:{title:t.translate(n.iconTooltip)}},action:function(t){oa(t,_E,{name:"alert-banner",value:n.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:t.translate(n.text)}}]})},FE=function(n,t){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:Gt(n.items,t.interpreter)}},IE=ft([Br("prefix","form-field"),Mh("fieldBehaviours",[Qv,Ah])]),RE=ft([dv({schema:[fr("dom")],name:"label"}),dv({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:n.text}}}},schema:[fr("text")],name:"aria-descriptor"}),fv({factory:{sketch:function(n){var t=to(n,["factory"]);return n.factory.sketch(t)}},schema:[fr("factory")],name:"field"})]),VE=function(n,t){var e=Ih(n.fieldBehaviours,[Qv.config({find:function(t){return Ov(t,n,"field")}}),Ah.config({store:{mode:"manual",getValue:function(n){return Qv.getCurrent(n).bind(Ah.getValue)},setValue:function(n,t){Qv.getCurrent(n).each(function(n){Ah.setValue(n,t)})}}})]),o=ca([Sa(function(t){var e=Tv(t,n,["label","field","aria-descriptor"]);e.field().each(function(t){var o=Sc(n.prefix);e.label().each(function(n){cc(n.element(),"for",o),cc(t.element(),"id",o)}),e["aria-descriptor"]().each(function(e){var o=Sc(n.prefix);cc(e.element(),"id",o),cc(t.element(),"aria-describedby",o)})})})]),r={getField:function(t){return Ov(t,n,"field")},getLabel:function(t){return Ov(t,n,"label")}};return{uid:n.uid,dom:n.dom,components:t,behaviours:e,events:o,apis:r}},HE=Uv({name:"FormField",configFields:IE(),partFields:RE(),factory:VE,apis:{getField:function(n,t){return n.getField(t)},getLabel:function(n,t){return n.getLabel(t)}}}),NE=ft([wr("data"),Br("inputAttributes",{}),Br("inputStyles",{}),Br("tag","input"),Br("inputClasses",[]),xl("onSetValue"),Br("styles",{}),Br("eventOrder",{}),Mh("inputBehaviours",[Ah,mw]),Br("selectOnFocus",!0)]),PE=function(n){return bd([mw.config({onFocus:n.selectOnFocus?function(n){var t=n.element(),e=Us(t);t.dom().setSelectionRange(0,e.length)}:at})])},zE=function(n){return vt(vt({},PE(n)),Ih(n.inputBehaviours,[Ah.config({store:vt(vt({mode:"manual"},n.data.map(function(n){return{initialValue:n}}).getOr({})),{getValue:function(n){return Us(n.element())},setValue:function(n,t){var e=Us(n.element());e!==t&&Ws(n.element(),t)}}),onSetValue:n.onSetValue})]))},LE=function(n){return{tag:n.tag,attributes:vt({type:"text"},n.inputAttributes),styles:n.inputStyles,classes:n.inputClasses}},jE=function(n){return{uid:n.uid,dom:LE(n),components:[],behaviours:zE(n),eventOrder:n.eventOrder}},UE=jv({name:"Input",configFields:NE(),factory:jE}),WE={},GE={exports:WE};!function(n,t,e,o){!function(o){if("object"==typeof t&&"undefined"!=typeof e)e.exports=o();else if("function"==typeof n&&n.amd)n([],o);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.EphoxContactWrapper=o()}}(function(){return function(){function n(t,e,r){function i(a,c){if(!e[a]){if(!t[a]){var s="function"==typeof o&&o;if(!c&&s)return s(a,!0);if(u)return u(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var l=e[a]={exports:{}};t[a][0].call(l.exports,function(n){var e=t[a][1][n];return i(e||n)},l,l.exports,n,t,e,r)}return e[a].exports}for(var u="function"==typeof o&&o,a=0;a1)for(var e=1;et;t++)u(n,n._deferreds[t]);n._deferreds=null}function f(n,t,e){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.promise=e}function l(n,t){var e=!1;try{n(function(n){e||(e=!0,a(t,n))},function(n){e||(e=!0,c(t,n))})}catch(o){if(e)return;e=!0,c(t,o)}}var d=setTimeout;i.prototype["catch"]=function(n){return this.then(null,n)},i.prototype.then=function(n,t){var e=new this.constructor(o);return u(this,new f(n,t,e)),e},i.all=function(n){var t=Array.prototype.slice.call(n);return new i(function(n,e){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(n){o(i,n)},e)}t[i]=u,0===--r&&n(t)}catch(c){e(c)}}if(0===t.length)return n([]);for(var r=t.length,i=0;io;o++)n[o].then(t,e)})},i._immediateFn="function"==typeof n?function(t){n(t)}:function(n){d(n,0)},i._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},i._setImmediateFn=function(n){i._immediateFn=n},i._setUnhandledRejectionFn=function(n){i._unhandledRejectionFn=n},"undefined"!=typeof t&&t.exports?t.exports=i:e.Promise||(e.Promise=i)}(this)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(n,t,e){(function(t,o){function r(n,t){this._id=n,this._clearFn=t}var i=n("process/browser.js").nextTick,u=Function.prototype.apply,a=Array.prototype.slice,c={},s=0;e.setTimeout=function(){return new r(u.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new r(u.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(n){n.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(n,t){clearTimeout(n._idleTimeoutId),n._idleTimeout=t},e.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},e._unrefActive=e.active=function(n){clearTimeout(n._idleTimeoutId);var t=n._idleTimeout;t>=0&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},t))},e.setImmediate="function"==typeof t?t:function(n){var t=s++,o=arguments.length<2?!1:a.call(arguments,1);return c[t]=!0,i(function(){c[t]&&(o?n.apply(null,o):n.call(null),e.clearImmediate(t))}),t},e.clearImmediate="function"==typeof o?o:function(n){delete c[n]}}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(n,t){var e=n("promise-polyfill"),o=function(){return"undefined"!=typeof window?window:Function("return this;")()}();t.exports={boltExport:o.Promise||e}},{"promise-polyfill":2}]},{},[4])(4)})}(void 0,WE,GE,void 0);var XE,YE=GE.exports.boltExport,qE=function(t){var e=St.none(),o=[],r=function(n){return qE(function(t){i(function(e){t(n(e))})})},i=function(n){a()?s(n):o.push(n)},u=function(n){e=St.some(n),c(o),o=[]},a=function(){return e.isSome()},c=function(n){Xt(n,s)},s=function(t){e.each(function(e){n.setTimeout(function(){t(e)},0)})};return t(u),{get:i,map:r,isReady:a}},KE=function(n){return qE(function(t){t(n)})},JE={nu:qE,pure:KE},$E=function(t){n.setTimeout(function(){throw t},0)},QE=function(n){var t=function(t){n().then(t,$E)},e=function(t){return QE(function(){return n().then(t)})},o=function(t){return QE(function(){return n().then(function(n){return t(n).toPromise()})})},r=function(t){return QE(function(){return n().then(function(){return t.toPromise()})})},i=function(){return JE.nu(t)},u=function(){var t=null;return QE(function(){return null===t&&(t=n()),t})},a=n;return{map:e,bind:o,anonBind:r,toLazy:i,toCached:u,toPromise:a,get:t}},ZE=function(n){return QE(function(){return new YE(n)})},nB=function(n){return QE(function(){return YE.resolve(n)})},tB={nu:ZE,pure:nB},eB=["input","textarea"],oB=function(n){var t=ec(n);return Lt(eB,t)},rB=function(n,t){var e=t.getRoot(n).getOr(n.element());Cs(e,t.invalidClass),t.notify.each(function(t){oB(n.element())&&cc(n.element(),"aria-invalid",!1),t.getContainer(n).each(function(n){nc(n,t.validHtml)}),t.onValid(n)})},iB=function(n,t,e,o){var r=t.getRoot(n).getOr(n.element());ws(r,t.invalidClass),t.notify.each(function(t){oB(n.element())&&cc(n.element(),"aria-invalid",!0),t.getContainer(n).each(function(n){nc(n,o)}),t.onInvalid(n,o)})},uB=function(n,t){return t.validator.fold(function(){return tB.pure(_t.value(!0))},function(t){return t.validate(n)})},aB=function(n,t,e){return t.notify.each(function(t){t.onValidate(n)}),uB(n,t).map(function(o){return n.getSystem().isConnected()?o.fold(function(o){return iB(n,t,e,o),_t.error(o) },function(e){return rB(n,t),_t.value(e)}):_t.error("No longer in system")})},cB=function(n,t){var e=t.getRoot(n).getOr(n.element());return ks(e,t.invalidClass)},sB=Object.freeze({__proto__:null,markValid:rB,markInvalid:iB,query:uB,run:aB,isInvalid:cB}),fB=function(n,t){return n.validator.map(function(e){return ca([da(e.onEvent,function(e){aB(e,n,t).get(lt)})].concat(e.validateOnLoad?[Sa(function(e){aB(e,n,t).get(at)})]:[]))}).getOr({})},lB=Object.freeze({__proto__:null,events:fB}),dB=[fr("invalidClass"),Br("getRoot",St.none),Tr("notify",[Br("aria","alert"),Br("getContainer",St.none),Br("validHtml",""),xl("onValid"),xl("onInvalid"),xl("onValidate")]),Tr("validator",[fr("validate"),Br("onEvent","input"),Br("validateOnLoad",!0)])],mB=xd({fields:dB,name:"invalidating",active:lB,apis:sB,extra:{validation:function(n){return function(t){var e=Ah.getValue(t);return tB.pure(n(e))}}}}),gB=function(n,t){return qc({attributes:oo([{key:t.tabAttr,value:"true"}])})},pB=Object.freeze({__proto__:null,exhibit:gB}),hB=[Br("tabAttr","data-alloy-tabstop")],vB=xd({fields:hB,name:"tabstopping",active:pB}),bB=function(n,t,e,o){var r=xB(n,t,e,o);return HE.sketch(r)},yB=function(n,t){return bB(n,t,[],[])},xB=function(n,t,e,o){return{dom:SB(e),components:n.toArray().concat([t]),fieldBehaviours:bd(o)}},wB=function(){return SB([])},SB=function(n){return{tag:"div",classes:["tox-form__group"].concat(n)}},CB=function(n,t){return HE.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(n)}})},kB=function(n,t,e,o){return e.getOrCreate(n,t,o)},OB=Object.freeze({__proto__:null,getCoupled:kB}),_B=[lr("others",Yo(_t.value,tr()))],TB=function(){var n={},t=function(t,e,o){var r=de(e.others);if(r)return xe(n,o).getOrThunk(function(){var r=xe(e.others,o).getOrDie("No information found for coupled component: "+o),i=r(t),u=t.getSystem().build(i);return n[o]=u,u});throw new Error("Cannot find coupled component: "+o+". Known coupled components: "+JSON.stringify(r,null,2))},e=ft({});return Uc({readState:e,getOrCreate:t})},EB=Object.freeze({__proto__:null,init:TB}),BB=xd({fields:_B,name:"coupling",apis:OB,state:EB}),DB=ft("sink"),AB=ft(dv({name:DB(),overrides:ft({dom:{tag:"div"},behaviours:bd([pp.config({useFixed:pt})]),events:ca([ya(Cu()),ya(hu()),ya(Tu())])})}));!function(n){n[n.HighlightFirst=0]="HighlightFirst",n[n.HighlightNone=1]="HighlightNone"}(XE||(XE={}));var MB,FB=function(n,t){var e=n.getHotspot(t).getOr(t),o="hotspot",r=n.getAnchorOverrides();return n.layouts.fold(function(){return{anchor:o,hotspot:e,overrides:r}},function(n){return{anchor:o,hotspot:e,overrides:r,layouts:n}})},IB=function(n,t,e){var o=n.fetch;return o(e).map(t)},RB=function(n,t,e,o,r,i,u){var a=IB(n,t,o),c=zB(o,n);return a.map(function(n){return n.bind(function(n){return St.from(pS.sketch(vt(vt({},i.menu()),{uid:Dc(""),data:n,highlightImmediately:u===XE.HighlightFirst,onOpenMenu:function(n,t){var o=c().getOrDie();pp.position(o,e,t),Kp.decloak(r)},onOpenSubmenu:function(n,t,e){var o=c().getOrDie();pp.position(o,{anchor:"submenu",item:t},e),Kp.decloak(r)},onRepositionMenu:function(n,t,o){var r=c().getOrDie();pp.position(r,e,t),Xt(o,function(n){pp.position(r,{anchor:"submenu",item:n.triggeringItem},n.triggeredMenu)})},onEscape:function(){return mw.focus(o),Kp.close(r),St.some(!0)}})))})})},VB=function(n,t,e,o,r,i,u){var a=FB(n,e),c=RB(n,t,a,e,o,r,u);return c.map(function(n){return n.fold(function(){Kp.isOpen(o)&&Kp.close(o)},function(n){Kp.cloak(o),Kp.open(o,n),i(o)}),o})},HB=function(n,t,e,o){return Kp.close(o),tB.pure(o)},NB=function(n,t,e,o,r,i){var u=BB.getCoupled(e,"sandbox"),a=Kp.isOpen(u),c=a?HB:VB;return c(n,t,e,u,o,r,i)},PB=function(n,t,e){var o=Qv.getCurrent(t).getOr(t),r=bf(n.element());e?Fs(o.element(),"min-width",r+"px"):vf(o.element(),r)},zB=function(n,t){return n.getSystem().getByUid(t.uid+"-"+DB()).map(function(n){return function(){return _t.value(n)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return _t.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(n)}})})},LB=function(n){Kp.getState(n).each(function(n){pS.repositionMenus(n)})},jB=function(n,t,e){var o=Zf(),r=function(r,i){var u=FB(n,t);o.link(t.element()),n.matchWidth&&PB(u.hotspot,i,n.useMinWidth),n.onOpen(u,r,i),void 0!==e&&void 0!==e.onOpen&&e.onOpen(r,i)},i=function(n,r){o.unlink(t.element()),void 0!==e&&void 0!==e.onClose&&e.onClose(n,r)},u=zB(t,n);return{dom:{tag:"div",classes:n.sandboxClasses,attributes:{id:o.id(),role:"listbox"}},behaviours:Rh.augment(n.sandboxBehaviours,[Ah.config({store:{mode:"memory",initialValue:t}}),Kp.config({onOpen:r,onClose:i,isPartOf:function(n,e,o){return tl(e,o)||tl(t,o)},getAttachPoint:function(){return u().getOrDie()}}),Qv.config({find:function(n){return Kp.getState(n).bind(function(n){return Qv.getCurrent(n)})}}),Ed.config({channels:vt(vt({},nh({isExtraPart:gt})),eh({doReposition:LB}))})])}},UB=function(n){var t=BB.getCoupled(n,"sandbox");LB(t)},WB=function(){return[Br("sandboxClasses",[]),Rh.field("sandboxBehaviours",[Qv,Ed,Kp,Ah])]},GB=ft([fr("dom"),fr("fetch"),xl("onOpen"),wl("onExecute"),Br("getHotspot",St.some),Br("getAnchorOverrides",ft({})),Om(),Mh("dropdownBehaviours",[Mw,BB,Xx,mw]),fr("toggleClass"),Br("eventOrder",{}),wr("lazySink"),Br("matchWidth",!1),Br("useMinWidth",!1),wr("role")].concat(WB())),XB=ft([lv({schema:[vl()],name:"menu",defaults:function(n){return{onExecute:n.onExecute}}}),AB()]),YB=function(n,t,e,o){var r,i=function(t){return xe(n.dom,"attributes").bind(function(n){return xe(n,t)})},u=function(n){Kp.getState(n).each(function(n){pS.highlightPrimary(n)})},a=function(t){var e=u;NB(n,function(n){return n},t,o,e,XE.HighlightFirst).get(at)},c={expand:function(t){Mw.isOn(t)||NB(n,function(n){return n},t,o,at,XE.HighlightNone).get(at)},open:function(t){Mw.isOn(t)||NB(n,function(n){return n},t,o,at,XE.HighlightFirst).get(at)},isOpen:Mw.isOn,close:function(t){Mw.isOn(t)&&NB(n,function(n){return n},t,o,at,XE.HighlightFirst).get(at)},repositionMenus:function(n){Mw.isOn(n)&&UB(n)}},s=function(n){return ra(n),St.some(!0)};return{uid:n.uid,dom:n.dom,components:t,behaviours:Ih(n.dropdownBehaviours,[Mw.config({toggleClass:n.toggleClass,aria:{mode:"expanded"}}),BB.config({others:{sandbox:function(t){return jB(n,t,{onOpen:function(){Mw.on(t)},onClose:function(){Mw.off(t)}})}}}),Xx.config({mode:"special",onSpace:s,onEnter:s,onDown:function(n){if(qB.isOpen(n)){var t=BB.getCoupled(n,"sandbox");u(t)}else qB.open(n);return St.some(!0)},onEscape:function(n){return qB.isOpen(n)?(qB.close(n),St.some(!0)):St.none()}}),mw.config({})]),events:Iw(St.some(a)),eventOrder:vt(vt({},n.eventOrder),(r={},r[Ru()]=["disabling","toggling","alloy.base.behaviour"],r)),apis:c,domModification:{attributes:vt(vt({"aria-haspopup":"true"},n.role.fold(function(){return{}},function(n){return{role:n}})),"button"===n.dom.tag?{type:i("type").getOr("button")}:{})}}},qB=Uv({name:"Dropdown",configFields:GB(),partFields:XB(),factory:YB,apis:{open:function(n,t){return n.open(t)},expand:function(n,t){return n.expand(t)},close:function(n,t){return n.close(t)},isOpen:function(n,t){return n.isOpen(t)},repositionMenus:function(n,t){return n.repositionMenus(t)}}}),KB=function(){return qc({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})},JB=function(){return ca([sa(Bu(),ft(!0))])},$B=Object.freeze({__proto__:null,events:JB,exhibit:KB}),QB=xd({fields:[],name:"unselecting",active:$B}),ZB=function(n,t){return qB.sketch({dom:n.dom,components:n.components,toggleClass:"mce-active",dropdownBehaviours:bd([QB.config({}),vB.config({})]),layouts:n.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:t.getSink,fetch:function(e){return tB.nu(function(t){return n.fetch(t)}).map(function(o){return St.from(jT(Be(xT(Sc("menu-value"),o,function(t){n.onItemAction(e,t)},n.columns,n.presets,FO.CLOSE_ON_EXECUTE,function(){return!1},t.providers),{movement:ST(n.columns,n.presets)})))})},parts:{menu:cT(!1,1,n.presets)}})},nD=Sc("color-input-change"),tD=Sc("color-swatch-change"),eD=Sc("color-picker-cancel"),oD=function(n,t,e){var o=HE.parts().field({factory:UE,inputClasses:["tox-textfield"],onSetValue:function(n){return mB.run(n).get(function(){})},inputBehaviours:bd([vB.config({}),mB.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(n){return Va(n.element())},notify:{onValid:function(n){var t=Ah.getValue(n);oa(n,nD,{color:t})}},validator:{validateOnLoad:!1,validate:function(n){var t=Ah.getValue(n);if(0===t.length)return tB.pure(_t.value(!0));var e=Xr.fromTag("span");Fs(e,"background-color",t);var o=Ns(e,"background-color").fold(function(){return _t.error("blah")},function(){return _t.value(t)});return tB.pure(o)}}})]),selectOnFocus:!1}),r=n.label.map(function(n){return CB(n,t.providers)}),i=function(n,t){oa(n,tD,{value:t})},u=function(n,t){a.getOpt(n).each(function(n){"custom"===t?e.colorPicker(function(t){t.fold(function(){return ea(n,eD)},function(t){i(n,t),M_.addColor(t)})},"#ffffff"):"remove"===t?i(n,""):i(n,t)})},a=sC(ZB({dom:{tag:"span",attributes:{"aria-label":t.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[Ql,$l,ed]},onLtr:function(){return[$l,Ql,ed]}},components:[],fetch:eT.getFetch(e.getColors(),e.hasCustomColors()),columns:e.getColorCols(),presets:"color",onItemAction:u},t));return HE.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:r.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[o,a.asSpec()]}]),fieldBehaviours:bd([rw("form-field-events",[da(nD,function(t,e){a.getOpt(t).each(function(n){Fs(n.element(),"background-color",e.event().color())}),oa(t,CE,{name:n.name})}),da(tD,function(n,t){HE.getField(n).each(function(e){Ah.setValue(e,t.event().value()),Qv.getCurrent(n).each(mw.focus)})}),da(eD,function(n){HE.getField(n).each(function(){Qv.getCurrent(n).each(mw.focus)})})])])})},rD=function(n,t,e){return{hue:ft(n),saturation:ft(t),value:ft(e)}},iD=function(n){var t=0,e=0,o=0,r=n.red()/255,i=n.green()/255,u=n.blue()/255,a=Math.min(r,Math.min(i,u)),c=Math.max(r,Math.max(i,u));if(a===c)return o=a,rD(0,0,100*o);var s=r===a?i-u:u===a?r-i:u-r;return t=r===a?3:u===a?1:5,t=60*(t-s/(c-a)),e=(c-a)/c,o=c,rD(Math.round(t),Math.round(100*e),Math.round(100*o))},uD=function(n){var t=(100-n)/100*360,e=rD(t,100,100),o=g_(e);return u_(o)},aD=ft(Sc("rgb-hex-update")),cD=ft(Sc("slider-update")),sD=ft(Sc("palette-update")),fD=dv({schema:[fr("dom")],name:"label"}),lD=function(n){return dv({name:""+n+"-edge",overrides:function(t){var e=t.model.manager.edgeActions[n];return e.fold(function(){return{}},function(n){return{events:ca([ma(du(),function(t,e,o){return n(t,o)},[t]),ma(hu(),function(t,e,o){return n(t,o)},[t]),ma(vu(),function(t,e,o){o.mouseIsDown.get()&&n(t,o)},[t])])}})}})},dD=lD("top-left"),mD=lD("top"),gD=lD("top-right"),pD=lD("right"),hD=lD("bottom-right"),vD=lD("bottom"),bD=lD("bottom-left"),yD=lD("left"),xD=fv({name:"thumb",defaults:ft({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:ca([va(du(),n,"spectrum"),va(mu(),n,"spectrum"),va(gu(),n,"spectrum"),va(hu(),n,"spectrum"),va(vu(),n,"spectrum"),va(yu(),n,"spectrum")])}}}),wD=fv({schema:[Pr("mouseIsDown",function(){return zr(!1)})],name:"spectrum",overrides:function(n){var t=n.model,e=t.manager,o=function(t,o){return e.getValueFromEvent(o).map(function(o){return e.setValueFrom(t,n,o)})};return{behaviours:bd([Xx.config({mode:"special",onLeft:function(t){return e.onLeft(t,n)},onRight:function(t){return e.onRight(t,n)},onUp:function(t){return e.onUp(t,n)},onDown:function(t){return e.onDown(t,n)}}),mw.config({})]),events:ca([da(du(),o),da(mu(),o),da(hu(),o),da(vu(),function(t,e){n.mouseIsDown.get()&&o(t,e)})])}}}),SD=[fD,yD,pD,mD,vD,dD,gD,bD,hD,xD,wD],CD="slider.change.value",kD=ft(CD),OD=function(n){return-1!==n.type.indexOf("touch")},_D=function(n){var t=n.event().raw();if(OD(t)){var e=t;return void 0!==e.touches&&1===e.touches.length?St.some(e.touches[0]).map(function(n){return lf(n.clientX,n.clientY)}):St.none()}var o=t;return void 0!==o.clientX?St.some(o).map(function(n){return lf(n.clientX,n.clientY)}):St.none()},TD="top",ED="right",BD="bottom",DD="left",AD=function(n){return n.model.minX},MD=function(n){return n.model.minY},FD=function(n){return n.model.minX-1},ID=function(n){return n.model.minY-1},RD=function(n){return n.model.maxX},VD=function(n){return n.model.maxY},HD=function(n){return n.model.maxX+1},ND=function(n){return n.model.maxY+1},PD=function(n,t,e){return t(n)-e(n)},zD=function(n){return PD(n,RD,AD)},LD=function(n){return PD(n,VD,MD)},jD=function(n){return zD(n)/2},UD=function(n){return LD(n)/2},WD=function(n){return n.stepSize},GD=function(n){return n.snapToGrid},XD=function(n){return n.snapStart},YD=function(n){return n.rounded},qD=function(n,t){return void 0!==n[t+"-edge"]},KD=function(n){return qD(n,DD)},JD=function(n){return qD(n,ED)},$D=function(n){return qD(n,TD)},QD=function(n){return qD(n,BD)},ZD=function(n){return n.model.value.get()},nA=function(n){return{x:ft(n)}},tA=function(n){return{y:ft(n)}},eA=function(n,t){return{x:ft(n),y:ft(t)}},oA=function(n,t){oa(n,kD(),{value:t})},rA=function(n,t){oA(n,eA(FD(t),ID(t)))},iA=function(n,t){oA(n,tA(ID(t)))},uA=function(n,t){oA(n,eA(jD(t),ID(t)))},aA=function(n,t){oA(n,eA(HD(t),ID(t)))},cA=function(n,t){oA(n,nA(HD(t)))},sA=function(n,t){oA(n,eA(HD(t),UD(t)))},fA=function(n,t){oA(n,eA(HD(t),ND(t)))},lA=function(n,t){oA(n,tA(ND(t)))},dA=function(n,t){oA(n,eA(jD(t),ND(t)))},mA=function(n,t){oA(n,eA(FD(t),ND(t)))},gA=function(n,t){oA(n,nA(FD(t)))},pA=function(n,t){oA(n,eA(FD(t),UD(t)))},hA=function(n,t,e,o){return t>n?n:n>e?e:n===t?t-1:Math.max(t,n-o)},vA=function(n,t,e,o){return n>e?n:t>n?t:n===e?e+1:Math.min(e,n+o)},bA=function(n,t,e){return Math.max(t,Math.min(e,n))},yA=function(n,t,e,o,r){return r.fold(function(){var r=n-t,i=Math.round(r/o)*o;return bA(t+i,t-1,e+1)},function(t){var r=(n-t)%o,i=Math.round(r/o),u=Math.floor((n-t)/o),a=Math.floor((e-t)/o),c=Math.min(a,u+i),s=t+c*o;return Math.max(t,s)})},xA=function(n,t,e){return Math.min(e,Math.max(n,t))-t},wA=function(n){var t=n.min,e=n.max,o=n.range,r=n.value,i=n.step,u=n.snap,a=n.snapStart,c=n.rounded,s=n.hasMinEdge,f=n.hasMaxEdge,l=n.minBound,d=n.maxBound,m=n.screenRange,g=s?t-1:t,p=f?e+1:e;if(l>r)return g;if(r>d)return p;var h=xA(r,l,d),v=bA(h/m*o+t,g,p);return u&&v>=t&&e>=v?yA(v,t,e,i,a):c?Math.round(v):v},SA=function(n){var t=n.min,e=n.max,o=n.range,r=n.value,i=n.hasMinEdge,u=n.hasMaxEdge,a=n.maxBound,c=n.maxOffset,s=n.centerMinEdge,f=n.centerMaxEdge;return t>r?i?0:s:r>e?u?a:f:(r-t)/o*c},CA="top",kA="right",OA="bottom",_A="left",TA="width",EA="height",BA=function(n){return n.element().dom().getBoundingClientRect()},DA=function(n,t){return n[t]},AA=function(n){var t=BA(n);return DA(t,_A)},MA=function(n){var t=BA(n);return DA(t,kA)},FA=function(n){var t=BA(n);return DA(t,CA)},IA=function(n){var t=BA(n);return DA(t,OA)},RA=function(n){var t=BA(n);return DA(t,TA)},VA=function(n){var t=BA(n);return DA(t,EA)},HA=function(n,t,e){return(n+t)/2-e},NA=function(n,t){var e=BA(n),o=BA(t),r=DA(e,_A),i=DA(e,kA),u=DA(o,_A);return HA(r,i,u)},PA=function(n,t){var e=BA(n),o=BA(t),r=DA(e,CA),i=DA(e,OA),u=DA(o,CA);return HA(r,i,u)},zA=function(n,t){oa(n,kD(),{value:t})},LA=function(n){return{x:ft(n)}},jA=function(n,t,e){var o={min:AD(t),max:RD(t),range:zD(t),value:e,step:WD(t),snap:GD(t),snapStart:XD(t),rounded:YD(t),hasMinEdge:KD(t),hasMaxEdge:JD(t),minBound:AA(n),maxBound:MA(n),screenRange:RA(n)};return wA(o)},UA=function(n,t,e){var o=jA(n,t,e),r=LA(o);return zA(n,r),o},WA=function(n,t){var e=AD(t);zA(n,LA(e))},GA=function(n,t){var e=RD(t);zA(n,LA(e))},XA=function(n,t,e){var o=n>0?vA:hA,r=o(ZD(e).x(),AD(e),RD(e),WD(e));return zA(t,LA(r)),St.some(r)},YA=function(n){return function(t,e){return XA(n,t,e).map(function(){return!0})}},qA=function(n){var t=_D(n);return t.map(function(n){return n.left()})},KA=function(n,t,e,o,r){var i=0,u=RA(n),a=o.bind(function(t){return St.some(NA(t,n))}).getOr(i),c=r.bind(function(t){return St.some(NA(t,n))}).getOr(u),s={min:AD(t),max:RD(t),range:zD(t),value:e,hasMinEdge:KD(t),hasMaxEdge:JD(t),minBound:AA(n),minOffset:i,maxBound:MA(n),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return SA(s)},JA=function(n,t,e,o,r,i){var u=KA(t,i,e,o,r);return AA(t)-AA(n)+u},$A=function(n,t,e,o){var r=ZD(e),i=JA(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=bf(t.element())/2;Fs(t.element(),"left",i-u+"px")},QA=YA(-1),ZA=YA(1),nM=St.none,tM=St.none,eM={"top-left":St.none(),top:St.none(),"top-right":St.none(),right:St.some(cA),"bottom-right":St.none(),bottom:St.none(),"bottom-left":St.none(),left:St.some(gA)},oM=Object.freeze({__proto__:null,setValueFrom:UA,setToMin:WA,setToMax:GA,findValueOfOffset:jA,getValueFromEvent:qA,findPositionOfValue:JA,setPositionFromValue:$A,onLeft:QA,onRight:ZA,onUp:nM,onDown:tM,edgeActions:eM}),rM=function(n,t){oa(n,kD(),{value:t})},iM=function(n){return{y:ft(n)}},uM=function(n,t,e){var o={min:MD(t),max:VD(t),range:LD(t),value:e,step:WD(t),snap:GD(t),snapStart:XD(t),rounded:YD(t),hasMinEdge:$D(t),hasMaxEdge:QD(t),minBound:FA(n),maxBound:IA(n),screenRange:VA(n)};return wA(o)},aM=function(n,t,e){var o=uM(n,t,e),r=iM(o);return rM(n,r),o},cM=function(n,t){var e=MD(t);rM(n,iM(e))},sM=function(n,t){var e=VD(t);rM(n,iM(e))},fM=function(n,t,e){var o=n>0?vA:hA,r=o(ZD(e).y(),MD(e),VD(e),WD(e));return rM(t,iM(r)),St.some(r)},lM=function(n){return function(t,e){return fM(n,t,e).map(function(){return!0})}},dM=function(n){var t=_D(n);return t.map(function(n){return n.top()})},mM=function(n,t,e,o,r){var i=0,u=VA(n),a=o.bind(function(t){return St.some(PA(t,n))}).getOr(i),c=r.bind(function(t){return St.some(PA(t,n))}).getOr(u),s={min:MD(t),max:VD(t),range:LD(t),value:e,hasMinEdge:$D(t),hasMaxEdge:QD(t),minBound:FA(n),minOffset:i,maxBound:IA(n),maxOffset:u,centerMinEdge:a,centerMaxEdge:c};return SA(s)},gM=function(n,t,e,o,r,i){var u=mM(t,i,e,o,r);return FA(t)-FA(n)+u},pM=function(n,t,e,o){var r=ZD(e),i=gM(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),u=af(t.element())/2;Fs(t.element(),"top",i-u+"px")},hM=St.none,vM=St.none,bM=lM(-1),yM=lM(1),xM={"top-left":St.none(),top:St.some(iA),"top-right":St.none(),right:St.none(),"bottom-right":St.none(),bottom:St.some(lA),"bottom-left":St.none(),left:St.none()},wM=Object.freeze({__proto__:null,setValueFrom:aM,setToMin:cM,setToMax:sM,findValueOfOffset:uM,getValueFromEvent:dM,findPositionOfValue:gM,setPositionFromValue:pM,onLeft:hM,onRight:vM,onUp:bM,onDown:yM,edgeActions:xM}),SM=function(n,t){oa(n,kD(),{value:t})},CM=function(n,t){return{x:ft(n),y:ft(t)}},kM=function(n,t,e){var o=jA(n,t,e.left()),r=uM(n,t,e.top()),i=CM(o,r);return SM(n,i),i},OM=function(n,t,e,o){var r=n>0?vA:hA,i=t?ZD(o).x():r(ZD(o).x(),AD(o),RD(o),WD(o)),u=t?r(ZD(o).y(),MD(o),VD(o),WD(o)):ZD(o).y();return SM(e,CM(i,u)),St.some(i)},_M=function(n,t){return function(e,o){return OM(n,t,e,o).map(function(){return!0})}},TM=function(n,t){var e=AD(t),o=MD(t);SM(n,CM(e,o))},EM=function(n,t){var e=RD(t),o=VD(t);SM(n,CM(e,o))},BM=function(n){return _D(n)},DM=function(n,t,e,o){var r=ZD(e),i=JA(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=gM(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),a=bf(t.element())/2,c=af(t.element())/2;Fs(t.element(),"left",i-a+"px"),Fs(t.element(),"top",u-c+"px")},AM=_M(-1,!1),MM=_M(1,!1),FM=_M(-1,!0),IM=_M(1,!0),RM={"top-left":St.some(rA),top:St.some(uA),"top-right":St.some(aA),right:St.some(sA),"bottom-right":St.some(fA),bottom:St.some(dA),"bottom-left":St.some(mA),left:St.some(pA)},VM=Object.freeze({__proto__:null,setValueFrom:kM,setToMin:TM,setToMax:EM,getValueFromEvent:BM,setPositionFromValue:DM,onLeft:AM,onRight:MM,onUp:FM,onDown:IM,edgeActions:RM}),HM=[Br("stepSize",1),Br("onChange",at),Br("onChoose",at),Br("onInit",at),Br("onDragStart",at),Br("onDragEnd",at),Br("snapToGrid",!1),Br("rounded",!0),wr("snapStart"),lr("model",nr("mode",{x:[Br("minX",0),Br("maxX",100),Pr("value",function(n){return zr(n.mode.minX)}),fr("getInitialValue"),kl("manager",oM)],y:[Br("minY",0),Br("maxY",100),Pr("value",function(n){return zr(n.mode.minY)}),fr("getInitialValue"),kl("manager",wM)],xy:[Br("minX",0),Br("maxX",100),Br("minY",0),Br("maxY",100),Pr("value",function(n){return zr({x:ft(n.mode.minX),y:ft(n.mode.minY)})}),fr("getInitialValue"),kl("manager",VM)]})),Mh("sliderBehaviours",[Xx,Ah]),Pr("mouseIsDown",function(){return zr(!1)})],NM=function(n,t){var e,o=function(t){return _v(t,n,"thumb")},r=function(t){return _v(t,n,"spectrum")},i=function(t){return Ov(t,n,"left-edge")},u=function(t){return Ov(t,n,"right-edge")},a=function(t){return Ov(t,n,"top-edge")},c=function(t){return Ov(t,n,"bottom-edge")},s=n.model,f=s.manager,l=function(t,e){f.setPositionFromValue(t,e,n,{getLeftEdge:i,getRightEdge:u,getTopEdge:a,getBottomEdge:c,getSpectrum:r})},d=function(t,e){s.value.set(e);var r=o(t);return l(t,r),n.onChange(t,r,e),St.some(!0)},m=function(t){f.setToMin(t,n)},g=function(t){f.setToMax(t,n)},p=function(t){var e=function(){Ov(t,n,"thumb").each(function(e){var o=s.value.get();n.onChoose(t,e,o)})},o=n.mouseIsDown.get();n.mouseIsDown.set(!1),o&&e()},h=function(t,e){e.stop(),n.mouseIsDown.set(!0),n.onDragStart(t,o(t))},v=function(t,e){e.stop(),n.onDragEnd(t,o(t)),p(t)};return{uid:n.uid,dom:n.dom,components:t,behaviours:Ih(n.sliderBehaviours,[Xx.config({mode:"special",focusIn:function(t){return Ov(t,n,"spectrum").map(Xx.focusIn).map(ft(!0))}}),Ah.config({store:{mode:"manual",getValue:function(){return s.value.get()}}}),Ed.config({channels:(e={},e[Qp()]={onReceive:p},e)})]),events:ca([da(kD(),function(n,t){d(n,t.event().value())}),Sa(function(t){var e=s.getInitialValue();s.value.set(e);var i=o(t);l(t,i);var u=r(t);n.onInit(t,i,u,s.value.get())}),da(du(),h),da(gu(),v),da(hu(),h),da(yu(),v)]),apis:{resetToMin:m,resetToMax:g,changeValue:d,refresh:l},domModification:{styles:{position:"relative"}}}},PM=Uv({name:"Slider",configFields:HM,partFields:SD,factory:NM,apis:{resetToMin:function(n,t){n.resetToMin(t)},resetToMax:function(n,t){n.resetToMax(t)},refresh:function(n,t){n.refresh(t)}}}),zM=function(n,t){var e=PM.parts().spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=PM.parts().thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return PM.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:ft({y:ft(0)})},components:[e,o],sliderBehaviours:bd([mw.config({})]),onChange:function(n,t,e){oa(n,cD(),{value:e})}})},LM="form",jM=[Mh("formBehaviours",[Ah])],UM=function(n){return""},WM=function(n){var t=function(){var n=[],t=function(t,e){return n.push(t),xv(LM,UM(t),e)};return{field:t,record:function(){return n}}}(),e=n(t),o=t.record(),r=Gt(o,function(n){return fv({name:n,pname:UM(n)})});return Hv(LM,jM,r,XM,e)},GM=function(n,t){return n.fold(function(){return _t.error(t)},_t.value)},XM=function(n,t){return{uid:n.uid,dom:n.dom,components:t,behaviours:Ih(n.formBehaviours,[Ah.config({store:{mode:"manual",getValue:function(t){var e=Ev(t,n);return pe(e,function(n,t){return n().bind(function(n){var e=Qv.getCurrent(n);return GM(e,new Error("Cannot find a current component to extract the value from for form part '"+t+"': "+vc(n.element())))}).map(Ah.getValue)})},setValue:function(t,e){ge(e,function(e,o){Ov(t,n,o).each(function(n){Qv.getCurrent(n).each(function(n){Ah.setValue(n,e)})})})}}})]),apis:{getField:function(t,e){return Ov(t,n,e).bind(Qv.getCurrent)}}}},YM={getField:Lc(function(n,t,e){return n.getField(t,e)}),sketch:WM},qM=Sc("valid-input"),KM=Sc("invalid-input"),JM=Sc("validating-input"),$M="colorcustom.rgb.",QM=function(n,t,e,o){var r=function(e,o){return mB.config({invalidClass:t("invalid"),notify:{onValidate:function(n){oa(n,JM,{type:e})},onValid:function(n){oa(n,qM,{type:e,value:Ah.getValue(n)})},onInvalid:function(n){oa(n,KM,{type:e,value:Ah.getValue(n)})}},validator:{validate:function(t){var e=Ah.getValue(t),r=o(e)?_t.value(!0):_t.error(n("aria.input.invalid"));return tB.pure(r)},validateOnLoad:!1}})},i=function(e,o,i,u,a){var c=n($M+"range"),s=HE.parts().label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":u}}}),f=HE.parts().field({data:a,factory:UE,inputAttributes:vt({type:"text"},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[t("textfield")],inputBehaviours:bd([r(o,e),vB.config({})]),onSetValue:function(n){if(mB.isInvalid(n)){var t=mB.run(n);t.get(at)}}}),l=[s,f],d="hex"!==o?[HE.parts()["aria-descriptor"]({text:c})]:[],m=l.concat(d);return{dom:{tag:"div",attributes:{role:"presentation"}},components:m}},u=function(n,t){var e=u_(t);return YM.getField(n,"hex").each(function(t){mw.isFocused(t)||Ah.setValue(n,{hex:e.value()})}),e},a=function(n,t){var e=t.red(),o=t.green(),r=t.blue();Ah.setValue(n,{red:e,green:o,blue:r})},c=sC({dom:{tag:"div",classes:[t("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),s=function(n,t){c.getOpt(n).each(function(n){Fs(n.element(),"background-color","#"+t.value())})},f=function(){var r={red:ft(zr(St.some(255))),green:ft(zr(St.some(255))),blue:ft(zr(St.some(255))),hex:ft(zr(St.some("ffffff")))},f=function(n,t){var e=p_(t);a(n,e),g(e)},l=function(n){return r[n]().get()},d=function(n,t){r[n]().set(t)},m=function(){return l("red").bind(function(n){return l("green").bind(function(t){return l("blue").map(function(e){return d_(n,t,e,1)})})})},g=function(n){var t=n.red(),e=n.green(),o=n.blue();d("red",St.some(t)),d("green",St.some(e)),d("blue",St.some(o))},p=function(n,t){var e=t.event();"hex"!==e.type()?d(e.type(),St.none()):o(n)},h=function(n,t){e(n);var o=ZO(t);d("hex",St.some(t));var r=p_(o);a(n,r),g(r),oa(n,aD(),{hex:o}),s(n,o)},v=function(n,t,e){var o=parseInt(e,10);d(t,St.some(o)),m().each(function(t){var e=u(n,t);s(n,e)})},b=function(n){return"hex"===n.type()},y=function(n,t){var e=t.event();b(e)?h(n,e.value()):v(n,e.type(),e.value())},x=function(t){return{label:n($M+t+".label"),description:n($M+t+".description")}},w=x("red"),S=x("green"),C=x("blue"),k=x("hex");return Be(YM.sketch(function(e){return{dom:{tag:"form",classes:[t("rgb-form")],attributes:{"aria-label":n("aria.color.picker")}},components:[e.field("red",HE.sketch(i(m_,"red",w.label,w.description,255))),e.field("green",HE.sketch(i(m_,"green",S.label,S.description,255))),e.field("blue",HE.sketch(i(m_,"blue",C.label,C.description,255))),e.field("hex",HE.sketch(i(e_,"hex",k.label,k.description,"ffffff"))),c.asSpec()],formBehaviours:bd([mB.config({invalidClass:t("form-invalid")}),rw("rgb-form-events",[da(qM,y),da(KM,p),da(JM,p)])])}}),{apis:{updateHex:function(n,t){Ah.setValue(n,{hex:t.value()}),f(n,t),s(n,t)}}})},l=jv({factory:f,name:"RgbForm",configFields:[],apis:{updateHex:function(n,t,e){n.updateHex(t,e)}},extraApis:{}});return l},ZM=function(n,t){var e=PM.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[t("sv-palette-spectrum")]}}),o=PM.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette-thumb")],innerHtml:"'}}),r=function(n,t){var e=n.width,o=n.height,r=n.getContext("2d");if(null!==r){r.fillStyle=t,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)}},i=function(n,t){var e=n.components()[0].element().dom();r(e,b_(t))},u=function(){var n=ft({x:ft(0),y:ft(0)}),i=function(n,t,e){oa(n,sD(),{value:e})},u=function(n,t,e){r(e.element().dom(),b_(y_()))},a=bd([Qv.config({find:St.some}),mw.config({})]);return PM.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette")]},model:{mode:"xy",getInitialValue:n},rounded:!1,components:[e,o],onChange:i,onInit:u,sliderBehaviours:a})},a=jv({factory:u,name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(n,t,e){i(t,e)}},extraApis:{}});return a},nF=function(n,t){var e=function(e){var o=QM(n,t,e.onValidHex,e.onInvalidHex),r=ZM(n,t),i={paletteRgba:ft(zr(y_()))},u=sC(r.sketch({})),a=sC(o.sketch({})),c=function(n,t){u.getOpt(n).each(function(n){var e=p_(t);i.paletteRgba().set(e),r.setRgba(n,e)})},s=function(n,t){a.getOpt(n).each(function(n){o.updateHex(n,t)})},f=function(n,t,e){Xt(e,function(e){e(n,t)})},l=function(){var n=[s];return function(t,e){var o=e.event().value(),r=i.paletteRgba().get(),u=iD(r),a=rD(u.hue(),o.x(),100-o.y()),c=g_(a),s=u_(c);f(t,s,n)}},d=function(){var n=[c,s];return function(t,e){var o=e.event().value(),r=uD(o.y());f(t,r,n)}};return{uid:e.uid,dom:e.dom,components:[u.asSpec(),zM(n,t),a.asSpec()],behaviours:bd([rw("colour-picker-events",[da(sD(),l()),da(cD(),d())]),Qv.config({find:function(n){return a.getOpt(n)}}),Xx.config({mode:"acyclic"})])}},o=jv({name:"ColourPicker",configFields:[fr("dom"),Br("onValidHex",at),Br("onInvalidHex",at)],factory:e});return o},tF=function(){return Qv.config({find:St.some})},eF=function(n){return Qv.config({find:n.getOpt})},oF=function(n){return Qv.config({find:function(t){return za(t.element(),n).bind(function(n){return t.getSystem().getByDom(n).toOption()})}})},rF={self:tF,memento:eF,childAt:oF},iF={"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"},uF=function(n){return iF[n]},aF=function(n){return uF(n)},cF=function(){var t=function(n){return"tox-"+n},e=nF(aF,t),o=function(n){oa(n,_E,{name:"hex-valid",value:!0})},r=function(n){oa(n,_E,{name:"hex-valid",value:!1})},i=sC(e.sketch({dom:{tag:"div",classes:[t("color-picker-container")],attributes:{role:"presentation"}},onValidHex:o,onInvalidHex:r}));return{dom:{tag:"div"},components:[i.asSpec()],behaviours:bd([Ah.config({store:{mode:"manual",getValue:function(n){var t=i.get(n),e=Qv.getCurrent(t),o=e.bind(function(n){var t=Ah.getValue(n);return t.hex});return o.map(function(n){return"#"+n}).getOr("")},setValue:function(t,e){var o=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,r=o.exec(e),u=i.get(t),a=Qv.getCurrent(u);a.fold(function(){n.console.log("Can not find form")},function(n){Ah.setValue(n,{hex:St.from(r[1]).getOr("")}),YM.getField(n,"hex").each(function(n){ea(n,Ou())})})}}}),rF.self()])}},sF=tinymce.util.Tools.resolve("tinymce.Resource"),fF=function(n){return Object.prototype.hasOwnProperty.call(n,"init")},lF=function(n){var t=zr(St.none()),e=sC({dom:{tag:n.tag}}),o=zr(St.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:bd([rw("editor-foo-events",[Sa(function(r){e.getOpt(r).each(function(e){(fF(n)?n.init(e.element().dom()):sF.load(n.scriptId,n.scriptUrl).then(function(t){return t(e.element().dom(),n.settings)})).then(function(n){o.get().each(function(t){n.setValue(t)}),o.set(St.none()),t.set(St.some(n))})})})]),Ah.config({store:{mode:"manual",getValue:function(){return t.get().fold(function(){return o.get().getOr("")},function(n){return n.getValue()})},setValue:function(n,e){t.get().fold(function(){o.set(St.some(e)) },function(n){return n.setValue(e)})}}}),rF.self()]),components:[e.asSpec()]}},dF=Mo([Br("preprocess",lt),Br("postprocess",lt)]),mF=function(n,t){var e=$o("RepresentingConfigs.memento processors",dF,t);return Ah.config({store:{mode:"manual",getValue:function(t){var o=n.get(t),r=Ah.getValue(o);return e.postprocess(r)},setValue:function(t,o){var r=e.preprocess(o),i=n.get(t);Ah.setValue(i,r)}}})},gF=function(n,t,e){return Ah.config(Be({store:{mode:"manual",getValue:t,setValue:e}},n.map(function(n){return{store:{initialValue:n}}}).getOr({})))},pF=function(n,t,e){return gF(n,function(n){return t(n.element())},function(n,t){return e(n.element(),t)})},hF=function(n){return pF(n,Us,Ws)},vF=function(n){return pF(n,Za,nc)},bF=function(n){return Ah.config({store:{mode:"memory",initialValue:n}})},yF={memento:mF,withElement:pF,withComp:gF,domValue:hF,domHtml:vF,memory:bF},xF=".jpg,.jpeg,.png,.gif",wF=function(n){var t=new RegExp("("+xF.split(/\s*,\s*/).join("|")+")$","i");return Kt(fe(n),function(n){return t.test(n.name)})},SF=function(n,t){var e=function(n,t){t.stop()},o=function(n){return function(t,e){Xt(n,function(n){n(t,e)})}},r=function(n,t){if(!CO.isDisabled(n)){var e=t.event().raw();u(n,e.dataTransfer.files)}},i=function(n,t){var e=t.event().raw().target.files;u(n,e)},u=function(t,e){Ah.setValue(t,wF(e)),oa(t,CE,{name:n.name})},a=sC({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:bd([rw("input-file-events",[ya(Tu()),ya(Hu())])])}),c=function(n){return{uid:n.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:bd([yF.memory([]),rF.self(),CO.config({}),Mw.config({toggleClass:"dragenter",toggleOnExecute:!1}),rw("dropzone-events",[da("dragenter",o([e,Mw.toggle])),da("dragleave",o([e,Mw.toggle])),da("dragover",e),da("drop",o([e,r])),da(_u(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:t.translate("Drop an image here")}},cC.sketch({dom:{tag:"button",innerHtml:t.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(n){var t=a.get(n);t.element().dom().click()},buttonBehaviours:bd([vB.config({})])})]}]}},s=n.label.map(function(n){return CB(n,t)}),f=HE.parts().field({factory:{sketch:c}});return bB(s,f,["tox-form__group--stretched"],[])},CF=function(n,t){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+n.columns+"col"]},components:Gt(n.items,t.interpreter)}},kF=Sc("alloy-fake-before-tabstop"),OF=Sc("alloy-fake-after-tabstop"),_F=function(n){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:n},behaviours:bd([mw.config({ignore:!0}),vB.config({})])}},TF=function(n){return{dom:{tag:"div",classes:["tox-navobj"]},components:[_F([kF]),n,_F([OF])],behaviours:bd([rF.childAt(1)])}},EF=function(n,t){oa(n,Cu(),{raw:{which:9,shiftKey:t}})},BF=function(n,t){var e=t.element();ks(e,kF)?EF(n,!0):ks(e,OF)&&EF(n,!1)},DF=function(n){return JT(n,["."+kF,"."+OF].join(","),ft(!1))},AF={isPseudoStop:DF,onFocus:BF,craft:TF},MF=!(Ui().browser.isIE()||Ui().browser.isEdge()),FF=function(n){var t=zr("");return{getValue:function(){return t.get()},setValue:function(e,o){if(n)cc(e.element(),"srcdoc",o);else{cc(e.element(),"src","javascript:''");var r=e.element().dom().contentWindow.document;r.open(),r.write(o),r.close()}t.set(o)}}},IF=function(n,t){var e=MF&&n.sandboxed,o=vt(vt({},n.label.map(function(n){return{title:n}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),r=FF(e),i=n.label.map(function(n){return CB(n,t)}),u=function(n){return AF.craft({uid:n.uid,dom:{tag:"iframe",attributes:o},behaviours:bd([vB.config({}),mw.config({}),yF.withComp(St.none(),r.getValue,r.setValue)])})},a=HE.parts().field({factory:{sketch:u}});return bB(i,a,["tox-form__group--stretched"],[])},RF=function(){function t(n,t){return function(){return n.apply(t,arguments)}}function e(n){var t=this;return null===this._state?void this._deferreds.push(n):void s(function(){var e=t._state?n.onFulfilled:n.onRejected;if(null===e)return void(t._state?n.resolve:n.reject)(t._value);var o;try{o=e(t._value)}catch(r){return void n.reject(r)}n.resolve(o)})}function o(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void a(t(e,n),t(o,this),t(r,this))}this._state=!0,this._value=n,i.call(this)}catch(u){r.call(this,u)}}function r(n){this._state=!1,this._value=n,i.call(this)}function i(){for(var n=0,t=this._deferreds;n0&&!dI(n[n.length-1])?n.concat([gI]):n:we(t,e.toLowerCase())?n.concat([t[e.toLowerCase()]]):n:n.concat([e])},[]);return e.length>0&&dI(e[e.length-1])&&e.pop(),e},hI=function(n,t){var e=n.getSubmenuItems(),o=yI(e,t),r=Be(o.menus,eo(n.value,o.items)),i=Be(o.expansions,eo(n.value,n.value));return{item:n,menus:r,expansions:i}},vI=function(n,t){return mI(n)?hI(n,t):{item:n,menus:{},expansions:{}}},bI=function(n){if(dI(n))return n;var t=xe(n,"value").getOrThunk(function(){return Sc("generated-menu-item")});return Be({value:t},n)},yI=function(n,t){var e=pI(Bt(n)?n.split(" "):n,t);return Jt(e,function(n,e){var o=bI(e),r=vI(o,t);return{menus:Be(n.menus,r.menus),items:[r.item].concat(n.items),expansions:Be(n.expansions,r.expansions)}},{menus:{},expansions:{},items:[]})},xI=function(n,t,e,o){var r=Sc("primary-menu"),i=yI(n,e.shared.providers.menuItems());if(0===i.items.length)return St.none();var u=LT(r,i.items,t,e,o),a=pe(i.menus,function(n,o){return LT(o,n,t,e,!1)}),c=Be(a,eo(r,u));return St.from(pS.tieredData(r,c,i.expansions))},wI=function(n){return{isDisabled:function(){return CO.isDisabled(n)},setDisabled:function(t){return CO.set(n,t)},setActive:function(t){var e=n.element();t?(ws(e,"tox-tbtn--enabled"),cc(e,"aria-pressed",!0)):(Cs(e,"tox-tbtn--enabled"),mc(e,"aria-pressed"))},isActive:function(){return ks(n.element(),"tox-tbtn--enabled")}}},SI=function(n,t,e,o){return fI({text:n.text,icon:n.icon,tooltip:n.tooltip,role:o,fetch:function(t){n.fetch(function(n){t(xI(n,FO.CLOSE_ON_EXECUTE,e,!1))})},onSetup:n.onSetup,getApi:wI,columns:1,presets:"normal",classes:[],dropdownBehaviours:[vB.config({})]},t,e.shared)},CI=function(n,t,e){var o=function(n){return function(o){var r=!o.isActive();o.setActive(r),n.storage.set(r),e.shared.getSink().each(function(e){t().getOpt(e).each(function(t){Ad(t.element()),oa(t,_E,{name:n.name,value:n.storage.get()})})})}},r=function(n){return function(t){t.setActive(n.storage.get())}};return function(t){t(Gt(n,function(n){var t=n.text.fold(function(){return{}},function(n){return{text:n}});return vt(vt({type:n.type,active:!1},t),{onAction:o(n),onSetup:r(n)})}))}},kI=function(n,t,e,o,r){void 0===e&&(e=[]);var i=t.fold(function(){return{}},function(n){return{action:n}}),u=vt({buttonBehaviours:bd([EO.button(n.disabled),vB.config({}),rw("button press",[la("click"),la("mousedown")])].concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},i),a=Be(u,{dom:o});return Be(a,{components:r})},OI=function(n,t,e,o){void 0===o&&(o=[]);var r=n.tooltip.map(function(n){return{"aria-label":e.translate(n),title:e.translate(n)}}).getOr({}),i={tag:"button",classes:["tox-tbtn"],attributes:r},u=n.icon.map(function(n){return eI(n,e.icons)}),a=VO([u]);return kI(n,t,o,i,a)},_I=function(n,t,e,o){void 0===o&&(o=[]);var r=OI(n,St.some(t),e,o);return cC.sketch(r)},TI=function(n,t,e,r,i){void 0===r&&(r=[]),void 0===i&&(i=[]);var u=e.translate(n.text),a=n.icon?n.icon.map(function(n){return eI(n,e.icons)}):St.none(),c=a.isSome()?VO([a]):[],s=a.isSome()?{}:{innerHtml:u},f=o(n.primary||n.borderless?["tox-button"]:["tox-button","tox-button--secondary"],a.isSome()?["tox-button--icon"]:[],n.borderless?["tox-button--naked"]:[],i),l=vt(vt({tag:"button",classes:f},s),{attributes:{title:u}});return kI(n,t,r,l,c)},EI=function(n,t,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=TI(n,St.some(t),e,o,r);return cC.sketch(i)},BI=function(t,e){return function(o){"custom"===e?oa(o,_E,{name:t,value:{}}):"submit"===e?ea(o,TE):"cancel"===e?ea(o,OE):n.console.error("Unknown button type: ",e)}},DI=function(n,t){return"menu"===t},AI=function(n,t){return"custom"===t||"cancel"===t||"submit"===t},MI=function(t,e,o){if(DI(t,e)){var r=function(){return a},i=t,u=vt(vt({},t),{onSetup:function(n){return n.setDisabled(t.disabled),at},fetch:CI(i.items,r,o)}),a=sC(SI(u,"tox-tbtn",o,St.none()));return a.asSpec()}if(AI(t,e)){var c=BI(t.name,e),s=vt(vt({},t),{borderless:!1});return EI(s,c,o.shared.providers,[])}n.console.error("Unknown footer button type: ",e)},FI=function(n,t){var e=BI(n.name,"custom");return yB(St.none(),HE.parts().field(vt({factory:cC},TI(n,St.some(e),t,[yF.memory(""),rF.self()]))))},II=ft([Br("field1Name","field1"),Br("field2Name","field2"),Sl("onLockedChange"),bl(["lockClass"]),Br("locked",!1),Rh.field("coupledFieldBehaviours",[Qv,Ah])]),RI=function(n,t,e){return Ov(n,t,e).bind(Qv.getCurrent)},VI=function(n,t){return fv({factory:HE,name:n,overrides:function(n){return{fieldBehaviours:bd([rw("coupled-input-behaviour",[da(Ou(),function(e){RI(e,n,t).each(function(t){Ov(e,n,"lock").each(function(o){Mw.isOn(o)&&n.onLockedChange(e,t,o)})})})])])}}})},HI=ft([VI("field1","field2"),VI("field2","field1"),fv({factory:cC,schema:[fr("dom")],name:"lock",overrides:function(n){return{buttonBehaviours:bd([Mw.config({selected:n.locked,toggleClass:n.markers.lockClass,aria:{mode:"pressed"}})])}}})]),NI=function(n,t){return{uid:n.uid,dom:n.dom,components:t,behaviours:Rh.augment(n.coupledFieldBehaviours,[Qv.config({find:St.some}),Ah.config({store:{mode:"manual",getValue:function(t){var e,o=Dv(t,n,["field1","field2"]);return e={},e[n.field1Name]=Ah.getValue(o.field1()),e[n.field2Name]=Ah.getValue(o.field2()),e},setValue:function(t,e){var o=Dv(t,n,["field1","field2"]);Se(e,n.field1Name)&&Ah.setValue(o.field1(),e[n.field1Name]),Se(e,n.field2Name)&&Ah.setValue(o.field2(),e[n.field2Name])}}})]),apis:{getField1:function(t){return Ov(t,n,"field1")},getField2:function(t){return Ov(t,n,"field2")},getLock:function(t){return Ov(t,n,"lock")}}}},PI=Uv({name:"FormCoupledInputs",configFields:II(),partFields:HI(),factory:NI,apis:{getField1:function(n,t){return n.getField1(t)},getField2:function(n,t){return n.getField2(t)},getLock:function(n,t){return n.getLock(t)}}}),zI=function(n){var t={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,"in":4,"%":4},e=function(n){return n in t?t[n]:1},o=n.value.toFixed(e(n.unit));return-1!==o.indexOf(".")&&(o=o.replace(/\.?0*$/,"")),o+n.unit},LI=function(n){var t=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/,e=t.exec(n);if(null!==e){var o=parseFloat(e[1]),r=e[2];return _t.value({value:o,unit:r})}return _t.error(n)},jI=function(n,t){var e={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,"in":1},o=function(n){return Object.prototype.hasOwnProperty.call(e,n)};return n.unit===t?St.some(n.value):o(n.unit)&&o(t)?St.some(e[n.unit]===e[t]?n.value:n.value/e[n.unit]*e[t]):St.none()},UI=function(){return St.none()},WI=function(n,t){return function(e){return jI(e,t).map(function(e){return{value:e*n,unit:t}})}},GI=function(n,t){var e=LI(n).toOption(),o=LI(t).toOption();return Xv(e,o,function(n,t){return jI(n,t.unit).map(function(n){return t.value/n}).map(function(n){return WI(n,t.unit)}).getOr(UI)}).getOr(UI)},XI=function(n,t){var e=UI,o=Sc("ratio-event"),r=PI.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:t.translate(n.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:lC("lock",t.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:lC("unlock",t.icons)}}],buttonBehaviours:bd([EO.button(n.disabled),vB.config({})])}),i=function(n){return{dom:{tag:"div",classes:["tox-form__group"]},components:n}},u=function(t){return HE.parts().field({factory:UE,inputClasses:["tox-textfield"],inputBehaviours:bd([CO.config({disabled:n.disabled}),vB.config({}),rw("size-input-events",[da(wu(),function(n){oa(n,o,{isField1:t})}),da(_u(),function(t){oa(t,CE,{name:n.name})})])]),selectOnFocus:!1})},a=function(n){return{dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(n)}}},c=PI.parts().field1(i([HE.parts().label(a("Width")),u(!0)])),s=PI.parts().field2(i([HE.parts().label(a("Height")),u(!1)]));return PI.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,i([a(" "),r])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(n,t){LI(Ah.getValue(n)).each(function(n){e(n).each(function(n){Ah.setValue(t,zI(n))})})},coupledFieldBehaviours:bd([CO.config({disabled:n.disabled,onDisabled:function(n){PI.getField1(n).bind(HE.getField).each(CO.disable),PI.getField2(n).bind(HE.getField).each(CO.disable),PI.getLock(n).each(CO.disable)},onEnabled:function(n){PI.getField1(n).bind(HE.getField).each(CO.enable),PI.getField2(n).bind(HE.getField).each(CO.enable),PI.getLock(n).each(CO.enable)}}),rw("size-input-events2",[da(o,function(n,t){var o=t.event().isField1(),r=o?PI.getField1(n):PI.getField2(n),i=o?PI.getField2(n):PI.getField1(n),u=r.map(Ah.getValue).getOr(""),a=i.map(Ah.getValue).getOr("");e=GI(u,a)})])])})},YI=ft(Sc("undo")),qI=ft(Sc("redo")),KI=ft(Sc("zoom")),JI=ft(Sc("back")),$I=ft(Sc("apply")),QI=ft(Sc("swap")),ZI=ft(Sc("transform")),nR=ft(Sc("temp-transform")),tR=ft(Sc("transform-apply")),eR={undo:YI,redo:qI,zoom:KI,back:JI,apply:$I,swap:QI,transform:ZI,tempTransform:nR,transformApply:tR},oR=ft("save-state"),rR=ft("disable"),iR=ft("enable"),uR={formActionEvent:_E,saveState:oR,disable:rR,enable:iR},aR=function(n,t){var e=function(n,e,o,r){return sC(EI({name:n,text:n,disabled:o,primary:r,icon:St.none(),borderless:!1},e,t))},o=function(n,e,o,r){return sC(_I({name:n,icon:St.some(n),tooltip:St.some(e),disabled:r,primary:!1,borderless:!1},o,t))},r=function(n,t){n.map(function(n){var e=n.get(t);e.hasConfigured(CO)&&CO.disable(e)})},i=function(n,t){n.map(function(n){var e=n.get(t);e.hasConfigured(CO)&&CO.enable(e)})},u={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},a=at,c=function(n,t,e){oa(n,t,e)},s=function(n){return ea(n,uR.disable())},f=function(n){return ea(n,uR.enable())},l=function(n,t){s(n),c(n,eR.transform(),{transform:t}),f(n)},d=function(n,t){s(n),c(n,eR.tempTransform(),{transform:t}),f(n)},m=function(n){return function(){ot.getOpt(n).each(function(n){ew.set(n,[tt])})}},g=function(n,t){s(n),c(n,eR.transformApply(),{transform:t,swap:m(n)}),f(n)},p=function(){return e("Back",function(n){return c(n,eR.back(),{swap:m(n)})},!1,!1)},h=function(){return sC({dom:{tag:"div",classes:["tox-spacer"]},behaviours:bd([CO.config({})])})},v=function(){return e("Apply",function(n){return c(n,eR.apply(),{swap:m(n)})},!0,!0)},b=function(){return function(t){var e=n.getRect();return QF(t,e.x,e.y,e.w,e.h)}},y=[p(),h(),e("Apply",function(t){var e=b();g(t,e),n.hideCrop()},!1,!0)],x=wE.sketch({dom:u,components:y.map(function(n){return n.asSpec()}),containerBehaviours:bd([rw("image-tools-crop-buttons-events",[da(uR.disable(),function(n){r(y,n)}),da(uR.enable(),function(n){i(y,n)})])])}),w=sC(XI({name:"size",label:St.none(),constrain:!0,disabled:!1},t)),S=function(n,t){return function(e){return ZF(e,n,t)}},C=[p(),h(),w,h(),e("Apply",function(n){w.getOpt(n).each(function(t){var e=Ah.getValue(t),o=parseInt(e.width,10),r=parseInt(e.height,10),i=S(o,r);g(n,i)})},!1,!0)],k=wE.sketch({dom:u,components:C.map(function(n){return n.asSpec()}),containerBehaviours:bd([rw("image-tools-resize-buttons-events",[da(uR.disable(),function(n){r(C,n)}),da(uR.enable(),function(n){i(C,n)})])])}),O=function(n,t){return function(e){return n(e,t)}},_=O($F,"h"),T=O($F,"v"),E=O(nI,-90),B=O(nI,90),D=function(n,t){d(n,t)},A=[p(),h(),o("flip-horizontally","Flip horizontally",function(n){D(n,_)},!1),o("flip-vertically","Flip vertically",function(n){D(n,T)},!1),o("rotate-left","Rotate counterclockwise",function(n){D(n,E)},!1),o("rotate-right","Rotate clockwise",function(n){D(n,B)},!1),h(),v()],M=wE.sketch({dom:u,components:A.map(function(n){return n.asSpec()}),containerBehaviours:bd([rw("image-tools-fliprotate-buttons-events",[da(uR.disable(),function(n){r(A,n)}),da(uR.enable(),function(n){i(A,n)})])])}),F=function(n,e,o,r,i){var u=PM.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(n)}}),a=PM.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=PM.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return sC(PM.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:o,maxX:i,getInitialValue:ft({x:ft(r)})},components:[u,a,c],sliderBehaviours:bd([mw.config({})]),onChoose:e}))},I=function(n,t,e,o,r){var i=function(n,e,o){var r=O(t,o.x()/100);l(n,r)};return F(n,i,e,o,r)},R=function(n,t,e,o,r){return[p(),I(n,t,e,o,r),v()]},V=function(n,t,e,o,a){var c=R(n,t,e,o,a);return wE.sketch({dom:u,components:c.map(function(n){return n.asSpec()}),containerBehaviours:bd([rw("image-tools-filter-panel-buttons-events",[da(uR.disable(),function(n){r(c,n)}),da(uR.enable(),function(n){i(c,n)})])])})},H=[p(),h(),v()],N=wE.sketch({dom:u,components:H.map(function(n){return n.asSpec()})}),P=V("Brightness",KF,-100,0,100),z=V("Contrast",JF,-100,0,100),L=V("Gamma",YF,-100,0,100),j=function(n,t,e){return function(o){return qF(o,n,t,e)}},U=function(n){var t=function(n){var t=W.getOpt(n),e=X.getOpt(n),o=G.getOpt(n);t.each(function(t){e.each(function(e){o.each(function(o){var r=Ah.getValue(t).x()/100,i=Ah.getValue(o).x()/100,u=Ah.getValue(e).x()/100,a=j(r,i,u);l(n,a)})})})};return F(n,t,0,100,200)},W=U("R"),G=U("G"),X=U("B"),Y=[p(),W,G,X,v()],q=wE.sketch({dom:u,components:Y.map(function(n){return n.asSpec()})}),K=function(n,t,e){return function(o){var r=function(){ot.getOpt(o).each(function(t){ew.set(t,[n]),e(t)})};c(o,eR.swap(),{transform:t,swap:r})}},J=function(){n.showCrop()},$=function(t){w.getOpt(t).each(function(t){var e=n.getMeasurements(),o=e.width,r=e.height;Ah.setValue(t,{width:o,height:r})})},Q=St.some(XF),Z=St.some(GF),nt=[o("crop","Crop",K(x,St.none(),J),!1),o("resize","Resize",K(k,St.none(),$),!1),o("orientation","Orientation",K(M,St.none(),a),!1),o("brightness","Brightness",K(P,St.none(),a),!1),o("sharpen","Sharpen",K(N,Q,a),!1),o("contrast","Contrast",K(z,St.none(),a),!1),o("color-levels","Color levels",K(q,St.none(),a),!1),o("gamma","Gamma",K(L,St.none(),a),!1),o("invert","Invert",K(N,Z,a),!1)],tt=wE.sketch({dom:u,components:nt.map(function(n){return n.asSpec()})}),et=wE.sketch({dom:{tag:"div"},components:[tt],containerBehaviours:bd([ew.config({})])}),ot=sC(et),rt=function(n){return ot.getOpt(n).map(function(n){var t=n.components()[0];return t.components()[t.components().length-1]})};return{memContainer:ot,getApplyButton:rt}},cR=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),sR=tinymce.util.Tools.resolve("tinymce.geom.Rect"),fR=tinymce.util.Tools.resolve("tinymce.util.Observable"),lR=tinymce.util.Tools.resolve("tinymce.util.Tools"),dR=tinymce.util.Tools.resolve("tinymce.util.VK"),mR=0,gR=function(n,t,e,o,r){function i(t,o,r,i){var u,a,c,s,f;u=o.x,a=o.y,c=o.w,s=o.h,u+=r*t.deltaX,a+=i*t.deltaY,c+=r*t.deltaW,s+=i*t.deltaH,20>c&&(c=20),20>s&&(s=20),f=n=sR.clamp({x:u,y:a,w:c,h:s},e,"move"===t.name),f=w(e,f),g.fire("updateRect",{rect:f}),l(f)}function u(){function t(t){var e;return new ot(b,{document:o.ownerDocument,handle:b+"-"+t.name,start:function(){e=n},drag:function(n){i(t,e,n.deltaX,n.deltaY)}})}cR('
    ').appendTo(o),lR.each(h,function(n){cR("#"+b,o).append('