HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/Neopoints/momsecurity.be/wwwroot/vendor/kms/js/vendor.es5.js
function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{1:function(t,e,n){n("5WJX"),n("DWi2"),n("vFQT"),n("Qjfq"),n("ZNhe"),n("hOyB"),n("hVuo"),n("vDqi"),n("EVdn"),n("MIQu"),n("Vn+K"),n("NvoQ"),t.exports=n("7bfH")},"121P":function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)}})?r.apply(e,o):r)||(t.exports=i)},"2SVd":function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},"4tak":function(t,e){!function(t){"use strict";var e,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(t,e){var n,r=t.dom,o=t.selection.getSelectedBlocks();o.length&&(n=r.getAttrib(o[0],"dir"),i.each(o,function(t){r.getParent(t.parentNode,'*[dir="'+e+'"]',r.getRoot())||r.setAttrib(t,"dir",n!==e?e:null)}),t.nodeChanged())},u=function(t){return function(){return t}},s=u(!1),c=u(!0),l=function(){return f},f=(e=function(t){return t.isNone()},{fold:function(t,e){return t()},is:s,isSome:s,isNone:c,getOr:r=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(void 0),or:r,orThunk:n,map:l,each:function(){},bind:l,exists:s,forall:c,filter:l,equals:e,equals_:e,toArray:function(){return[]},toString:u("none()")}),d=function t(e){var n=u(e),r=function(){return i},o=function(t){return t(e)},i={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:c,isNone:s,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:r,orThunk:r,map:function(n){return t(n(e))},each:function(t){t(e)},bind:o,exists:o,forall:o,filter:function(t){return t(e)?i:f},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(s,function(t){return n(e,t)})}};return i},m=d,h=l,p=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:u(t)}},g=p,v=function(t){return"function"===_typeof(t)},b=(void 0!==t.window?t.window:Function("return this;")(),function(t){return function(e){return e.dom().nodeType===t}}),y=b(3),x=b(9),w=b(11),C=v(t.Element.prototype.attachShadow)&&v(t.Node.prototype.getRootNode)?function(t){return g(t.dom().getRootNode())}:function(t){return x(t)?t:g(t.dom().ownerDocument)},_=function(t){return g(t.dom().host)},k=function t(e){var n,r,o=y(e)?e.dom().parentNode:e.dom();return null!=o&&null!==o.ownerDocument&&function(t){var e=C(t);return w(e)?m(e):h()}(g(o)).fold(function(){return o.ownerDocument.body.contains(o)},(n=t,r=_,function(t){return n(r(t))}))},S=function(e){return"rtl"===function(e,n){var r=e.dom(),o=t.window.getComputedStyle(r).getPropertyValue(n);return""!==o||k(e)?o:function(t,e){return function(t){return void 0!==t.style&&v(t.style.getPropertyValue)}(t)?t.style.getPropertyValue(e):""}(r,n)}(e,"direction")?"rtl":"ltr"},T=function(t,e){return function(n){var r=function(t){var r=g(t.element);n.setActive(S(r)===e)};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}};o.add("directionality",function(t){!function(t){t.addCommand("mceDirectionLTR",function(){a(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){a(t,"rtl")})}(t),function(t){t.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return t.execCommand("mceDirectionLTR")},onSetup:T(t,"ltr")}),t.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return t.execCommand("mceDirectionRTL")},onSetup:T(t,"rtl")})}(t)})}(window)},"5WJX":function(t,e,n){(function(e){!function(n){"use strict";var r=function(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=_typeof(t);return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e},o=function(t){return{eq:t}},i=o(function(t,e){return t===e}),a=function(t){return o(function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0})},u=function(t,e){return function(t,e){return o(function(n,r){return t.eq(e(n),e(r))})}(a(t),function(t){return function(t,e){return Array.prototype.slice.call(t).sort(e)}(t,e)})},s=function(t){return o(function(e,n){var r=Object.keys(e),o=Object.keys(n);if(!u(i).eq(r,o))return!1;for(var a=r.length,s=0;s<a;s++){var c=r[s];if(!t.eq(e[c],n[c]))return!1}return!0})},c=o(function(t,e){if(t===e)return!0;var n=r(t);return n===r(e)&&(-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(n)?t===e:"array"===n?a(c).eq(t,e):"object"===n&&s(c).eq(t,e))}),l=function(){},f=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},d=function(t){return function(){return t}},m=function(t){return t};function h(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var p=function(t){return function(e){return!t(e)}},g=function(t){return function(){throw new Error(t)}},v=d(!1),b=d(!0),y=function(){return x},x=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:v,isSome:v,isNone:b,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(void 0),or:n,orThunk:e,map:y,each:l,bind:y,exists:v,forall:b,filter:y,equals:t,equals_:t,toArray:function(){return[]},toString:d("none()")}}(),w=function t(e){var n=d(e),r=function(){return i},o=function(t){return t(e)},i={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:b,isNone:v,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:r,orThunk:r,map:function(n){return t(n(e))},each:function(t){t(e)},bind:o,exists:o,forall:o,filter:function(t){return t(e)?i:x},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(v,function(t){return n(e,t)})}};return i},C={some:w,none:y,from:function(t){return null==t?x:w(t)}},_=function(t){return function(e){return r=_typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},k=function(t){return function(e){return _typeof(e)===t}},S=function(t){return function(e){return t===e}},T=_("string"),O=_("object"),D=_("array"),E=S(null),N=k("boolean"),A=S(void 0),R=k("function"),B=k("number"),I=Array.prototype.slice,P=Array.prototype.indexOf,M=Array.prototype.push,L=function(t,e){return P.call(t,e)},F=function(t,e){return L(t,e)>-1},H=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},j=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},V=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},z=function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)},U=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},W=function(t,e,n){return z(t,function(t){n=e(n,t)}),n},q=function(t,e,n){return V(t,function(t){n=e(n,t)}),n},$=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return C.some(i);if(n(i,r))break}return C.none()}(t,e,v)},Y=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return C.some(n);return C.none()},G=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!D(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);M.apply(e,t[n])}return e}(j(t,e))},K=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},X=function(t){var e=I.call(t,0);return e.reverse(),e},J=function(t,e){return U(t,function(t){return!F(e,t)})},Q=function(t){return 0===t.length?C.none():C.some(t[0])},Z=function(t){return 0===t.length?C.none():C.some(t[t.length-1])},tt=R(Array.from)?Array.from:function(t){return I.call(t)},et=Object.keys,nt=Object.hasOwnProperty,rt=function(t,e){for(var n=et(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},ot=function(t,e){return it(t,function(t,n){return{k:n,v:e(t,n)}})},it=function(t,e){var n={};return rt(t,function(t,r){var o=e(t,r);n[o.k]=o.v}),n},at=function(t){return function(e,n){t[n]=e}},ut=function(t,e,n,r){return rt(t,function(t,o){(e(t,o)?n:r)(t,o)}),{}},st=function(t,e){var n={},r={};return ut(t,e,at(n),at(r)),{t:n,f:r}},ct=function(t,e){var n={};return ut(t,e,at(n),l),n},lt=function(t,e){return ft(t,e)?C.from(t[e]):C.none()},ft=function(t,e){return nt.call(t,e)},dt=Array.isArray,mt=function(t,e,n){var r,o;if(!t)return 0;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return 0}else for(r in t)if(t.hasOwnProperty(r)&&!1===e.call(n,t[r],r,t))return 0;return 1},ht=function(t,e){var n=[];return mt(t,function(r,o){n.push(e(r,o,t))}),n},pt=function(t,e){var n=[];return mt(t,function(r,o){e&&!e(r,o,t)||n.push(r)}),n},gt=function(t,e){var n,r;if(t)for(n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},vt=function(t,e,n,r){var o=0;for(arguments.length<3&&(n=t[0]);o<t.length;o++)n=e.call(r,n,t[o],o);return n},bt=function(t,e,n){var r,o;for(r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1},yt=function(t){return t[t.length-1]},xt=function(){return(xt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function wt(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}var Ct=function(){return _t(0,0)},_t=function(t,e){return{major:t,minor:e}},kt=function(t,e){var n=String(e).toLowerCase();return 0===t.length?Ct():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return _t(r(1),r(2))}(t,n)},St=Ct,Tt=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},Ot=function(){return Tt({current:void 0,version:St()})},Dt=Tt,Et=(d("Edge"),d("Chrome"),d("IE"),d("Opera"),d("Firefox"),d("Safari"),function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}}),Nt=function(){return Et({current:void 0,version:St()})},At=Et,Rt=(d("Windows"),d("iOS"),d("Android"),d("Linux"),d("OSX"),d("Solaris"),d("FreeBSD"),d("ChromeOS"),function(t,e){var n=String(e).toLowerCase();return $(t,function(t){return t.search(n)})}),Bt=function(t,e){return-1!==t.indexOf(e)},It=function(t,e){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(0,0+e.length)===e}(t,e)},Pt=function(t){return function(e){return e.replace(t,"")}},Mt=Pt(/^\s+|\s+$/g),Lt=Pt(/^\s+/g),Ft=Pt(/\s+$/g),Ht=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,jt=function(t){return function(e){return Bt(e,t)}},Vt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Bt(t,"edge/")&&Bt(t,"chrome")&&Bt(t,"safari")&&Bt(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ht],search:function(t){return Bt(t,"chrome")&&!Bt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Bt(t,"msie")||Bt(t,"trident")}},{name:"Opera",versionRegexes:[Ht,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:jt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:jt("firefox")},{name:"Safari",versionRegexes:[Ht,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Bt(t,"safari")||Bt(t,"mobile/"))&&Bt(t,"applewebkit")}}],zt=[{name:"Windows",search:jt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Bt(t,"iphone")||Bt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:jt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:jt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:jt("linux"),versionRegexes:[]},{name:"Solaris",search:jt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:jt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:jt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ut={browsers:d(Vt),oses:d(zt)},Wt=function(t,e){var n=Ut.browsers(),r=Ut.oses(),o=function(t,e){return Rt(t,e).map(function(t){var n=kt(t.versionRegexes,e);return{current:t.name,version:n}})}(n,t).fold(Ot,Dt),i=function(t,e){return Rt(t,e).map(function(t){var n=kt(t.versionRegexes,e);return{current:t.name,version:n}})}(r,t).fold(Nt,At);return{browser:o,os:i,deviceType:function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),s=o||!i&&a&&r("(min-device-width:768px)"),c=i||a&&!s,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!c&&!s&&!l;return{isiPad:d(o),isiPhone:d(i),isTablet:d(s),isPhone:d(c),isTouch:d(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:d(l),isDesktop:d(f)}}(i,o,t,e)}},qt=function(t){return n.window.matchMedia(t).matches},$t=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}(function(){return Wt(n.navigator.userAgent,qt)}),Yt=function(){return $t()},Gt=n.navigator.userAgent,Kt=Yt(),Xt=Kt.browser,Jt=Kt.os,Qt=Kt.deviceType,Zt=/WebKit/.test(Gt)&&!Xt.isEdge(),te="FormData"in n.window&&"FileReader"in n.window&&"URL"in n.window&&!!n.URL.createObjectURL,ee=-1!==Gt.indexOf("Windows Phone"),ne={opera:Xt.isOpera(),webkit:Zt,ie:!(!Xt.isIE()&&!Xt.isEdge())&&Xt.version.major,gecko:Xt.isFirefox(),mac:Jt.isOSX()||Jt.isiOS(),iOS:Qt.isiPad()||Qt.isiPhone(),android:Jt.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:n.window.getSelection&&"Range"in n.window,documentMode:Xt.isIE()?n.document.documentMode||7:10,fileApi:te,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!Xt.isIE(),desktop:Qt.isDesktop(),windowsPhone:ee,browser:{current:Xt.current,version:Xt.version,isChrome:Xt.isChrome,isEdge:Xt.isEdge,isFirefox:Xt.isFirefox,isIE:Xt.isIE,isOpera:Xt.isOpera,isSafari:Xt.isSafari},os:{current:Jt.current,version:Jt.version,isAndroid:Jt.isAndroid,isChromeOS:Jt.isChromeOS,isFreeBSD:Jt.isFreeBSD,isiOS:Jt.isiOS,isLinux:Jt.isLinux,isOSX:Jt.isOSX,isSolaris:Jt.isSolaris,isWindows:Jt.isWindows},deviceType:{isDesktop:Qt.isDesktop,isiPad:Qt.isiPad,isiPhone:Qt.isiPhone,isPhone:Qt.isPhone,isTablet:Qt.isTablet,isTouch:Qt.isTouch,isWebView:Qt.isWebView}},re=/^\s*|\s*$/g,oe=function(t){return null==t?"":(""+t).replace(re,"")},ie=function(t,e){return e?!("array"!==e||!dt(t))||_typeof(t)===e:void 0!==t},ae={trim:oe,isArray:dt,is:ie,toArray:function(t){var e,n,r=t;if(!dt(t))for(r=[],e=0,n=t.length;e<n;e++)r[e]=t[e];return r},makeMap:function(t,e,n){var r;for(e=e||",","string"==typeof(t=t||[])&&(t=t.split(e)),n=n||{},r=t.length;r--;)n[t[r]]={};return n},each:mt,map:ht,grep:pt,inArray:gt,hasOwn:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];for(var i in o)if(o.hasOwnProperty(i)){var a=o[i];void 0!==a&&(t[i]=a)}}return t},create:function(t,e,n){var r,o,i,a=0,u=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],s=this.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[u]){if("static"===t[2])return s[u]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[u]));e[u]||(e[u]=function(){},a=1),s[u]=e[u],this.extend(s[u].prototype,e),t[5]&&(r=this.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[u],s[u]=a?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[u].prototype[u]=s[u],this.each(r,function(t,e){s[u].prototype[e]=r[e]}),this.each(e,function(t,e){r[e]?s[u].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==u&&(s[u].prototype[e]=t)})),this.each(e.static,function(t,e){s[u][e]=t})}},walk:function t(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),mt(e,function(e,i){if(!1===n.call(o,e,i,r))return!1;t(e,n,r,o)}))},createNS:function(t,e){var r,o;for(e=e||n.window,t=t.split("."),r=0;r<t.length;r++)e[o=t[r]]||(e[o]={}),e=e[o];return e},resolve:function(t,e){var r,o;for(e=e||n.window,r=0,o=(t=t.split(".")).length;r<o&&(e=e[t[r]]);r++);return e},explode:function(t,e){return!t||ie(t,"array")?t:ht(t.split(e||","),oe)},_addCacheSuffix:function(t){var e=ne.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},ue=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:d(t)}},se={fromHtml:function(t,e){var r=(e||n.document).createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw n.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return ue(r.childNodes[0])},fromTag:function(t,e){var r=(e||n.document).createElement(t);return ue(r)},fromText:function(t,e){var r=(e||n.document).createTextNode(t);return ue(r)},fromDom:ue,fromPoint:function(t,e,n){var r=t.dom();return C.from(r.elementFromPoint(e,n)).map(ue)}},ce=(void 0!==n.window?n.window:Function("return this;")(),function(t){return t.dom().nodeName.toLowerCase()}),le=function(t){return t.dom().nodeType},fe=function(t){return function(e){return le(e)===t}},de=fe(1),me=fe(3),he=fe(9),pe=fe(11),ge=function(t,e){var n=[],r=function(t){return n.push(t),e(t)},o=e(t);do{o=o.bind(r)}while(o.isSome());return n},ve=function(t,e){var n=t.dom();if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},be=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},ye=function(t,e){return t.dom()===e.dom()},xe=function(t,e){return Yt().browser.isIE()?function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t.dom(),e.dom(),n.Node.DOCUMENT_POSITION_CONTAINED_BY)}(t,e):function(t,e){var n=t.dom(),r=e.dom();return n!==r&&n.contains(r)}(t,e)},we=function(t){return se.fromDom(t.dom().ownerDocument)},Ce=function(t){return he(t)?t:we(t)},_e=function(t){return se.fromDom(t.dom().ownerDocument.defaultView)},ke=function(t){return C.from(t.dom().parentNode).map(se.fromDom)},Se=function(t){return C.from(t.dom().previousSibling).map(se.fromDom)},Te=function(t){return C.from(t.dom().nextSibling).map(se.fromDom)},Oe=function(t){return X(ge(t,Se))},De=function(t){return ge(t,Te)},Ee=function(t){return j(t.dom().childNodes,se.fromDom)},Ne=function(t,e){var n=t.dom().childNodes;return C.from(n[e]).map(se.fromDom)},Ae=function(t){return Ne(t,0)},Re=function(t){return Ne(t,t.dom().childNodes.length-1)},Be=function(t){return pe(t)},Ie=R(n.Element.prototype.attachShadow)&&R(n.Node.prototype.getRootNode)?function(t){return se.fromDom(t.dom().getRootNode())}:Ce,Pe=function(t){return Be(t)?t:function(t){var e=t.dom().head;if(null==e)throw new Error("Head is not available yet");return se.fromDom(e)}(Ce(t))},Me=function(t){return se.fromDom(t.dom().host)},Le=function(t,e){ke(t).each(function(n){n.dom().insertBefore(e.dom(),t.dom())})},Fe=function(t,e){Te(t).fold(function(){ke(t).each(function(t){je(t,e)})},function(t){Le(t,e)})},He=function(t,e){Ae(t).fold(function(){je(t,e)},function(n){t.dom().insertBefore(e.dom(),n.dom())})},je=function(t,e){t.dom().appendChild(e.dom())},Ve=function(t,e){V(e,function(e){je(t,e)})},ze=function(t){t.dom().textContent="",V(Ee(t),function(t){Ue(t)})},Ue=function(t){var e=t.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},We=function(t){var e,n=Ee(t);n.length>0&&(e=t,V(n,function(t){Le(e,t)})),Ue(t)},qe=function t(e){var n,r,o=me(e)?e.dom().parentNode:e.dom();return null!=o&&null!==o.ownerDocument&&function(t){var e=Ie(t);return Be(e)?C.some(e):C.none()}(se.fromDom(o)).fold(function(){return o.ownerDocument.body.contains(o)},(n=t,r=Me,function(t){return n(r(t))}))},$e=function t(e,n){return{left:d(e),top:d(n),translate:function(r,o){return t(e+r,n+o)}}},Ye=function(t,e){return void 0!==t?t:void 0!==e?e:0},Ge=function(t){var e=t.dom(),n=e.ownerDocument.body;return n===e?$e(n.offsetLeft,n.offsetTop):qe(t)?function(t){var e=t.getBoundingClientRect();return $e(e.left,e.top)}(e):$e(0,0)},Ke=function(t){var e=void 0!==t?t.dom():n.document,r=e.body.scrollLeft||e.documentElement.scrollLeft,o=e.body.scrollTop||e.documentElement.scrollTop;return $e(r,o)},Xe=function(t,e,r){(void 0!==r?r.dom():n.document).defaultView.scrollTo(t,e)},Je=function(t,e){Yt().browser.isSafari()&&R(t.dom().scrollIntoViewIfNeeded)?t.dom().scrollIntoViewIfNeeded(!1):t.dom().scrollIntoView(e)},Qe=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Ze=function(t){var e=void 0===t?n.window:t,r=e.document,o=Ke(se.fromDom(r));return function(t){var e=void 0===t?n.window:t;return C.from(e.visualViewport)}(e).fold(function(){var t=e.document.documentElement,n=t.clientWidth,r=t.clientHeight;return Qe(o.left(),o.top(),n,r)},function(t){return Qe(Math.max(t.pageLeft,o.left()),Math.max(t.pageTop,o.top()),t.width,t.height)})},tn=function(t){return function(e){return!!e&&e.nodeType===t}},en=function(t){return!!t&&!Object.getPrototypeOf(t)},nn=tn(1),rn=function(t){var e=t.map(function(t){return t.toLowerCase()});return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return F(e,n)}return!1}},on=function(t,e){var n=e.toLowerCase().split(" ");return function(e){var r;if(nn(e))for(r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}},an=function(t){return function(e){return nn(e)&&e.hasAttribute(t)}},un=function(t){return nn(t)&&t.hasAttribute("data-mce-bogus")},sn=function(t){return nn(t)&&"TABLE"===t.tagName},cn=function(t){return function(e){if(nn(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},ln=rn(["textarea","input"]),fn=tn(3),dn=tn(8),mn=tn(9),hn=tn(11),pn=rn(["br"]),gn=cn("true"),vn=cn("false"),bn=function(t){return void 0!==t.style&&R(t.style.getPropertyValue)},yn=function(t,e,r){if(!(T(r)||N(r)||B(r)))throw n.console.error("Invalid call to Attr.set. Key ",e,":: Value ",r,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,r+"")},xn=function(t,e,n){yn(t.dom(),e,n)},wn=function(t,e){var n=t.dom();rt(e,function(t,e){yn(n,e,t)})},Cn=function(t,e){var n=t.dom().getAttribute(e);return null===n?void 0:n},_n=function(t,e){t.dom().removeAttribute(e)},kn=function(t,e){var r=t.dom(),o=n.window.getComputedStyle(r).getPropertyValue(e);return""!==o||qe(t)?o:Sn(r,e)},Sn=function(t,e){return bn(t)?t.style.getPropertyValue(e):""},Tn=function(t,e){var n=t.dom(),r=Sn(n,e);return C.from(r).filter(function(t){return t.length>0})},On=Yt().browser,Dn=function(t){return $(t,de)},En=function(t,e){return t.children&&F(t.children,e)},Nn=function(t,e,n){var r,o,i=0,a=0,u=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===kn(se.fromDom(t),"position"))return{x:i=(o=e.getBoundingClientRect()).left+(u.documentElement.scrollLeft||t.scrollLeft)-u.documentElement.clientLeft,y:a=o.top+(u.documentElement.scrollTop||t.scrollTop)-u.documentElement.clientTop};for(r=e;r&&r!==n&&r.nodeType&&!En(r,n);)i+=r.offsetLeft||0,a+=r.offsetTop||0,r=r.offsetParent;for(r=e.parentNode;r&&r!==n&&r.nodeType&&!En(r,n);)i-=r.scrollLeft||0,a-=r.scrollTop||0,r=r.parentNode;a+=function(t){return On.isFirefox()&&"table"===ce(t)?Dn(Ee(t)).filter(function(t){return"caption"===ce(t)}).bind(function(t){return Dn(De(t)).map(function(e){var n=e.dom().offsetTop,r=t.dom().offsetTop,o=t.dom().offsetHeight;return n<=r?-o:0})}).getOr(0):0}(se.fromDom(e))}return{x:i,y:a}},An=function(t){var e;return function(n){return(e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,d(!0))).hasOwnProperty(ce(n))}},Rn=An(["h1","h2","h3","h4","h5","h6"]),Bn=An(["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"]),In=function(t){return de(t)&&!Bn(t)},Pn=function(t){return de(t)&&"br"===ce(t)},Mn=An(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),Ln=An(["ul","ol","dl"]),Fn=An(["li","dd","dt"]),Hn=An(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),jn=An(["thead","tbody","tfoot"]),Vn=An(["td","th"]),zn=An(["pre","script","textarea","style"]),Un=function(t){return t&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Wn=function t(e,n){var r,o=n.childNodes;if(!nn(n)||!Un(n)){for(r=o.length-1;r>=0;r--)t(e,o[r]);if(!1===mn(n)){if(fn(n)&&n.nodeValue.length>0){var i=ae.trim(n.nodeValue).length;if(e.isBlock(n.parentNode)||i>0)return;if(0===i&&function(t){var e=t.previousSibling&&"SPAN"===t.previousSibling.nodeName,n=t.nextSibling&&"SPAN"===t.nextSibling.nodeName;return e&&n}(n))return}else if(nn(n)&&(1===(o=n.childNodes).length&&Un(o[0])&&n.parentNode.insertBefore(o[0],n),o.length||Hn(se.fromDom(n))))return;e.remove(n)}return n}},qn=ae.makeMap,$n=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Yn=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Gn=/[<>&\"\']/g,Kn=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Xn={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:"Ÿ"},Jn={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},Qn={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},Zn=function(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),Jn[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}},tr=Zn("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),er=function(t,e){return t.replace(e?$n:Yn,function(t){return Jn[t]||t})},nr=function(t,e){return t.replace(e?$n:Yn,function(t){return t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":Jn[t]||"&#"+t.charCodeAt(0)+";"})},rr=function(t,e,n){return n=n||tr,t.replace(e?$n:Yn,function(t){return Jn[t]||n[t]||t})},or={encodeRaw:er,encodeAllRaw:function(t){return(""+t).replace(Gn,function(t){return Jn[t]||t})},encodeNumeric:nr,encodeNamed:rr,getEncodeFunc:function(t,e){var n=Zn(e)||tr,r=qn(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?$n:Yn,function(t){return void 0!==Jn[t]?Jn[t]:void 0!==n[t]?n[t]:t.length>1?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"})}:r.named?e?function(t,e){return rr(t,e,n)}:rr:r.numeric?nr:er},decode:function(t){return t.replace(Kn,function(t,e){return e?(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):Xn[e]||String.fromCharCode(e):Qn[t]||tr[t]||function(t){var e=se.fromTag("div").dom();return e.innerHTML=t,e.textContent||e.innerText||t}(t)})}},ir={},ar={},ur=ae.makeMap,sr=ae.each,cr=ae.extend,lr=ae.explode,fr=ae.inArray,dr=function(t,e){return(t=ae.trim(t))?t.split(e||" "):[]},mr=function(t,e){var n;return t&&(n={},"string"==typeof t&&(t={"*":t}),sr(t,function(t,r){n[r]=n[r.toUpperCase()]="map"===e?ur(t,/[, ]/):lr(t,/[, ]/)})),n};function hr(t){var e={},n={},r=[],o={},i={},a=function(e,n,r){var o=t[e];return o?o=ur(o,/[, ]/,ur(o.toUpperCase(),/[, ]/)):(o=ir[e])||(o=ur(n," ",ur(n.toUpperCase()," ")),o=cr(o,r),ir[e]=o),o},u=function(t){var e,n,r,o,i,a,u={},s=function(t,n,r){var o,i,a,s=function(t,e){var n,r,o={};for(n=0,r=t.length;n<r;n++)o[t[n]]=e||{};return o};for(n=n||"","string"==typeof(r=r||[])&&(r=dr(r)),o=(t=dr(t)).length;o--;)a={attributes:s(i=dr([e,n].join(" "))),attributesOrder:i,children:s(r,ar)},u[t[o]]=a},c=function(t,e){var n,r,o,i;for(n=(t=dr(t)).length,e=dr(e);n--;)for(r=u[t[n]],o=0,i=e.length;o<i;o++)r.attributes[e[o]]={},r.attributesOrder.push(e[o])};return ir[t]?ir[t]:(e="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==t&&(e+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==t&&(e+=" xml:lang",r=[r,a="acronym applet basefont big font strike tt"].join(" "),sr(dr(a),function(t){s(t,"",r)}),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),sr(dr(i),function(t){s(t,"",o)})),o=o||[n,r].join(" "),s("html","manifest","head body"),s("head","","base command link meta noscript script style title"),s("title hr noscript br"),s("base","href target"),s("link","href rel media hreflang type sizes hreflang"),s("meta","name http-equiv content charset"),s("style","media type scoped"),s("script","src async defer type charset"),s("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),s("address dt dd div caption","",o),s("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),s("blockquote","cite",o),s("ol","reversed start type","li"),s("ul","","li"),s("li","value",o),s("dl","","dt dd"),s("a","href target rel media hreflang type",r),s("q","cite",r),s("ins del","cite datetime",o),s("img","src sizes srcset alt usemap ismap width height"),s("iframe","src name width height",o),s("embed","src type width height"),s("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),s("param","name value"),s("map","name",[o,"area"].join(" ")),s("area","alt coords shape href target rel media hreflang type"),s("table","border","caption colgroup thead tfoot tbody tr"+("html4"===t?" col":"")),s("colgroup","span","col"),s("col","span"),s("tbody thead tfoot","","tr"),s("tr","","td th"),s("td","colspan rowspan headers",o),s("th","colspan rowspan headers scope abbr",o),s("form","accept-charset action autocomplete enctype method name novalidate target",o),s("fieldset","disabled form name",[o,"legend"].join(" ")),s("label","form for",r),s("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"),s("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===t?o:r),s("select","disabled form multiple name required size","option optgroup"),s("optgroup","disabled label","option"),s("option","disabled label selected value"),s("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),s("menu","type label",[o,"li"].join(" ")),s("noscript","",o),"html4"!==t&&(s("wbr"),s("ruby","",[r,"rt rp"].join(" ")),s("figcaption","",o),s("mark rt rp summary bdi","",r),s("canvas","width height",o),s("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),s("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),s("picture","","img source"),s("source","src srcset type media sizes"),s("track","kind src srclang label default"),s("datalist","",[r,"option"].join(" ")),s("article section nav aside main header footer","",o),s("hgroup","","h1 h2 h3 h4 h5 h6"),s("figure","",[o,"figcaption"].join(" ")),s("time","datetime",r),s("dialog","open",o),s("command","type label icon disabled checked radiogroup command"),s("output","for form name",r),s("progress","value max",r),s("meter","value min max low high optimum",r),s("details","open",[o,"summary"].join(" ")),s("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==t&&(c("script","language xml:space"),c("style","xml:space"),c("object","declare classid code codebase codetype archive standby align border hspace vspace"),c("embed","align name hspace vspace"),c("param","valuetype type"),c("a","charset name rev shape coords"),c("br","clear"),c("applet","codebase archive code object alt name width height align hspace vspace"),c("img","name longdesc align border hspace vspace"),c("iframe","longdesc frameborder marginwidth marginheight scrolling align"),c("font basefont","size color face"),c("input","usemap align"),c("select"),c("textarea"),c("h1 h2 h3 h4 h5 h6 div p legend caption","align"),c("ul","type compact"),c("li","type"),c("ol dl menu dir","compact"),c("pre","width xml:space"),c("hr","align noshade size width"),c("isindex","prompt"),c("table","summary width frame rules cellspacing cellpadding align bgcolor"),c("col","width align char charoff valign"),c("colgroup","width align char charoff valign"),c("thead","align char charoff valign"),c("tr","align char charoff valign bgcolor"),c("th","axis align char charoff valign nowrap bgcolor width height"),c("form","accept"),c("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),c("tfoot","align char charoff valign"),c("tbody","align char charoff valign"),c("area","nohref"),c("body","background bgcolor text link vlink alink")),"html4"!==t&&(c("input button select textarea","autofocus"),c("input textarea","placeholder"),c("a","download"),c("link script img","crossorigin"),c("img","loading"),c("iframe","sandbox seamless allowfullscreen loading")),sr(dr("a form meter progress dfn"),function(t){u[t]&&delete u[t].children[t]}),delete u.caption.children.table,delete u.script,ir[t]=u,u)}((t=t||{}).schema);!1===t.verify_html&&(t.valid_elements="*[*]");var s=mr(t.valid_styles),c=mr(t.invalid_styles,"map"),l=mr(t.valid_classes,"map"),f=a("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=a("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=a("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),h=a("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),p=a("non_empty_elements","td th iframe video audio object script pre code",m),g=a("move_caret_before_on_enter_elements","table",p),v=a("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),b=a("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",v),y=a("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");sr((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),function(t){i[t]=new RegExp("</"+t+"[^>]*>","gi")});var x=function(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")},w=function(t){var n,o,i,a,u,s,c,l,f,d,m,h,p,g,v,b,y,w,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,_=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(t)for(t=dr(t,","),e["@"]&&(b=e["@"].attributes,y=e["@"].attributesOrder),n=0,o=t.length;n<o;n++)if(u=C.exec(t[n])){if(g=u[1],f=u[2],v=u[3],l=u[5],s={attributes:h={},attributesOrder:p=[]},"#"===g&&(s.paddEmpty=!0),"-"===g&&(s.removeEmpty=!0),"!"===u[4]&&(s.removeEmptyAttrs=!0),b&&(rt(b,function(t,e){h[e]=t}),p.push.apply(p,y)),l)for(i=0,a=(l=dr(l,"|")).length;i<a;i++)if(u=_.exec(l[i])){if(c={},m=u[1],d=u[2].replace(/[\\:]:/g,":"),g=u[3],w=u[4],"!"===m&&(s.attributesRequired=s.attributesRequired||[],s.attributesRequired.push(d),c.required=!0),"-"===m){delete h[d],p.splice(fr(p,d),1);continue}g&&("="===g&&(s.attributesDefault=s.attributesDefault||[],s.attributesDefault.push({name:d,value:w}),c.defaultValue=w),":"===g&&(s.attributesForced=s.attributesForced||[],s.attributesForced.push({name:d,value:w}),c.forcedValue=w),"<"===g&&(c.validValues=ur(w,"?"))),k.test(d)?(s.attributePatterns=s.attributePatterns||[],c.pattern=x(d),s.attributePatterns.push(c)):(h[d]||p.push(d),h[d]=c)}b||"@"!==f||(b=h,y=p),v&&(s.outputName=f,e[v]=s),k.test(f)?(s.pattern=x(f),r.push(s)):e[f]=s}},C=function(t){e={},r=[],w(t),sr(u,function(t,e){n[e]=t.children})},_=function(t){var r=/^(~)?(.+)$/;t&&(ir.text_block_elements=ir.block_elements=null,sr(dr(t,","),function(t){var i=r.exec(t),a="~"===i[1],u=a?"span":"div",s=i[2];if(n[s]=n[u],o[s]=u,a||(b[s.toUpperCase()]={},b[s]={}),!e[s]){var c=e[u];delete(c=cr({},c)).removeEmptyAttrs,delete c.removeEmpty,e[s]=c}sr(n,function(t,e){t[u]&&(n[e]=t=cr({},n[e]),t[s]=t[u])})}))},k=function(e){var r=/^([+\-]?)([A-Za-z0-9_\-\.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)\]$/;ir[t.schema]=null,e&&sr(dr(e,","),function(t){var e,o,i=r.exec(t);i&&(o=i[1],e=o?n[i[2]]:n[i[2]]={"#comment":{}},e=n[i[2]],sr(dr(i[3],"|"),function(t){"-"===o?delete e[t]:e[t]={}}))})},S=function(t){var n,o=e[t];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(t))return o};return t.valid_elements?C(t.valid_elements):(sr(u,function(t,r){e[r]={attributes:t.attributes,attributesOrder:t.attributesOrder},n[r]=t.children}),"html5"!==t.schema&&sr(dr("strong/b em/i"),function(t){t=dr(t,"/"),e[t[1]].outputName=t[0]}),sr(dr("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(t){e[t]&&(e[t].removeEmpty=!0)}),sr(dr("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(t){e[t].paddEmpty=!0}),sr(dr("span"),function(t){e[t].removeEmptyAttrs=!0})),_(t.custom_elements),k(t.valid_children),w(t.extended_valid_elements),k("+ol[ul|ol],+ul[ul|ol]"),sr({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},function(t,n){e[n]&&(e[n].parentsRequired=dr(t))}),t.invalid_elements&&sr(lr(t.invalid_elements),function(t){e[t]&&delete e[t]}),S("span")||w("span[!data-mce-type|*]"),{children:n,elements:e,getValidStyles:function(){return s},getValidClasses:function(){return l},getBlockElements:function(){return b},getInvalidStyles:function(){return c},getShortEndedElements:function(){return m},getTextBlockElements:function(){return v},getTextInlineElements:function(){return y},getBoolAttrs:function(){return h},getElementRule:S,getSelfClosingElements:function(){return d},getNonEmptyElements:function(){return p},getMoveCaretBeforeOnEnterElements:function(){return g},getWhiteSpaceElements:function(){return f},getSpecialElements:function(){return i},isValidChild:function(t,e){var r=n[t.toLowerCase()];return!(!r||!r[e.toLowerCase()])},isValid:function(t,e){var n,r,o=S(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:function(){return o},addValidElements:w,setValidElements:C,addCustomElements:_,addValidChildren:k}}var pr,gr,vr,br,yr,xr,wr,Cr,_r,kr,Sr,Tr,Or,Dr,Er,Nr,Ar,Rr=function(t,e,n,r){var o=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+o(e)+o(n)+o(r)},Br=function(t,e){var n,r,o,i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,a=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,u=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,c={};t=t||{},e&&(r=e.getValidStyles(),o=e.getInvalidStyles());var l="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<l.length;n++)c[l[n]]="\ufeff"+n,c["\ufeff"+n]=l[n];return{toHex:function(t){return t.replace(i,Rr)},parse:function(e){var r,o,l,f,d,m,h,p={},g=t.url_converter,v=t.url_converter_scope||this,b=function(t,e,r){var o=p[t+"-top"+e];if(o){var i=p[t+"-right"+e];if(i){var a=p[t+"-bottom"+e];if(a){var u=p[t+"-left"+e];if(u){var s=[o,i,a,u];for(n=s.length-1;n--&&s[n]===s[n+1];);n>-1&&r||(p[t+e]=-1===n?s[0]:s.join(" "),delete p[t+"-top"+e],delete p[t+"-right"+e],delete p[t+"-bottom"+e],delete p[t+"-left"+e])}}}}},y=function(t){var e,n=p[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return!1;return p[t]=n[0],!0}},x=function(t){return f=!0,c[t]},w=function(t,e){return f&&(t=t.replace(/\uFEFF[0-9]/g,function(t){return c[t]})),e||(t=t.replace(/\\([\'\";:])/g,"$1")),t},C=function(t){return String.fromCharCode(parseInt(t.slice(1),16))},_=function(t){return t.replace(/\\[0-9a-f]+/gi,C)},k=function(e,n,r,o,i,a){if(i=i||a)return"'"+(i=w(i)).replace(/\'/g,"\\'")+"'";if(n=w(n||r||o),!t.allow_script_urls){var u=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(u))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(u))return""}return g&&(n=g.call(v,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,x).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(t){return t.replace(/[;:]/g,x)});r=u.exec(e);)if(u.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),l=r[2].replace(s,""),o&&l){if(o=_(o),l=_(l),-1!==o.indexOf("\ufeff")||-1!==o.indexOf('"'))continue;if(!t.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(l)))continue;"font-weight"===o&&"700"===l?l="bold":"color"!==o&&"background-color"!==o||(l=l.toLowerCase()),l=(l=l.replace(i,Rr)).replace(a,k),p[o]=f?w(l,!0):l}b("border","",!0),b("border","-width"),b("border","-color"),b("border","-style"),b("padding",""),b("margin",""),"border",m="border-style",h="border-color",y(d="border-width")&&y(m)&&y(h)&&(p.border=p[d]+" "+p[m]+" "+p[h],delete p[d],delete p[m],delete p[h]),"medium none"===p.border&&delete p.border,"none"===p["border-image"]&&delete p["border-image"]}return p},serialize:function(t,e){var n="",i=function(e){var o,i=r[e];if(i)for(var a=0,u=i.length;a<u;a++)e=i[a],(o=t[e])&&(n+=(n.length>0?" ":"")+e+": "+o+";")};return e&&r?(i("*"),i(e)):rt(t,function(t,r){!t||o&&!function(t,e){var n=o["*"];return!(n&&n[t]||(n=o[e])&&n[t])}(r,e)||(n+=(n.length>0?" ":"")+r+": "+t+";")}),n}}},Ir=/^(?:mouse|contextmenu)|click/,Pr={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1,mozPressure:1},Mr=function(){return!1},Lr=function(){return!0},Fr=function(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)},Hr=function(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)},jr=function(t,e){var r,o=e||{};for(r in t)Pr[r]||(o[r]=t[r]);if(o.target||(o.target=o.srcElement||n.document),ne.experimentalShadowDom&&(o.target=function(t,e){if(t.composedPath){var n=t.composedPath();if(n&&n.length>0)return n[0]}return e}(t,o.target)),t&&Ir.test(t.type)&&void 0===t.pageX&&void 0!==t.clientX){var i=o.target.ownerDocument||n.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=Lr,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=Lr,t&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=Lr,o.stopPropagation()},!1===function(t){return t.isDefaultPrevented===Lr||t.isDefaultPrevented===Mr}(o)&&(o.isDefaultPrevented=Mr,o.isPropagationStopped=Mr,o.isImmediatePropagationStopped=Mr),void 0===o.metaKey&&(o.metaKey=!1),o},Vr=function(t,e,n){var r=t.document,o={type:"ready"};if(n.domLoaded)e(o);else{var i=function r(){Hr(t,"DOMContentLoaded",r),Hr(t,"load",r),n.domLoaded||(n.domLoaded=!0,e(o))};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():Fr(t,"DOMContentLoaded",i),Fr(t,"load",i)}},zr=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in n.document.documentElement,this.hasFocusIn="onfocusin"in n.document.documentElement,this.count=1}return t.prototype.bind=function(t,e,r,o){var i,a,u,s,c,l,f,d=this,m=n.window,h=function(t){d.executeHandlers(jr(t||m.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 p=e.split(" ");for(u=p.length;u--;)l=h,c=f=!1,"DOMContentLoaded"===(s=p[u])&&(s="ready"),d.domLoaded&&"ready"===s&&"complete"===t.readyState?r.call(o,jr({type:s})):(d.hasMouseEnterLeave||(c=d.mouseEnterLeave[s])&&(l=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=jr(t||m.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,d.executeHandlers(t,i))}),d.hasFocusIn||"focusin"!==s&&"focusout"!==s||(f=!0,c="focusin"===s?"focus":"blur",l=function(t){(t=jr(t||m.event)).type="focus"===t.type?"focusin":"focusout",d.executeHandlers(t,i)}),(a=d.events[i][s])?"ready"===s&&d.domLoaded?r(jr({type:s})):a.push({func:r,scope:o}):(d.events[i][s]=a=[{func:r,scope:o}],a.fakeName=c,a.capture=f,a.nativeHandler=l,"ready"===s?Vr(t,l,d):Fr(t,c||s,l,f)));return t=a=0,r}},t.prototype.unbind=function(t,e,n){var r,o,i,a,u;if(!t||3===t.nodeType||8===t.nodeType)return this;var s=t[this.expando];if(s){if(u=this.events[s],e){var c=e.split(" ");for(o=c.length;o--;)if(r=u[a=c[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var l=r.nativeHandler,f=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=l,r.fakeName=f,r.capture=d,u[a]=r}n&&0!==r.length||(delete u[a],Hr(t,r.fakeName||a,r.nativeHandler,r.capture))}}else rt(u,function(e,n){Hr(t,e.fakeName||n,e.nativeHandler,e.capture)}),u={};for(a in u)if(ft(u,a))return this;delete this.events[s];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},t.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;var o=jr(null,n);o.type=e,o.target=t;do{(r=t[this.expando])&&this.executeHandlers(o,r),t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow}while(t&&!o.isPropagationStopped());return this},t.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),t.getElementsByTagName||(t=t.document),t&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var a=r[o];if(a&&!1===a.func.call(a.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},t.Event=new t,t}(),Ur="sizzle"+-new Date,Wr=n.window.document,qr=0,$r=0,Yr=So(),Gr=So(),Kr=So(),Xr=function(t,e){return t===e&&(kr=!0),0},Jr={}.hasOwnProperty,Qr=[],Zr=Qr.pop,to=Qr.push,eo=Qr.push,no=Qr.slice,ro=Qr.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},oo="[\\x20\\t\\r\\n\\f]",io="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ao="\\["+oo+"*("+io+")(?:"+oo+"*([*^$|!~]?=)"+oo+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+io+"))|)"+oo+"*\\]",uo=":("+io+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ao+")*)|.*)\\)|)",so=new RegExp("^"+oo+"+|((?:^|[^\\\\])(?:\\\\.)*)"+oo+"+$","g"),co=new RegExp("^"+oo+"*,"+oo+"*"),lo=new RegExp("^"+oo+"*([>+~]|"+oo+")"+oo+"*"),fo=new RegExp("="+oo+"*([^\\]'\"]*?)"+oo+"*\\]","g"),mo=new RegExp(uo),ho=new RegExp("^"+io+"$"),po={ID:new RegExp("^#("+io+")"),CLASS:new RegExp("^\\.("+io+")"),TAG:new RegExp("^("+io+"|[*])"),ATTR:new RegExp("^"+ao),PSEUDO:new RegExp("^"+uo),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+oo+"*(even|odd|(([+-]|)(\\d*)n|)"+oo+"*(?:([+-]|)"+oo+"*(\\d+)|))"+oo+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+oo+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+oo+"*((?:-\\d)?\\d*)"+oo+"*\\)|)(?=[^-]|$)","i")},go=/^(?:input|select|textarea|button)$/i,vo=/^h\d$/i,bo=/^[^{]+\{\s*\[native \w/,yo=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xo=/[+~]/,wo=/'|\\/g,Co=new RegExp("\\\\([\\da-f]{1,6}"+oo+"?|("+oo+")|.)","ig"),_o=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{eo.apply(Qr=no.call(Wr.childNodes),Wr.childNodes),Qr[Wr.childNodes.length].nodeType}catch(t){eo={apply:Qr.length?function(t,e){to.apply(t,no.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var ko=function(t,e,n,r){var o,i,a,u,s,c,l,f,d,m;if((e?e.ownerDocument||e:Wr)!==Tr&&Sr(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(u=(e=e||Tr).nodeType)&&9!==u)return[];if(Dr&&!r){if(o=yo.exec(t))if(a=o[1]){if(9===u){if(!(i=e.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(a))&&Ar(e,i)&&i.id===a)return n.push(i),n}else{if(o[2])return eo.apply(n,e.getElementsByTagName(t)),n;if((a=o[3])&&pr.getElementsByClassName)return eo.apply(n,e.getElementsByClassName(a)),n}if(pr.qsa&&(!Er||!Er.test(t))){if(f=l=Ur,d=e,m=9===u&&t,1===u&&"object"!==e.nodeName.toLowerCase()){for(c=yr(t),(l=e.getAttribute("id"))?f=l.replace(wo,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Ao(c[s]);d=xo.test(t)&&Eo(e.parentNode)||e,m=c.join(",")}if(m)try{return eo.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return wr(t.replace(so,"$1"),e,n,r)};function So(){var t=[];return function e(n,r){return t.push(n+" ")>gr.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function To(t){return t[Ur]=!0,t}function Oo(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||1<<31)-(~t.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function Do(t){return To(function(e){return e=+e,To(function(n,r){for(var o,i=t([],n.length,e),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function Eo(t){return t&&void 0!==t.getElementsByTagName&&t}function No(){}function Ao(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function Ro(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=$r++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,a){var u,s,c=[qr,i];if(a){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,a))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((u=(s=e[Ur]||(e[Ur]={}))[r])&&u[0]===qr&&u[1]===i)return c[2]=u[2];if(s[r]=c,c[2]=t(e,n,a))return!0}}}function Bo(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function Io(t,e,n,r,o){for(var i,a=[],u=0,s=t.length,c=null!=e;u<s;u++)(i=t[u])&&(n&&!n(i,r,o)||(a.push(i),c&&e.push(u)));return a}function Po(t,e,n,r,o,i){return r&&!r[Ur]&&(r=Po(r)),o&&!o[Ur]&&(o=Po(o,i)),To(function(i,a,u,s){var c,l,f,d=[],m=[],h=a.length,p=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)ko(t,e[r],n);return n}(e||"*",u.nodeType?[u]:u,[]),g=!t||!i&&e?p:Io(p,d,t,u,s),v=n?o||(i?t:h||r)?[]:a:g;if(n&&n(g,v,u,s),r)for(c=Io(v,m),r(c,[],u,s),l=c.length;l--;)(f=c[l])&&(v[m[l]]=!(g[m[l]]=f));if(i){if(o||t){if(o){for(c=[],l=v.length;l--;)(f=v[l])&&c.push(g[l]=f);o(null,v=[],c,s)}for(l=v.length;l--;)(f=v[l])&&(c=o?ro.call(i,f):d[l])>-1&&(i[c]=!(a[c]=f))}}else v=Io(v===a?v.splice(h,v.length):v),o?o(null,a,v,s):eo.apply(a,v)})}function Mo(t){for(var e,n,r,o=t.length,i=gr.relative[t[0].type],a=i||gr.relative[" "],u=i?1:0,s=Ro(function(t){return t===e},a,!0),c=Ro(function(t){return ro.call(e,t)>-1},a,!0),l=[function(t,n,r){return!i&&(r||n!==Cr)||((e=n).nodeType?s(t,n,r):c(t,n,r))}];u<o;u++)if(n=gr.relative[t[u].type])l=[Ro(Bo(l),n)];else{if((n=gr.filter[t[u].type].apply(null,t[u].matches))[Ur]){for(r=++u;r<o&&!gr.relative[t[r].type];r++);return Po(u>1&&Bo(l),u>1&&Ao(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(so,"$1"),n,u<r&&Mo(t.slice(u,r)),r<o&&Mo(t=t.slice(r)),r<o&&Ao(t))}l.push(n)}return Bo(l)}pr=ko.support={},br=ko.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},Sr=ko.setDocument=function(t){var e,n=t?t.ownerDocument||t:Wr,r=n.defaultView;return n!==Tr&&9===n.nodeType&&n.documentElement?(Tr=n,Or=n.documentElement,Dr=!br(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",function(){Sr()},!1):r.attachEvent&&r.attachEvent("onunload",function(){Sr()})),pr.attributes=!0,pr.getElementsByTagName=!0,pr.getElementsByClassName=bo.test(n.getElementsByClassName),pr.getById=!0,gr.find.ID=function(t,e){if(void 0!==e.getElementById&&Dr){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},gr.filter.ID=function(t){var e=t.replace(Co,_o);return function(t){return t.getAttribute("id")===e}},gr.find.TAG=pr.getElementsByTagName?function(t,e){if(void 0!==e.getElementsByTagName)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},gr.find.CLASS=pr.getElementsByClassName&&function(t,e){if(Dr)return e.getElementsByClassName(t)},Nr=[],Er=[],pr.disconnectedMatch=!0,Er=Er.length&&new RegExp(Er.join("|")),Nr=Nr.length&&new RegExp(Nr.join("|")),e=bo.test(Or.compareDocumentPosition),Ar=e||bo.test(Or.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Xr=e?function(t,e){if(t===e)return kr=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!pr.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===Wr&&Ar(Wr,t)?-1:e===n||e.ownerDocument===Wr&&Ar(Wr,e)?1:_r?ro.call(_r,t)-ro.call(_r,e):0:4&r?-1:1)}:function(t,e){if(t===e)return kr=!0,0;var r,o=0,i=t.parentNode,a=e.parentNode,u=[t],s=[e];if(!i||!a)return t===n?-1:e===n?1:i?-1:a?1:_r?ro.call(_r,t)-ro.call(_r,e):0;if(i===a)return Oo(t,e);for(r=t;r=r.parentNode;)u.unshift(r);for(r=e;r=r.parentNode;)s.unshift(r);for(;u[o]===s[o];)o++;return o?Oo(u[o],s[o]):u[o]===Wr?-1:s[o]===Wr?1:0},n):Tr},ko.matches=function(t,e){return ko(t,null,null,e)},ko.matchesSelector=function(t,e){if((t.ownerDocument||t)!==Tr&&Sr(t),e=e.replace(fo,"='$1']"),pr.matchesSelector&&Dr&&(!Nr||!Nr.test(e))&&(!Er||!Er.test(e)))try{var n=(void 0).call(t,e);if(n||pr.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return ko(e,Tr,null,[t]).length>0},ko.contains=function(t,e){return(t.ownerDocument||t)!==Tr&&Sr(t),Ar(t,e)},ko.attr=function(t,e){(t.ownerDocument||t)!==Tr&&Sr(t);var n=gr.attrHandle[e.toLowerCase()],r=n&&Jr.call(gr.attrHandle,e.toLowerCase())?n(t,e,!Dr):void 0;return void 0!==r?r:pr.attributes||!Dr?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},ko.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ko.uniqueSort=function(t){var e,n=[],r=0,o=0;if(kr=!pr.detectDuplicates,_r=!pr.sortStable&&t.slice(0),t.sort(Xr),kr){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return _r=null,t},vr=ko.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=vr(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=vr(e);return n},(gr=ko.selectors={cacheLength:50,createPseudo:To,match:po,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Co,_o),t[3]=(t[3]||t[4]||t[5]||"").replace(Co,_o),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ko.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ko.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return po.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&mo.test(n)&&(e=yr(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Co,_o).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Yr[t+" "];return e||(e=new RegExp("(^|"+oo+")"+t+"("+oo+"|$)"))&&Yr(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(r){var o=ko.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),a="last"!==t.slice(-4),u="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,s){var c,l,f,d,m,h,p=i!==a?"nextSibling":"previousSibling",g=e.parentNode,v=u&&e.nodeName.toLowerCase(),b=!s&&!u;if(g){if(i){for(;p;){for(f=e;f=f[p];)if(u?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;h=p="only"===t&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&b){for(m=(c=(l=g[Ur]||(g[Ur]={}))[t]||[])[0]===qr&&c[1],d=c[0]===qr&&c[2],f=m&&g.childNodes[m];f=++m&&f&&f[p]||(d=m=0)||h.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[qr,m,d];break}}else if(b&&(c=(e[Ur]||(e[Ur]={}))[t])&&c[0]===qr)d=c[1];else for(;(f=++m&&f&&f[p]||(d=m=0)||h.pop())&&((u?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[Ur]||(f[Ur]={}))[t]=[qr,d]),f!==e)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(t,e){var n,r=gr.pseudos[t]||gr.setFilters[t.toLowerCase()]||ko.error("unsupported pseudo: "+t);return r[Ur]?r(e):r.length>1?(n=[t,t,"",e],gr.setFilters.hasOwnProperty(t.toLowerCase())?To(function(t,n){for(var o,i=r(t,e),a=i.length;a--;)t[o=ro.call(t,i[a])]=!(n[o]=i[a])}):function(t){return r(t,0,n)}):r}},pseudos:{not:To(function(t){var e=[],n=[],r=xr(t.replace(so,"$1"));return r[Ur]?To(function(t,e,n,o){for(var i,a=r(t,null,o,[]),u=t.length;u--;)(i=a[u])&&(t[u]=!(e[u]=i))}):function(t,o,i){return e[0]=t,r(e,null,i,n),!n.pop()}}),has:To(function(t){return function(e){return ko(t,e).length>0}}),contains:To(function(t){return t=t.replace(Co,_o),function(e){return(e.textContent||e.innerText||vr(e)).indexOf(t)>-1}}),lang:To(function(t){return ho.test(t||"")||ko.error("unsupported lang: "+t),t=t.replace(Co,_o).toLowerCase(),function(e){var n;do{if(n=Dr?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(t){var e=n.window.location&&n.window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===Or},focus:function(t){return t===Tr.activeElement&&(!Tr.hasFocus||Tr.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!gr.pseudos.empty(t)},header:function(t){return vo.test(t.nodeName)},input:function(t){return go.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:Do(function(){return[0]}),last:Do(function(t,e){return[e-1]}),eq:Do(function(t,e,n){return[n<0?n+e:n]}),even:Do(function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t}),odd:Do(function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t}),lt:Do(function(t,e,n){for(var r=n<0?n+e:n;--r>=0;)t.push(r);return t}),gt:Do(function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t})}}).pseudos.nth=gr.pseudos.eq,V(["radio","checkbox","file","password","image"],function(t){gr.pseudos[t]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(t)}),V(["submit","reset"],function(t){gr.pseudos[t]=function(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}(t)}),No.prototype=gr.filters=gr.pseudos,gr.setFilters=new No,yr=ko.tokenize=function(t,e){var n,r,o,i,a,u,s,c=Gr[t+" "];if(c)return e?0:c.slice(0);for(a=t,u=[],s=gr.preFilter;a;){for(i in n&&!(r=co.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=lo.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(so," ")}),a=a.slice(n.length)),gr.filter)gr.filter.hasOwnProperty(i)&&(!(r=po[i].exec(a))||s[i]&&!(r=s[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length)));if(!n)break}return e?a.length:a?ko.error(t):Gr(t,u).slice(0)},xr=ko.compile=function(t,e){var n,r=[],o=[],i=Kr[t+" "];if(!i){for(e||(e=yr(t)),n=e.length;n--;)(i=Mo(e[n]))[Ur]?r.push(i):o.push(i);(i=Kr(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,i,a,u,s){var c,l,f,d=0,m="0",h=o&&[],p=[],g=Cr,v=o||r&&gr.find.TAG("*",s),b=qr+=null==g?1:Math.random()||.1,y=v.length;for(s&&(Cr=i!==Tr&&i);m!==y&&null!=(c=v[m]);m++){if(r&&c){for(l=0;f=t[l++];)if(f(c,i,a)){u.push(c);break}s&&(qr=b)}n&&((c=!f&&c)&&d--,o&&h.push(c))}if(d+=m,n&&m!==d){for(l=0;f=e[l++];)f(h,p,i,a);if(o){if(d>0)for(;m--;)h[m]||p[m]||(p[m]=Zr.call(u));p=Io(p)}eo.apply(u,p),s&&!o&&p.length>0&&d+e.length>1&&ko.uniqueSort(u)}return s&&(qr=b,Cr=g),h};return n?To(o):o}(o,r))).selector=t}return i},wr=ko.select=function(t,e,n,r){var o,i,a,u,s,c="function"==typeof t&&t,l=!r&&yr(t=c.selector||t);if(n=n||[],1===l.length){if((i=l[0]=l[0].slice(0)).length>2&&"ID"===(a=i[0]).type&&pr.getById&&9===e.nodeType&&Dr&&gr.relative[i[1].type]){if(!(e=(gr.find.ID(a.matches[0].replace(Co,_o),e)||[])[0]))return n;c&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=po.needsContext.test(t)?0:i.length;o--&&(a=i[o],!gr.relative[u=a.type]);)if((s=gr.find[u])&&(r=s(a.matches[0].replace(Co,_o),xo.test(i[0].type)&&Eo(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&Ao(i)))return eo.apply(n,r),n;break}}return(c||xr(t,l))(r,e,!Dr,n,xo.test(t)&&Eo(e.parentNode)||e),n},pr.sortStable=Ur.split("").sort(Xr).join("")===Ur,pr.detectDuplicates=!!kr,Sr(),pr.sortDetached=!0;var Lo=n.document,Fo=Array.prototype.push,Ho=Array.prototype.slice,jo=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Vo=zr.Event,zo=ae.makeMap("children,contents,next,prev"),Uo=function(t){return void 0!==t},Wo=function(t){return"string"==typeof t},qo=function(t,e){var n,r=(e=e||Lo).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o},$o=function t(e,n,r,o){var i;if(Wo(n))n=qo(n,ai(e[0]));else if(n.length&&!n.nodeType){if(n=li.makeArray(n),o)for(i=n.length-1;i>=0;i--)t(e,n[i],r,o);else for(i=0;i<n.length;i++)t(e,n[i],r,o);return e}if(n.nodeType)for(i=e.length;i--;)r.call(e[i],n);return e},Yo=function(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")},Go=function(t,e,n){var r,o;return e=li(e)[0],t.each(function(){n&&r===this.parentNode||(r=this.parentNode,o=e.cloneNode(!1),this.parentNode.insertBefore(o,this)),o.appendChild(this)}),t},Ko=ae.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Xo=ae.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Jo={for:"htmlFor",class:"className",readonly:"readOnly"},Qo={float:"cssFloat"},Zo={},ti={},ei=function(t,e){return new li.fn.init(t,e)},ni=/^\s*|\s*$/g,ri=function(t){return null==t?"":(""+t).replace(ni,"")},oi=function(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t},ii=function(t,e){var n=[];return oi(t,function(t,r){e(r,t)&&n.push(r)}),n},ai=function(t){return t?9===t.nodeType?t:t.ownerDocument:Lo};ei.fn=ei.prototype={constructor:ei,selector:"",context:null,length:0,init:function(t,e){var r,o;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if(e&&e.nodeType)this.context=e;else{if(e)return li(t).attr(e);this.context=e=n.document}if(Wo(t)){if(this.selector=t,!(r="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:jo.exec(t)))return li(e).find(t);if(r[1])for(o=qo(t,ai(e)).firstChild;o;)Fo.call(this,o),o=o.nextSibling;else{if(!(o=ai(e).getElementById(r[2])))return this;if(o.id!==r[2])return this.find(t);this.length=1,this[0]=o}}else this.add(t,!1);return this},toArray:function(){return ae.toArray(this)},add:function(t,e){var n,r;if(Wo(t))return this.add(li(t));if(!1!==e)for(n=li.unique(this.toArray().concat(li.makeArray(t))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Fo.apply(this,li.makeArray(t));return this},attr:function(t,e){var n,r=this;if("object"==_typeof(t))oi(t,function(t,e){r.attr(t,e)});else{if(!Uo(e)){if(r[0]&&1===r[0].nodeType){if((n=Zo[t])&&n.get)return n.get(r[0],t);if(Xo[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each(function(){var n;if(1===this.nodeType){if((n=Zo[t])&&n.set)return void n.set(this,e);null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2)}})}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==_typeof(t=Jo[t]||t))oi(t,function(t,e){n.prop(t,e)});else{if(!Uo(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each(function(){1===this.nodeType&&(this[t]=e)})}return n},css:function(t,e){var n,r,o=this,i=function(t){return t.replace(/-(\D)/g,function(t,e){return e.toUpperCase()})},a=function(t){return t.replace(/[A-Z]/g,function(t){return"-"+t})};if("object"==_typeof(t))oi(t,function(t,e){o.css(t,e)});else if(Uo(e))t=i(t),"number"!=typeof e||Ko[t]||(e=e.toString()+"px"),o.each(function(){var n=this.style;if((r=ti[t])&&r.set)r.set(this,e);else{try{this.style[Qo[t]||t]=e}catch(t){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(a(t)):n.removeAttribute(t))}});else{if(n=o[0],(r=ti[t])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(t)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(a(t))}catch(t){return}}return o},remove:function(){for(var t,e=this.length;e--;)t=this[e],Vo.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e;if(Uo(t)){e=this.length;try{for(;e--;)this[e].innerHTML=t}catch(n){li(this[e]).empty().append(t)}return this}return this[0]?this[0].innerHTML:""},text:function(t){var e;if(Uo(t)){for(e=this.length;e--;)"innerText"in this[e]?this[e].innerText=t:this[0].textContent=t;return this}return this[0]?this[0].innerText||this[0].textContent:""},append:function(){return $o(this,arguments,function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)})},prepend:function(){return $o(this,arguments,function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)},!0)},before:function(){var t=this;return t[0]&&t[0].parentNode?$o(t,arguments,function(t){this.parentNode.insertBefore(t,this)}):t},after:function(){var t=this;return t[0]&&t[0].parentNode?$o(t,arguments,function(t){this.parentNode.insertBefore(t,this.nextSibling)},!0):t},appendTo:function(t){return li(t).append(this),this},prependTo:function(t){return li(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return Go(this,t)},wrapAll:function(t){return Go(this,t,!0)},wrapInner:function(t){return this.each(function(){li(this).contents().wrapAll(t)}),this},unwrap:function(){return this.parent().each(function(){li(this).replaceWith(this.childNodes)})},clone:function(){var t=[];return this.each(function(){t.push(this.cloneNode(!0))}),li(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t||(-1!==t.indexOf(" ")?oi(t.split(" "),function(){n.toggleClass(this,e)}):n.each(function(n,r){var o=Yo(r,t);if(o!==e){var i=r.className;o?r.className=ri((" "+i+" ").replace(" "+t+" "," ")):r.className+=i?" "+t:t}})),n},hasClass:function(t){return Yo(this[0],t)},each:function(t){return oi(this,t)},on:function(t,e){return this.each(function(){Vo.bind(this,t,e)})},off:function(t,e){return this.each(function(){Vo.unbind(this,t,e)})},trigger:function(t){return this.each(function(){"object"==_typeof(t)?Vo.fire(this,t.type,t):Vo.fire(this,t)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new li(Ho.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){var e,n,r=[];for(e=0,n=this.length;e<n;e++)li.find(t,this[e],r);return li(r)},filter:function(t){return li("function"==typeof t?ii(this.toArray(),function(e,n){return t(n,e)}):li.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof li&&(t=t[0]),this.each(function(n,r){for(;r;){if("string"==typeof t&&li(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}}),li(e)},offset:function(t){var e,n,r,o,i=0,a=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Fo,sort:Array.prototype.sort,splice:Array.prototype.splice},ae.extend(ei,{extend:ae.extend,makeArray:function(t){return(e=t)&&e===e.window||t.nodeType?[t]:ae.toArray(t);var e},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:ae.isArray,each:oi,trim:ri,grep:ii,find:ko,expr:ko.selectors,unique:ko.uniqueSort,text:ko.getText,contains:ko.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return 1===e.length?li.find.matchesSelector(e[0],t)?[e[0]]:[]:li.find.matches(t,e)}});var ui=function(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof li&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&li(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r},si=function(t,e,n,r){var o=[];for(r instanceof li&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&li(t).is(r))break}o.push(t)}return o},ci=function(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null};oi({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return ui(t,"parentNode")},next:function(t){return ci(t,"nextSibling",1)},prev:function(t){return ci(t,"previousSibling",1)},children:function(t){return si(t.firstChild,"nextSibling",1)},contents:function(t){return ae.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},function(t,e){ei.fn[t]=function(n){var r=[];this.each(function(){var t=e.call(r,this,n,r);t&&(li.isArray(t)?r.push.apply(r,t):r.push(t))}),this.length>1&&(zo[t]||(r=li.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=li(r);return n?o.filter(n):o}}),oi({parentsUntil:function(t,e){return ui(t,"parentNode",e)},nextUntil:function(t,e){return si(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return si(t,"previousSibling",1,e).slice(1)}},function(t,e){ei.fn[t]=function(n,r){var o=[];this.each(function(){var t=e.call(o,this,n,o);t&&(li.isArray(t)?o.push.apply(o,t):o.push(t))}),this.length>1&&(o=li.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=li(o);return r?i.filter(r):i}}),ei.fn.is=function(t){return!!t&&this.filter(t).length>0},ei.fn.init.prototype=ei.fn,ei.overrideDefaults=function(t){var e,n=function n(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o||(o=e.context),new n.fn.init(r,o)};return li.extend(n,this),n},ei.attrHooks=Zo,ei.cssHooks=ti;var li=ei,fi=function(){function t(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return t.prototype.current=function(){return this.node},t.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},t.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},t.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},t.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},t.prototype.findPreviousNode=function(t,e,n,r){var o,i,a;if(t){if(o=t[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(a=o[e];a;a=a[e])if(!a[e])return a;return o}if((i=t.parentNode)&&i!==this.rootNode)return i}},t}(),di={},mi={exports:di};!function(t,n,r,o){!function(t){"object"==_typeof(n)&&void 0!==r?r.exports=t():("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function t(e,n,r){function i(u,s){if(!n[u]){if(!e[u]){var c="function"==typeof o&&o;if(!s&&c)return c(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:{}};e[u][0].call(f.exports,function(t){return i(e[u][1][t]||t)},f,f.exports,t,e,n,r)}return n[u].exports}for(var a="function"==typeof o&&o,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(t,e,n){var r,o,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(t){o=u}}();var c,l=[],f=!1,d=-1;function m(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&h())}function h(){if(!f){var t=s(m);f=!0;for(var e=l.length;e;){for(c=l,l=[];++d<e;)c&&c[d].run();d=-1,e=l.length}c=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new p(t,e)),1!==l.length||f||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=_typeof(this))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function a(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void s(e.promise,t)}u(e.promise,r)}else(1===t._state?u:s)(e.promise,t._value)})):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==_typeof(e)||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){s(t,e)}var r,o}function s(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t(function(t){n||(n=!0,u(e,t))},function(t){n||(n=!0,s(e,t))})}catch(t){if(n)return;n=!0,s(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return a(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i(function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==_typeof(a)||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,function(t){o(i,t)},n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])})},i.resolve=function(t){return t&&"object"==_typeof(t)&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(t){return new i(function(e,n){n(t)})},i.race=function(t){return new i(function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)})},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,a=Array.prototype.slice,u={},s=0;function c(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new c(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new c(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n.setImmediate="function"==typeof e?e:function(t){var e=s++,r=!(arguments.length<2)&&a.call(arguments,1);return u[e]=!0,o(function(){u[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))}),e},n.clearImmediate="function"==typeof r?r:function(t){delete u[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)})}(0,di,mi,void 0);var hi,pi=mi.exports.boltExport,gi=function t(e){var r=C.none(),o=[],i=function(t){a()?u(t):o.push(t)},a=function(){return r.isSome()},u=function(t){r.each(function(e){n.setTimeout(function(){t(e)},0)})};return e(function(t){a()||(r=C.some(t),function(t){V(t,u)}(o),o=[])}),{get:i,map:function(e){return t(function(t){i(function(n){t(e(n))})})},isReady:a}},vi=gi,bi=function(t){n.setTimeout(function(){throw t},0)},yi=function(t){return function t(e){var n=function(t){e().then(t,bi)};return{map:function(n){return t(function(){return e().then(n)})},bind:function(n){return t(function(){return e().then(function(t){return n(t).toPromise()})})},anonBind:function(n){return t(function(){return e().then(function(){return n.toPromise()})})},toLazy:function(){return vi(n)},toCached:function(){var n=null;return t(function(){return null===n&&(n=e()),n})},toPromise:e,get:n}}(function(){return new pi(t)})},xi=function(t,e){return e(function(e){var n=[],r=0;0===t.length?e([]):V(t,function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))})})},wi=function t(e){return{is:function(t){return e===t},isValue:b,isError:v,getOr:d(e),getOrThunk:d(e),getOrDie:d(e),or:function(n){return t(e)},orThunk:function(n){return t(e)},fold:function(t,n){return n(e)},map:function(n){return t(n(e))},mapError:function(n){return t(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return C.some(e)}}},Ci=function t(e){return{is:v,isValue:v,isError:b,getOr:m,getOrThunk:function(t){return t()},getOrDie:function(){return g(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(n){return t(e)},mapError:function(n){return t(n(e))},each:l,bind:function(n){return t(e)},exists:v,forall:b,toOption:C.none}},_i={value:wi,error:Ci,fromOption:function(t,e){return t.fold(function(){return Ci(e)},wi)}},ki=function(t){if(!D(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=[],r={};return V(t,function(o,i){var a=et(o);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],s=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(!D(s))throw new Error("case arguments must be an array");e.push(u),r[u]=function(){var r=arguments.length;if(r!==s.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+s.length+" ("+s+"), got "+r);for(var o=new Array(r),a=0;a<o.length;a++)o[a]=arguments[a];return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);return arguments[i].apply(null,o)},match:function(t){var n=et(t);if(e.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+n.join(","));if(!K(e,function(t){return F(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,o)},log:function(t){n.console.log(t,{constructors:e,constructor:u,params:o})}}}}),r},Si=(ki([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){return t.fold(m,m)}),Ti=window.Promise?window.Promise:function(){function t(t,e){return function(){t.apply(e,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=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=[],l(e,t(a,this),t(u,this))},o=r.immediateFn||"function"==typeof n.setImmediate&&n.setImmediate||function(t){n.setTimeout(t,1)};function i(t){var e=this;null!==this._state?o(function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)}):this._deferreds.push(t)}function a(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 l(t(n,e),t(a,this),t(u,this))}this._state=!0,this._value=e,s.call(this)}catch(t){u.call(this,t)}}function u(t){this._state=!1,this._value=t,s.call(this)}function s(){for(var t=0,e=this._deferreds.length;t<e;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(t){if(r)return;r=!0,n(t)}}return r.prototype.catch=function(t){return this.then(null,t)},r.prototype.then=function(t,e){var n=this;return new r(function(r,o){i.call(n,new c(t,e,r,o))})},r.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new r(function(e,n){if(0===t.length)return e([]);var r=t.length;function o(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(t){o(i,t)},n)}t[i]=a,0==--r&&e(t)}catch(t){n(t)}}for(var i=0;i<t.length;i++)o(i,t[i])})},r.resolve=function(t){return t&&"object"==_typeof(t)&&t.constructor===r?t:new r(function(e){e(t)})},r.reject=function(t){return new r(function(e,n){n(t)})},r.race=function(t){return new r(function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)})},r}(),Oi=function(t,e){return"number"!=typeof e&&(e=0),n.setTimeout(t,e)},Di=function(t,e){return"number"!=typeof e&&(e=1),n.setInterval(t,e)},Ei=function(t,e){var r,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n.clearTimeout(r),r=Oi(function(){t.apply(this,o)},e)};return o.stop=function(){n.clearTimeout(r)},o},Ni={requestAnimationFrame:function(t,e){hi?hi.then(t):hi=new Ti(function(t){e||(e=n.document.body),function(t,e){var r,o=n.window.requestAnimationFrame,i=["ms","moz","webkit"];for(r=0;r<i.length&&!o;r++)o=n.window[i[r]+"RequestAnimationFrame"];o||(o=function(t){n.window.setTimeout(t,0)}),o(t,e)}(t,e)}).then(t)},setTimeout:Oi,setInterval:Di,setEditorTimeout:function(t,e,n){return Oi(function(){t.removed||e()},n)},setEditorInterval:function(t,e,r){var o=Di(function(){t.removed?n.clearInterval(o):e()},r);return o},debounce:Ei,throttle:Ei,clearInterval:function(t){return n.clearInterval(t)},clearTimeout:function(t){return n.clearTimeout(t)}};function Ai(t,e){void 0===e&&(e={});var r=0,o={},i=se.fromDom(t),a=Ce(i),u=e.maxLoadTime||5e3,s=function(t){je(Pe(i),t)},c=function(i,c,l){var f,d,m,h=function(t){m.status=t,m.passed=[],m.failed=[],f&&(f.onload=null,f.onerror=null,f=null)},p=function(){for(var t=m.passed,e=t.length;e--;)t[e]();h(2)},g=function(){for(var t=m.failed,e=t.length;e--;)t[e]();h(3)},v=function(t,e){t()||((new Date).getTime()-x<u?Ni.setTimeout(e):g())},b=function e(){v(function(){for(var e,n,r=t.styleSheets,o=r.length;o--;)if((n=(e=r[o]).ownerNode?e.ownerNode:e.owningElement)&&n.id===f.id)return p(),!0},e)};if(i=ae._addCacheSuffix(i),o[i]?m=o[i]:(m={passed:[],failed:[]},o[i]=m),c&&m.passed.push(c),l&&m.failed.push(l),1!==m.status)if(2!==m.status)if(3!==m.status){m.status=1,(f=a.dom().createElement("link")).rel="stylesheet",f.type="text/css",f.id="u"+r++,f.async=!1,f.defer=!1;var y,x=(new Date).getTime();if(e.contentCssCors&&(f.crossOrigin="anonymous"),e.referrerPolicy&&xn(se.fromDom(f),"referrerpolicy",e.referrerPolicy),!("onload"in f)||(y=n.navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(y[1],10)<536){if(n.navigator.userAgent.indexOf("Firefox")>0)return(d=a.dom().createElement("style")).textContent='@import "'+i+'"',function t(){v(function(){try{var t=d.sheet.cssRules;return p(),!!t}catch(t){}},t)}(),void s(se.fromDom(d));b()}else f.onload=b,f.onerror=g;s(se.fromDom(f)),f.href=i}else g();else p()},l=function(t){return yi(function(e){c(t,f(e,d(_i.value(t))),f(e,d(_i.error(t))))})};return{load:c,loadAll:function(t,e,n){var r;(r=j(t,l),xi(r,yi)).get(function(t){var r=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var a=t[o];(e(a)?n:r).push(a)}return{pass:n,fail:r}}(t,function(t){return t.isValue()});r.fail.length>0?n(r.fail.map(Si)):e(r.pass.map(Si))})},_setReferrerPolicy:function(t){e.referrerPolicy=t}}}var Ri=function(){var t=new WeakMap;return{forElement:function(e,n){var r=Ie(e).dom();return C.from(t.get(r)).getOrThunk(function(){var e=Ai(r,n);return t.set(r,e),e})}}}(),Bi=ae.each,Ii=ae.grep,Pi=ne.ie,Mi=/^([a-z0-9],?)+$/i,Li=/^[ \t\r\n]*$/,Fi=function(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName);r||(r=null),e.attr("data-mce-style",r)},Hi=function(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o};function ji(t,e){var r=this;void 0===e&&(e={});var o={},i=n.window,a={},u=0,s=Ri.forElement(se.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),c=[],l=e.schema?e.schema:hr({}),f=Br({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),d=e.ownEvents?new zr:zr.Event,m=l.getBlockElements(),h=li.overrideDefaults(function(){return{context:t,element:j.getRoot()}}),p=function(e){return e&&t&&T(e)?t.getElementById(e):e},g=function(t){return h("string"==typeof t?p(t):t)},v=function(t,e,n){var r,o,i=g(t);return i.length&&(o=(r=V[e])&&r.get?r.get(i,e):i.attr(e)),void 0===o&&(o=n||""),o},b=function(t){var e=p(t);return e?e.attributes:[]},y=function(t,n,r){""===r&&(r=null);var o=g(t),i=o.attr(n);if(o.length){var a=V[n];a&&a.set?a.set(o,r,n):o.attr(n,r),i!==r&&e.onSetAttrib&&e.onSetAttrib({attrElm:o,attrName:n,attrValue:r})}},x=function(){return e.root_element||t.body},w=function(e,n){return Nn(t.body,p(e),n)},C=function(t,e,n){var r=g(t);return n?r.css(e):("float"===(e=e.replace(/-(\D)/g,function(t,e){return e.toUpperCase()}))&&(e=ne.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[e]:void 0)},_=function(t){var e,n;return t=p(t),e=C(t,"width"),n=C(t,"height"),-1===e.indexOf("px")&&(e=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},k=function(t,e){var n;if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(Mi.test(e)){var r=e.toLowerCase().split(/,/),o=t.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return ko(e,i[0].ownerDocument||i[0],null,i).length>0},S=function(t,e,n,r){var o,i=[],a=p(t);for(r=void 0===r,n=n||("BODY"!==x().nodeName?x().parentNode:null),ae.is(e,"string")&&(o=e,e="*"===e?function(t){return 1===t.nodeType}:function(t){return k(t,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!e||"function"==typeof e&&e(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},O=function(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return k(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null},D=function(t,e,n){var o,i="string"==typeof t?p(t):t;if(!i)return!1;if(ae.isArray(i)&&(i.length||0===i.length))return o=[],Bi(i,function(t,r){t&&("string"==typeof t&&(t=p(t)),o.push(e.call(n,t,r)))}),o;var a=n||r;return e.call(a,i)},E=function(t,e){g(t).each(function(t,n){Bi(e,function(t,e){y(n,e,t)})})},N=function(t,e){var n=g(t);Pi?n.each(function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){li("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}}):n.html(e)},A=function(e,n,r,o,i){return D(e,function(e){var a="string"==typeof n?t.createElement(n):n;return E(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&N(a,o)),i?a:e.appendChild(a)})},R=function(e,n,r){return A(t.createElement(e),e,n,r,!0)},B=or.encodeAllRaw,I=function(t,e){var n=g(t);return e?n.each(function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)}).remove():n.remove(),n.length>1?n.toArray():n[0]},P=function(t,e,n){g(t).toggleClass(e,n).each(function(){""===this.className&&li(this).attr("class",null)})},M=function(t,e,n){return D(e,function(e){return ae.is(e,"array")&&(t=t.cloneNode(!0)),n&&Bi(Ii(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},L=function(t){if(nn(t)){var e="a"===t.nodeName.toLowerCase()&&!v(t,"href")&&v(t,"id");if(v(t,"name")||v(t,"data-mce-bookmark")||e)return!0}return!1},F=function(){return t.createRange()},H=function(t){if(t&&nn(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null},j={doc:t,settings:e,win:i,files:a,stdMode:!0,boxModel:!0,styleSheetLoader:s,boundEvents:c,styles:f,schema:l,events:d,isBlock:function(t){if("string"==typeof t)return!!m[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!m[t.nodeName])}return!1},$:h,$$:g,root:null,clone:function(e,n){if(!Pi||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return Bi(b(e),function(t){y(r,t.nodeName,v(e,t.nodeName))}),r},getRoot:x,getViewPort:function(t){var e=Ze(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){t=p(t);var e=w(t),n=_(t);return{x:e.x,y:e.y,w:n.w,h:n.h}},getSize:_,getParent:function(t,e,n){var r=S(t,e,n,!1);return r&&r.length>0?r[0]:null},getParents:S,get:p,getNext:function(t,e){return O(t,e,"nextSibling")},getPrev:function(t,e){return O(t,e,"previousSibling")},select:function(n,r){return ko(n,p(r)||e.root_element||t,[])},is:k,add:A,create:R,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)e.hasOwnProperty(r)&&null!==e[r]&&void 0!==e[r]&&(o+=" "+r+'="'+B(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:I,setStyle:function(t,n,r){var o=T(n)?g(t).css(n,r):g(t).css(n);e.update_styles&&Fi(f,o)},getStyle:C,setStyles:function(t,n){var r=g(t).css(n);e.update_styles&&Fi(f,r)},removeAllAttribs:function(t){return D(t,function(t){var e,n=t.attributes;for(e=n.length-1;e>=0;e--)t.removeAttributeNode(n.item(e))})},setAttrib:y,setAttribs:E,getAttrib:v,getPos:w,parseStyle:function(t){return f.parse(t)},serializeStyle:function(t,e){return f.serialize(t,e)},addStyle:function(e){var r,i;if(j!==ji.DOM&&t===n.document){if(o[e])return;o[e]=!0}(i=t.getElementById("mceDefaultStyles"))||((i=t.createElement("style")).id="mceDefaultStyles",i.type="text/css",(r=t.getElementsByTagName("head")[0]).firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(t.createTextNode(e))},loadCSS:function(r){if(j===ji.DOM||t!==n.document){r||(r="");var o=t.getElementsByTagName("head")[0];Bi(r.split(","),function(t){if(t=ae._addCacheSuffix(t),!a[t]){a[t]=!0;var n=R("link",xt(xt({rel:"stylesheet",type:"text/css",href:t},e.contentCssCors?{crossOrigin:"anonymous"}:{}),e.referrerPolicy?{referrerPolicy:e.referrerPolicy}:{}));o.appendChild(n)}})}else ji.DOM.loadCSS(r)},addClass:function(t,e){g(t).addClass(e)},removeClass:function(t,e){P(t,e,!1)},hasClass:function(t,e){return g(t).hasClass(e)},toggleClass:P,show:function(t){g(t).show()},hide:function(t){g(t).hide()},isHidden:function(t){return"none"===g(t).css("display")},uniqueId:function(t){return(t||"mce_")+u++},setHTML:N,getOuterHTML:function(t){var e="string"==typeof t?p(t):t;return nn(e)?e.outerHTML:li("<div></div>").append(li(e).clone()).html()},setOuterHTML:function(t,e){g(t).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}I(li(this).html(e),!0)})},decode:or.decode,encode:B,insertAfter:function(t,e){var n=p(e);return D(t,function(t){var e=n.parentNode,r=n.nextSibling;return r?e.insertBefore(t,r):e.appendChild(t),t})},replace:M,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=R(e),Bi(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),M(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return f.toHex(ae.trim(t))},run:D,getAttribs:b,isEmpty:function(t,e){var n,r,o=0;if(L(t))return!1;if(t=t.firstChild){var i=new fi(t,t.parentNode),a=l?l.getWhiteSpaceElements():{};e=e||(l?l.getNonEmptyElements():null);do{if(n=t.nodeType,nn(t)){var u=t.getAttribute("data-mce-bogus");if(u){t=i.next("all"===u);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"===r){o++,t=i.next();continue}return!1}if(L(t))return!1}if(8===n)return!1;if(3===n&&!Li.test(t.nodeValue))return!1;if(3===n&&t.parentNode&&a[t.parentNode.nodeName]&&Li.test(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:F,nodeIndex:Hi,split:function(t,e,n){var r,o,i,a=F();if(t&&e)return a.setStart(t.parentNode,Hi(t)),a.setEnd(e.parentNode,Hi(e)),r=a.extractContents(),(a=F()).setStart(e.parentNode,Hi(e)+1),a.setEnd(t.parentNode,Hi(t)+1),o=a.extractContents(),(i=t.parentNode).insertBefore(Wn(j,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(Wn(j,o),t),I(t),n||e},bind:function n(r,o,a,u){if(ae.isArray(r)){for(var s=r.length,l=[];s--;)l[s]=n(r[s],o,a,u);return l}return!e.collect||r!==t&&r!==i||c.push([r,o,a,u]),d.bind(r,o,a,u||j)},unbind:function e(n,r,o){var a;if(ae.isArray(n)){a=n.length;for(var u=[];a--;)u[a]=e(n[a],r,o);return u}if(c.length>0&&(n===t||n===i))for(a=c.length;a--;){var s=c[a];n!==s[0]||r&&r!==s[1]||o&&o!==s[2]||d.unbind(s[0],s[1],s[2])}return d.unbind(n,r,o)},fire:function(t,e,n){return d.fire(t,e,n)},getContentEditable:H,getContentEditableParent:function(t){for(var e=x(),n=null;t&&t!==e&&null===(n=H(t));t=t.parentNode);return n},destroy:function(){if(c.length>0)for(var t=c.length;t--;){var e=c[t];d.unbind(e[0],e[1],e[2])}ko.setDocument&&ko.setDocument()},isChildOf:function(t,e){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},V=function(t,e,n){var r=e.keep_values,o={set:function(t,n,r){e.url_converter&&(n=e.url_converter.call(e.url_converter_scope||j,n,r,t[0])),t.attr("data-mce-"+r,n).attr(r,n)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},i={style:{set:function(e,n){null===n||"object"!=_typeof(n)?(r&&e.attr("data-mce-style",n),null!==n&&"string"==typeof n?(e.removeAttr("style"),e.css(t.parse(n))):e.attr("style",n)):e.css(n)},get:function(e){var n=e.attr("data-mce-style")||e.attr("style");return t.serialize(t.parse(n),e[0].nodeName)}}};return r&&(i.href=i.src=o),i}(f,e);return j}!function(t){t.DOM=t(n.document),t.nodeIndex=Hi}(ji||(ji={}));var Vi=ji,zi=Vi.DOM,Ui=ae.each,Wi=ae.grep,qi=function(){function t(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}return t.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},t.prototype.loadScript=function(t,e,r){var o,i=zi,a=i.uniqueId();(o=n.document.createElement("script")).id=a,o.type="text/javascript",o.src=ae._addCacheSuffix(t),this.settings.referrerPolicy&&i.setAttrib(o,"referrerpolicy",this.settings.referrerPolicy),o.onload=function(){i.remove(a),o&&(o.onreadystatechange=o.onload=o=null),e()},o.onerror=function(){R(r)?r():void 0!==n.console&&n.console.log&&n.console.log("Failed to load script: "+t)},(n.document.getElementsByTagName("head")[0]||n.document.body).appendChild(o)},t.prototype.isDone=function(t){return 2===this.states[t]},t.prototype.markDone=function(t){this.states[t]=2},t.prototype.add=function(t,e,n,r){void 0===this.states[t]&&(this.queue.push(t),this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},t.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},t.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},t.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},t.prototype.loadScripts=function(t,e,n,r){var o=this,i=[],a=function(t,e){Ui(o.scriptLoadedCallbacks[e],function(e){R(e[t])&&e[t].call(e.scope)}),o.scriptLoadedCallbacks[e]=void 0};o.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});!function e(){var n=Wi(t);if(t.length=0,Ui(n,function(t){2!==o.states[t]?3!==o.states[t]?1!==o.states[t]&&(o.states[t]=1,o.loading++,o.loadScript(t,function(){o.states[t]=2,o.loading--,a("success",t),e()},function(){o.states[t]=3,o.loading--,i.push(t),a("failure",t),e()})):a("failure",t):a("success",t)}),!o.loading){var r=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,Ui(r,function(t){0===i.length?R(t.success)&&t.success.call(t.scope):R(t.failure)&&t.failure.call(t.scope,i)})}}()},t.ScriptLoader=new t,t}(),$i=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Yi={},Gi=$i("en"),Ki=function(){return lt(Yi,Gi.get())},Xi={getData:function(){return ot(Yi,function(t){return xt({},t)})},setCode:function(t){t&&Gi.set(t)},getCode:function(){return Gi.get()},add:function(t,e){var n=Yi[t];n||(Yi[t]=n={}),rt(e,function(t,e){n[e.toLowerCase()]=t})},translate:function(t){var e,n=Ki().getOr({}),r=function(t){return R(t)?Object.prototype.toString.call(t):o(t)?"":""+t},o=function(t){return""===t||null==t},i=function(t){var e=r(t);return lt(n,e.toLowerCase()).map(r).getOr(e)},a=function(t){return t.replace(/{context:\w+}$/,"")};if(o(t))return"";if(O(e=t)&&ft(e,"raw"))return r(t.raw);if(function(t){return D(t)&&t.length>1}(t)){var u=t.slice(1);return a(i(t[0]).replace(/\{([0-9]+)\}/g,function(t,e){return ft(u,e)?r(u[e]):t}))}return a(i(t))},isRtl:function(){return Ki().bind(function(t){return lt(t,"_dir")}).exists(function(t){return"rtl"===t})},hasCode:function(t){return ft(Yi,t)}};function Ji(){var t=this,e=[],n={},r={},o=[],i=function(t,e){var n=U(o,function(n){return n.name===t&&n.state===e});V(n,function(t){return t.callback()})},a=function(t){var e;return r[t]&&(e=r[t].dependencies),e||[]},u=function(t,e){return"object"==_typeof(e)?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}},s=function(t,e,i){void 0===i&&(i="added"),ft(r,t)&&"added"===i||ft(n,t)&&"loaded"===i?e():o.push({name:t,state:i,callback:e})};return{items:e,urls:n,lookup:r,_listeners:o,get:function(t){if(r[t])return r[t].instance},dependencies:a,requireLangPack:function(t,e){!1!==Ji.languageLoad&&s(t,function(){var r=Xi.getCode();!r||e&&-1===(","+(e||"")+",").indexOf(","+r+",")||qi.ScriptLoader.add(n[t]+"/langs/"+r+".js")},"loaded")},add:function(t,n,o){var a=n;return e.push(a),r[t]={instance:a,dependencies:o},i(t,"added"),a},remove:function(t){delete n[t],delete r[t]},createUrl:u,addComponents:function(e,n){var r=t.urls[e];V(n,function(t){qi.ScriptLoader.add(r+"/"+t)})},load:function t(e,o,s,c,l){if(!n[e]){var f="string"==typeof o?o:o.prefix+o.resource+o.suffix;0!==f.indexOf("/")&&-1===f.indexOf("://")&&(f=Ji.baseURL+"/"+f),n[e]=f.substring(0,f.lastIndexOf("/"));var d=function(){i(e,"loaded"),function(e,n,r,o){var i=a(e);V(i,function(e){var r=u(n,e);t(r.resource,r,void 0,void 0)}),r&&(o?r.call(o):r.call(qi))}(e,o,s,c)};r[e]?d():qi.ScriptLoader.add(f,d,c,l)}},waitFor:s}}!function(t){t.PluginManager=t(),t.ThemeManager=t()}(Ji||(Ji={}));var Qi=Ji,Zi=function(t,e){var r=null;return{cancel:function(){null!==r&&(n.clearTimeout(r),r=null)},throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null===r&&(r=n.setTimeout(function(){t.apply(null,o),r=null},e))}}},ta=function(t,e){var r=null;return{cancel:function(){null!==r&&(n.clearTimeout(r),r=null)},throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null!==r&&n.clearTimeout(r),r=n.setTimeout(function(){t.apply(null,o),r=null},e)}}},ea=function(t,e){var n=Cn(t,e);return void 0===n||""===n?[]:n.split(" ")},na=function(t){return void 0!==t.dom().classList},ra=function(t,e){na(t)?t.dom().classList.add(e):function(t,e){(function(t,e,n){var r=ea(t,e).concat([n]);xn(t,e,r.join(" "))})(t,"class",e)}(t,e)},oa=function(t,e){return na(t)&&t.dom().classList.contains(e)},ia=function(t,e){return function(t,e){var r=void 0===e?n.document:e.dom();return be(r)?[]:j(r.querySelectorAll(t),se.fromDom)}(e,t)};function aa(t,e,n,r,o){return t(n,r)?C.some(n):R(o)&&o(n)?C.none():e(n,r,o)}var ua=function(t,e,n){for(var r=t.dom(),o=R(n)?n:d(!1);r.parentNode;){r=r.parentNode;var i=se.fromDom(r);if(e(i))return C.some(i);if(o(i))break}return C.none()},sa=function(t,e,n){return aa(function(t,e){return e(t)},ua,t,e,n)},ca=function(t,e,n){return ua(t,function(t){return ve(t,e)},n)},la=function(t,e){return function(t,e){var r=void 0===e?n.document:e.dom();return be(r)?C.none():C.from(r.querySelector(t)).map(se.fromDom)}(e,t)},fa=function(t,e,n){return aa(function(t,e){return ve(t,e)},ca,t,e,n)},da=d("mce-annotation"),ma=d("data-mce-annotation"),ha=d("data-mce-annotation-uid"),pa=function(t,e){var n=t.selection.getRng(),r=se.fromDom(n.startContainer),o=se.fromDom(t.getBody()),i=e.fold(function(){return"."+da()},function(t){return"["+ma()+'="'+t+'"]'}),a=Ne(r,n.startOffset).getOr(r),u=fa(a,i,function(t){return ye(t,o)}),s=function(t,e){return function(t,e){var n=t.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(e)}(t,e)?C.some(Cn(t,e)):C.none()};return u.bind(function(e){return s(e,""+ha()).bind(function(n){return s(e,""+ma()).map(function(e){var r=ga(t,n);return{uid:n,name:e,elements:r}})})})},ga=function(t,e){var n=se.fromDom(t.getBody());return ia(n,"["+ha()+'="'+e+'"]')},va=0,ba=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++va+String(e)},ya=function(t,e){var r,o,i=we(t).dom(),a=se.fromDom(i.createDocumentFragment()),u=(r=e,(o=(i||n.document).createElement("div")).innerHTML=r,Ee(se.fromDom(o)));Ve(a,u),ze(t),je(t,a)},xa=function(t,e){return se.fromDom(t.dom().cloneNode(e))},wa=function(t){return xa(t,!1)},Ca=function(t){return xa(t,!0)},_a=function(t,e,n){void 0===n&&(n=v);var r=new fi(t,e),o=function(t){var e;do{e=r[t]()}while(e&&!fn(e)&&!n(e));return C.from(e).filter(fn)};return{current:function(){return C.from(r.current()).filter(fn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},ka=function(t,e){var n=e||function(e){return t.isBlock(e)||pn(e)||vn(e)},r=function t(e,n,r,o){if(fn(e)){var i=o(e,n,e.data);if(-1!==i)return C.some({container:e,offset:i})}return r().bind(function(e){return t(e.container,e.offset,r,o)})};return{backwards:function(t,e,o,i){var a=_a(t,i,n);return r(t,e,function(){return a.prev().map(function(t){return{container:t,offset:t.length}})},o).getOrNull()},forwards:function(t,e,o,i){var a=_a(t,i,n);return r(t,e,function(){return a.next().map(function(t){return{container:t,offset:0}})},o).getOrNull()}}},Sa=function(t){return"\ufeff"===t},Ta=function(t){return t.replace(/\uFEFF/g,"")},Oa=nn,Da=fn,Ea=function(t){return Da(t)&&(t=t.parentNode),Oa(t)&&t.hasAttribute("data-mce-caret")},Na=function(t){return Da(t)&&Sa(t.data)},Aa=function(t){return Ea(t)||Na(t)},Ra=function(t){return t.firstChild!==t.lastChild||!pn(t.firstChild)},Ba=function(t){var e=t.container();return!(!t||!fn(e))&&("\ufeff"===e.data.charAt(t.offset())||t.isAtStart()&&Na(e.previousSibling))},Ia=function(t){var e=t.container();return!(!t||!fn(e))&&("\ufeff"===e.data.charAt(t.offset()-1)||t.isAtEnd()&&Na(e.nextSibling))},Pa=function(t,e,r){var o,i=e.ownerDocument.createElement(t);i.setAttribute("data-mce-caret",r?"before":"after"),i.setAttribute("data-mce-bogus","all"),i.appendChild(((o=n.document.createElement("br")).setAttribute("data-mce-bogus","1"),o));var a=e.parentNode;return r?a.insertBefore(i,e):e.nextSibling?a.insertBefore(i,e.nextSibling):a.appendChild(i),i},Ma=function(t){return Da(t)&&"\ufeff"===t.data[0]},La=function(t){return Da(t)&&"\ufeff"===t.data[t.data.length-1]},Fa=function(t){return t&&t.hasAttribute("data-mce-caret")?(n=(e=t.getElementsByTagName("br"))[e.length-1],un(n)&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n},Ha=function(t,e,n){return t.isSome()&&e.isSome()?C.some(n(t.getOrDie(),e.getOrDie())):C.none()},ja=Math.round,Va=function(t){return t?{left:ja(t.left),top:ja(t.top),bottom:ja(t.bottom),right:ja(t.right),width:ja(t.width),height:ja(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},za=function(t,e){return t=Va(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t},Ua=function(t,e,n){return t>=0&&t<=Math.min(e.height,n.height)/2},Wa=function(t,e){return t.bottom-t.height/2<e.top||!(t.top>e.bottom)&&Ua(e.top-t.bottom,t,e)},qa=function(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&Ua(e.bottom-t.top,t,e)},$a=function(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom},Ya=function(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null},Ga=function(t,e){return 1===t.nodeType&&t.hasChildNodes()&&(e>=t.childNodes.length&&(e=t.childNodes.length-1),t=t.childNodes[e]),t},Ka=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),Xa=function(t){return"string"==typeof t&&t.charCodeAt(0)>=768&&Ka.test(t)},Ja=gn,Qa=vn,Za=pn,tu=fn,eu=rn(["script","style","textarea"]),nu=rn(["img","input","textarea","hr","iframe","video","audio","object"]),ru=rn(["table"]),ou=Aa,iu=function(t){return!ou(t)&&(tu(t)?!eu(t.parentNode):nu(t)||Za(t)||ru(t)||au(t))},au=function(t){return!1===function(t){return nn(t)&&"true"===t.getAttribute("unselectable")}(t)&&Qa(t)},uu=function(t,e){return iu(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(au(t))return!1;if(Ja(t))return!0}return!0}(t,e)},su=nn,cu=iu,lu=on("display","block table"),fu=on("float","left right"),du=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(su,cu,p(fu)),mu=p(on("white-space","pre pre-line pre-wrap")),hu=fn,pu=pn,gu=Vi.nodeIndex,vu=Ga,bu=function(t){return"createRange"in t?t.createRange():Vi.DOM.createRng()},yu=function(t){return t&&/[\r\n\t ]/.test(t)},xu=function(t){return!!t.setStart&&!!t.setEnd},wu=function(t){var e,n=t.startContainer,r=t.startOffset;return!!(yu(t.toString())&&mu(n.parentNode)&&fn(n)&&(e=n.data,yu(e[r-1])||yu(e[r+1])))},Cu=function(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom},_u=function t(e){var n,r=e.getClientRects();return n=r.length>0?Va(r[0]):Va(e.getBoundingClientRect()),!xu(e)&&pu(e)&&Cu(n)?function(t){var e=t.ownerDocument,n=bu(e),r=e.createTextNode(" "),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=Va(n.getBoundingClientRect());return o.removeChild(r),i}(e):Cu(n)&&xu(e)?function(e){var n=e.startContainer,r=e.endContainer,o=e.startOffset,i=e.endOffset;if(n===r&&fn(r)&&0===o&&1===i){var a=e.cloneRange();return a.setEndAfter(r),t(a)}return null}(e):n},ku=function(t,e){var n=za(t,e);return n.width=1,n.right=n.left+1,n},Su=function(t){var e,n,r=[],o=function(t){var e,n;0!==t.height&&(r.length>0&&(e=t,n=r[r.length-1],e.left===n.left&&e.top===n.top&&e.bottom===n.bottom&&e.right===n.right)||r.push(t))},i=function(t,e){var n=bu(t.ownerDocument);if(e<t.data.length){if(Xa(t.data[e]))return r;if(Xa(t.data[e-1])&&(n.setStart(t,e),n.setEnd(t,e+1),!wu(n)))return o(ku(_u(n),!1)),r}e>0&&(n.setStart(t,e-1),n.setEnd(t,e),wu(n)||o(ku(_u(n),!1))),e<t.data.length&&(n.setStart(t,e),n.setEnd(t,e+1),wu(n)||o(ku(_u(n),!0)))};if(hu(t.container()))return i(t.container(),t.offset()),r;if(su(t.container()))if(t.isAtEnd())n=vu(t.container(),t.offset()),hu(n)&&i(n,n.data.length),du(n)&&!pu(n)&&o(ku(_u(n),!1));else{if(n=vu(t.container(),t.offset()),hu(n)&&i(n,0),du(n)&&t.isAtEnd())return o(ku(_u(n),!1)),r;e=vu(t.container(),t.offset()-1),du(e)&&!pu(e)&&(lu(e)||lu(n)||!du(n))&&o(ku(_u(e),!1)),du(n)&&o(ku(_u(n),!0))}return r};function Tu(t,e,n){var r=function(){return n||(n=Su(Tu(t,e))),n};return{container:d(t),offset:d(e),toRange:function(){var n=bu(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return hu(t),0===e},isAtEnd:function(){return hu(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return vu(t,n?e-1:e)}}}!function(t){t.fromRangeStart=function(e){return t(e.startContainer,e.startOffset)},t.fromRangeEnd=function(e){return t(e.endContainer,e.endOffset)},t.after=function(e){return t(e.parentNode,gu(e)+1)},t.before=function(e){return t(e.parentNode,gu(e))},t.isAbove=function(t,e){return Ha(Q(e.getClientRects()),Z(t.getClientRects()),Wa).getOr(!1)},t.isBelow=function(t,e){return Ha(Z(e.getClientRects()),Q(t.getClientRects()),qa).getOr(!1)},t.isAtStart=function(t){return!!t&&t.isAtStart()},t.isAtEnd=function(t){return!!t&&t.isAtEnd()},t.isTextPosition=function(t){return!!t&&fn(t.container())},t.isElementPosition=function(e){return!1===t.isTextPosition(e)}}(Tu||(Tu={}));var Ou,Du=Tu,Eu=function(t,e){fn(e)&&0===e.data.length&&t.remove(e)},Nu=function(t,e,n){hn(n)?function(t,e,n){var r=C.from(n.firstChild),o=C.from(n.lastChild);e.insertNode(n),r.each(function(e){return Eu(t,e.previousSibling)}),o.each(function(e){return Eu(t,e.nextSibling)})}(t,e,n):function(t,e,n){e.insertNode(n),Eu(t,n.previousSibling),Eu(t,n.nextSibling)}(t,e,n)},Au=fn,Ru=un,Bu=Vi.nodeIndex,Iu=function t(e){return e?vt(e.childNodes,function(e,n){return Ru(n)&&"BR"!==n.nodeName?e=e.concat(t(n)):e.push(n),e},[]):[]},Pu=function(t){return function(e){return t===e}},Mu=function(t){return(Au(t)?"text()":t.nodeName.toLowerCase())+"["+function(t){var e,n;e=Iu(function t(e){var n=e.parentNode;return Ru(n)?t(n):n}(t)),n=bt(e,Pu(t),t),e=e.slice(0,n+1);var r=vt(e,function(t,n,r){return Au(n)&&Au(e[r-1])&&t++,t},0);return e=pt(e,rn([t.nodeName])),(n=bt(e,Pu(t),t))-r}(t)+"]"},Lu=function(t,e){var n,r,o,i,a,u=[];return n=e.container(),r=e.offset(),Au(n)?o=function(t,e){for(;(t=t.previousSibling)&&Au(t);)e+=t.data.length;return e}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Mu(n)),a=function(t,e,n){var r=[];for(e=e.parentNode;e!==t;e=e.parentNode)r.push(e);return r}(t,n),a=pt(a,p(un)),(u=u.concat(ht(a,function(t){return Mu(t)}))).reverse().join("/")+","+o},Fu=function(t,e){var n;if(!e)return null;var r=e.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=vt(o,function(t,e){return(e=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e))?("text()"===e[1]&&(e[1]="#text"),function(t,e,n){var r=Iu(t);return r=pt(r,function(t,e){return!Au(t)||!Au(r[e-1])}),(r=pt(r,rn([e])))[n]}(t,e[1],parseInt(e[2],10))):null},t);return i?Au(i)?function(t,e){for(var n,r=t,o=0;Au(r);){if(n=r.data.length,e>=o&&e<=o+n){t=r,e-=o;break}if(!Au(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return Au(t)&&e>t.data.length&&(e=t.data.length),Du(t,e)}(i,parseInt(n,10)):(n="after"===n?Bu(i)+1:Bu(i),Du(i.parentNode,n)):null},Hu=vn,ju=function(t,e,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=t.getRoot();for(fn(a)?s.push(n?function(t,e,n){var r,o;for(o=t(e.data.slice(0,n)).length,r=e.previousSibling;r&&fn(r);r=r.previousSibling)o+=t(r.data).length;return o}(e,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(t.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(t.nodeIndex(a,n));return s},Vu=function(t,e,n){var r=0;return ae.each(t.select(e),function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++}),r},zu=function(t,e){var n,r,o,i=e?"start":"end";n=t[i+"Container"],r=t[i+"Offset"],nn(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(e?r:r-1,o.length-1)])&&(r=e?0:n.childNodes.length,t["set"+(e?"Start":"End")](n,r))},Uu=function(t){return zu(t,!0),zu(t,!1),t},Wu=function(t,e){var n;if(nn(t)&&(t=Ga(t,e),Hu(t)))return t;if(Aa(t)){if(fn(t)&&Ea(t)&&(t=t.parentNode),n=t.previousSibling,Hu(n))return n;if(n=t.nextSibling,Hu(n))return n}},qu=function(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Hu(r)||"IMG"===o)return{name:o,index:Vu(n.dom,o,r)};var a=function(t){return Wu(t.startContainer,t.startOffset)||Wu(t.endContainer,t.endOffset)}(i);return a?{name:o=a.tagName,index:Vu(n.dom,o,a)}:function(t,e,n,r){var o=e.dom,i={};return i.start=ju(o,t,n,r,!0),e.isCollapsed()||(i.end=ju(o,t,n,r,!1)),i}(t,n,e,i)},$u=function(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,"&#xFEFF;"):t.create("span",r)},Yu=function(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),a=t.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:Vu(n,u,a)};var s=Uu(r.cloneRange());if(!i){s.collapse(!1);var c=$u(n,o+"_end",e);Nu(n,s,c)}(r=Uu(r)).collapse(!0);var l=$u(n,o+"_start",e);return Nu(n,r,l),t.moveToBookmark({id:o,keep:!0}),{id:o}},Gu=h(qu,m,!0),Ku=Vi.DOM,Xu=function(t,e,n){var r=t.getParam(e,n);if(-1!==r.indexOf("=")){var o=t.getParam(e,"","hash");return o.hasOwnProperty(t.id)?o[t.id]:n}return r},Ju=function(t){return t.getParam("content_security_policy","")},Qu=function(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e},Zu=function(t){return t.getParam("forced_root_block_attrs",{})},ts=function(t){return t.getParam("automatic_uploads",!0,"boolean")},es=function(t){return t.getParam("images_reuse_filename",!1,"boolean")},ns=function(t){return t.getParam("icons","","string")},rs=function(t){return t.getParam("images_upload_url","","string")},os=function(t){return t.getParam("images_upload_base_path","","string")},is=function(t){return t.getParam("images_upload_credentials",!1,"boolean")},as=function(t){return t.getParam("images_upload_handler",null,"function")},us=function(t){return t.getParam("content_css_cors",!1,"boolean")},ss=function(t){return t.getParam("referrer_policy","","string")},cs=function(t){return t.getParam("language","en","string")},ls=function(t){return t.getParam("indent_use_margin",!1)},fs=function(t){return t.getParam("object_resizing")},ds=function(t){return t.getParam("event_root")},ms=function(t){return t.getParam("theme")},hs=function(t){return t.getParam("validate")},ps=function(t){return!1!==t.getParam("inline_boundaries")},gs=function(t){return t.getParam("content_css_cors")},vs=function(t){return t.getParam("plugins")},bs=nn,ys=fn,xs=function(t){var e=t.parentNode;e&&e.removeChild(t)},ws=function(t,e){0===e.length?xs(t):t.nodeValue=e},Cs=function(t){var e=Ta(t);return{count:t.length-e.length,text:e}},_s=function(t,e){return Ss(t),e},ks=function(t,e){return Du.isTextPosition(e)?function(t,e){return ys(t)&&e.container()===t?function(t,e){var n=Cs(t.data.substr(0,e.offset())),r=Cs(t.data.substr(e.offset())),o=n.text+r.text;return o.length>0?(ws(t,o),Du(t,e.offset()-n.count)):e}(t,e):_s(t,e)}(t,e):function(t,e){return e.container()===t.parentNode?function(t,e){var n=e.container(),r=function(t,e){var n=L(t,e);return-1===n?C.none():C.some(n)}(tt(n.childNodes),t).map(function(t){return t<e.offset()?Du(n,e.offset()-1):e}).getOr(e);return Ss(t),r}(t,e):_s(t,e)}(t,e)},Ss=function(t){if(bs(t)&&Aa(t)&&(Ra(t)?t.removeAttribute("data-mce-caret"):xs(t)),ys(t)){var e=Ta(function(t){try{return t.nodeValue}catch(t){return""}}(t));ws(t,e)}},Ts=Yt().browser,Os=vn,Ds=function(t,e,n){var r,o,i,a,u,s=za(e.getBoundingClientRect(),n);return"BODY"===t.tagName?(r=t.ownerDocument.documentElement,o=t.scrollLeft||r.scrollLeft,i=t.scrollTop||r.scrollTop):(u=t.getBoundingClientRect(),o=t.scrollLeft-u.left,i=t.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,(a=e.offsetWidth-e.clientWidth)>0&&(n&&(a*=-1),s.left+=a,s.right+=a),s},Es=function(){return Ts.isIE()||Ts.isEdge()||Ts.isFirefox()},Ns=function(t){return Os(t)||sn(t)&&Es()},As=vn,Rs=on("display","block table table-cell table-caption list-item"),Bs=Aa,Is=Ea,Ps=nn,Ms=iu,Ls=function(t){return t>0},Fs=function(t){return t<0},Hs=function(t,e){for(var n;n=t(e);)if(!Is(n))return n;return null},js=function(t,e,n,r,o){var i=new fi(t,r);if(Fs(e)){if((As(t)||Is(t))&&n(t=Hs(i.prev,!0)))return t;for(;t=Hs(i.prev,o);)if(n(t))return t}if(Ls(e)){if((As(t)||Is(t))&&n(t=Hs(i.next,!0)))return t;for(;t=Hs(i.next,o);)if(n(t))return t}return null},Vs=function(t,e){for(;t&&t!==e;){if(Rs(t))return t;t=t.parentNode}return null},zs=function(t,e,n){return Vs(t.container(),n)===Vs(e.container(),n)},Us=function(t,e){if(!e)return null;var n=e.container(),r=e.offset();return Ps(n)?n.childNodes[r+t]:null},Ws=function(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n},qs=function(t,e,n){return Vs(e,t)===Vs(n,t)},$s=function(t,e,n){var r,o;for(o=t?"previousSibling":"nextSibling";n&&n!==e;){if(r=n[o],Bs(r)&&(r=r[o]),As(r)){if(qs(e,r,n))return r;break}if(Ms(r))break;n=n.parentNode}return null},Ys=h(Ws,!0),Gs=h(Ws,!1),Ks=function(t,e,n){var r,o,i,a=h($s,!0,e),u=h($s,!1,e);o=n.startContainer;var s=n.startOffset;if(Ea(o)){if(Ps(o)||(o=o.parentNode),"before"===(i=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,Ns(r)))return Ys(r);if("after"===i&&(r=o.previousSibling,Ns(r)))return Gs(r)}if(!n.collapsed)return n;if(fn(o)){if(Bs(o)){if(1===t){if(r=u(o))return Ys(r);if(r=a(o))return Gs(r)}if(-1===t){if(r=a(o))return Gs(r);if(r=u(o))return Ys(r)}return n}if(La(o)&&s>=o.data.length-1)return 1===t&&(r=u(o))?Ys(r):n;if(Ma(o)&&s<=1)return-1===t&&(r=a(o))?Gs(r):n;if(s===o.data.length)return(r=u(o))?Ys(r):n;if(0===s)return(r=a(o))?Gs(r):n}return n},Xs=function(t,e){return C.from(Us(t?0:-1,e)).filter(As)},Js=function(t,e,n){var r=Ks(t,e,n);return-1===t?Tu.fromRangeStart(r):Tu.fromRangeEnd(r)},Qs=function(t){return C.from(t.getNode()).map(se.fromDom)},Zs=function(t,e){for(;e=t(e);)if(e.isVisible())return e;return e},tc=function(t,e){var n=zs(t,e);return!(n||!pn(t.getNode()))||n};!function(t){t[t.Backwards=-1]="Backwards",t[t.Forwards=1]="Forwards"}(Ou||(Ou={}));var ec=vn,nc=fn,rc=nn,oc=pn,ic=iu,ac=function(t){return nu(t)||function(t){return!!au(t)&&!0!==q(tt(t.getElementsByTagName("*")),function(t,e){return t||Ja(e)},!1)}(t)},uc=uu,sc=function(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null},cc=function(t,e){if(Ls(t)){if(ic(e.previousSibling)&&!nc(e.previousSibling))return Du.before(e);if(nc(e))return Du(e,0)}if(Fs(t)){if(ic(e.nextSibling)&&!nc(e.nextSibling))return Du.after(e);if(nc(e))return Du(e,e.data.length)}return Fs(t)?oc(e)?Du.before(e):Du.after(e):Du.before(e)},lc=function t(e,n,r){var o,i,a,u;if(!rc(r)||!n)return null;if(n.isEqual(Du.after(r))&&r.lastChild){if(u=Du.after(r.lastChild),Fs(e)&&ic(r.lastChild)&&rc(r.lastChild))return oc(r.lastChild)?Du.before(r.lastChild):u}else u=n;var s=u.container(),c=u.offset();if(nc(s)){if(Fs(e)&&c>0)return Du(s,--c);if(Ls(e)&&c<s.length)return Du(s,++c);o=s}else{if(Fs(e)&&c>0&&(i=sc(s,c-1),ic(i)))return!ac(i)&&(a=js(i,e,uc,i))?nc(a)?Du(a,a.data.length):Du.after(a):nc(i)?Du(i,i.data.length):Du.before(i);if(Ls(e)&&c<s.childNodes.length&&(i=sc(s,c),ic(i)))return oc(i)?function(e,n){var r=n.nextSibling;return r&&ic(r)?nc(r)?Du(r,0):Du.before(r):t(Ou.Forwards,Du.after(n),e)}(r,i):!ac(i)&&(a=js(i,e,uc,i))?nc(a)?Du(a,0):Du.before(a):nc(i)?Du(i,0):Du.after(i);o=i||u.getNode()}if((Ls(e)&&u.isAtEnd()||Fs(e)&&u.isAtStart())&&(o=js(o,e,d(!0),r,!0),uc(o,r)))return cc(e,o);i=js(o,e,uc,r);var l=yt(U(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(s,r),ec));return!l||i&&l.contains(i)?i?cc(e,i):null:u=Ls(e)?Du.after(l):Du.before(l)},fc=function(t){return{next:function(e){return lc(Ou.Forwards,e,t)},prev:function(e){return lc(Ou.Backwards,e,t)}}},dc=function(t){return Du.isTextPosition(t)?0===t.offset():iu(t.getNode())},mc=function(t){if(Du.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return iu(t.getNode(!0))},hc=function(t,e){return!Du.isTextPosition(t)&&!Du.isTextPosition(e)&&t.getNode()===e.getNode(!0)},pc=function(t,e,n){var r=fc(e);return C.from(t?r.next(n):r.prev(n))},gc=function(t,e,n){return pc(t,e,n).bind(function(r){return zs(n,r,e)&&function(t,e,n){return t?!hc(e,n)&&(r=e,!(!Du.isTextPosition(r)&&pn(r.getNode())))&&mc(e)&&dc(n):!hc(n,e)&&dc(e)&&mc(n);var r}(t,n,r)?pc(t,e,r):C.some(r)})},vc=function(t,e){var n,r=t?e.firstChild:e.lastChild;return fn(r)?C.some(Du(r,t?0:r.data.length)):r?iu(r)?C.some(t?Du.before(r):pn(n=r)?Du.before(n):Du.after(n)):function(t,e,n){var r=t?Du.before(n):Du.after(n);return pc(t,e,r)}(t,e,r):C.none()},bc=h(pc,!0),yc=h(pc,!1),xc=h(vc,!0),wc=h(vc,!1),Cc=function(t){return nn(t)&&"_mce_caret"===t.id},_c=function(t,e){for(;e&&e!==t;){if("_mce_caret"===e.id)return e;e=e.parentNode}return null},kc=function(t,e){return nn(e)&&t.isBlock(e)&&!e.innerHTML&&!ne.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e},Sc=function(t,e){return wc(t).fold(function(){return!1},function(t){return e.setStart(t.container(),t.offset()),e.setEnd(t.container(),t.offset()),!0})},Tc=function(t,e,n){return!(!1!==e.hasChildNodes()||!_c(t,e)||(function(t,e){var n=t.ownerDocument.createTextNode("\ufeff");t.appendChild(n),e.setStart(n,0),e.setEnd(n,0)}(e,n),0))},Oc=function(t,e,n,r){var o,i,a,u,s=n[e?"start":"end"],c=t.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;o>=1;o--){if(u=i.childNodes,Tc(c,i,r))return!0;if(s[o]>u.length-1)return!!Tc(c,i,r)||Sc(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),e?r.setStart(i,a):r.setEnd(i,a)}return!0},Dc=function(t){return fn(t)&&t.data.length>0},Ec=function(t,e,n){var r,o,i,a,u,s,c=t.get(n.id+"_"+e),l=n.keep;if(c){if(r=c.parentNode,"start"===e?(l?c.hasChildNodes()?(r=c.firstChild,o=1):Dc(c.nextSibling)?(r=c.nextSibling,o=0):Dc(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=t.nodeIndex(c)+1):o=t.nodeIndex(c),u=r,s=o):(l?c.hasChildNodes()?(r=c.firstChild,o=1):Dc(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=t.nodeIndex(c)):o=t.nodeIndex(c),u=r,s=o),!l){for(a=c.previousSibling,i=c.nextSibling,ae.each(ae.grep(c.childNodes),function(t){fn(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))});c=t.get(n.id+"_"+e);)t.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&fn(a)&&!ne.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),t.remove(i),u=a,s=o)}return C.some(Du(u,s))}return C.none()},Nc=function(t,e,n){return function(t,e,n){return 2===e?qu(Ta,n,t):3===e?function(t){var e=t.getRng();return{start:Lu(t.dom.getRoot(),Du.fromRangeStart(e)),end:Lu(t.dom.getRoot(),Du.fromRangeEnd(e))}}(t):e?function(t){return{rng:t.getRng()}}(t):Yu(t,!1)}(t,e,n)},Ac=function(t,e){(function(t,e){var n=t.dom;if(e){if(function(t){return ae.isArray(t.start)}(e))return function(t,e){var n=t.createRng();return Oc(t,!0,e,n)&&Oc(t,!1,e,n)?C.some(n):C.none()}(n,e);if("string"==typeof e.start)return C.some(function(t,e){var n,r=t.createRng();return n=Fu(t.getRoot(),e.start),r.setStart(n.container(),n.offset()),n=Fu(t.getRoot(),e.end),r.setEnd(n.container(),n.offset()),r}(n,e));if(e.hasOwnProperty("id"))return function(t,e){var n=Ec(t,"start",e),r=Ec(t,"end",e);return Ha(n,r.or(n),function(e,n){var r=t.createRng();return r.setStart(kc(t,e.container()),e.offset()),r.setEnd(kc(t,n.container()),n.offset()),r})}(n,e);if(e.hasOwnProperty("name"))return function(t,e){return C.from(t.select(e.name)[e.index]).map(function(e){var n=t.createRng();return n.selectNode(e),n})}(n,e);if(e.hasOwnProperty("rng"))return C.some(e.rng)}return C.none()})(t,e).each(function(e){t.setRng(e)})},Rc=function(t){return nn(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")},Bc=(" ",function(t){return" "===t}),Ic=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Pc=function(t){return!Ic(t)&&!Bc(t)},Mc=function(t){return!!t.nodeType},Lc=function(t,e,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!function(t){return t&&/^(IMG)$/.test(t.nodeName)}(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?(u=i[a],r=new fi(u,t.getParent(u,t.isBlock))):(u=i[i.length-1],(r=new fi(u,t.getParent(u,t.isBlock))).next(!0)),o=r.current();o;o=r.next())if(3===o.nodeType&&!Vc(o))return n.setStart(o,0),void e.setRng(n)},Fc=function(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(1===t.nodeType||!Vc(t))return t}},Hc=function(t,e){return Mc(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]},jc=function(t,e,n){return t.schema.isValidChild(e,n)},Vc=function(t){return t&&fn(t)&&/^([\t \r\n]+|)$/.test(t.nodeValue)},zc=function(t,e){return"string"!=typeof t?t=t(e):e&&(t=t.replace(/%(\w+)/g,function(t,n){return e[n]||t})),t},Uc=function(t,e){return e=e||"",t=""+((t=t||"").nodeName||t),e=""+(e.nodeName||e),t.toLowerCase()===e.toLowerCase()},Wc=function(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),"fontFamily"===n&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e},qc=function(t,e,n){return Wc(t,t.getStyle(e,n),n)},$c=function(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n},Yc=function(t,e,n){return t.getParents(e,n,t.getRoot())},Gc=function(t,e,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(t){return ct(t,function(t,e){return H(r,function(t){return t===e})})};return H(t.formatter.get(e),function(e){var r=o(e);return H(t.formatter.get(n),function(t){var e=o(t);return function(t,e,n){return void 0===n&&(n=c),s(n).eq(t,e)}(r,e)})})},Kc=Rc,Xc=Yc,Jc=Vc,Qc=Hc,Zc=function(t,e){for(var n=e;n;){if(nn(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e},tl=function(t,e,n,r){for(var o=e.data,i=n;t?i>=0:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1},el=function(t,e,n){return tl(t,e,n,function(t){return Bc(t)||Ic(t)})},nl=function(t,e,n){return tl(t,e,n,Pc)},rl=function(t,e,n,r,o,i){var a,u=t.getParent(n,t.isBlock)||e,s=function(e,n,r){var i=ka(t),s=o?i.backwards:i.forwards;return C.from(s(e,n,function(t,e){return Kc(t.parentNode)?-1:(a=t,r(o,t,e))},u))};return s(n,r,el).bind(function(t){return i?s(t.container,t.offset+(o?-1:0),nl):C.some(t)}).orThunk(function(){return a?C.some({container:a,offset:o?0:a.length}):C.none()})},ol=function(t,e,n,r,o){fn(r)&&0===r.nodeValue.length&&r[o]&&(r=r[o]);for(var i=Xc(t,r),a=0;a<i.length;a++)for(var u=0;u<e.length;u++){var s=e[u];if((!("collapsed"in s)||s.collapsed===n.collapsed)&&t.is(i[a],s.selector))return i[a]}return r},il=function(t,e,n,r){var o,i=t.dom,a=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,a)),!o){var u=i.getParent(n,"LI,TD,TH");o=i.getParent(fn(n)?n.parentNode:n,function(e){return e!==a&&Qc(t,e)},u)}if(o&&e[0].wrapper&&(o=Xc(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Uc(o,"br")););return o||n},al=function(t,e,n,r,o,i,a){var u,s,c;u=s=a?n:o;var l,f=a?"previousSibling":"nextSibling",d=t.getRoot();if(fn(u)&&!Jc(u)&&(a?r>0:i<u.nodeValue.length))return u;for(;;){if(!e[0].block_expand&&t.isBlock(s))return s;for(c=s[f];c;c=c[f])if(!Kc(c)&&!Jc(c)&&("BR"!==(l=c).nodeName||!l.getAttribute("data-mce-bogus")||l.nextSibling))return s;if(s===d||s.parentNode===d){u=s;break}s=s.parentNode}return u},ul=function(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,a=e.endContainer,u=e.endOffset,s=t.dom;return nn(o)&&o.hasChildNodes()&&(o=Ga(o,i),fn(o)&&(i=0)),nn(a)&&a.hasChildNodes()&&(a=Ga(a,e.collapsed?u:u-1),fn(a)&&(u=a.nodeValue.length)),o=Zc(s,o),a=Zc(s,a),(Kc(o.parentNode)||Kc(o))&&(o=Kc(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,fn(o)&&(i=e.collapsed?o.length:0)),(Kc(a.parentNode)||Kc(a))&&(a=Kc(a)?a:a.parentNode,a=e.collapsed?a.nextSibling||a:a.previousSibling||a,fn(a)&&(u=e.collapsed?0:a.length)),e.collapsed&&(rl(s,t.getBody(),o,i,!0,r).each(function(t){var e=t.container,n=t.offset;o=e,i=n}),rl(s,t.getBody(),a,u,!1,r).each(function(t){var e=t.container,n=t.offset;a=e,u=n})),(n[0].inline||n[0].block_expand)&&(n[0].inline&&fn(o)&&0!==i||(o=al(s,n,o,i,a,u,!0)),n[0].inline&&fn(a)&&u!==a.nodeValue.length||(a=al(s,n,o,i,a,u,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(o=ol(s,n,e,o,"previousSibling"),a=ol(s,n,e,a,"nextSibling")),(n[0].block||n[0].selector)&&(o=il(t,n,o,"previousSibling"),a=il(t,n,a,"nextSibling"),n[0].block&&(s.isBlock(o)||(o=al(s,n,o,i,a,u,!0)),s.isBlock(a)||(a=al(s,n,o,i,a,u,!1)))),nn(o)&&(i=s.nodeIndex(o),o=o.parentNode),nn(a)&&(u=s.nodeIndex(a)+1,a=a.parentNode),{startContainer:o,startOffset:i,endContainer:a,endOffset:u}},sl=function(t,e){var n=t.childNodes;return e>=n.length?e=n.length-1:e<0&&(e=0),n[e]||t},cl=function(t,e,n){var r=e.startContainer,o=e.startOffset,i=e.endContainer,a=e.endOffset,u=function(t){var e;return 3===(e=t[0]).nodeType&&e===r&&o>=e.nodeValue.length&&t.splice(0,1),e=t[t.length-1],0===a&&t.length>0&&e===i&&3===e.nodeType&&t.splice(t.length-1,1),t},s=function(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r},c=function(t,e){do{if(t.parentNode===e)return t;t=t.parentNode}while(t)},l=function(t,e,r){for(var o=r?"nextSibling":"previousSibling",i=t,a=i.parentNode;i&&i!==e;i=a){a=i.parentNode;var c=s(i===t?i:i[o],o);c.length&&(r||c.reverse(),n(u(c)))}};if(1===r.nodeType&&r.hasChildNodes()&&(r=sl(r,o)),1===i.nodeType&&i.hasChildNodes()&&(i=sl(i,a-1)),r===i)return n(u([r]));for(var f=t.findCommonAncestor(r,i),d=r;d;d=d.parentNode){if(d===i)return l(r,f,!0);if(d===f)break}for(d=i;d;d=d.parentNode){if(d===r)return l(i,f);if(d===f)break}var m=c(r,f)||r,h=c(i,f)||i;l(r,m,!0);var p=s(m===r?m:m.nextSibling,"nextSibling",h===i?h.nextSibling:h);p.length&&n(u(p)),l(i,h)},ll=function(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e},fl=function(t,e){var n=ia(e,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:function(t){return U(function(t){return G(t,function(t){var e=Ya(t);return e?[se.fromDom(e)]:[]})}(t),Vn)}(t)},dl=function(t){return fl(ll(t.selection.getSel()),se.fromDom(t.getBody()))},ml=function(t,e){return Ha(function(t){var e=t.startContainer,n=t.startOffset;return fn(e)?0===n?C.some(se.fromDom(e)):C.none():C.from(e.childNodes[n]).map(se.fromDom)}(e),function(t){var e=t.endContainer,n=t.endOffset;return fn(e)?n===e.data.length?C.some(se.fromDom(e)):C.none():C.from(e.childNodes[n-1]).map(se.fromDom)}(e),function(e,n){var r=$(function t(e){return Ae(e).fold(d([e]),function(n){return[e].concat(t(n))})}(t),h(ye,e)),o=$(function t(e){return Re(e).fold(d([e]),function(n){return"br"===ce(n)?Se(n).map(function(n){return[e].concat(t(n))}).getOr([]):[e].concat(t(n))})}(t),h(ye,n));return r.isSome()&&o.isSome()}).getOr(!1)},hl=function(t,e,n,r){var o=n,i=new fi(n,o),a=t.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==ae.trim(n.nodeValue).length)return void(r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))},pl=function(t){var e=t.selection.getSel();return e&&e.rangeCount>0},gl=function(t,e){var n=dl(t);n.length>0?V(n,function(n){var r=n.dom(),o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)}):e(t.selection.getRng(),!1)},vl=function(t,e,n){var r=Yu(t,e);n(r),t.moveToBookmark(r)},bl=function(t,e){var n=function(e){return t(e)?C.from(e.dom().nodeValue):C.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom().nodeValue=n}}}(me),yl=function(t){return bl.get(t)},xl=function(t,e,n,r){var o=e.uid,i=void 0===o?ba("mce-annotation"):o,a=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(e,["uid"]),u=se.fromTag("span",t);ra(u,da()),xn(u,""+ha(),i),xn(u,""+ma(),n);var s=r(i,a),c=s.attributes,l=void 0===c?{}:c,f=s.classes,d=void 0===f?[]:f;return wn(u,l),function(t,e){V(d,function(e){ra(t,e)})}(u),u},wl=function(t,e,n,r,o){var i=[],a=xl(t.getDoc(),o,n,r),u=$i(C.none()),s=function(){u.set(C.none())},c=function(t){V(t,l)},l=function(e){switch(function(t,e,n,r){return ke(e).fold(function(){return"skipping"},function(o){return"br"===r||function(t){return me(t)&&"\ufeff"===yl(t)}(e)?"valid":function(t){return de(t)&&oa(t,da())}(e)?"existing":Cc(e)?"caret":jc(t,n,r)&&jc(t,ce(o),n)?"valid":"invalid-child"})}(t,e,"span",ce(e))){case"invalid-child":s();var n=Ee(e);c(n),s();break;case"valid":!function(t,e){Le(t,e),je(e,t)}(e,u.get().getOrThunk(function(){var t=wa(a);return i.push(t),u.set(C.some(t)),t}))}};return cl(t.dom,e,function(t){s(),function(t){var e=j(t,se.fromDom);c(e)}(t)}),i},Cl=function(t){var e,n=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return e.hasOwnProperty(t)?C.from(e[t]).map(function(t){return t.settings}):C.none()}});!function(t,e){t.on("init",function(){t.serializer.addNodeFilter("span",function(t){V(t,function(t){(function(t){return C.from(t.attr(ma())).bind(e.lookup)})(t).each(function(e){!1===e.persistent&&t.unwrap()})})})})}(t,n);var r=function(t,e){var n=$i({}),r=function(t,e){o(t,function(t){return e(t),t})},o=function(t,e){var r=n.get(),o=e(r.hasOwnProperty(t)?r[t]:{listeners:[],previous:$i(C.none())});r[t]=o,n.set(r)},i=ta(function(){var e,i,a=n.get(),u=(e=et(a),(i=I.call(e,0)).sort(void 0),i);V(u,function(e){o(e,function(n){var o=n.previous.get();return pa(t,C.some(e)).fold(function(){var t;o.isSome()&&(r(t=e,function(e){V(e.listeners,function(e){return e(!1,t)})}),n.previous.set(C.none()))},function(t){var e=t.uid,i=t.name,a=t.elements;o.is(e)||(function(t,e,n){r(t,function(r){V(r.listeners,function(r){return r(!0,t,{uid:e,nodes:j(n,function(t){return t.dom()})})})})}(i,e,a),n.previous.set(C.some(e)))}),{previous:n.previous,listeners:n.listeners}})})},30);return t.on("remove",function(){i.cancel()}),t.on("NodeChange",function(){i.throttle()}),{addListener:function(t,e){o(t,function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}})}}}(t);return{register:function(t,e){n.register(t,e)},annotate:function(e,r){n.lookup(e).each(function(n){!function(t,e,n,r){t.undoManager.transact(function(){var o=t.selection,i=o.getRng(),a=dl(t).length>0;if(i.collapsed&&!a&&function(t,e){var n=ul(t,e,[{inline:!0}]);e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)}(t,i),o.getRng().collapsed&&!a){var u=xl(t.getDoc(),r,e,n.decorate);ya(u," "),o.getRng().insertNode(u.dom()),o.select(u.dom())}else vl(o,!1,function(){gl(t,function(o){wl(t,o,e,n.decorate,r)})})})}(t,e,n,r)})},annotationChanged:function(t,e){r.addListener(t,e)},remove:function(e){pa(t,C.some(e)).each(function(t){var e=t.elements;V(e,We)})},getAll:function(e){var n=function(t,e){var n=se.fromDom(t.getBody()),r=ia(n,"["+ma()+'="'+e+'"]'),o={};return V(r,function(t){var e=Cn(t,ha()),n=o.hasOwnProperty(e)?o[e]:[];o[e]=n.concat([t])}),o}(t,e);return ot(n,function(t){return j(t,function(t){return t.dom()})})}}},_l=/^[ \t\r\n]*$/,kl={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Sl=function(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var a=t.parent;a&&a!==e;a=a.parent)if(i=a[o])return i}},Tl=function(t){if(!_l.test(t.value))return!1;var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)},Ol=function(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e},Dl=function(){function t(t,e){this.name=t,this.type=e,1===e&&(this.attributes=[],this.attributes.map={})}return t.create=function(e,n){var r=new t(e,kl[e]||1);return n&&rt(n,function(t,e){r.attr(e,t)}),r},t.prototype.replace=function(t){return t.parent&&t.remove(),this.insert(t,this),this.remove(),this},t.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&rt(t,function(t,e){r.attr(e,t)}),r;if(n=r.attributes){if(void 0!==e){if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}return n.map[t]}},t.prototype.clone=function(){var e,n=new t(this.name,this.type);if(e=this.attributes){var r=[];r.map={};for(var o=0,i=e.length;o<i;o++){var a=e[o];"id"!==a.name&&(r[r.length]={name:a.name,value:a.value},r.map[a.name]=a.value)}n.attributes=r}return n.value=this.value,n.shortEnded=this.shortEnded,n},t.prototype.wrap=function(t){return this.parent.insert(t,this),t.append(this),this},t.prototype.unwrap=function(){for(var t=this.firstChild;t;){var e=t.next;this.insert(t,this,!0),t=e}this.remove()},t.prototype.remove=function(){var t=this.parent,e=this.next,n=this.prev;return t&&(t.firstChild===this?(t.firstChild=e,e&&(e.prev=null)):n.next=e,t.lastChild===this?(t.lastChild=n,n&&(n.next=null)):e.prev=n,this.parent=this.next=this.prev=null),this},t.prototype.append=function(t){t.parent&&t.remove();var e=this.lastChild;return e?(e.next=t,t.prev=e,this.lastChild=t):this.lastChild=this.firstChild=t,t.parent=this,t},t.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,t.next=e,e.prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,t.prev=e,e.next=t),t.parent=r,t},t.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=Sl(n,this))n.name===t&&e.push(n);return e},t.prototype.empty=function(){if(this.firstChild){for(var t=[],e=this.firstChild;e;e=Sl(e,this))t.push(e);for(var n=t.length;n--;)(e=t[n]).parent=e.firstChild=e.lastChild=e.next=e.prev=null}return this.firstChild=this.lastChild=null,this},t.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this.firstChild;if(Ol(this))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(t[r.name])return!1;if(Ol(r))return!1}if(8===r.type)return!1;if(3===r.type&&!Tl(r))return!1;if(3===r.type&&r.parent&&e[r.parent.name]&&_l.test(r.value))return!1;if(n&&n(r))return!1}while(r=Sl(r,this));return!0},t.prototype.walk=function(t){return Sl(this,null,t)},t}(),El=ae.makeMap,Nl=function(t){var e=[],n=(t=t||{}).indent,r=El(t.indent_before||""),o=El(t.indent_after||""),i=or.getEncodeFunc(t.entity_encoding||"raw",t.entities),a="html"===t.element_format;return{start:function(t,u,s){var c,l,f,d;if(n&&r[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n"),e.push("<",t),u)for(c=0,l=u.length;c<l;c++)f=u[c],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!s||a?">":" />",s&&n&&o[t]&&e.length>0&&(d=e[e.length-1]).length>0&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&e.length>0&&(r=e[e.length-1]).length>0&&"\n"!==r&&e.push("\n")},text:function(t,n){t.length>0&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}},Al=function(t,e){void 0===e&&(e=hr());var n=Nl(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)do{a(t)}while(t=t.next)}};n.reset();var a=function t(r){var a,u,s,c,l,f,d,m,h,p=i[r.type];if(p)p(r);else{if(a=r.name,u=r.shortEnded,s=r.attributes,o&&s&&s.length>1&&((f=[]).map={},h=e.getElementRule(r.name))){for(d=0,m=h.attributesOrder.length;d<m;d++)(c=h.attributesOrder[d])in s.map&&(l=s.map[c],f.map[c]=l,f.push({name:c,value:l}));for(d=0,m=s.length;d<m;d++)(c=s[d].name)in f.map||(l=s.map[c],f.map[c]=l,f.push({name:c,value:l}));s=f}if(n.start(r.name,s,u),!u){if(r=r.firstChild)do{t(r)}while(r=r.next);n.end(a)}}};return 1!==r.type||t.inner?i[11](r):a(r),n.getContent()}}},Rl=function(t,e){return t.replace(new RegExp(e.prefix+"_[0-9]+","g"),function(t){return lt(e.uris,t).getOr(t)})},Bl=function(t,e,n){var r,o,i=1,a=t.getShortEndedElements(),u=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;for(u.lastIndex=r=n;o=u.exec(e);){if(r=u.lastIndex,"/"===o[1])i--;else if(!o[1]){if(o[2]in a)continue;i++}if(0===i)break}return r},Il=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function Pl(t,e){void 0===e&&(e=hr());var n=function(){};!1!==(t=t||{}).fix_self_closing&&(t.fix_self_closing=!0);var r=t.comment?t.comment:n,o=t.cdata?t.cdata:n,i=t.text?t.text:n,a=t.start?t.start:n,u=t.end?t.end:n,s=t.pi?t.pi:n,c=t.doctype?t.doctype:n,l=function(n,l){void 0===l&&(l="html");for(var f,d,m,h,p,g,v,b,y,x,w,C,_,k,S,T,O,D,E,N=n.html,A=0,R=[],B=0,I=or.decode,P=ae.makeMap("src,href,data,background,formaction,poster,xlink:href"),M=/((java|vb)script|mhtml):/i,L="html"===l?0:1,F=function(t){var e,n;for(e=R.length;e--&&R[e].name!==t;);if(e>=0){for(n=R.length-1;n>=e;n--)(t=R[n]).valid&&u(t.name);R.length=e}},H=function(t,e){return i(Rl(t,n),e)},j=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),r(Rl(e,n)))},V=function(t,e){var n=t||"",r=!It(n,"--"),o=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(t,e){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(r.substr(e))}(0,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/;a.lastIndex=n;var u=a.exec(t);return u?u.index+u[0].length:r.length}(N,r,e);return t=N.substr(e,o-e),j(r?n+t:t),o+1},z=function(e,r,o,i,a){var u,s;if(o=function(t){return lt(n.uris,t).getOr(t)}((r=r.toLowerCase())in Y?r:I(o||i||a||"")),G&&!b&&!1===function(t){return 0===t.indexOf("data-")||0===t.indexOf("aria-")}(r)){if(!(u=k[r])&&S){for(s=S.length;s--&&!(u=S[s]).pattern.test(r););-1===s&&(u=null)}if(!u)return;if(u.validValues&&!(o in u.validValues))return}if(P[r]&&!t.allow_script_urls){var c=o.replace(/[\s\u0000-\u001F]+/g,"");try{c=decodeURIComponent(c)}catch(t){c=unescape(c)}if(M.test(c))return;if(function(t,e){return!t.allow_html_data_urls&&(/^data:image\//i.test(e)?!1===t.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(e):/^data:/i.test(e))}(t,c))return}b&&(r in P||0===r.indexOf("on"))||(h.map[r]=o,h.push({name:r,value:o}))},U=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"),W=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,q=e.getShortEndedElements(),$=t.self_closing_elements||e.getSelfClosingElements(),Y=e.getBoolAttrs(),G=t.validate,K=t.remove_internals,X=t.fix_self_closing,J=e.getSpecialElements(),Q=N+">";f=U.exec(Q);){var Z=f[0];if(A<f.index&&H(I(N.substr(A,f.index-A))),d=f[7])":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),F(d);else if(d=f[8]){if(f.index+Z.length>N.length){H(I(N.substr(f.index))),A=f.index+Z.length;continue}":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),y=d in q,X&&$[d]&&R.length>0&&R[R.length-1].name===d&&F(d);var tt=Il(W,f[9]);if(null!==tt){if("all"===tt){A=Bl(e,N,U.lastIndex),U.lastIndex=A;continue}w=!1}if(!G||(x=e.getElementRule(d))){if(w=!0,G&&(k=x.attributes,S=x.attributePatterns),(_=f[9])?((b=-1!==_.indexOf("data-mce-type"))&&K&&(w=!1),(h=[]).map={},_.replace(W,z)):(h=[]).map={},G&&!b){if(T=x.attributesRequired,O=x.attributesDefault,D=x.attributesForced,x.removeEmptyAttrs&&!h.length&&(w=!1),D)for(p=D.length;p--;)v=(C=D[p]).name,"{$uid}"===(E=C.value)&&(E="mce_"+B++),h.map[v]=E,h.push({name:v,value:E});if(O)for(p=O.length;p--;)(v=(C=O[p]).name)in h.map||("{$uid}"===(E=C.value)&&(E="mce_"+B++),h.map[v]=E,h.push({name:v,value:E}));if(T){for(p=T.length;p--&&!(T[p]in h.map););-1===p&&(w=!1)}if(C=h.map["data-mce-bogus"]){if("all"===C){A=Bl(e,N,U.lastIndex),U.lastIndex=A;continue}w=!1}}w&&a(d,h,y)}else w=!1;if(m=J[d]){m.lastIndex=A=f.index+Z.length,(f=m.exec(N))?(w&&(g=N.substr(A,f.index-A)),A=f.index+f[0].length):(g=N.substr(A),A=N.length),w&&(g.length>0&&H(g,!0),u(d)),U.lastIndex=A;continue}y||(_&&_.indexOf("/")===_.length-1?w&&u(d):R.push({name:d,valid:w}))}else if(d=f[1])j(d);else if(d=f[2]){if(!(1===L||t.preserve_cdata||R.length>0&&e.isValidChild(R[R.length-1].name,"#cdata"))){A=V("",f.index+2),U.lastIndex=A;continue}o(d)}else if(d=f[3])c(d);else{if((d=f[4])||"<!"===Z){A=V(d,f.index+Z.length),U.lastIndex=A;continue}if(d=f[5]){if(1!==L){A=V("?",f.index+2),U.lastIndex=A;continue}s(d,f[6])}}A=f.index+Z.length}for(A<N.length&&H(I(N.substr(A))),p=R.length-1;p>=0;p--)(d=R[p]).valid&&u(d.name)};return{parse:function(t,e){void 0===e&&(e="html"),l(function(t){for(var e,n=/data:[^;]+;base64,([a-z0-9\+\/=]+)/gi,r=[],o={},i=ba("img"),a=0,u=0;e=n.exec(t);){var s=e[0],c=i+"_"+u++;o[c]=s,a<e.index&&r.push(t.substr(a,e.index-a)),r.push(c),a=e.index+s.length}return 0===a?{prefix:i,uris:o,html:t}:(a<t.length&&r.push(t.substr(a)),{prefix:i,uris:o,html:r.join("")})}(t),e)}}}(Pl||(Pl={})).findEndTag=Bl;var Ml,Ll=Pl,Fl=function(t,e){var n,r,o,i,a=e,u=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,s=t.schema;a=function(t,e){var n=new RegExp(["\\s?("+t.join("|")+')="[^"]+"'].join("|"),"gi");return e.replace(n,"")}(t.getTempAttrs(),a);for(var c=s.getShortEndedElements();i=u.exec(a);)r=u.lastIndex,o=i[0].length,n=c[i[1]]?r:Ll.findEndTag(s,a,r),a=a.substring(0,r-o)+a.substring(n),u.lastIndex=r-o;return Ta(a)},Hl=Fl,jl=ae.each,Vl=function(t){this.compare=function(e,n){if(e.nodeName!==n.nodeName)return!1;var r=function(e){var n={};return jl(t.getAttribs(e),function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))}),n},o=function(t,e){var n,r;for(r in t)if(t.hasOwnProperty(r)){if(void 0===(n=e[r]))return!1;if(t[r]!==n)return!1;delete e[r]}for(r in e)if(e.hasOwnProperty(r))return!1;return!0};return!(!o(r(e),r(n))||!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))||Rc(e)||Rc(n))}},zl=function(t,e,n){return C.from(n.container()).filter(fn).exists(function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))})},Ul=h(zl,!0,Ic),Wl=h(zl,!1,Ic),ql=function(t){var e=t.container();return fn(e)&&0===e.data.length},$l=function(t,e){return function(n){return C.from(Us(t?0:-1,n)).filter(e).isSome()}},Yl=function(t){return"IMG"===t.nodeName&&"block"===kn(se.fromDom(t),"display")},Gl=function(t){return vn(t)&&!function(t){return nn(t)&&"all"===t.getAttribute("data-mce-bogus")}(t)},Kl=$l(!0,Yl),Xl=$l(!1,Yl),Jl=$l(!0,sn),Ql=$l(!1,sn),Zl=$l(!0,Gl),tf=$l(!1,Gl),ef=function(t,e){return iu(e)&&!1===function(t,e){return fn(e)&&/^[ \t\r\n]*$/.test(e.data)&&!1===function(t,e){var n,r,o=se.fromDom(t);return n=se.fromDom(e),r=h(ye,o),ca(n,"pre,code",r).isSome()}(t,e)}(t,e)||function(t){return nn(t)&&"A"===t.nodeName&&t.hasAttribute("name")}(e)||nf(e)},nf=an("data-mce-bookmark"),rf=an("data-mce-bogus"),of=("data-mce-bogus","all",function(t){return nn(t)&&"all"===t.getAttribute("data-mce-bogus")}),af=function(t,e){return void 0===e&&(e=!0),function(t,e){var n,r=0;if(ef(t,t))return!1;if(!(n=t.firstChild))return!0;var o=new fi(n,t);do{if(e){if(of(n)){n=o.next(!0);continue}if(rf(n)){n=o.next();continue}}if(pn(n))r++,n=o.next();else{if(ef(t,n))return!1;n=o.next()}}while(n);return r<=1}(t.dom(),e)},uf=function(t){ze(t),je(t,se.fromHtml('<br data-mce-bogus="1">'))},sf=function(t){Re(t).each(function(e){Se(e).each(function(n){Bn(t)&&Pn(e)&&Bn(n)&&Ue(e)})})},cf=function(t,e){return function(t,e,n){return xe(e,t)?function(t,e){for(var n=R(e)?e:v,r=t.dom(),o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=se.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(t,function(t){return n(t)||ye(t,e)}).slice(0,-1):[]}(t,e,d(!1))},lf=function(t,e){return[t].concat(cf(t,e))},ff=function(t,e,n){if(0!==n){var r=t.data.slice(e,e+n),o=e+n>=t.data.length,i=0===e;t.replaceData(e,n,function(t,e,n){return q(t,function(r,o){return Ic(o)||Bc(o)?r.previousCharIsSpace||""===r.str&&e||r.str.length===t.length-1&&n?{previousCharIsSpace:!1,str:r.str+" "}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}},{previousCharIsSpace:!1,str:""}).str}(r,i,o))}},df=function(t,e){var n=t.data.slice(e),r=n.length-Lt(n).length;return ff(t,e,r)},mf=function(t,e){return function(t,e){var n=t.container(),r=t.offset();return!1===Du.isTextPosition(t)&&n===e.parentNode&&r>Du.before(e).offset()}(e,t)?Du(e.container(),e.offset()-1):e},hf=function(t){return iu(t.previousSibling)?C.some((e=t.previousSibling,fn(e)?Du(e,e.data.length):Du.after(e))):t.previousSibling?wc(t.previousSibling):C.none();var e},pf=function(t){return iu(t.nextSibling)?C.some((e=t.nextSibling,fn(e)?Du(e,0):Du.before(e))):t.nextSibling?xc(t.nextSibling):C.none();var e},gf=function(t,e,n){return function(t,e,n){return t?function(t,e){return pf(e).orThunk(function(){return hf(e)}).orThunk(function(){return function(t,e){return bc(t,Du.after(e)).fold(function(){return yc(t,Du.before(e))},C.some)}(t,e)})}(e,n):function(t,e){return hf(e).orThunk(function(){return pf(e)}).orThunk(function(){return function(t,e){var n=Du.before(e.previousSibling?e.previousSibling:e.parentNode);return yc(t,n).fold(function(){return bc(t,Du.after(e))},C.some)}(t,e)})}(e,n)}(t,e,n).map(h(mf,n))},vf=function(t,e,n){n.fold(function(){t.focus()},function(n){t.selection.setRng(n.toRange(),e)})},bf=function(t,e){return e&&t.schema.getBlockElements().hasOwnProperty(ce(e))},yf=function(t){if(af(t)){var e=se.fromHtml('<br data-mce-bogus="1">');return ze(t),je(t,e),C.some(Du.before(e.dom()))}return C.none()},xf=function(t,e,n,r){void 0===r&&(r=!0);var o,i=gf(e,t.getBody(),n.dom()),a=ua(n,h(bf,t),(o=t.getBody(),function(t){return t.dom()===o})),u=function(t,e,n){var r,o,i,a,u=Se(t).filter(me),s=Te(t).filter(me);return Ue(t),(r=u,o=s,i=e,a=function(t,e,r){var o=t.dom(),i=e.dom(),a=o.data.length;return function(t,e,n){var r=Ft(t.data).length;t.appendData(e.data),Ue(se.fromDom(e)),n&&df(t,r)}(o,i,n),r.container()===i?Du(o,a):r},r.isSome()&&o.isSome()&&i.isSome()?C.some(a(r.getOrDie(),o.getOrDie(),i.getOrDie())):C.none()).orThunk(function(){return n&&(u.each(function(t){return e=t.dom(),n=t.dom().length,o=(r=e.data.slice(0,n)).length-Ft(r).length,ff(e,n-o,o);var e,n,r,o}),s.each(function(t){return df(t.dom(),0)})),e})}(n,i,function(t,e){return ft(t.schema.getTextInlineElements(),ce(e))}(t,n));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):a.bind(yf).fold(function(){r&&vf(t,e,u)},function(n){r&&vf(t,e,C.some(n))})},wf=function(t,e){return{start:t,end:e}},Cf=ki([{removeTable:["element"]},{emptyCells:["cells"]},{deleteCellSelection:["rng","cell"]}]),_f=function(t,e){return fa(se.fromDom(t),"td,th",e)},kf=function(t,e){return ca(t,"table",e)},Sf=function(t){return!ye(t.start,t.end)},Tf=function(t,e){return kf(t.start,e).bind(function(n){return kf(t.end,e).bind(function(t){return e=ye(n,t),r=n,e?C.some(r):C.none();var e,r})})},Of=function(t){return ia(t,"td,th")},Df=function(t,e){return Tf(e,t).isSome()},Ef=function(t,e,n){return t.filter(function(t){return Sf(t)&&Df(n,t)}).orThunk(function(){return function(t,e){var n=_f(e.startContainer,t),r=_f(e.endContainer,t);return e.collapsed?C.none():Ha(n,r,wf).fold(function(){return n.fold(function(){return r.bind(function(e){return kf(e,t).bind(function(t){return Q(Of(t)).map(function(t){return wf(t,e)})})})},function(e){return kf(e,t).bind(function(t){return Z(Of(t)).map(function(t){return wf(e,t)})})})},function(e){return Df(t,e)?C.none():function(t,e){return kf(t.start,e).bind(function(e){return Z(Of(e)).map(function(e){return wf(t.start,e)})})}(e,t)})}(n,e)}).bind(function(t){return function(t,e){return Tf(t,n).map(function(e){return function(t,e,n){return{rng:t,table:e,cells:n}}(t,e,Of(e))})}(t)})},Nf=function(t,e){return Y(t,function(t){return ye(t,e)})},Af=function(t){return function(t){return Ha(Nf(t.cells,t.rng.start),Nf(t.cells,t.rng.end),function(e,n){return t.cells.slice(e,n+1)})}(t).map(function(e){var n=t.cells;return e.length===n.length?Cf.removeTable(t.table):Cf.emptyCells(e)})},Rf=function(t,e){var n=function(t){return function(e){return ye(t,e)}}(t),r=function(t,e){var n=_f(t.startContainer,e),r=_f(t.endContainer,e);return Ha(n,r,wf)}(e,n);return function(t,e,n){return t.filter(function(t){return function(t,e){return!Sf(t)&&Tf(t,e).exists(function(t){var e=t.dom().rows;return 1===e.length&&1===e[0].cells.length})}(t,n)&&ml(t.start,e)}).map(function(t){return t.start})}(r,e,n).map(function(t){return Cf.deleteCellSelection(e,t)}).orThunk(function(){return Ef(r,e,n).bind(Af)})},Bf=function(t,e){return V(e,uf),t.selection.setCursorLocation(e[0].dom(),0),!0},If=function(t,e,n){e.deleteContents();var r,o=function t(e){var n;return(8===le(n=e)||"#comment"===ce(n)?Se(e):Re(e)).bind(t).orThunk(function(){return C.some(e)})}(n).getOr(n),i=se.fromDom(t.dom.getParent(o.dom(),t.dom.isBlock));if(af(i)&&(uf(i),t.selection.setCursorLocation(i.dom(),0)),!ye(n,i)){var a=ke(i).is(n)?[]:ke(r=i).map(Ee).map(function(t){return U(t,function(t){return!ye(r,t)})}).getOr([]);V(a.concat(Ee(n)),function(t){ye(t,i)||xe(t,i)||Ue(t)})}return!0},Pf=function(t,e){return xf(t,!1,e),!0},Mf=function(t,e){return $(lf(e,t),Vn)},Lf=function(t,e){return $(lf(e,t),function(t){return"caption"===ce(t)})},Ff=function(t,e){return uf(e),t.selection.setCursorLocation(e.dom(),0),C.some(!0)},Hf=function(t,e){return t?Jl(e):Ql(e)},jf=function(t,e,n){var r=se.fromDom(t.getBody());return Lf(r,n).fold(function(){return function(t,e,n,r){var o=Du.fromRangeStart(t.selection.getRng());return Mf(n,r).bind(function(r){return af(r)?Ff(t,r):function(t,e,n,r,o){return gc(n,t.getBody(),o).bind(function(t){return Mf(e,se.fromDom(t.getNode())).map(function(t){return!1===ye(t,r)})})}(t,n,e,r,o)}).getOr(!1)}(t,e,r,n)||function(t,e){var n=Du.fromRangeStart(t.selection.getRng());return Hf(e,n)||pc(e,t.getBody(),n).map(function(t){return Hf(e,t)}).getOr(!1)}(t,e)},function(n){return function(t,e,n,r){var o=Du.fromRangeStart(t.selection.getRng());return af(r)?Ff(t,r):function(t,e,n,r,o){return gc(n,t.getBody(),o).bind(function(i){return function(t,e,n,r){return xc(t.dom()).bind(function(o){return wc(t.dom()).map(function(t){return e?n.isEqual(o)&&r.isEqual(t):n.isEqual(t)&&r.isEqual(o)})}).getOr(!0)}(r,n,o,i)?function(t,e){return Ff(t,r)}(t):function(t,e,n){return Lf(t,se.fromDom(n.getNode())).map(function(t){return!1===ye(t,e)})}(e,r,i)}).or(C.some(!0))}(t,n,e,r,o)}(t,e,r,n).getOr(!1)})},Vf=function(t,e){var n=se.fromDom(t.selection.getStart(!0)),r=dl(t);return t.selection.isCollapsed()&&0===r.length?jf(t,e,n):function(t,e){var n=se.fromDom(t.getBody()),r=t.selection.getRng(),o=dl(t);return 0!==o.length?Bf(t,o):function(t,e,n,r){return Lf(e,r).fold(function(){return function(t,e,n){return Rf(e,n).map(function(e){return e.fold(h(Pf,t),h(Bf,t),h(If,t))})}(t,e,n)},function(e){return function(t,e){return Ff(t,e)}(t,e)}).getOr(!1)}(t,n,r,e)}(t,n)},zf=function(t){return t.collapsed?t:function(t){var e=Du.fromRangeStart(t),r=Du.fromRangeEnd(t),o=t.commonAncestorContainer;return pc(!1,o,r).map(function(i){return!zs(e,r,o)&&zs(e,i,o)?function(t,e,r,o){var i=n.document.createRange();return i.setStart(t,e),i.setEnd(r,o),i}(e.container(),e.offset(),i.container(),i.offset()):t}).getOr(t)}(t)},Uf=function(t){return t.length>0&&(!(e=t[t.length-1]).firstChild||function(t){return t&&t.firstChild&&t.firstChild===t.lastChild&&function(t){return" "===t.data||pn(t)}(t.firstChild)}(e))?t.slice(0,-1):t;var e},Wf=function(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null},qf=function(t,e){var n=Du.after(t),r=fc(e).prev(n);return r?r.toRange():null},$f=function(t,e,n,r){var o,i=function(t,e,n){var r=e.serialize(n);return function(t){var e=t.firstChild,n=t.lastChild;return e&&"META"===e.nodeName&&e.parentNode.removeChild(e),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),t}(t.createFragment(r))}(e,t,r),a=Wf(e,n.startContainer),u=Uf((o=i.firstChild,ae.grep(o.childNodes,function(t){return"LI"===t.nodeName}))),s=e.getRoot(),c=function(t){var r=Du.fromRangeStart(n),o=fc(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||Wf(e,i.getNode())!==a};return c(1)?function(t,e,n){var r=t.parentNode;return ae.each(e,function(e){r.insertBefore(e,t)}),function(t,e){var n=Du.before(t),r=fc(e).next(n);return r?r.toRange():null}(t,n)}(a,u,s):c(2)?function(t,e,n,r){return r.insertAfter(e.reverse(),t),qf(e[0],n)}(a,u,s,e):function(t,e,n,r){var o=function(t,e){var n=e.cloneRange(),r=e.cloneRange();return n.setStartBefore(t),r.setEndAfter(t),[n.cloneContents(),r.cloneContents()]}(t,r),i=t.parentNode;return i.insertBefore(o[0],t),ae.each(e,function(e){i.insertBefore(e,t)}),i.insertBefore(o[1],t),i.removeChild(t),qf(e[e.length-1],n)}(a,u,s,n)},Yf=rn(["td","th"]),Gf=function(t,e){var n=t.selection.getRng(),r=n.startContainer,o=n.startOffset;n.collapsed&&function(t,e){return fn(t)&&" "===t.nodeValue[e-1]}(r,o)&&fn(r)&&(r.insertData(o-1," "),r.deleteData(o,1),n.setStart(r,o),n.setEnd(r,o),t.selection.setRng(n)),t.selection.setContent(e)},Kf=function(t,e,n){var r,o,i,a,u,s,c=t.selection,l=t.dom;/^ | $/.test(e)&&(e=function(t,e){var n=t.startContainer,r=t.startOffset,o=function(t){return n[t]&&3===n[t].nodeType};return fn(n)&&(r>0?e=e.replace(/^&nbsp;/," "):o("previousSibling")||(e=e.replace(/^ /,"&nbsp;")),r<n.length?e=e.replace(/&nbsp;(<br>|)$/," "):o("nextSibling")||(e=e.replace(/(&nbsp;| )(<br>|)$/,"&nbsp;"))),e}(c.getRng(),e));var f=t.parser,d=n.merge,m=Al({validate:hs(t)},t.schema),h='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;&#x200B;</span>';if(i={content:e,format:"html",selection:!0,paste:n.paste},(i=t.fire("BeforeSetContent",i)).isDefaultPrevented())t.fire("SetContent",{content:i.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=i.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,h);var p=(u=c.getRng()).startContainer||(u.parentElement?u.parentElement():null),g=t.getBody();p===g&&c.isCollapsed()&&l.isBlock(g.firstChild)&&function(t,e){return e&&!t.schema.getShortEndedElements()[e.nodeName]}(t,g.firstChild)&&l.isEmpty(g.firstChild)&&((u=l.createRng()).setStart(g.firstChild,0),u.setEnd(g.firstChild,0),c.setRng(u)),c.isCollapsed()||(function(t){var e=t.dom,n=zf(t.selection.getRng());t.selection.setRng(n);var r=e.getParent(n.startContainer,Yf);!function(t,e,n){return null!==n&&n===t.getParent(e.endContainer,Yf)&&ml(se.fromDom(n),e)}(e,n,r)?t.getDoc().execCommand("Delete",!1,null):If(t,n,se.fromDom(r))}(t),e=function(t,e){var n=t.startContainer,r=t.startOffset;return fn(n)&&t.collapsed&&(" "===n.data[r]?(n.deleteData(r,1),/[\u00a0| ]$/.test(e)||(e+=" ")):" "===n.data[r-1]&&(n.deleteData(r-1,1),/[\u00a0| ]$/.test(e)||(e=" "+e))),e}(t.selection.getRng(),e));var v,b={context:(r=c.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},y=f.parse(e,b);if(!0===n.paste&&function(t,e){var n=e.firstChild,r=e.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(t,e){var n=t.getNonEmptyElements();return e&&(e.isEmpty(n)||function(t,e){return t.getBlockElements()[e.name]&&function(t){return t.firstChild&&t.firstChild===t.lastChild}(e)&&function(t){return"br"===t.name||" "===t.value}(e.firstChild)}(t,e))}(t,r)&&(r=r.prev),!(!n||n!==r||"ul"!==n.name&&"ol"!==n.name)}(t.schema,y)&&Wf(l,r))return u=$f(m,l,t.selection.getRng(),y),t.selection.setRng(u),void t.fire("SetContent",i);if(function(t){for(var e=y;e=e.walk();)1===e.type&&e.attr("data-mce-fragment","1")}(),"mce_marker"===(s=y.lastChild).attr("id"))for(a=s,s=s.prev;s;s=s.walk(!0))if(3===s.type||!l.isBlock(s.name)){t.schema.isValidChild(s.parent.name,"span")&&s.parent.insert(a,s,"br"===s.name);break}if(t._selectionOverrides.showBlockCaretContainer(r),b.invalid){for(Gf(t,h),r=c.getNode(),o=t.getBody(),9===r.nodeType?r=s=o:s=r;s!==o;)r=s,s=s.parentNode;e=r===o?o.innerHTML:l.getOuterHTML(r),e=m.serialize(f.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return m.serialize(y)}))),r===o?l.setHTML(o,e):l.setOuterHTML(r,e)}else!function(t,e,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(t.dom.createFragment(e),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?t.dom.setHTML(n,e):Gf(t,e)}}(t,e=m.serialize(y),r);!function(t,e){var n=t.schema.getTextInlineElements(),r=t.dom;if(e){var o=t.getBody(),i=new Vl(r);ae.each(r.select("*[data-mce-fragment]"),function(t){for(var e=t.parentNode;e&&e!==o;e=e.parentNode)n[t.nodeName.toLowerCase()]&&i.compare(e,t)&&r.remove(t,!0)})}}(t,d),function(t,e){var n,r,o=t.dom,i=t.selection;if(e){t.selection.scrollIntoView(e);var a=function(e){for(var n=t.getBody();e&&e!==n;e=e.parentNode)if("false"===t.dom.getContentEditable(e))return e;return null}(e);if(a)return o.remove(e),void i.select(a);var u=o.createRng(),s=e.previousSibling;s&&3===s.nodeType?(u.setStart(s,s.nodeValue.length),ne.ie||(r=e.nextSibling)&&3===r.nodeType&&(s.appendData(r.data),r.parentNode.removeChild(r))):(u.setStartBefore(e),u.setEndBefore(e));var c=o.getParent(e,o.isBlock);o.remove(e),c&&o.isEmpty(c)&&(t.$(c).empty(),u.setStart(c,0),u.setEnd(c,0),Yf(c)||c.getAttribute("data-mce-fragment")||!(n=function(e){var n=Du.fromRangeStart(e);if(n=fc(t.getBody()).next(n))return n.toRange()}(u))?o.add(c,o.create("br",{"data-mce-bogus":"1"})):(u=n,o.remove(c))),i.setRng(u)}}(t,l.get("mce_marker")),v=t.getBody(),ae.each(v.getElementsByTagName("*"),function(t){t.removeAttribute("data-mce-fragment")}),function(t,e){C.from(t.getParent(e,"td,th")).map(se.fromDom).each(sf)}(t.dom,t.selection.getStart()),t.fire("SetContent",i),t.addVisual()}},Xf=function(t){var e=Ie(t).dom();return t.dom()===e.activeElement},Jf=function(t){return void 0===t&&(t=se.fromDom(n.document)),C.from(t.dom().activeElement).map(se.fromDom)},Qf=ki([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Zf=(Qf.before,Qf.on,Qf.after,ki([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),td=(Zf.domRange,Zf.relative,Zf.exact,function(t,e,n,r){return{start:d(t),soffset:d(e),finish:d(n),foffset:d(r)}}),ed=Yt().browser,nd=function(t,e){var n=me(e)?yl(e).length:Ee(e).length+1;return t>n?n:t<0?0:t},rd=function(t){return td(t.start(),nd(t.soffset(),t.start()),t.finish(),nd(t.foffset(),t.finish()))},od=function(t,e){return!en(e.dom())&&(xe(t,e)||ye(t,e))},id=function(t){return function(e){return od(t,e.start())&&od(t,e.finish())}},ad=function(t){return!0===t.inline||ed.isIE()},ud=function(t){return td(se.fromDom(t.startContainer),t.startOffset,se.fromDom(t.endContainer),t.endOffset)},sd=function(t){var e=n.document.createRange();try{return e.setStart(t.start().dom(),t.soffset()),e.setEnd(t.finish().dom(),t.foffset()),C.some(e)}catch(t){return C.none()}},cd=function(t){var e=ad(t)?function(t){return function(t){var e=t.getSelection();return(e&&0!==e.rangeCount?C.from(e.getRangeAt(0)):C.none()).map(ud)}(_e(t).dom()).filter(id(t))}(se.fromDom(t.getBody())):C.none();t.bookmark=e.isSome()?e:t.bookmark},ld=function(t){return(t.bookmark?t.bookmark:C.none()).bind(function(e){return function(t,e){return C.from(e).filter(id(t)).map(rd)}(se.fromDom(t.getBody()),e)}).bind(sd)},fd={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},dd=function(t){var e=Zi(function(){cd(t)},0);t.on("init",function(){t.inline&&function(t,e){var r=function(){e.throttle()};Vi.DOM.bind(n.document,"mouseup",r),t.on("remove",function(){Vi.DOM.unbind(n.document,"mouseup",r)})}(t,e),function(t,e){Yt().browser.isIE()?function(t){t.on("focusout",function(){cd(t)})}(t):function(t,e){t.on("mouseup touchend",function(t){e.throttle()})}(t,e),t.on("keyup NodeChange",function(e){(function(t){return"nodechange"===t.type&&t.selectionChange})(e)||cd(t)})}(t,e)}),t.on("remove",function(){e.cancel()})},md=Vi.DOM,hd=function(t,e){var n=function(t){return t.getParam("custom_ui_selector","","string")}(t);return null!==md.getParent(e,function(e){return fd.isEditorUIElement(e)||!!n&&t.dom.is(e,n)})},pd=function(t,e){var r=e.editor;dd(r),r.on("focusin",function(){var e=t.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),t.setActive(this),t.focusedEditor=this,this.fire("focus",{blurredEditor:e}),this.focus(!0))}),r.on("focusout",function(){var e=this;Ni.setEditorTimeout(e,function(){var r=t.focusedEditor;hd(e,function(){try{return n.document.activeElement}catch(t){return n.document.body}}())||r!==e||(e.fire("blur",{focusedEditor:null}),t.focusedEditor=null)})}),Ml||(Ml=function(e){var r=t.activeEditor,o=e.target;r&&o.ownerDocument===n.document&&(o===n.document.body||hd(r,o)||t.focusedEditor!==r||(r.fire("blur",{focusedEditor:null}),t.focusedEditor=null))},md.bind(n.document,"focusin",Ml))},gd=function(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(md.unbind(n.document,"focusin",Ml),Ml=null)},vd=function(t,e){(function(t,e){return function(t){return t.collapsed?C.from(Ga(t.startContainer,t.startOffset)).map(se.fromDom):C.none()}(e).bind(function(e){return jn(e)?C.some(e):!1===xe(t,e)?C.some(t):C.none()})})(se.fromDom(t.getBody()),e).bind(function(t){return xc(t.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},bd=function(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()},yd=function(t){return t.inline?function(t){var e=t.getBody();return e&&function(t){return Xf(t)||(e=t,Jf(Ie(e)).filter(function(t){return e.dom().contains(t.dom())})).isSome();var e}(se.fromDom(e))}(t):function(t){return t.iframeElement&&Xf(se.fromDom(t.iframeElement))}(t)},xd=function(t){return t.editorManager.setActive(t)},wd=function(t,e,n){var r=function(t,e,n){var r={},o={},i=[];for(var a in n.firstChild&&function t(e,n){n(e),e.firstChild&&t(e.firstChild,n),e.next&&t(e.next,n)}(n.firstChild,function(n){V(t,function(t){t.name===n.name&&(r[t.name]?r[t.name].nodes.push(n):r[t.name]={filter:t,nodes:[n]})}),V(e,function(t){"string"==typeof n.attr(t.name)&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var u in o)o.hasOwnProperty(u)&&i.push(o[u]);return i}(t,e,n);V(r,function(t){V(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Cd=function(t){return t instanceof Dl},_d=function(t,e){t.dom.setHTML(t.getBody(),e),function(t){yd(t)&&xc(t.getBody()).each(function(e){var n=e.getNode(),r=sn(n)?xc(n).getOr(e):e;t.selection.setRng(r.toRange())})}(t)},kd=function(t,e){return t.splitText(e)},Sd=function(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&fn(e)?n>0&&n<e.nodeValue.length&&(e=(r=kd(e,n)).previousSibling,o>n?(e=r=kd(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(fn(e)&&n>0&&n<e.nodeValue.length&&(e=kd(e,n),n=0),fn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=kd(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}},Td=Uc,Od=function(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&t.dom.is(e,r[o].selector))return!0;return!1},Dd=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,function(e){return!!Od(t,e,n)||e.parentNode===o||!!Ad(t,e,n,r,!0)}),Ad(t,e,n,r))},Ed=function(t,e,n){return!!Td(e,n.inline)||!!Td(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0)},Nd=function(t,e,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(e,n,r);if(c)if(void 0===c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?t.getAttrib(e,a):qc(t,e,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!Td(u,Wc(t,zc(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?t.getAttrib(e,c[s]):qc(t,e,c[s]))return n;return n},Ad=function(t,e,n,r,o){var i,a,u,s,c=t.formatter.get(n),l=t.dom;if(c&&e)for(a=0;a<c.length;a++)if(i=c[a],Ed(t.dom,e,i)&&Nd(l,e,i,"attributes",o,r)&&Nd(l,e,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!t.dom.hasClass(e,s[u]))return;return i}},Rd=function(t,e,n,r){if(r)return Dd(t,r,e,n);if(r=t.selection.getNode(),Dd(t,r,e,n))return!0;var o=t.selection.getStart();return!(o===r||!Dd(t,o,e,n))},Bd=function(t,e,n){var r=[],o={},i=t.selection.getStart();return t.dom.getParent(i,function(i){for(var a=0;a<e.length;a++){var u=e[a];!o[u]&&Ad(t,i,u,n)&&(o[u]=!0,r.push(u))}},t.dom.getRoot()),r},Id=function(t,e){var n,r,o,i,a,u=t.formatter.get(e),s=t.dom;if(u)for(n=t.selection.getStart(),r=Yc(s,n),i=u.length-1;i>=0;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;o>=0;o--)if(s.is(r[o],a))return!0}return!1},Pd=function(t,e,n){return q(n,function(n,r){var o=function(t,e){return H(t.formatter.get(e),function(t){var e=function(t){return t.length>1&&"%"===t.charAt(0)};return H(["styles","attributes"],function(n){return lt(t,n).exists(function(t){var n=D(t)?t:function(t){return function(t,e){var n=[];return rt(t,function(t,e){n.push(function(t){return t}(t))}),n}(t)}(t);return H(n,e)})})})}(t,r);return t.formatter.matchNode(e,r,{},o)?n.concat([r]):n},[])},Md=function(t){return function(t){for(var e=[];t;){if(3===t.nodeType&&"\ufeff"!==t.nodeValue||t.childNodes.length>1)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length>0},Ld=function(t){if(t){var e=new fi(t,t);for(t=e.current();t;t=e.next())if(fn(t))return t}return null},Fd=function(t){var e=se.fromTag("span");return wn(e,{id:"_mce_caret","data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&je(e,se.fromText("\ufeff")),e},Hd=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(Md(e))xf(t,!1,se.fromDom(e),n);else{var i=o.getRng(),a=r.getParent(e,r.isBlock),u=i.startContainer,s=i.startOffset,c=i.endContainer,l=i.endOffset,f=function(t){var e=Ld(t);return e&&"\ufeff"===e.nodeValue.charAt(0)&&e.deleteData(0,1),e}(e);r.remove(e,!0),u===f&&s>0&&i.setStart(f,s-1),c===f&&l>0&&i.setEnd(f,l-1),a&&r.isEmpty(a)&&uf(se.fromDom(a)),o.setRng(i)}},jd=function(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)Hd(t,e,n);else if(!(e=_c(t.getBody(),o.getStart())))for(;e=r.get("_mce_caret");)Hd(t,e,!1)},Vd=function(t,e){return t.appendChild(e),e},zd=function(t,e){var n=W(t,function(t,e){return Vd(t,e.cloneNode(!1))},e);return Vd(n,n.ownerDocument.createTextNode("\ufeff"))},Ud=function(t,e,n,r){var o,i,a,u=t.dom,s=t.selection,c=[],l=s.getRng(),f=l.startContainer,d=l.startOffset;for(i=f,3===f.nodeType&&(d!==f.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(Ad(t,i,e,n,r)){a=i;break}i.nextSibling&&(o=!0),c.push(i),i=i.parentNode}if(a)if(o){var m=s.getBookmark();l.collapse(!0);var p=ul(t,l,t.formatter.get(e),!0);p=Sd(p),t.formatter.remove(e,n,p,r),s.moveToBookmark(m)}else{var g=_c(t.getBody(),a),v=Fd(!1).dom();!function(t,e,n){var r=t.dom,o=r.getParent(n,h(Hc,t));o&&r.isEmpty(o)?n.parentNode.replaceChild(e,n):(function(t){var e=ia(t,"br"),n=U(function(t){for(var e=[],n=t.dom();n;)e.push(se.fromDom(n)),n=n.lastChild;return e}(t).slice(-1),Pn);e.length===n.length&&V(n,Ue)}(se.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(e,n):r.insertAfter(e,n))}(t,v,null!==g?g:a);var b=function(t,e,n,r,o,i){var a=t.formatter,u=t.dom,s=U(et(a.get()),function(t){return"removeformat"!==t&&t!==r}),c=Pd(t,n,s);if(U(c,function(e){return!Gc(t,e,r)}).length>0){var l=n.cloneNode(!1);return u.add(e,l),a.remove(r,o,l,i),u.remove(l),C.some(l)}return C.none()}(t,v,a,e,n,r),y=zd(c.concat(b.toArray()),v);Hd(t,g,!1),s.setCursorLocation(y,1),u.isEmpty(a)&&u.remove(a)}},Wd=function(t,e){return t.schema.getTextInlineElements().hasOwnProperty(ce(e))&&!Cc(e.dom())&&!un(e.dom())},qd={},$d=pt,Yd=mt;!function(t,e){qd[t]||(qd[t]=[]),qd[t].push(function(t){var e,n=t.selection.getRng(),r=rn(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),Yd($d($d(e,r),function(t){return r(t.previousSibling)&&-1!==gt(e,t.previousSibling)}),function(t){var e,n;e=t.previousSibling,li(n=t).remove(),li(e).append("<br><br>").append(n.childNodes)}))})}("pre");var Gd,Kd,Xd=/^(src|href|style)$/,Jd=ae.each,Qd=Uc,Zd=function(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)},tm=function(t,e,n){var r,o;if(r=e[n?"startContainer":"endContainer"],o=e[n?"startOffset":"endOffset"],nn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return fn(r)&&n&&o>=r.nodeValue.length&&(r=new fi(r,t.getBody()).next()||r),fn(r)&&!n&&0===o&&(r=new fi(r,t.getBody()).prev()||r),r},em=function(t,e){var n=e?"firstChild":"lastChild";if(function(t){return/^(TR|TH|TD)$/.test(t.nodeName)}(t)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t},nm=function(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o},rm=function(t,e,n,r,o){var i=se.fromDom(e),a=se.fromDom(t.create(r,o)),u=n?De(i):Oe(i);return Ve(a,u),n?(Le(i,a),He(a,i)):(Fe(i,a),je(a,i)),a.dom()},om=function(t,e,n,r){return!(e=Fc(e,n,r))||"BR"===e.nodeName||t.isBlock(e)},im=function(t,e,n,r,o){var i,a=t.dom;if(!function(t,e,n){return!!Qd(e,n.inline)||!!Qd(e,n.block)||(n.selector?nn(e)&&t.is(e,n.selector):void 0)}(a,r,e)&&!function(t,e){return e.links&&"A"===t.nodeName}(r,e))return!1;var u=r;if(e.inline&&"all"===e.remove&&D(e.preserve_attributes)){var s=U(a.getAttribs(u),function(t){return F(e.preserve_attributes,t.name.toLowerCase())});if(a.removeAllAttribs(u),V(s,function(t){return a.setAttrib(u,t.name,t.value)}),s.length>0)return t.dom.rename(r,"span"),!0}if("all"!==e.remove){Jd(e.styles,function(t,r){t=Wc(a,zc(t,n),r),"number"==typeof r&&(r=t,o=null),(e.remove_similar||!o||Qd(qc(a,o,r),t))&&a.setStyle(u,r,""),i=!0}),i&&""===a.getAttrib(u,"style")&&(u.removeAttribute("style"),u.removeAttribute("data-mce-style")),Jd(e.attributes,function(t,r){var i;if(t=zc(t,n),"number"==typeof r&&(r=t,o=null),e.remove_similar||!o||Qd(a.getAttrib(o,r),t)){if("class"===r&&(t=a.getAttrib(u,r))&&(i="",V(t.split(/\s+/),function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)}),i))return void a.setAttrib(u,r,i);"class"===r&&u.removeAttribute("className"),Xd.test(r)&&u.removeAttribute("data-mce-"+r),u.removeAttribute(r)}}),Jd(e.classes,function(t){t=zc(t,n),o&&!a.hasClass(o,t)||a.removeClass(u,t)});for(var c=a.getAttribs(u),l=0;l<c.length;l++){var f=c[l].nodeName;if(0!==f.indexOf("_")&&0!==f.indexOf("data-"))return!1}}return"none"!==e.remove?(function(t,e,n){var r,o=e.parentNode,i=t.dom,a=Qu(t);n.block&&(a?o===i.getRoot()&&(n.list_block&&Qd(e,n.list_block)||V(tt(e.childNodes),function(e){jc(t,a,e.nodeName.toLowerCase())?r?r.appendChild(e):(r=nm(i,e,a),i.setAttribs(r,t.settings.forced_root_block_attrs)):r=0})):i.isBlock(e)&&!i.isBlock(o)&&(om(i,e,!1)||om(i,e.firstChild,!0,!0)||e.insertBefore(i.create("br"),e.firstChild),om(i,e,!0)||om(i,e.lastChild,!1,!0)||e.appendChild(i.create("br")))),n.selector&&n.inline&&!Qd(n.inline,e)||i.remove(e,!0)}(t,u,e),!0):void 0},am=function(t,e,n,r,o){var i=t.formatter.get(e),a=i[0],u=!0,s=t.dom,c=t.selection,l=function(r){var u=function(t,e,n,r,o){var i;return V(Yc(t.dom,e.parentNode).reverse(),function(e){if(!i&&"_start"!==e.id&&"_end"!==e.id){var a=Ad(t,e,n,r,o);a&&!1!==a.split&&(i=e)}}),i}(t,r,e,n,o);return function(t,e,n,r,o,i,a,u){var s,c,l,f=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){s=f.clone(m,!1);for(var h=0;h<e.length;h++)if(im(t,e[h],u,s,s)){s=0;break}s&&(c&&s.appendChild(c),l||(l=s),c=s)}a.mixed&&f.isBlock(n)||(r=f.split(n,r)),c&&(o.parentNode.insertBefore(c,o),l.appendChild(o))}return r}(t,i,u,r,r,0,a,n)},f=function e(r){var o,c;nn(r)&&s.getContentEditable(r)&&(o=u,u="true"===s.getContentEditable(r),c=!0);var l=tt(r.childNodes);if(u&&!c)for(var f=0;f<i.length&&!im(t,i[f],n,r,r);f++);if(a.deep&&l.length){for(f=0;f<l.length;f++)e(l[f]);c&&(u=o)}},d=function(t){var e=s.get(t?"_start":"_end"),n=e[t?"firstChild":"lastChild"];return function(t){return Rc(t)&&nn(t)&&("_start"===t.id||"_end"===t.id)}(n)&&(n=n[t?"firstChild":"lastChild"]),fn(n)&&0===n.data.length&&(n=t?e.previousSibling||e.nextSibling:e.nextSibling||e.previousSibling),s.remove(e,!0),n},m=function(e){var n,r,o=ul(t,e,i,!0);if(a.split){if(o=Sd(o),(n=tm(t,o,!0))!==(r=tm(t,o))){if(n=em(n,!0),r=em(r,!1),Zd(s,n,r)){var u=C.from(n.firstChild).getOr(n);return l(rm(s,u,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void d(!0)}if(Zd(s,r,n))return u=C.from(r.lastChild).getOr(r),l(rm(s,u,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void d(!1);n=nm(s,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=nm(s,r,"span",{id:"_end","data-mce-type":"bookmark"});var c=s.createRng();c.setStartAfter(n),c.setEndBefore(r),cl(s,c,function(t){V(t,function(t){Rc(t)||Rc(t.parentNode)||l(t)})}),l(n),l(r),n=d(!0),r=d()}else n=r=l(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=s.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=s.nodeIndex(r)+1}cl(s,o,function(e){V(e,function(e){f(e),V(["underline","line-through","overline"],function(n){nn(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&$c(s,e.parentNode)===n&&im(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)})})})};if(r)if(Mc(r)){var h=s.createRng();h.setStartBefore(r),h.setEndAfter(r),m(h)}else m(r);else if("false"!==s.getContentEditable(c.getNode()))c.isCollapsed()&&a.inline&&!dl(t).length?Ud(t,e,n,o):(vl(c,!0,function(){gl(t,m)}),a.inline&&Rd(t,e,n,c.getStart())&&Lc(s,c,c.getRng()),t.nodeChanged());else{r=c.getNode();for(var p=0;p<i.length&&(!i[p].ceFalseOverride||!im(t,i[p],n,r,r));p++);}},um=ae.each,sm=function(t){return nn(t)&&!Rc(t)&&!Cc(t)&&!un(t)},cm=function(t,e){var n;for(n=t;n;n=n[e]){if(fn(n)&&0!==n.nodeValue.length)return t;if(nn(n)&&!Rc(n))return n}return t},lm=function(t,e,n){var r,o,i=new Vl(t);if(e&&n&&(e=cm(e,"previousSibling"),n=cm(n,"nextSibling"),i.compare(e,n))){for(r=e.nextSibling;r&&r!==n;)o=r,r=r.nextSibling,e.appendChild(o);return t.remove(n),ae.each(ae.grep(n.childNodes),function(t){e.appendChild(t)}),e}return n},fm=function t(e,n,r){um(e.childNodes,function(e){sm(e)&&(n(e)&&r(e),e.hasChildNodes()&&t(e,n,r))})},dm=function(t,e){return function(n){return!(!n||!qc(t,n,e))}},mm=function(t,e,n){return function(r){t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),hm(t,r)}},hm=function(t,e){"SPAN"===e.nodeName&&0===t.getAttribs(e).length&&t.remove(e,!0)},pm=ae.each,gm=function t(e,n,r,o){var i,a=e.formatter.get(n),u=a[0],s=!o&&e.selection.isCollapsed(),c=e.dom,l=e.selection,f=function(t,e){if(e=e||u,t){if(e.onformat&&e.onformat(t,e,r,o),pm(e.styles,function(e,n){c.setStyle(t,n,zc(e,r))}),e.styles){var n=c.getAttrib(t,"style");n&&c.setAttrib(t,"data-mce-style",n)}pm(e.attributes,function(e,n){c.setAttrib(t,n,zc(e,r))}),pm(e.classes,function(e){e=zc(e,r),c.hasClass(t,e)||c.addClass(t,e)})}},d=function(t,e){var n=!1;return!!u.selector&&(pm(t,function(t){if(!("collapsed"in t)||t.collapsed===s)return c.is(e,t.selector)&&!Cc(e)?(f(e,t),n=!0,!1):void 0}),n)},m=function(t,o,i,s){var c=[],l=!0,m=u.inline||u.block,h=t.create(m);f(h),cl(t,o,function(o){var i;pm(o,function o(p){var g=!1,v=l,b=p.nodeName.toLowerCase(),y=p.parentNode.nodeName.toLowerCase();if(nn(p)&&t.getContentEditable(p)&&(v=l,l="true"===t.getContentEditable(p),g=!0),Uc(b,"br"))return i=0,void(u.block&&t.remove(p));if(u.wrapper&&Ad(e,p,n,r))i=0;else{if(l&&!g&&u.block&&!u.wrapper&&Hc(e,b)&&jc(e,y,m))return p=t.rename(p,m),f(p),c.push(p),void(i=0);if(u.selector){var x=d(a,p);if(!u.inline||x)return void(i=0)}!l||g||!jc(e,m,b)||!jc(e,y,m)||!s&&3===p.nodeType&&1===p.nodeValue.length&&65279===p.nodeValue.charCodeAt(0)||Cc(p)||u.inline&&t.isBlock(p)?(i=0,pm(ae.grep(p.childNodes),o),g&&(l=v),i=0):(i||(i=t.clone(h,!1),p.parentNode.insertBefore(i,p),c.push(i)),i.appendChild(p))}})}),!0===u.links&&pm(c,function(t){!function t(e){"A"===e.nodeName&&f(e,u),pm(ae.grep(e.childNodes),t)}(t)}),pm(c,function(o){var i=function(t){var e=0;return pm(o.childNodes,function(t){(function(t){return t&&fn(t)&&0===t.length})(t)||Rc(t)||e++}),e}();!(c.length>1)&&t.isBlock(o)||0!==i?(u.inline||u.wrapper)&&(u.exact||1!==i||(o=function(e){var n,r=function(t){var e=!1;return pm(t.childNodes,function(t){if(function(t){return t&&1===t.nodeType&&!Rc(t)&&!Cc(t)&&!un(t)}(t))return e=t,!1}),e}(e);return r&&!Rc(r)&&Ed(t,r,u)&&(n=t.clone(r,!1),f(n),t.replace(n,e,!0),t.remove(r,!0)),n||e}(o)),function(t,e,n,r){um(e,function(e){um(t.dom.select(e.inline,r),function(r){sm(r)&&im(t,e,n,r,e.exact?r:null)}),function(t,e,n){if(e.clear_child_styles){var r=e.links?"*:not(a)":"*";um(t.select(r,n),function(n){sm(n)&&um(e.styles,function(e,r){t.setStyle(n,r,"")})})}}(t.dom,e,r)})}(e,a,r,o),function(t,e,n,r,o){Ad(t,o.parentNode,n,r)&&im(t,e,r,o)||e.merge_with_parents&&t.dom.getParent(o.parentNode,function(i){if(Ad(t,i,n,r))return im(t,e,r,o),!0})}(e,u,n,r,o),function(t,e,n,r){e.styles&&e.styles.backgroundColor&&fm(r,dm(t,"fontSize"),mm(t,"backgroundColor",zc(e.styles.backgroundColor,n)))}(t,u,r,o),function(t,e,n,r){var o=function(e){if(1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType){var n=$c(t,e.parentNode);t.getStyle(e,"color")&&n?t.setStyle(e,"text-decoration",n):t.getStyle(e,"text-decoration")===n&&t.setStyle(e,"text-decoration",null)}};e.styles&&(e.styles.color||e.styles.textDecoration)&&(ae.walk(r,o,"childNodes"),o(r))}(t,u,0,o),function(t,e,n,r){"sub"!==e.inline&&"sup"!==e.inline||(fm(r,dm(t,"fontSize"),mm(t,"fontSize","")),t.remove(t.select("sup"===e.inline?"sub":"sup",r),!0))}(t,u,0,o),function(t,e,n,r){r&&!1!==u.merge_siblings&&(r=lm(t,Fc(r),r),r=lm(t,r,Fc(r,!0)))}(t,0,0,o)):t.remove(o,!0)})};if("false"!==c.getContentEditable(l.getNode())){if(u){if(o)Mc(o)?d(a,o)||((i=c.createRng()).setStartBefore(o),i.setEndAfter(o),m(c,ul(e,i,a),0,!0)):m(c,o,0,!0);else if(s&&u.inline&&!dl(e).length)!function(t,e,n){var r,o,i=t.selection,a=i.getRng(),u=a.startOffset,s=a.startContainer.nodeValue;(r=_c(t.getBody(),i.getStart()))&&(o=Ld(r));var c,l,f=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(s&&u>0&&u<s.length&&f.test(s.charAt(u))&&f.test(s.charAt(u-1))){var d=i.getBookmark();a.collapse(!0);var m=ul(t,a,t.formatter.get(e));m=Sd(m),t.formatter.apply(e,n,m),i.moveToBookmark(d)}else r&&"\ufeff"===o.nodeValue||(c=t.getDoc(),l=Fd(!0).dom(),o=(r=c.importNode(l,!0)).firstChild,a.insertNode(r),u=1),t.formatter.apply(e,n,r),i.setCursorLocation(o,u)}(e,n,r);else{var h=l.getNode();e.settings.forced_root_block||!a[0].defaultBlock||c.getParent(h,c.isBlock)||t(e,a[0].defaultBlock),l.setRng(zf(l.getRng())),vl(l,!0,function(t){gl(e,function(t,n){var r=n?t:ul(e,t,a);m(c,r)})}),Lc(c,l,l.getRng()),e.nodeChanged()}!function(t,e){Yd(qd[t],function(t){t(e)})}(n,e)}}else{o=l.getNode();for(var p=0,g=a.length;p<g;p++)if(a[p].ceFalseOverride&&c.is(o,a[p].selector))return void f(o,a[p])}},vm=function(t,e){return j(e,function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e})},bm=function(t,e){var r=(e||n.document).createDocumentFragment();return V(t,function(t){r.appendChild(t.dom())}),se.fromDom(r)},ym=function(t,e,n){return{element:d(t),width:d(e),rows:d(n)}},xm=function(t,e){return{element:d(t),cells:d(e)}},wm=function(t,e){return{x:d(t),y:d(e)}},Cm=function(t,e){var n=parseInt(Cn(t,e),10);return isNaN(n)?1:n},_m=function(t,e,n){var r=t.rows();return!!(r[n]?r[n].cells():[])[e]},km=function(t){return q(t,function(t,e){return e.cells().length>t?e.cells().length:t},0)},Sm=function(t,e){for(var n=t.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(ye(o[i],e))return C.some(wm(i,r));return C.none()},Tm=function(t,e,n,r,o){for(var i=[],a=t.rows(),u=n;u<=o;u++){var s=a[u].cells(),c=e<r?s.slice(e,r+1):s.slice(r,e+1);i.push(xm(a[u].element(),c))}return i},Om=function(t){return function(t,e){var n=wa(t.element()),r=se.fromTag("tbody");return Ve(r,e),je(n,r),n}(t,function(t){return j(t.rows(),function(t){var e=j(t.cells(),function(t){var e=Ca(t);return _n(e,"colspan"),_n(e,"rowspan"),e}),n=wa(t.element());return Ve(n,e),n})}(t))},Dm=function(t,e){var n=se.fromDom(e.commonAncestorContainer),r=lf(n,t),o=U(r,function(t){return In(t)||Rn(t)}),i=function(t,e){return $(t,function(t){return"li"===ce(t)&&ml(t,e)}).fold(d([]),function(e){return function(t){return $(t,function(t){return"ul"===ce(t)||"ol"===ce(t)})}(t).map(function(t){return[se.fromTag("li"),se.fromTag(ce(t))]}).getOr([])})}(r,e),a=o.concat(i.length?i:function(t){return Fn(t)?ke(t).filter(Ln).fold(d([]),function(e){return[t,e]}):Ln(t)?[t]:[]}(n));return j(a,wa)},Em=function(){return bm([])},Nm=function(t,e){return(n=t,r=e[0],ca(r,"table",h(ye,n))).bind(function(t){var n=e[0],r=e[e.length-1];return function(t,e,n){return Sm(t,e).bind(function(e){return Sm(t,n).map(function(n){return function(t,e,n){var r=e.x(),o=e.y(),i=n.x(),a=n.y(),u=o<a?Tm(t,r,o,i,a):Tm(t,r,a,i,o);return ym(t.element(),km(u),u)}(t,e,n)})})}(function(t){var e=ym(wa(t),0,[]);return V(ia(t,"tr"),function(t,n){V(ia(t,"td,th"),function(r,o){!function(t,e,n,r,o){for(var i=Cm(o,"rowspan"),a=Cm(o,"colspan"),u=t.rows(),s=n;s<n+i;s++){u[s]||(u[s]=xm(Ca(r),[]));for(var c=e;c<e+a;c++)u[s].cells()[c]=s===n&&c===e?o:wa(o)}}(e,function(t,e,n){for(;_m(t,e,n);)e++;return e}(e,o,n),n,t,r)})}),ym(e.element(),km(e.rows()),e.rows())}(t),n,r).map(function(t){return bm([Om(t)])})}).getOrThunk(Em);var n,r},Am=function(t,e){var n=fl(e,t);return n.length>0?Nm(t,n):function(t,e){return e.length>0&&e[0].collapsed?Em():function(t,e){return n=se.fromDom(e.cloneContents()),r=Dm(t,e),o=q(r,function(t,e){return je(e,t),e},n),r.length>0?bm([o]):o;var n,r,o}(t,e[0])}(t,e)},Rm=function(t,e){return e>=0&&e<t.length&&Ic(t.charAt(e))},Bm=function(t){var e=Ta(t.innerText);return ne.browser.isIE()?e.replace(/^[ \f\n\r\t\v]+/,""):e},Im=function(t){return nn(t)?t.outerHTML:fn(t)?or.encodeRaw(t.data,!1):dn(t)?"\x3c!--"+t.data+"--\x3e":""},Pm=function(t,e,r){var o=function(t){var e,r=n.document.createElement("div"),o=n.document.createDocumentFragment();for(t&&(r.innerHTML=t);e=r.firstChild;)o.appendChild(e);return o}(e);if(t.hasChildNodes()&&r<t.childNodes.length){var i=t.childNodes[r];i.parentNode.insertBefore(o,i)}else t.appendChild(o)},Mm=$i(C.none()),Lm=function(t){var e,n=(e=t.getBody(),U(j(tt(e.childNodes),Im),function(t){return t.length>0})),r=G(n,function(e){var n=Fl(t.serializer,e);return n.length>0?[n]:[]}),o=r.join("");return-1!==o.indexOf("</iframe>")?{type:"fragmented",fragments:r,content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:o,bookmark:null,beforeBookmark:null}},Fm=function(t,e,n){"fragmented"===e.type?function(t,e){var n,r,o,i,a,u,s,c,l,f=j(tt(e.childNodes),Im);(function(t,e){var n=0;V(t,function(t){0===t[0]?n++:1===t[0]?(Pm(e,t[1],n),n++):2===t[0]&&function(t,e){if(t.hasChildNodes()&&e<t.childNodes.length){var n=t.childNodes[e];n.parentNode.removeChild(n)}}(e,n)})})((r=t,o=(n=f).length+r.length+2,i=new Array(o),a=new Array(o),u=function(t,e,o,i,a){var s=c(t,e,o,i);if(null===s||s.start===e&&s.diag===e-i||s.end===t&&s.diag===t-o)for(var l=t,f=o;l<e||f<i;)l<e&&f<i&&n[l]===r[f]?(a.push([0,n[l]]),++l,++f):e-t>i-o?(a.push([2,n[l]]),++l):(a.push([1,r[f]]),++f);else{u(t,s.start,o,s.start-s.diag,a);for(var d=s.start;d<s.end;++d)a.push([0,n[d]]);u(s.end,e,s.end-s.diag,i,a)}},s=function(t,e,o,i){for(var a=t;a-e<i&&a<o&&n[a]===r[a-e];)++a;return function(t,e,n){return{start:t,end:a,diag:n}}(t,0,e)},c=function(t,e,o,u){var c=e-t,l=u-o;if(0===c||0===l)return null;var f,d,m,h,p,g=c-l,v=l+c,b=(v%2==0?v:v+1)/2;for(i[1+b]=t,a[1+b]=e+1,f=0;f<=b;++f){for(d=-f;d<=f;d+=2){for(m=d+b,d===-f||d!==f&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,p=(h=i[m])-t+o-d;h<e&&p<u&&n[h]===r[p];)i[m]=++h,++p;if(g%2!=0&&g-f<=d&&d<=g+f&&a[m-g]<=i[m])return s(a[m-g],d+t-o,e,u)}for(d=g-f;d<=g+f;d+=2){for(m=d+b-g,d===g-f||d!==g+f&&a[m+1]<=a[m-1]?a[m]=a[m+1]-1:a[m]=a[m-1],p=(h=a[m]-1)-t+o-d;h>=t&&p>=o&&n[h]===r[p];)a[m]=h--,p--;if(g%2==0&&-f<=d&&d<=f&&a[m]<=i[m+g])return s(a[m],d+t-o,e,u)}}},l=[],u(0,n.length,0,r.length,l),l),e)}(e.fragments,t.getBody()):t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(n?e.beforeBookmark:e.bookmark)},Hm=function(t){return"fragmented"===t.type?t.fragments.join(""):t.content},jm=function(t){var e=se.fromTag("body",Mm.get().getOrThunk(function(){var t=n.document.implementation.createHTMLDocument("undo");return Mm.set(C.some(t)),t}));return ya(e,Hm(t)),V(ia(e,"*[data-mce-bogus]"),We),e.dom().innerHTML},Vm=function(t,e){return!(!t||!e)&&(!!function(t,e){return Hm(t)===Hm(e)}(t,e)||function(t,e){return jm(t)===jm(e)}(t,e))},zm=function(t){return 0===t.get()},Um=function(t,e,n){zm(n)&&(t.typing=e)},Wm=function(t,e){t.typing&&(Um(t,!1,e),t.add())},qm=function(t){return t instanceof Dl},$m=function(t,e){wd(t.serializer.getNodeFilters(),t.serializer.getAttributeFilters(),e)},Ym=function(t){return{undoManager:{beforeChange:function(e,n){return function(t,e,n){zm(e)&&n.set(C.some(Gu(t.selection)))}(t,e,n)},addUndoLevel:function(e,n,r,o,i,a){return function(t,e,n,r,o,i,a){var u=Lm(t);if(i=i||{},i=ae.extend(i,u),!1===zm(r)||t.removed)return null;var s=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:s,originalEvent:a}).isDefaultPrevented())return null;if(s&&Vm(s,i))return null;e.data[n.get()]&&o.get().each(function(t){e.data[n.get()].beforeBookmark=t});var c=function(t){return t.getParam("custom_undo_redo_levels",0,"number")}(t);if(c&&e.data.length>c){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=Gu(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:s,originalEvent:a};return t.fire("AddUndo",f),n.get()>0&&(t.setDirty(!0),t.fire("change",f)),i}(t,e,n,r,o,i,a)},undo:function(e,n,r){return function(t,e,n,r){var o;return e.typing&&(e.add(),e.typing=!1,Um(e,!1,n)),r.get()>0&&(r.set(r.get()-1),o=e.data[r.get()],Fm(t,o,!0),t.setDirty(!0),t.fire("Undo",{level:o})),o}(t,e,n,r)},redo:function(e,n){return function(t,e,n){var r;return e.get()<n.length-1&&(e.set(e.get()+1),r=n[e.get()],Fm(t,r,!1),t.setDirty(!0),t.fire("Redo",{level:r})),r}(t,e,n)},clear:function(e,n){return function(t,e,n){e.data=[],n.set(0),e.typing=!1,t.fire("ClearUndos")}(t,e,n)},reset:function(t){return function(t){t.clear(),t.add()}(t)},hasUndo:function(e,n){return function(t,e,n){return n.get()>0||e.typing&&e.data[0]&&!Vm(Lm(t),e.data[0])}(t,e,n)},hasRedo:function(t,e){return function(t,e){return e.get()<t.data.length-1&&!t.typing}(t,e)},transact:function(t,e,n){return function(t,e,n){return Wm(t,e),t.beforeChange(),t.ignore(n),t.add()}(t,e,n)},ignore:function(t,e){return function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}}(t,e)},extra:function(e,n,r,o){return function(t,e,n,r,o){if(e.transact(r)){var i=e.data[n.get()].bookmark,a=e.data[n.get()-1];Fm(t,a,!0),e.transact(o)&&(e.data[n.get()-1].beforeBookmark=i)}}(t,e,n,r,o)}},formatter:{apply:function(e,n,r){return gm(t,e,n,r)},remove:function(e,n,r,o){return am(t,e,n,r,o)},toggle:function(e,n,r){return function(t,e,n,r){var o=t.formatter.get(e);!Rd(t,e,n,r)||"toggle"in o[0]&&!o[0].toggle?gm(t,e,n,r):am(t,e,n,r)}(t,e,n,r)}},editor:{getContent:function(e,n){return function(t,e,n){return C.from(t.getBody()).fold(d("tree"===e.format?new Dl("body",11):""),function(r){return function(t,e,n,r){var o;if(e.format=n,e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),"raw"===e.format)o=ae.trim(Hl(t.serializer,r.innerHTML));else if("text"===e.format)o=Ta(r.innerText||r.textContent);else{if("tree"===e.format)return t.serializer.serialize(r,e);o=function(t,e){var n=Qu(t),r=new RegExp("^(<"+n+"[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return e.replace(r,"")}(t,t.serializer.serialize(r,e))}return"text"===e.format||zn(se.fromDom(r))?e.content=o:e.content=ae.trim(o),e.no_events||t.fire("GetContent",e),e.content}(t,e,n,r)})}(t,e,n)},setContent:function(e,n){return function(t,e,n){return n.format=n.format?n.format:"html",n.set=!0,n.content=Cd(e)?"":e,Cd(e)||n.no_events||(t.fire("BeforeSetContent",n),e=n.content),C.from(t.getBody()).fold(d(e),function(r){return Cd(e)?function(t,e,n,r){wd(t.parser.getNodeFilters(),t.parser.getAttributeFilters(),n);var o=Al({validate:t.validate},t.schema).serialize(n);return r.content=zn(se.fromDom(e))?o:ae.trim(o),_d(t,r.content),r.no_events||t.fire("SetContent",r),n}(t,r,e,n):function(t,e,n,r){var o,i;return 0===n.length||/^\s+$/.test(n)?(i='<br data-mce-bogus="1">',"TABLE"===e.nodeName?n="<tr><td>"+i+"</td></tr>":/^(UL|OL)$/.test(e.nodeName)&&(n="<li>"+i+"</li>"),(o=Qu(t))&&t.schema.isValidChild(e.nodeName.toLowerCase(),o.toLowerCase())?(n=i,n=t.dom.createHTML(o,Zu(t),n)):n||(n='<br data-mce-bogus="1">'),_d(t,n),t.fire("SetContent",r)):("raw"!==r.format&&(n=Al({validate:t.validate},t.schema).serialize(t.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=zn(se.fromDom(e))?n:ae.trim(n),_d(t,r.content),r.no_events||t.fire("SetContent",r)),r.content}(t,r,e,n)})}(t,e,n)},insertContent:function(e,n){return Kf(t,e,n)}},selection:{getContent:function(e,n){return function(t,e,n){if(void 0===n&&(n={}),n.get=!0,n.format=e,n.selection=!0,(n=t.fire("BeforeGetContent",n)).isDefaultPrevented())return t.fire("GetContent",n),n.content;if("text"===n.format)return function(t){return C.from(t.selection.getRng()).map(function(e){var n=t.dom.add(t.getBody(),"div",{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),r=Bm(n),o=Ta(n.textContent);if(t.dom.remove(n),Rm(o,0)||Rm(o,o.length-1)){var i=t.dom.getParent(e.commonAncestorContainer,t.dom.isBlock),a=Bm(i),u=a.indexOf(r);return-1!==u?(Rm(a,u-1)?" ":"")+r+(Rm(a,u+r.length)?" ":""):r}return r}).getOr("")}(t);n.getInner=!0;var r=function(t,e){var n=t.selection.getRng(),r=t.dom.create("body"),o=t.selection.getSel(),i=vm(t,ll(o)),a=e.contextual?Am(se.fromDom(t.getBody()),i).dom():n.cloneContents();return a&&r.appendChild(a),t.selection.serializer.serialize(r,e)}(t,n);return"tree"===n.format?r:(n.content=t.selection.isCollapsed()?"":r,t.fire("GetContent",n),n.content)}(t,e,n)}},raw:{getModel:function(){return C.none()}}}},Gm=function(t){return ft(t.plugins,"rtc")},Km=function(t){return t.rtcInstance?t.rtcInstance:Ym(t)},Xm=function(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")},Jm=function(t,e,n){return void 0===n&&(n={}),function(t,e,n){return Km(t).editor.setContent(e,n)}(t,e,n)},Qm=Vi.DOM,Zm=function(t){return C.from(t).each(function(t){return t.destroy()})},th=Object.prototype.hasOwnProperty,eh=(Gd=function(t,e){return O(t)&&O(e)?eh(t,e):e},function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o=t[r];for(var i in o)th.call(o,i)&&(n[i]=Gd(n[i],o[i]))}return n}),nh=Yt().deviceType,rh=nh.isTouch(),oh=nh.isPhone(),ih=nh.isTablet(),ah=["lists","autolink","autosave"],uh={table_grid:!1,object_resizing:!1,resize:!1},sh=function(t){var e=D(t)?t.join(" "):t,n=j(T(e)?e.split(" "):[],Mt);return U(n,function(t){return t.length>0})},ch=function(t,e){return t.sections().hasOwnProperty(e)},lh=function(t,e){return lt(t,"toolbar_mode").orThunk(function(){return lt(t,"toolbar_drawer").map(function(t){return!1===t?"wrap":t})}).getOr(e)},fh=function(t,e){var n={resize:!1,toolbar_mode:lh(t,"scrolling"),toolbar_sticky:!1};return xt(xt(xt({},uh),n),e?{menubar:!1}:{})},dh=function(t,e){var n=e.external_plugins?e.external_plugins:{};return t&&t.external_plugins?ae.extend({},t.external_plugins,n):n},mh=function(t,e,n,r,o){var i=t?{mobile:fh(o.mobile||{},e)}:{},a=function(t,e){var n=st(e,function(e,n){return F(t,n)});return function(t,e){return{sections:d(t),settings:d(e)}}(n.t,n.f)}(["mobile"],eh(i,o)),u=ae.extend(n,r,a.settings(),function(t,e){return t&&ch(a,"mobile")}(t)?function(t,e,n){void 0===n&&(n={});var r=a.sections(),o=r.hasOwnProperty(e)?r[e]:{};return ae.extend({},n,o)}(0,"mobile"):{},{validate:!0,external_plugins:dh(r,a.settings())});return function(t,e,n,r){var o=sh(n.forced_plugins),i=sh(r.plugins),a=function(t,e){return ch(t,e)?t.sections()[e]:{}}(e,"mobile"),u=a.plugins?sh(a.plugins):i,s=function(t,e){return[].concat(sh(t)).concat(sh(e))}(o,t&&function(t,e,n){var r=t.sections();return ch(t,e)&&"mobile"===r[e].theme}(e,"mobile")?U(u,h(F,ah)):t&&ch(e,"mobile")?u:i);return ae.extend(r,{plugins:s.join(" ")})}(t,a,r,u)},hh=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i={id:e,theme:"silver",toolbar_mode:lh(t,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return xt(xt({},i),r?uh:{})}(o,e,n,rh,t);return mh(oh||ih,oh,i,r,o)},ph=function(t,e,n){return C.from(e.settings[n]).filter(t)},gh=(Kd={},{add:function(t,e){Kd[t]=e},get:function(t){return Kd[t]?Kd[t]:{icons:{}}},has:function(t){return ft(Kd,t)}}),vh=function(t,e){return e.dom()[t]},bh=function(t,e){return parseInt(kn(e,t),10)},yh=h(vh,"clientWidth"),xh=h(vh,"clientHeight"),wh=h(bh,"margin-top"),Ch=h(bh,"margin-left"),_h=function(t,e,n){var r,o=se.fromDom(t.getBody()),i=t.inline?o:(r=o,se.fromDom(r.dom().ownerDocument.documentElement)),a=function(t,e,n,r){var o=e.dom().getBoundingClientRect();return{x:n-(t?o.left+e.dom().clientLeft+Ch(e):0),y:r-(t?o.top+e.dom().clientTop+wh(e):0)}}(t.inline,i,e,n);return function(t,e,n){var r=yh(t),o=xh(t);return e>=0&&n>=0&&e<=r&&n<=o}(i,a.x,a.y)},kh=function(t){var e;return(e=t.inline?t.getBody():t.getContentAreaContainer(),C.from(e).map(se.fromDom)).map(function(t){return xe(we(t),t)}).getOr(!1)};function Sh(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},r=function(){e.length>0&&n().reposition(e)},o=function(t){Y(e,function(e){return e===t}).each(function(t){e.splice(t,1)})},i=function(i){if(!t.removed&&kh(t))return $(e,function(t){return e=n().getArgs(t),r=i,!(e.type!==r.type||e.text!==r.text||e.progressBar||e.timeout||r.progressBar||r.timeout);var e,r}).getOrThunk(function(){t.editorManager.setActive(t);var a=n().open(i,function(){o(a),r()});return function(t){e.push(t)}(a),r(),a})};return function(t){t.on("SkinLoaded",function(){var e=function(t){return t.getParam("service_message")}(t);e&&i({text:e,type:"warning",timeout:0})}),t.on("ResizeEditor ResizeWindow NodeChange",function(){Ni.requestAnimationFrame(r)}),t.on("remove",function(){V(e.slice(),function(t){n().close(t)})})}(t),{open:i,close:function(){C.from(e[0]).each(function(t){n().close(t),o(t),r()})},getNotifications:function(){return e}}}var Th=Qi.PluginManager,Oh=Qi.ThemeManager,Dh=function(t){var e=[],n=function(){var e,n=t.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:e,alert:e,confirm:e,close:e,getParams:e,setParams:e}},r=function(t,e){return function(){return e?e.apply(t,arguments):void 0}},o=function(n){e.push(n),function(e){t.fire("OpenWindow",{dialog:e})}(n)},i=function(n){!function(e){t.fire("CloseWindow",{dialog:e})}(n),0===(e=U(e,function(t){return t!==n})).length&&t.focus()},a=function(e){t.editorManager.setActive(t),cd(t);var n=e();return o(n),n};return t.on("remove",function(){V(e,function(t){n().close(t)})}),{open:function(t,e){return a(function(){return n().open(t,e,i)})},openUrl:function(t){return a(function(){return n().openUrl(t,i)})},alert:function(t,e,o){n().alert(t,r(o||this,e))},confirm:function(t,e,o){n().confirm(t,r(o||this,e))},close:function(){C.from(e[e.length-1]).each(function(t){n().close(t),i(t)})}}},Eh=function(t,e){t.notificationManager.open({type:"error",text:e})},Nh=function(t,e){t._skinLoaded?Eh(t,e):t.on("SkinLoaded",function(){Eh(t,e)})},Ah=function(t,e,r){!function(t,e,n){t.fire(e,n)}(t,e,{message:r}),n.console.error(r)},Rh=function(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e},Bh=function(t,e,n){Ah(t,"PluginLoadError",Rh("plugin",e,n))},Ih=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var o=n.window.console;o&&(o.error?o.error.apply(o,wt([t],e)):o.log.apply(o,wt([t],e)))},Ph=function(t,e){var n=function(e){var n=function(t){var e=t.dom();return qe(t)?e.getBoundingClientRect().height:e.offsetHeight}(e);if(n<=0||null===n){var r=kn(e,t);return parseFloat(r)||0}return n},r=function(t,e){return q(e,function(e,n){var r=kn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o},0)};return{set:function(e,n){if(!B(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom();bn(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}("height"),Mh=Object.freeze({__proto__:null,view:function(t){return(t.dom()===n.document?C.none():C.from(t.dom().defaultView.frameElement)).map(se.fromDom)},owner:function(t){return we(t)}}),Lh=function(t){var e=se.fromDom(n.document),r=Ke(e),o=function(t,e){var n=e.owner(t);return function t(e,n){return e.view(n).fold(d([]),function(n){var r=e.owner(n),o=t(e,r);return[n].concat(o)})}(e,n)}(t,Mh),i=Ge(t),a=W(o,function(t,e){var n=Ge(e);return{left:t.left+n.left(),top:t.top+n.top()}},{left:0,top:0});return $e(a.left+i.left()+r.left(),a.top+i.top()+r.top())},Fh=function(t){return"textarea"===ce(t)},Hh=function(t,e){var n=function(t){var e=t.dom().ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom())return $e(n.offsetLeft,n.offsetTop);var i=Ye(r.pageYOffset,o.scrollTop),a=Ye(r.pageXOffset,o.scrollLeft),u=Ye(o.clientTop,n.clientTop),s=Ye(o.clientLeft,n.clientLeft);return Ge(t).translate(a-s,i-u)}(t),r=function(t){return Ph.get(t)}(t);return{element:t,bottom:n.top()+r,height:r,pos:n,cleanup:e}},jh=function(t,e,n,r){Wh(t,function(o,i){return zh(t,e,n,r)},n)},Vh=function(t,e,n,r,o){var i={elm:r.element.dom(),alignToTop:o};(function(t,e){return t.fire("ScrollIntoView",e).isDefaultPrevented()})(t,i)||(n(e,Ke(e).top(),r,o),function(t,e){t.fire("AfterScrollIntoView",e)}(t,i))},zh=function(t,e,n,r){var o=se.fromDom(t.getBody()),i=se.fromDom(t.getDoc());o.dom().offsetWidth;var a=function(t,e){var n=function(t,e){var n=Ee(t);if(0===n.length||Fh(t))return{element:t,offset:e};if(e<n.length&&!Fh(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return Fh(r)?{element:t,offset:e}:"img"===ce(r)?{element:r,offset:1}:me(r)?{element:r,offset:yl(r).length}:{element:r,offset:Ee(r).length}}(t,e),r=se.fromHtml('<span data-mce-bogus="all">\ufeff</span>');return Le(n.element,r),Hh(r,function(){return Ue(r)})}(se.fromDom(n.startContainer),n.startOffset);Vh(t,i,e,a,r),a.cleanup()},Uh=function(t,e,n,r){var o=se.fromDom(t.getDoc());Vh(t,o,n,function(t){return Hh(se.fromDom(t),l)}(e),r)},Wh=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;e(se.fromDom(r),se.fromDom(i));var u=t.dom.createRng();u.setStart(r,o),u.setEnd(i,a),t.selection.setRng(n)},qh=function(t,e,n,r){var o=t.pos;if(n)Xe(o.left(),o.top(),r);else{var i=o.top()-e+t.height;Xe(o.left(),i,r)}},$h=function(t,e,n,r,o){var i=n+e,a=r.pos.top(),u=r.bottom,s=u-a>=n;a<e?qh(r,n,!1!==o,t):a>i?qh(r,n,s?!1!==o:!0===o,t):u>i&&!s&&qh(r,n,!0===o,t)},Yh=function(t,e,n,r){var o=t.dom().defaultView.innerHeight;$h(t,e,o,n,r)},Gh=function(t,e,r,o){var i=t.dom().defaultView.innerHeight;$h(t,e,i,r,o);var a=Lh(r.element),u=Ze(n.window);a.top()<u.y?Je(r.element,!1!==o):a.top()>u.bottom&&Je(r.element,!0===o)},Kh=function(t,e,n){(t.inline?function(t,e,n){return jh(t,Yh,e,n)}:function(t,e,n){return jh(t,Gh,e,n)})(t,e,n)},Xh=function(t){return gn(t)||vn(t)},Jh=function(t,e,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(t,e);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=ae.toArray(i.getClientRects())).sort(function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-Math.abs(Math.max(n.top-e,n.bottom-e))})).length>0){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return function(t,e){var n=t&&t.parentElement?t.parentElement():null;return vn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(n,e,Xh))?null:t}(r,n.body)}return r},Qh=function(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,a=n?e.startOffset:e.endOffset;return C.from(i).map(se.fromDom).map(function(t){return r&&e.collapsed?t:Ne(t,o(t,a)).getOr(t)}).bind(function(t){return de(t)?C.some(t):ke(t).filter(de)}).map(function(t){return t.dom()}).getOr(t)},Zh=function(t,e,n){return Qh(t,e,!0,n,function(t,e){return Math.min(t.dom().childNodes.length,e)})},tp=function(t,e,n){return Qh(t,e,!1,n,function(t,e){return e>0?e-1:e})},ep=function(t,e){for(var n=t;t&&fn(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n},np=function(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset},rp=function(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)},op=function(t,e,n){return rp(t,e,function(t){return t.nodeName===n})},ip=function(t){return t&&"TABLE"===t.nodeName},ap=function(t){return t&&/^(TD|TH|CAPTION)$/.test(t.nodeName)},up=function(t,e){return Aa(t)&&!1===rp(t,e,Cc)},sp=function(t,e,n){for(var r=new fi(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(pn(e))return!0},cp=function(t,e,n,r,o){var i,a,u=t.getRoot(),s=t.schema.getNonEmptyElements(),c=t.getParent(o.parentNode,t.isBlock)||u;if(r&&pn(o)&&e&&t.isEmpty(c))return C.some(Tu(o.parentNode,t.nodeIndex(o)));for(var l=new fi(o,c);a=l[r?"prev":"next"]();){if("false"===t.getContentEditableParent(a)||up(a,u))return C.none();if(fn(a)&&a.nodeValue.length>0)return!1===op(a,u,"A")?C.some(Tu(a,r?a.nodeValue.length:0)):C.none();if(t.isBlock(a)||s[a.nodeName.toLowerCase()])return C.none();i=a}return n&&i?C.some(Tu(i,0)):C.none()},lp=function(t,e,n,r){var o,i,a,u,s=t.getRoot(),c=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var l=nn(o)&&i===o.childNodes.length,f=t.schema.getNonEmptyElements();if(u=n,Aa(o))return C.none();if(nn(o)&&i>o.childNodes.length-1&&(u=!1),mn(o)&&(o=s,i=0),o===s){if(u&&(a=o.childNodes[i>0?i-1:0])){if(Aa(a))return C.none();if(f[a.nodeName]||ip(a))return C.none()}if(o.hasChildNodes()){if(i=Math.min(!u&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=fn(o)&&l?o.data.length:0,!e&&o===s.lastChild&&ip(o))return C.none();if(function(t,e){for(;e&&e!==t;){if(vn(e))return!0;e=e.parentNode}return!1}(s,o)||Aa(o))return C.none();if(o.hasChildNodes()&&!1===ip(o)){a=o;var d=new fi(o,s);do{if(vn(a)||Aa(a)){c=!1;break}if(fn(a)&&a.nodeValue.length>0){i=u?0:a.nodeValue.length,o=a,c=!0;break}if(f[a.nodeName.toLowerCase()]&&!ap(a)){i=t.nodeIndex(a),o=a.parentNode,u||i++,c=!0;break}}while(a=u?d.next():d.prev())}}}return e&&(fn(o)&&0===i&&cp(t,l,e,!0,o).each(function(t){o=t.container(),i=t.offset(),c=!0}),nn(o)&&((a=o.childNodes[i])||(a=o.childNodes[i-1]),!a||!pn(a)||function(t,e){return t.previousSibling&&"A"===t.previousSibling.nodeName}(a)||sp(t,a,!1)||sp(t,a,!0)||cp(t,l,e,!0,a).each(function(t){o=t.container(),i=t.offset(),c=!0}))),u&&!e&&fn(o)&&i===o.nodeValue.length&&cp(t,l,e,!1,o).each(function(t){o=t.container(),i=t.offset(),c=!0}),c?C.some(Tu(o,i)):C.none()},fp=function(t,e){var n=e.collapsed,r=e.cloneRange(),o=Tu.fromRangeStart(e);return lp(t,n,!0,r).each(function(t){n&&Tu.isAbove(o,t)||r.setStart(t.container(),t.offset())}),n||lp(t,n,!1,r).each(function(t){r.setEnd(t.container(),t.offset())}),n&&r.collapse(!0),np(e,r)?C.none():C.some(r)},dp=function(t){return 0===t.dom().length?(Ue(t),C.none()):C.some(t)};function mp(t){return{getBookmark:h(Nc,t),moveToBookmark:h(Ac,t)}}(mp||(mp={})).isBookmarkNode=Rc;var hp=mp,pp=function(t,e,n){if(n.collapsed)return!1;if(ne.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(nn(r))return H(r.getClientRects(),function(n){return $a(n,t,e)})}return H(n.getClientRects(),function(n){return $a(n,t,e)})},gp={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(t){return t.shiftKey||t.ctrlKey||t.altKey||this.metaKeyPressed(t)},metaKeyPressed:function(t){return ne.mac?t.metaKey:t.ctrlKey&&!t.altKey}},vp=vn,bp=gn,yp=function(t,e){var r,o,i,a,u,s,c,l,f,d,m,h,p,g,v=e.dom,b=ae.each,y=e.getDoc(),x=n.document,w=Math.abs,C=Math.round,_=e.getBody(),k={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},S=function(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))},T=function(t){var n=t.target;(function(t,e){if("longpress"===t.type||0===t.type.indexOf("touch")){var n=t.touches[0];return S(t.target)&&!pp(n.clientX,n.clientY,e)}return S(t.target)&&!pp(t.clientX,t.clientY,e)})(t,e.selection.getRng())&&!t.isDefaultPrevented()&&e.selection.select(n)},O=function(t){return e.dom.is(t,"figure.image")?t.querySelector("img"):t},D=function(t){var n=fs(e);return!1!==n&&!ne.iOS&&("string"!=typeof n&&(n="table,img,figure.image,div"),"false"!==t.getAttribute("data-mce-resize")&&t!==e.getBody()&&ve(se.fromDom(t),n))},E=function(t,e,n){v.setStyles(O(t),{width:e,height:n})},N=function(t){var n,b,y,x;n=t.screenX-u,b=t.screenY-s,m=n*a[2]+c,h=b*a[3]+l,m=m<5?5:m,h=h<5?5:h,(S(r)&&!1!==e.getParam("resize_img_proportional",!0,"boolean")?!gp.modifierPressed(t):gp.modifierPressed(t))&&(w(n)>w(b)?(h=C(m*f),m=C(h/f)):(m=C(h/f),h=C(m*f))),E(o,m,h),y=(y=a.startPos.x+n)>0?y:0,x=(x=a.startPos.y+b)>0?x:0,v.setStyles(i,{left:y,top:x,display:"block"}),i.innerHTML=m+" &times; "+h,a[2]<0&&o.clientWidth<=m&&v.setStyle(o,"left",void 0+(c-m)),a[3]<0&&o.clientHeight<=h&&v.setStyle(o,"top",void 0+(l-h)),(n=_.scrollWidth-p)+(b=_.scrollHeight-g)!=0&&v.setStyles(i,{left:y-n,top:x-b}),d||(function(t,e,n,r){t.fire("ObjectResizeStart",{target:e,width:n,height:r})}(e,r,c,l),d=!0)},A=function t(){var n=d;d=!1;var a=function(t,n){n&&(r.style[t]||!e.schema.isValid(r.nodeName.toLowerCase(),t)?v.setStyle(O(r),t,n):v.setAttrib(O(r),t,""+n))};n&&(a("width",m),a("height",h)),v.unbind(y,"mousemove",N),v.unbind(y,"mouseup",t),x!==y&&(v.unbind(x,"mousemove",N),v.unbind(x,"mouseup",t)),v.remove(o),v.remove(i),R(r),n&&(function(t,e,n,r){t.fire("ObjectResized",{target:e,width:n,height:r})}(e,r,m,h),v.setAttrib(r,"style",v.getAttrib(r,"style"))),e.nodeChanged()},R=function(t){B(),M();var n=v.getPos(t,_),d=n.x,w=n.y,C=t.getBoundingClientRect(),S=C.width||C.right-C.left,T=C.height||C.bottom-C.top;r!==t&&(r=t,m=h=0);var R=e.fire("ObjectSelected",{target:t});D(t)&&!R.isDefaultPrevented()?b(k,function(t,e){var n;(n=v.get("mceResizeHandle"+e))&&v.remove(n),n=v.add(_,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===ne.ie&&(n.contentEditable=!1),v.bind(n,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),function(e){u=e.screenX,s=e.screenY,c=O(r).clientWidth,l=O(r).clientHeight,f=l/c,a=t,t.startPos={x:S*t[0]+d,y:T*t[1]+w},p=_.scrollWidth,g=_.scrollHeight,o=r.cloneNode(!0),v.addClass(o,"mce-clonedresizable"),v.setAttrib(o,"data-mce-bogus","all"),o.contentEditable=!1,o.unSelectabe=!0,v.setStyles(o,{left:d,top:w,margin:0}),E(o,S,T),o.removeAttribute("data-mce-selected"),_.appendChild(o),v.bind(y,"mousemove",N),v.bind(y,"mouseup",A),x!==y&&(v.bind(x,"mousemove",N),v.bind(x,"mouseup",A)),i=v.add(_,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},c+" &times; "+l)}(e)}),t.elm=n,v.setStyles(n,{left:S*t[0]+d-n.offsetWidth/2,top:T*t[1]+w-n.offsetHeight/2})}):B(),r.setAttribute("data-mce-selected","1")},B=function(){M(),r&&r.removeAttribute("data-mce-selected"),rt(k,function(t,e){var n=v.get("mceResizeHandle"+e);n&&(v.unbind(n),v.remove(n))})},I=function(n){var r,o=function(t,e){if(t)do{if(t===e)return!0}while(t=t.parentNode)};d||e.removed||(b(v.select("img[data-mce-selected],hr[data-mce-selected]"),function(t){t.removeAttribute("data-mce-selected")}),r="mousedown"===n.type?n.target:t.getNode(),o(r=v.$(r).closest("table,img,figure.image,hr")[0],_)&&(L(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?R(r):B())},P=function(t){return vp(function(t,e){for(;e&&e!==t;){if(bp(e)||vp(e))return e;e=e.parentNode}return null}(e.getBody(),t))},M=function(){rt(k,function(t){t.elm&&(v.unbind(t.elm),delete t.elm)})},L=function(){try{e.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(t){}};return e.on("init",function(){if(L(),ne.browser.isIE()||ne.browser.isEdge()){e.on("mousedown click",function(t){var n=t.target,r=n.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||P(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())});var t=function(t){var n=function(t){Ni.setEditorTimeout(e,function(){return e.selection.select(t)})};if(P(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))};v.bind(_,"mscontrolselect",t),e.on("remove",function(){return v.unbind(_,"mscontrolselect",t)})}var n=Ni.throttle(function(t){e.composing||I(t)});e.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",n),e.on("keyup compositionend",function(t){r&&"TABLE"===r.nodeName&&n(t)}),e.on("hide blur",B),e.on("contextmenu longpress",T,!0)}),e.on("remove",M),{isResizable:D,showResizeRect:R,hideResizeRect:B,updateResizeRect:I,destroy:function(){r=o=null}}},xp=function(t,e,n){if(t&&t.hasOwnProperty(e)){var r=U(t[e],function(t){return t!==n});0===r.length?delete t[e]:t[e]=r}},wp=function(t){return!!t.select},Cp=function(t){return!(!t||!t.ownerDocument)&&xe(se.fromDom(t.ownerDocument),se.fromDom(t))},_p=function(t,e,n,r){var o,i,a=function(t,e){var n,r;return{selectorChangedWithUnbind:function(o,i){return n||(n={},r={},e.on("NodeChange",function(e){var o=e.element,i=t.getParents(o,null,t.getRoot()),a={};ae.each(n,function(e,n){ae.each(i,function(o){if(t.is(o,n))return r[n]||(ae.each(e,function(t){t(!0,{node:o,selector:n,parents:i})}),r[n]=e),a[n]=e,!1})}),ae.each(r,function(t,e){a[e]||(delete r[e],ae.each(t,function(t){t(!1,{node:o,selector:e,parents:i})}))})})),n[o]||(n[o]=[]),n[o].push(i),{unbind:function(){xp(n,o,i),xp(r,o,i)}}}}}(t,r).selectorChangedWithUnbind,u=function(t,e){return function(t,e,n){void 0===n&&(n={});var r=function(t,e){return xt(xt({format:"html"},n),{set:!0,selection:!0,content:e})}(0,e);if(r.no_events||!(r=t.fire("BeforeSetContent",r)).isDefaultPrevented()){n.content=function(t,e){if("raw"!==e.format){var n=t.parser.parse(e.content,xt({isRootContent:!0,forced_root_block:!1},e));return Al({validate:t.validate},t.schema).serialize(n)}return e.content}(t,r);var o=t.selection.getRng();!function(t,e){var n=C.from(e.firstChild).map(se.fromDom),r=C.from(e.lastChild).map(se.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(Se).filter(me).bind(dp),i=r.bind(Te).filter(me).bind(dp);Ha(o,n.filter(me),function(t,e){!function(t,e){t.insertData(0,e)}(e.dom(),t.dom().data),Ue(t)}),Ha(i,r.filter(me),function(e,n){var r=n.dom().length;n.dom().appendData(e.dom().data),t.setEnd(n.dom(),r),Ue(e)}),t.collapse(!1)}(o,o.createContextualFragment(n.content)),t.selection.setRng(o),Kh(t,o),r.no_events||t.fire("SetContent",r)}else t.fire("SetContent",r)}(r,t,e)},s=function(t){var e=l();e.collapse(!!t),f(e)},c=function(){return e.getSelection?e.getSelection():e.document.selection},l=function(){var n,a,u,s=function(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}};if(!e)return null;var l=e.document;if(null==l)return null;if(void 0!==r.bookmark&&!1===yd(r)){var f=ld(r);if(f.isSome())return f.map(function(t){return vm(r,[t])[0]}).getOr(l.createRange())}try{(n=c())&&!en(n.anchorNode)&&(a=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():l.createRange())}catch(t){}return(a=vm(r,[a])[0])||(a=l.createRange?l.createRange():l.body.createTextRange()),a.setStart&&9===a.startContainer.nodeType&&a.collapsed&&(u=t.getRoot(),a.setStart(u,0),a.setEnd(u,0)),o&&i&&(0===s(a.START_TO_START,a,o)&&0===s(a.END_TO_END,a,o)?a=i:(o=null,i=null)),a},f=function(t,e){var n;if(function(t){return!!t&&(!!wp(t)||Cp(t.startContainer)&&Cp(t.endContainer))}(t)){var a=wp(t)?t:null;if(a){i=null;try{a.select()}catch(t){}}else{var u=c();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,u){i=t;try{u.removeAllRanges(),u.addRange(t)}catch(t){}!1===e&&u.extend&&(u.collapse(t.endContainer,t.endOffset),u.extend(t.startContainer,t.startOffset)),o=u.rangeCount>0?u.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!u.setBaseAndExtent||ne.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(u.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),u.anchorNode===t.startContainer&&u.focusNode===t.endContainer||u.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},d=function(){var e=c();if(!e||!e.anchorNode||!e.focusNode)return!0;var n=t.createRng();n.setStart(e.anchorNode,e.anchorOffset),n.collapse(!0);var r=t.createRng();return r.setStart(e.focusNode,e.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0},m={bookmarkManager:null,controlSelection:null,dom:t,win:e,serializer:n,editor:r,collapse:s,setCursorLocation:function(e,n){var o=t.createRng();e?(o.setStart(e,n),o.setEnd(e,n),f(o),s(!1)):(hl(t,o,r.getBody(),!0),f(o))},getContent:function(t){return function(t,e){return void 0===e&&(e={}),function(t,e,n){return Xm(t).selection.getContent(e,n)}(t,e.format?e.format:"html",e)}(r,t)},setContent:u,getBookmark:function(t,e){return h.getBookmark(t,e)},moveToBookmark:function(t){return h.moveToBookmark(t)},select:function(e,n){return function(t,e,n){return C.from(e).map(function(e){var r=t.nodeIndex(e),o=t.createRng();return o.setStart(e.parentNode,r),o.setEnd(e.parentNode,r+1),n&&(hl(t,o,e,!0),hl(t,o,e,!1)),o})}(t,e,n).each(f),e},isCollapsed:function(){var t=l(),e=c();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:d,setNode:function(e){return u(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){var n,r,o;if(!e)return t;r=e.startContainer,o=e.endContainer;var i=e.startOffset,a=e.endOffset;return n=e.commonAncestorContainer,!e.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?ep(r.nextSibling,!0):r.parentNode,o=0===a?ep(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),l())},getSel:c,setRng:f,getRng:l,getStart:function(t){return Zh(r.getBody(),l(),t)},getEnd:function(t){return tp(r.getBody(),l(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o,i=[],a=t.getRoot();if(n=t.getParent(n||Zh(a,e,e.collapsed),t.isBlock),r=t.getParent(r||tp(a,e,e.collapsed),t.isBlock),n&&n!==a&&i.push(n),n&&r&&n!==r){o=n;for(var u=new fi(n,a);(o=u.next())&&o!==r;)t.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==a&&i.push(r),i}(t,l(),e,n)},normalize:function(){var e=l(),n=c();if(!(ll(n).length>1)&&pl(r)){var o=fp(t,e);return o.each(function(t){f(t,d())}),o.getOr(e)}return e},selectorChanged:function(t,e){return a(t,e),m},selectorChangedWithUnbind:a,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){return function(t,e,n){(t.inline?function(t,e,n){return Uh(t,e,Yh,n)}:function(t,e,n){return Uh(t,e,Gh,n)})(t,e,n)}(r,t,e)},placeCaretAt:function(t,e){return f(Jh(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=l();return t.collapsed?Du.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=o=i=null,p.destroy()}},h=hp(m),p=yp(m,r);return m.bookmarkManager=h,m.controlSelection=p,m},kp=function(t,e){var n=Br();e.convert_fonts_to_spans&&function(t,e,n){t.addNodeFilter("font",function(t){V(t,function(t){var r=e.parse(t.attr("style")),o=t.attr("color"),i=t.attr("face"),a=t.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=n[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",e.serialize(r)),function(t,e){V(["color","face","size"],function(e){t.attr(e,null)})}(t)})})}(t,n,ae.explode(e.font_size_legacy_values)),function(t,e){t.addNodeFilter("strike",function(t){V(t,function(t){var n=e.parse(t.attr("style"));n["text-decoration"]="line-through",t.name="span",t.attr("style",e.serialize(n))})})}(t,n)},Sp=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},Tp=function(t,e){var r;try{r=n.atob(e)}catch(t){return C.none()}for(var o=new Uint8Array(r.length),i=0;i<o.length;i++)o[i]=r.charCodeAt(i);return C.some(new n.Blob([o],{type:t}))},Op=function(t){return 0===t.indexOf("blob:")?function(t){return new Ti(function(e,r){var o=function(){r("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var i=new n.XMLHttpRequest;i.open("GET",t,!0),i.responseType="blob",i.onload=function(){200===this.status?e(this.response):o()},i.onerror=o,i.send()}catch(t){o()}})}(t):0===t.indexOf("data:")?(e=t,new Ti(function(t){var r=Sp(e),o=r.type,i=r.data;Tp(o,i).fold(function(){return t(new n.Blob([]))},t)})):null;var e},Dp=0,Ep=function(t){return(t||"blobid")+Dp++},Np=function(t,e,r,o){var i,a;if(0!==e.src.indexOf("blob:")){var u=Sp(e.src),s=u.data,c=u.type;i=s,(a=t.getByData(i,c))?r({image:e,blobInfo:a}):Op(e.src).then(function(n){a=t.create(Ep(),n,i),t.add(a),r({image:e,blobInfo:a})},function(t){o(t)})}else(a=t.getByUri(e.src))?r({image:e,blobInfo:a}):Op(e.src).then(function(o){(function(t){return new Ti(function(e){var r=new n.FileReader;r.onloadend=function(){e(r.result)},r.readAsDataURL(t)})})(o).then(function(n){i=Sp(n).data,a=t.create(Ep(),o,i),t.add(a),r({image:e,blobInfo:a})})},function(t){o(t)})};var Ap=function(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new Dl("br",1)).shortEnded=!0:r.empty().append(new Dl("#text",3)).value=" "},Rp=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},Bp=function(t,e,n,r){return r.isEmpty(e,n,function(e){return function(t,e){var n=t.getElementRule(e.name);return n&&n.paddEmpty}(t,e)})},Ip=function(t,e){var r=e.blob_cache,o=function(t){var o=t.attr("src");(function(t){return t.attr("src")===ne.transparentSrc||t.attr("data-mce-placeholder")})(t)||function(t){return t.attr("data-mce-bogus")}(t)||function(t){var e=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(o);return e?C.some({type:e[1],data:decodeURIComponent(e[2])}):C.none()}().filter(function(){return function(t,e){if(e.images_dataimg_filter){var r=new n.Image;return r.src=t.attr("src"),rt(t.attributes.map,function(t,e){r.setAttribute(e,t)}),e.images_dataimg_filter(r)}return!0}(t,e)}).bind(function(t){var e=t.type,n=t.data;return C.from(r.getByData(n,e)).orThunk(function(){return Tp(e,n).map(function(t){var e=r.create(Ep(),t,n);return r.add(e),e})})}).each(function(e){t.attr("src",e.blobUri())})};r&&t.addAttributeFilter("src",function(t){return V(t,o)})},Pp=ae.makeMap,Mp=ae.each,Lp=ae.explode,Fp=ae.extend,Hp=function(t,e){void 0===e&&(e=hr());var n={},r=[],o={},i={};(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var a=function(t){var e,a,u;(a=t.name)in n&&((u=o[a])?u.push(t):o[a]=[t]),e=r.length;for(;e--;)(a=r[e].name)in t.attributes.map&&((u=i[a])?u.push(t):i[a]=[t]);return t},u={schema:e,addAttributeFilter:function(t,e){Mp(Lp(t),function(t){var n;for(n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})})},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){Mp(Lp(t),function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)})},getNodeFilters:function(){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push({name:e,callbacks:n[e]});return t},filterNode:a,parse:function(u,s){var c,l,f,d,m,h,p,g,v,b=[];s=s||{},o={},i={};var y=Fp(Pp("script,style,head,html,body,title,meta,param"),e.getBlockElements()),x=e.getNonEmptyElements(),w=e.children,C=t.validate,_=function(t){return!1===t?"":!0===t?"p":t}("forced_root_block"in s?s.forced_root_block:t.forced_root_block),k=e.getWhiteSpaceElements(),S=/^[ \t\r\n]+/,T=/[ \t\r\n]+$/,O=/[ \t\r\n]+/g,D=/^[ \t\r\n]+$/;g=k.hasOwnProperty(s.context)||k.hasOwnProperty(t.root_name);var E=function(t,e){var r,i=new Dl(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i},N=function(t){var n,r,o,i,a=e.getBlockElements();for(n=t.prev;n&&3===n.type;){if((o=n.value.replace(T,"")).length>0)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}},A=Ll({validate:C,allow_html_data_urls:t.allow_html_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e,n={};for(e in t)"li"!==e&&"p"!==e&&(n[e]=t[e]);return n}(e.getSelfClosingElements()),cdata:function(t){v.append(E("#cdata",4)).value=t},text:function(t,e){var n;g||(t=t.replace(O," "),function(t,e){return t&&(y[t.name]||"br"===t.name)}(v.lastChild)&&(t=t.replace(S,""))),0!==t.length&&((n=E("#text",3)).raw=!!e,v.append(n).value=t)},comment:function(t){v.append(E("#comment",8)).value=t},pi:function(t,e){v.append(E(t,7)).value=e,N(v)},doctype:function(t){v.append(E("#doctype",10)).value=t,N(v)},start:function(t,n,o){var a,u,s,c,l=C?e.getElementRule(t):{};if(l){for((a=E(l.outputName||t,1)).attributes=n,a.shortEnded=o,v.append(a),(c=w[v.name])&&w[a.name]&&!c[a.name]&&b.push(a),u=r.length;u--;)(s=r[u].name)in n.map&&((h=i[s])?h.push(a):i[s]=[a]);y[t]&&N(a),o||(v=a),!g&&k[t]&&(g=!0)}},end:function(n){var r,o,i,a,u=C?e.getElementRule(n):{};if(u){if(y[n]&&!g){if((r=v.firstChild)&&3===r.type)if((o=r.value.replace(S,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||D.test(o))&&(r.remove(),r=i),r=i;if((r=v.lastChild)&&3===r.type)if((o=r.value.replace(T,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||D.test(o))&&(r.remove(),r=i),r=i}if(g&&k[n]&&(g=!1),u.removeEmpty&&Bp(e,x,k,v))return a=v.parent,y[v.name]?v.empty().remove():v.unwrap(),void(v=a);u.paddEmpty&&(function(t){return Rp(t,"#text")&&" "===t.firstChild.value}(v)||Bp(e,x,k,v))&&Ap(t,s,y,v),v=v.parent}}},e),R=v=new Dl(s.context||t.root_name,11);if(A.parse(u,s.format),C&&b.length&&(s.context?s.invalid=!0:function(t){var n,r,o,i,u,s,c,l,f,d,m,h=Pp("tr,td,th,tbody,thead,tfoot,table"),p=e.getNonEmptyElements(),g=e.getWhiteSpaceElements(),v=e.getTextBlockElements(),b=e.getSpecialElements();for(n=0;n<t.length;n++)if((r=t[n]).parent&&!r.fixed)if(v[r.name]&&"li"===r.parent.name){for(d=r.next;d&&v[d.name];)d.name="li",d.fixed=!0,r.parent.insert(d,r.parent),d=d.next;r.unwrap(r)}else{for(i=[r],o=r.parent;o&&!e.isValidChild(o.name,r.name)&&!h[o.name];o=o.parent)i.push(o);if(o&&i.length>1){for(i.reverse(),u=s=a(i[0].clone()),f=0;f<i.length-1;f++){for(e.isValidChild(s.name,i[f].name)?(c=a(i[f].clone()),s.append(c)):c=s,l=i[f].firstChild;l&&l!==i[f+1];)m=l.next,c.append(l),l=m;s=c}Bp(e,p,g,u)?o.insert(r,i[0],!0):(o.insert(u,i[0],!0),o.insert(r,u)),o=i[0],(Bp(e,p,g,o)||Rp(o,"br"))&&o.empty().remove()}else if(r.parent){if("li"===r.name){if((d=r.prev)&&("ul"===d.name||"ul"===d.name)){d.append(r);continue}if((d=r.next)&&("ul"===d.name||"ul"===d.name)){d.insert(r,d.firstChild,!0);continue}r.wrap(a(new Dl("ul",1)));continue}e.isValidChild(r.parent.name,"div")&&e.isValidChild("div",r.name)?r.wrap(a(new Dl("div",1))):b[r.name]?r.empty().remove():r.unwrap()}}}(b)),_&&("body"===R.name||s.isRootContent)&&function(){var n,r,o=R.firstChild,i=function(t){t&&((o=t.firstChild)&&3===o.type&&(o.value=o.value.replace(S,"")),(o=t.lastChild)&&3===o.type&&(o.value=o.value.replace(T,"")))};if(e.isValidChild(R.name,_.toLowerCase())){for(;o;)n=o.next,3===o.type||1===o.type&&"p"!==o.name&&!y[o.name]&&!o.attr("data-mce-type")?(r||((r=E(_,1)).attr(t.forced_root_block_attrs),R.insert(r,o)),r.append(o)):(i(r),r=null),o=n;i(r)}}(),!s.invalid){for(p in o)if(o.hasOwnProperty(p)){for(h=n[p],d=(c=o[p]).length;d--;)c[d].parent||c.splice(d,1);for(l=0,f=h.length;l<f;l++)h[l](c,p,s)}for(l=0,f=r.length;l<f;l++)if((h=r[l]).name in i){for(d=(c=i[h.name]).length;d--;)c[d].parent||c.splice(d,1);for(d=0,m=h.callbacks.length;d<m;d++)h.callbacks[d](c,h.name,s)}}return R}};return function(t,e){var n=t.schema;e.remove_trailing_brs&&t.addNodeFilter("br",function(t,r,o){var i,a,u,s,c,l,f,d,m=t.length,h=ae.extend({},n.getBlockElements()),p=n.getNonEmptyElements(),g=n.getWhiteSpaceElements();for(h.body=1,i=0;i<m;i++)if(u=(a=t[i]).parent,h[a.parent.name]&&a===u.lastChild){for(c=a.prev;c;){if("span"!==(l=c.name)||"bookmark"!==c.attr("data-mce-type")){if("br"!==l)break;if("br"===l){a=null;break}}c=c.prev}a&&(a.remove(),Bp(n,p,g,u)&&(f=n.getElementRule(u.name))&&(f.removeEmpty?u.remove():f.paddEmpty&&Ap(e,o,h,u)))}else{for(s=a;u&&u.firstChild===s&&u.lastChild===s&&(s=u,!h[u.name]);)u=u.parent;s===u&&!0!==e.padd_empty_with_br&&((d=new Dl("#text",3)).value=" ",a.replace(d))}}),t.addAttributeFilter("href",function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(void 0,r=(n=i.attr("rel"))?ae.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter(function(t){return t.length>0}).concat(["noopener"]).sort().join(" ")))}}),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,e=o.lastChild;do{n=e.prev,r.insert(e,o),e=n}while(e)}}),e.fix_list_elements&&t.addNodeFilter("ul,ol",function(t){for(var e,n,r=t.length;r--;)if("ul"===(n=(e=t[r]).parent).name||"ol"===n.name)if(e.prev&&"li"===e.prev.name)e.prev.append(e);else{var o=new Dl("li",1);o.attr("style","list-style-type: none"),e.wrap(o)}}),e.validate&&n.getValidClasses()&&t.addAttributeFilter("class",function(t){for(var e,r,o,i,a,u,s,c=t.length,l=n.getValidClasses();c--;){for(r=(e=t[c]).attr("class").split(" "),a="",o=0;o<r.length;o++)i=r[o],s=!1,(u=l["*"])&&u[i]&&(s=!0),u=l[e.name],!s&&u&&u[i]&&(s=!0),s&&(a&&(a+=" "),a+=i);a.length||(a=null),e.attr("class",a)}}),Ip(t,e)}(u,t),function(t,e){e.inline_styles&&kp(t,e)}(u,t),u},jp=function(t,e,r){return function(t,e){return t&&t.hasEventListeners("PreProcess")&&!e.no_events}(t,r)?function(t,e,r){var o,i,a=t.dom;e=e.cloneNode(!0);var u=n.document.implementation;return u.createHTMLDocument&&(o=u.createHTMLDocument(""),ae.each("BODY"===e.nodeName?e.childNodes:[e],function(t){o.body.appendChild(o.importNode(t,!0))}),e="BODY"!==e.nodeName?o.body.firstChild:o.body,i=a.doc,a.doc=o),function(t,e){t.fire("PreProcess",e)}(t,xt(xt({},r),{node:e})),i&&(a.doc=i),e}(t,e,r):e},Vp=function(t,e,n){-1===ae.inArray(e,n)&&(t.addAttributeFilter(n,function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)}),e.push(n))},zp=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:Vi.DOM,o=e&&e.schema?e.schema:hr(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i=Hp(t,o);return function(t,e,n){t.addAttributeFilter("data-mce-tabindex",function(t,e){for(var n,r=t.length;r--;)(n=t[r]).attr("tabindex",n.attr("data-mce-tabindex")),n.attr(e,null)}),t.addAttributeFilter("src,href,style",function(t,r){for(var o,i,a=t.length,u="data-mce-"+r,s=e.url_converter,c=e.url_converter_scope;a--;)void 0!==(i=(o=t[a]).attr(u))?(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):s&&(i=s.call(c,i,r,o.name)),o.attr(r,i.length>0?i:null))}),t.addAttributeFilter("class",function(t){for(var e,n,r=t.length;r--;)(n=(e=t[r]).attr("class"))&&(n=e.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),e.attr("class",n.length>0?n:null))}),t.addAttributeFilter("data-mce-type",function(t,e,n){for(var r,o=t.length;o--;)"bookmark"!==(r=t[o]).attr("data-mce-type")||n.cleanup||(C.from(r.firstChild).exists(function(t){return!Sa(t.value)})?r.unwrap():r.remove())}),t.addNodeFilter("noscript",function(t){for(var e,n=t.length;n--;)(e=t[n].firstChild)&&(e.value=or.decode(e.value))}),t.addNodeFilter("script,style",function(t,n){for(var r,o,i,a=t.length,u=function(t){return t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};a--;)o=(r=t[a]).firstChild?r.firstChild.value:"","script"===n?((i=r.attr("type"))&&r.attr("type","mce-no/type"===i?null:i.replace(/^mce\-/,"")),"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="// <![CDATA[\n"+u(o)+"\n// ]]>")):"xhtml"===e.element_format&&o.length>0&&(r.firstChild.value="\x3c!--\n"+u(o)+"\n--\x3e")}),t.addNodeFilter("#comment",function(t){for(var r,o=t.length;o--;)r=t[o],e.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))}),t.addNodeFilter("xml:namespace,input",function(t,e){for(var n,r=t.length;r--;)7===(n=t[r]).type?n.remove():1===n.type&&("input"!==e||n.attr("type")||n.attr("type","text"))}),t.addAttributeFilter("data-mce-type",function(e){V(e,function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())})}),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})}(i,t,r),{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,a){void 0===a&&(a={});var u=xt({format:"html"},a),s=jp(e,n,u),c=function(t,e,n){var r=Ta(n.getInner?e.innerHTML:t.getOuterHTML(e));return n.selection||zn(se.fromDom(e))?r:ae.trim(r)}(r,s,u),l=function(t,e,n){var r=n.selection?xt({forced_root_block:!1},n):n,o=t.parse(e,r);return function(t){var e=function(t){return t&&"br"===t.name},n=o.lastChild;if(e(n)){var r=n.prev;e(r)&&(n.remove(),r.remove())}}(),o}(i,c,u);return"tree"===u.format?l:function(t,e,n,r,o){return function(t,e,n){return!e.no_events&&t?function(t,e){return t.fire("PostProcess",e)}(t,xt(xt({},e),{content:n})).content:n}(t,o,function(t,e,n){return Al(t,e).serialize(n)}(e,n,r))}(e,t,o,l,u)},addRules:function(t){o.addValidElements(t)},setRules:function(t){o.setValidElements(t)},addTempAttr:h(Vp,i,n),getTempAttrs:function(){return n},getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},Up=function(t,e){var n=zp(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}};function Wp(t,e){var r={},o=function(t,r,o,i){var a=new n.XMLHttpRequest;a.open("POST",e.url),a.withCredentials=e.credentials,a.upload.onprogress=function(t){i(t.loaded/t.total*100)},a.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+a.status)},a.onload=function(){if(a.status<200||a.status>=300)o("HTTP Error: "+a.status);else{var t,n,i=JSON.parse(a.responseText);i&&"string"==typeof i.location?r((t=e.basePath,n=i.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+a.responseText)}};var u=new n.FormData;u.append("file",t.blob(),t.filename()),a.send(u)},i=function(t,e){return{url:e,blobInfo:t,status:!0}},a=function(t,e){return{url:"",blobInfo:t,status:!1,error:e}},u=function(t,e){ae.each(r[t],function(t){t(e)}),delete r[t]},s=function(n,o){return n=ae.grep(n,function(e){return!t.isUploaded(e.blobUri())}),Ti.all(ae.map(n,function(n){return t.isPending(n.blobUri())?function(t){var e=n.blobUri();return new Ti(function(t){r[e]=r[e]||[],r[e].push(t)})}():function(e,n,r){return t.markPending(e.blobUri()),new Ti(function(o){var s;try{var c=function(){s&&s.close()};n(e,function(n){c(),t.markUploaded(e.blobUri(),n),u(e.blobUri(),i(e,n)),o(i(e,n))},function(n){c(),t.removeFailed(e.blobUri()),u(e.blobUri(),a(e,n)),o(a(e,n))},function(t){t<0||t>100||(s||(s=r()),s.progressBar.value(t))})}catch(t){o(a(e,t.message))}})}(n,e.handler,o)}))};return!1===R(e.handler)&&(e.handler=o),{upload:function(t,n){return e.url||e.handler!==o?s(t,n):new Ti(function(t){t([])})}}}var qp=0,$p=function(t){return t+qp+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+e()+e()+e());var e},Yp=function(t){var e,r,o,i,a,u=function(){var t=[],e=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e,r=t.id||$p("blobid"),o=t.name||r;return{id:d(r),name:d(o),filename:d(o+"."+(e=t.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[e.toLowerCase()]||"dat")),blob:d(t.blob),base64:d(t.base64),blobUri:d(t.blobUri||n.URL.createObjectURL(t.blob)),uri:d(t.uri)}},r=function(e){return $(t,e).getOrUndefined()},o=function(t){return r(function(e){return e.id()===t})};return{create:function(t,n,r,o){if(T(t))return e({id:t,name:o,blob:n,base64:r});if(O(t))return e(t);throw new Error("Unknown input type")},add:function(e){o(e.id())||t.push(e)},get:o,getByUri:function(t){return r(function(e){return e.blobUri()===t})},getByData:function(t,e){return r(function(n){return n.base64()===t&&n.blob().type===e})},findFirst:r,removeByUri:function(e){t=U(t,function(t){return t.blobUri()!==e||(n.URL.revokeObjectURL(t.blobUri()),!1)})},destroy:function(){V(t,function(t){n.URL.revokeObjectURL(t.blobUri())}),t=[]}}}(),s=(o={},i=function(t,e){return{status:t,resultUri:e}},{hasBlobUri:a=function(t){return t in o},getResultUri:function(t){var e=o[t];return e?e.resultUri:null},isPending:function(t){return!!a(t)&&1===o[t].status},isUploaded:function(t){return!!a(t)&&2===o[t].status},markPending:function(t){o[t]=i(1,null)},markUploaded:function(t,e){o[t]=i(2,e)},removeFailed:function(t){delete o[t]},destroy:function(){o={}}}),c=[],l=function(e){return function(n){return t.selection?e(n):[]}},f=function(t,e,n){var r=0;do{-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1)}while(-1!==r);return t},m=function(t,e,n){return t=f(t,'src="'+e+'"','src="'+n+'"'),f(t,'data-mce-src="'+e+'"','data-mce-src="'+n+'"')},h=function(e,n){V(t.undoManager.data,function(t){"fragmented"===t.type?t.fragments=j(t.fragments,function(t){return m(t,e,n)}):t.content=m(t.content,e,n)})},p=function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},g=function(n){return e||(e=Wp(s,{url:rs(t),basePath:os(t),credentials:is(t),handler:as(t)})),y().then(l(function(r){var o=j(r,function(t){return t.blobInfo});return e.upload(o,p).then(l(function(e){var o=j(e,function(e,n){var o=r[n].blobInfo,i=r[n].image;return e.status&&function(t){return t.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(u.removeByUri(i.src),function(e,n){var r,o=t.convertURL(n,"src");h(e.src,n),t.$(e).attr({src:es(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(i,e.url)):e.error&&function(t,e){Nh(t,Xi.translate(["Failed to upload image: {0}",e]))}(t,e.error),{element:i,status:e.status,uploadUri:e.url,blobInfo:o}});return n&&n(o),o}))}))},v=function(e){if(ts(t))return g(e)},b=function(e){return!1!==K(c,function(t){return t(e)})&&(0!==e.getAttribute("src").indexOf("data:")||function(t){return t.getParam("images_dataimg_filter",d(!0),"function")}(t)(e))},y=function(){return r||(r=function(t,e){var n={};return{findAll:function(r,o){o||(o=d(!0));var i=U(r?tt(r.getElementsByTagName("img")):[],function(e){var n=e.src;return!!ne.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!n||n===ne.transparentSrc)&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e))}),a=j(i,function(t){if(void 0!==n[t.src])return new Ti(function(e){n[t.src].then(function(n){if("string"==typeof n)return n;e({image:t,blobInfo:n.blobInfo})})});var r=new Ti(function(n,r){Np(e,t,n,r)}).then(function(t){return delete n[t.image.src],t}).catch(function(e){return delete n[t.src],e});return n[t.src]=r,r});return Ti.all(a)}}}(s,u)),r.findAll(t.getBody(),b).then(l(function(e){return e=U(e,function(e){return"string"!=typeof e||(Nh(t,e),!1)}),V(e,function(t){h(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")}),e}))},x=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var r=s.getResultUri(n);if(r)return'src="'+r+'"';var o=u.getByUri(n);return o||(o=q(t.editorManager.get(),function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)},null)),o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':e})};return t.on("SetContent",function(){ts(t)?v():y()}),t.on("RawSaveContent",function(t){t.content=x(t.content)}),t.on("GetContent",function(t){t.source_view||"raw"===t.format||(t.content=x(t.content))}),t.on("PostRender",function(){t.parser.addNodeFilter("img",function(t){V(t,function(t){var e=t.attr("src");if(!u.getByUri(e)){var n=s.getResultUri(e);n&&t.attr("src",n)}})})}),{blobCache:u,addFilter:function(t){c.push(t)},uploadImages:g,uploadImagesAuto:v,scanForImages:y,destroy:function(){u.destroy(),s.destroy(),r=e=null}}},Gp=function(t,e,n,r){return st(t,function(t,o){return!!ft(e,o)||(V(t,function(t){t(!1,{node:n,format:o,parents:r})}),!1)}).t},Kp=function(t,e,n,r,o){return null===e.get()&&function(t,e){var n=$i({});t.set({}),e.on("NodeChange",function(r){!function(t,e,n,r){var o=et(n.get()),i={},a={},u=U(Yc(t.dom,e),function(t){return 1===t.nodeType&&!t.getAttribute("data-mce-bogus")});rt(r,function(e,n){ae.each(u,function(r){return t.formatter.matchNode(r,n,{},e.similar)?(-1===o.indexOf(n)&&(V(e.callbacks,function(t){t(!0,{node:r,format:n,parents:u})}),i[n]=e.callbacks),a[n]=e.callbacks,!1):!Od(t,r,n)&&void 0})});var s=Gp(n.get(),a,e,u);n.set(xt(xt({},i),s))}(e,r.element,n,t.get())})}(e,t),function(t,e,n,r){var o=t.get();V(e.split(","),function(t){o[t]||(o[t]={similar:r,callbacks:[]}),o[t].callbacks.push(n)}),t.set(o)}(e,n,r,o),{unbind:function(){return function(t,e,n){var r=t.get();V(e.split(","),function(t){r[t].callbacks=U(r[t].callbacks,function(t){return t!==n}),0===r[t].callbacks.length&&delete r[t]}),t.set(r)}(e,n,r)}}};var Xp,Jp=ae.each,Qp=Vi.DOM,Zp=function(t,e){var n,r,o,i=e&&e.schema||hr({}),a=function(t){r="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e=Qp.create(r.name);return function(t,e){e.classes.length&&Qp.addClass(t,e.classes.join(" ")),Qp.setAttribs(t,e.attrs)}(e,r),e};return t&&t.length?(r=t[0],n=a(r),(o=Qp.create("div")).appendChild(function t(e,n,r){var o,u,s=n.length>0&&n[0],c=s&&s.name,l=function(t,e){var n="string"!=typeof t?t.nodeName.toLowerCase():t,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(e&&-1!==ae.inArray(o,e)?e:o[0])}(e,c);if(l)c===l?(u=n[0],n=n.slice(1)):u=l;else if(s)u=n[0],n=n.slice(1);else if(!r)return e;return u&&(o=a(u)).appendChild(e),r&&(o||(o=Qp.create("div")).appendChild(e),ae.each(r,function(t){var n=a(t);o.insertBefore(n,e)})),t(o,n,u&&u.siblings)}(n,t.slice(1),r.siblings)),o):""},tg=function(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=ae.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==ae.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=e||"div",n},eg=function(t,e){var n,r,o,i="",a=function(t){var e=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return T(e)?e:""}(t);if(""===a)return"";var u=function(t){return t.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var s=lt(e,"preview");if(s.is(!1))return"";a=s.getOr(a)}n=e.block||e.inline||"span";var c,l=(c=e.selector)&&"string"==typeof c?(c=(c=c.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),ae.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),function(t){var e=ae.map(t.split(/(?:~\+|~|\+)/),tg),n=e.pop();return e.length&&(n.siblings=e),n}).reverse()):[];l.length?(l[0].name||(l[0].name=n),n=e.selector,r=Zp(l,t)):r=Zp([n],t);var f=Qp.select(n,r)[0]||r.firstChild;return Jp(e.styles,function(t,e){(t=u(t))&&Qp.setStyle(f,e,t)}),Jp(e.attributes,function(t,e){(t=u(t))&&Qp.setAttrib(f,e,t)}),Jp(e.classes,function(t){t=u(t),Qp.hasClass(f,t)||Qp.addClass(f,t)}),t.fire("PreviewFormats"),Qp.setStyles(r,{position:"absolute",left:-65535}),t.getBody().appendChild(r),o=Qp.getStyle(t.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Jp(a.split(" "),function(e){var n=Qp.getStyle(f,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Qp.getStyle(t.getBody(),e,!0),"#ffffff"===Qp.toHex(n).toLowerCase())||"color"===e&&"#000000"===Qp.toHex(n).toLowerCase())){if("font-size"===e&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===e&&n&&(i+="padding:0 2px;"),i+=e+":"+n+";"}}),t.fire("AfterPreviewFormats"),Qp.remove(r),i},ng=function(t){var e=function(t){var e={},n=function t(n,r){n&&("string"!=typeof n?ae.each(n,function(e,n){t(n,e)}):(D(r)||(r=[r]),ae.each(r,function(t){void 0===t.deep&&(t.deep=!t.selector),void 0===t.split&&(t.split=!t.selector||t.inline),void 0===t.remove&&t.selector&&!t.inline&&(t.remove="none"),t.selector&&t.inline&&(t.mixed=!0,t.block_expand=!0),"string"==typeof t.classes&&(t.classes=t.classes.split(/\s+/))}),e[n]=r))};return n(function(t){var e={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",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",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]}],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(e,n,r){ae.each(r,function(n,r){t.setAttrib(e,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 ae.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(t){e[t]={block:t,remove:"all"}}),e}(t.dom)),n(function(t){return t.getParam("formats")}(t)),{get:function(t){return t?e[t]:e},has:function(t){return ft(e,t)},register:n,unregister:function(t){return t&&e[t]&&delete e[t],e}}}(t),n=$i(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),function(t){t.on("mouseup keydown",function(e){!function(t,e){var n=t.selection,r=t.getBody();jd(t,null,!1),8!==e&&46!==e||!n.isCollapsed()||"\ufeff"!==n.getStart().innerHTML||jd(t,_c(r,n.getStart())),37!==e&&39!==e||jd(t,_c(r,n.getStart()))}(t,e.keyCode)})}(t),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,n,r){!function(t,e,n,r){Xm(t).formatter.apply(e,n,r)}(t,e,n,r)},remove:function(e,n,r,o){!function(t,e,n,r,o){Xm(t).formatter.remove(e,n,r,o)}(t,e,n,r,o)},toggle:function(e,n,r){!function(t,e,n,r){Xm(t).formatter.toggle(e,n,r)}(t,e,n,r)},match:h(Rd,t),matchAll:h(Bd,t),matchNode:h(Ad,t),canApply:h(Id,t),formatChanged:h(Kp,t,n),getCssText:h(eg,t)}},rg=function(t){var e=$i(C.none()),n=$i(0),r=$i(0),o={data:[],typing:!1,beforeChange:function(){!function(t,e,n){Xm(t).undoManager.beforeChange(e,n)}(t,n,e)},add:function(i,a){return function(t,e,n,r,o,i,a){return Xm(t).undoManager.addUndoLevel(e,n,r,o,i,a)}(t,o,r,n,e,i,a)},undo:function(){return function(t,e,n,r){return Xm(t).undoManager.undo(e,n,r)}(t,o,n,r)},redo:function(){return function(t,e,n){return Xm(t).undoManager.redo(e,n)}(t,r,o.data)},clear:function(){!function(t,e,n){Xm(t).undoManager.clear(e,n)}(t,o,r)},reset:function(){!function(t,e){Xm(t).undoManager.reset(e)}(t,o)},hasUndo:function(){return function(t,e,n){return Xm(t).undoManager.hasUndo(e,n)}(t,o,r)},hasRedo:function(){return function(t,e,n){return Xm(t).undoManager.hasRedo(e,n)}(t,o,r)},transact:function(e){return function(t,e,n,r){return Xm(t).undoManager.transact(e,n,r)}(t,o,n,e)},ignore:function(e){!function(t,e,n){Xm(t).undoManager.ignore(e,n)}(t,n,e)},extra:function(e,n){!function(t,e,n,r,o){Xm(t).undoManager.extra(e,n,r,o)}(t,o,r,e,n)}};return Gm(t)||function(t,e,n){var r=$i(!1),o=function(t){Um(e,!1,n),e.add({},t)};t.on("init",function(){e.add()}),t.on("BeforeExecCommand",function(t){var r=t.command.toLowerCase();"undo"!==r&&"redo"!==r&&"mcerepaint"!==r&&(Wm(e,n),e.beforeChange())}),t.on("ExecCommand",function(t){var e=t.command.toLowerCase();"undo"!==e&&"redo"!==e&&"mcerepaint"!==e&&o(t)}),t.on("ObjectResizeStart cut",function(){e.beforeChange()}),t.on("SaveContent ObjectResized blur",o),t.on("dragend",o),t.on("keyup",function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),t.nodeChanged()),46!==i&&8!==i||t.nodeChanged(),r.get()&&e.typing&&!1===Vm(Lm(t),e.data[0])&&(!1===t.isDirty()&&(t.setDirty(!0),t.fire("change",{level:e.data[0],lastLevel:null})),t.fire("TypingUndo"),r.set(!1),t.nodeChanged()))}),t.on("keydown",function(t){var i=t.keyCode;if(!t.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)e.typing&&o(t);else{var a=t.ctrlKey&&!t.altKey||t.metaKey;!(i<16||i>20)||224===i||91===i||e.typing||a||(e.beforeChange(),Um(e,!0,n),e.add({},t),r.set(!0))}}),t.on("mousedown",function(t){e.typing&&o(t)}),t.on("input",function(t){t.inputType&&("insertReplacementText"===t.inputType||function(t){return"insertText"===t.inputType&&null===t.data}(t)||function(t){return"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType}(t))&&o(t)}),t.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||t.nodeChanged()})}(t,o,n),function(t){t.addShortcut("meta+z","","Undo"),t.addShortcut("meta+y,meta+shift+z","","Redo")}(t),o},og=[9,27,gp.HOME,gp.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,gp.DOWN,gp.UP,gp.LEFT,gp.RIGHT].concat(ne.browser.isFirefox()?[224]:[]),ig=function(t){return"keydown"===t.type||"keyup"===t.type},ag=function(t){var e=t.keyCode;return e===gp.BACKSPACE||e===gp.DELETE},ug=function(t){return void 0===t.touches||1!==t.touches.length?C.none():C.some(t.touches[0])},sg=function(t,e){return t.hasOwnProperty(e.nodeName)},cg=function(t,e){return!!fn(e)||!!nn(e)&&!sg(t,e)&&!Rc(e)},lg=function(t,e){if(fn(e)){if(0===e.nodeValue.length)return!0;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||sg(t,e.nextSibling)))return!0}return!1},fg=function(t){var e,n,r,o=t.dom,i=t.selection,a=t.schema,u=a.getBlockElements(),s=i.getStart(),c=t.getBody(),l=Qu(t);if(s&&nn(s)&&l){var f=c.nodeName.toLowerCase();if(a.isValidChild(f,l.toLowerCase())&&!function(t,e,n){return H(cf(se.fromDom(n),se.fromDom(e)),function(e){return sg(t,e.dom())})}(u,c,s)){var d=i.getRng(),m=d.startContainer,h=d.startOffset,p=d.endContainer,g=d.endOffset,v=yd(t);for(s=c.firstChild;s;)if(cg(u,s)){if(lg(u,s)){n=s,s=s.nextSibling,o.remove(n);continue}e||(e=o.create(l,Zu(t)),s.parentNode.insertBefore(e,s),r=!0),n=s,s=s.nextSibling,e.appendChild(n)}else e=null,s=s.nextSibling;r&&v&&(d.setStart(m,h),d.setEnd(p,g),i.setRng(d),t.nodeChanged())}}},dg=function(t,e,n){var r=t?1:-1;return e.setRng(Du(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0},mg=fn,hg=function(t){return mg(t)&&"\ufeff"===t.data[0]},pg=function(t){return mg(t)&&"\ufeff"===t.data[t.data.length-1]},gg=function(t){return t.ownerDocument.createTextNode("\ufeff")},vg=function(t,e){return t?function(t){if(mg(t.previousSibling))return pg(t.previousSibling)||t.previousSibling.appendData("\ufeff"),t.previousSibling;if(mg(t))return hg(t)||t.insertData(0,"\ufeff"),t;var e=gg(t);return t.parentNode.insertBefore(e,t),e}(e):function(t){if(mg(t.nextSibling))return hg(t.nextSibling)||t.nextSibling.insertData(0,"\ufeff"),t.nextSibling;if(mg(t))return pg(t)||t.appendData("\ufeff"),t;var e=gg(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e}(e)},bg=h(vg,!0),yg=h(vg,!1),xg=function(t,e){return fn(t.container())?vg(e,t.container()):vg(e,t.getNode())},wg=function(t,e){var n=e.get();return n&&t.container()===n&&Na(n)},Cg=function(t,e){return e.fold(function(e){Ss(t.get());var n=bg(e);return t.set(n),C.some(Du(n,n.length-1))},function(e){return xc(e).map(function(e){if(wg(e,t))return Du(t.get(),1);Ss(t.get());var n=xg(e,!0);return t.set(n),Du(n,1)})},function(e){return wc(e).map(function(e){if(wg(e,t))return Du(t.get(),t.get().length-1);Ss(t.get());var n=xg(e,!1);return t.set(n),Du(n,n.length-1)})},function(e){Ss(t.get());var n=yg(e);return t.set(n),C.some(Du(n,1))})},_g=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,kg=function(t,e){return ve(se.fromDom(e),function(t){return t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(t))},Sg=function(t,e,n){var r=function(t,e,n){return U(Vi.DOM.getParents(n.container(),"*",e),t)}(t,e,n);return C.from(r[r.length-1])},Tg=function(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?Na(n)?fn(n.nextSibling)?Du(n.nextSibling,0):Du.after(n):Ba(e)?Du(n,r+1):e:Na(n)?fn(n.previousSibling)?Du(n.previousSibling,n.previousSibling.data.length):Du.before(n):Ia(e)?Du(n,r-1):e},Og=h(Tg,!0),Dg=h(Tg,!1),Eg=function(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return C.none()},Ng=ki([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Ag=function(t,e){return Vs(e,t)||t},Rg=function(t,e,n){var r=Og(n),o=Ag(e,r.container());return Sg(t,o,r).fold(function(){return bc(o,r).bind(h(Sg,t,o)).map(function(t){return Ng.before(t)})},C.none)},Bg=function(t,e){return null===_c(t,e)},Ig=function(t,e,n){return Sg(t,e,n).filter(h(Bg,e))},Pg=function(t,e,n){var r=Dg(n);return Ig(t,e,r).bind(function(t){return yc(t,r).isNone()?C.some(Ng.start(t)):C.none()})},Mg=function(t,e,n){var r=Og(n);return Ig(t,e,r).bind(function(t){return bc(t,r).isNone()?C.some(Ng.end(t)):C.none()})},Lg=function(t,e,n){var r=Dg(n),o=Ag(e,r.container());return Sg(t,o,r).fold(function(){return yc(o,r).bind(h(Sg,t,o)).map(function(t){return Ng.after(t)})},C.none)},Fg=function(t){return!1===function(t){return"rtl"===Vi.DOM.getStyle(t,"direction",!0)||(e=t.textContent,_g.test(e));var e}(jg(t))},Hg=function(t,e,n){return Eg([Rg,Pg,Mg,Lg],[t,e,n]).filter(Fg)},jg=function(t){return t.fold(m,m,m,m)},Vg=function(t){return t.fold(d("before"),d("start"),d("end"),d("after"))},zg=function(t){return t.fold(Ng.before,Ng.before,Ng.after,Ng.after)},Ug=function(t){return t.fold(Ng.start,Ng.start,Ng.end,Ng.end)},Wg=function(t,e,n,r,o,i){return Ha(Sg(e,n,r),Sg(e,n,o),function(e,r){return e!==r&&function(t,e,n){var r=Vs(e,t),o=Vs(n,t);return r&&r===o}(n,e,r)?Ng.after(t?e:r):i}).getOr(i)},qg=function(t,e){return t.fold(d(!0),function(t){return r=e,!(Vg(n=t)===Vg(r)&&jg(n)===jg(r));var n,r})},$g=function(t,e){return t?e.fold(f(C.some,Ng.start),C.none,f(C.some,Ng.after),C.none):e.fold(C.none,f(C.some,Ng.before),C.none,f(C.some,Ng.end))},Yg=function(t,e,n,r){var o=Tg(t,r),i=Hg(e,n,o);return Hg(e,n,o).bind(h($g,t)).orThunk(function(){return function(t,e,n,r,o){var i=Tg(t,o);return pc(t,n,i).map(h(Tg,t)).fold(function(){return r.map(zg)},function(o){return Hg(e,n,o).map(h(Wg,t,e,n,i,o)).filter(h(qg,r))}).filter(Fg)}(t,e,n,i,r)})},Gg=(h(Yg,!1),h(Yg,!0),function(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)}),Kg=function(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")},Xg=function(t,e,n){return Cg(e,n).map(function(e){return Gg(t,e),n})},Jg=function(t,e,n){return function(){return!!ps(t)&&function(t,e,n){var r=t.getBody(),o=Du.fromRangeStart(t.selection.getRng()),i=h(kg,t);return Yg(n,i,r,o).bind(function(n){return Xg(t,e,n)})}(t,e,n).isSome()}},Qg=function(t,e,n){return function(){return!!ps(e)&&function(t,e){var n=e.selection.getRng(),r=t?Du.fromRangeEnd(n):Du.fromRangeStart(n);return!!R(e.selection.getSel().modify)&&(t&&Ba(r)?dg(!0,e.selection,r):!(t||!Ia(r))&&dg(!1,e.selection,r))}(t,e)}},Zg=function(t){var e=$i(null),n=h(kg,t);return t.on("NodeChange",function(r){!ps(t)||ne.browser.isIE()&&r.initial||(function(t,e,n){var r=j(ia(se.fromDom(e.getRoot()),'*[data-mce-selected="inline-boundary"]'),function(t){return t.dom()}),o=U(r,t),i=U(n,t);V(J(o,i),h(Kg,!1)),V(J(i,o),h(Kg,!0))}(n,t.dom,r.parents),function(t,e){if(t.selection.isCollapsed()&&!0!==t.composing&&e.get()){var n=Du.fromRangeStart(t.selection.getRng());Du.isTextPosition(n)&&!1===function(t){return Ba(t)||Ia(t)}(n)&&(Gg(t,ks(e.get(),n)),e.set(null))}}(t,e),function(t,e,n,r){if(e.selection.isCollapsed()){var o=U(r,t);V(o,function(r){var o=Du.fromRangeStart(e.selection.getRng());Hg(t,e.getBody(),o).bind(function(t){return Xg(e,n,t)})})}}(n,t,e,r.parents))}),e},tv=h(Qg,!0),ev=h(Qg,!1);!function(t){t[t.Br=0]="Br",t[t.Block=1]="Block",t[t.Wrap=2]="Wrap",t[t.Eol=3]="Eol"}(Xp||(Xp={}));var nv,rv=function(t,e){return t===Ou.Backwards?X(e):e},ov=function(t,e,n){return t===Ou.Forwards?e.next(n):e.prev(n)},iv=function(t,e,n,r){return pn(r.getNode(e===Ou.Forwards))?Xp.Br:!1===zs(n,r)?Xp.Block:Xp.Wrap},av=function(t,e,n,r){for(var o,i=fc(n),a=r,u=[];a&&(o=ov(e,i,a));){if(pn(o.getNode(!1)))return e===Ou.Forwards?{positions:rv(e,u).concat([o]),breakType:Xp.Br,breakAt:C.some(o)}:{positions:rv(e,u),breakType:Xp.Br,breakAt:C.some(o)};if(o.isVisible()){if(t(a,o)){var s=iv(0,e,a,o);return{positions:rv(e,u),breakType:s,breakAt:C.some(o)}}u.push(o),a=o}else a=o}return{positions:rv(e,u),breakType:Xp.Eol,breakAt:C.none()}},uv=function(t,e,n,r){return e(n,r).breakAt.map(function(r){var o=e(n,r).positions;return t===Ou.Backwards?o.concat(r):[r].concat(o)}).getOr([])},sv=function(t,e){return q(t,function(t,n){return t.fold(function(){return C.some(n)},function(r){return Ha(Q(r.getClientRects()),Q(n.getClientRects()),function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r}).or(t)})},C.none())},cv=function(t,e){return Q(e.getClientRects()).bind(function(e){return sv(t,e.left)})},lv=h(av,Tu.isAbove,-1),fv=h(av,Tu.isBelow,1),dv=h(uv,-1,lv),mv=h(uv,1,fv),hv=function(t){var e=function(e){return j(e,function(e){return(e=Va(e)).node=t,e})};if(nn(t))return e(t.getClientRects());if(fn(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}},pv=function(t){return G(t,hv)};!function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}(nv||(nv={}));var gv,vv,bv=function(t,e,n,r,o,i){var a=0,u=[],s=function(r){var i,s,l;for(l=pv([r]),-1===t&&(l=l.reverse()),i=0;i<l.length;i++)if(s=l[i],!n(s,c)){if(u.length>0&&e(s,yt(u))&&a++,s.line=a,o(s))return!0;u.push(s)}},c=yt(i.getClientRects());if(!c)return u;var l=i.getNode();return s(l),function(t,e,n,r){for(;r=js(r,t,uu,e);)if(n(r))return}(t,r,s,l),u},yv=h(bv,nv.Up,Wa,qa),xv=h(bv,nv.Down,qa,Wa),wv=function(t){return function(e){return function(t,e){return e.line>t}(t,e)}},Cv=function(t){return function(e){return function(t,e){return e.line===t}(t,e)}},_v=vn,kv=js,Sv=function(t,e){return Math.abs(t.left-e)},Tv=function(t,e){return Math.abs(t.right-e)},Ov=function(t,e){return t>=e.left&&t<=e.right},Dv=function(t,e){return t>=e.top&&t<=e.bottom},Ev=function(t,e){return vt(t,function(t,n){var r=Math.min(Sv(t,e),Tv(t,e)),o=Math.min(Sv(n,e),Tv(n,e));return Ov(e,n)?n:Ov(e,t)?t:o===r&&_v(n.node)||o<r?n:t})},Nv=function(t,e,n,r,o){var i=kv(r,t,uu,e,!o);do{if(!i||n(i))return}while(i=kv(i,t,uu,e))},Av=function(t,e,n){var r=pv(function(t){return U(tt(t.getElementsByTagName("*")),Ns)}(t)),o=U(r,h(Dv,n)),i=Ev(o,e);if(i){var a=!sn(i.node);if((i=Ev(function(t,e,n){void 0===n&&(n=!0);var r=[],o=function(t,n){var o=U(pv([n]),function(n){return!t(n,e)});return r=r.concat(o),0===o.length};return r.push(e),Nv(nv.Up,t,h(o,Wa),e.node,n),Nv(nv.Down,t,h(o,qa),e.node,n),r}(t,i,a),e))&&Ns(i.node))return function(t,e){return{node:t.node,before:Sv(t,e)<Tv(t,e)}}(i,e)}return null},Rv=gn,Bv=vn,Iv=function(t,e,n,r,o){return e._selectionOverrides.showCaret(t,n,r,o)},Pv=function(t,e){return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?null:function(t){var e=t.ownerDocument.createRange();return e.selectNode(t),e}(e)},Mv=function(t,e,n){var r=Ks(1,t.getBody(),e),o=Du.fromRangeStart(r),i=o.getNode();if(Bv(i))return Iv(1,t,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(Bv(a))return Iv(1,t,a,!1,!1);var u=t.dom.getParent(o.getNode(),function(t){return Bv(t)||Rv(t)});return Bv(u)?Iv(1,t,u,!1,n):null},Lv=function(t,e,n){return e&&e.collapsed&&Mv(t,e,n)||e},Fv=vn,Hv=Ya,jv=function(t,e,n){var r,o,i=fc(t.getBody()),a=h(Zs,i.next),u=h(Zs,i.prev);if(n.collapsed&&function(t){return""!==Qu(t)}(t)){if(!(r=t.dom.getParent(n.startContainer,"PRE")))return;(1===e?a(Du.fromRangeStart(n)):u(Du.fromRangeStart(n)))||(o=function(t){var e=t.dom.create(Qu(t));return(!ne.ie||ne.ie>=11)&&(e.innerHTML='<br data-mce-bogus="1">'),e}(t),1===e?t.$(r).after(o):t.$(r).before(o),t.selection.select(o,!0),t.selection.collapse())}},Vv=function(t,e){return function(){var n=function(t,e){var n,r=fc(t.getBody()),o=h(Zs,r.next),i=h(Zs,r.prev),a=e?Ou.Forwards:Ou.Backwards,u=e?o:i,s=t.selection.getRng();return(n=function(t,e,n,r){var o=t===Ou.Forwards,i=o?Zl:tf;if(!r.collapsed){var a=Hv(r);if(Fv(a))return Iv(t,e,a,t===Ou.Backwards,!0)}var u=Ea(r.startContainer),s=Js(t,e.getBody(),r);if(i(s))return Pv(e,s.getNode(!o));var c=Tg(o,n(s));if(!c)return u?r:null;if(i(c))return Iv(t,e,c.getNode(!o),o,!0);var l=n(c);return l&&i(l)&&tc(c,l)?Iv(t,e,l.getNode(!o),o,!0):u?Lv(e,c.toRange(),!0):null}(a,t,u,s))?n:(n=jv(t,a,s))||null}(t,e);return!!n&&(t.selection.setRng(n),!0)}},zv=function(t,e){return function(){var n=function(t,e){var n,r=e?1:-1,o=e?xv:yv,i=t.selection.getRng();return(n=function(t,e,n,r){var o,i,a,u;u=Hv(r);var s=Js(t,e.getBody(),r),c=n(e.getBody(),wv(1),s),l=U(c,Cv(1)),f=yt(s.getClientRects());if((Zl(s)||Jl(s))&&(u=s.getNode()),(tf(s)||Ql(s))&&(u=s.getNode(!0)),!f)return null;var d=f.left;if((o=Ev(l,d))&&Fv(o.node))return i=Math.abs(d-o.left),a=Math.abs(d-o.right),Iv(t,e,o.node,i<a,!0);if(u){var m=function(t,e,n,r){var o,i,a,u,s,c=fc(e),l=[],f=0,d=function(t){return yt(t.getClientRects())};1===t?(o=c.next,i=qa,a=Wa,u=Du.after(r)):(o=c.prev,i=Wa,a=qa,u=Du.before(r));var m=d(u);do{if(u.isVisible()&&!a(s=d(u),m)){if(l.length>0&&i(s,yt(l))&&f++,(s=Va(s)).position=u,s.line=f,n(s))return l;l.push(s)}}while(u=o(u));return l}(t,e.getBody(),wv(1),u);if(o=Ev(U(m,Cv(1)),d))return Lv(e,o.position.toRange(),!0);if(o=yt(U(m,Cv(0))))return Lv(e,o.position.toRange(),!0)}}(r,t,o,i))?n:(n=jv(t,r,i))||null}(t,e);return!!n&&(t.selection.setRng(n),!0)}},Uv=function(t,e){return function(){var n=e?Du.fromRangeEnd(t.selection.getRng()):Du.fromRangeStart(t.selection.getRng()),r=e?fv(t.getBody(),n):lv(t.getBody(),n);return(e?Z(r.positions):Q(r.positions)).filter(function(t){return function(e){return t?tf(e):Zl(e)}}(e)).fold(d(!1),function(e){return t.selection.setRng(e.toRange()),!0})}},Wv=function(t,e,n,r,o){var i=ia(se.fromDom(n),"td,th,caption").map(function(t){return t.dom()});return function(t,e,n){return q(t,function(t,r){return t.fold(function(){return C.some(r)},function(t){var o=Math.sqrt(Math.abs(t.x-e)+Math.abs(t.y-n)),i=Math.sqrt(Math.abs(r.x-e)+Math.abs(r.y-n));return C.some(i<o?r:t)})},C.none())}(U(function(t,e){return G(i,function(e){var n=function(t,e){return{left:t.left-e,top:t.top-e,right:t.right+-2,bottom:t.bottom+-2,width:t.width+e,height:t.height+e}}(Va(e.getBoundingClientRect()),-1);return[{x:n.left,y:t(n),cell:e},{x:n.right,y:t(n),cell:e}]})}(t),function(t){return e(t,o)}),r,o).map(function(t){return t.cell})},qv=h(Wv,function(t){return t.bottom},function(t,e){return t.y<e}),$v=h(Wv,function(t){return t.top},function(t,e){return t.y>e}),Yv=function(t,e){t.selection.setRng(e),Kh(t,e)},Gv=function(t,e,n){var r=t(e,n);return function(t){return t.breakType===Xp.Wrap&&0===t.positions.length}(r)||!pn(n.getNode())&&function(t){return t.breakType===Xp.Br&&1===t.positions.length}(r)?!function(t,e,n){return r.breakAt.map(function(n){return t(e,n).breakAt.isSome()}).getOr(!1)}(t,e):r.breakAt.isNone()},Kv=h(Gv,lv),Xv=h(Gv,fv),Jv=function(t,e,n){var r=function(t,e){var n=e.getNode(t);return nn(n)&&"TABLE"===n.nodeName?C.some(n):C.none()}(!!e,n),o=!1===e;r.fold(function(){return Yv(t,n.toRange())},function(r){return vc(o,t.getBody()).filter(function(t){return t.isEqual(n)}).fold(function(){return Yv(t,n.toRange())},function(o){return function(t,e,n,r){var o=Qu(e);o?e.undoManager.transact(function(){var r=se.fromTag(o);wn(r,Zu(e)),je(r,se.fromTag("br")),t?Fe(se.fromDom(n),r):Le(se.fromDom(n),r);var i=e.dom.createRng();i.setStart(r.dom(),0),i.setEnd(r.dom(),0),Yv(e,i)}):Yv(e,r.toRange())}(e,t,r,n)})})},Qv=function(t,e,n,r){var o=t.selection.getRng(),i=Du.fromRangeStart(o),a=t.getBody();if(!e&&Kv(r,i)){var u=function(t,e,n){return function(t,e){return Q(e.getClientRects()).bind(function(e){return qv(t,e.left,e.top)}).bind(function(t){return cv(wc(n=t).map(function(t){return lv(n,t).positions.concat(t)}).getOr([]),e);var n})}(e,n).orThunk(function(){return Q(n.getClientRects()).bind(function(n){return sv(dv(t,Du.before(e)),n.left)})}).getOr(Du.before(e))}(a,n,i);return Jv(t,e,u),!0}return!(!e||!Xv(r,i))&&(u=function(t,e,n){return function(t,e){return Z(e.getClientRects()).bind(function(e){return $v(t,e.left,e.top)}).bind(function(t){return cv(xc(n=t).map(function(t){return[t].concat(fv(n,t).positions)}).getOr([]),e);var n})}(e,n).orThunk(function(){return Q(n.getClientRects()).bind(function(n){return sv(mv(t,Du.after(e)),n.left)})}).getOr(Du.after(e))}(a,n,i),Jv(t,e,u),!0)},Zv=function(t,e){return function(){return C.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(n){return C.from(t.dom.getParent(n,"table")).map(function(n){return function(t,e,n,r){var o=t.selection.getRng(),i=e?1:-1;if(Es()&&function(t,e,n){var r=Du.fromRangeStart(e);return vc(!t,n).map(function(t){return t.isEqual(r)}).getOr(!1)}(e,o,n)){var a=Iv(i,t,n,!e,!0);return Yv(t,a),!0}return!1}(t,e,n)})}).getOr(!1)}},tb=function(t,e){return function(){return C.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(n){return C.from(t.dom.getParent(n,"table")).map(function(r){return Qv(t,e,r,n)})}).getOr(!1)}},eb=function(t){return F(["figcaption"],ce(t))},nb=function(t){var e=n.document.createRange();return e.setStartBefore(t.dom()),e.setEndBefore(t.dom()),e},rb=function(t,e,n){n?je(t,e):He(t,e)},ob=function(t,e){var n=se.fromDom(t.getBody()),r=Du.fromRangeStart(t.selection.getRng()),o=Qu(t),i=Zu(t);return function(t,e){var n=h(ye,e);return sa(se.fromDom(t.container()),Bn,n).filter(eb)}(r,n).exists(function(){if(function(t,e,n){return e?function(t,e){return fv(t,n).breakAt.isNone()}(t.dom()):function(t,e){return lv(t,n).breakAt.isNone()}(t.dom())}(n,e,r)){var a=function(t,e,n,r){return""===e?function(t,e){var n=se.fromTag("br");return rb(t,n,e),nb(n)}(t,r):function(t,e,n,r){var o=se.fromTag(n),i=se.fromTag("br");return wn(o,r),je(o,i),rb(t,o,e),nb(i)}(t,r,e,n)}(n,o,i,e);return t.selection.setRng(a),!0}return!1})},ib=function(t,e){return function(){return!!t.selection.isCollapsed()&&ob(t,e)}},ab=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}},ub=function(t,e){return $(function(t,e){return G(function(t){return j(t,function(t){return xt({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:l},t)})}(t),function(t){return function(t,e){return e.keyCode===t.keyCode&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.ctrlKey===t.ctrlKey&&e.metaKey===t.metaKey}(t,e)?[t]:[]})}(t,e),function(t){return t.action()})},sb=function(t,e){return xe(t,e)?sa(e,function(t){return Mn(t)||Fn(t)},function(t){return function(e){return ye(t,se.fromDom(e.dom().parentNode))}}(t)):C.none()},cb=function(t){t.dom.isEmpty(t.getBody())&&(t.setContent(""),function(t){var e=t.getBody(),n=e.firstChild&&t.dom.isBlock(e.firstChild)?e.firstChild:e;t.selection.setCursorLocation(n,0)}(t))},lb=function(t,e){return{from:t,to:e}},fb=function(t,e){var n=se.fromDom(t),r=se.fromDom(e.container());return sb(n,r).map(function(t){return function(t,e){return{block:t,position:e}}(t,e)})},db=function(t){var e=function(t){var e=Ee(t);return Y(e,Bn).fold(function(){return e},function(t){return e.slice(0,t)})}(t);return V(e,Ue),e},mb=function(t,e){var n=lf(e,t);return $(n.reverse(),function(t){return af(t)}).each(Ue)},hb=function(t,e,n,r){if(af(n))return uf(n),xc(n.dom());0===U(Oe(r),function(t){return!af(t)}).length&&af(e)&&Le(r,se.fromTag("br"));var o=yc(n.dom(),Du.before(r.dom()));return V(db(e),function(t){Le(r,t)}),mb(t,e),o},pb=function(t,e,n){if(af(n))return Ue(n),af(e)&&uf(e),xc(e.dom());var r=wc(n.dom());return V(db(e),function(t){je(n,t)}),mb(t,e),r},gb=function(t,e){vc(t,e.dom()).map(function(t){return t.getNode()}).map(se.fromDom).filter(Pn).each(Ue)},vb=function(t,e,n){return gb(!0,e),gb(!1,n),function(t,e){return xe(e,t)?function(t,e){var n=lf(e,t);return C.from(n[n.length-1])}(e,t):C.none()}(e,n).fold(h(pb,t,e,n),h(hb,t,e,n))},bb=function(t,e,n,r){return e?vb(t,r,n):vb(t,n,r)},yb=function(t,e){var n=se.fromDom(t.getBody()),r=function(t,e,n){return n.collapsed?function(t,e,n){var r=fb(t,Du.fromRangeStart(n)),o=r.bind(function(n){return pc(e,t,n.position).bind(function(n){return fb(t,n).map(function(n){return function(t,e,n){return pn(n.position.getNode())&&!1===af(n.block)?vc(!1,n.block.dom()).bind(function(r){return r.isEqual(n.position)?pc(e,t,r).bind(function(e){return fb(t,e)}):C.some(n)}).getOr(n):n}(t,e,n)})})});return Ha(r,o,lb).filter(function(t){return function(t){return!1===ye(t.from.block,t.to.block)}(t)&&function(t){return ke(t.from.block).bind(function(e){return ke(t.to.block).filter(function(t){return ye(e,t)})}).isSome()}(t)&&function(t){return!1===vn(t.from.block.dom())&&!1===vn(t.to.block.dom())}(t)})}(t,e,n):C.none()}(n.dom(),e,t.selection.getRng()).bind(function(t){return bb(n,e,t.from.block,t.to.block)});return r.each(function(e){t.selection.setRng(e.toRange())}),r.isSome()},xb=function(t,e){var n=se.fromDom(e),r=h(ye,t);return ua(n,Vn,r).isSome()},wb=function(t){var e=se.fromDom(t.getBody());return function(t,e){var n=yc(t.dom(),Du.fromRangeStart(e)).isNone(),r=bc(t.dom(),Du.fromRangeEnd(e)).isNone();return!function(t,e){return xb(t,e.startContainer)||xb(t,e.endContainer)}(t,e)&&n&&r}(e,t.selection.getRng())?function(t){return t.setContent(""),t.selection.setCursorLocation(),!0}(t):function(t,e){var n=e.getRng();return Ha(sb(t,se.fromDom(n.startContainer)),sb(t,se.fromDom(n.endContainer)),function(r,o){return!1===ye(r,o)&&(n.deleteContents(),bb(t,!0,r,o).each(function(t){e.setRng(t.toRange())}),!0)}).getOr(!1)}(e,t.selection)},Cb=function(t,e){return!t.selection.isCollapsed()&&wb(t)},_b=function(t){return Qs(t).exists(Pn)},kb=function(t,e,n){var r=U(lf(se.fromDom(n.container()),e),Bn),o=Q(r).getOr(e);return pc(t,o.dom(),n).filter(_b)},Sb=function(t,e){return Qs(e).exists(Pn)||kb(!0,t,e).isSome()},Tb=function(t,e){return function(t){return C.from(t.getNode(!0)).map(se.fromDom)}(e).exists(Pn)||kb(!1,t,e).isSome()},Ob=h(kb,!1),Db=h(kb,!0),Eb=ki([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Nb=function(t,e,n){return pc(e,t,n).bind(function(r){return o=r.getNode(),Vn(se.fromDom(o))||Fn(se.fromDom(o))||function(t,e,n,r){var o=function(e){return In(se.fromDom(e))&&!zs(n,r,t)};return Xs(!e,n).fold(function(){return Xs(e,r).fold(d(!1),o)},o)}(t,e,n,r)?C.none():e&&vn(r.getNode())||!1===e&&vn(r.getNode(!0))?function(t,e,n,r){var o=r.getNode(!1===e);return sb(se.fromDom(t),se.fromDom(n.getNode())).map(function(t){return af(t)?Eb.remove(t.dom()):Eb.moveToElement(o)}).orThunk(function(){return C.some(Eb.moveToElement(o))})}(t,e,n,r):e&&tf(n)||!1===e&&Zl(n)?C.some(Eb.moveToPosition(r)):C.none();var o})},Ab=function(t,e){return C.from(Bb(t.getBody(),e))},Rb=function(t,e){var n=t.selection.getNode();return Ab(t,n).filter(vn).fold(function(){return function(t,e,n){var r=Ks(e?1:-1,t,n),o=Du.fromRangeStart(r),i=se.fromDom(t);return!1===e&&tf(o)?C.some(Eb.remove(o.getNode(!0))):e&&Zl(o)?C.some(Eb.remove(o.getNode())):!1===e&&Zl(o)&&Tb(i,o)?Ob(i,o).map(function(t){return Eb.remove(t.getNode())}):e&&tf(o)&&Sb(i,o)?Db(i,o).map(function(t){return Eb.remove(t.getNode())}):function(t,e,n){return function(t,e){var n=e.getNode(!1===t),r=t?"after":"before";return nn(n)&&n.getAttribute("data-mce-caret")===r}(e,n)?function(t,e){return t&&vn(e.nextSibling)?C.some(Eb.moveToElement(e.nextSibling)):!1===t&&vn(e.previousSibling)?C.some(Eb.moveToElement(e.previousSibling)):C.none()}(e,n.getNode(!1===e)).fold(function(){return Nb(t,e,n)},C.some):Nb(t,e,n).bind(function(e){return function(t,e,n){return n.fold(function(t){return C.some(Eb.remove(t))},function(t){return C.some(Eb.moveToElement(t))},function(n){return zs(e,n,t)?C.none():C.some(Eb.moveToPosition(n))})}(t,n,e)})}(t,e,o)}(t.getBody(),e,t.selection.getRng()).map(function(n){return n.fold(function(t,e){return function(n){return t._selectionOverrides.hideFakeCaret(),xf(t,e,se.fromDom(n)),!0}}(t,e),function(t,e){return function(n){var r=e?Du.before(n):Du.after(n);return t.selection.setRng(r.toRange()),!0}}(t,e),function(t){return function(e){return t.selection.setRng(e.toRange()),!0}}(t))}).getOr(!1)},function(){return!0})},Bb=function(t,e){for(;e&&e!==t;){if(gn(e)||vn(e))return e;e=e.parentNode}return null},Ib=function(t){var e,n=Bb(t.getBody(),t.selection.getNode());return gn(n)&&t.dom.isBlock(n)&&t.dom.isEmpty(n)&&(e=t.dom.create("br",{"data-mce-bogus":"1"}),t.dom.setHTML(n,""),n.appendChild(e),t.selection.setRng(Du.before(e).toRange())),!0},Pb=function(t,e){return t.selection.isCollapsed()?Rb(t,e):function(t,e){var n=t.selection.getNode();return!!vn(n)&&Ab(t,n.parentNode).filter(vn).fold(function(){var n;return n=se.fromDom(t.getBody()),V(ia(n,".mce-offscreen-selection"),Ue),xf(t,e,se.fromDom(t.selection.getNode())),cb(t),!0},function(){return!0})}(t,e)},Mb=function(t,e,n,r,o,i){var a=Iv(r,t,i.getNode(!o),o,!0);if(e.collapsed){var u=e.cloneRange();o?u.setEnd(a.startContainer,a.startOffset):u.setStart(a.endContainer,a.endOffset),u.deleteContents()}else e.deleteContents();return t.selection.setRng(a),function(t,e){fn(e)&&0===e.data.length&&t.remove(e)}(t.dom,n),!0},Lb=function(t,e){return function(t,e){var n=t.selection.getRng();if(!fn(n.commonAncestorContainer))return!1;var r=e?Ou.Forwards:Ou.Backwards,o=fc(t.getBody()),i=h(Zs,o.next),a=h(Zs,o.prev),u=e?i:a,s=e?Zl:tf,c=Js(r,t.getBody(),n),l=Tg(e,u(c));if(!l||!tc(c,l))return!1;if(s(l))return Mb(t,n,c.getNode(),r,e,l);var f=u(l);return!!(f&&s(f)&&tc(l,f))&&Mb(t,n,c.getNode(),r,e,f)}(t,e)},Fb=function(t,e){return function(n){return Cg(e,n).map(function(e){return Gg(t,e),!0}).getOr(!1)}},Hb=function(t,e,r,o){var i=t.getBody(),a=h(kg,t);t.undoManager.ignore(function(){t.selection.setRng(function(t,e){var r=n.document.createRange();return r.setStart(t.container(),t.offset()),r.setEnd(e.container(),e.offset()),r}(r,o)),t.execCommand("Delete"),Hg(a,i,Du.fromRangeStart(t.selection.getRng())).map(Ug).map(Fb(t,e))}),t.nodeChanged()},jb=function(t,e,n){if(t.selection.isCollapsed()&&ps(t)){var r=Du.fromRangeStart(t.selection.getRng());return function(t,e,n,r){var o=function(t,e){return Vs(e,t)||t}(t.getBody(),r.container()),i=h(kg,t),a=Hg(i,o,r);return a.bind(function(t){return n?t.fold(d(C.some(Ug(t))),C.none,d(C.some(zg(t))),C.none):t.fold(C.none,d(C.some(zg(t))),C.none,d(C.some(Ug(t))))}).map(Fb(t,e)).getOrThunk(function(){var u=gc(n,o,r),s=u.bind(function(t){return Hg(i,o,t)});return a.isSome()&&s.isSome()?Sg(i,o,r).map(function(e){return!!function(t){return Ha(xc(t),wc(t),function(e,n){var r=Tg(!0,e),o=Tg(!1,n);return bc(t,r).map(function(t){return t.isEqual(o)}).getOr(!0)}).getOr(!0)}(e)&&(xf(t,n,se.fromDom(e)),!0)}).getOr(!1):s.bind(function(o){return u.map(function(o){return n?Hb(t,e,r,o):Hb(t,e,o,r),!0})}).getOr(!1)})}(t,e,n,r)}return!1},Vb=function(t){return 1===Ee(t).length},zb=function(t,e){var n=se.fromDom(t.getBody()),r=se.fromDom(t.selection.getStart()),o=U(function(t,e){var n=lf(r,t);return Y(n,Bn).fold(d(n),function(t){return n.slice(0,t)})}(n),Vb);return Z(o).map(function(n){var r,i=Du.fromRangeStart(t.selection.getRng());return!(!function(t,e,n){return Ha(xc(n),wc(n),function(r,o){var i=Tg(!0,r),a=Tg(!1,o),u=Tg(!1,e);return t?bc(n,u).map(function(t){return t.isEqual(a)&&e.isEqual(i)}).getOr(!1):yc(n,u).map(function(t){return t.isEqual(i)&&e.isEqual(a)}).getOr(!1)}).getOr(!0)}(e,i,n.dom())||(r=n,Cc(r.dom())&&Md(r.dom()))||(function(t,e,n,r){var o=h(Wd,e),i=j(U(r,o),function(t){return t.dom()});if(0===i.length)xf(e,t,n);else{var a=function(t,e){var n=Fd(!1),r=zd(e,n.dom());return Le(se.fromDom(t),n),Ue(se.fromDom(t)),Du(r,0)}(n.dom(),i);e.selection.setRng(a.toRange())}}(e,t,n,o),0))}).getOr(!1)},Ub=function(t,e){return!!t.selection.isCollapsed()&&zb(t,e)},Wb=function(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=Du.fromRangeStart(t.selection.getRng());return pc(e,t.getBody(),n).filter(function(t){return e?Kl(t):Xl(t)}).bind(function(t){return C.from(Us(e?0:-1,t))}).map(function(e){return t.selection.select(e),!0}).getOr(!1)}(t,e)},qb=function(t){var e=parseInt(t,10);return isNaN(e)?0:e},$b=function(t,e){return(t||"table"===ce(e)?"margin":"padding")+("rtl"===kn(e,"direction")?"-right":"-left")},Yb=function(t){var e=Kb(t);return!t.mode.isReadOnly()&&(e.length>1||function(t,e){return K(e,function(e){var n=$b(ls(t),e),r=Tn(e,n).map(qb).getOr(0);return"false"!==t.dom.getContentEditable(e.dom())&&r>0})}(t,e))},Gb=function(t){return Ln(t)||Fn(t)},Kb=function(t){return U(j(t.selection.getSelectedBlocks(),se.fromDom),function(t){return!Gb(t)&&!function(t){return ke(t).map(Gb).getOr(!1)}(t)&&sa(t,function(t){return gn(t.dom())||vn(t.dom())}).exists(function(t){return gn(t.dom())})})},Xb=function(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=function(t){return t.getParam("indentation","40px","string")}(t),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),s=ls(t),c=Qu(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==c||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),V(Kb(t),function(t){!function(t,e,n,r,o,i){var a=$b(n,se.fromDom(i));if("outdent"===e){var u=Math.max(0,qb(i.style[a])-r);t.setStyle(i,a,u?u+o:"")}else u=qb(i.style[a])+r+o,t.setStyle(i,a,u)}(n,e,s,u,a,t.dom())})},Jb=function(t,e,n){return function t(e,n,r,o){return gc(e,n,r).bind(function(r){return o(r)?t(e,n,r,o):C.some(r)})}(t,e,n,ql)},Qb=function(t,e){return $(lf(se.fromDom(e.container()),t),Bn)},Zb=function(t,e,n){return Jb(t,e.dom(),n).forall(function(t){return Qb(e,n).fold(function(){return!1===zs(t,n,e.dom())},function(r){return!1===zs(t,n,e.dom())&&xe(r,se.fromDom(t.container()))})})},ty=function(t,e,n){return Qb(e,n).fold(function(){return Jb(t,e.dom(),n).forall(function(t){return!1===zs(t,n,e.dom())})},function(e){return Jb(t,e.dom(),n).isNone()})},ey=h(ty,!1),ny=h(ty,!0),ry=h(Zb,!1),oy=h(Zb,!0),iy=function(t,e,n){if(t.selection.isCollapsed()&&Yb(t)){var r=t.dom,o=t.selection.getRng(),i=Du.fromRangeStart(o),a=r.getParent(o.startContainer,r.isBlock);if(null!==a&&ey(se.fromDom(a),i))return Xb(t,"outdent"),!0}return!1},ay=function(t,e){var n,r=e,o=t.dom,i=t.schema.getMoveCaretBeforeOnEnterElements();if(e){if(/^(LI|DT|DD)$/.test(e.nodeName)){var a=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild);a&&/^(UL|OL|DL)$/.test(a.nodeName)&&e.insertBefore(o.doc.createTextNode(" "),e.firstChild)}var u=o.createRng();if(e.normalize(),e.hasChildNodes()){for(var s=new fi(e,e);n=s.current();){if(fn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}r=n,n=s.next()}n||(u.setStart(r,0),u.setEnd(r,0))}else pn(e)?e.nextSibling&&o.isBlock(e.nextSibling)?(u.setStartBefore(e),u.setEndBefore(e)):(u.setStartAfter(e),u.setEndAfter(e)):(u.setStart(e,0),u.setEnd(e,0));t.selection.setRng(u),Kh(t,u)}},uy=function(t){return C.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))},sy=function(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e},cy=function(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)},ly=function(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t},fy=function(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!nn(r);)r=r[n?"nextSibling":"previousSibling"];return r===e},dy=function(t,e){return e&&"A"===e.nodeName&&t.isEmpty(e)},my=function(t){t.innerHTML='<br data-mce-bogus="1">'},hy=function(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e},py=function(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)},gy=function(t,e,n){return!1===fn(e)?n:t?1===n&&"\ufeff"===e.data.charAt(n-1)?0:n:n===e.data.length-1&&"\ufeff"===e.data.charAt(n)?e.data.length:n},vy=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},by=function(t,e){var n=Qu(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){C.from(n.style).map(t.dom.parseStyle).each(function(n){var r=function(t){var e={},n=t.dom();if(bn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e}(se.fromDom(e)),o=xt(xt({},r),n);t.dom.setStyles(e,o)});var r=C.from(n.class).map(function(t){return t.split(/\s+/)}),o=C.from(e.className).map(function(t){return U(t.split(/\s+/),function(t){return""!==t})});Ha(r,o,function(n,r){var o=U(r,function(t){return!F(n,t)}),i=wt(n,o);t.dom.setAttrib(e,"class",i.join(" "))});var i=["style","class"],a=ct(n,function(t,e){return!F(i,e)});t.dom.setAttribs(e,a)}(t,e,Zu(t))},yy=function(t,e){var n,r,o,i,a,u,s,c,l,f,d=t.dom,m=t.schema,h=m.getNonEmptyElements(),p=t.selection.getRng(),g=function(e){var n,o,a,u=r,s=m.getTextInlineElements();if(a=n=e||"TABLE"===c||"HR"===c?d.create(e||l):i.cloneNode(!1),!1===function(t){return t.getParam("keep_styles",!0)}(t))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(s[u.nodeName]){if(Cc(u)||Rc(u))continue;o=u.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(a=o,n.appendChild(o))}}while((u=u.parentNode)&&u!==w);return by(t,n),my(a),n},v=function(t){var e,n,a=gy(t,r,o);if(fn(r)&&(t?a>0:a<r.nodeValue.length))return!1;if(r.parentNode===i&&f&&!t)return!0;if(t&&nn(r)&&r===i.firstChild)return!0;if(hy(r,"TABLE")||hy(r,"HR"))return f&&!t||!f&&t;var u=new fi(r,i);for(fn(r)&&(t&&0===a?u.prev():t||a!==r.nodeValue.length||u.next());e=u.current();){if(nn(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),h[n]&&"br"!==n))return!1}else if(fn(e)&&!/^[ \t\r\n]*$/.test(e.nodeValue))return!1;t?u.prev():u.next()}return!0},b=function(){a=/^(H[1-6]|PRE|FIGURE)$/.test(c)&&"HGROUP"!==C?g(l):g(),function(t){return t.getParam("end_container_on_empty_block",!1)}(t)&&py(d,s)&&d.isEmpty(i)?a=d.split(s,i):d.insertAfter(a,i),ay(t,a)};fp(d,p).each(function(t){p.setStart(t.startContainer,t.startOffset),p.setEnd(t.endContainer,t.endOffset)}),r=p.startContainer,o=p.startOffset,l=Qu(t);var y=!(!e||!e.shiftKey),x=!(!e||!e.ctrlKey);nn(r)&&r.hasChildNodes()&&(f=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=f&&fn(r)?r.nodeValue.length:0);var w=vy(d,r);if(w){(l&&!y||!l&&y)&&(r=function(t,e,n,r,o){var i,a,u,s,c,l,f=e||"P",d=t.dom,m=vy(d,r);if(!(a=d.getParent(r,d.isBlock))||!py(d,a)){if(l=(a=a||m)===t.getBody()||a&&/^(TD|TH|CAPTION)$/.test(a.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=d.create(f),by(t,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!d.isBlock(s);)u=s,s=s.previousSibling;if(u&&t.schema.isValidChild(l,f.toLowerCase())){for(i=d.create(f),by(t,i),u.parentNode.insertBefore(i,u),s=u;s&&!d.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(t,l,p,r,o)),i=d.getParent(r,d.isBlock),s=i?d.getParent(i.parentNode,d.isBlock):null,c=i?i.nodeName.toUpperCase():"";var C=s?s.nodeName.toUpperCase():"";"LI"!==C||x||(i=s,s=s.parentNode,c=C),/^(LI|DT|DD)$/.test(c)&&d.isEmpty(i)?function(t,e,n,r,o){var i=t.dom,a=t.selection.getRng();if(n!==t.getBody()){var u;cy(u=n)&&cy(u.parentNode)&&(o="LI");var s=o?e(o):i.create("BR");if(fy(n,r,!0)&&fy(n,r,!1))sy(n,"LI")?i.insertAfter(s,ly(n)):i.replace(s,n);else if(fy(n,r,!0))sy(n,"LI")?(i.insertAfter(s,ly(n)),s.appendChild(i.doc.createTextNode(" ")),s.appendChild(n)):n.parentNode.insertBefore(s,n);else if(fy(n,r,!1))i.insertAfter(s,ly(n));else{n=ly(n);var c=a.cloneRange();c.setStartAfter(r),c.setEndAfter(n);var l=c.extractContents();"LI"===o&&function(t,e){return t.firstChild&&"LI"===t.firstChild.nodeName}(l)?(s=l.firstChild,i.insertAfter(l,n)):(i.insertAfter(l,n),i.insertAfter(s,n))}i.remove(r),ay(t,s)}}(t,g,s,i,l):l&&i===t.getBody()||(l=l||"P",Ea(i)?(a=Fa(i),d.isEmpty(i)&&my(i),by(t,a),ay(t,a)):v()?b():v(!0)?(a=i.parentNode.insertBefore(g(),i),ay(t,hy(i,"HR")?a:i)):((n=function(t){var e=t.cloneRange();return e.setStart(t.startContainer,gy(!0,t.startContainer,t.startOffset)),e.setEnd(t.endContainer,gy(!1,t.endContainer,t.endOffset)),e}(p).cloneRange()).setEndAfter(i),function(t){V(function t(e,n){var r=[];return V(Ee(e),function(e){n(e)&&(r=r.concat([e])),r=r.concat(t(e,n))}),r}(se.fromDom(t),me),function(t){var e=t.dom();e.nodeValue=Ta(e.nodeValue)})}(u=n.extractContents()),function(t){do{fn(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)}(u),a=u.firstChild,d.insertAfter(u,i),function(t,e,n){var r,o=a,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;nn(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||dy(t,o))&&t.remove(o)}}(d,h),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(d,i),d.isEmpty(i)&&my(i),a.normalize(),d.isEmpty(a)?(d.remove(a),b()):(by(t,a),ay(t,a))),d.setAttrib(a,"id",""),t.fire("NewBlock",{newBlock:a}))}},xy=function(t,e,n){var r=t.create("span",{},"&nbsp;");n.parentNode.insertBefore(r,n),e.scrollIntoView(r),t.remove(r)},wy=function(t,e,n,r){var o=t.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),e.setRng(o)},Cy=function(t,e){var n=se.fromTag("br");Le(se.fromDom(e),n),t.undoManager.add()},_y=function(t,e){ky(t.getBody(),e)||Fe(se.fromDom(e),se.fromTag("br"));var n=se.fromTag("br");Fe(se.fromDom(e),n),xy(t.dom,t.selection,n.dom()),wy(t.dom,t.selection,n.dom(),!1),t.undoManager.add()},ky=function(t,e){return n=Du.after(e),!!pn(n.getNode())||bc(t,Du.after(e)).map(function(t){return pn(t.getNode())}).getOr(!1);var n},Sy=function(t){return t&&"A"===t.nodeName&&"href"in t},Ty=function(t){return t.fold(d(!1),Sy,Sy,d(!1))},Oy=function(t,e){e.fold(l,h(Cy,t),h(_y,t),l)},Dy=function(t,e){var n=function(t){var e=h(kg,t),n=Du.fromRangeStart(t.selection.getRng());return Hg(e,t.getBody(),n).filter(Ty)}(t);n.isSome()?n.each(h(Oy,t)):function(t,e){var n,r,o=t.selection,i=t.dom,a=o.getRng();fp(i,a).each(function(t){a.setStart(t.startContainer,t.startOffset),a.setEnd(t.endContainer,t.endOffset)});var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var c=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(t,e,n){for(var r,o=new fi(s,l),i=t.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(t.schema)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Nu(i,a,n),xy(i,o,n),wy(i,o,n,r),t.undoManager.add()}(t,e)},Ey=function(t,e){return uy(t).filter(function(t){return e.length>0&&ve(se.fromDom(t),e)}).isSome()},Ny=ki([{br:[]},{block:[]},{none:[]}]),Ay=function(t,e){return function(t){return Ey(t,function(t){return t.getParam("no_newline_selector","")}(t))}(t)},Ry=function(t){return function(e,n){return""===Qu(e)===t}},By=function(t){return function(e,n){return uy(e).filter(function(t){return Fn(se.fromDom(t))}).isSome()===t}},Iy=function(t,e){return function(n,r){return uy(n).fold(d(""),function(t){return t.nodeName.toUpperCase()})===t.toUpperCase()===e}},Py=function(t){return Iy("pre",t)},My=function(t){return function(e,n){return e.getParam("br_in_pre",!0)===t}},Ly=function(t,e){return function(t){return Ey(t,function(t){return t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(t))}(t)},Fy=function(t,e){return e},Hy=function(t){var e=Qu(t),n=function(t,e){var n,r,o=t.getRoot();for(n=e;n!==o&&"false"!==t.getContentEditable(n);)"true"===t.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")},jy=function(t,e){return function(n,r){return q(t,function(t,e){return t&&e(n,r)},!0)?C.some(e):C.none()}},Vy=function(t,e){(function(t,e){return Eg([jy([Ay],Ny.none()),jy([Iy("summary",!0)],Ny.br()),jy([Py(!0),My(!1),Fy],Ny.br()),jy([Py(!0),My(!1)],Ny.block()),jy([Py(!0),My(!0),Fy],Ny.block()),jy([Py(!0),My(!0)],Ny.br()),jy([By(!0),Fy],Ny.br()),jy([By(!0)],Ny.block()),jy([Ry(!0),Fy,Hy],Ny.block()),jy([Ry(!0)],Ny.br()),jy([Ly],Ny.br()),jy([Ry(!1),Fy],Ny.br()),jy([Hy],Ny.block())],[t,!(!e||!e.shiftKey)]).getOr(Ny.none())})(t,e).fold(function(){Dy(t,e)},function(){yy(t,e)},l)},zy=function(t,e){var n=e.container(),r=e.offset();return fn(n)?(n.insertData(r,t),C.some(Tu(n,r+t.length))):Qs(e).map(function(n){var r=se.fromText(t);return e.isAtEnd()?Fe(n,r):Le(n,r),Tu(r.dom(),t.length)})},Uy=h(zy," "),Wy=h(zy," "),qy=function(t){return Tu.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()},$y=function(t,e){var n=U(lf(se.fromDom(e.container()),t),Bn);return Q(n).getOr(t)},Yy=function(t,e){return qy(e)?Wl(e):Wl(e)||yc($y(t,e).dom(),e).exists(Wl)},Gy=function(t,e){return qy(e)?Ul(e):Ul(e)||bc($y(t,e).dom(),e).exists(Ul)},Ky=function(t){return Qs(t).bind(function(t){return sa(t,de)}).exists(function(t){return function(t){return F(["pre","pre-wrap"],t)}(kn(t,"white-space"))})},Xy=function(t,e){return function(t,e){return!Ky(e)&&(ey(t,e)||ry(t,e)||Tb(t,e)||Yy(t,e))}(t,e)||function(t,e){var n=function(t){var e=t.container(),n=t.offset();return fn(e)&&n<e.data.length?Tu(e,n+1):t}(e);return!Ky(n)&&(ny(t,n)||oy(t,n)||Sb(t,n)||Gy(t,n))}(t,e)},Jy=function(t,e){return Bc(t.charAt(e))},Qy=function(t){var e=t.container();return fn(e)&&Bt(e.data," ")},Zy=function(t,e){return C.some(e).filter(Qy).bind(function(e){var n=e.container();return function(t,e){var n=e.data,r=Tu(e,0);return!(!Jy(n,0)||Xy(t,r)||(e.data=" "+n.slice(1),0))}(t,n)||function(t){var e=t.data,n=function(t){var e=t.split("");return j(e,function(t,n){return Bc(t)&&n>0&&n<e.length-1&&Pc(e[n-1])&&Pc(e[n+1])?" ":t}).join("")}(e);return n!==e&&(t.data=n,!0)}(n)||function(t,e){var n=e.data,r=Tu(e,n.length-1);return!(!Jy(n,n.length-1)||Xy(t,r)||(e.data=n.slice(0,-1)+" ",0))}(t,n)?C.some(e):C.none()})},tx=function(t){var e=se.fromDom(t.getBody());t.selection.isCollapsed()&&Zy(e,Tu.fromRangeStart(t.selection.getRng())).each(function(e){t.selection.setRng(e.toRange())})},ex=function(t,e){return function(n){return function(t,e){return!Ky(e)&&(function(t,e){return function(t,e){return yc(t.dom(),e).isNone()}(t,e)||function(t,e){return bc(t.dom(),e).isNone()}(t,e)||ey(t,e)||ny(t,e)||Tb(t,e)||Sb(t,e)}(t,e)||Yy(t,e)||Gy(t,e))}(t,n)?Uy(e):Wy(e)}},nx=function(t){var e=Du.fromRangeStart(t.selection.getRng()),n=se.fromDom(t.getBody());if(t.selection.isCollapsed()){var r=h(kg,t),o=Du.fromRangeStart(t.selection.getRng());return Hg(r,t.getBody(),o).bind(function(t){return function(e){return e.fold(function(e){return yc(t.dom(),Du.before(e))},function(t){return xc(t)},function(t){return wc(t)},function(e){return bc(t.dom(),Du.after(e))})}}(n)).bind(ex(n,e)).exists(function(t){return function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}}(t))}return!1},rx=function(t,e){e.hasAttribute("data-mce-caret")&&(Fa(e),function(t){t.selection.setRng(t.selection.getRng())}(t),t.selection.scrollIntoView(e))},ox=function(t,e){var n=function(t){return la(se.fromDom(t.getBody()),"*[data-mce-caret]").fold(d(null),function(t){return t.dom()})}(t);if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void rx(t,n)):void(Ra(n)&&(rx(t,n),t.undoManager.add()))},ix=Yt().browser,ax=function(t){var e=Zg(t);!function(t){t.on("keyup compositionstart",h(ox,t))}(t),function(t,e){t.on("keydown",function(n){!1===n.isDefaultPrevented()&&function(t,e,n){var r=Yt().os;ub([{keyCode:gp.RIGHT,action:Vv(t,!0)},{keyCode:gp.LEFT,action:Vv(t,!1)},{keyCode:gp.UP,action:zv(t,!1)},{keyCode:gp.DOWN,action:zv(t,!0)},{keyCode:gp.RIGHT,action:Zv(t,!0)},{keyCode:gp.LEFT,action:Zv(t,!1)},{keyCode:gp.UP,action:tb(t,!1)},{keyCode:gp.DOWN,action:tb(t,!0)},{keyCode:gp.RIGHT,action:Jg(t,e,!0)},{keyCode:gp.LEFT,action:Jg(t,e,!1)},{keyCode:gp.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:tv(t,e)},{keyCode:gp.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:ev(t,e)},{keyCode:gp.UP,action:ib(t,!1)},{keyCode:gp.DOWN,action:ib(t,!0)}],n).each(function(t){n.preventDefault()})}(t,e,n)})}(t,e),function(t,e){t.on("keydown",function(n){!1===n.isDefaultPrevented()&&function(t,e,n){ub([{keyCode:gp.BACKSPACE,action:ab(iy,t,!1)},{keyCode:gp.BACKSPACE,action:ab(Pb,t,!1)},{keyCode:gp.DELETE,action:ab(Pb,t,!0)},{keyCode:gp.BACKSPACE,action:ab(Lb,t,!1)},{keyCode:gp.DELETE,action:ab(Lb,t,!0)},{keyCode:gp.BACKSPACE,action:ab(jb,t,e,!1)},{keyCode:gp.DELETE,action:ab(jb,t,e,!0)},{keyCode:gp.BACKSPACE,action:ab(Vf,t,!1)},{keyCode:gp.DELETE,action:ab(Vf,t,!0)},{keyCode:gp.BACKSPACE,action:ab(Wb,t,!1)},{keyCode:gp.DELETE,action:ab(Wb,t,!0)},{keyCode:gp.BACKSPACE,action:ab(Cb,t,!1)},{keyCode:gp.DELETE,action:ab(Cb,t,!0)},{keyCode:gp.BACKSPACE,action:ab(yb,t,!1)},{keyCode:gp.DELETE,action:ab(yb,t,!0)},{keyCode:gp.BACKSPACE,action:ab(Ub,t,!1)},{keyCode:gp.DELETE,action:ab(Ub,t,!0)}],n).each(function(t){n.preventDefault()})}(t,e,n)}),t.on("keyup",function(e){!1===e.isDefaultPrevented()&&function(t,e){ub([{keyCode:gp.BACKSPACE,action:ab(Ib,t)},{keyCode:gp.DELETE,action:ab(Ib,t)}],e)}(t,e)})}(t,e),function(t){t.on("keydown",function(e){e.keyCode===gp.ENTER&&function(t,e){var n;e.isDefaultPrevented()||(e.preventDefault(),(n=t.undoManager).typing&&(n.typing=!1,n.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),Vy(t,e)}))}(t,e)})}(t),function(t){t.on("keydown",function(e){!1===e.isDefaultPrevented()&&function(t,e){ub([{keyCode:gp.SPACEBAR,action:ab(nx,t)}],e).each(function(t){e.preventDefault()})}(t,e)})}(t),function(t){!function(t){var e=Zi(function(){t.composing||tx(t)},0);ix.isIE()&&(t.on("keypress",function(t){e.throttle()}),t.on("remove",function(t){e.cancel()}))}(t),t.on("input",function(e){!1===e.isComposing&&tx(t)})}(t),function(t){t.on("keydown",function(e){!1===e.isDefaultPrevented()&&function(t,e){ub([{keyCode:gp.END,action:Uv(t,!0)},{keyCode:gp.HOME,action:Uv(t,!1)}],e).each(function(t){e.preventDefault()})}(t,e)})}(t)},ux=function(){function t(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&np(o,e)||t.fire("SelectionChange"),e=o}),t.on("contextmenu",function(){t.fire("SelectionChange")}),t.on("SelectionChange",function(){var e=t.selection.getStart(!0);!e||!ne.range&&t.selection.isCollapsed()||pl(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})}),t.on("mouseup",function(e){!e.isDefaultPrevented()&&pl(t)&&("IMG"===t.selection.getNode().nodeName?Ni.setEditorTimeout(t,function(){t.nodeChanged()}):t.nodeChanged())})}return t.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,function(t){if(t===r)return!0;n.push(t)}),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},t.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;e>=0&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},t}(),sx=function(t){return nn(t)&&Mn(se.fromDom(t))},cx=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}},lx=vn,fx=gn,dx=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},mx=function(t){t.dragging=!1,t.element=null,dx(t.ghost)},hx=function(t){var e={},r=Vi.DOM,o=n.document,i=function(t,e){return function(n){if(0===n.button){var r=$(e.dom.getParents(n.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(lx,fx)).getOr(null);if(u=e.getBody(),lx(s=r)&&s!==u){var o=e.dom.getPos(r),i=e.getBody(),a=e.getDoc().documentElement;t.element=r,t.screenX=n.screenX,t.screenY=n.screenY,t.maxX=(e.inline?i.scrollWidth:a.offsetWidth)-2,t.maxY=(e.inline?i.scrollHeight:a.offsetHeight)-2,t.relX=n.pageX-o.x,t.relY=n.pageY-o.y,t.width=r.offsetWidth,t.height=r.offsetHeight,t.ghost=function(t,e,n,r){var o=e.cloneNode(!0);t.dom.setStyles(o,{width:n,height:r}),t.dom.setAttrib(o,"data-mce-selected",null);var i=t.dom.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return t.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),t.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(e,r,t.width,t.height)}}var u,s}}(e,t),a=function(t,e){var n=Ni.throttle(function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)},0);return function(r){var o,i,a=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(function(t){return t.element}(t)&&!t.dragging&&a>10){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}if(t.dragging){var u=function(t,e){return{pageX:e.pageX-t.relX,pageY:e.pageY+5}}(t,function(t,e){return function(t,e,n){return{pageX:n.left-t.left+e.left,pageY:n.top-t.top+e.top}}(function(t){return t.inline?cx(t.getBody()):{left:0,top:0}}(t),function(t){var e=t.getBody();return t.inline?{left:e.scrollLeft,top:e.scrollTop}:{left:0,top:0}}(t),function(t,e){if(e.target.ownerDocument!==t.getDoc()){var n=cx(t.getContentAreaContainer()),r=function(t){var e=t.getBody(),n=t.getDoc().documentElement,r={left:e.scrollLeft,top:e.scrollTop},o={left:e.scrollLeft||n.scrollLeft,top:e.scrollTop||n.scrollTop};return t.inline?r:o}(t);return{left:e.pageX-n.left+r.left,top:e.pageY-n.top+r.top}}return{left:e.pageX,top:e.pageY}}(t,e))}(e,r));o=t.ghost,i=e.getBody(),o.parentNode!==i&&i.appendChild(o),function(t,e,n,r,o,i){var a=0,u=0;t.style.left=e.pageX+"px",t.style.top=e.pageY+"px",e.pageX+n>o&&(a=e.pageX+n-o),e.pageY+r>i&&(u=e.pageY+r-i),t.style.width=n-a+"px",t.style.height=r-u+"px"}(t.ghost,u,t.width,t.height,t.maxX,t.maxY),n(r.clientX,r.clientY)}}}(e,t),u=function(t,e){return function(n){if(t.dragging&&function(t,e,n){return e!==n&&!t.dom.isChildOf(e,n)&&!lx(e)}(e,3===(a=e.selection.getSel().getRangeAt(0).startContainer).nodeType?a.parentNode:a,t.element)){var r=((i=t.element.cloneNode(!0)).removeAttribute("data-mce-selected"),i),o=e.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});o.isDefaultPrevented()||(r=o.targetClone,e.undoManager.transact(function(){dx(t.element),e.insertContent(e.dom.getOuterHTML(r)),e._selectionOverrides.hideFakeCaret()}))}var i,a;mx(t)}}(e,t),s=function(t,e){return function(){t.dragging&&e.fire("dragend"),mx(t)}}(e,t);t.on("mousedown",i),t.on("mousemove",a),t.on("mouseup",u),r.bind(o,"mousemove",a),r.bind(o,"mouseup",s),t.on("remove",function(){r.unbind(o,"mousemove",a),r.unbind(o,"mouseup",s)})},px=gn,gx=vn,vx=function(t,e){for(var n=t.getBody();e&&e!==n;){if(px(e)||gx(e))return e;e=e.parentNode}return null},bx=function(t){var e,r=t.getBody(),o=function(t,e,n,r){var o,i,a=$i(C.none()),u=Qu(t),s=u.length>0?u:"p",c=function(){!function(t){var e,n,r,o,i=ia(se.fromDom(t),"*[contentEditable=false]");for(r=0;r<i.length;r++)n=(e=i[r].dom()).previousSibling,La(n)&&(1===(o=n.data).length?n.parentNode.removeChild(n):n.deleteData(o.length-1,1)),n=e.nextSibling,Ma(n)&&(1===(o=n.data).length?n.parentNode.removeChild(n):n.deleteData(0,1))}(e),i&&(Ss(i),i=null),a.get().each(function(t){li(t.caret).remove(),a.set(C.none())}),o&&(Ni.clearInterval(o),o=null)},l=function(){o=Ni.setInterval(function(){r()?li("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):li("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")},500)};return{show:function(t,r){var o,u,f;if(c(),nn(f=r)&&/^(TD|TH)$/i.test(f.tagName))return null;if(!n(r))return i=function(t,e){var n,r=t.ownerDocument.createTextNode("\ufeff"),o=t.parentNode;if(e){if(n=t.previousSibling,Da(n)){if(Aa(n))return n;if(La(n))return n.splitText(n.data.length-1)}o.insertBefore(r,t)}else{if(n=t.nextSibling,Da(n)){if(Aa(n))return n;if(Ma(n))return n.splitText(1),n}t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r)}return r}(r,t),u=r.ownerDocument.createRange(),Os(i.nextSibling)?(u.setStart(i,0),u.setEnd(i,0)):(u.setStart(i,1),u.setEnd(i,1)),u;i=Pa(s,r,t),o=Ds(e,r,t),li(i).css("top",o.top);var d=li('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(o).appendTo(e)[0];return a.set(C.some({caret:d,element:r,before:t})),a.get().each(function(e){t&&li(e.caret).addClass("mce-visual-caret-before")}),l(),(u=r.ownerDocument.createRange()).setStart(i,0),u.setEnd(i,0),u},hide:c,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){a.get().each(function(t){var n=Ds(e,t.element,t.before);li(t.caret).css(xt({},n))})},destroy:function(){return Ni.clearInterval(o)}}}(t,r,function(e){return t.dom.isBlock(e)},function(){return yd(t)}),i="sel-"+t.dom.uniqueId(),a=function(e){e&&t.selection.setRng(e)},u=function(){return t.selection.getRng()},s=function(e,n,r,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:n,direction:e,before:r}).isDefaultPrevented()?null:(i&&t.selection.scrollIntoView(n,-1===e),o.show(r,n))},c=function(t){return Aa(t)||Ma(t)||La(t)},l=function(t){return c(t.startContainer)||c(t.endContainer)},f=function(e){var n=t.schema.getShortEndedElements(),r=t.dom.createRng(),o=e.startContainer,i=e.startOffset,a=e.endContainer,u=e.endOffset;return ft(n,o.nodeName.toLowerCase())?0===i?r.setStartBefore(o):r.setStartAfter(o):r.setStart(o,i),ft(n,a.nodeName.toLowerCase())?0===u?r.setEndBefore(a):r.setEndAfter(a):r.setEnd(a,u),r},d=function(n,o){var a,u,c,f,d,m,p,g=t.$,v=t.dom;if(!n)return null;if(n.collapsed){if(!l(n))if(!1===o){if(d=Js(-1,r,n),Ns(d.getNode(!0)))return s(-1,d.getNode(!0),!1,!1);if(Ns(d.getNode()))return s(-1,d.getNode(),!d.isAtEnd(),!1)}else{if(d=Js(1,r,n),Ns(d.getNode()))return s(1,d.getNode(),!d.isAtEnd(),!1);if(Ns(d.getNode(!0)))return s(1,d.getNode(!0),!1,!1)}return null}c=n.startContainer,f=n.startOffset;var b=n.endOffset;if(3===c.nodeType&&0===f&&gx(c.parentNode)&&(c=c.parentNode,f=v.nodeIndex(c),c=c.parentNode),1!==c.nodeType)return null;if(b===f+1&&c===n.endContainer&&(a=c.childNodes[f]),!gx(a))return null;m=p=a.cloneNode(!0);var y=t.fire("ObjectSelected",{target:a,targetClone:m});if(y.isDefaultPrevented())return null;u=la(se.fromDom(t.getBody()),"#"+i).fold(function(){return g([])},function(t){return g([t.dom()])}),m=y.targetClone,0===u.length&&(u=g('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",i)).appendTo(t.getBody()),n=t.dom.createRng(),m===p&&ne.ie?(u.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(m),n.setStartAfter(u[0].firstChild.firstChild),n.setEndAfter(m)):(u.empty().append(" ").append(m).append(" "),n.setStart(u[0].firstChild,1),n.setEnd(u[0].lastChild,0)),u.css({top:v.getPos(a,t.getBody()).y}),u[0].focus();var x=t.selection.getSel();x.removeAllRanges(),x.addRange(n);var w=se.fromDom(a);return V(ia(se.fromDom(t.getBody()),"*[data-mce-selected]"),function(t){ye(w,t)||_n(t,"data-mce-selected")}),t.dom.getAttrib(a,"data-mce-selected")||a.setAttribute("data-mce-selected","1"),e=a,h(),n},m=function(){e&&(e.removeAttribute("data-mce-selected"),la(se.fromDom(t.getBody()),"#"+i).each(Ue),e=null),la(se.fromDom(t.getBody()),"#"+i).each(Ue),e=null},h=function(){o.hide()};return ne.ceFalse&&function(){t.on("mouseup",function(e){var n=u();n.collapsed&&_h(t,e.clientX,e.clientY)&&a(Mv(t,n,!1))}),t.on("click",function(e){var n=vx(t,e.target);n&&(gx(n)&&(e.preventDefault(),t.focus()),px(n)&&t.dom.isChildOf(n,t.selection.getNode())&&m())}),t.on("blur NewBlock",function(){m()}),t.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});!function(t){t.on("tap",function(e){var n=vx(t,e.target);gx(n)&&(e.preventDefault(),d(Pv(t,n)))},!0)}(t),t.on("mousedown",function(e){var n=e.target;if((n===r||"HTML"===n.nodeName||t.dom.isChildOf(n,r))&&!1!==_h(t,e.clientX,e.clientY)){var o=vx(t,n);if(o)gx(o)?(e.preventDefault(),d(Pv(t,o))):(m(),px(o)&&e.shiftKey||pp(e.clientX,e.clientY,t.selection.getRng())||(h(),t.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===Ns(n)){m(),h();var i=Av(r,e.clientX,e.clientY);if(i&&!function(e,n){var r,o,i=t.dom.getParent(e,t.dom.isBlock),a=t.dom.getParent(n,t.dom.isBlock);return!(!i||!t.dom.isChildOf(i,a)||!1!==gx(vx(t,i)))||i&&(r=i,o=a,!(t.dom.getParent(r,t.dom.isBlock)===t.dom.getParent(o,t.dom.isBlock)))&&function(t){var e=fc(t);if(!t.firstChild)return!1;var n=Du.before(t.firstChild),r=e.next(n);return r&&!Zl(r)&&!tf(r)}(i)}(e.target,i.node)){e.preventDefault();var u=s(1,i.node,i.before,!1);t.getBody().focus(),a(u)}}}}),t.on("keypress",function(e){gp.modifierPressed(e)||(e.keyCode,gx(t.selection.getNode())&&e.preventDefault())}),t.on("GetSelectionRange",function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}}),t.on("SetSelectionRange",function(t){t.range=f(t.range);var e=d(t.range,t.forward);e&&(t.range=e)}),t.on("AfterSetSelectionRange",function(e){var n,r=e.range;l(r)||"mcepastebin"===r.startContainer.parentNode.id||h(),n=r.startContainer.parentNode,t.dom.hasClass(n,"mce-offscreen-selection")||m()}),t.on("copy",function(e){var n,r=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!ne.ie){var o=(n=t.dom.get(i))?n.getElementsByTagName("*")[0]:n;o&&(e.preventDefault(),r.clearData(),r.setData("text/html",o.outerHTML),r.setData("text/plain",o.outerText))}}),function(t){hx(t),function(t){t.on("drop",function(e){var n=void 0!==e.clientX?t.getDoc().elementFromPoint(e.clientX,e.clientY):null;(lx(n)||lx(t.dom.getContentEditableParent(n)))&&e.preventDefault()})}(t),function(t){return t.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var e=function(t){if(!t.defaultPrevented){var e=t.dataTransfer;e&&(F(e.types,"Files")||e.files.length>0)&&t.preventDefault()}},r=function(n){hd(t,n.target)&&e(n)},o=function(){var o=Vi.DOM,i=t.dom,a=n.document,u=t.inline?t.getBody():t.getDoc(),s=["drop","dragover"];V(s,function(t){o.bind(a,t,r),i.bind(u,t,e)}),t.on("remove",function(){V(s,function(t){o.unbind(a,t,r),i.unbind(u,t,e)})})};t.on("init",function(){Ni.setEditorTimeout(t,o,0)})}(t)}(t),function(t){var e=Zi(function(){if(!t.removed&&t.getBody().contains(n.document.activeElement)&&t.selection.getRng().collapsed){var e=Lv(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})}(t)}(),{showCaret:s,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Fa(e),a(u()),t.selection.scrollIntoView(e))},hideFakeCaret:h,destroy:function(){o.destroy(),e=null}}},yx=function(t){var e,r,o,i=ae.each,a=gp.BACKSPACE,u=gp.DELETE,s=t.dom,c=t.selection,l=t.parser,f=ne.gecko,d=ne.ie,m=ne.webkit,h=d?"Text":"URL",p=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},g=function(t){return t.isDefaultPrevented()},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},b=function(){t.on("keydown",function(t){if(!g(t)&&t.keyCode===a&&c.isCollapsed()&&0===c.getRng().startOffset){var e=c.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}})},y=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",function(e){var n;if("HTML"===e.target.nodeName){if(ne.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}}))};return t.on("keydown",function(e){var n,r;if(!g(e)&&e.keyCode===gp.BACKSPACE){var o=(n=c.getRng()).startContainer,i=n.startOffset,a=s.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==a;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=s.createRng()).setStart(o,0),n.setEnd(o,0),c.setRng(n))}}}),e=function(t){var e=s.create("body"),n=t.cloneContents();return e.appendChild(n),c.serializer.serialize(e,{format:"html"})},t.on("keydown",function(n){var r,o,i=n.keyCode;if(!g(n)&&(i===u||i===a)){if(r=t.selection.isCollapsed(),o=t.getBody(),r&&!s.isEmpty(o))return;if(!r&&!function(n){var r=e(n),o=s.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),o.firstChild&&s.isBlock(o.firstChild)?t.selection.setCursorLocation(o.firstChild,0):t.selection.setCursorLocation(o,0),t.nodeChanged()}}),ne.windowsPhone||t.on("keyup focusin mouseup",function(t){gp.modifierPressed(t)||c.normalize()},!0),m&&(t.inline||s.bind(t.getDoc(),"mousedown mouseup",function(e){var n;if(e.target===t.getDoc().documentElement)if(n=c.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Aa(n.startContainer))return;c.placeCaretAt(e.clientX,e.clientY)}else c.setRng(n)}),t.on("click",function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==s.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&s.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),c.select(n))}),Qu(t)&&t.on("init",function(){p("DefaultParagraphSeparator",Qu(t))}),t.on("init",function(){t.dom.bind(t.getBody(),"submit",function(t){t.preventDefault()})}),b(),l.addNodeFilter("br",function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()}),ne.iOS?(t.inline||t.on("keydown",function(){n.document.activeElement===n.document.body&&t.getWin().focus()}),y(),t.on("click",function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)}),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):v()),ne.ie>=11&&(y(),b()),ne.ie&&(v(),p("AutoUrlDetect",!1),t.on("dragstart",function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&c.select(e.target),(n=t.selection.getContent()).length>0&&(r="data:text/mce-internal,"+escape(t.id)+","+escape(n),e.dataTransfer.setData(h,r)))}(e)}),t.on("drop",function(e){if(!g(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(h))&&e.indexOf("data:text/mce-internal,")>=0?(e=e.substr("data:text/mce-internal,".length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=Jh(e.x,e.y,t.getDoc());c.setRng(r),o=n.html,!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:!0}):t.execCommand("mceInsertContent",!1,o)}}var o})),f&&(t.on("keydown",function(e){if(!g(e)&&e.keyCode===a){if(!t.getBody().getElementsByTagName("hr").length)return;if(c.isCollapsed()&&0===c.getRng().startOffset){var n=c.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return s.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(s.remove(r),e.preventDefault())}}}),n.Range.prototype.getClientRects||t.on("mousedown",function(e){if(!g(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),Ni.setEditorTimeout(t,function(){n.focus()})}}),r=function(){var e=s.getAttribs(c.getStart().cloneNode(!1));return function(){var n=c.getStart();n!==t.getBody()&&(s.setAttrib(n,"style",null),i(e,function(t){n.setAttributeNode(t.cloneNode(!0))}))}},o=function(){return!c.isCollapsed()&&s.getParent(c.getStart(),s.isBlock)!==s.getParent(c.getEnd(),s.isBlock)},t.on("keypress",function(e){var n;if(!g(e)&&(8===e.keyCode||46===e.keyCode)&&o())return n=r(),t.getDoc().execCommand("delete",!1,null),n(),e.preventDefault(),!1}),s.bind(t.getDoc(),"cut",function(e){var n;!g(e)&&o()&&(n=r(),Ni.setEditorTimeout(t,function(){n()}))}),function(t){return t.getParam("readonly")}(t)||t.on("BeforeExecCommand mousedown",function(){p("StyleWithCSS",!1),p("enableInlineTableEditing",!1),fs(t)||p("enableObjectResizing",!1)}),t.on("SetContent ExecCommand",function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||i(s.select("a"),function(t){var e=t.parentNode,n=s.getRoot();if(e.lastChild===t){for(;e&&!s.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}s.add(e,"br",{"data-mce-bogus":1})}})}),t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),ne.mac&&t.on("keydown",function(e){!gp.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}),b()),{refreshContentEditable:function(){},isHidden:function(){if(!f||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},xx=Vi.DOM,wx=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Cx=function(t){return ct(t,function(t){return!1===A(t)})},_x=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Cx({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:wx(t),validate:!0,blob_cache:n,images_dataimg_filter:e.images_dataimg_filter})},kx=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),function(t){var e=t.dom.getRoot();t.inline||pl(t)&&t.selection.getStart(!0)!==e||xc(e).each(function(e){var n=e.getNode(),r=sn(n)?xc(n).getOr(e):e;ne.browser.isIE()?function(t,e){var n=se.fromDom(t.getBody()),r=(ad(t)?C.from(e):C.none()).map(ud).filter(id(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())})}(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&Ni.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)}(t)},Sx=function(t,e){var n=t.settings,r=t.getDoc(),o=t.getBody();n.browser_spellcheck||n.gecko_spellcheck||(r.body.spellcheck=!1,xx.setAttrib(o,"spellcheck","false")),t.quirks=yx(t),function(t){t.fire("PostRender")}(t);var i=function(t){return t.getParam("directionality",Xi.isRtl()?"rtl":void 0)}(t);if(void 0!==i&&(o.dir=i),n.protect&&t.on("BeforeSetContent",function(t){ae.each(n.protect,function(e){t.content=t.content.replace(e,function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),!1===e&&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){var a="";ae.each(t.contentStyles,function(t){a+=t+"\r\n"}),t.dom.addStyle(a)}(function(t){return t.inline?xx.styleSheetLoader:t.dom.styleSheetLoader})(t).loadAll(t.contentCSS,function(e){kx(t)},function(e){kx(t)}),n.content_style&&function(t,e){var n=se.fromDom(t.getDoc().head),r=se.fromTag("style");xn(r,"type","text/css"),je(r,se.fromText(e)),je(n,r)}(t,n.content_style)},Tx=function(t,e){var r=t.settings,o=t.getElement(),i=t.getDoc();r.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(i.open(),i.write(t.iframeHTML),i.close()),t.inline&&(xx.addClass(o,"mce-content-body"),t.contentDocument=i=n.document,t.contentWindow=n.window,t.bodyElement=o,t.contentAreaContainer=o);var a=t.getBody();a.disabled=!0,t.readonly=!!r.readonly,t.readonly||(t.inline&&"static"===xx.getStyle(a,"position",!0)&&(a.style.position="relative"),a.contentEditable=t.getParam("content_editable_state",!0)),a.disabled=!1,t.editorUpload=Yp(t),t.schema=hr(r),t.dom=Vi(i,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:r.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:us(t),referrerPolicy:ss(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Hp(_x(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",function(e,n){for(var r,o,i=e.length,a=t.dom,u="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(u)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(u,o),r.attr(n,o)):"tabindex"===n?(r.attr(u,o),r.attr(n,null)):r.attr(u,t.convertURL(o,n,r.name))}}),e.addNodeFilter("script",function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}}),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}}),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Dl("br",1)).shortEnded=!0)}}),e}(t),t.serializer=Up(function(t){var e=t.settings;return xt(xt({},_x(t)),Cx({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before,block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements}))}(t),t),t.selection=_p(t.dom,t.getWin(),t.serializer,t),t.annotator=Cl(t),t.formatter=ng(t),t.undoManager=rg(t),t._nodeChangeDispatcher=new ux(t),t._selectionOverrides=bx(t),function(t){var e=$i(C.none()),n=$i(!1),r=ta(function(e){t.fire("longpress",xt(xt({},e),{type:"longpress"})),n.set(!0)},400);t.on("touchstart",function(t){ug(t).each(function(o){r.cancel();var i={x:d(o.clientX),y:d(o.clientY),target:d(t.target)};r.throttle(t),n.set(!1),e.set(C.some(i))})},!0),t.on("touchmove",function(o){r.cancel(),ug(o).each(function(r){e.get().each(function(o){(function(t,e){var n=Math.abs(t.clientX-e.x()),r=Math.abs(t.clientY-e.y());return n>5||r>5})(r,o)&&(e.set(C.none()),n.set(!1),t.fire("longpresscancel"))})})},!0),t.on("touchend touchcancel",function(o){r.cancel(),"touchcancel"!==o.type&&e.get().filter(function(t){return t.target().isEqualNode(o.target)}).each(function(){n.get()?o.preventDefault():t.fire("tap",xt(xt({},o),{type:"tap"}))})},!0)}(t),function(t){!function(t){t.on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()})}(t),function(t){t.parser.addNodeFilter("details",function(t){V(t,function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")})}),t.serializer.addNodeFilter("details",function(t){V(t,function(t){var e=t.attr("data-mce-open");t.attr("open",T(e)?e:null),t.attr("data-mce-open",null)})})}(t)}(t),Gm(t)||function(t){t.on("click",function(e){e.detail>=3&&function(t){var e=t.selection.getRng(),n=Tu.fromRangeStart(e),r=Tu.fromRangeEnd(e);if(Tu.isElementPosition(n)){var o=n.container();sx(o)&&xc(o).each(function(t){return e.setStart(t.container(),t.offset())})}Tu.isElementPosition(r)&&(o=n.container(),sx(o)&&wc(o).each(function(t){return e.setEnd(t.container(),t.offset())})),t.selection.setRng(zf(e))}(t)})}(t),function(t){Gm(t)||ax(t)}(t),function(t){Qu(t)&&t.on("NodeChange",h(fg,t))}(t),function(t){var e=t.dom,n=Qu(t),r=function(t){return t.getParam("placeholder",Ku.getAttrib(t.getElement(),"placeholder"),"string")}(t),o=function o(i,a){if(!function(t){if(ig(t)){var e=t.keyCode;return!ag(t)&&(gp.metaKeyPressed(t)||t.altKey||e>=112&&e<=123||F(og,e))}return!1}(i)){var u=t.getBody(),s=!function(t){return ig(t)&&!(ag(t)||"keyup"===t.type&&229===t.keyCode)}(i)&&function(t,e,n){if(af(se.fromDom(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(e,u,n);(""!==e.getAttrib(u,"data-mce-placeholder")!==s||a)&&(e.setAttrib(u,"data-mce-placeholder",s?r:null),e.setAttrib(u,"aria-placeholder",s?r:null),function(t,e){t.fire("PlaceholderToggle",{state:e})}(t,s),t.on(s?"keydown":"keyup",o),t.off(s?"keyup":"keydown",o))}};r&&t.on("init",function(e){o(e,!0),t.on("change SetContent ExecCommand",o),t.on("paste",function(e){return Ni.setEditorTimeout(t,function(){return o(e)})})})}(t),function(t){t.fire("PreInit")}(t),function(t){var e=t;return lt(t.plugins,"rtc").fold(function(){return e.rtcInstance=Ym(t),C.none()},function(n){return C.some(n.setup().then(function(n){return e.rtcInstance=function(t,e){var n=function(t){return O(t)?t:{}},r=g("Unimplemented feature for rtc");return{undoManager:{beforeChange:l,addUndoLevel:r,undo:function(){return e.undo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},redo:function(){return e.redo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},clear:r,reset:r,hasUndo:function(){return e.hasUndo()},hasRedo:function(){return e.hasRedo()},transact:function(t,n,r){return e.transact(r),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},ignore:r,extra:r},formatter:{apply:function(t,r,o){return e.applyFormat(t,n(r))},remove:function(t,r,o,i){return e.removeFormat(t,n(r))},toggle:function(t,r,o){return e.toggleFormat(t,n(r))}},editor:{getContent:function(n,r){if("html"===r||"tree"===r){var o=e.getContent(),i=Al({inner:!0});return $m(t,o),"tree"===r?o:i.serialize(o)}return Ym(t).editor.getContent(n,r)},setContent:function(n,r){var o=qm(n)?n:t.parser.parse(n,{isRootContent:!0,insert:!0});return e.setContent(o),n},insertContent:function(n,r){var o=qm(n)?n:t.parser.parse(n,{insert:!0});e.insertContent(o)}},selection:{getContent:function(n,r){if("html"===n||"tree"===n){var o=e.getSelectedContent(),i=Al({});return $m(t,o),"tree"===n?o:i.serialize(o)}return Ym(t).selection.getContent(n,r)}},raw:{getModel:function(){return C.some(e.getRawModel())}}}}(t,n),n.isRemote}))})}(t).fold(function(){Sx(t,!1)},function(e){t.setProgressState(!0),e.then(function(e){t.setProgressState(!1),Sx(t,e)})})},Ox=Vi.DOM,Dx=function(t,e){var r=t.editorManager.translate("Rich Text Area. Press ALT-0 for help."),o=function(t,e,n,r){var o=se.fromTag("iframe");return wn(o,r),wn(o,{id:t+"_ifr",frameBorder:"0",allowTransparency:"true",title:e}),ra(o,"tox-edit-area__iframe"),o}(t.id,r,e.height,function(t){return t.getParam("iframe_attrs",{})}(t)).dom();o.onload=function(){o.onload=null,t.fire("load")};var i=function(t,e){if(n.document.domain!==n.window.location.hostname&&ne.browser.isIE()){var r=$p("mce");t[r]=function(){Tx(t)};var o='javascript:(function(){document.open();document.domain="'+n.document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+r+"(true);})()";return Ox.setAttrib(e,"src",o),!0}return!1}(t,o);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=o,t.iframeHTML=function(t){var e=function(t){return t.getParam("doctype","<!DOCTYPE html>")}(t)+"<html><head>";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(t){return Xu(t,"body_id","tinymce")}(t),r=function(t){return Xu(t,"body_class","")}(t);return Ju(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+Ju(t)+'" />'),e+'</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'"><br></body></html>'}(t),Ox.add(e.iframeContainer,o),i},Ex=Vi.DOM,Nx=function(t){return t.replace(/^\-/,"")},Ax=function(t){return{editorContainer:t,iframeContainer:t}},Rx=function(t){var e=t.getElement();return t.orgDisplay=e.style.display,T(ms(t))?function(t){return t.theme.renderUI()}(t):R(ms(t))?function(t){var e=t.getElement(),n=ms(t)(t,e);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:e.offsetHeight,n}(t):function(t){var e=t.getElement();return t.inline?Ax(null):function(t){var e=Ex.create("div");return Ex.insertAfter(e,t),Ax(e)}(e)}(t)},Bx=function(t){t.fire("ScriptsLoaded"),function(t){var e=ae.trim(ns(t)),n=t.ui.registry.getAll().icons,r=xt(xt({},gh.get("default").icons),gh.get(e).icons);rt(r,function(e,r){ft(n,r)||t.ui.registry.addIcon(r,e)})}(t),function(t){var e=ms(t);if(T(e)){t.settings.theme=Nx(e);var n=Oh.get(e);t.theme=new n(t,Oh.urls[e]),t.theme.init&&t.theme.init(t,Oh.urls[e]||t.documentBaseUrl.replace(/\/$/,""),t.$)}else t.theme={}}(t),function(t){var e=[];ae.each(vs(t).split(/[ ,]/),function(n){!function t(e,n,r){var o=Th.get(r),i=Th.urls[r]||e.documentBaseUrl.replace(/\/$/,"");if(r=ae.trim(r),o&&-1===ae.inArray(n,r)){if(ae.each(Th.dependencies(r),function(r){t(e,n,r)}),e.plugins[r])return;try{var a=new o(e,i,e.$);e.plugins[r]=a,a.init&&(a.init(e,i),n.push(r))}catch(n){!function(t,e,n){var r=Xi.translate(["Failed to initialize plugin: {0}",e]);Ih(r,n),Nh(t,r)}(e,r,n)}}}(t,e,Nx(n))})}(t);var e=Rx(t);return t.editorContainer=e.editorContainer?e.editorContainer:null,function(t){t.contentCSS=t.contentCSS.concat(function(t){var e=function(t){var e=t.getParam("content_css");return T(e)?j(e.split(","),Mt):D(e)?e:!1===e||t.inline?[]:["default"]}(t),n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return j(e,function(e){return/^[a-z0-9\-]+$/i.test(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)})}(t))}(t),t.inline?Tx(t):function(t,e){var n=Dx(t,e);e.editorContainer&&(Ox.get(e.editorContainer).style.display=t.orgDisplay,t.hidden=Ox.isHidden(e.editorContainer)),t.getElement().style.display="none",Ox.setAttrib(t.id,"aria-hidden","true"),n||Tx(t)}(t,e)},Ix=Vi.DOM,Px=function(t){return"-"===t.charAt(0)},Mx=function(t,e,n){return C.from(e).filter(function(t){return t.length>0&&!gh.has(t)}).map(function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:C.some(e)}})},Lx=function(t,e){var n=qi.ScriptLoader;!function(t,e,n,r){var o=ms(e);if(T(o)){if(!Px(o)&&!Oh.urls.hasOwnProperty(o)){var i=e.getParam("theme_url");i?Oh.load(o,e.documentBaseURI.toAbsolute(i)):Oh.load(o,"themes/"+o+"/theme"+n+".js")}t.loadQueue(function(){Oh.waitFor(o,r)})}else r()}(n,t,e,function(){(function(t,e){var n=cs(e),r=e.getParam("language_url","","string");if(!1===Xi.hasCode(n)&&"en"!==n){var o=""!==r?r:e.editorManager.baseURL+"/langs/"+n+".js";t.add(o,l,void 0,function(){!function(t,e,n){Ah(t,"LanguageLoadError",Rh("language",o,n))}(e,0,n)})}})(n,t),function(t,e,n){var r=Mx(e,"default",n),o=function(t){return C.from(function(t){return t.getParam("icons_url","","string")}(t)).filter(function(t){return t.length>0}).map(function(t){return{url:t,name:C.none()}})}(e).orThunk(function(){return Mx(e,ns(e),"")});V(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([r,o]),function(n){t.add(n.url,l,void 0,function(){!function(t,e,n){Ah(t,"IconsLoadError",Rh("icons",e,n))}(e,n.url,n.name.getOrUndefined())})})}(n,t,e),function(t,e){ae.each(function(t){return t.getParam("external_plugins")}(t),function(e,n){Th.load(n,e,l,void 0,function(){Bh(t,e,n)}),t.settings.plugins+=" "+n}),ae.each(vs(t).split(/[ ,]/),function(n){if((n=ae.trim(n))&&!Th.urls[n])if(Px(n)){n=n.substr(1,n.length);var r=Th.dependencies(n);ae.each(r,function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"},o=Th.createUrl(r,n);Th.load(o.resource,o,l,void 0,function(){Bh(t,o.prefix+o.resource+o.suffix,o.resource)})})}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+e+".js"};Th.load(n,o,l,void 0,function(){Bh(t,o.prefix+o.resource+o.suffix,n)})}})}(t,e),n.loadQueue(function(){t.removed||Bx(t)},t,function(){t.removed||Bx(t)})})},Fx=function(t){return R(t)?t:d(!1)},Hx={"font-size":"size","font-family":"face"},jx=function(t,e,n){var r=function(e){return Tn(e,t).orThunk(function(){return"font"===ce(e)?lt(Hx,t).bind(function(t){return n=e,r=t,C.from(Cn(n,r));var n,r}):C.none()})};return function(t,e,n){var r=e(t),o=Fx(n);return r.orThunk(function(){return o(t)?C.none():function(t,e,n){for(var r=t.dom(),o=Fx(n);r.parentNode;){r=r.parentNode;var i=se.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return C.none()}(t,e,o)})}(se.fromDom(n),function(t){return r(t)},function(t){return ye(se.fromDom(e),t)})},Vx=function(t){return function(e,n){return C.from(n).map(se.fromDom).filter(de).bind(function(n){return jx(t,e,n.dom()).or(function(t,e){return C.from(Vi.DOM.getStyle(e,t,!0))}(t,n.dom()))}).getOr("")}},zx=Vx("font-size"),Ux=f(function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},Vx("font-family")),Wx=function(t){return xc(t.getBody()).map(function(t){var e=t.container();return fn(e)?e.parentNode:e})},qx=function(t){return C.from(t.selection.getRng()).bind(function(e){return function(t,e){return t.startContainer===e&&0===t.startOffset}(e,t.getBody())?C.none():C.from(t.selection.getStart(!0))})},$x=function(t,e){if(/^[0-9\.]+$/.test(e)){var n=parseInt(e,10);if(n>=1&&n<=7){var r=function(t){return ae.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(t),o=function(t){return ae.explode(t.getParam("font_size_classes",""))}(t);return o?o[n-1]||e:r[n-1]||e}return e}return e},Yx=function(t){var e=t.split(/\s*,\s*/);return j(e,function(t){return-1===t.indexOf(" ")||It(t,'"')||It(t,"'")?t:"'"+t+"'"}).join(",")},Gx=function(t,e){t.getDoc().execCommand(e,!1,null)},Kx=ae.each,Xx=ae.map,Jx=ae.inArray,Qx=function(){function t(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}return t.prototype.execCommand=function(t,e,n,r){var o,i=!1,a=this;if(!a.editor.removed){var u;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?(u=a.editor,ld(u).each(function(t){u.selection.setRng(t)})):a.editor.focus(),(r=a.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var s=t.toLowerCase();if(o=a.commands.exec[s])return o(s,e,n),a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(Kx(this.editor.plugins,function(r){if(r.execCommand&&r.execCommand(t,e,n))return a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),i=!0,!1}),i)return i;if(a.editor.theme&&a.editor.theme.execCommand&&a.editor.theme.execCommand(t,e,n))return a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{i=a.editor.getDoc().execCommand(t,e,n)}catch(t){}return!!i&&(a.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},t.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},t.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},t.prototype.addCommands=function(t,e){var n=this;e=e||"exec",Kx(t,function(t,r){Kx(r.toLowerCase().split(","),function(r){n.commands[e][r]=t})})},t.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,a){return e.call(n||r.editor,o,i,a)}},t.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},t.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},t.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},t.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},t.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},t.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},t.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e?{value:e}:void 0),this.editor.nodeChanged()},t.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},t.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},t.prototype.setupCommands=function(t){var e=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},"Cut,Copy,Paste":function(n){var r,o=t.getDoc();try{e.execNativeCommand(n)}catch(t){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");ne.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(t.selection.isCollapsed()){var e=t.dom.getParent(t.selection.getStart(),"a");e&&t.dom.remove(e,!0)}else t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),Kx("left,center,right,justify".split(","),function(e){r!==e&&t.formatter.remove("align"+e)}),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,r)},FontName:function(e,n,r){!function(t,e){var n=$x(t,r);t.formatter.toggle("fontname",{value:Yx(n)}),t.nodeChanged()}(t)},FontSize:function(e,n,r){!function(t,e){t.formatter.toggle("fontsize",{value:$x(t,e)}),t.nodeChanged()}(t,r)},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1},t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){!function(t,e){var n=function(t){var e;return"string"!=typeof t?(e=ae.extend({paste:t.paste,data:{paste:t.paste}},t),{content:t.content,details:e}):{content:t,details:{}}}(e);!function(t,e,n){Km(t).editor.insertContent(e,n)}(t,n.content,n.details)}(t,r)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,function(){return r}))},mceInsertNewLine:function(e,n,r){Vy(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){Xb(t,e)},mceRepaint:function(){},InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e=t.dom.getParent(t.selection.getStart(),gn);if(e){var n=t.dom.createRng();n.selectNodeContents(e),t.selection.setRng(n)}},delete:function(){!function(t){iy(t)||Pb(t,!1)||Lb(t,!1)||jb(t,!1)||yb(t,!1)||Vf(t)||Cb(t)||Ub(t,!1)||(Gx(t,"Delete"),cb(t))}(t)},forwardDelete:function(){!function(t){Pb(t,!0)||Lb(t,!0)||jb(t,!0)||yb(t,!0)||Vf(t)||Cb(t)||Ub(t,!0)||Gx(t,"ForwardDelete")}(t)},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return Dy(t,r),!0}});var n=function(e){return function(){var n=t.selection.isCollapsed()?[t.dom.getParent(t.selection.getNode(),t.dom.isBlock)]:t.selection.getSelectedBlocks(),r=Xx(n,function(n){return!!t.formatter.matchNode(n,e)});return-1!==Jx(r,!0)}};e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return Yb(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",function(){return function(t){return qx(t).fold(function(){return Wx(t).map(function(e){return Ux(t.getBody(),e)}).getOr("")},function(e){return Ux(t.getBody(),e)})}(t)},this),e.addQueryValueHandler("FontSize",function(){return function(t){return qx(t).fold(function(){return Wx(t).map(function(e){return zx(t.getBody(),e)}).getOr("")},function(e){return zx(t.getBody(),e)})}(t)},this)},t}(),Zx=function(t,e,n){oa(t,e)&&!1===n?function(t,e){na(t)?t.dom().classList.remove(e):function(t,e){(function(t,e,n){var r=U(ea(t,e),function(t){return t!==n});r.length>0?xn(t,e,r.join(" ")):_n(t,e)})(t,"class",e)}(t,e),function(t){0===(na(t)?t.dom().classList:function(t){return ea(t,"class")}(t)).length&&_n(t,"class")}(t)}(t,e):n&&ra(t,e)},tw=function(t,e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},ew=function(t,e){t.dom().contentEditable=e?"true":"false"},nw=function(t,e){var n=se.fromDom(t.getBody());Zx(n,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),function(t){C.from(t.selection.getNode()).each(function(t){t.removeAttribute("data-mce-selected")})}(t),t.readonly=!0,ew(n,!1),V(ia(n,'*[contenteditable="true"]'),function(t){xn(t,"data-mce-contenteditable","true"),ew(t,!1)})):(t.readonly=!1,ew(n,!0),V(ia(n,'*[data-mce-contenteditable="true"]'),function(t){_n(t,"data-mce-contenteditable"),ew(t,!0)}),tw(t,"StyleWithCSS",!1),tw(t,"enableInlineTableEditing",!1),tw(t,"enableObjectResizing",!1),function(t){return yd(t)||function(t){return Jf().filter(function(e){return!(void 0!==(n=e.dom().classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&hd(t,e.dom());var n}).isSome()}(t)}(t)&&t.focus(),function(t){t.selection.setRng(t.selection.getRng())}(t),t.nodeChanged())},rw=function(t){return t.readonly},ow=function(t){t.parser.addAttributeFilter("contenteditable",function(e){rw(t)&&V(e,function(t){t.attr("data-mce-contenteditable",t.attr("contenteditable")),t.attr("contenteditable","false")})}),t.serializer.addAttributeFilter("data-mce-contenteditable",function(e){rw(t)&&V(e,function(t){t.attr("contenteditable",t.attr("data-mce-contenteditable"))})}),t.serializer.addTempAttr("data-mce-contenteditable")},iw=ae.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"," "),aw=function(){function t(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||v}return t.isNative=function(t){return!!iw[t.toLowerCase()]},t.prototype.fire=function(t,e){t=t.toLowerCase(),(e=e||{}).type=t,e.target||(e.target=this.scope),e.preventDefault||(e.preventDefault=function(){e.isDefaultPrevented=b},e.stopPropagation=function(){e.isPropagationStopped=b},e.stopImmediatePropagation=function(){e.isImmediatePropagationStopped=b},e.isDefaultPrevented=v,e.isPropagationStopped=v,e.isImmediatePropagationStopped=v),this.settings.beforeFire&&this.settings.beforeFire(e);var n=this.bindings[t];if(n)for(var r=0,o=n.length;r<o;r++){var i=n[r];if(i.once&&this.off(t,i.func),e.isImmediatePropagationStopped())return e.stopPropagation(),e;if(!1===i.func.call(this.scope,e))return e.preventDefault(),e}return e},t.prototype.on=function(t,e,n,r){var o,i,a;if(!1===e&&(e=v),e){var u={func:e};for(r&&ae.extend(u,r),a=(i=t.toLowerCase().split(" ")).length;a--;)t=i[a],(o=this.bindings[t])||(o=this.bindings[t]=[],this.toggleEvent(t,!0)),n?o.unshift(u):o.push(u)}return this},t.prototype.off=function(t,e){var n,r,o,i,a=this;if(t)for(n=(o=t.toLowerCase().split(" ")).length;n--;){if(t=o[n],r=this.bindings[t],!t)return rt(this.bindings,function(t,e){a.toggleEvent(e,!1),delete a.bindings[e]}),this;if(r){if(e)for(i=r.length;i--;)r[i].func===e&&(r=r.slice(0,i).concat(r.slice(i+1)),this.bindings[t]=r);else r.length=0;r.length||(this.toggleEvent(t,!1),delete this.bindings[t])}}else rt(this.bindings,function(t,e){a.toggleEvent(e,!1)}),this.bindings={};return this},t.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},t.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},t}(),uw=function(t){return t._eventDispatcher||(t._eventDispatcher=new aw({scope:t,toggleEvent:function(e,n){aw.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher},sw={fire:function(t,e,n){if(this.removed&&"remove"!==t&&"detach"!==t)return e;var r=uw(this).fire(t,e);if(!1!==n&&this.parent)for(var o=this.parent();o&&!r.isPropagationStopped();)o.fire(t,r,!1),o=o.parent();return r},on:function(t,e,n){return uw(this).on(t,e,n)},off:function(t,e){return uw(this).off(t,e)},once:function(t,e){return uw(this).once(t,e)},hasEventListeners:function(t){return uw(this).has(t)}},cw=Vi.DOM,lw=function(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=ds(t);return n?(t.eventRoot||(t.eventRoot=cw.select(n)[0]),t.eventRoot):t.getBody()},fw=function(t,e,n){!function(t){return!t.hidden&&!rw(t)}(t)?rw(t)&&function(t,e){var n=e.target;"click"===e.type&&!gp.metaKeyPressed(e)&&function(t,e){return null!==t.dom.getParent(e,"a")}(t,n)&&e.preventDefault()}(t,n):t.fire(e,n)},dw=function(t,e){var n;if(t.delegates||(t.delegates={}),!t.delegates[e]&&!t.removed){var r=lw(t,e);if(ds(t)){if(gv||(gv={},t.editorManager.on("removeEditor",function(){t.editorManager.activeEditor||gv&&(rt(gv,function(e,n){t.dom.unbind(lw(t,n))}),gv=null)})),gv[e])return;n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var a=o[i].getBody();(a===r||cw.isChildOf(r,a))&&fw(o[i],e,n)}},gv[e]=n,cw.bind(r,e,n)}else n=function(n){fw(t,e,n)},cw.bind(r,e,n),t.delegates[e]=n}},mw=xt(xt({},sw),{bindPendingEventDelegates:function(){var t=this;ae.each(t._pendingNativeEvents,function(e){dw(t,e)})},toggleNativeEvent:function(t,e){"focus"!==t&&"blur"!==t&&(e?this.initialized?dw(this,t):this._pendingNativeEvents?this._pendingNativeEvents.push(t):this._pendingNativeEvents=[t]:this.initialized&&(this.dom.unbind(lw(this,t),t,this.delegates[t]),delete this.delegates[t]))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(rt(t.delegates,function(e,n){t.dom.unbind(lw(t,n),n,e)}),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),hw=["design","readonly"],pw=function(t,e,r,o){var i=r[e.get()],a=r[o];try{a.activate()}catch(t){return void n.console.error("problem while activating editor mode "+o+":",t)}i.deactivate(),i.editorReadOnly!==a.editorReadOnly&&nw(t,a.editorReadOnly),e.set(o),function(t,e){t.fire("SwitchMode",{mode:e})}(t,o)},gw=function(t){var e=$i("design"),r=$i({design:{activate:l,deactivate:l,editorReadOnly:!1},readonly:{activate:l,deactivate:l,editorReadOnly:!0}});return function(t){t.serializer?ow(t):t.on("PreInit",function(){ow(t)})}(t),function(t){t.on("ShowCaret",function(e){rw(t)&&e.preventDefault()}),t.on("ObjectSelected",function(e){rw(t)&&e.preventDefault()})}(t),{isReadOnly:function(){return rw(t)},set:function(n){return function(t,e,n,r){if(r!==n.get()){if(!ft(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?pw(t,n,e,r):t.on("init",function(){return pw(t,n,e,r)})}}(t,r.get(),e,n)},get:function(){return e.get()},register:function(t,e){r.set(function(t,e,r){var o;if(F(hw,e))throw new Error("Cannot override default mode "+e);return xt(xt({},t),((o={})[e]=xt(xt({},r),{deactivate:function(){try{r.deactivate()}catch(t){n.console.error("problem while deactivating editor mode "+e+":",t)}}}),o))}(r.get(),t,e))}}},vw=ae.each,bw=ae.explode,yw={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},xw=ae.makeMap("alt,ctrl,shift,meta,access"),ww=function(){function t(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(vw(e.shortcuts,function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0}),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))})}return t.prototype.add=function(t,e,n,r){var o=this,i=n;return"string"==typeof i?n=function(){o.editor.execCommand(i,!1,null)}:ae.isArray(i)&&(n=function(){o.editor.execCommand(i[0],i[1],i[2])}),vw(bw(ae.trim(t)),function(t){var i=o.createShortcut(t,e,n,r);o.shortcuts[i.id]=i}),!0},t.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},t.prototype.parseShortcut=function(t){var e,n={};vw(bw(t.toLowerCase(),"+"),function(t){t in xw?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=yw[t]||t.toUpperCase().charCodeAt(0))});var r=[n.keyCode];for(e in xw)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,ne.mac?n.ctrl=!0:n.shift=!0),n.meta&&(ne.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},t.prototype.createShortcut=function(t,e,n,r){var o=ae.map(bw(t,">"),this.parseShortcut);return o[o.length-1]=ae.extend(o[o.length-1],{func:n,scope:r||this.editor}),ae.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},t.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},t.prototype.isFunctionKey=function(t){return"keydown"===t.type&&t.keyCode>=112&&t.keyCode<=123},t.prototype.matchShortcut=function(t,e){return!!e&&e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&e.alt===t.altKey&&e.shift===t.shiftKey&&!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0)},t.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},t}(),Cw=function(){var t=function(){var t={},e={},n={},r={},o={},i={},a={},u=function(t,e){return function(n,r){return t[n.toLowerCase()]=xt(xt({},r),{type:e})}};return{addButton:u(t,"button"),addGroupToolbarButton:u(t,"grouptoolbarbutton"),addToggleButton:u(t,"togglebutton"),addMenuButton:u(t,"menubutton"),addSplitButton:u(t,"splitbutton"),addMenuItem:u(e,"menuitem"),addNestedMenuItem:u(e,"nestedmenuitem"),addToggleMenuItem:u(e,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(t,e){return r[t.toLowerCase()]=e},getAll:function(){return{buttons:t,menuItems:e,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}}}();return{addAutocompleter:t.addAutocompleter,addButton:t.addButton,addContextForm:t.addContextForm,addContextMenu:t.addContextMenu,addContextToolbar:t.addContextToolbar,addIcon:t.addIcon,addMenuButton:t.addMenuButton,addMenuItem:t.addMenuItem,addNestedMenuItem:t.addNestedMenuItem,addSidebar:t.addSidebar,addSplitButton:t.addSplitButton,addToggleButton:t.addToggleButton,addGroupToolbarButton:t.addGroupToolbarButton,addToggleMenuItem:t.addToggleMenuItem,getAll:t.getAll}},_w=ae.each,kw=ae.trim,Sw="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Tw={ftp:21,http:80,https:443,mailto:25},Ow=function(){function t(e,r){e=kw(e),this.settings=r||{};var o=this.settings.base_uri,i=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))i.source=e;else{var a=0===e.indexOf("//");if(0!==e.indexOf("/")||a||(e=(o&&o.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(n.document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)e="//mce_host"+i.toAbsPath(u,e);else{var s=/([^#?]*)([#?]?.*)/.exec(e);e=(o&&o.protocol||"http")+"://mce_host"+i.toAbsPath(u,s[1])+s[2]}}e=e.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);_w(Sw,function(t,e){var n=c[e];n&&(n=n.replace(/\(mce_at\)/g,"@@")),i[t]=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(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(e=r[1]),{type:e,data:n[1]}},t.getDocumentBaseUrl=function(t){var e;return e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},t.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=Tw[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},t.prototype.toRelPath=function(t,e){var n,r,o=0,i="",a=t.substring(0,t.lastIndexOf("/")).split("/"),u=e.split("/");if(a.length>=u.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||a[n]!==u[n]){o=n+1;break}if(a.length<u.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return e;for(n=0,r=a.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=u.length;n<r;n++)i+=n!==o-1?"/"+u[n]:u[n];return i},t.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],a=/\/$/.test(e)?"/":"",u=t.split("/"),s=e.split("/");for(_w(u,function(t){t&&i.push(t)}),u=i,n=s.length-1,i=[];n>=0;n--)0!==s[n].length&&"."!==s[n]&&(".."!==s[n]?o>0?o--:i.push(s[n]):o++);return 0!==(r=(n=u.length-o)<=0?X(i).join("/"):u.slice(0,n).join("/")+"/"+X(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},t.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},t}(),Dw=Vi.DOM,Ew=ae.extend,Nw=ae.each,Aw=ae.resolve,Rw=ne.ie,Bw=function(){function t(t,e,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,Ew(this,mw),this.settings=hh(this,t,this.documentBaseUrl,n.defaultSettings,e),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(qi.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),Vi.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),Qi.languageLoad=this.settings.language_load,Qi.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new Ow(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new ww(this),this.editorCommands=new Qx(this),this.settings.cache_suffix&&(ne.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:Cw(),styleSheetLoader:void 0};var o=gw(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=li.overrideDefaults(function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}})}return t.prototype.render=function(){!function(t){var e=t.id;Xi.setCode(cs(t));if(zr.Event.domLoaded){if(t.getElement()&&ne.contentEditable){var r=se.fromDom(t.getElement()),o=q(r.dom().attributes,function(t,e){return t[e.name]=e.value,t},{});t.on("remove",function(){z(r.dom().attributes,function(t){return _n(r,t.name)}),wn(r,o)}),t.ui.styleSheetLoader=function(t,e){return Ri.forElement(t,{contentCssCors:gs(e),referrerPolicy:ss(e)})}(r,t),function(t){return t.getParam("inline")}(t)?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var i=t.getElement().form||Ix.getParent(e,"form");i&&(t.formElement=i,function(t){return t.getParam("hidden_input")}(t)&&!ln(t.getElement())&&(Ix.insertAfter(Ix.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},Ix.bind(i,"submit reset",t.formEventDelegate),t.on("reset",function(){t.resetContent()}),!function(t){return t.getParam("submit_patch")}(t)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=Dh(t),t.notificationManager=Sh(t),function(t){return"xml"===t.getParam("encoding")}(t)&&t.on("GetContent",function(t){t.save&&(t.content=Ix.encode(t.content))}),function(t){return t.getParam("add_form_submit_trigger")}(t)&&t.on("submit",function(){t.initialized&&t.save()}),function(t){return t.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),Lx(t,t.suffix)}}else Ix.bind(n.window,"ready",function e(){Ix.unbind(n.window,"ready",e),t.render()})}(this)},t.prototype.focus=function(t){!function(t,e){t.removed||(e?xd(t):function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===yd(t)&&ld(t).each(function(e){t.selection.setRng(e),r=e});var o=function(t,e){return t.dom.getParent(e,function(e){return"true"===t.dom.getContentEditable(e)})}(t,e.getNode());if(t.$.contains(n,o))return bd(o),vd(t,r),void xd(t);t.inline||(ne.opera||bd(n),t.getWin().focus()),(ne.gecko||t.inline)&&(bd(n),vd(t,r)),xd(t)}(t))}(this,t)},t.prototype.hasFocus=function(){return yd(this)},t.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this,i=o.settings[t];if(i)return o.callbackLookup&&(r=o.callbackLookup[t])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?Aw(r):0,i=Aw(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[t]={func:i,scope:r}),i.apply(r||o,e)},t.prototype.translate=function(t){return Xi.translate(t)},t.prototype.getParam=function(t,e,n){return function(t,e,n,r){var o,i=e in t.settings?t.settings[e]:n;return"hash"===r?function(t){var e={};return"string"==typeof t?V(t.indexOf("=")>0?t.split(/[;,](?![^=;,]*(?:[;,]|$))/):t.split(","),function(t){var n=t.split("=");n.length>1?e[ae.trim(n[0])]=ae.trim(n[1]):e[ae.trim(n[0])]=ae.trim(n[0])}):e=t,e}(i):"string"===r?ph(T,t,e).getOr(n):"number"===r?ph(B,t,e).getOr(n):"boolean"===r?ph(N,t,e).getOr(n):"object"===r?ph(O,t,e).getOr(n):"array"===r?ph(D,t,e).getOr(n):"string[]"===r?ph((o=T,function(t){return D(t)&&K(t,o)}),t,e).getOr(n):"function"===r?ph(R,t,e).getOr(n):i}(this,t,e,n)},t.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},t.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},t.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},t.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},t.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},t.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},t.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},t.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},t.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},t.prototype.show=function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable="true":(Dw.show(this.getContainer()),Dw.hide(this.id)),this.load(),this.fire("show"))},t.prototype.hide=function(){var t=this.getDoc();this.hidden||(Rw&&t&&!this.inline&&t.execCommand("SelectAll"),this.save(),this.inline?(this.getBody().contentEditable="false",this===this.editorManager.focusedEditor&&(this.editorManager.focusedEditor=null)):(Dw.hide(this.getContainer()),Dw.setStyle(this.id,"display",this.orgDisplay)),this.hidden=!0,this.fire("hide"))},t.prototype.isHidden=function(){return!!this.hidden},t.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},t.prototype.load=function(t){var e,n=this.getElement();if(this.removed)return"";if(n){(t=t||{}).load=!0;var r=ln(n)?n.value:n.innerHTML;return e=this.setContent(r,t),t.element=n,t.no_events||this.fire("LoadContent",t),t.element=n=null,e}},t.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,ln(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=Dw.getParent(r.id,"form"))&&Nw(n.elements,function(t){if(t.name===r.id)return t.value=e,!1})),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},t.prototype.setContent=function(t,e){return Jm(this,t,e)},t.prototype.getContent=function(t){return function(t,e){return void 0===e&&(e={}),function(t,e,n){return Km(t).editor.getContent(e,n)}(t,e,e.format?e.format:"html")}(this,t)},t.prototype.insertContent=function(t,e){e&&(t=Ew({content:t},e)),this.execCommand("mceInsertContent",!1,t)},t.prototype.resetContent=function(t){void 0===t?Jm(this,this.startContent,{format:"raw"}):Jm(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},t.prototype.isDirty=function(){return!this.isNotDirty},t.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},t.prototype.getContainer=function(){return this.container||(this.container=Dw.get(this.editorContainer||this.id+"_parent")),this.container},t.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},t.prototype.getElement=function(){return this.targetElm||(this.targetElm=Dw.get(this.id)),this.targetElm},t.prototype.getWin=function(){var t;return this.contentWindow||(t=this.iframeElement)&&(this.contentWindow=t.contentWindow),this.contentWindow},t.prototype.getDoc=function(){var t;return this.contentDocument||(t=this.getWin())&&(this.contentDocument=t.document),this.contentDocument},t.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},t.prototype.convertURL=function(t,e,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",t,n,!0,e):!r.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:r.relative_urls?this.documentBaseURI.toRelative(t):t=this.documentBaseURI.toAbsolute(t,r.remove_script_host)},t.prototype.addVisual=function(t){var e,n=this,r=n.settings,o=n.dom;t=t||n.getBody(),void 0===n.hasVisual&&(n.hasVisual=r.visual),Nw(o.select("table,a",t),function(t){var i;switch(t.nodeName){case"TABLE":return e=r.visual_table_class||"mce-item-table",void((i=o.getAttrib(t,"border"))&&"0"!==i||!n.hasVisual?o.removeClass(t,e):o.addClass(t,e));case"A":return void(o.getAttrib(t,"href")||(i=o.getAttrib(t,"name")||t.id,e=r.visual_anchor_class||"mce-item-anchor",i&&n.hasVisual?o.addClass(t,e):o.removeClass(t,e)))}}),n.fire("VisualAid",{element:t,hasVisual:n.hasVisual})},t.prototype.remove=function(){!function(t){if(!t.removed){var e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement();r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&Qm.remove(o.nextSibling),function(t){t.fire("remove")}(t),t.editorManager.remove(t),!t.inline&&r&&function(t){Qm.setStyle(t.id,"display",t.orgDisplay)}(t),function(t){t.fire("detach")}(t),Qm.remove(t.getContainer()),Zm(e),Zm(n),t.destroy()}}(this)},t.prototype.destroy=function(t){!function(t,e){var n=t.selection,r=t.dom;t.destroyed||(e||t.removed?(e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),Zm(n),Zm(r)),function(t){var e=t.formElement;e&&(e._mceOldSubmit&&(e.submit=e._mceOldSubmit,e._mceOldSubmit=null),Qm.unbind(e,"submit reset",t.formEventDelegate))}(t),function(t){t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null)}(t),t.destroyed=!0):t.remove())}(this,t)},t.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},t.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},t.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},t.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},t.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},t.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},t}(),Iw=Vi.DOM,Pw=ae.explode,Mw=ae.each,Lw=ae.extend,Fw=0,Hw=!1,jw=[],Vw=[],zw=function(t){var e=t.type;Mw($w.get(),function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}})},Uw=function(t){t!==Hw&&(t?li(window).on("resize scroll",zw):li(window).off("resize scroll",zw),Hw=t)},Ww=function(t){var e=Vw;delete jw[t.id];for(var n=0;n<jw.length;n++)if(jw[n]===t){jw.splice(n,1);break}return Vw=U(Vw,function(e){return t!==e}),$w.activeEditor===t&&($w.activeEditor=Vw.length>0?Vw[0]:null),$w.focusedEditor===t&&($w.focusedEditor=null),e.length!==Vw.length},qw="CSS1Compat"!==n.document.compatMode,$w=xt(xt({},sw),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:li,majorVersion:"5",minorVersion:"4.1",releaseDate:"2020-07-08",editors:jw,i18n:Xi,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e,r="";e=Ow.getDocumentBaseUrl(n.document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,r=i.suffix;else{for(var a=n.document.getElementsByTagName("script"),u=0;u<a.length;u++){var s;if(""!==(s=a[u].src||"")){var c=s.substring(s.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(s)){-1!==c.indexOf(".min")&&(r=".min"),t=s.substring(0,s.lastIndexOf("/"));break}}}!t&&n.document.currentScript&&(-1!==(s=n.document.currentScript.src).indexOf(".min")&&(r=".min"),t=s.substring(0,s.lastIndexOf("/")))}this.baseURL=new Ow(e).toAbsolute(t),this.documentBaseURL=e,this.baseURI=new Ow(this.baseURL),this.suffix=r,(o=this).on("AddEditor",h(pd,o)),o.on("RemoveEditor",h(gd,o))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n),this.defaultSettings=t;var r=t.plugin_base_urls;void 0!==r&&rt(r,function(t,e){Qi.PluginManager.urls[e]=t})},init:function(t){var e,r=this,o=ae.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),i=function(t){var e=t.id;return e||(e=lt(t,"name").filter(function(t){return!Iw.get(t)}).getOrThunk(Iw.uniqueId),t.setAttribute("id",e)),e},a=function(t,e){return e.constructor===RegExp?e.test(t.className):Iw.hasClass(t,e)},u=function(t){e=t};return r.settings=t,Iw.bind(window,"ready",function e(){var s,c=0,l=[],f=function(t,e,n){var o=new Bw(t,e,r);l.push(o),o.on("init",function(){++c===s.length&&u(l)}),o.targetElm=o.targetElm||n,o.render()};Iw.unbind(window,"ready",e),function(e){var n=t.onpageload;n&&n.apply(r,Array.prototype.slice.call(arguments,2))}("onpageload"),s=li.unique(function(t){var e=[];if(ne.browser.isIE()&&ne.browser.version.major<11)return Ih("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(qw)return Ih("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return Mw(t.types,function(t){e=e.concat(Iw.select(t.selector))}),e;if(t.selector)return Iw.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var r=t.elements||"";r.length>0&&Mw(Pw(r),function(t){var r=Iw.get(t);r?e.push(r):Mw(n.document.forms,function(n){Mw(n.elements,function(n){n.name===t&&(t="mce_editor_"+Fw++,Iw.setAttrib(n,"id",t),e.push(n))})})});break;case"textareas":case"specific_textareas":Mw(Iw.select("textarea"),function(n){t.editor_deselector&&a(n,t.editor_deselector)||t.editor_selector&&!a(n,t.editor_selector)||e.push(n)})}return e}(t)),t.types?Mw(t.types,function(e){ae.each(s,function(n){return!Iw.is(n,e.selector)||(f(i(n),Lw({},t,e),n),!1)})}):(ae.each(s,function(t){var e;(e=r.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&(Ww(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0,e=null)}),0===(s=ae.grep(s,function(t){return!r.get(t.id)})).length?u([]):Mw(s,function(e){!function(t,e){return t.inline&&e.tagName.toLowerCase()in o}(t,e)?f(i(e),t,e):Ih("Could not initialize inline editor on invalid inline target element",e)}))}),new Ti(function(t){e?t(e):u=function(e){t(e)}})},get:function(t){return 0===arguments.length?Vw.slice(0):T(t)?$(Vw,function(e){return e.id===t}).getOr(null):B(t)&&Vw[t]?Vw[t]:null},add:function(t){var e=this;return jw[t.id]===t||(null===e.get(t.id)&&("length"!==t.id&&(jw[t.id]=t),jw.push(t),Vw.push(t)),Uw(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),vv||(vv=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",vv))),t},createEditor:function(t,e){return this.add(new Bw(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!T(t))return n=t,E(r.get(n.id))?null:(Ww(n)&&r.fire("RemoveEditor",{editor:n}),0===Vw.length&&window.removeEventListener("beforeunload",vv),n.remove(),Uw(Vw.length>0),n);Mw(Iw.select(t),function(t){(n=r.get(t.id))&&r.remove(n)})}else for(e=Vw.length-1;e>=0;e--)r.remove(Vw[e])},execCommand:function(t,e,n){var r=this.get(n);switch(t){case"mceAddEditor":return this.get(n)||new Bw(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?(r.isHidden()?r.show():r.hide(),!0):(this.execCommand("mceAddEditor",0,n),!0)}return!!this.activeEditor&&this.activeEditor.execCommand(t,e,n)},triggerSave:function(){Mw(Vw,function(t){t.save()})},addI18n:function(t,e){Xi.add(t,e)},translate:function(t){return Xi.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new Ow(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new Ow(this.baseURL)}});function Yw(t){return{walk:function(e,n){return cl(t,e,n)},split:Sd,normalize:function(e){return fp(t,e).fold(d(!1),function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0})}}}$w.setup(),function(t){t.compareRanges=np,t.getCaretRangeFromPoint=Jh,t.getSelectedNode=Ya,t.getNode=Ga}(Yw||(Yw={}));var Gw,Kw,Xw,Jw,Qw=Yw,Zw=(Gw={},Kw={},{load:function(t,e){var r='Script at URL "'+e+'" failed to load',o='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==Gw[t])return Gw[t];var i=new Ti(function(i,a){var u=function(t,e,r){void 0===r&&(r=1e3);var o=!1,i=null,a=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];o||(o=!0,null!==i&&(n.clearTimeout(i),i=null),t.apply(null,e))}},u=a(t),s=a(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];o||null!==i||(i=n.setTimeout(function(){return s.apply(null,t)},r))},resolve:u,reject:s}}(i,a);Kw[t]=u.resolve,qi.ScriptLoader.loadScript(e,function(){return u.start(o)},function(){return u.reject(r)})});return Gw[t]=i,i},add:function(t,e){void 0!==Kw[t]&&(Kw[t](e),delete Kw[t]),Gw[t]=Ti.resolve(e)}}),tC=Math.min,eC=Math.max,nC=Math.round,rC=function(t,e,n){var r=e.x,o=e.y,i=t.w,a=t.h,u=e.w,s=e.h;return"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=nC(s/2)),"c"===n[1]&&(r+=nC(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=nC(a/2)),"c"===n[4]&&(r-=nC(i/2)),oC(r,o,i,a)},oC=function(t,e,n,r){return{x:t,y:e,w:n,h:r}},iC={inflate:function(t,e,n){return oC(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:rC,findBestRelativePosition:function(t,e,n,r){var o,i;for(i=0;i<r.length;i++)if((o=rC(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=eC(t.x,e.x),r=eC(t.y,e.y),o=tC(t.x+t.w,e.x+e.w),i=tC(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:oC(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,a=t.y+t.h,u=e.x+e.w,s=e.y+e.h,c=eC(0,e.x-r),l=eC(0,e.y-o),f=eC(0,i-u),d=eC(0,a-s);return r+=c,o+=l,n&&(i+=c,a+=l,r-=f,o-=d),oC(r,o,(i-=f)-r,(a-=d)-o)},create:oC,fromClientRect:function(t){return oC(t.left,t.top,t.width,t.height)}},aC=ae.each,uC=ae.extend,sC=function(){};sC.extend=Xw=function(t){var e=this.prototype,n=function(){var t,e,n,r=this;if(!Jw&&(r.init&&r.init.apply(r,arguments),e=r.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(r,arguments)},r=function(){return this};Jw=!0;var o=new this;return Jw=!1,t.Mixins&&(aC(t.Mixins,function(e){for(var n in e)"init"!==n&&(t[n]=e[n])}),e.Mixins&&(t.Mixins=e.Mixins.concat(t.Mixins))),t.Methods&&aC(t.Methods.split(","),function(e){t[e]=r}),t.Properties&&aC(t.Properties.split(","),function(e){var n="_"+e;t[e]=function(t){return void 0!==t?(this[n]=t,this):this[n]}}),t.Statics&&aC(t.Statics,function(t,e){n[e]=t}),t.Defaults&&e.Defaults&&(t.Defaults=uC({},e.Defaults,t.Defaults)),rt(t,function(t,n){"function"==typeof t&&e[n]?o[n]=function(t,n){return function(){var r=this,o=r._super;r._super=e[t];var i=n.apply(r,arguments);return r._super=o,i}}(n,t):o[n]=t}),n.prototype=o,n.constructor=n,n.extend=Xw,n};var cC,lC=Math.min,fC=Math.max,dC=Math.round,mC={serialize:function(t){var e=JSON.stringify(t);return T(e)?e.replace(/[\u0080-\uFFFF]/g,function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e}):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},hC={callbacks:{},count:0,send:function(t){var e=this,n=Vi.DOM,r=void 0!==t.count?t.count:e.count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},pC=xt(xt({},sw),{send:function(t){var e,r=0,o=function n(){!t.async||4===e.readyState||r++>1e4?(t.success&&r<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,r>1e4?"TIMED_OUT":"GENERAL",e,t),e=null):Ni.setTimeout(n,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",pC.fire("beforeInitialize",{settings:t}),e=new n.XMLHttpRequest){if(e.overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&ae.each(t.requestheaders,function(t){e.setRequestHeader(t.key,t.value)}),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=pC.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return o();Ni.setTimeout(o,10)}}}),gC=ae.extend,vC=function(){function t(t){this.settings=gC({},t),this.count=0}return t.sendRPC=function(e){return(new t).send(e)},t.prototype.send=function(t){var e=t.error,n=t.success,r=gC(this.settings,t);r.success=function(t,o){void 0===(t=mC.parse(t))&&(t={error:"JSON Parse error."}),t.error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=mC.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",pC.send(r)},t}();try{var bC="__storage_test__";(cC=n.window.localStorage).setItem(bC,bC),cC.removeItem(bC)}catch(t){cC=function(){var t={},e=[],n={getItem:function(e){return t[e]||null},setItem:function(n,r){e.push(n),t[n]=String(r)},key:function(t){return e[t]},removeItem:function(n){e=e.filter(function(t){return t===n}),delete t[n]},clear:function(){e=[],t={}},length:0};return Object.defineProperty(n,"length",{get:function(){return e.length},configurable:!1,enumerable:!1}),n}()}var yC={geom:{Rect:iC},util:{Promise:Ti,Delay:Ni,Tools:ae,VK:gp,URI:Ow,Class:sC,EventDispatcher:aw,Observable:sw,I18n:Xi,XHR:pC,JSON:mC,JSONRequest:vC,JSONP:hC,LocalStorage:cC,Color:function(t){var e={},n=0,r=0,o=0,i=function(t){var i;return"object"==_typeof(t)?"r"in t?(n=t.r,r=t.g,o=t.b):"v"in t&&function(t,e,i){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,i=parseInt(i,10)/100,e=fC(0,lC(e,1)),i=fC(0,lC(i,1)),0!==e){var a=t/60,u=i*e,s=u*(1-Math.abs(a%2-1)),c=i-u;switch(Math.floor(a)){case 0:n=u,r=s,o=0;break;case 1:n=s,r=u,o=0;break;case 2:n=0,r=u,o=s;break;case 3:n=0,r=s,o=u;break;case 4:n=s,r=0,o=u;break;case 5:n=u,r=0,o=s;break;default:n=r=o=0}n=dC(255*(n+c)),r=dC(255*(r+c)),o=dC(255*(o+c))}else n=r=o=dC(255*i)}(t.h,t.s,t.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,e};return t&&i(t),e.toRgb=function(){return{r:n,g:r,b:o}},e.toHsv=function(){return function(t,e,n){var r,o;o=0;var i=lC(t/=255,lC(e/=255,n/=255)),a=fC(t,fC(e,n));return i===a?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,o=a,{h:dC(60*((t===i?3:n===i?1:5)-(t===i?e-n:n===i?t-e:n-t)/(a-i))),s:dC(100*r),v:dC(100*o)})}(n,r,o)},e.toHex=function(){var t=function(t){return(t=parseInt(t,10).toString(16)).length>1?t:"0"+t};return"#"+t(n)+t(r)+t(o)},e.parse=i,e}},dom:{EventUtils:zr,Sizzle:ko,DomQuery:li,TreeWalker:fi,TextSeeker:ka,DOMUtils:Vi,ScriptLoader:qi,RangeUtils:Qw,Serializer:Up,StyleSheetLoader:Ai,ControlSelection:yp,BookmarkManager:hp,Selection:_p,Event:zr.Event},html:{Styles:Br,Entities:or,Node:Dl,Schema:hr,SaxParser:Ll,DomParser:Hp,Writer:Nl,Serializer:Al},Env:ne,AddOnManager:Qi,Annotator:Cl,Formatter:ng,UndoManager:rg,EditorCommands:Qx,WindowManager:Dh,NotificationManager:Sh,EditorObservable:mw,Shortcuts:ww,Editor:Bw,FocusManager:fd,EditorManager:$w,DOM:Vi.DOM,ScriptLoader:qi.ScriptLoader,PluginManager:Qi.PluginManager,ThemeManager:Qi.ThemeManager,IconManager:gh,Resource:Zw,trim:ae.trim,isArray:ae.isArray,is:ae.is,toArray:ae.toArray,makeMap:ae.makeMap,each:ae.each,map:ae.map,grep:ae.grep,inArray:ae.inArray,extend:ae.extend,create:ae.create,walk:ae.walk,createNS:ae.createNS,resolve:ae.resolve,explode:ae.explode,_addCacheSuffix:ae._addCacheSuffix,isOpera:ne.opera,isWebKit:ne.webkit,isIE:ne.ie,isGecko:ne.gecko,isMac:ne.mac},xC=ae.extend($w,yC);!function(t){window.tinymce=t,window.tinyMCE=t}(xC),function(e){try{t.exports=e}catch(t){}}(xC)}(window)}).call(this,n("yLpj"))},"5oMp":function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},"7bfH":function(t,e,n){var r,o,i;o=[n("EVdn"),n("wCe6"),n("GC/X"),n("N6cA"),n("vBzC"),n("r15H"),n("Jchv"),n("y6ec"),n("Qwlt"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){return t.widget("ui.selectmenu",[t.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=t()},_drawButton:function(){var e,n=this,r=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=t("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),e=t("<span>").appendTo(this.button),this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(r).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){n._rendered||n._refreshMenu()})},_drawMenu:function(){var e=this;this.menu=t("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=t("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,n){t.preventDefault(),e._setSelection(),e._select(n.item.data("ui-selectmenu-item"),t)},focus:function(t,n){var r=n.item.data("ui-selectmenu-item");null!=e.focusIndex&&r.index!==e.focusIndex&&(e._trigger("focus",t,{item:r}),e.isOpen||e._select(r,t)),e.focusIndex=r.index,e.button.attr("aria-activedescendant",e.menuItems.eq(r.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(t.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var n=t("<span>");return this._setText(n,e.label),this._addClass(n,"ui-selectmenu-text"),n},_renderMenu:function(e,n){var r=this,o="";t.each(n,function(n,i){var a;i.optgroup!==o&&(a=t("<li>",{text:i.optgroup}),r._addClass(a,"ui-selectmenu-optgroup","ui-menu-divider"+(i.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),a.appendTo(e),o=i.optgroup),r._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(e,n){var r=t("<li>"),o=t("<div>",{title:n.element.attr("title")});return n.disabled&&this._addClass(r,null,"ui-state-disabled"),this._setText(o,n.label),r.append(o).appendTo(e)},_setText:function(t,e){e?t.text(e):t.html("&#160;")},_move:function(t,e){var n,r,o=".ui-menu-item";this.isOpen?n=this.menuItems.eq(this.focusIndex).parent("li"):(n=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),o+=":not(.ui-state-disabled)"),(r="first"===t||"last"===t?n["first"===t?"prevAll":"nextAll"](o).eq(-1):n[t+"All"](o).eq(0)).length&&this.menuInstance.focus(e,r)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?((t=window.getSelection()).removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){this.isOpen&&(t(e.target).closest(".ui-selectmenu-menu, #"+t.ui.escapeSelector(this.ids.button)).length||this.close(e))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection()).rangeCount&&(this.range=t.getRangeAt(0)):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(e){var n=!0;switch(e.keyCode){case t.ui.keyCode.TAB:case t.ui.keyCode.ESCAPE:this.close(e),n=!1;break;case t.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case t.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case t.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case t.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case t.ui.keyCode.LEFT:this._move("prev",e);break;case t.ui.keyCode.RIGHT:this._move("next",e);break;case t.ui.keyCode.HOME:case t.ui.keyCode.PAGE_UP:this._move("first",e);break;case t.ui.keyCode.END:case t.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),n=!1}n&&e.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var n=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==n&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){if("icons"===t){var n=this.button.find("span.ui-icon");this._removeClass(n,null,this.options.icons.button)._addClass(n,null,e.button)}this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;!1!==t?(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t)):this.button.css("width","")},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(e){var n=this,r=[];e.each(function(e,o){r.push(n._parseOption(t(o),e))}),this.items=r},_parseOption:function(t,e){var n=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:n.attr("label")||"",disabled:n.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}])})?r.apply(e,o):r)||(t.exports=i)},"7x9u":function(t,e){!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){var e=function(t){return t.getContent({source_view:!0})}(t);t.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){!function(t,e){t.focus(),t.undoManager.transact(function(){t.setContent(e)}),t.selection.setCursorLocation(),t.nodeChanged()}(t,e.getData().code),e.close()}})};t.add("code",function(t){return function(t){t.addCommand("mceCodeEditor",function(){e(t)})}(t),function(t){t.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return e(t)}}),t.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return e(t)}})}(t),{}})}()},"8Iik":function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.fn.scrollParent=function(e){var n=this.css("position"),r="absolute"===n,o=e?/(auto|scroll|hidden)/:/(auto|scroll)/,i=this.parents().filter(function(){var e=t(this);return(!r||"static"!==e.css("position"))&&o.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==n&&i.length?i:t(this[0].ownerDocument||document)}})?r.apply(e,o):r)||(t.exports=i)},"8oxB":function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,c=[],l=!1,f=-1;function d(){l&&s&&(l=!1,s.length?c=s.concat(c):f=-1,c.length&&m())}function m(){if(!l){var t=u(d);l=!0;for(var e=c.length;e;){for(s=c,c=[];++f<e;)s&&s[f].run();f=-1,e=c.length}s=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function p(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new h(t,e)),1!==c.length||l||u(m)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=p,o.addListener=p,o.once=p,o.off=p,o.removeListener=p,o.removeAllListeners=p,o.emit=p,o.prependListener=p,o.prependOnceListener=p,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},"9/yf":function(t,e,n){var r,o,i;o=[n("EVdn"),n("wCe6"),n("vBzC"),n("Jchv"),n("yw1R"),n("Qwlt"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){return t.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,n,r,o=this.element[0].nodeName.toLowerCase(),i="textarea"===o,a="input"===o;this.isMultiLine=i||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[i||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(o){if(this.element.prop("readOnly"))return e=!0,r=!0,void(n=!0);e=!1,r=!1,n=!1;var i=t.ui.keyCode;switch(o.keyCode){case i.PAGE_UP:e=!0,this._move("previousPage",o);break;case i.PAGE_DOWN:e=!0,this._move("nextPage",o);break;case i.UP:e=!0,this._keyEvent("previous",o);break;case i.DOWN:e=!0,this._keyEvent("next",o);break;case i.ENTER:this.menu.active&&(e=!0,o.preventDefault(),this.menu.select(o));break;case i.TAB:this.menu.active&&this.menu.select(o);break;case i.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(o),o.preventDefault());break;default:n=!0,this._searchTimeout(o)}},keypress:function(r){if(e)return e=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||r.preventDefault());if(!n){var o=t.ui.keyCode;switch(r.keyCode){case o.PAGE_UP:this._move("previousPage",r);break;case o.PAGE_DOWN:this._move("nextPage",r);break;case o.UP:this._keyEvent("previous",r);break;case o.DOWN:this._keyEvent("next",r)}}},input:function(t){if(r)return r=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),this._change(t))}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,n){var r,o;if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)});o=n.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:o})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(o.value),(r=n.item.attr("aria-label")||o.value)&&t.trim(r).length&&(this.liveRegion.children().hide(),t("<div>").text(r).appendTo(this.liveRegion))},menuselect:function(e,n){var r=n.item.data("ui-autocomplete-item"),o=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=o,this._delay(function(){this.previous=o,this.selectedItem=r})),!1!==this._trigger("select",e,{item:r})&&this._value(r.value),this.term=this._value(),this.close(e),this.selectedItem=r}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var n=this.menu.element[0];return e.target===this.element[0]||e.target===n||t.contains(n,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,n,r=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(n,r){r(t.ui.autocomplete.filter(e,n.term))}):"string"==typeof this.options.source?(n=this.options.source,this.source=function(e,o){r.xhr&&r.xhr.abort(),r.xhr=t.ajax({url:n,data:e,dataType:"json",success:function(t){o(t)},error:function(){o([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),n=this.menu.element.is(":visible"),r=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;e&&(!e||n||r)||(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var n=this.menu.element.empty();this._renderMenu(n,e),this.isNewMenu=!0,this.menu.refresh(),n.show(),this._resizeMenu(),n.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,n){var r=this;t.each(n,function(t,n){r._renderItemData(e,n)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,n){return t("<li>").append(t("<div>").text(n.label)).appendTo(e)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,n){var r=new RegExp(t.ui.autocomplete.escapeRegex(n),"i");return t.grep(e,function(t){return r.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var n;this._superApply(arguments),this.options.disabled||this.cancelSearch||(n=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(n).appendTo(this.liveRegion))}}),t.ui.autocomplete})?r.apply(e,o):r)||(t.exports=i)},"9rSQ":function(t,e,n){"use strict";var r=n("xTJ+");function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},Aw8l:function(t,e,n){(function(t){!function(e){"use strict";var n=function(){},r=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},o=function(t){return function(){return t}},i=function(t){return t};function a(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var u=function(t){return function(e){return!t(e)}},s=function(t){return function(){throw new Error(t)}},c=o(!1),l=o(!0),f=tinymce.util.Tools.resolve("tinymce.ThemeManager"),d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function m(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function h(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}var p,g=function(){return v},v=function(){var t=function(t){return t.isNone()},e=function(t){return t()},r=function(t){return t};return{fold:function(t,e){return t()},is:c,isSome:c,isNone:l,getOr:r,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(void 0),or:r,orThunk:e,map:g,each:n,bind:g,exists:c,forall:l,filter:g,equals:t,equals_:t,toArray:function(){return[]},toString:o("none()")}}(),b=function t(e){var n=o(e),r=function(){return a},i=function(t){return t(e)},a={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:l,isNone:c,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:r,orThunk:r,map:function(n){return t(n(e))},each:function(t){t(e)},bind:i,exists:i,forall:i,filter:function(t){return t(e)?a:v},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(c,function(t){return n(e,t)})}};return a},y={some:b,none:g,from:function(t){return null==t?v:b(t)}},x=function(t){return function(e){return function(t){var e=_typeof(t);return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(e)===t}},w=function(t){return function(e){return _typeof(e)===t}},C=x("string"),_=x("object"),k=x("array"),S=w("boolean"),T=function(t){return void 0===t},O=function(t){return!function(t){return null==t}(t)},D=w("function"),E=w("number"),N=function(t,e){if(k(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},A=Array.prototype.slice,R=Array.prototype.indexOf,B=Array.prototype.push,I=function(t,e){return R.call(t,e)},P=function(t,e){return I(t,e)>-1},M=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1},L=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},F=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=A.call(t,r,r+e);n.push(o)}return n},H=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},j=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},V=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var a=t[o];(e(a,o)?n:r).push(a)}return{pass:n,fail:r}},z=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},U=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n])}(t,function(t){n=e(n,t)}),n},W=function(t,e,n){return j(t,function(t){n=e(n,t)}),n},q=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return y.some(i);if(n(i,r))break}return y.none()}(t,e,c)},$=function(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return y.some(n);return y.none()},Y=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!k(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);B.apply(e,t[n])}return e},G=function(t,e){return Y(H(t,e))},K=function(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0},X=function(t){var e=A.call(t,0);return e.reverse(),e},J=function(t,e){return z(t,function(t){return!P(e,t)})},Q=function(t,e){var n=A.call(t,0);return n.sort(e),n},Z=function(t){return 0===t.length?y.none():y.some(t[0])},tt=function(t){return 0===t.length?y.none():y.some(t[t.length-1])},et=D(Array.from)?Array.from:function(t){return A.call(t)},nt=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return y.none()},rt=function t(e){return{is:function(t){return e===t},isValue:l,isError:c,getOr:o(e),getOrThunk:o(e),getOrDie:o(e),or:function(n){return t(e)},orThunk:function(n){return t(e)},fold:function(t,n){return n(e)},map:function(n){return t(n(e))},mapError:function(n){return t(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return y.some(e)}}},ot=function t(e){return{is:c,isValue:c,isError:l,getOr:i,getOrThunk:function(t){return t()},getOrDie:function(){return s(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(n){return t(e)},mapError:function(n){return t(n(e))},each:n,bind:function(n){return t(e)},exists:c,forall:l,toOption:y.none}},it={value:rt,error:ot,fromOption:function(t,e){return t.fold(function(){return ot(e)},rt)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(p||(p={}));var at=function(t,e,n){return t.stype===p.Error?e(t.serror):n(t.svalue)},ut=function(t){return{stype:p.Value,svalue:t}},st=function(t){return{stype:p.Error,serror:t}},ct=ut,lt=function(t){var e=[],n=[];return j(t,function(t){at(t,function(t){return n.push(t)},function(t){return e.push(t)})}),{values:e,errors:n}},ft=st,dt=function(t,e){return t.stype===p.Value?e(t.svalue):t},mt=function(t,e){return t.stype===p.Value?{stype:p.Value,svalue:e(t.svalue)}:t},ht=Object.keys,pt=Object.hasOwnProperty,gt=function(t,e){for(var n=ht(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},vt=function(t,e){return bt(t,function(t,n){return{k:n,v:e(t,n)}})},bt=function(t,e){var n={};return gt(t,function(t,r){var o=e(t,r);n[o.k]=o.v}),n},yt=function(t,e){var n=[];return gt(t,function(t,r){n.push(e(t,r))}),n},xt=function(t,e){for(var n=ht(t),r=0,o=n.length;r<o;r++){var i=n[r],a=t[i];if(e(a,i,t))return y.some(a)}return y.none()},wt=function(t){return yt(t,function(t){return t})},Ct=function(t,e){return _t(t,e)?y.from(t[e]):y.none()},_t=function(t,e){return pt.call(t,e)},kt=function(t,e){return _t(t,e)&&void 0!==t[e]&&null!==t[e]},St=function(t){if(!k(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 j(t,function(o,i){var a=ht(o);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],s=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(!k(s))throw new Error("case arguments must be an array");n.push(u),r[u]=function(){var r=arguments.length;if(r!==s.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+s.length+" ("+s+"), got "+r);for(var o=new Array(r),a=0;a<o.length;a++)o[a]=arguments[a];return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);return arguments[i].apply(null,o)},match:function(t){var e=ht(t);if(n.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+n.join(",")+"\nActual: "+e.join(","));if(!K(n,function(t){return P(e,t)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+n.join(", "));return t[u].apply(null,o)},log:function(t){e.console.log(t,{constructors:n,constructor:u,params:o})}}}}),r},Tt=Object.prototype.hasOwnProperty,Ot=function(t){return function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var a in i)Tt.call(i,a)&&(r[a]=t(r[a],i[a]))}return r}},Dt=Ot(function(t,e){return _(t)&&_(e)?Dt(t,e):e}),Et=Ot(function(t,e){return e}),Nt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},At=St([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Rt=function(t){return At.defaultedThunk(o(t))},Bt=function(t){return At.mergeWithThunk(o(t))},It=At.strict,Pt=At.asOption,Mt=At.defaultedThunk,Lt=(At.asDefaultedOptionThunk,At.mergeWithThunk),Ft=function(t,e){var n;return(n={})[t]=e,n},Ht=(St([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t,e){return function(t,e){var n={};return gt(t,function(t,r){P(e,r)||(n[r]=t)}),n}(t,e)}),jt=function(t,e){return Ft(t,e)},Vt=function(t){return function(t){var e={};return j(t,function(t){e[t.key]=t.value}),e}(t)},zt=function(t){return r(ft,Y)(t)},Ut=function(t){var e=lt(t);return e.errors.length>0?zt(e.errors):ct(e.values)},Wt=function(t){return _(t)&&ht(t).length>100?" removed due to size":JSON.stringify(t,null,2)},qt=function(t,e){return ft([{path:t,getErrorInfo:e}])},$t=St([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Yt=function(t,e,n){var r=Ct(t,e).fold(function(){return n(t)},i);return ct(r)},Gt=function(t,e,n,r){return n.fold(function(n,i,a,u){var s=function(e){var o=u.extract(t.concat([n]),r,e);return mt(o,function(t){return Ft(i,r(t))})},c=function(e){return e.fold(function(){var t=Ft(i,r(y.none()));return ct(t)},function(e){var o=u.extract(t.concat([n]),r,e);return mt(o,function(t){return Ft(i,r(y.some(t)))})})};return a.fold(function(){return dt(function(t,e,n){return Ct(e,n).fold(function(){return function(t,e,n){return qt(t,function(){return'Could not find valid *strict* value for "'+e+'" in '+Wt(n)})}(t,n,e)},ct)}(t,e,n),s)},function(t){return dt(Yt(e,n,t),s)},function(){return dt(ct(Ct(e,n)),c)},function(t){return dt(function(t,e,n){var r=Ct(t,e).map(function(e){return!0===e?n(t):e});return ct(r)}(e,n,t),c)},function(t){var r=t(e),i=mt(Yt(e,n,o({})),function(t){return Dt(r,t)});return dt(i,s)})},function(t,n){var o=n(e);return ct(Ft(t,r(o)))})},Kt=function(t){return{extract:function(e,n,r){return function(t,e){return t.stype===p.Error?e(t.serror):t}(t(r,n),function(t){return function(t,e){return qt(t,function(){return e})}(e,t)})},toString:function(){return"val"}}},Xt=function(t){return ht(function(t,e){var r={};return function(t,e,n,r){gt(t,function(t,o){(e(t,o)?n:r)(t,o)})}(t,e,function(t){return function(e,n){t[n]=e}}(r),n),r}(t,function(t){return null!=t}))},Jt=function(t){var e=Qt(t),n=U(t,function(t,e){return e.fold(function(e){return Dt(t,jt(e,!0))},o(t))},{});return{extract:function(t,r,o){var i=S(o)?[]:Xt(o),a=z(i,function(t){return!kt(n,t)});return 0===a.length?e.extract(t,r,o):function(t,e){return qt(t,function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"})}(t,a)},toString:e.toString}},Qt=function(t){return{extract:function(e,n,r){return function(t,e,n,r){return function(t,e){var n=lt(t);return n.errors.length>0?zt(n.errors):function(t,e){return t.length>0?ct(Dt(e,Et.apply(void 0,t))):ct(e)}(n.values,e)}(H(n,function(n){return Gt(t,e,n,r)}),{})}(e,r,t,n)},toString:function(){return"obj{\n"+H(t,function(t){return t.fold(function(t,e,n,r){return t+" -> "+r.toString()},function(t,e){return"state("+t+")"})}).join("\n")+"}"}}},Zt=function(t){return{extract:function(e,n,r){var o=H(r,function(r,o){return t.extract(e.concat(["["+o+"]"]),n,r)});return Ut(o)},toString:function(){return"array("+t.toString()+")"}}},te=o(Kt(ct)),ee=r(Zt,Qt),ne=$t.state,re=$t.field,oe=function(t,e){return{extract:function(n,r,o){return Ct(o,t).fold(function(){return e=t,qt(n,function(){return'Choice schema did not contain choice key: "'+e+'"'});var e},function(t){return function(t,e,n,r,o){return Ct(r,o).fold(function(){return function(t,e,n){return qt(t,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Wt(e)})}(t,r,o)},function(r){return r.extract(t.concat(["branch: "+o]),e,n)})}(n,r,o,e,t)})},toString:function(){return"chooseOn("+t+"). Possible values: "+ht(e)}}},ie=Kt(ct),ae=function(t){return ee(t)},ue=function(t){return Kt(function(e){return t(e).fold(ft,ct)})},se=function(t,e){return function(t,e){return{extract:function(n,r,o){var a=ht(o),u=function(e,n){return Zt(Kt(t)).extract(e,i,n)}(n,a);return dt(u,function(t){var i=H(t,function(t){return $t.field(t,t,It(),e)});return Qt(i).extract(n,r,o)})},toString:function(){return"setOf("+e.toString()+")"}}}(function(e){return function(t){return t.fold(st,ut)}(t(e))},e)},ce=function(t,e,n){return function(t){return at(t,it.error,it.value)}(function(t,e,n,r){return function(t,e){return t.stype===p.Error?{stype:p.Error,serror:e(t.serror)}:t}(e.extract([t],n,r),function(t){return{input:r,errors:t}})}(t,e,i,n))},le=function(t){return t.fold(function(t){throw new Error(de(t))},i)},fe=function(t,e,n){return le(ce(t,e,n))},de=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,H(n,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()})).join("\n")+"\n\nInput object: "+Wt(t.input);var e,n},me=function(t,e){return oe(t,e)},he=function(t,e){return oe(t,vt(e,Qt))},pe=o(ie),ge=function(t,e){return Kt(function(n){var r=_typeof(n);return t(n)?ct(n):ft("Expected type: "+e+" but got: "+r)})},ve=ge(E,"number"),be=ge(C,"string"),ye=ge(S,"boolean"),xe=ge(D,"function"),we=Kt(function(t){return function t(e){var n=function(t,e){for(var n=t.next();!n.done;){if(!e(n.value))return!1;n=t.next()}return!0};if(Object(e)!==e)return!0;switch({}.toString.call(e).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(e).every(function(n){return t(e[n])});case"Map":return n(e.keys(),t)&&n(e.values(),t);case"Set":return n(e.keys(),t);default:return!1}}(t)?ct(t):ft("Expected value to be acceptable for sending via postMessage")}),Ce=function(t){return ue(function(e){return P(t,e)?it.value(e):it.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')})},_e=function(t){return re(t,t,It(),te())},ke=function(t,e){return re(t,t,It(),e)},Se=function(t){return ke(t,ve)},Te=function(t){return ke(t,be)},Oe=function(t,e){return re(t,t,It(),Ce(e))},De=function(t){return ke(t,xe)},Ee=function(t,e){return re(t,t,It(),Qt(e))},Ne=function(t,e){return re(t,t,It(),ee(e))},Ae=function(t,e){return re(t,t,It(),Zt(e))},Re=function(t){return re(t,t,Pt(),te())},Be=function(t,e){return re(t,t,Pt(),e)},Ie=function(t){return Be(t,ve)},Pe=function(t){return Be(t,be)},Me=function(t){return Be(t,xe)},Le=function(t,e){return Be(t,Qt(e))},Fe=function(t,e){return re(t,t,Rt(e),te())},He=function(t,e,n){return re(t,t,Rt(e),n)},je=function(t,e){return He(t,e,ve)},Ve=function(t,e){return He(t,e,be)},ze=function(t,e,n){return He(t,e,Ce(n))},Ue=function(t,e){return He(t,e,ye)},We=function(t,e){return He(t,e,xe)},qe=function(t,e,n){return He(t,e,Qt(n))},$e=function(t,e){return ne(t,e)},Ye=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Ge=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:o(t)}},Ke={fromHtml:function(t,n){var r=(n||e.document).createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.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 Ge(r.childNodes[0])},fromTag:function(t,n){var r=(n||e.document).createElement(t);return Ge(r)},fromText:function(t,n){var r=(n||e.document).createTextNode(t);return Ge(r)},fromDom:Ge,fromPoint:function(t,e,n){var r=t.dom();return y.from(r.elementFromPoint(e,n)).map(Ge)}},Xe=function(){return Je(0,0)},Je=function(t,e){return{major:t,minor:e}},Qe=function(t,e){var n=String(e).toLowerCase();return 0===t.length?Xe():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return Je(r(1),r(2))}(t,n)},Ze=Xe,tn=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},en=function(){return tn({current:void 0,version:Ze()})},nn=tn,rn=(o("Edge"),o("Chrome"),o("IE"),o("Opera"),o("Firefox"),o("Safari"),function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}}),on=function(){return rn({current:void 0,version:Ze()})},an=rn,un=(o("Windows"),o("iOS"),o("Android"),o("Linux"),o("OSX"),o("Solaris"),o("FreeBSD"),o("ChromeOS"),function(t,e){var n=String(e).toLowerCase();return q(t,function(t){return t.search(n)})}),sn=function(t,e){return-1!==t.indexOf(e)},cn=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),ln=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,fn=function(t){return function(e){return sn(e,t)}},dn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return sn(t,"edge/")&&sn(t,"chrome")&&sn(t,"safari")&&sn(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ln],search:function(t){return sn(t,"chrome")&&!sn(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return sn(t,"msie")||sn(t,"trident")}},{name:"Opera",versionRegexes:[ln,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:fn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:fn("firefox")},{name:"Safari",versionRegexes:[ln,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(sn(t,"safari")||sn(t,"mobile/"))&&sn(t,"applewebkit")}}],mn=[{name:"Windows",search:fn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return sn(t,"iphone")||sn(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:fn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:fn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:fn("linux"),versionRegexes:[]},{name:"Solaris",search:fn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:fn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:fn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],hn={browsers:o(dn),oses:o(mn)},pn=function(t,e){var n=hn.browsers(),r=hn.oses(),i=function(t,e){return un(t,e).map(function(t){var n=Qe(t.versionRegexes,e);return{current:t.name,version:n}})}(n,t).fold(en,nn),a=function(t,e){return un(t,e).map(function(t){var n=Qe(t.versionRegexes,e);return{current:t.name,version:n}})}(r,t).fold(on,an);return{browser:i,os:a,deviceType:function(t,e,n,r){var i=t.isiOS()&&!0===/ipad/i.test(n),a=t.isiOS()&&!i,u=t.isiOS()||t.isAndroid(),s=u||r("(pointer:coarse)"),c=i||!a&&u&&r("(min-device-width:768px)"),l=a||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!c&&!f;return{isiPad:o(i),isiPhone:o(a),isTablet:o(c),isPhone:o(l),isTouch:o(s),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:o(f),isDesktop:o(d)}}(a,i,t,e)}},gn=function(t){return e.window.matchMedia(t).matches},vn=Nt(function(){return pn(e.navigator.userAgent,gn)}),bn=function(){return vn()},yn=function(t,e){var n=t.dom();if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},xn=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},wn=function(t,e){return t.dom()===e.dom()},Cn=function(t,n){return function(t,n){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,n,e.Node.DOCUMENT_POSITION_CONTAINED_BY)}(t.dom(),n.dom())},_n=function(t,e){return bn().browser.isIE()?Cn(t,e):function(t,e){var n=t.dom(),r=e.dom();return n!==r&&n.contains(r)}(t,e)},kn=function(t){return D(t)?t:o(!1)},Sn=function(t,e,n){for(var r=t.dom(),o=kn(n);r.parentNode;){r=r.parentNode;var i=Ke.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return y.none()},Tn=function(t,e,n){var r=e(t),o=kn(n);return r.orThunk(function(){return o(t)?y.none():Sn(t,e,o)})},On=function(t,e){return wn(t.element(),e.event().target())},Dn=function(t){if(!kt(t,"can")&&!kt(t,"abort")&&!kt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return fe("Extracting event.handler",Jt([Fe("can",o(!0)),Fe("abort",o(!1)),Fe("run",n)]),t)},En=o("touchstart"),Nn=o("touchmove"),An=o("touchend"),Rn=o("touchcancel"),Bn=o("mousedown"),In=o("mousemove"),Pn=o("mouseout"),Mn=o("mouseup"),Ln=o("mouseover"),Fn=o("focusin"),Hn=o("focusout"),jn=o("keydown"),Vn=o("keyup"),zn=o("input"),Un=o("change"),Wn=o("click"),qn=o("transitionend"),$n=o("selectstart"),Yn={tap:o("alloy.tap")},Gn=o("alloy.focus"),Kn=o("alloy.blur.post"),Xn=o("alloy.paste.post"),Jn=o("alloy.receive"),Qn=o("alloy.execute"),Zn=o("alloy.focus.item"),tr=Yn.tap,er=o("alloy.longpress"),nr=o("alloy.sandbox.close"),rr=o("alloy.typeahead.cancel"),or=o("alloy.system.init"),ir=o("alloy.system.touchmove"),ar=o("alloy.system.touchend"),ur=o("alloy.system.scroll"),sr=o("alloy.system.resize"),cr=o("alloy.system.attached"),lr=o("alloy.system.detached"),fr=o("alloy.system.dismissRequested"),dr=o("alloy.system.repositionRequested"),mr=o("alloy.focusmanager.shifted"),hr=o("alloy.slotcontainer.visibility"),pr=o("alloy.change.tab"),gr=o("alloy.dismiss.tab"),vr=o("alloy.highlight"),br=o("alloy.dehighlight"),yr=function(t,e){_r(t,t.element(),e,{})},xr=function(t,e,n){_r(t,t.element(),e,n)},wr=function(t){yr(t,Qn())},Cr=function(t,e,n){_r(t,e,n,{})},_r=function(t,e,n,r){var i=d({target:e},r);t.getSystem().triggerEvent(n,e,vt(i,o))},kr=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event())},Sr=function(t){return Vt(t)},Tr=function(t,e){return{key:t,value:Dn({abort:e})}},Or=function(t){return{key:t,value:Dn({run:function(t,e){e.event().prevent()}})}},Dr=function(t,e){return{key:t,value:Dn({run:e})}},Er=function(t,e,n){return{key:t,value:Dn({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Nr=function(t){return function(e){return{key:t,value:Dn({run:function(t,n){On(t,n)&&e(t,n)}})}}},Ar=function(t,e,n){return function(t,e){return Dr(t,function(n,r){n.getSystem().getByUid(e).each(function(e){kr(e,e.element(),t,r)})})}(t,e.partUids[n])},Rr=function(t,e){return Dr(t,function(t,n){var r=n.event(),i=t.getSystem().getByDom(r.target()).fold(function(){return Tn(r.target(),function(e){return t.getSystem().getByDom(e).toOption()},o(!1)).getOr(t)},function(t){return t});e(t,i,n)})},Br=function(t){return Dr(t,function(t,e){e.cut()})},Ir=function(t){return Dr(t,function(t,e){e.stop()})},Pr=function(t,e){return Nr(t)(e)},Mr=Nr(cr()),Lr=Nr(lr()),Fr=Nr(or()),Hr=function(t){return function(e){return Dr(t,e)}}(Qn()),jr=(void 0!==e.window?e.window:Function("return this;")(),function(t){return t.dom().nodeName.toLowerCase()}),Vr=function(t){return function(e){return e.dom().nodeType===t}},zr=Vr(1),Ur=Vr(3),Wr=Vr(9),qr=Vr(11),$r=function(t){return Ke.fromDom(t.dom().ownerDocument)},Yr=function(t){return Wr(t)?t:$r(t)},Gr=function(t){return Ke.fromDom(t.dom().ownerDocument.documentElement)},Kr=function(t){return Ke.fromDom(t.dom().ownerDocument.defaultView)},Xr=function(t){return y.from(t.dom().parentNode).map(Ke.fromDom)},Jr=function(t){return y.from(t.dom().offsetParent).map(Ke.fromDom)},Qr=function(t){return H(t.dom().childNodes,Ke.fromDom)},Zr=function(t,e){var n=t.dom().childNodes;return y.from(n[e]).map(Ke.fromDom)},to=function(t,e){Xr(t).each(function(n){n.dom().insertBefore(e.dom(),t.dom())})},eo=function(t,e){(function(t){return y.from(t.dom().nextSibling).map(Ke.fromDom)})(t).fold(function(){Xr(t).each(function(t){ro(t,e)})},function(t){to(t,e)})},no=function(t,e){(function(t){return Zr(t,0)})(t).fold(function(){ro(t,e)},function(n){t.dom().insertBefore(e.dom(),n.dom())})},ro=function(t,e){t.dom().appendChild(e.dom())},oo=function(t,e){j(e,function(e){ro(t,e)})},io=function(t){t.dom().textContent="",j(Qr(t),function(t){ao(t)})},ao=function(t){var e=t.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},uo=function(t){var e,n=Qr(t);n.length>0&&(e=t,j(n,function(t){to(e,t)})),ao(t)},so=function(t){return t.dom().innerHTML},co=function(t,n){var r,o,i=$r(t).dom(),a=Ke.fromDom(i.createDocumentFragment()),u=(r=n,(o=(i||e.document).createElement("div")).innerHTML=r,Qr(Ke.fromDom(o)));oo(a,u),io(t),ro(t,a)},lo=function(t,n,r){if(!(C(r)||S(r)||E(r)))throw e.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,r+"")},fo=function(t,e,n){lo(t.dom(),e,n)},mo=function(t,e){var n=t.dom().getAttribute(e);return null===n?void 0:n},ho=function(t,e){return y.from(mo(t,e))},po=function(t,e){var n=t.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},go=function(t,e){t.dom().removeAttribute(e)},vo=function(t){return function(t){var e=Ke.fromTag("div"),n=Ke.fromDom(t.dom().cloneNode(!0));return ro(e,n),so(e)}(function(t){return function(t,e){return Ke.fromDom(t.dom().cloneNode(!1))}(t)}(t))},bo=function(t){return vo(t)},yo=Sr([function(t,e){return{key:Gn(),value:Dn({can:e})}}(0,function(t,n){var r=n.event().originator(),o=n.event().target();return!function(t,e,n){return wn(e,t.element())&&!wn(e,n)}(t,r,o)||(e.console.warn(Gn()+" did not get interpreted by the desired target. \nOriginator: "+bo(r)+"\nTarget: "+bo(o)+"\nCheck the "+Gn()+" event handlers"),!1)})]),xo=Object.freeze({__proto__:null,events:yo}),wo=0,Co=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++wo+String(e)},_o=o("alloy-id-"),ko=o("data-alloy-id"),So=_o(),To=ko(),Oo=function(t,e){Object.defineProperty(t.dom(),To,{value:e,writable:!0})},Do=function(t){var e=zr(t)?t.dom()[To]:null;return y.from(e)},Eo=function(t){return Co(t)},No=i,Ao=function(t){var e=function(e){return function(){throw new Error("The component must be in a context to send: "+e+(t?"\n"+bo(t().element())+" is not in context.":""))}};return{debugInfo:o("fake"),triggerEvent:e("triggerEvent"),triggerFocus:e("triggerFocus"),triggerEscape:e("triggerEscape"),build:e("build"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),broadcast:e("broadcast"),broadcastOn:e("broadcastOn"),broadcastEvent:e("broadcastEvent"),isConnected:o(!1)}},Ro=Ao(),Bo=function(t){return H(t,function(t){return function(t,e){return function(t,e,n){return t.length>=e.length&&t.substr(n,n+e.length)===e}(t,"/*",t.length-"/*".length)}(t)?t.substring(0,t.length-"/*".length):t})},Io=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:Bo(i)}},t},Po=Co("alloy-premade"),Mo=function(t){return jt(Po,t)},Lo=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Bo(i.slice(1))}},t}(function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,h([e.getApis(),e],n))},t)},Fo={init:function(){return Ho({readState:function(){return"No State required"}})}},Ho=function(t){return t},jo=function(t,e){var n={};return gt(t,function(t,r){gt(t,function(t,o){var i=Ct(n,o).getOr([]);n[o]=i.concat([e(r,t)])})}),n},Vo=function(t){return{classes:void 0!==t.classes?t.classes:[],attributes:void 0!==t.attributes?t.attributes:{},styles:void 0!==t.styles?t.styles:{}}},zo=function(t,e){return n=a.apply(void 0,[t.handler].concat(e)),r=t.purpose(),{cHandler:n,purpose:o(r)};var n,r},Uo=function(t){return t.cHandler},Wo=function(t,e){return{name:o(t),handler:o(e)}},qo=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=Q(n,function(n,o){var i=n[e](),a=o[e](),u=r.indexOf(i),s=r.indexOf(a);if(-1===u)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===s)throw new Error("The ordering for "+t+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(r,null,2));return u<s?-1:s<u?1:0});return it.value(o)}catch(t){return it.error([t])}}("Event: "+n,"name",t,r).map(function(t){return function(t){var e=function(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return W(t,function(t,n){return t&&function(t){return t.can}(n).apply(void 0,e)},!0)}}(t),n=function(t,e){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return W(t,function(t,n){return t||function(t){return t.abort}(n).apply(void 0,e)},!1)}}(t);return Dn({can:e,abort:n,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];j(t,function(t){t.run.apply(void 0,e)})}})}(H(t,function(t){return t.handler()}))}):function(t,e){return it.error(["The event ("+n+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(H(e,function(t){return t.name()}),null,2)])}(0,t)},$o=function(t,e){return function(t,e){var n,r=function(t){var e=[],n=[];return j(t,function(t){t.fold(function(t){e.push(t)},function(t){n.push(t)})}),{errors:e,values:n}}(t);return r.errors.length>0?(n=r.errors,it.error(Y(n))):function(t,e){return 0===t.length?it.value(e):it.value(Dt(e,Et.apply(void 0,t)))}(r.values,e)}(yt(t,function(t,n){return(1===t.length?it.value(t[0].handler()):qo(t,e,n)).map(function(r){var i=function(t){var e=function(t){return D(t)?{can:o(!0),abort:o(!1),run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}}(r),a=t.length>1?z(e[n],function(e){return M(t,function(t){return t.name()===e})}).join(" > "):t[0].name();return jt(n,{handler:i,purpose:o(a)})})}),{})},Yo=function(t){return t.events},Go=function(t,e){var n=mo(t,e);return void 0===n||""===n?[]:n.split(" ")},Ko=function(t){return void 0!==t.dom().classList},Xo=function(t,e){Ko(t)?t.dom().classList.add(e):function(t,e){(function(t,e,n){var r=Go(t,e).concat([n]);fo(t,e,r.join(" "))})(t,"class",e)}(t,e)},Jo=function(t,e){Ko(t)?t.dom().classList.remove(e):function(t,e){(function(t,e,n){var r=z(Go(t,e),function(t){return t!==n});r.length>0?fo(t,e,r.join(" ")):go(t,e)})(t,"class",e)}(t,e),function(t){0===(Ko(t)?t.dom().classList:function(t){return Go(t,"class")}(t)).length&&go(t,"class")}(t)},Qo=function(t,e){return Ko(t)&&t.dom().classList.contains(e)},Zo=function(t,e){j(e,function(e){Xo(t,e)})},ti=function(t,e){j(e,function(e){Jo(t,e)})},ei=function(t){return void 0!==t.style&&D(t.style.getPropertyValue)},ni=function(t){return qr(t)},ri=D(e.Element.prototype.attachShadow)&&D(e.Node.prototype.getRootNode),oi=o(ri),ii=ri?function(t){return Ke.fromDom(t.dom().getRootNode())}:Yr,ai=function(t){return Ke.fromDom(t.dom().host)},ui=function t(e){var n,r,o=Ur(e)?e.dom().parentNode:e.dom();return null!=o&&null!==o.ownerDocument&&function(t){var e=ii(t);return ni(e)?y.some(e):y.none()}(Ke.fromDom(o)).fold(function(){return o.ownerDocument.body.contains(o)},(n=t,r=ai,function(t){return n(r(t))}))},si=function(){return ci(Ke.fromDom(e.document))},ci=function(t){var e=t.dom().body;if(null==e)throw new Error("Body is not available yet");return Ke.fromDom(e)},li=function(t,n,r){if(!C(r))throw e.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",t),new Error("CSS value must be a string: "+r);ei(t)&&t.style.setProperty(n,r)},fi=function(t,e){ei(t)&&t.style.removeProperty(e)},di=function(t,e,n){var r=t.dom();li(r,e,n)},mi=function(t,e){var n=t.dom();gt(e,function(t,e){li(n,e,t)})},hi=function(t,e){var n=t.dom();gt(e,function(t,e){t.fold(function(){fi(n,e)},function(t){li(n,e,t)})})},pi=function(t,n){var r=t.dom(),o=e.window.getComputedStyle(r).getPropertyValue(n);return""!==o||ui(t)?o:gi(r,n)},gi=function(t,e){return ei(t)?t.style.getPropertyValue(e):""},vi=function(t,e){var n=t.dom(),r=gi(n,e);return y.from(r).filter(function(t){return t.length>0})},bi=function(t){var e={},n=t.dom();if(ei(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},yi=function(t,e,n){var r=Ke.fromTag(t);return di(r,e,n),vi(r,e).isSome()},xi=function(t,e){var n=t.dom();fi(n,e),ho(t,"style").map(cn).is("")&&go(t,"style")},wi=function(t){return t.dom().offsetWidth},Ci=function(t){return t.dom().value},_i=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom().value=e},ki=function(t){return function(t,e){return function(t,e){var n=H(e,function(t){return Le(t.name(),[_e("config"),Fe("state",Fo)])}),r=ce("component.behaviours",Qt(n),t.behaviours).fold(function(e){throw new Error(de(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))},function(t){return t});return{list:e,data:vt(r,function(t){var e=t.map(function(t){return{config:t.config,state:t.state.init(t.config)}});return function(){return e}})}}(t,e)}(t,function(t){var e=Ct(t,"behaviours").getOr({}),n=z(ht(e),function(t){return void 0!==e[t]});return H(n,function(t){return e[t].me})}(t))},Si=function(t,e,n){var r={"alloy.base.behaviour":Yo(t)};return function(t,e,n,r){var o=function(t,e,n){var r=d(d({},n),function(t,e){var n={};return j(t,function(t){n[t.name()]=t.handlers(e)}),n}(e,t));return jo(r,Wo)}(t,n,r);return $o(o,e)}(n,t.eventOrder,e,r).getOrDie()},Ti=function(t){var e=function(){return f},n=Ye(Ro),r=le(function(t){return ce("custom.definition",Qt([re("dom","dom",It(),Qt([_e("tag"),Fe("styles",{}),Fe("classes",[]),Fe("attributes",{}),Re("value"),Re("innerHtml")])),_e("components"),_e("uid"),Fe("events",{}),Fe("apis",{}),re("eventOrder","eventOrder",Bt({"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"],"alloy.receive":["receiving","reflecting","tooltipping"]}),pe()),Re("domModification")]),t)}(t)),i=ki(t),a=i.list,u=i.data,s=function(t){var e=Ke.fromTag(t.tag);!function(t,e){var n=t.dom();gt(e,function(t,e){lo(n,e,t)})}(e,t.attributes),Zo(e,t.classes),mi(e,t.styles),t.innerHtml.each(function(t){return co(e,t)});var n=t.domChildren;return oo(e,n),t.value.each(function(t){_i(e,t)}),t.uid,Oo(e,t.uid),e}(function(t,e,n){var r,o,i,a=d(d({},(r=t).dom),{uid:r.uid,domChildren:H(r.components,function(t){return t.element()})}),u=function(t){return t.domModification.fold(function(){return Vo({})},Vo)}(t),s={"alloy.base.modification":u};return i=e.length>0?function(t,e,n,r){var o=d({},e);j(n,function(e){o[e.name()]=e.exhibit(t,r)});var i=jo(o,function(t,e){return{name:t,modification:e}}),a=function(t){return U(t,function(t,e){return d(d({},e.modification),t)},{})},u=U(i.classes,function(t,e){return e.modification.concat(t)},[]),s=a(i.attributes),c=a(i.styles);return Vo({classes:u,attributes:s,styles:c})}(n,s,e,a):u,d(d({},o=a),{attributes:d(d({},o.attributes),i.attributes),styles:d(d({},o.styles),i.styles),classes:o.classes.concat(i.classes)})}(r,a,u)),c=Si(r,a,u),l=Ye(r.components),f={getSystem:n.get,config:function(e){var n=u;return(D(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return D(u[t.name()])},spec:o(t),readState:function(t){return u[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(Ao(e))},element:o(s),syncComponents:function(){var t=Qr(s),e=G(t,function(t){return n.get().getByDom(t).fold(function(){return[]},function(t){return[t]})});l.set(e)},components:l.get,events:o(c)};return f},Oi=function(t){var e=No(t),n=e.events,r=m(e,["events"]),o=function(t){var e=Ct(r,"components").getOr([]);return H(e,Ai)}(),i=d(d({},r),{events:d(d({},xo),n),components:o});return it.value(Ti(i))},Di=function(t){var e=Ke.fromText(t);return Ei({element:e})},Ei=function(t){var e=fe("external.component",Jt([_e("element"),Re("uid")]),t),r=Ye(Ao());e.uid.each(function(t){Oo(e.element,t)});var i={getSystem:r.get,config:y.none,hasConfigured:o(!1),connect:function(t){r.set(t)},disconnect:function(){r.set(Ao(function(){return i}))},getApis:function(){return{}},element:o(e.element),spec:o(t),readState:o("No state"),syncComponents:n,components:o([]),events:o({})};return Mo(i)},Ni=Eo,Ai=function(t){return function(t){return Ct(t,Po)}(t).fold(function(){var e=t.hasOwnProperty("uid")?t:d({uid:Ni("")},t);return Oi(e).getOrDie()},function(t){return t})},Ri=Mo;function Bi(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=pi(n,t);return parseFloat(o)||0}return r},r=function(t,e){return W(e,function(e,n){var r=pi(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o},0)};return{set:function(e,n){if(!E(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom();ei(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}}var Ii=Bi("height",function(t){var e=t.dom();return ui(t)?e.getBoundingClientRect().height:e.offsetHeight}),Pi=function(t){return Ii.get(t)},Mi=function(t){return Ii.getOuter(t)},Li=function t(e,n){return{left:o(e),top:o(n),translate:function(r,o){return t(e+r,n+o)}}},Fi=function(t,e){return void 0!==t?t:void 0!==e?e:0},Hi=function(t){var e=t.dom().ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom())return Li(n.offsetLeft,n.offsetTop);var i=Fi(r.pageYOffset,o.scrollTop),a=Fi(r.pageXOffset,o.scrollLeft),u=Fi(o.clientTop,n.clientTop),s=Fi(o.clientLeft,n.clientLeft);return ji(t).translate(a-s,i-u)},ji=function(t){var e=t.dom(),n=e.ownerDocument.body;return n===e?Li(n.offsetLeft,n.offsetTop):ui(t)?function(t){var e=t.getBoundingClientRect();return Li(e.left,e.top)}(e):Li(0,0)},Vi=Bi("width",function(t){return t.dom().offsetWidth}),zi=function(t){return Vi.get(t)},Ui=function(t){return Vi.getOuter(t)},Wi=function(t){var e=Ke.fromDom(function(t){if(oi()&&O(t.target)){var e=Ke.fromDom(t.target);if(zr(e)&&function(t){return O(t.dom().shadowRoot)}(Ke.fromDom(t.target))){var n=t;if(n.composed&&n.composedPath){var r=n.composedPath();if(r)return Z(r)}}}return y.from(t.target)}(t).getOr(t.target)),n=function(){return t.stopPropagation()},i=function(){return t.preventDefault()},a=r(i,n);return function(t,e,n,r,i,a,u){return{target:o(t),x:o(e),y:o(n),stop:r,prevent:i,kill:a,raw:o(u)}}(e,t.clientX,t.clientY,n,i,a,t)},qi=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(Wi(n))}}(n,r);return t.dom().addEventListener(e,i,o),{unbind:a($i,t,e,i,o)}},$i=function(t,e,n,r){t.dom().removeEventListener(e,n,r)},Yi=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 Li(r,o)},Gi=function(t,n,r){(void 0!==r?r.dom():e.document).defaultView.scrollTo(t,n)},Ki=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Xi=function(t){var n=void 0===t?e.window:t,r=n.document,o=Yi(Ke.fromDom(r));return function(t){var n=void 0===t?e.window:t;return y.from(n.visualViewport)}(n).fold(function(){var t=n.document.documentElement,e=t.clientWidth,r=t.clientHeight;return Ki(o.left(),o.top(),e,r)},function(t){return Ki(Math.max(t.pageLeft,o.left()),Math.max(t.pageTop,o.top()),t.width,t.height)})},Ji=Object.freeze({__proto__:null,view:function(t){return(t.dom()===e.document?y.none():y.from(t.dom().defaultView.frameElement)).map(Ke.fromDom)},owner:function(t){return $r(t)}}),Qi=function(t){var n=Ke.fromDom(e.document),r=Yi(n);return function(t,e){var n=e.owner(t),r=function t(e,n){return e.view(n).fold(o([]),function(n){var r=e.owner(n),o=t(e,r);return[n].concat(o)})}(e,n);return y.some(r)}(t,Ji).fold(a(Hi,t),function(e){var n=ji(t),o=U(e,function(t,e){var n=ji(e);return{left:t.left+n.left(),top:t.top+n.top()}},{left:0,top:0});return Li(o.left+n.left()+r.left(),o.top+n.top()+r.top())})},Zi=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},ta=function(t){var e=Hi(t),n=Ui(t),r=Mi(t);return Zi(e.left(),e.top(),n,r)},ea=function(t){var e=Qi(t),n=Ui(t),r=Mi(t);return Zi(e.left(),e.top(),n,r)},na=function(){return Xi(e.window)};function ra(t,e,n,r,o){return t(n,r)?y.some(n):D(o)&&o(n)?y.none():e(n,r,o)}var oa,ia=function(t,e,n){for(var r=t.dom(),i=D(n)?n:o(!1);r.parentNode;){r=r.parentNode;var a=Ke.fromDom(r);if(e(a))return y.some(a);if(i(a))break}return y.none()},aa=function(t,e,n){return ra(function(t,e){return e(t)},ia,t,e,n)},ua=function(t,e,n){return aa(t,e,n).isSome()},sa=function(t,e,n){return ia(t,function(t){return yn(t,e)},n)},ca=function(t,n){return function(t,n){var r=void 0===n?e.document:n.dom();return xn(r)?y.none():y.from(r.querySelector(t)).map(Ke.fromDom)}(n,t)},la=function(t,e,n){return ra(function(t,e){return yn(t,e)},sa,t,e,n)},fa=function(){var t=Co("aria-owns");return{id:t,link:function(e){fo(e,"aria-owns",t)},unlink:function(t){go(t,"aria-owns")}}},da=function(t,e){return aa(e,function(t){if(!zr(t))return!1;var e=mo(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1}).bind(function(t){var e=mo(t,"id"),n=$r(t);return ca(n,'[aria-owns="'+e+'"]')}).exists(function(e){return ma(t,e)})},ma=function(t,e){return ua(e,function(e){return wn(e,t.element())},o(!1))||da(t,e)};!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(oa||(oa={}));var ha,pa=Ye({}),ga=function(t,n,r){switch(Ct(pa.get(),t).orThunk(function(){var e=ht(pa.get());return nt(e,function(e){return t.indexOf(e)>-1?y.some(pa.get()[e]):y.none()})}).getOr(oa.NORMAL)){case oa.NORMAL:return r(ya());case oa.LOGGING:var o=function(t,n){var r=[],o=(new Date).getTime();return{logEventCut:function(t,e,n){r.push({outcome:"cut",target:e,purpose:n})},logEventStopped:function(t,e,n){r.push({outcome:"stopped",target:e,purpose:n})},logNoParent:function(t,e,n){r.push({outcome:"no-parent",target:e,purpose:n})},logEventNoHandlers:function(t,e){r.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,n){r.push({outcome:"response",purpose:n,target:e})},write:function(){var i=(new Date).getTime();P(["mousemove","mouseover","mouseout",or()],t)||e.console.log(t,{event:t,time:i-o,target:n.dom(),sequence:H(r,function(t){return P(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+bo(t.target)+")":t.outcome})})}}}(t,n),i=r(o);return o.write(),i;case oa.STOP:return!0}},va=["alloy/data/Fields","alloy/debugging/Debugging"],ba=function(t,e,n){return ga(t,e,n)},ya=o({logEventCut:n,logEventStopped:n,logNoParent:n,logEventNoHandlers:n,logEventResponse:n,write:n}),xa=o([_e("menu"),_e("selectedMenu")]),wa=o([_e("item"),_e("selectedItem")]),Ca=(o(Qt(wa().concat(xa()))),o(Qt(wa()))),_a=Ee("initSize",[_e("numColumns"),_e("numRows")]),ka=function(){return Ee("markers",[_e("backgroundMenu")].concat(xa()).concat(wa()))},Sa=function(t){return Ee("markers",H(t,_e))},Ta=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");q(e,function(t){return t.indexOf("alloy")>0&&!M(va,function(e){return t.indexOf(e)>-1})}).getOr("unknown")}}(),re(e,e,n,ue(function(t){return it.value(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)})}))},Oa=function(t){return Ta(0,t,Rt(n))},Da=function(t){return Ta(0,t,Rt(y.none))},Ea=function(t){return Ta(0,t,It())},Na=function(t){return Ta(0,t,It())},Aa=function(t,e){return $e(t,o(e))},Ra=function(t){return $e(t,i)},Ba=o(_a),Ia=function(t,e,n,r,i,a){return{x:o(t),y:o(e),bubble:o(n),direction:o(r),boundsRestriction:o(i),label:o(a)}},Pa=St([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Ma=Pa.southeast,La=Pa.southwest,Fa=Pa.northeast,Ha=Pa.northwest,ja=Pa.south,Va=Pa.north,za=Pa.east,Ua=Pa.west,Wa=function(t,e){return function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i)}return n}(["left","right","top","bottom"],function(n){return Ct(e,n).map(function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)})})},qa=function(t){return t.x},$a=function(t,e){return t.x+t.width/2-e.width/2},Ya=function(t,e){return t.x+t.width-e.width},Ga=function(t,e){return t.y-e.height},Ka=function(t){return t.y+t.height},Xa=function(t,e){return t.y+t.height/2-e.height/2},Ja=function(t,e,n){return Ia(qa(t),Ka(t),n.southeast(),Ma(),Wa(t,{left:1,top:3}),"layout-se")},Qa=function(t,e,n){return Ia(Ya(t,e),Ka(t),n.southwest(),La(),Wa(t,{right:0,top:3}),"layout-sw")},Za=function(t,e,n){return Ia(qa(t),Ga(t,e),n.northeast(),Fa(),Wa(t,{left:1,bottom:2}),"layout-ne")},tu=function(t,e,n){return Ia(Ya(t,e),Ga(t,e),n.northwest(),Ha(),Wa(t,{right:0,bottom:2}),"layout-nw")},eu=function(t,e,n){return Ia($a(t,e),Ga(t,e),n.north(),Va(),Wa(t,{bottom:2}),"layout-n")},nu=function(t,e,n){return Ia($a(t,e),Ka(t),n.south(),ja(),Wa(t,{top:3}),"layout-s")},ru=function(t,e,n){return Ia(function(t){return t.x+t.width}(t),Xa(t,e),n.east(),za(),Wa(t,{left:0}),"layout-e")},ou=function(t,e,n){return Ia(function(t,e){return t.x-e.width}(t,e),Xa(t,e),n.west(),Ua(),Wa(t,{right:1}),"layout-w")},iu=function(){return[Ja,Qa,Za,tu,nu,eu,ru,ou]},au=function(){return[Qa,Ja,tu,Za,nu,eu,ru,ou]},uu=function(){return[Za,tu,Ja,Qa,eu,nu]},su=function(){return[Ja,Qa,Za,tu,nu,eu]},cu=function(){return[Qa,Ja,tu,Za,nu,eu]},lu=function(t,e,n){return Fr(function(r,o){n(r,t,e)})},fu=function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),a=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:Bo(a.slice(0,1).concat(a.slice(3)))}},t}(function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var u=[r].concat(i);return r.config({name:o(t)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)},function(t){var n=Array.prototype.slice.call(u,1);return e.apply(void 0,[r,t.config,t.state].concat(n))})},n,e)},du=function(t){return{key:t,value:void 0}},mu=function(t,e,n,r,o,i,u){var s=function(t){return kt(t,n)?t[n]():y.none()},c=vt(o,function(t,e){return fu(n,t,e)}),l=vt(i,function(t,e){return Io(t,e)}),f=d(d(d({},l),c),{revoke:a(du,n),config:function(e){var r=fe(n+"-config",t,e);return{key:n,value:{config:r,me:f,configAsRaw:Nt(function(){return fe(n+"-config",t,e)}),initialConfig:e,state:u}}},schema:function(){return e},exhibit:function(t,e){return s(t).bind(function(t){return Ct(r,"exhibit").map(function(n){return n(e,t.config,t.state)})}).getOr(Vo({}))},name:function(){return n},handlers:function(t){return s(t).map(function(t){return Ct(r,"events").getOr(function(){return{}})(t.config,t.state)}).getOr({})}});return f},hu=function(t){return Vt(t)},pu=Jt([_e("fields"),_e("name"),Fe("active",{}),Fe("apis",{}),Fe("state",Fo),Fe("extra",{})]),gu=function(t){var e=fe("Creating behaviour: "+t.name,pu,t);return function(t,e,n,r,o,i){var a,u=Jt(t),s=Le(e,[("config",a=t,Be("config",Jt(a)))]);return mu(u,s,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},vu=Jt([_e("branchKey"),_e("branches"),_e("name"),Fe("active",{}),Fe("apis",{}),Fe("state",Fo),Fe("extra",{})]),bu=function(t){var e=fe("Creating behaviour: "+t.name,vu,t);return function(t,e,n,r,o,i){var a=t,u=Le(e,[Be("config",t)]);return mu(a,u,e,n,r,o,i)}(he(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},yu=o(void 0),xu=Object.freeze({__proto__:null,events:function(t){return Sr([Dr(Jn(),function(e,n){var r=t.channels,o=ht(r),i=n,a=function(t,e){return e.universal()?t:z(t,function(t){return P(e.channels(),t)})}(o,i);j(a,function(t){var n=r[t],o=n.schema,a=fe("channel["+t+"] data\nReceiver: "+bo(e.element()),o,i.data());n.onReceive(e,a)})})])}}),wu=[ke("channels",se(it.value,Jt([Ea("onReceive"),Fe("schema",pe())])))],Cu=gu({fields:wu,name:"receiving",active:xu}),_u=Object.freeze({__proto__:null,exhibit:function(t,e){return Vo({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),ku=function(t){return t.dom().focus()},Su=function(t){return void 0===t&&(t=Ke.fromDom(e.document)),y.from(t.dom().activeElement).map(Ke.fromDom)},Tu=function(t){return Su(ii(t)).filter(function(e){return t.dom().contains(e.dom())})},Ou=function(t,e){var r=$r(e),o=Su(r).bind(function(t){var n,r,o=function(e){return wn(t,e)};return o(e)?y.some(e):(n=o,(r=function(t){for(var e=0;e<t.childNodes.length;e++){var o=Ke.fromDom(t.childNodes[e]);if(n(o))return y.some(o);var i=r(t.childNodes[e]);if(i.isSome())return i}return y.none()})(e.dom()))}),i=t(e);return o.each(function(t){Su(r).filter(function(e){return wn(e,t)}).fold(function(){ku(t)},n)}),i},Du=function(t,e,n,r,i){return{position:o(t),left:o(e),top:o(n),right:o(r),bottom:o(i)}},Eu=function(t,e){var n=function(t){return t+"px"};hi(t,{position:y.some(e.position()),left:e.left().map(n),top:e.top().map(n),right:e.right().map(n),bottom:e.bottom().map(n)})},Nu=St([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Au=function(t,e,n,r,o,i){var a=e.x-n,u=e.y-r,s=o-(a+e.width),c=i-(u+e.height),l=y.some(a),f=y.some(u),d=y.some(s),m=y.some(c),h=y.none();return function(t,e,n,r,o,i,a,u,s){return t.fold(e,n,r,o,i,a,u,s)}(e.direction,function(){return Du(t,l,f,h,h)},function(){return Du(t,h,f,d,h)},function(){return Du(t,l,h,h,m)},function(){return Du(t,h,h,d,m)},function(){return Du(t,l,f,h,h)},function(){return Du(t,l,h,h,m)},function(){return Du(t,l,f,h,h)},function(){return Du(t,h,f,d,h)})},Ru=function(t,e){var n=a(Qi,e),r=t.fold(n,n,function(){var t=Yi();return Qi(e).translate(-t.left(),-t.top())}),o=Ui(e),i=Mi(e);return Zi(r.left(),r.top(),o,i)},Bu=function(t,e){return e.fold(function(){return t.fold(na,na,Zi)},function(e){return t.fold(e,e,function(){var n=e(),r=Iu(t,n.x,n.y);return Zi(r.left(),r.top(),n.width,n.height)})})},Iu=function(t,e,n){var r=Li(e,n);return t.fold(o(r),o(r),function(){var t=Yi();return r.translate(-t.left(),-t.top())})},Pu=(Nu.none,Nu.relative),Mu=Nu.fixed,Lu=function(t,e){return function(t,e){return{anchorBox:o(t),origin:o(e)}}(t,e)},Fu=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},Hu=function(t,e,n){return Math.min(Math.max(t,e),n)},ju=St([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),Vu=function(t,e,n,r){var a=t.x(),u=t.y(),s=t.bubble().offset(),c=s.left(),l=s.top(),f=function(t,e,n){var r=function(t,r){var o="top"===t||"bottom"===t?n.top():n.left();return Ct(e,t).bind(i).bind(function(e){return"left"===t||"top"===t?e>=r?y.some(e):y.none():e<=r?y.some(e):y.none()}).map(function(t){return t+o}).getOr(r)},o=r("left",t.x),a=r("top",t.y),u=r("right",t.right),s=r("bottom",t.bottom);return Zi(o,a,u-o,s-a)}(r,t.boundsRestriction(),s),d=f.y,m=f.bottom,h=f.x,p=f.right,g=u+l,v=function(t,e,n,r,o){var i=o.x,a=o.y,u=o.width,s=o.height,c=t>=i,l=e>=a,f=c&&l,d=t+n<=i+u&&e+r<=a+s,m=Math.abs(Math.min(n,c?i+u-t:i-(t+n))),h=Math.abs(Math.min(r,l?a+s-e:a-(e+r))),p=Math.max(o.x,o.right-n),g=Math.max(o.y,o.bottom-r);return{originInBounds:f,sizeInBounds:d,limitX:Hu(t,o.x,p),limitY:Hu(e,o.y,g),deltaW:m,deltaH:h}}(a+c,g,e,n,f),b=v.originInBounds,x=v.sizeInBounds,w=v.limitX,C=v.limitY,_=v.deltaW,k=v.deltaH,S=o(C+k-d),T=o(m-C),O=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t.direction(),T,T,S),D=o(w+_-h),E=o(p-w),N={x:w,y:C,width:_,height:k,maxHeight:O,maxWidth:function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t.direction(),E,E,D),direction:t.direction(),classes:{on:t.bubble().classesOn(),off:t.bubble().classesOff()},label:t.label(),candidateYforTest:g};return b&&x?ju.fit(N):ju.nofit(N,_,k)},zu=function(t,e){!function(t,e){var n=Ii.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);di(t,"max-height",n+"px")}(t,Math.floor(e))},Uu=o(function(t,e){zu(t,e),mi(t,{"overflow-x":"hidden","overflow-y":"auto"})}),Wu=o(function(t,e){zu(t,e)}),qu=function(t,e,n){return void 0===t[e]?n:t[e]},$u=function(t,e,n,r){var o=function(t,e,n,r){xi(e,"max-height"),xi(e,"max-width");var o,u={width:Ui(o=e),height:Mi(o)};return function(t,e,n,r,o){var u=n.width,s=n.height,c=function(t,i,a,c){var l=t(e,n,r);return Vu(l,u,s,o).fold(ju.fit,function(t,e,n){return n>c||e>a?ju.nofit(t,e,n):ju.nofit(i,a,c)})};return W(t,function(t,e){var n=a(c,e);return t.fold(ju.fit,n)},ju.nofit({x:e.x,y:e.y,width:n.width,height:n.height,maxHeight:n.height,maxWidth:n.width,direction:Ma(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y},-1,-1)).fold(i,i)}(r.preference,t,u,n,r.bounds)}(t,e,n,r);(function(t,e,n){Eu(t,function(t,e){return t.fold(function(){return Du("absolute",y.some(e.x),y.some(e.y),y.none(),y.none())},function(t,n,r,o){return Au("absolute",e,t,n,r,o)},function(t,n,r,o){return Au("fixed",e,t,n,r,o)})}(n.origin,e))})(e,o,r),function(t,e){var n=o.classes;ti(t,n.off),Zo(t,n.on)}(e),function(t,e,n){(0,r.maxHeightFunction)(t,e.maxHeight)}(e,o),function(t,e,n){(0,r.maxWidthFunction)(t,e.maxWidth)}(e,o)},Yu=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],Gu=function(t,e,n){var r=function(t){return Ct(n,t).getOr([])},o=function(t,e,n){var o=J(Yu,n);return{offset:function(){return Li(t,e)},classesOn:function(){return G(n,r)},classesOff:function(){return G(o,r)}}};return{southeast:function(){return o(-t,e,["top","alignLeft"])},southwest:function(){return o(t,e,["top","alignRight"])},south:function(){return o(-t/2,e,["top","alignCentre"])},northeast:function(){return o(-t,-e,["bottom","alignLeft"])},northwest:function(){return o(t,-e,["bottom","alignRight"])},north:function(){return o(-t/2,-e,["bottom","alignCentre"])},east:function(){return o(t,-e/2,["valignCentre","left"])},west:function(){return o(-t,-e/2,["valignCentre","right"])},innerNorthwest:function(){return o(-t,e,["top","alignRight"])},innerNortheast:function(){return o(t,e,["top","alignLeft"])},innerNorth:function(){return o(-t/2,e,["top","alignCentre"])},innerSouthwest:function(){return o(-t,-e,["bottom","alignRight"])},innerSoutheast:function(){return o(t,-e,["bottom","alignLeft"])},innerSouth:function(){return o(-t/2,-e,["bottom","alignCentre"])},innerWest:function(){return o(t,-e/2,["valignCentre","right"])},innerEast:function(){return o(-t,-e/2,["valignCentre","left"])}}},Ku=function(){return Gu(0,0,{})},Xu=function(t,e){return function(n){return"rtl"===Ju(n)?e:t}},Ju=function(t){return"rtl"===pi(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(ha||(ha={}));var Qu="data-alloy-vertical-dir",Zu=function(t){return ua(t,function(t){return zr(t)&&mo(t,Qu)===ha.BottomToTop})},ts=function(){return Le("layouts",[_e("onLtr"),_e("onRtl"),Re("onBottomLtr"),Re("onBottomRtl")])},es=function(t,e,n,r,o,i,a){var u=a.map(Zu).getOr(!1),s=e.layouts.map(function(e){return e.onLtr(t)}),c=e.layouts.map(function(e){return e.onRtl(t)}),l=u?e.layouts.bind(function(e){return e.onBottomLtr.map(function(e){return e(t)})}).or(s).getOr(o):s.getOr(n),f=u?e.layouts.bind(function(e){return e.onBottomRtl.map(function(e){return e(t)})}).or(c).getOr(i):c.getOr(r);return Xu(l,f)(t)},ns=[_e("hotspot"),Re("bubble"),Fe("overrides",{}),ts(),Aa("placement",function(t,e,n){var r=e.hotspot,o=Ru(n,r.element()),i=es(t.element(),e,su(),cu(),uu(),[tu,Za,Qa,Ja,eu,nu],y.some(e.hotspot.element()));return y.some({anchorBox:o,bubble:e.bubble.getOr(Ku()),overrides:e.overrides,layouts:i,placer:y.none()})})],rs=[_e("x"),_e("y"),Fe("height",0),Fe("width",0),Fe("bubble",Ku()),Fe("overrides",{}),ts(),Aa("placement",function(t,e,n){var r=Iu(n,e.x,e.y),o=Zi(r.left(),r.top(),e.width,e.height),i=es(t.element(),e,iu(),au(),iu(),au(),y.none());return y.some({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:y.none()})})],os=function(t,e,n,r){return{start:o(t),soffset:o(e),finish:o(n),foffset:o(r)}},is=St([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),as=(is.before,is.on,is.after,function(t){return t.fold(i,i,i)}),us=St([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ss={domRange:us.domRange,relative:us.relative,exact:us.exact,exactFromRange:function(t){return us.exact(t.start(),t.soffset(),t.finish(),t.foffset())},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Ke.fromDom(t.startContainer)},relative:function(t,e){return as(t)},exact:function(t,e,n,r){return t}})}(t);return Kr(e)},range:os},cs=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold(function(t){r.setStartBefore(t.dom())},function(t,e){r.setStart(t.dom(),e)},function(t){r.setStartAfter(t.dom())}),function(t,e){n.fold(function(e){t.setEndBefore(e.dom())},function(e,n){t.setEnd(e.dom(),n)},function(e){t.setEndAfter(e.dom())})}(o),o},ls=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom(),n),i.setEnd(r.dom(),o),i},fs=function(t){return{left:o(t.left),top:o(t.top),right:o(t.right),bottom:o(t.bottom),width:o(t.width),height:o(t.height)}},ds=St([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),ms=function(t,e,n){return e(Ke.fromDom(n.startContainer),n.startOffset,Ke.fromDom(n.endContainer),n.endOffset)};ds.ltr,ds.rtl;var hs,ps=function(t,e){var n=function(e){return t(e)?y.from(e.dom().nodeValue):y.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw text value of a text node");e.dom().nodeValue=n}}}(Ur),gs=function(t){return ps.getOption(t)},vs=["img","br"],bs=function(t){return gs(t).filter(function(t){return 0!==t.trim().length||t.indexOf(" ")>-1}).isSome()||P(vs,jr(t))},ys=function(t,n){return function(t,n){var r=void 0===n?e.document:n.dom();return xn(r)?[]:H(r.querySelectorAll(t),Ke.fromDom)}(n,t)},xs=function(t){var e=Ke.fromDom(t.anchorNode),n=Ke.fromDom(t.focusNode);return function(t,e,n,r){var o=function(t,e,n,r){var o=$r(t).dom().createRange();return o.setStart(t.dom(),e),o.setEnd(n.dom(),r),o}(t,e,n,r),i=wn(t,n)&&e===r;return o.collapsed&&!i}(e,t.anchorOffset,n,t.focusOffset)?y.some(os(e,t.anchorOffset,n,t.focusOffset)):function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return y.some(os(Ke.fromDom(e.startContainer),e.startOffset,Ke.fromDom(n.endContainer),n.endOffset))}return y.none()}(t)},ws=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?y.some(n).map(fs):y.none()}(function(t,e){return function(t,e){return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return ds.rtl(Ke.fromDom(t.endContainer),t.endOffset,Ke.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return ms(0,ds.ltr,n)}):ms(0,ds.ltr,n)}(0,function(t,e){return e.match({domRange:function(t){return{ltr:o(t),rtl:y.none}},relative:function(e,n){return{ltr:Nt(function(){return cs(t,e,n)}),rtl:Nt(function(){return y.some(cs(t,n,e))})}},exact:function(e,n,r,o){return{ltr:Nt(function(){return ls(t,e,n,r,o)}),rtl:Nt(function(){return y.some(ls(t,r,o,e,n))})}}})}(t,e))}(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom(),n),i.setEnd(r.dom(),o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom(),o),i.setEnd(e.dom(),n),i}})}(t,e))},Cs=function(t,e){return{element:t,offset:e}},_s=St([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),ks=function(t){return t.fold(i,function(t,e,n){return t.translate(-e,-n)})},Ss=function(t){return t.fold(i,i)},Ts=function(t){return W(t,function(t,e){return t.translate(e.left(),e.top())},Li(0,0))},Os=function(t){var e=H(t,Ss);return Ts(e)},Ds=_s.screen,Es=_s.absolute,Ns=function(t,e,n){var r=$r(t.element()),o=Yi(r),i=function(t,e,n){var r=Kr(n.root).dom();return y.from(r.frameElement).map(Ke.fromDom).filter(function(e){var n=$r(e),r=$r(t.element());return wn(n,r)}).map(Hi)}(t,0,n).getOr(o);return Es(i,o.left(),o.top())},As=function(t,e,n,r){var o=t,i=e,a=n,u=r;t<0&&(o=0,a=n+t),e<0&&(i=0,u=r+e);var s=Ds(Li(o,i));return y.some({point:s,width:a,height:u})},Rs=function(t,e,n,r,o){return t.map(function(t){var i,a,u,s=[e,t.point],c=(i=function(){return Os(s)},a=function(){return Os(s)},u=function(){return t=H(s,ks),Ts(t);var t},r.fold(i,a,u)),l=function(t,e,n,r){return{x:t,y:e,width:n,height:r}}(c.left(),c.top(),t.width,t.height),f=n.showAbove?uu():su(),d=(n.showAbove,cu()),m=es(o,n,f,d,f,d,y.none());return{anchorBox:l,bubble:n.bubble.getOr(Ku()),overrides:n.overrides,layouts:m,placer:y.none()}})},Bs=function(t,e){return Ur(t)?function(t,e){return{element:t,offset:e}}(t,e):function(t,e){var n=Qr(t);if(0===n.length)return Cs(t,e);if(e<n.length)return Cs(n[e],0);var r=n[n.length-1],o=Ur(r)?function(t){return ps.get(t)}(r).length:Qr(r).length;return Cs(r,o)}(t,e)},Is=function(t,e){return e.getSelection.getOrThunk(function(){return function(){return function(t){return y.from(t.getSelection()).filter(function(t){return t.rangeCount>0}).bind(xs)}(t)}})().map(function(t){var e=Bs(t.start(),t.soffset()),n=Bs(t.finish(),t.foffset());return ss.range(e.element,e.offset,n.element,n.offset)})},Ps=[Re("getSelection"),_e("root"),Re("bubble"),ts(),Fe("overrides",{}),Fe("showAbove",!1),Aa("placement",function(t,e,n){var r=Kr(e.root).dom(),o=Ns(t,0,e),i=Is(r,e).bind(function(t){return ws(r,ss.exactFromRange(t)).orThunk(function(){var e=Ke.fromText("\ufeff");return to(t.start(),e),ws(r,ss.exact(e,0,e,1)).map(function(t){return ao(e),t})}).bind(function(t){return As(t.left(),t.top(),t.width(),t.height())})}),a=Is(r,e).bind(function(t){return zr(t.start())?y.some(t.start()):Xr(t.start())}).getOr(t.element());return Rs(i,o,e,n,a)})],Ms=[_e("node"),_e("root"),Re("bubble"),ts(),Fe("overrides",{}),Fe("showAbove",!1),Aa("placement",function(t,e,n){var r=Ns(t,0,e);return e.node.bind(function(o){var i=o.dom().getBoundingClientRect(),a=As(i.left,i.top,i.width,i.height),u=e.node.getOr(t.element());return Rs(a,r,e,n,u)})})],Ls=function(t){return t.x+t.width},Fs=function(t,e){return t.x-e.width},Hs=function(t,e){return t.y-e.height+t.height},js=function(t){return t.y},Vs=function(t,e,n){return Ia(Ls(t),js(t),n.southeast(),Ma(),Wa(t,{left:0,top:2}),"link-layout-se")},zs=function(t,e,n){return Ia(Fs(t,e),js(t),n.southwest(),La(),Wa(t,{right:1,top:2}),"link-layout-sw")},Us=function(t,e,n){return Ia(Ls(t),Hs(t,e),n.northeast(),Fa(),Wa(t,{left:0,bottom:3}),"link-layout-ne")},Ws=function(t,e,n){return Ia(Fs(t,e),Hs(t,e),n.northwest(),Ha(),Wa(t,{right:1,bottom:3}),"link-layout-nw")},qs=function(){return[Vs,zs,Us,Ws]},$s=function(){return[zs,Vs,Ws,Us]},Ys=[_e("item"),ts(),Fe("overrides",{}),Aa("placement",function(t,e,n){var r=Ru(n,e.item.element()),o=es(t.element(),e,qs(),$s(),qs(),$s(),y.none());return y.some({anchorBox:r,bubble:Ku(),overrides:e.overrides,layouts:o,placer:y.none()})})],Gs=he("anchor",{selection:Ps,node:Ms,hotspot:ns,submenu:Ys,makeshift:rs}),Ks=function(t,e,r,o,i){!function(t,e,r,o,i,a){var u=qu(a,"maxHeightFunction",Uu()),s=qu(a,"maxWidthFunction",n),c=t.anchorBox(),l=t.origin(),f={bounds:Bu(l,i),origin:l,preference:o,maxHeightFunction:u,maxWidthFunction:s};$u(c,e,r,f)}(Lu(r.anchorBox,e),i.element(),r.bubble,r.layouts,o,r.overrides)},Xs=function(t,e,n,r,o,i){var a=i.map(ta);return Js(t,e,n,r,o,a)},Js=function(t,n,r,i,a,u){var s=fe("positioning anchor.info",Gs,i);Ou(function(){di(a.element(),"position","fixed");var r=vi(a.element(),"visibility");di(a.element(),"visibility","hidden");var i,c=n.useFixed()?(i=e.document.documentElement,Mu(0,0,i.clientWidth,i.clientHeight)):function(t){var e=Hi(t.element()),n=t.element().dom().getBoundingClientRect();return Pu(e.left(),e.top(),n.width,n.height)}(t),l=s.placement,f=u.map(o).or(n.getBounds);l(t,s,c).each(function(e){e.placer.getOr(Ks)(t,c,e,f,a)}),r.fold(function(){xi(a.element(),"visibility")},function(t){di(a.element(),"visibility",t)}),vi(a.element(),"left").isNone()&&vi(a.element(),"top").isNone()&&vi(a.element(),"right").isNone()&&vi(a.element(),"bottom").isNone()&&vi(a.element(),"position").is("fixed")&&xi(a.element(),"position")},a.element())},Qs=Object.freeze({__proto__:null,position:function(t,e,n,r,o){Xs(t,e,n,r,o,y.none())},positionWithin:Xs,positionWithinBounds:Js,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"}}),Zs=[Fe("useFixed",c),Re("getBounds")],tc=gu({fields:Zs,name:"positioning",active:_u,apis:Qs}),ec=function t(e){yr(e,lr());var n=e.components();j(n,t)},nc=function t(e){var n=e.components();j(n,t),yr(e,cr())},rc=function(t,e){ro(t.element(),e.element())},oc=function(t,e){var n=t.components();!function(t){j(t.components(),function(t){return ao(t.element())}),io(t.element()),t.syncComponents()}(t);var r=J(n,e);j(r,function(e){ec(e),t.getSystem().removeFromWorld(e)}),j(e,function(e){e.getSystem().isConnected()?rc(t,e):(t.getSystem().addToWorld(e),rc(t,e),ui(t.element())&&nc(e)),t.syncComponents()})},ic=function(t,e){ac(t,e,ro)},ac=function(t,e,n){t.getSystem().addToWorld(e),n(t.element(),e.element()),ui(t.element())&&nc(e),t.syncComponents()},uc=function(t){ec(t),ao(t.element()),t.getSystem().removeFromWorld(t)},sc=function(t){var e=Xr(t.element()).bind(function(e){return t.getSystem().getByDom(e).toOption()});uc(t),e.each(function(t){t.syncComponents()})},cc=function(t){var e=t.components();j(e,uc),io(t.element()),t.syncComponents()},lc=function(t,e){fc(t,e,ro)},fc=function(t,e,n){n(t,e.element());var r=Qr(e.element());j(r,function(t){e.getByDom(t).each(nc)})},dc=function(t){var e=Qr(t.element());j(e,function(e){t.getByDom(e).each(ec)}),ao(t.element())},mc=function(t,e,n,r){n.get().each(function(e){cc(t)});var o=e.getAttachPoint(t);ic(o,t);var i=t.getSystem().build(r);return ic(t,i),n.set(i),i},hc=function(t,e,n,r){var o=mc(t,e,n,r);return e.onOpen(t,o),o},pc=function(t,e,n){n.get().each(function(r){cc(t),sc(t),e.onClose(t,r),n.clear()})},gc=function(t,e,n){return n.isOpen()},vc=function(t,e,n){var r=e.getAttachPoint(t);di(t.element(),"position",tc.getMode(r)),function(t,e,n,r){vi(t.element(),e).fold(function(){go(t.element(),n)},function(e){fo(t.element(),n,e)}),di(t.element(),e,"hidden")}(t,"visibility",e.cloakVisibilityAttr)},bc=function(t,e,n){(function(t){return M(["top","left","right","bottom"],function(e){return vi(t,e).isSome()})})(t.element())||xi(t.element(),"position"),function(t,e,n){ho(t.element(),n).fold(function(){return xi(t.element(),e)},function(n){return di(t.element(),e,n)})}(t,"visibility",e.cloakVisibilityAttr)},yc=Object.freeze({__proto__:null,cloak:vc,decloak:bc,open:hc,openWhileCloaked:function(t,e,n,r,o){vc(t,e),hc(t,e,n,r),o(),bc(t,e)},close:pc,isOpen:gc,isPartOf:function(t,e,n,r){return gc(0,0,n)&&n.get().exists(function(n){return e.isPartOf(t,n,r)})},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map(function(){return mc(t,e,n,r)})}}),xc=Object.freeze({__proto__:null,events:function(t,e){return Sr([Dr(nr(),function(n,r){pc(n,t,e)})])}}),wc=[Oa("onOpen"),Oa("onClose"),_e("isPartOf"),_e("getAttachPoint"),Fe("cloakVisibilityAttr","data-precloak-visibility")],Cc=gu({fields:wc,name:"sandboxing",active:xc,apis:yc,state:Object.freeze({__proto__:null,init:function(){var t=Ye(y.none()),e=o("not-implemented");return Ho({readState:e,isOpen:function(){return t.get().isSome()},clear:function(){t.set(y.none())},set:function(e){t.set(y.some(e))},get:function(){return t.get()}})}})}),_c=o("dismiss.popups"),kc=o("reposition.popups"),Sc=o("mouse.released"),Tc=Jt([Fe("isExtraPart",o(!1)),Le("fireEventInstead",[Fe("event",fr())])]),Oc=function(t){var e,n=fe("Dismissal",Tc,t);return(e={})[_c()]={schema:Jt([_e("target")]),onReceive:function(t,e){Cc.isOpen(t)&&(Cc.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold(function(){return Cc.close(t)},function(e){return yr(t,e.event)}))}},e},Dc=Jt([Le("fireEventInstead",[Fe("event",dr())]),De("doReposition")]),Ec=function(t){var e,n=fe("Reposition",Dc,t);return(e={})[kc()]={onReceive:function(t){Cc.isOpen(t)&&n.fireEventInstead.fold(function(){return n.doReposition(t)},function(e){return yr(t,e.event)})}},e},Nc=function(t,e,n){e.store.manager.onLoad(t,e,n)},Ac=function(t,e,n){e.store.manager.onUnload(t,e,n)},Rc=Object.freeze({__proto__:null,onLoad:Nc,onUnload:Ac,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),Bc=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[Mr(function(n,r){Nc(n,t,e)}),Lr(function(n,r){Ac(n,t,e)})]:[lu(t,e,Nc)];return Sr(n)}}),Ic=function(){var t=Ye(null);return Ho({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},Pc=function(){var t=Ye({}),e=Ye({});return Ho({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return Ct(t.get(),n).orThunk(function(){return Ct(e.get(),n)})},update:function(n){var r=t.get(),o=e.get(),i={},a={};j(n,function(t){i[t.value]=t,Ct(t,"meta").each(function(e){Ct(e,"text").each(function(e){a[e]=t})})}),t.set(d(d({},r),i)),e.set(d(d({},o),a))},clear:function(){t.set({}),e.set({})}})},Mc=Object.freeze({__proto__:null,memory:Ic,dataset:Pc,manual:function(){return Ho({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),Lc=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},Fc=[Re("initialValue"),_e("getFallbackEntry"),_e("getDataKey"),_e("setValue"),Aa("manager",{setValue:Lc,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).fold(function(){return r.getFallbackEntry(o)},function(t){return t})},onLoad:function(t,e,n){e.store.initialValue.each(function(r){Lc(t,e,n,r)})},onUnload:function(t,e,n){n.clear()},state:Pc})],Hc=[_e("getValue"),Fe("setValue",n),Re("initialValue"),Aa("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each(function(n){e.store.setValue(t,n)})},onUnload:n,state:Fo.init})],jc=[Re("initialValue"),Aa("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each(function(t){n.isNotSet()&&n.set(t)})},onUnload:function(t,e,n){n.clear()},state:Ic})],Vc=[He("store",{mode:"memory"},he("mode",{memory:jc,manual:Hc,dataset:Fc})),Oa("onSetValue"),Fe("resetOnDom",!1)],zc=gu({fields:Vc,name:"representing",active:Bc,apis:Rc,extra:{setValueFrom:function(t,e){var n=zc.getValue(e);zc.setValue(t,n)}},state:Mc}),Uc=function(t,e){return qe(t,{},H(e,function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,re(n,n,Pt(),Kt(function(t){return ft("The field: "+n+" is forbidden. "+r)}));var n,r}).concat([$e("dump",i)]))},Wc=function(t){return t.dump},qc=function(t,e){return d(d({},t.dump),hu(e))},$c=Uc,Yc=qc,Gc=St([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Kc=function(t){return _t(t,"uiType")},Xc=function t(e,n,r,a){return function(t,e,n,r){return Kc(n)&&"placeholder"===n.uiType?function(t,e,n,r){return t.exists(function(t){return t!==n.owner})?Gc.single(!0,o(n)):Ct(r,n.name).fold(function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+ht(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))},function(t){return t.replace()})}(t,0,n,r):Gc.single(!1,o(n))}(e,0,r,a).fold(function(o,i){var u=Kc(r)?i(n,r.config,r.validated):i(n),s=Ct(u,"components").getOr([]),c=G(s,function(r){return t(e,n,r,a)});return[d(d({},u),{components:c})]},function(t,e){if(Kc(r)){var o=e(n,r.config,r.validated);return r.validated.preprocess.getOr(i)(o)}return e(n)})},Jc=Gc.single,Qc=Gc.multiple,Zc=o("placeholder"),tl=St([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),el=Fe("factory",{sketch:i}),nl=Fe("schema",[]),rl=_e("name"),ol=re("pname","pname",Mt(function(t){return"<alloy."+Co(t.name)+">"}),pe()),il=$e("schema",function(){return[Re("preprocess")]}),al=Fe("defaults",o({})),ul=Fe("overrides",o({})),sl=Qt([el,nl,rl,ol,al,ul]),cl=Qt([el,nl,rl,al,ul]),ll=Qt([el,nl,rl,ol,al,ul]),fl=Qt([el,il,rl,_e("unit"),ol,al,ul]),dl=function(t){return t.fold(y.some,y.none,y.some,y.some)},ml=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},hl=function(t,e){return function(n){var r=fe("Converting part type",e,n);return t(r)}},pl=hl(tl.required,sl),gl=hl(tl.external,cl),vl=hl(tl.optional,ll),bl=hl(tl.group,fl),yl=o("entirety"),xl=Object.freeze({__proto__:null,required:pl,external:gl,optional:vl,group:bl,asNamedPart:dl,name:ml,asCommon:function(t){return t.fold(i,i,i,i)},original:yl}),wl=function(t,e,n,r){return Dt(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},Cl=function(t,e){var n={};return j(e,function(e){dl(e).each(function(e){var r=_l(t,e.pname);n[e.name]=function(n){var o=fe("Part: "+e.name+" in "+t,Qt(e.schema),n);return d(d({},r),{config:n,validated:o})}})}),n},_l=function(t,e){return{uiType:Zc(),owner:t,name:e}},kl=function(t,e,n){return{uiType:Zc(),owner:t,name:e,config:n,validated:{}}},Sl=function(t){return G(t,function(t){return t.fold(y.none,y.some,y.none,y.none).map(function(t){return Ee(t.name,t.schema.concat([Ra(yl())]))}).toArray()})},Tl=function(t){return H(t,ml)},Ol=function(t,e,n){return function(t,e,n){var r={},i={};return j(n,function(t){t.fold(function(t){r[t.pname]=Jc(!0,function(e,n,r){return t.factory.sketch(wl(e,t,n,r))})},function(t){var n=e.parts[t.name];i[t.name]=o(t.factory.sketch(wl(e,t,n[yl()]),n))},function(t){r[t.pname]=Jc(!1,function(e,n,r){return t.factory.sketch(wl(e,t,n,r))})},function(t){r[t.pname]=Qc(!0,function(e,n,r){var o=e[t.name];return H(o,function(n){return t.factory.sketch(Dt(t.defaults(e,n,r),n,t.overrides(e,n)))})})})}),{internals:o(r),externals:o(i)}}(0,e,n)},Dl=function(t,e,n){return function(t,e,n,r){var i=vt(r,function(t,e){return r=t,i=!1,{name:o(n=e),required:function(){return r.fold(function(t,e){return t},function(t,e){return t})},used:function(){return i},replace:function(){if(i)throw new Error("Trying to use the same placeholder more than once: "+n);return i=!0,r}};var n,r,i}),a=function(t,e,n,r){return G(n,function(n){return Xc(t,e,n,r)})}(t,e,n,i);return gt(i,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))}),a}(y.some(t),e,e.components,n)},El=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOption()},Nl=function(t,e,n){return El(t,e,n).getOrDie("Could not find part: "+n)},Al=function(t,e,n){var r={},i=e.partUids,a=t.getSystem();return j(n,function(t){r[t]=o(a.getByUid(i[t]))}),r},Rl=function(t,e){var n=t.getSystem();return vt(e.partUids,function(t,e){return o(n.getByUid(t))})},Bl=function(t){return ht(t.partUids)},Il=function(t,e,n){var r={},i=e.partUids,a=t.getSystem();return j(n,function(t){r[t]=o(a.getByUid(i[t]).getOrDie())}),r},Pl=function(t,e){var n=Tl(e);return Vt(H(n,function(e){return{key:e,value:t+"-"+e}}))},Ml=function(t){return re("partUids","partUids",Lt(function(e){return Pl(e.uid,t)}),pe())},Ll=Object.freeze({__proto__:null,generate:Cl,generateOne:kl,schemas:Sl,names:Tl,substitutes:Ol,components:Dl,defaultUids:Pl,defaultUidsSchema:Ml,getAllParts:Rl,getAllPartNames:Bl,getPart:El,getPartOrDie:Nl,getParts:Al,getPartsOrDie:Il}),Fl=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[Ee("parts",t)]:[]).concat([_e("uid"),Fe("dom",{}),Fe("components",[]),Ra("originalSpec"),Fe("debug.sketcher",{})]).concat(e)}(r,o);return fe(t+" [SpecSchema]",Jt(i.concat(e)),n)},Hl=function(t,e,n,r,o){var i=jl(o),a=Sl(n),u=Ml(n),s=Fl(t,e,i,a,[u]),c=Ol(0,s,n);return r(s,Dl(t,s,c.internals()),i,c.externals())},jl=function(t){return function(t){return _t(t,"uid")}(t)?t:d(d({},t),{uid:Eo("uid")})},Vl=Jt([_e("name"),_e("factory"),_e("configFields"),Fe("apis",{}),Fe("extraApis",{})]),zl=Jt([_e("name"),_e("factory"),_e("configFields"),_e("partFields"),Fe("apis",{}),Fe("extraApis",{})]),Ul=function(t){var e=fe("Sketcher for "+t.name,Vl,t),n=vt(e.apis,Lo),r=vt(e.extraApis,function(t,e){return Io(t,e)});return d(d({name:o(e.name),configFields:o(e.configFields),sketch:function(t){return function(t,e,n,r){var o=jl(r);return n(Fl(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},Wl=function(t){var e=fe("Sketcher for "+t.name,zl,t),n=Cl(e.name,e.partFields),r=vt(e.apis,Lo),i=vt(e.extraApis,function(t,e){return Io(t,e)});return d(d({name:o(e.name),partFields:o(e.partFields),configFields:o(e.configFields),sketch:function(t){return Hl(e.name,e.configFields,e.partFields,e.factory,t)},parts:o(n)},r),i)},ql=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},$l=function(t){return"input"===jr(t)&&"radio"!==mo(t,"type")||"textarea"===jr(t)},Yl=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),Gl=[_e("find")],Kl=gu({fields:Gl,name:"composing",apis:Yl}),Xl=function(t,e,n,r){var o=ys(t.element(),"."+e.highlightClass);j(o,function(n){M(r,function(t){return t.element()===n})||(Jo(n,e.highlightClass),t.getSystem().getByDom(n).each(function(n){e.onDehighlight(t,n),yr(n,br())}))})},Jl=function(t,e,n,r){Xl(t,e,0,[r]),Ql(t,e,n,r)||(Xo(r.element(),e.highlightClass),e.onHighlight(t,r),yr(r,vr()))},Ql=function(t,e,n,r){return Qo(r.element(),e.highlightClass)},Zl=function(t,e,n){return ca(t.element(),"."+e.itemClass).bind(function(e){return t.getSystem().getByDom(e).toOption()})},tf=function(t,e,n){var r=ys(t.element(),"."+e.itemClass);return(r.length>0?y.some(r[r.length-1]):y.none()).bind(function(e){return t.getSystem().getByDom(e).toOption()})},ef=function(t,e,n,r){var o=ys(t.element(),"."+e.itemClass);return $(o,function(t){return Qo(t,e.highlightClass)}).bind(function(e){var n=Fu(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOption()})},nf=function(t,e,n){var r=ys(t.element(),"."+e.itemClass);return ql(H(r,function(e){return t.getSystem().getByDom(e).toOption()}))},rf=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Xl(t,e,0,[])},dehighlight:function(t,e,n,r){Ql(t,e,n,r)&&(Jo(r.element(),e.highlightClass),e.onDehighlight(t,r),yr(r,br()))},highlight:Jl,highlightFirst:function(t,e,n){Zl(t,e).each(function(r){Jl(t,e,n,r)})},highlightLast:function(t,e,n){tf(t,e).each(function(r){Jl(t,e,n,r)})},highlightAt:function(t,e,n,r){(function(t,e,n,r){var o=ys(t.element(),"."+e.itemClass);return y.from(o[r]).fold(function(){return it.error("No element found with index "+r)},t.getSystem().getByDom)})(t,e,0,r).fold(function(t){throw new Error(t)},function(r){Jl(t,e,n,r)})},highlightBy:function(t,e,n,r){var o=nf(t,e);q(o,r).each(function(r){Jl(t,e,n,r)})},isHighlighted:Ql,getHighlighted:function(t,e,n){return ca(t.element(),"."+e.highlightClass).bind(function(e){return t.getSystem().getByDom(e).toOption()})},getFirst:Zl,getLast:tf,getPrevious:function(t,e,n){return ef(t,e,0,-1)},getNext:function(t,e,n){return ef(t,e,0,1)},getCandidates:nf}),of=[_e("highlightClass"),_e("itemClass"),Oa("onHighlight"),Oa("onDehighlight")],af=gu({fields:of,name:"highlighting",apis:rf}),uf=function(t,e,n){var r=X(t.slice(0,e)),o=X(t.slice(e+1));return q(r.concat(o),n)},sf=function(t,e,n){var r=X(t.slice(0,e));return q(r,n)},cf=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return q(o.concat(r),n)},lf=function(t,e,n){var r=t.slice(e+1);return q(r,n)},ff=function(t){return function(e){var n=e.raw();return P(t,n.which)}},df=function(t){return function(e){return K(t,function(t){return t(e)})}},mf=function(t){return!0===t.raw().shiftKey},hf=function(t){return!0===t.raw().ctrlKey},pf=u(mf),gf=function(t,e){return{matches:t,classification:e}},vf=function(t,e,n){e.exists(function(t){return n.exists(function(e){return wn(e,t)})})||xr(t,mr(),{prevFocus:e,newFocus:n})},bf=function(){var t=function(t){return Tu(t.element())};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element());var o=t(e);vf(e,r,o)}}},yf=function(){var t=function(t){return af.getHighlighted(t).map(function(t){return t.element()})};return{get:t,set:function(e,r){var o=t(e);e.getSystem().getByDom(r).fold(n,function(t){af.highlight(e,t)});var i=t(e);vf(e,o,i)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(hs||(hs={}));var xf=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,a;return(i=n(t,e,r,o),a=e.event(),q(i,function(t){return t.matches(a)}).map(function(t){return t.classification})).bind(function(n){return n(t,e,r,o)})},a={schema:function(){return t.concat([Fe("focusManager",bf()),He("focusInside","onFocus",ue(function(t){return P(["onFocus","onEnterOrSpace","onApi"],t)?it.value(t):it.error("Invalid value for focusInside")})),Aa("handler",a),Aa("state",e),Aa("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var a=t.focusInside!==hs.OnFocusMode?y.none():o(t).map(function(n){return Dr(Gn(),function(r,o){n(r,t,e),o.stop()})}),u=[Dr(jn(),function(r,a){i(r,a,n,t,e).fold(function(){!function(n,r){var i=ff([32].concat([13]))(r.event());t.focusInside===hs.OnEnterOrSpaceMode&&i&&On(n,r)&&o(t).each(function(o){o(n,t,e),r.stop()})}(r,a)},function(t){a.stop()})}),Dr(Vn(),function(n,o){i(n,o,r,t,e).each(function(t){o.stop()})})];return Sr(a.toArray().concat(u))}};return a},wf=function(t){var e=[Re("onEscape"),Re("onEnter"),Fe("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Fe("firstTabstop",0),Fe("useTabstopAt",o(!0)),Re("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind(function(t){return la(e,t)}).getOr(e);return Pi(n)>0},r=function(t,e,r){(function(t,e){var r=ys(t.element(),e.selector),o=z(r,function(t){return n(e,t)});return y.from(o[e.firstTabstop])})(t,e).each(function(n){e.focusManager.set(t,n)})},i=function(t,e,r,o,i){return i(e,r,function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)}).fold(function(){return o.cyclic?y.some(!0):y.none()},function(e){return o.focusManager.set(t,e),y.some(!0)})},u=function(t,e,n,r){var o=ys(t.element(),n.selector);return function(t,e){return e.focusManager.get(t).bind(function(t){return la(t,e.selector)})}(t,n).bind(function(e){return $(o,a(wn,e)).bind(function(e){return i(t,o,e,n,r)})})},s=o([gf(df([mf,ff([9])]),function(t,e,n){var r=n.cyclic?uf:sf;return u(t,0,n,r)}),gf(ff([9]),function(t,e,n){var r=n.cyclic?cf:lf;return u(t,0,n,r)}),gf(ff([27]),function(t,e,n){return n.onEscape.bind(function(n){return n(t,e)})}),gf(df([pf,ff([13])]),function(t,e,n){return n.onEnter.bind(function(n){return n(t,e)})})]),c=o([]);return xf(e,Fo.init,s,c,function(){return y.some(r)})},Cf=wf($e("cyclic",o(!1))),_f=wf($e("cyclic",o(!0))),kf=function(t,e,n){return $l(n)&&ff([32])(e.event())?y.none():function(t,e,n){return Cr(t,n,Qn()),y.some(!0)}(t,0,n)},Sf=function(t,e){return y.some(!0)},Tf=[Fe("execute",kf),Fe("useSpace",!1),Fe("useEnter",!0),Fe("useControlEnter",!1),Fe("useDown",!1)],Of=function(t,e,n){return n.execute(t,e,t.element())},Df=xf(Tf,Fo.init,function(t,e,n,r){var o=n.useSpace&&!$l(t.element())?[32]:[],i=n.useEnter?[13]:[],a=n.useDown?[40]:[],u=o.concat(i).concat(a);return[gf(ff(u),Of)].concat(n.useControlEnter?[gf(df([hf,ff([13])]),Of)]:[])},function(t,e,n,r){return n.useSpace&&!$l(t.element())?[gf(ff([32]),Sf)]:[]},function(){return y.none()}),Ef=function(){var t=Ye(y.none());return Ho({readState:function(){return t.get().map(function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set(y.some({numRows:e,numColumns:n}))},getNumRows:function(){return t.get().map(function(t){return t.numRows})},getNumColumns:function(){return t.get().map(function(t){return t.numColumns})}})},Nf=Object.freeze({__proto__:null,flatgrid:Ef,init:function(t){return t.state(t)}}),Af=function(t){return function(e,n,r,o){var i=t(e.element());return Pf(i,e,n,r,o)}},Rf=function(t,e){var n=Xu(t,e);return Af(n)},Bf=function(t,e){var n=Xu(e,t);return Af(n)},If=function(t){return function(e,n,r,o){return Pf(t,e,n,r,o)}},Pf=function(t,e,n,r,o){return r.focusManager.get(e).bind(function(n){return t(e.element(),n,r,o)}).map(function(t){return r.focusManager.set(e,t),!0})},Mf=If,Lf=If,Ff=If,Hf=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom())},jf=function(t,e,n){var r=ys(t,n);return function(t,e){return $(t,e).map(function(e){return{index:o(e),candidates:o(t)}})}(z(r,Hf),function(t){return wn(t,e)})},Vf=function(t,e){return $(t,function(t){return wn(e,t)})},zf=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind(function(e){var r=e.row()*n+e.column();return r>=0&&r<t.length?y.some(t[r]):y.none()})},Uf=function(t,e,n,r,i){return zf(t,e,r,function(e,a){var u=e===n-1?t.length-e*r:r,s=Fu(a,i,0,u-1);return y.some({row:o(e),column:o(s)})})},Wf=function(t,e,n,r,i){return zf(t,e,r,function(e,a){var u=Fu(e,i,0,n-1),s=u===n-1?t.length-u*r:r,c=Hu(a,0,s-1);return y.some({row:o(u),column:o(c)})})},qf=[_e("selector"),Fe("execute",kf),Da("onEscape"),Fe("captureTab",!1),Ba()],$f=function(t,e,n){ca(t.element(),e.selector).each(function(n){e.focusManager.set(t,n)})},Yf=function(t){return function(e,n,r,o){return jf(e,n,r.selector).bind(function(e){return t(e.candidates(),e.index(),o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))})}},Gf=function(t,e,n){return n.captureTab?y.some(!0):y.none()},Kf=Yf(function(t,e,n,r){return Uf(t,e,n,r,-1)}),Xf=Yf(function(t,e,n,r){return Uf(t,e,n,r,1)}),Jf=Yf(function(t,e,n,r){return Wf(t,e,n,r,-1)}),Qf=Yf(function(t,e,n,r){return Wf(t,e,n,r,1)}),Zf=o([gf(ff([37]),Rf(Kf,Xf)),gf(ff([39]),Bf(Kf,Xf)),gf(ff([38]),Mf(Jf)),gf(ff([40]),Lf(Qf)),gf(df([mf,ff([9])]),Gf),gf(df([pf,ff([9])]),Gf),gf(ff([27]),function(t,e,n){return n.onEscape(t,e)}),gf(ff([32].concat([13])),function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind(function(t){return la(t,e.selector)})}(t,n).bind(function(r){return n.execute(t,e,r)})})]),td=o([gf(ff([32]),Sf)]),ed=xf(qf,Ef,Zf,td,function(){return y.some($f)}),nd=function(t,e,n,r){return jf(t,n,e).bind(function(t){var e=t.index();return function t(e,n,o){var i,a=Fu(n,r,0,o.length-1);return a===e?y.none():(i=o[a],"button"===jr(i)&&"disabled"===mo(i,"disabled")?t(e,a,o):y.from(o[a]))}(e,e,t.candidates())})},rd=[_e("selector"),Fe("getInitial",y.none),Fe("execute",kf),Da("onEscape"),Fe("executeOnMove",!1),Fe("allowVertical",!0)],od=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind(function(t){return la(t,e.selector)})}(t,n).bind(function(r){return n.execute(t,e,r)})},id=function(t,e,n){e.getInitial(t).orThunk(function(){return ca(t.element(),e.selector)}).each(function(n){e.focusManager.set(t,n)})},ad=function(t,e,n){return nd(t,n.selector,e,-1)},ud=function(t,e,n){return nd(t,n.selector,e,1)},sd=function(t){return function(e,n,r,o){return t(e,n,r,o).bind(function(){return r.executeOnMove?od(e,n,r):y.some(!0)})}},cd=function(t,e,n){return n.onEscape(t,e)},ld=o([gf(ff([32]),Sf)]),fd=xf(rd,Fo.init,function(t,e,n,r){var o=[37].concat(n.allowVertical?[38]:[]),i=[39].concat(n.allowVertical?[40]:[]);return[gf(ff(o),sd(Rf(ad,ud))),gf(ff(i),sd(Bf(ad,ud))),gf(ff([13]),od),gf(ff([32]),od),gf(ff([27]),cd)]},ld,function(){return y.some(id)}),dd=function(t,e,n){return y.from(t[e]).bind(function(t){return y.from(t[n]).map(function(t){return{rowIndex:e,columnIndex:n,cell:t}})})},md=function(t,e,n,r){var o=t[e].length,i=Fu(n,r,0,o-1);return dd(t,e,i)},hd=function(t,e,n,r){var o=Fu(n,r,0,t.length-1),i=t[o].length,a=Hu(e,0,i-1);return dd(t,o,a)},pd=function(t,e,n,r){var o=t[e].length,i=Hu(n+r,0,o-1);return dd(t,e,i)},gd=function(t,e,n,r){var o=Hu(n+r,0,t.length-1),i=t[o].length,a=Hu(e,0,i-1);return dd(t,o,a)},vd=[Ee("selectors",[_e("row"),_e("cell")]),Fe("cycles",!0),Fe("previousSelector",y.none),Fe("execute",kf)],bd=function(t,e,n){e.previousSelector(t).orThunk(function(){var n=e.selectors;return ca(t.element(),n.cell)}).each(function(n){e.focusManager.set(t,n)})},yd=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return la(r,o.selectors.row).bind(function(t){var e=ys(t,o.selectors.cell);return Vf(e,r).bind(function(e){var r=ys(n,o.selectors.row);return Vf(r,t).bind(function(t){var n=function(t,e){return H(r,function(t){return ys(t,e.selectors.cell)})}(0,o);return i(n,t,e).map(function(t){return t.cell})})})})}},xd=yd(function(t,e,n){return md(t,e,n,-1)},function(t,e,n){return pd(t,e,n,-1)}),wd=yd(function(t,e,n){return md(t,e,n,1)},function(t,e,n){return pd(t,e,n,1)}),Cd=yd(function(t,e,n){return hd(t,n,e,-1)},function(t,e,n){return gd(t,n,e,-1)}),_d=yd(function(t,e,n){return hd(t,n,e,1)},function(t,e,n){return gd(t,n,e,1)}),kd=o([gf(ff([37]),Rf(xd,wd)),gf(ff([39]),Bf(xd,wd)),gf(ff([38]),Mf(Cd)),gf(ff([40]),Lf(_d)),gf(ff([32].concat([13])),function(t,e,n){return Tu(t.element()).bind(function(r){return n.execute(t,e,r)})})]),Sd=o([gf(ff([32]),Sf)]),Td=xf(vd,Fo.init,kd,Sd,function(){return y.some(bd)}),Od=[_e("selector"),Fe("execute",kf),Fe("moveOnTab",!1)],Dd=function(t,e,n){return n.focusManager.get(t).bind(function(r){return n.execute(t,e,r)})},Ed=function(t,e,n){ca(t.element(),e.selector).each(function(n){e.focusManager.set(t,n)})},Nd=function(t,e,n){return nd(t,n.selector,e,-1)},Ad=function(t,e,n){return nd(t,n.selector,e,1)},Rd=o([gf(ff([38]),Ff(Nd)),gf(ff([40]),Ff(Ad)),gf(df([mf,ff([9])]),function(t,e,n,r){return n.moveOnTab?Ff(Nd)(t,e,n,r):y.none()}),gf(df([pf,ff([9])]),function(t,e,n,r){return n.moveOnTab?Ff(Ad)(t,e,n,r):y.none()}),gf(ff([13]),Dd),gf(ff([32]),Dd)]),Bd=o([gf(ff([32]),Sf)]),Id=xf(Od,Fo.init,Rd,Bd,function(){return y.some(Ed)}),Pd=[Da("onSpace"),Da("onEnter"),Da("onShiftEnter"),Da("onLeft"),Da("onRight"),Da("onTab"),Da("onShiftTab"),Da("onUp"),Da("onDown"),Da("onEscape"),Fe("stopSpaceKeyup",!1),Re("focusIn")],Md=xf(Pd,Fo.init,function(t,e,n){return[gf(ff([32]),n.onSpace),gf(df([pf,ff([13])]),n.onEnter),gf(df([mf,ff([13])]),n.onShiftEnter),gf(df([mf,ff([9])]),n.onShiftTab),gf(df([pf,ff([9])]),n.onTab),gf(ff([38]),n.onUp),gf(ff([40]),n.onDown),gf(ff([37]),n.onLeft),gf(ff([39]),n.onRight),gf(ff([32]),n.onSpace),gf(ff([27]),n.onEscape)]},function(t,e,n){return n.stopSpaceKeyup?[gf(ff([32]),Sf)]:[]},function(t){return t.focusIn}),Ld=Cf.schema(),Fd=_f.schema(),Hd=fd.schema(),jd=ed.schema(),Vd=Td.schema(),zd=Df.schema(),Ud=Id.schema(),Wd=Md.schema(),qd=bu({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Ld,cyclic:Fd,flow:Hd,flatgrid:jd,matrix:Vd,execution:zd,menu:Ud,special:Wd}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold(function(){t.getSystem().triggerFocus(t.element(),t.element())},function(r){r(t,e,n)})},setGridSize:function(t,n,r,o,i){kt(r,"setGridSize")?r.setGridSize(o,i):e.console.error("Layout does not support setGridSize")}},state:Nf}),$d=function(t,e,n,r){var o=t.getSystem().build(r);ac(t,o,n)},Yd=function(t,e,n,r){var o=Gd(t);q(o,function(t){return wn(r.element(),t.element())}).each(sc)},Gd=function(t,e){return t.components()},Kd=function(t,e,n,r,o){var i=Gd(t);return y.from(i[r]).map(function(e){return Yd(t,0,0,e),o.each(function(e){$d(t,0,function(t,e){!function(t,e,n){Zr(t,r).fold(function(){ro(t,e)},function(t){to(t,e)})}(t,e)},e)}),e})},Xd=gu({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,e,n,r){$d(t,0,ro,r)},prepend:function(t,e,n,r){$d(t,0,no,r)},remove:Yd,replaceAt:Kd,replaceBy:function(t,e,n,r,o){var i=Gd(t);return $(i,r).bind(function(e){return Kd(t,0,0,e,o)})},set:function(t,e,n,r){Ou(function(){var e=H(r,t.getSystem().build);oc(t,e)},t.element())},contents:Gd})}),Jd=function(t,e){return{key:t,value:{config:{},me:function(t,e){var n=Sr(e);return gu({fields:[_e("enabled")],name:t,active:{events:o(n)}})}(t,e),configAsRaw:o({}),initialConfig:{},state:Fo}}},Qd=function(t,e){e.ignore||(ku(t.element()),e.onFocus(t))},Zd=Object.freeze({__proto__:null,focus:Qd,blur:function(t,e){e.ignore||function(t){t.dom().blur()}(t.element())},isFocused:function(t){return function(t){var e=ii(t).dom();return t.dom()===e.activeElement}(t.element())}}),tm=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return Vo(n)},events:function(t){return Sr([Dr(Gn(),function(e,n){Qd(e,t),n.stop()})].concat(t.stopMousedown?[Dr(Bn(),function(t,e){e.event().prevent()})]:[]))}}),em=[Oa("onFocus"),Fe("stopMousedown",!1),Fe("ignore",!1)],nm=gu({fields:em,name:"focusing",active:tm,apis:Zd}),rm=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},om=function(t,e,n){e.toggleClass.each(function(e){n.get()?Xo(t.element(),e):Jo(t.element(),e)})},im=function(t,e,n){sm(t,e,n,!n.get())},am=function(t,e,n){n.set(!0),om(t,e,n),rm(t,e,n)},um=function(t,e,n){n.set(!1),om(t,e,n),rm(t,e,n)},sm=function(t,e,n,r){(r?am:um)(t,e,n)},cm=function(t,e,n){sm(t,e,n,e.selected)},lm=Object.freeze({__proto__:null,onLoad:cm,toggle:im,isOn:function(t,e,n){return n.get()},on:am,off:um,set:sm}),fm=Object.freeze({__proto__:null,exhibit:function(){return Vo({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=im,Hr(function(t){o(t,n,r)})),a=lu(t,e,cm);return Sr(Y([t.toggleOnExecute?[i]:[],[a]]))}}),dm=function(t,e,n){fo(t.element(),"aria-expanded",n)},mm=[Fe("selected",!1),Re("toggleClass"),Fe("toggleOnExecute",!0),He("aria",{mode:"none"},he("mode",{pressed:[Fe("syncWithExpanded",!1),Aa("update",function(t,e,n){fo(t.element(),"aria-pressed",n),e.syncWithExpanded&&dm(t,0,n)})],checked:[Aa("update",function(t,e,n){fo(t.element(),"aria-checked",n)})],expanded:[Aa("update",dm)],selected:[Aa("update",function(t,e,n){fo(t.element(),"aria-selected",n)})],none:[Aa("update",n)]}))],hm=gu({fields:mm,name:"toggling",active:fm,apis:lm,state:(!1,{init:function(){var t=Ye(!1);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(!1)},readState:function(){return t.get()}}}})}),pm=function(){var t=function(t,e){e.stop(),wr(t)};return[Dr(Wn(),t),Dr(tr(),t),Br(En()),Br(Bn())]},gm=function(t){return Sr(Y([t.map(function(t){return Hr(function(e,n){t(e),n.stop()})}).toArray(),pm()]))},vm=function(t){(Tu(t.element()).isNone()||nm.isFocused(t))&&(nm.isFocused(t)||nm.focus(t),xr(t,"alloy.item-hover",{item:t}))},bm=function(t){xr(t,"alloy.item-focus",{item:t})},ym=o("alloy.item-hover"),xm=o("alloy.item-focus"),wm=[_e("data"),_e("components"),_e("dom"),Fe("hasSubmenu",!1),Re("toggling"),$c("itemBehaviours",[hm,nm,qd,zc]),Fe("ignoreFocus",!1),Fe("domModification",{}),Aa("builder",function(t){return{dom:t.dom,domModification:d(d({},t.domModification),{attributes:d(d(d({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Yc(t.itemBehaviours,[t.toggling.fold(hm.revoke,function(t){return hm.config(d({aria:{mode:"checked"}},t))}),nm.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){bm(t)}}),qd.config({mode:"execution"}),zc.config({store:{mode:"memory",initialValue:t.data}}),Jd("item-type-events",h(pm(),[Dr(Ln(),vm),Dr(Zn(),nm.focus)]))]),components:t.components,eventOrder:t.eventOrder}}),Fe("eventOrder",{})],Cm=[_e("dom"),_e("components"),Aa("builder",function(t){return{dom:t.dom,components:t.components,events:Sr([Ir(Zn())])}})],_m=o([pl({name:"widget",overrides:function(t){return{behaviours:hu([zc.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:function(){}}})])}}})]),km=[_e("uid"),_e("data"),_e("components"),_e("dom"),Fe("autofocus",!1),Fe("ignoreFocus",!1),$c("widgetBehaviours",[zc,nm,qd]),Fe("domModification",{}),Ml(_m()),Aa("builder",function(t){var e=Ol(0,t,_m()),n=Dl("item-widget",t,e.internals()),r=function(e){return El(e,t,"widget").map(function(t){return qd.focusIn(t),t})},o=function(e,n){return $l(n.event().target())?y.none():t.autofocus?(n.setSource(e.element()),y.none()):y.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:Sr([Hr(function(t,e){r(t).each(function(t){e.stop()})}),Dr(Ln(),vm),Dr(Zn(),function(e,n){t.autofocus?r(e):nm.focus(e)})]),behaviours:Yc(t.widgetBehaviours,[zc.config({store:{mode:"memory",initialValue:t.data}}),nm.config({ignore:t.ignoreFocus,onFocus:function(t){bm(t)}}),qd.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:yu(),onLeft:o,onRight:o,onEscape:function(e,n){return nm.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element()),y.none()):y.none():(nm.focus(e),y.some(!0))}})])}})],Sm=he("type",{widget:km,item:wm,separator:Cm}),Tm=o([bl({factory:{sketch:function(t){var e=fe("menu.spec item",Sm,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return e.hasOwnProperty("uid")?e:d(d({},e),{uid:Eo("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Om=o([_e("value"),_e("items"),_e("dom"),_e("components"),Fe("eventOrder",{}),Uc("menuBehaviours",[af,zc,Kl,qd]),He("movement",{mode:"menu",moveOnTab:!0},he("mode",{grid:[Ba(),Aa("config",function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}})],matrix:[Aa("config",function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}}),_e("rowSelector")],menu:[Fe("moveOnTab",!0),Aa("config",function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}})]})),ke("markers",Ca()),Fe("fakeFocus",!1),Fe("focusManager",bf()),Oa("onHighlight")]),Dm=o("alloy.menu-focus"),Em=Wl({name:"Menu",configFields:Om(),partFields:Tm(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:qc(t.menuBehaviours,[af.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),zc.config({store:{mode:"memory",initialValue:t.value}}),Kl.config({find:y.some}),qd.config(t.movement.config(t,t.movement))]),events:Sr([Dr(xm(),function(t,e){var n=e.event();t.getSystem().getByDom(n.target()).each(function(n){af.highlight(t,n),e.stop(),xr(t,Dm(),{menu:t,item:n})})}),Dr(ym(),function(t,e){var n=e.event().item();af.highlight(t,n)})]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Nm=function(t,e){var n={};gt(t,function(t,e){j(t,function(t){n[t]=e})});var r=e,o=bt(e,function(t,e){return{k:t,v:e}}),i=vt(o,function(t,e){return[e].concat(function t(e,n,r,o){return Ct(r,o).bind(function(o){return Ct(e,o).bind(function(o){var i=t(e,n,r,o);return y.some([o].concat(i))})}).getOr([])}(n,r,o,e))});return vt(n,function(t){return Ct(i,t).getOr([t])})},Am=function(t){return"prepared"===t.type?y.some(t.menu):y.none()},Rm=function(){var t=Ye({}),e=Ye({}),n=Ye({}),r=Ye(y.none()),o=Ye({}),i=function(e,n,r){return a(e).bind(function(o){return function(e){return xt(t.get(),function(t,n){return t===e})}(e).bind(function(t){return n(t).map(function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}})})})},a=function(t){return u(t).bind(Am)},u=function(t){return Ct(e.get(),t)},s=function(e){return Ct(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(d(d({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,a,u,s){r.set(y.some(i)),t.set(u),e.set(a),o.set(s);var c=Nm(s,u);n.set(c)},expand:function(e){return Ct(t.get(),e).map(function(t){var r=Ct(n.get(),e).getOr([]);return[t].concat(r)})},refresh:function(t){return Ct(n.get(),t)},collapse:function(t){return Ct(n.get(),t).bind(function(t){return t.length>1?y.some(t.slice(1)):y.none()})},lookupMenu:u,lookupItem:s,otherMenus:function(t){var e=o.get();return J(ht(e),t)},getPrimary:function(){return r.get().bind(a)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.set(y.none())},isClear:function(){return r.get().isNone()},getTriggeringPath:function(t,e){var o=z(s(t).toArray(),function(t){return a(t).isSome()});return Ct(n.get(),t).bind(function(t){var n=X(o.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return y.none();e.push(r.getOrDie())}return y.some(e)}(G(n,function(t,o){return i(t,e,n.slice(0,o+1)).fold(function(){return r.get().is(t)?[]:[y.none()]},function(t){return[y.some(t)]})}))})}}},Bm=Am,Im=o("collapse-item"),Pm=Ul({name:"TieredMenu",configFields:[Na("onExecute"),Na("onEscape"),Ea("onOpenMenu"),Ea("onOpenSubmenu"),Oa("onRepositionMenu"),Oa("onCollapseMenu"),Fe("highlightImmediately",!0),Ee("data",[_e("primary"),_e("menus"),_e("expansions")]),Fe("fakeFocus",!1),Oa("onHighlight"),Oa("onHover"),ka(),_e("dom"),Fe("navigateOnHover",!0),Fe("stayInDom",!1),Uc("tmenuBehaviours",[qd,af,Kl,Xd]),Fe("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=Ye(y.none()),o=Rm(),i=function(t){return zc.getValue(t).value},a=function(e){return vt(t.data.menus,function(t,e){return G(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})})},u=function(t,e){af.highlight(t,e),af.getHighlighted(e).orThunk(function(){return af.getFirst(e)}).each(function(e){Cr(t,e.element(),Zn())})},s=function(t,e){return ql(H(e,function(e){return t.lookupMenu(e).bind(function(t){return"prepared"===t.type?y.some(t.menu):y.none()})}))},c=function(e,n,r){var o=s(n,n.otherMenus(r));j(o,function(n){ti(n.element(),[t.markers.backgroundMenu]),t.stayInDom||Xd.remove(e,n)})},l=function(e,n){var o=function(e){return r.get().getOrThunk(function(){var n={},o=ys(e.element(),"."+t.markers.item),a=z(o,function(t){return"true"===mo(t,"aria-haspopup")});return j(a,function(t){e.getSystem().getByDom(t).each(function(t){var e=i(t);n[e]=t})}),r.set(y.some(n)),n})}(e);gt(o,function(t,e){var r=P(n,e);fo(t.element(),"aria-expanded",r)})},f=function(e,n,r){return y.from(r[0]).bind(function(o){return n.lookupMenu(o).bind(function(o){if("notbuilt"===o.type)return y.none();var i=o.menu,a=s(n,r.slice(1));return j(a,function(e){Xo(e.element(),t.markers.backgroundMenu)}),ui(i.element())||Xd.append(e,Ri(i)),ti(i.element(),[t.markers.backgroundMenu]),u(e,i),c(e,n,r),y.some(i)})})};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var m=function(e,r,a){void 0===a&&(a=n.HighlightSubmenu);var u=i(r);return o.expand(u).bind(function(i){return l(e,i),y.from(i[0]).bind(function(u){return o.lookupMenu(u).bind(function(s){var c=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,u,s);return ui(c.element())||Xd.append(e,Ri(c)),t.onOpenSubmenu(e,r,c,X(i)),a===n.HighlightSubmenu?(af.highlightFirst(c),f(e,o,i)):(af.dehighlightAll(c),y.some(r))})})})},h=function(e,n){var r=i(n);return o.collapse(r).bind(function(r){return l(e,r),f(e,o,r).map(function(r){return t.onCollapseMenu(e,n,r),r})})},p=function(e){return function(n,r){return la(r.getSource(),"."+t.markers.item).bind(function(t){return n.getSystem().getByDom(t).toOption().bind(function(t){return e(n,t).map(function(){return!0})})})}},g=Sr([Dr(Dm(),function(t,e){var n=e.event().item();o.lookupItem(i(n)).each(function(){var n=e.event().menu();af.highlight(t,n);var r=i(e.event().item());o.refresh(r).each(function(e){return c(t,o,e)})})}),Hr(function(e,r){var o=r.event().target();e.getSystem().getByDom(o).each(function(r){0===i(r).indexOf("collapse-item")&&h(e,r),m(e,r,n.HighlightSubmenu).fold(function(){t.onExecute(e,r)},function(){})})}),Mr(function(e,n){(function(e){var n=function(e,n,r){return vt(r,function(r,o){var i=function(){return Em.sketch(d(d({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?yf():bf()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}})}(e,t.data.primary,t.data.menus),r=a();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()})(e).each(function(n){Xd.append(e,Ri(n)),t.onOpenMenu(e,n),t.highlightImmediately&&u(e,n)})})].concat(t.navigateOnHover?[Dr(ym(),function(e,r){var a=r.event().item();!function(t,e){var n=i(a);o.refresh(n).bind(function(e){return l(t,e),f(t,o,e)})}(e),m(e,a,n.HighlightParent),t.onHover(e,a)})]:[])),v=function(t){return af.getHighlighted(t).bind(af.getHighlighted)},b={collapseMenu:function(t){v(t).each(function(e){h(t,e)})},highlightPrimary:function(t){o.getPrimary().each(function(e){u(t,e)})},repositionMenus:function(e){o.getPrimary().bind(function(t){return v(e).bind(function(t){var e=i(t),n=wt(o.getMenus()),r=ql(H(n,Bm));return o.getTriggeringPath(e,function(t){return e=t,nt(r,function(t){if(!t.getSystem().isConnected())return y.none();var n=af.getCandidates(t);return q(n,function(t){return i(t)===e})});var e})}).map(function(e){return{primary:t,triggeringPath:e}})}).fold(function(){(function(t){return y.from(t.components()[0]).filter(function(t){return"menu"===mo(t.element(),"role")})})(e).each(function(n){t.onRepositionMenu(e,n,[])})},function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)})}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:qc(t.tmenuBehaviours,[qd.config({mode:"special",onRight:p(function(t,e){return $l(e.element())?y.none():m(t,e,n.HighlightSubmenu)}),onLeft:p(function(t,e){return $l(e.element())?y.none():h(t,e)}),onEscape:p(function(e,n){return h(e,n).orThunk(function(){return t.onEscape(e,n).map(function(){return e})})}),focusIn:function(t,e){o.getPrimary().each(function(e){Cr(t,e.element(),Zn())})}}),af.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),Kl.config({find:function(t){return af.getHighlighted(t)}}),Xd.config({})]),eventOrder:t.eventOrder,apis:b,events:g}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:jt(t,e),expansions:{}}},collapseItem:function(t){return{value:Co(Im()),meta:{text:t}}}}}),Mm=Ul({name:"InlineView",configFields:[_e("lazySink"),Oa("onShow"),Oa("onHide"),Me("onEscape"),Uc("inlineBehaviours",[Cc,zc,Cu]),Le("fireDismissalEventInstead",[Fe("event",fr())]),Le("fireRepositionEventInstead",[Fe("event",dr())]),Fe("getRelated",y.none),Fe("isExtraPart",c),Fe("eventOrder",y.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,function(){return o.map(function(t){return ta(t)})})},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();Cc.openWhileCloaked(e,r,function(){return tc.positionWithinBounds(i,n,e,o())}),zc.setValue(e,y.some({mode:"position",anchor:n,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},a="horizontal"===r.type?{layouts:{onLtr:function(){return su()},onRtl:function(){return cu()}}}:{},u=function(t){return function(t){return 2===t.length}(t)?a:{}};return Pm.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return Cc.close(e),t.onEscape.map(function(t){return t(e)}),y.some(!0)},onExecute:function(){return y.some(!0)},onOpenMenu:function(t,e){tc.positionWithinBounds(i().getOrDie(),n,e,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();tc.position(o,d({anchor:"submenu",item:e},u(r)),n)},onRepositionMenu:function(t,e,r){var a=i().getOrDie();tc.positionWithinBounds(a,n,e,o()),j(r,function(t){var e=u(t.triggeringPath);tc.position(a,d({anchor:"submenu",item:t.triggeringItem},e),t.triggeredMenu)})}})}(t,e,n,r,o);Cc.open(e,i),zc.setValue(e,y.some({mode:"menu",menu:i}))},i=function(e){Cc.isOpen(e)&&zc.getValue(e).each(function(n){switch(n.mode){case"menu":Cc.getState(e).each(function(t){Pm.repositionMenus(t)});break;case"position":var r=t.lazySink(e).getOrDie();tc.positionWithinBounds(r,n.anchor,e,n.getBounds())}})},a={setContent:function(t,e){Cc.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,y.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,function(){return y.none()})},showMenuWithinBounds:o,hide:function(t){Cc.isOpen(t)&&(zc.setValue(t,y.none()),Cc.close(t))},getContent:function(t){return Cc.getState(t)},reposition:i,isOpen:Cc.isOpen};return{uid:t.uid,dom:t.dom,behaviours:qc(t.inlineBehaviours,[Cc.config({isPartOf:function(e,n,r){return ma(n,r)||function(e,n){return t.getRelated(e).exists(function(t){return ma(t,n)})}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),zc.config({store:{mode:"memory",initialValue:y.none()}}),Cu.config({channels:d(d({},Oc(d({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Ec(d(d({},t.fireRepositionEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:a}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),Lm=function(t){return t.x},Fm=function(t,e){return t.x+t.width/2-e.width/2},Hm=function(t,e){return t.x+t.width-e.width},jm=function(t){return t.y},Vm=function(t,e){return t.y+t.height-e.height},zm=function(t,e,n){return Ia(Hm(t,e),Vm(t,e),n.innerSoutheast(),Ha(),Wa(t,{right:0,bottom:3}),"layout-inner-se")},Um=function(t,e,n){return Ia(Lm(t),Vm(t,e),n.innerSouthwest(),Fa(),Wa(t,{left:1,bottom:3}),"layout-inner-sw")},Wm=function(t,e,n){return Ia(Hm(t,e),jm(t),n.innerNortheast(),La(),Wa(t,{right:0,top:2}),"layout-inner-ne")},qm=function(t,e,n){return Ia(Lm(t),jm(t),n.innerNorthwest(),Ma(),Wa(t,{left:1,top:2}),"layout-inner-nw")},$m=function(t,e,n){return Ia(Fm(t,e),jm(t),n.innerNorth(),ja(),Wa(t,{top:2}),"layout-inner-n")},Ym=function(t,e,n){return Ia(Fm(t,e),Vm(t,e),n.innerSouth(),Va(),Wa(t,{bottom:3}),"layout-inner-s")},Gm=tinymce.util.Tools.resolve("tinymce.util.Delay"),Km=Ul({name:"Button",factory:function(t){var e=gm(t.action),n=t.dom.tag,r=function(e){return Ct(t.dom,"attributes").bind(function(t){return Ct(t,e)})};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Yc(t.buttonBehaviours,[nm.config({}),qd.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map(function(t){return{role:t}}).getOr({});return d({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[Fe("uid",void 0),_e("dom"),Fe("components",[]),$c("buttonBehaviours",[nm,qd]),Re("action"),Re("role"),Fe("eventOrder",{})]}),Xm=function(t){var e=function(t){return void 0!==t.uid}(t)&&kt(t,"uid")?t.uid:Eo("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOption()},asSpec:function(){return d(d({},t),{uid:e})}}},Jm=function(t){return y.from(t()["temporary-placeholder"]).getOr("!not found!")},Qm=function(t,e){return y.from(e()[t.toLowerCase()]).getOrThunk(function(){return Jm(e)})},Zm=function(t,e){return nt(t,function(t){return y.from(e()[t.toLowerCase()])}).getOrThunk(function(){return Jm(e)})},th={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},eh=Ul({name:"Notification",factory:function(t){var e=Xm({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:hu([Xd.config({})])}),n=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},o=Xm({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:hu([Xd.config({})])}),i={updateProgress:function(t,e){t.getSystem().isConnected()&&o.getOpt(t).each(function(t){Xd.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(e)]},r(e)])})},updateText:function(t,n){if(t.getSystem().isConnected()){var r=e.get(t);Xd.set(r,[Di(n)])}}},a=Y([t.icon.toArray(),t.level.toArray(),t.level.bind(function(t){return y.from(th[t])}).toArray()]);return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]}).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:Zm(a,t.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:hu([Xd.config({})])}].concat(t.progress?[o.asSpec()]:[]).concat(t.closeButton?[Km.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:Qm("close",t.iconProvider),attributes:{"aria-label":t.translationProvider("Close")}}}],action:function(e){t.onAction(e)}})]:[]),apis:i}},configFields:[Re("level"),_e("progress"),_e("icon"),_e("onAction"),_e("text"),_e("iconProvider"),_e("translationProvider"),Ue("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});var nh,rh=function(t,n){var r=null;return{cancel:function(){null!==r&&(e.clearTimeout(r),r=null)},throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null!==r&&e.clearTimeout(r),r=e.setTimeout(function(){t.apply(null,o),r=null},n)}}},oh=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),ih=function(t,e,n,r,o){var i=oh(t,function(e){return function(t,e){return t.isBlock(e)||P(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)});return y.from(i.backwards(e,n,r,o))},ah=function(t,e){return uh(Ke.fromDom(t.selection.getNode())).getOrThunk(function(){var n=Ke.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return ro(n,Ke.fromDom(e.extractContents())),e.insertNode(n.dom()),Xr(n).each(function(t){return t.dom().normalize()}),function(t,e){return function t(n){for(var r=Qr(n),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return y.some(i);var a=t(i);if(a.isSome())return a}return y.none()}(t)}(n,bs).map(function(e){t.selection.setCursorLocation(e.dom(),function(t){return"img"===jr(t)?1:gs(t).fold(function(){return Qr(t).length},function(t){return t.length})}(e))}),n})},uh=function(t){return la(t,"[data-mce-autocompleter]")},sh=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},ch=function(t){return""!==t&&-1!=="  \f\n\r\t\v".indexOf(t)},lh=function(t,e){return t.substring(e.length)},fh=function(t,e,n,r){return void 0===r&&(r=0),uh(Ke.fromDom(e.startContainer)).fold(function(){return function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return y.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return ih(t,e.startContainer,e.startOffset,function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(ch(o))return y.none();if(o===n)break}return y.some(r)}(r,e,n).getOr(e)},i).bind(function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return y.none();var i=sh(o);return 0!==i.lastIndexOf(n)||lh(i,n).length<r?y.none():y.some({text:lh(i,n),range:o,triggerChar:n})})}(t,e,n,r)},function(e){var r=t.createRng();r.selectNode(e.dom());var o=sh(r);return y.some({range:r,text:lh(o,n),triggerChar:n})})},dh=tinymce.util.Tools.resolve("tinymce.util.Promise"),mh=function(t,e){return{container:t,offset:e}},hh=function t(n,r){var o=n.childNodes;return o.length>0&&r<o.length?t(o[r],0):o.length>0&&function(t){return t.nodeType===e.Node.ELEMENT_NODE}(n)&&o.length===r?function t(n){if(function(t){return t.nodeType===e.Node.TEXT_NODE}(n))return mh(n,n.data.length);var r=n.childNodes;return r.length>0?t(r[r.length-1]):mh(n,r.length)}(o[o.length-1]):mh(n,r)},ph=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,a=z(o.lookupByChar(n.triggerChar),function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk(function(){return function(t){return function(e){var n=hh(e.startContainer,e.startOffset);return!function(t,e){return ih(t,e.container,e.offset,function(t,e){return 0===e?-1:e},t.getRoot()).filter(function(t){var e=t.container.data.charAt(t.offset-1);return!ch(e)}).isSome()}(t,n)}}(t.dom)})(n.range,i,n.text)});if(0===a.length)return y.none();var u=dh.all(H(a,function(t){return t.fetch(n.text,t.maxResults,r).then(function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction}})}));return y.some({lookupData:u,context:n})},gh=Qt([Te("type"),Pe("text")]),vh=Qt([$e("type",function(){return"autocompleteitem"}),$e("active",function(){return!1}),$e("disabled",function(){return!1}),Fe("meta",{}),Te("value"),Pe("text"),Pe("icon")]),bh=Qt([Te("type"),Te("ch"),je("minChars",1),Fe("columns",1),je("maxResults",10),Me("matches"),De("fetch"),De("onAction")]);!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(nh||(nh={}));var yh,xh=nh,wh="tox-menu-nav__js",Ch="tox-collection__item",_h={normal:wh,color:"tox-swatch"},kh="tox-collection__item-label",Sh="tox-collection__item--active",Th=function(t){return Ct(_h,t).getOr(wh)},Oh=function(t){return"color"===t?"tox-swatches":"tox-menu"},Dh=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:Oh(t),tieredMenu:"tox-tiered-menu"}},Eh=function(t){var e=Dh(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Th(t)}},Nh=function(t,e,n){var r=Dh(n);return{tag:"div",classes:Y([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},Ah=[Em.parts().items({})],Rh=function(t,e,n){var r=Dh(n);return{dom:{tag:"div",classes:Y([[r.tieredMenu]])},markers:Eh(n)}},Bh=function(t,e){return function(n){var r=F(n,e);return H(r,function(e){return{dom:t,components:e}})}},Ih=function(t,e){var n=[],r=[];return j(t,function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],_t(t.dom,"innerHtml")&&r.push(t)):r.push(t)}),r.length>0&&n.push(r),H(n,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}})},Ph=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Em.parts().items({preprocess:function(n){return"auto"!==t&&t>1?Bh({tag:"div",classes:["tox-collection__group"]},t)(n):Ih(n,function(t,n){return"separator"===e[n].type})}})]}},Mh=function(t){return M(t,function(t){return"icon"in t&&void 0!==t.icon})},Lh=function(t){return e.console.error(de(t)),e.console.log(t),y.none()},Fh=function(t,e,n,r,o){var a;return"color"===o?{value:t,dom:(a=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Em.parts().items({preprocess:"auto"!==t?Bh({tag:"div",classes:["tox-swatches__row"]},t):i})]}]}}(r)).dom,components:a.components,items:n}:"normal"===o&&"auto"===r?{value:t,dom:(a=Ph(r,n)).dom,components:a.components,items:n}:"normal"===o&&1===r?{value:t,dom:(a=Ph(1,n)).dom,components:a.components,items:n}:"normal"===o?{value:t,dom:(a=Ph(r,n)).dom,components:a.components,items:n}:"listpreview"===o&&"auto"!==r?{value:t,dom:(a=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Em.parts().items({preprocess:Bh({tag:"div",classes:["tox-collection__group"]},t)})]}}(r)).dom,components:a.components,items:n}:{value:t,dom:Nh(e,r,o),components:Ah,items:n}},Hh=[Ue("disabled",!1),Pe("text"),Pe("shortcut"),re("value","value",Mt(function(){return Co("menuitem-value")}),pe()),Fe("meta",{})],jh=Qt([Te("type"),Ue("active",!1),Pe("icon")].concat(Hh)),Vh=Qt([Te("type"),Oe("fancytype",["inserttable","colorswatch"]),We("onAction",n)]),zh=Qt([Te("type"),We("onSetup",function(){return n}),We("onAction",n),Pe("icon")].concat(Hh)),Uh=Qt([Te("type"),De("getSubmenuItems"),We("onSetup",function(){return n}),Pe("icon")].concat(Hh)),Wh=Qt([Te("type"),Pe("icon"),Ue("active",!1),We("onSetup",function(){return n}),De("onAction")].concat(Hh)),qh=function(t,e,n){var r=ys(t.element(),"."+n);if(r.length>0){var o=$(r,function(t){var n=t.dom().getBoundingClientRect().top,o=r[0].dom().getBoundingClientRect().top;return Math.abs(n-o)>e}).getOr(r.length);return y.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return y.none()},$h=function(t){return function(t,e){return hu([Jd(t,e)])}(Co("unnamed-events"),t)},Yh=[_e("lazySink"),_e("tooltipDom"),Fe("exclusive",!0),Fe("tooltipComponents",[]),Fe("delay",300),ze("mode","normal",["normal","follow-highlight"]),Fe("anchor",function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:o([nu,eu,Ja,Za,Qa,tu]),onRtl:o([nu,eu,Ja,Za,Qa,tu])}}}),Oa("onHide"),Oa("onShow")],Gh=Object.freeze({__proto__:null,init:function(){var t=Ye(y.none()),n=Ye(y.none()),r=function(){t.get().each(function(t){e.clearTimeout(t)})},i=o("not-implemented");return Ho({getTooltip:function(){return n.get()},isShowing:function(){return n.get().isSome()},setTooltip:function(t){n.set(y.some(t))},clearTooltip:function(){n.set(y.none())},clearTimer:r,resetTimer:function(n,o){r(),t.set(y.some(e.setTimeout(function(){n()},o)))},readState:i})}}),Kh=Co("tooltip.exclusive"),Xh=Co("tooltip.show"),Jh=Co("tooltip.hide"),Qh=function(t,e,n){t.getSystem().broadcastOn([Kh],{})},Zh=Object.freeze({__proto__:null,hideAllExclusive:Qh,setComponents:function(t,e,n,r){n.getTooltip().each(function(t){t.getSystem().isConnected()&&Xd.set(t,r)})}}),tp=gu({fields:Yh,name:"tooltipping",active:Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each(function(r){sc(r),t.onHide(n,r),e.clearTooltip()}),e.clearTimer()};return Sr(Y([[Dr(Xh,function(n){e.resetTimer(function(){!function(n){if(!e.isShowing()){Qh(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:Sr("normal"===t.mode?[Dr(Ln(),function(t){yr(n,Xh)}),Dr(Pn(),function(t){yr(n,Jh)})]:[]),behaviours:hu([Xd.config({})])});e.setTooltip(o),ic(r,o),t.onShow(n,o),tc.position(r,t.anchor(n),o)}}(n)},t.delay)}),Dr(Jh,function(r){e.resetTimer(function(){n(r)},t.delay)}),Dr(Jn(),function(t,e){P(e.channels(),Kh)&&n(t)}),Lr(function(t){n(t)})],"normal"===t.mode?[Dr(Fn(),function(t){yr(t,Xh)}),Dr(Kn(),function(t){yr(t,Jh)}),Dr(Ln(),function(t){yr(t,Xh)}),Dr(Pn(),function(t){yr(t,Jh)})]:[Dr(vr(),function(t,e){yr(t,Xh)}),Dr(br(),function(t){yr(t,Jh)})]]))}}),state:Gh,apis:Zh}),ep=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),np=tinymce.util.Tools.resolve("tinymce.util.I18n"),rp=["input","button","textarea","select"],op=function(t,e,n){(e.disabled()?ap:up)(t,e,n)},ip=function(t,e){return!0===e.useNative&&P(rp,jr(t.element()))},ap=function(t,e,n){e.disableClass.each(function(e){Xo(t.element(),e)}),(ip(t,e)?function(t){fo(t.element(),"disabled","disabled")}:function(t){fo(t.element(),"aria-disabled","true")})(t),e.onDisabled(t)},up=function(t,e,n){e.disableClass.each(function(e){Jo(t.element(),e)}),(ip(t,e)?function(t){go(t.element(),"disabled")}:function(t){fo(t.element(),"aria-disabled","false")})(t),e.onEnabled(t)},sp=function(t,e){return ip(t,e)?function(t){return po(t.element(),"disabled")}(t):function(t){return"true"===mo(t.element(),"aria-disabled")}(t)},cp=Object.freeze({__proto__:null,enable:up,disable:ap,isDisabled:sp,onLoad:op,set:function(t,e,n,r){(r?ap:up)(t,e,n)}}),lp=Object.freeze({__proto__:null,exhibit:function(t,e){return Vo({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return Sr([Tr(Qn(),function(e,n){return sp(e,t)}),lu(t,e,op)])}}),fp=[We("disabled",c),Fe("useNative",!0),Re("disableClass"),Oa("onDisabled"),Oa("onEnabled")],dp=gu({fields:fp,name:"disabling",active:lp,apis:cp}),mp=tinymce.util.Tools.resolve("tinymce.EditorManager"),hp=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},pp=function(t){return t.getParam("width",ep.DOM.getStyle(t.getElement(),"width"))},gp=function(t){return y.from(t.getParam("min_width")).filter(E)},vp=function(t){return y.from(t.getParam("min_height")).filter(E)},bp=function(t){return y.from(t.getParam("max_width")).filter(E)},yp=function(t){return y.from(t.getParam("max_height")).filter(E)},xp=function(t){return!1!==t.getParam("menubar",!0,"boolean")},wp=function(t){var e=t.getParam("toolbar",!0),n=!0===e,r=C(e),o=k(e)&&e.length>0;return!_p(t)&&(o||r||n)},Cp=function(t){var e=L(9,function(e){return t.getParam("toolbar"+(e+1),!1,"string")}),n=z(e,function(t){return"string"==typeof t});return n.length>0?y.some(n):y.none()},_p=function(t){return Cp(t).fold(function(){return t.getParam("toolbar",[],"string[]").length>0},function(){return!0})};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(yh||(yh={}));var kp,Sp=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(kp||(kp={}));var Tp,Op=function(t){return t.getParam("toolbar_location",kp.auto,"string")},Dp=function(t){return Op(t)===kp.bottom},Ep=function(t){var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);return e.length>0&&t.inline?ca(si(),e):y.none()},Np=function(t){return t.inline&&Ep(t).isSome()},Ap=function(t){return t.inline&&!xp(t)&&!wp(t)&&!_p(t)},Rp=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Np(t)&&!Ap(t)},Bp=function(t){var e=t.getParam("menu");return e?vt(e,function(t){return d(d({},t),{items:t.items})}):{}},Ip=function(t){return t.getParam("menubar")},Pp=function(t){return t.getParam("anchor_top","#top","string")},Mp=function(t){return t.getParam("anchor_bottom","#bottom","string")},Lp=Qt([("readonly",ke("readonly",ye))]),Fp=function(t,e){var n=t.outerContainer.element();e&&(t.mothership.broadcastOn([_c()],{target:n}),t.uiMothership.broadcastOn([_c()],{target:n})),t.mothership.broadcastOn(["silver.readonly"],{readonly:e}),t.uiMothership.broadcastOn(["silver.readonly"],{readonly:e})},Hp=function(t,e){t.on("init",function(){t.mode.isReadOnly()&&Fp(e,!0)}),t.on("SwitchMode",function(){return Fp(e,t.mode.isReadOnly())}),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},jp=function(){var t;return Cu.config({channels:(t={},t["silver.readonly"]={schema:Lp,onReceive:function(t,e){dp.set(t,e.readonly)}},t)})},Vp=function(t){return dp.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},zp=function(t){return dp.config({disabled:t})},Up=function(t){return dp.config({disabled:t,disableClass:"tox-tbtn--disabled"})},Wp=function(t){return dp.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},qp=function(t,e){var n=t.getApi(e);return function(t){t(n)}},$p=function(t,e){return Mr(function(n){qp(t,n)(function(n){var r=t.onSetup(n);null!=r&&e.set(r)})})},Yp=function(t,e){return Lr(function(n){return qp(t,n)(e.get())})},Gp=function(t,e){return Hr(function(n,r){qp(t,n)(t.onAction),t.triggersSubmenu||e!==xh.CLOSE_ON_EXECUTE||(yr(n,nr()),r.stop())})},Kp={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},Xp=function(t){return G(t,function(t){return t.toArray()})},Jp=function(t,e,r,o){var i=Ye(n);return{type:"item",dom:e.dom,components:Xp(e.optComponents),data:t.data,eventOrder:Kp,hasSubmenu:t.triggersSubmenu,itemBehaviours:hu([Jd("item-events",[Gp(t,r),$p(t,i),Yp(t,i)]),Vp(function(){return t.disabled||o.isReadOnly()}),jp(),Xd.config({})].concat(t.itemBehaviours))}},Qp=function(t){return{value:t.value,meta:d({text:t.text.getOr("")},t.meta)}},Zp=tinymce.util.Tools.resolve("tinymce.Env"),tg=function(t){var e=Zp.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=H(n,function(t){var n=t.toLowerCase().trim();return _t(e,n)?e[n]:t});return Zp.mac?r.join(""):r.join("+")},eg=function(t){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:t}}},ng=function(t){return{dom:{tag:"div",classes:[kh]},components:[Di(np.translate(t))]}},rg=function(t,e){return{dom:{tag:"div",classes:[kh]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Di(np.translate(e))]}]}},og=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:tg(t)}}},ig=function(t){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:Qm("checkmark",t)}}},ag=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],ug=["list-bull-circle","list-bull-default","list-bull-square"],sg=function(t,e,n,r){void 0===r&&(r=y.none());var o,i=np.isRtl()&&t.iconContent.exists(function(t){return P(ug,t)}),u=(o=t.iconContent,o.map(function(t){return np.isRtl()&&P(ag,t)?t+"-rtl":t})).map(function(t){return function(t,e,n){return y.from(e()[t.toLowerCase()]).or(n).getOrThunk(function(){return Jm(e)})}(t,e.icons,r)}),s=y.from(t.meta).fold(function(){return ng},function(t){return _t(t,"style")?a(rg,t.style):ng});return"color"===t.presets?function(t,e,n,r){var o,i;return{dom:(o=u.getOr(""),i={tag:"div",attributes:t.map(function(t){return{title:r.translate(t)}}).getOr({}),classes:["tox-swatch"]},d(d({},i),"custom"===e?{tag:"button",classes:h(i.classes,["tox-swatches__picker-btn"]),innerHtml:o}:"remove"===e?{classes:h(i.classes,["tox-swatch--remove"]),innerHtml:o}:{attributes:d(d({},i.attributes),{"data-mce-color":e}),styles:{"background-color":e}})),optComponents:[]}}(t.ariaLabel,t.value,0,e):function(t,e,n,r,o){var i=n?e.or(y.some("")).map(eg):y.none(),a=t.checkMark,u=t.ariaLabel.map(function(t){return{attributes:{title:np.translate(t)}}}).getOr({});return{dom:d({tag:"div",classes:[wh,Ch].concat(o?["tox-collection__item-icon-rtl"]:[])},u),optComponents:[i,t.htmlContent.fold(function(){return t.textContent.map(r)},function(t){return y.some(function(t){return{dom:{tag:"div",classes:[kh],innerHtml:t}}}(t))}),t.shortcutContent.map(og),a,t.caret]}}(t,u,n,s,i)},cg=function(t,e){return Ct(t,"tooltipWorker").map(function(t){return[tp.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:Wu}}},mode:"follow-highlight",onShow:function(e,n){t(function(t){tp.setComponents(e,[Ei({element:Ke.fromDom(t)})])})}})]}).getOr([])},lg=o(Cl("item-widget",_m())),fg=Co("cell-over"),dg=Co("cell-execute"),mg=function(t,e,n){var r,o=function(n){return xr(n,dg,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return Ai({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:hu([Jd("insert-table-picker-cell",[Dr(Ln(),nm.focus),Dr(Qn(),o),Dr(Wn(),i),Dr(tr(),i)]),hm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),nm.config({onFocus:function(n){return xr(n,fg,{row:t,col:e})}})])})},hg=function(t){return G(t,function(t){return H(t,Ri)})},pg=function(t,e){return Di(e+1+"x"+(t+1))},gg=function(t){return{value:t}},vg=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,bg=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,yg=function(t){return vg.test(t)||bg.test(t)},xg=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e},wg=function(t){var e=xg(t.red)+xg(t.green)+xg(t.blue);return gg(e)},Cg=Math.min,_g=Math.max,kg=Math.round,Sg=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Tg=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Og=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Dg=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},Eg=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,a=t.value/100;if(i=_g(0,Cg(i,1)),a=_g(0,Cg(a,1)),0===i)return e=n=r=kg(255*a),Og(e,n,r,1);var u=o/60,s=a*i,c=s*(1-Math.abs(u%2-1)),l=a-s;switch(Math.floor(u)){case 0:e=s,n=c,r=0;break;case 1:e=c,n=s,r=0;break;case 2:e=0,n=s,r=c;break;case 3:e=0,n=c,r=s;break;case 4:e=c,n=0,r=s;break;case 5:e=s,n=0,r=c;break;default:e=n=r=0}return e=kg(255*(e+l)),n=kg(255*(n+l)),r=kg(255*(r+l)),Og(e,n,r,1)},Ng=function(t){var e=function(t){var e=function(t){return{value:t.value.replace(vg,function(t,e,n,r){return e+e+n+n+r+r})}}(t),n=bg.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n}(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return Og(n,r,o,1)},Ag=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),a=parseInt(n,10),u=parseFloat(r);return Og(o,i,a,u)},Rg=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},Bg=Og(255,0,0,1),Ig=function(t,e){return t.fire("ResizeContent",e)},Pg=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Mg="choiceitem",Lg=[{type:Mg,text:"Light Green",value:"#BFEDD2"},{type:Mg,text:"Light Yellow",value:"#FBEEB8"},{type:Mg,text:"Light Red",value:"#F8CAC6"},{type:Mg,text:"Light Purple",value:"#ECCAFA"},{type:Mg,text:"Light Blue",value:"#C2E0F4"},{type:Mg,text:"Green",value:"#2DC26B"},{type:Mg,text:"Yellow",value:"#F1C40F"},{type:Mg,text:"Red",value:"#E03E2D"},{type:Mg,text:"Purple",value:"#B96AD9"},{type:Mg,text:"Blue",value:"#3598DB"},{type:Mg,text:"Dark Turquoise",value:"#169179"},{type:Mg,text:"Orange",value:"#E67E23"},{type:Mg,text:"Dark Red",value:"#BA372A"},{type:Mg,text:"Dark Purple",value:"#843FA1"},{type:Mg,text:"Dark Blue",value:"#236FA1"},{type:Mg,text:"Light Gray",value:"#ECF0F1"},{type:Mg,text:"Medium Gray",value:"#CED4D9"},{type:Mg,text:"Gray",value:"#95A5A6"},{type:Mg,text:"Dark Gray",value:"#7E8C8D"},{type:Mg,text:"Navy Blue",value:"#34495E"},{type:Mg,text:"Black",value:"#000000"},{type:Mg,text:"White",value:"#ffffff"}],Fg=function(t){void 0===t&&(t=10);var e,n=Pg.getItem("tinymce-custom-colors"),r=C(n)?JSON.parse(n):[],o=t-(e=r).length<0?e.slice(0,t):e,i=function(t){o.splice(t,1)};return{add:function(e){(function(t,e){var n=I(o,e);return-1===n?y.none():y.some(n)})(0,e).each(i),o.unshift(e),o.length>t&&o.pop(),Pg.setItem("tinymce-custom-colors",JSON.stringify(o))},state:function(){return o.slice(0)}}}(10),Hg=function(t){return!1!==t.getParam("custom_colors")},jg=function(t){var n=function(t){return t.getParam("color_map")}(t);return void 0!==n?function(t){var n=[],r=e.document.createElement("canvas");r.height=1,r.width=1;for(var o=r.getContext("2d"),i=function(t,e){var n=e/255;return("0"+Math.round(t*n+255*(1-n)).toString(16)).slice(-2).toUpperCase()},a=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();o.clearRect(0,0,r.width,r.height),o.fillStyle="#FFFFFF",o.fillStyle=t,o.fillRect(0,0,1,1);var e=o.getImageData(0,0,1,1).data,n=e[0],a=e[1],u=e[2],s=e[3];return"#"+i(n,s)+i(a,s)+i(u,s)},u=0;u<t.length;u+=2)n.push({text:t[u+1],value:a(t[u]),type:"choiceitem"});return n}(n):Lg},Vg=function(t){Fg.add(t)},zg=function(t){return function(t,e){return t.getParam("color_cols",e,"number")}(t,function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))}(jg(t).length))},Ug=function(t,e,n,r){"custom"===n?Kg(t)(function(n){n.each(function(n){Vg(n),t.execCommand("mceApplyTextcolor",e,n),r(n)})},"#000000"):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},Wg=function(t,e){return t.concat(H(Fg.state(),function(t){return{type:Mg,text:t,value:t}}).concat(function(t){var e={type:"choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[e,{type:"choiceitem",text:"Custom color",icon:"color-picker",value:"custom"}]:[e]}(e)))},qg=function(t,e){return function(n){n(Wg(t,e))}},$g=function(t,e,n){var r,o;r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",o=n,t.setIconFill(r,o),t.setIconStroke(r,o)},Yg=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return y.from(function(t,e){var n;return t.dom.getParents(t.selection.getStart(),function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)}),n}(t,n)).bind(function(t){return function(t){if("transparent"===t)return y.some(Og(0,0,0,0));var e=Sg.exec(t);if(null!==e)return y.some(Ag(e[1],e[2],e[3],"1"));var n=Tg.exec(t);return null!==n?y.some(Ag(n[1],n[2],n[3],n[4])):y.none()}(t).map(function(t){var n=wg(t).value;return sn(e.toLowerCase(),n)})}).getOr(!1)},columns:zg(t),fetch:qg(jg(t),Hg(t)),onAction:function(e){null!==o.get()&&Ug(t,n,o.get(),function(){})},onItemAction:function(r,i){Ug(t,n,i,function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})})},onSetup:function(n){null!==o.get()&&$g(n,e,o.get());var r=function(t){t.name===e&&$g(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},Gg=function(t,e,r,o){t.ui.registry.addNestedMenuItem(e,{text:o,icon:"forecolor"===e?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(e){Ug(t,r,e.value,n)}}]}})},Kg=function(t){return function(e,n){var r={colorpicker:n},o=function(t){return function(e){var n=e.getData();t(y.from(n.colorpicker)),e.close()}}(e);t.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onAction:function(t,e){"hex-valid"===e.name&&(e.value?t.enable("ok"):t.disable("ok"))},onSubmit:o,onClose:function(){},onCancel:function(){e(y.none())}})}},Xg=function(t,e,n,r,o,i,a,u){var s=Mh(e),c=Jg(e,n,r,"color"!==o?"normal":"color",i,a,u);return Fh(t,s,c,r,o)},Jg=function(t,e,n,r,o,i,a){return ql(H(t,function(u){return"choiceitem"===u.type?(s=u,ce("choicemenuitem",jh,s)).fold(Lh,function(s){return y.some(function(t,e,n,r,o,i,a,u){void 0===u&&(u=!0);var s=sg({presets:n,textContent:e?t.text:y.none(),htmlContent:y.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:y.none(),checkMark:e?y.some(ig(a.icons)):y.none(),caret:y.none(),value:t.value},a,u);return Dt(Jp({data:Qp(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){hm.set(t,e)},isActive:function(){return hm.isOn(t)},isDisabled:function(){return dp.isDisabled(t)},setDisabled:function(e){return dp.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),function(){}},triggersSubmenu:!1,itemBehaviours:[]},s,i,a),{toggling:{toggleClass:"tox-collection__item--enabled",toggleOnExecute:!1,selected:t.active}})}(s,1===n,r,e,i(u.value),o,a,Mh(t)))}):y.none();var s}))},Qg=function(t,e){var n=Eh(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}},Zg={inserttable:function(t){var e=Co("size-label"),n=function(t,e,n){for(var r=[],o=0;o<10;o++){for(var i=[],a=0;a<10;a++)i.push(mg(o,a,t));r.push(i)}return r}(e),r=Xm({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[Di("0x0")],behaviours:hu([Xd.config({})])});return{type:"widget",data:{value:Co("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[lg().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:hg(n).concat(r.asSpec()),behaviours:hu([Jd("insert-table-picker",[Rr(fg,function(t,e,o){var i=o.event().row(),a=o.event().col();!function(t,e,n,r,o){for(var i=0;i<10;i++)for(var a=0;a<10;a++)hm.set(t[i][a],i<=e&&a<=n)}(n,i,a),Xd.set(r.get(t),[pg(i,a)])}),Rr(dg,function(e,n,r){t.onAction({numRows:r.event().row()+1,numColumns:r.event().col()+1}),yr(e,nr())})]),qd.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=Wg(e.colorinput.getColors(),e.colorinput.hasCustomColors()),r=e.colorinput.getColorCols(),o=Xg(Co("menu-value"),n,function(e){t.onAction({value:e})},r,"color",xh.CLOSE_ON_EXECUTE,function(){return!1},e.shared.providers),i=d(d({},o),{markers:Eh("color"),movement:Qg(r,"color")});return{type:"widget",data:{value:Co("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[lg().widget(Em.sketch(i))]}}},tv=function(t,e,n,r,o,i,a,u){void 0===u&&(u=!0);var s=sg({presets:r,textContent:y.none(),htmlContent:n?t.text.map(function(t){return function(t,e){var n=function(t){return ep.DOM.encode(t)}(np.translate(t));if(e.length>0){var r=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");return n.replace(r,function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"})}return n}(t,e)}):y.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:y.none(),checkMark:y.none(),caret:y.none(),value:t.value},a.providers,u,t.icon);return Jp({data:Qp(t),disabled:t.disabled,getApi:function(){return{}},onAction:function(e){return o(t.value,t.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:cg(t.meta,a)},s,i,a.providers)},ev=function(t){var e=t.text.fold(function(){return{}},function(t){return{innerHtml:t}});return{type:"separator",dom:d({tag:"div",classes:[Ch,"tox-collection__group-heading"]},e),components:[]}},nv=function(t,e,r,o,i){void 0===o&&(o=!0),void 0===i&&(i=!1);var a,u=i?(a=r.icons,{dom:{tag:"div",classes:["tox-collection__item-caret"],innerHtml:Qm("chevron-down",a)}}):function(t){return{dom:{tag:"div",classes:["tox-collection__item-caret"],innerHtml:Qm("chevron-right",t)}}}(r.icons),s=sg({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:y.none(),ariaLabel:t.text,caret:y.some(u),checkMark:y.none(),shortcutContent:t.shortcut},r,o);return Jp({data:Qp(t),getApi:function(t){return{isDisabled:function(){return dp.isDisabled(t)},setDisabled:function(e){return dp.set(t,e)}}},disabled:t.disabled,onAction:n,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},s,e,r)};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(Tp||(Tp={}));var rv=function(t,n,r,o,i){var a,u=r.shared.providers,s=function(t){return i?d(d({},t),{shortcut:y.none(),icon:t.text.isSome()?y.none():t.icon}):t};switch(t.type){case"menuitem":return(a=t,ce("menuitem",zh,a)).fold(Lh,function(t){return y.some(function(t,e,n,r){void 0===r&&(r=!0);var o=sg({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:y.none(),ariaLabel:t.text,caret:y.none(),checkMark:y.none(),shortcutContent:t.shortcut},n,r);return Jp({data:Qp(t),getApi:function(t){return{isDisabled:function(){return dp.isDisabled(t)},setDisabled:function(e){return dp.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)}(s(t),n,u,o))});case"nestedmenuitem":return function(t){return ce("nestedmenuitem",Uh,t)}(t).fold(Lh,function(t){return y.some(nv(s(t),n,u,o,i))});case"togglemenuitem":return function(t){return ce("togglemenuitem",Wh,t)}(t).fold(Lh,function(t){return y.some(function(t,e,n,r){void 0===r&&(r=!0);var o=sg({iconContent:t.icon,textContent:t.text,htmlContent:y.none(),ariaLabel:t.text,checkMark:y.some(ig(n.icons)),caret:y.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return Dt(Jp({data:Qp(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){hm.set(t,e)},isActive:function(){return hm.isOn(t)},isDisabled:function(){return dp.isDisabled(t)},setDisabled:function(e){return dp.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:"tox-collection__item--enabled",toggleOnExecute:!1,selected:t.active}})}(s(t),n,u,o))});case"separator":return function(t){return ce("separatormenuitem",gh,t)}(t).fold(Lh,function(t){return y.some(ev(t))});case"fancymenuitem":return function(t){return ce("fancymenuitem",Vh,t)}(t).fold(Lh,function(t){return function(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?y.some(t[e]):y.none()}(Zg,t.fancytype).map(function(n){return n(t,e)})}(s(t),r)});default:return e.console.error("Unknown item in general menu",t),y.none()}},ov=function(t,e,n,r,o){var i=Mh(e),a=ql(H(e,function(t){var e=function(t){return rv(t,n,r,function(t){return o?!t.hasOwnProperty("text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(d(d({},t),{disabled:!0})):e(t)}));return(o?function(t,e,n,r,o){var i,a=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Em.parts().items({preprocess:function(t){return Ih(t,function(t,e){return"separator"===i[e].type})}})]});return{value:t,dom:a.dom,components:a.components,items:n}}:Fh)(t,i,a,1,"normal")},iv=function(t){return Pm.singleData(t.value,t)},av=function(t,n){var r=Ye(y.none()),o=Ye(!1),i=Ai(Mm.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:hu([Jd("dismissAutocompleter",[Dr(fr(),function(){return s()})])]),lazySink:n.getSink})),a=function(){return r.get().isSome()},u=function(){a()&&Mm.hide(i)},s=function(){if(a()){var e=r.get().map(function(t){return t.element});uh(e.getOr(Ke.fromDom(t.selection.getNode()))).each(uo),u(),r.set(y.none()),o.set(!1)}},c=Nt(function(){return function(t){var e=t.ui.registry.getAll().popups,n=vt(e,function(t){return(e=t,ce("Autocompleter",bh,e)).fold(function(t){throw new Error(de(t))},function(t){return t});var e}),r=function(t){var e={};return j(t,function(t){e[t]={}}),ht(e)}(yt(n,function(t){return t.ch})),o=wt(n);return{dataset:n,triggerChars:r,lookupByChar:function(t){return z(o,function(e){return e.ch===t})}}}(t)}),l=function(e,n,r,o){e.matchLength=n.text.length;var a=nt(r,function(t){return y.from(t.columns)}).getOr(1);Mm.showAt(i,{anchor:"node",root:Ke.fromDom(t.getBody()),node:y.from(e.element)},Em.sketch(function(t,e,n,r){var o=n===Tp.ContentFocus?yf():bf(),i=Qg(e,r),a=Eh(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:a.selectedItem,item:a.item},movement:i,fakeFocus:n===Tp.ContentFocus,focusManager:o,menuBehaviours:$h("auto"!==e?[]:[Mr(function(t,e){qh(t,4,a.item).each(function(e){var n=e.numColumns,r=e.numRows;qd.setGridSize(t,r,n)})})])}}(Fh("autocompleter-value",!0,o,a,"normal"),a,Tp.ContentFocus,"normal"))),Mm.getContent(i).each(af.highlightFirst)},f=function i(f){(function(e){return r.get().map(function(n){return fh(t.dom,t.selection.getRng(),n.triggerChar).bind(function(n){return ph(t,c,n,e)})}).getOrThunk(function(){return function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return nt(n.triggerChars,function(n){return fh(t,e,n)})}(t.dom,r,n).bind(function(n){return ph(t,e,n)})}(t,c)})})(f).fold(s,function(c){!function(e){if(!a()){var n=ah(t,e.range);r.set(y.some({triggerChar:e.triggerChar,element:n,matchLength:e.text.length})),o.set(!1)}}(c.context),c.lookupData.then(function(a){r.get().map(function(r){var f,d,m,h=c.context;if(r.triggerChar===h.triggerChar){var p=(f=h.triggerChar,m=nt(d=a,function(t){return y.from(t.columns)}).getOr(1),G(d,function(r){return function(t,e,n,r,o,i){var a=1===r,u=!a||Mh(t);return ql(H(t,function(t){return"separator"===t.type?(r=t,ce("Autocompleter.Separator",gh,r)).fold(Lh,function(t){return y.some(ev(t))}):function(t){return ce("Autocompleter.Item",vh,t)}(t).fold(Lh,function(t){return y.some(tv(t,e,a,"normal",n,o,i,u))});var r}))}(r.items,r.matchText,function(n,a){var c=t.selection.getRng();fh(t.dom,c,f).fold(function(){return e.console.error("Lost context. Cursor probably moved")},function(t){var e=t.range,c={hide:function(){s()},reload:function(t){u(),i(t)}};o.set(!0),r.onAction(c,e,n,a),o.set(!1)})},m,xh.BUBBLE_TO_SANDBOX,n)}));p.length>0?l(r,h,a,p):h.text.length-r.matchLength>=10?s():u()}})})})};!function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){xr(t,jn(),{raw:e})};e.on("keydown",function(e){var r=function(){return t.getView().bind(af.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(wr),e.preventDefault()):40===e.which?(r().fold(function(){t.getView().each(af.highlightFirst)},function(t){n(t,e)}),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each(function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()}):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())}),e.on("NodeChange",function(e){t.isActive()&&!t.isProcessingAction()&&uh(Ke.fromDom(e.element)).isNone()&&t.cancelIfNecessary()})}({onKeypress:rh(function(t){27!==t.which&&f()},50),cancelIfNecessary:s,isMenuOpen:function(){return Mm.isOpen(i)},isActive:a,isProcessingAction:o.get,getView:function(){return Mm.getContent(i)}},t)},uv=o(!0),sv=function(t,e,n){return function(t,e,n,r){return qi(t,e,uv,r,!1)}(t,e,0,n)},cv=function(t,e,n){return function(t,e,n,r){return qi(t,e,uv,r,!0)}(t,e,0,n)},lv=Wi,fv=function(t,e,n){return la(t,e,n).isSome()};function dv(t,n){var r=null;return{cancel:function(){null!==r&&(e.clearTimeout(r),r=null)},schedule:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r=e.setTimeout(function(){t.apply(null,o),r=null},n)}}}var mv=function(t){var e=t.raw();return void 0===e.touches||1!==e.touches.length?y.none():y.some(e.touches[0])},hv=function(){return bn().browser.isFirefox()},pv=Jt([De("triggerEvent"),Fe("stopBackspace",!0)]),gv=function(t,n){var r=fe("Getting GUI events settings",pv,n),o=function(t){var e=Ye(y.none()),n=Ye(!1),r=dv(function(e){t.triggerEvent(er(),e),n.set(!0)},400),o=Vt([{key:En(),value:function(t){return mv(t).each(function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target()};r.schedule(t),n.set(!1),e.set(y.some(i))}),y.none()}},{key:Nn(),value:function(t){return r.cancel(),mv(t).each(function(t){e.get().each(function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.set(y.none())})}),y.none()}},{key:An(),value:function(o){return r.cancel(),e.get().filter(function(t){return wn(t.target,o.target())}).map(function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(tr(),o)})}}]);return{fireIfReady:function(t,e){return Ct(o,e).bind(function(e){return e(t)})}}}(r),i=H(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(e){return sv(t,e,function(t){o.fireIfReady(t,e).each(function(e){e&&t.kill()}),r.triggerEvent(e,t)&&t.kill()})}),a=Ye(y.none()),u=sv(t,"paste",function(t){o.fireIfReady(t,"paste").each(function(e){e&&t.kill()}),r.triggerEvent("paste",t)&&t.kill(),a.set(y.some(e.setTimeout(function(){r.triggerEvent(Xn(),t)},0)))}),s=sv(t,"keydown",function(t){r.triggerEvent("keydown",t)?t.kill():!0===r.stopBackspace&&function(t){return 8===t.raw().which&&!P(["input","textarea"],jr(t.target()))&&!fv(t.target(),'[contenteditable="true"]')}(t)&&t.prevent()}),c=function(t,e){return hv()?cv(t,"focus",e):sv(t,"focusin",e)}(t,function(t){r.triggerEvent("focusin",t)&&t.kill()}),l=Ye(y.none()),f=function(t,e){return hv()?cv(t,"blur",e):sv(t,"focusout",e)}(t,function(t){r.triggerEvent("focusout",t)&&t.kill(),l.set(y.some(e.setTimeout(function(){r.triggerEvent(Kn(),t)},0)))});return{unbind:function(){j(i,function(t){t.unbind()}),s.unbind(),c.unbind(),f.unbind(),u.unbind(),a.get().each(e.clearTimeout),l.get().each(e.clearTimeout)}}},vv=function(t,e){var n=Ct(t,"target").map(function(t){return t()}).getOr(e);return Ye(n)},bv=St([{stopped:[]},{resume:["element"]},{complete:[]}]),yv=function(t,e,n,r,i,a){var u=t(e,r),s=function(t,e){var n=Ye(!1),r=Ye(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:o(t),setSource:e.set,getSource:e.get}}(n,i);return u.fold(function(){return a.logEventNoHandlers(e,r),bv.complete()},function(t){var n=t.descHandler;return Uo(n)(s),s.isStopped()?(a.logEventStopped(e,t.element,n.purpose()),bv.stopped()):s.isCut()?(a.logEventCut(e,t.element,n.purpose()),bv.complete()):Xr(t.element).fold(function(){return a.logNoParent(e,t.element,n.purpose()),bv.complete()},function(r){return a.logEventResponse(e,t.element,n.purpose()),bv.resume(r)})})},xv=function(t,e,r){var i=function(t){var e=Ye(!1);return{stop:function(){e.set(!0)},cut:n,isStopped:e.get,isCut:o(!1),event:o(t),setSource:s("Cannot set source of a broadcasted event"),getSource:s("Cannot get source of a broadcasted event")}}(e);return j(t,function(t){var e=t.descHandler();Uo(e)(i)}),i.isStopped()},wv=function(t,e,n,r,o){return function t(e,n,r,o,i,a){return yv(e,n,r,o,i,a).fold(function(){return!0},function(o){return t(e,n,r,o,i,a)},function(){return!1})}(t,e,n,r,vv(n,r),o)};function Cv(){var t=function(){var t={};return{registerId:function(e,n,r){gt(r,function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=zo(r,e),t[o]=i})},unregisterId:function(e){gt(t,function(t,n){t.hasOwnProperty(e)&&delete t[e]})},filterByType:function(e){return Ct(t,e).map(function(t){return yt(t,function(t,e){return function(t,e){return{id:o(t),descHandler:o(e)}}(e,t)})}).getOr([])},find:function(e,n,r){var o=Ct(t,n);return Tn(r,function(t){return function(t,e){return Do(e).fold(function(){return y.none()},function(n){return t.bind(function(t){return Ct(t,n)}).map(function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)})})}(o,t)},e)}}}(),e={},n=function(n){Do(n.element()).each(function(n){delete e[n],t.unregisterId(n)})};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(r){var o=function(t){var e=t.element();return Do(e).fold(function(){return e=t.element(),n=Co(So+"uid-"),Oo(e,n),n;var e,n},function(t){return t})}(r);kt(e,o)&&function(t,r){var o=e[r];if(o!==t)throw new Error('The tagId "'+r+'" is already used by: '+bo(o.element())+"\nCannot use it for: "+bo(t.element())+"\nThe conflicting element is"+(ui(o.element())?" ":" not ")+"already in the DOM");n(t)}(r,o);var i=[r];t.registerId(i,o,r.events()),e[o]=r},unregister:n,getById:function(t){return Ct(e,t)}}}var _v=Ul({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=m(e,["attributes"]);return{uid:t.uid,dom:d({tag:"div",attributes:d({role:"presentation"},n)},r),components:t.components,behaviours:Wc(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[Fe("components",[]),Uc("containerBehaviours",[]),Fe("events",{}),Fe("domModification",{}),Fe("eventOrder",{})]}),kv=function(t){var e=function(e){return Xr(t.element()).fold(function(){return!0},function(t){return wn(e,t)})},r=Cv(),i=function(t,n){return r.find(e,t,n)},a=gv(t.element(),{triggerEvent:function(t,e){return ba(t,e.target(),function(n){return function(t,e,n,r){var o=n.target();return wv(t,e,n,o,r)}(i,t,e,n)})}}),u={debugInfo:o("real"),triggerEvent:function(t,e,n){ba(t,e,function(r){return wv(i,t,n,e,r)})},triggerFocus:function(t,e){Do(t).fold(function(){ku(t)},function(r){ba(Gn(),t,function(r){return function(t,e,n,r,o){var i=vv(n,r);yv(t,e,n,r,i,o)}(i,Gn(),{originator:o(e),kill:n,prevent:n,target:o(t)},t,r),!1})})},triggerEscape:function(t,e){u.triggerEvent("keydown",t.element(),e.event())},getByUid:function(t){return g(t)},getByDom:function(t){return v(t)},build:Ai,addToGui:function(t){l(t)},removeFromGui:function(t){f(t)},addToWorld:function(t){s(t)},removeFromWorld:function(t){c(t)},broadcast:function(t){m(t)},broadcastOn:function(t,e){h(t,e)},broadcastEvent:function(t,e){p(t,e)},isConnected:o(!0)},s=function t(e){e.connect(u),Ur(e.element())||(r.register(e),j(e.components(),t),u.triggerEvent(or(),e.element(),{target:o(e.element())}))},c=function t(e){Ur(e.element())||(j(e.components(),t),r.unregister(e)),e.disconnect()},l=function(e){ic(t,e)},f=function(t){sc(t)},d=function(t){var e=r.filter(Jn());j(e,function(e){var n=e.descHandler();Uo(n)(t)})},m=function(t){d({universal:o(!0),data:o(t)})},h=function(t,e){d({universal:o(!1),channels:o(t),data:o(e)})},p=function(t,e){var n=r.filter(t);return xv(n,e)},g=function(t){return r.getById(t).fold(function(){return it.error(new Error('Could not find component with uid: "'+t+'" in system.'))},it.value)},v=function(t){var e=Do(t).getOr("not found");return g(e)};return s(t),{root:o(t),element:t.element,destroy:function(){a.unbind(),ao(t.element())},add:l,remove:f,getByUid:g,getByDom:v,addToWorld:s,removeFromWorld:c,broadcast:m,broadcastOn:h,broadcastEvent:p}},Sv=o([Fe("prefix","form-field"),Uc("fieldBehaviours",[Kl,zc])]),Tv=o([vl({schema:[_e("dom")],name:"label"}),vl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[_e("text")],name:"aria-descriptor"}),pl({factory:{sketch:function(t){var e=Ht(t,["factory"]);return t.factory.sketch(e)}},schema:[_e("factory")],name:"field"})]),Ov=Wl({name:"FormField",configFields:Sv(),partFields:Tv(),factory:function(t,e,n,r){var o=qc(t.fieldBehaviours,[Kl.config({find:function(e){return El(e,t,"field")}}),zc.config({store:{mode:"manual",getValue:function(t){return Kl.getCurrent(t).bind(zc.getValue)},setValue:function(t,e){Kl.getCurrent(t).each(function(t){zc.setValue(t,e)})}}})]),i=Sr([Mr(function(e,n){var r=Al(e,t,["label","field","aria-descriptor"]);r.field().each(function(e){var n=Co(t.prefix);r.label().each(function(t){fo(t.element(),"for",n),fo(e.element(),"id",n)}),r["aria-descriptor"]().each(function(n){var r=Co(t.prefix);fo(n.element(),"id",r),fo(e.element(),"aria-describedby",r)})})})]),a={getField:function(e){return El(e,t,"field")},getLabel:function(e){return El(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:a}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),Dv=Object.freeze({__proto__:null,exhibit:function(t,e){return Vo({attributes:Vt([{key:e.tabAttr,value:"true"}])})}}),Ev=[Fe("tabAttr","data-alloy-tabstop")],Nv=gu({fields:Ev,name:"tabstopping",active:Dv}),Av=function(t,e,n,r){var o=Rv(t,e,n,r);return Ov.sketch(o)},Rv=function(t,e,n,r){return{dom:Bv(n),components:t.toArray().concat([e]),fieldBehaviours:hu(r)}},Bv=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},Iv=function(t,e){return Ov.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},Pv=Co("form-component-change"),Mv=Co("form-close"),Lv=Co("form-cancel"),Fv=Co("form-action"),Hv=Co("form-submit"),jv=Co("form-block"),Vv=Co("form-unblock"),zv=Co("form-tabchange"),Uv=Co("form-resize"),Wv=o([Re("data"),Fe("inputAttributes",{}),Fe("inputStyles",{}),Fe("tag","input"),Fe("inputClasses",[]),Oa("onSetValue"),Fe("styles",{}),Fe("eventOrder",{}),Uc("inputBehaviours",[zc,nm]),Fe("selectOnFocus",!0)]),qv=function(t){return hu([nm.config({onFocus:t.selectOnFocus?function(t){var e=t.element(),n=Ci(e);e.dom().setSelectionRange(0,n.length)}:n})])},$v=function(t){return d(d({},qv(t)),qc(t.inputBehaviours,[zc.config({store:d(d({mode:"manual"},t.data.map(function(t){return{initialValue:t}}).getOr({})),{getValue:function(t){return Ci(t.element())},setValue:function(t,e){Ci(t.element())!==e&&_i(t.element(),e)}}),onSetValue:t.onSetValue})]))},Yv=function(t){return{tag:t.tag,attributes:d({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Gv=Ul({name:"Input",configFields:Wv(),factory:function(t,e){return{uid:t.uid,dom:Yv(t),components:[],behaviours:$v(t),eventOrder:t.eventOrder}}}),Kv={},Xv={exports:Kv};!function(e,n,r,o){!function(e){"object"==_typeof(n)&&void 0!==r?r.exports=e():("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).EphoxContactWrapper=e()}(function(){return function t(e,n,r){function i(u,s){if(!n[u]){if(!e[u]){var c="function"==typeof o&&o;if(!s&&c)return c(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:{}};e[u][0].call(f.exports,function(t){return i(e[u][1][t]||t)},f,f.exports,t,e,n,r)}return n[u].exports}for(var a="function"==typeof o&&o,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(t,e,n){var r,o,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(t){o=u}}();var c,l=[],f=!1,d=-1;function m(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&h())}function h(){if(!f){var t=s(m);f=!0;for(var e=l.length;e;){for(c=l,l=[];++d<e;)c&&c[d].run();d=-1,e=l.length}c=null,f=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new p(t,e)),1!==l.length||f||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,e,n){(function(t){!function(n){var r=setTimeout;function o(){}function i(t){if("object"!=_typeof(this))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function a(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void s(e.promise,t)}u(e.promise,r)}else(1===t._state?u:s)(e.promise,t._value)})):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==_typeof(e)||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){s(t,e)}var r,o}function s(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t(function(t){n||(n=!0,u(e,t))},function(t){n||(n=!0,s(e,t))})}catch(t){if(n)return;n=!0,s(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return a(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i(function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==_typeof(a)||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,function(t){o(i,t)},n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])})},i.resolve=function(t){return t&&"object"==_typeof(t)&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(t){return new i(function(e,n){n(t)})},i.race=function(t){return new i(function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)})},i._immediateFn="function"==typeof t?function(e){t(e)}:function(t){r(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==e&&e.exports?e.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(t,e,n){(function(e,r){var o=t("process/browser.js").nextTick,i=Function.prototype.apply,a=Array.prototype.slice,u={},s=0;function c(t,e){this._id=t,this._clearFn=e}n.setTimeout=function(){return new c(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new c(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n.setImmediate="function"==typeof e?e:function(t){var e=s++,r=!(arguments.length<2)&&a.call(arguments,1);return u[e]=!0,o(function(){u[e]&&(r?t.apply(null,r):t.call(null),n.clearImmediate(e))}),e},n.clearImmediate="function"==typeof r?r:function(t){delete u[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,e,n){var r=t("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)})}(0,Kv,Xv,void 0);var Jv,Qv=Xv.exports.boltExport,Zv=function t(n){var r=y.none(),o=[],i=function(t){a()?u(t):o.push(t)},a=function(){return r.isSome()},u=function(t){r.each(function(n){e.setTimeout(function(){t(n)},0)})};return n(function(t){a()||(r=y.some(t),function(t){j(t,u)}(o),o=[])}),{get:i,map:function(e){return t(function(t){i(function(n){t(e(n))})})},isReady:a}},tb=Zv,eb=function(t){e.setTimeout(function(){throw t},0)},nb=function t(e){var n=function(t){e().then(t,eb)};return{map:function(n){return t(function(){return e().then(n)})},bind:function(n){return t(function(){return e().then(function(t){return n(t).toPromise()})})},anonBind:function(n){return t(function(){return e().then(function(){return n.toPromise()})})},toLazy:function(){return tb(n)},toCached:function(){var n=null;return t(function(){return null===n&&(n=e()),n})},toPromise:e,get:n}},rb=function(t){return nb(function(){return new Qv(t)})},ob=function(t){return nb(function(){return Qv.resolve(t)})},ib=["input","textarea"],ab=function(t){var e=jr(t);return P(ib,e)},ub=function(t,e){var n=e.getRoot(t).getOr(t.element());Jo(n,e.invalidClass),e.notify.each(function(e){ab(t.element())&&fo(t.element(),"aria-invalid",!1),e.getContainer(t).each(function(t){co(t,e.validHtml)}),e.onValid(t)})},sb=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element());Xo(o,e.invalidClass),e.notify.each(function(e){ab(t.element())&&fo(t.element(),"aria-invalid",!0),e.getContainer(t).each(function(t){co(t,r)}),e.onInvalid(t,r)})},cb=function(t,e,n){return e.validator.fold(function(){return ob(it.value(!0))},function(e){return e.validate(t)})},lb=function(t,e,n){return e.notify.each(function(e){e.onValidate(t)}),cb(t,e).map(function(n){return t.getSystem().isConnected()?n.fold(function(n){return sb(t,e,0,n),it.error(n)},function(n){return ub(t,e),it.value(n)}):it.error("No longer in system")})},fb=Object.freeze({__proto__:null,markValid:ub,markInvalid:sb,query:cb,run:lb,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element());return Qo(n,e.invalidClass)}}),db=Object.freeze({__proto__:null,events:function(t,e){return t.validator.map(function(e){return Sr([Dr(e.onEvent,function(e){lb(e,t).get(i)})].concat(e.validateOnLoad?[Mr(function(e){lb(e,t).get(n)})]:[]))}).getOr({})}}),mb=[_e("invalidClass"),Fe("getRoot",y.none),Le("notify",[Fe("aria","alert"),Fe("getContainer",y.none),Fe("validHtml",""),Oa("onValid"),Oa("onInvalid"),Oa("onValidate")]),Le("validator",[_e("validate"),Fe("onEvent","input"),Fe("validateOnLoad",!0)])],hb=gu({fields:mb,name:"invalidating",active:db,apis:fb,extra:{validation:function(t){return function(e){var n=zc.getValue(e);return ob(t(n))}}}}),pb=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),gb=[ke("others",se(it.value,pe()))],vb=gu({fields:gb,name:"coupling",apis:pb,state:Object.freeze({__proto__:null,init:function(){var t={},e=o({});return Ho({readState:e,getOrCreate:function(e,n,r){var o=ht(n.others);if(o)return Ct(t,r).getOrThunk(function(){var o=Ct(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})}),bb=o("sink"),yb=o(vl({name:bb(),overrides:o({dom:{tag:"div"},behaviours:hu([tc.config({useFixed:l})]),events:Sr([Br(jn()),Br(Bn()),Br(Wn())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}(Jv||(Jv={}));var xb=function(t,e){var n=t.getHotspot(e).getOr(e),r=t.getAnchorOverrides();return t.layouts.fold(function(){return{anchor:"hotspot",hotspot:n,overrides:r}},function(t){return{anchor:"hotspot",hotspot:n,overrides:r,layouts:t}})},wb=function(t,e,n,r,o,i,a){return function(t,e,n,r,o,i,a){var u=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),s=_b(r,t);return u.map(function(t){return t.bind(function(t){return y.from(Pm.sketch(d(d({},i.menu()),{uid:Eo(""),data:t,highlightImmediately:a===Jv.HighlightFirst,onOpenMenu:function(t,e){var r=s().getOrDie();tc.position(r,n,e),Cc.decloak(o)},onOpenSubmenu:function(t,e,n){var r=s().getOrDie();tc.position(r,{anchor:"submenu",item:e},n),Cc.decloak(o)},onRepositionMenu:function(t,e,r){var o=s().getOrDie();tc.position(o,n,e),j(r,function(t){tc.position(o,{anchor:"submenu",item:t.triggeringItem},t.triggeredMenu)})},onEscape:function(){return nm.focus(r),Cc.close(o),y.some(!0)}})))})})}(t,e,xb(t,n),n,r,o,a).map(function(t){return t.fold(function(){Cc.isOpen(r)&&Cc.close(r)},function(t){Cc.cloak(r),Cc.open(r,t),i(r)}),r})},Cb=function(t,e,n,r,o,i){var a=vb.getCoupled(n,"sandbox");return(Cc.isOpen(a)?function(t,e,n,r,o,i,a){return Cc.close(r),ob(r)}:wb)(t,e,n,a,r,o,i)},_b=function(t,e){return t.getSystem().getByUid(e.uid+"-"+bb()).map(function(t){return function(){return it.value(t)}}).getOrThunk(function(){return e.lazySink.fold(function(){return function(){return it.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(e){return function(){return e(t)}})})},kb=function(t){Cc.getState(t).each(function(t){Pm.repositionMenus(t)})},Sb=function(t,e,n){var r=fa(),o=_b(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:Yc(t.sandboxBehaviours,[zc.config({store:{mode:"memory",initialValue:e}}),Cc.config({onOpen:function(o,i){var a=xb(t,e);r.link(e.element()),t.matchWidth&&function(t,e,n){var r=Kl.getCurrent(e).getOr(e),o=zi(t.element());n?di(r.element(),"min-width",o+"px"):function(t,e){Vi.set(t,e)}(r.element(),o)}(a.hotspot,i,t.useMinWidth),t.onOpen(a,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element()),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return ma(n,r)||ma(e,r)},getAttachPoint:function(){return o().getOrDie()}}),Kl.config({find:function(t){return Cc.getState(t).bind(function(t){return Kl.getCurrent(t)})}}),Cu.config({channels:d(d({},Oc({isExtraPart:c})),Ec({doReposition:kb}))})])}},Tb=function(t){var e=vb.getCoupled(t,"sandbox");kb(e)},Ob=function(){return[Fe("sandboxClasses",[]),$c("sandboxBehaviours",[Kl,Cu,Cc,zc])]},Db=o([_e("dom"),_e("fetch"),Oa("onOpen"),Da("onExecute"),Fe("getHotspot",y.some),Fe("getAnchorOverrides",o({})),ts(),Uc("dropdownBehaviours",[hm,vb,qd,nm]),_e("toggleClass"),Fe("eventOrder",{}),Re("lazySink"),Fe("matchWidth",!1),Fe("useMinWidth",!1),Re("role")].concat(Ob())),Eb=o([gl({schema:[ka()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),yb()]),Nb=Wl({name:"Dropdown",configFields:Db(),partFields:Eb(),factory:function(t,e,r,o){var i,a=function(t){Cc.getState(t).each(function(t){Pm.highlightPrimary(t)})},u={expand:function(e){hm.isOn(e)||Cb(t,function(t){return t},e,o,n,Jv.HighlightNone).get(n)},open:function(e){hm.isOn(e)||Cb(t,function(t){return t},e,o,n,Jv.HighlightFirst).get(n)},isOpen:hm.isOn,close:function(e){hm.isOn(e)&&Cb(t,function(t){return t},e,o,n,Jv.HighlightFirst).get(n)},repositionMenus:function(t){hm.isOn(t)&&Tb(t)}},s=function(t,e){return wr(t),y.some(!0)};return{uid:t.uid,dom:t.dom,components:e,behaviours:qc(t.dropdownBehaviours,[hm.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),vb.config({others:{sandbox:function(e){return Sb(t,e,{onOpen:function(){hm.on(e)},onClose:function(){hm.off(e)}})}}}),qd.config({mode:"special",onSpace:s,onEnter:s,onDown:function(t,e){if(Nb.isOpen(t)){var n=vb.getCoupled(t,"sandbox");a(n)}else Nb.open(t);return y.some(!0)},onEscape:function(t,e){return Nb.isOpen(t)?(Nb.close(t),y.some(!0)):y.none()}}),nm.config({})]),events:gm(y.some(function(e){Cb(t,function(t){return t},e,o,a,Jv.HighlightFirst).get(n)})),eventOrder:d(d({},t.eventOrder),(i={},i[Qn()]=["disabling","toggling","alloy.base.behaviour"],i)),apis:u,domModification:{attributes:d(d({"aria-haspopup":"true"},t.role.fold(function(){return{}},function(t){return{role:t}})),"button"===t.dom.tag?{type:("type",Ct(t.dom,"attributes").bind(function(t){return Ct(t,"type")})).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),Ab=Object.freeze({__proto__:null,events:function(){return Sr([Tr($n(),o(!0))])},exhibit:function(){return Vo({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),Rb=gu({fields:[],name:"unselecting",active:Ab}),Bb=Co("color-input-change"),Ib=Co("color-swatch-change"),Pb=Co("color-picker-cancel"),Mb=function(t,e,n){return{hue:t,saturation:e,value:n}},Lb=Co("rgb-hex-update"),Fb=Co("slider-update"),Hb=Co("palette-update"),jb=vl({schema:[_e("dom")],name:"label"}),Vb=function(t){return vl({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold(function(){return{}},function(t){return{events:Sr([Er(En(),function(e,n,r){return t(e,r)},[e]),Er(Bn(),function(e,n,r){return t(e,r)},[e]),Er(In(),function(e,n,r){r.mouseIsDown.get()&&t(e,r)},[e])])}})}})},zb=Vb("top-left"),Ub=Vb("top"),Wb=Vb("top-right"),qb=Vb("right"),$b=Vb("bottom-right"),Yb=Vb("bottom"),Gb=Vb("bottom-left"),Kb=[jb,Vb("left"),qb,Ub,Yb,zb,Wb,Gb,$b,pl({name:"thumb",defaults:o({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Sr([Ar(En(),t,"spectrum"),Ar(Nn(),t,"spectrum"),Ar(An(),t,"spectrum"),Ar(Bn(),t,"spectrum"),Ar(In(),t,"spectrum"),Ar(Mn(),t,"spectrum")])}}}),pl({schema:[$e("mouseIsDown",function(){return Ye(!1)})],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map(function(r){return e.setValueFrom(n,t,r)})};return{behaviours:hu([qd.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),nm.config({})]),events:Sr([Dr(En(),n),Dr(Nn(),n),Dr(Bn(),n),Dr(In(),function(e,r){t.mouseIsDown.get()&&n(e,r)})])}}})],Xb=o("slider.change.value"),Jb=function(t){var e=t.event().raw();if(-1!==e.type.indexOf("touch")){var n=e;return void 0!==n.touches&&1===n.touches.length?y.some(n.touches[0]).map(function(t){return Li(t.clientX,t.clientY)}):y.none()}var r=e;return void 0!==r.clientX?y.some(r).map(function(t){return Li(t.clientX,t.clientY)}):y.none()},Qb=function(t){return t.model.minX},Zb=function(t){return t.model.minY},ty=function(t){return t.model.minX-1},ey=function(t){return t.model.minY-1},ny=function(t){return t.model.maxX},ry=function(t){return t.model.maxY},oy=function(t){return t.model.maxX+1},iy=function(t){return t.model.maxY+1},ay=function(t,e,n){return e(t)-n(t)},uy=function(t){return ay(t,ny,Qb)},sy=function(t){return ay(t,ry,Zb)},cy=function(t){return uy(t)/2},ly=function(t){return sy(t)/2},fy=function(t){return t.stepSize},dy=function(t){return t.snapToGrid},my=function(t){return t.snapStart},hy=function(t){return t.rounded},py=function(t,e){return void 0!==t[e+"-edge"]},gy=function(t){return py(t,"left")},vy=function(t){return py(t,"right")},by=function(t){return py(t,"top")},yy=function(t){return py(t,"bottom")},xy=function(t){return t.model.value.get()},wy=function(t){return{x:o(t)}},Cy=function(t){return{y:o(t)}},_y=function(t,e){return{x:o(t),y:o(e)}},ky=function(t,e){xr(t,Xb(),{value:e})},Sy=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},Ty=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},Oy=function(t,e,n){return Math.max(e,Math.min(n,t))},Dy=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,a=t.snap,u=t.snapStart,s=t.rounded,c=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,h=c?e-1:e,p=l?n+1:n;if(o<f)return h;if(o>d)return p;var g=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=Oy(g/m*r+e,h,p);return a&&v>=e&&v<=n?function(t,e,n,r,o){return u.fold(function(){var o=t-e,i=Math.round(o/r)*r;return Oy(e+i,e-1,n+1)},function(e){var o=(t-e)%r,i=Math.round(o/r),a=Math.floor((t-e)/r),u=Math.floor((n-e)/r),s=e+Math.min(u,a+i)*r;return Math.max(e,s)})}(v,e,n,i):s?Math.round(v):v},Ey=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,a=t.hasMaxEdge,u=t.maxBound,s=t.maxOffset,c=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:c:o>n?a?u:l:(o-e)/r*s},Ny=function(t){return t.element().dom().getBoundingClientRect()},Ay=function(t,e){return t[e]},Ry=function(t){var e=Ny(t);return Ay(e,"left")},By=function(t){var e=Ny(t);return Ay(e,"right")},Iy=function(t){var e=Ny(t);return Ay(e,"top")},Py=function(t){var e=Ny(t);return Ay(e,"bottom")},My=function(t){var e=Ny(t);return Ay(e,"width")},Ly=function(t){var e=Ny(t);return Ay(e,"height")},Fy=function(t,e,n){return(t+e)/2-n},Hy=function(t,e){var n=Ny(t),r=Ny(e),o=Ay(n,"left"),i=Ay(n,"right"),a=Ay(r,"left");return Fy(o,i,a)},jy=function(t,e){var n=Ny(t),r=Ny(e),o=Ay(n,"top"),i=Ay(n,"bottom"),a=Ay(r,"top");return Fy(o,i,a)},Vy=function(t,e){xr(t,Xb(),{value:e})},zy=function(t){return{x:o(t)}},Uy=function(t,e,n){var r={min:Qb(e),max:ny(e),range:uy(e),value:n,step:fy(e),snap:dy(e),snapStart:my(e),rounded:hy(e),hasMinEdge:gy(e),hasMaxEdge:vy(e),minBound:Ry(t),maxBound:By(t),screenRange:My(t)};return Dy(r)},Wy=function(t){return function(e,n){return function(t,e,n){var r=(t>0?Ty:Sy)(xy(n).x(),Qb(n),ny(n),fy(n));return Vy(e,zy(r)),y.some(r)}(t,e,n).map(function(){return!0})}},qy=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=My(t),a=r.bind(function(e){return y.some(Hy(e,t))}).getOr(0),u=o.bind(function(e){return y.some(Hy(e,t))}).getOr(i),s={min:Qb(e),max:ny(e),range:uy(e),value:n,hasMinEdge:gy(e),hasMaxEdge:vy(e),minBound:Ry(t),minOffset:0,maxBound:By(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return Ey(s)}(e,i,n,r,o);return Ry(e)-Ry(t)+a},$y=Wy(-1),Yy=Wy(1),Gy=y.none,Ky=y.none,Xy={"top-left":y.none(),top:y.none(),"top-right":y.none(),right:y.some(function(t,e){ky(t,wy(oy(e)))}),"bottom-right":y.none(),bottom:y.none(),"bottom-left":y.none(),left:y.some(function(t,e){ky(t,wy(ty(e)))})},Jy=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=Uy(t,e,n),o=zy(r);return Vy(t,o),r},setToMin:function(t,e){var n=Qb(e);Vy(t,zy(n))},setToMax:function(t,e){var n=ny(e);Vy(t,zy(n))},findValueOfOffset:Uy,getValueFromEvent:function(t){return Jb(t).map(function(t){return t.left()})},findPositionOfValue:qy,setPositionFromValue:function(t,e,n,r){var o=xy(n),i=qy(t,r.getSpectrum(t),o.x(),r.getLeftEdge(t),r.getRightEdge(t),n),a=zi(e.element())/2;di(e.element(),"left",i-a+"px")},onLeft:$y,onRight:Yy,onUp:Gy,onDown:Ky,edgeActions:Xy}),Qy=function(t,e){xr(t,Xb(),{value:e})},Zy=function(t){return{y:o(t)}},tx=function(t,e,n){var r={min:Zb(e),max:ry(e),range:sy(e),value:n,step:fy(e),snap:dy(e),snapStart:my(e),rounded:hy(e),hasMinEdge:by(e),hasMaxEdge:yy(e),minBound:Iy(t),maxBound:Py(t),screenRange:Ly(t)};return Dy(r)},ex=function(t){return function(e,n){return function(t,e,n){var r=(t>0?Ty:Sy)(xy(n).y(),Zb(n),ry(n),fy(n));return Qy(e,Zy(r)),y.some(r)}(t,e,n).map(function(){return!0})}},nx=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=Ly(t),a=r.bind(function(e){return y.some(jy(e,t))}).getOr(0),u=o.bind(function(e){return y.some(jy(e,t))}).getOr(i),s={min:Zb(e),max:ry(e),range:sy(e),value:n,hasMinEdge:by(e),hasMaxEdge:yy(e),minBound:Iy(t),minOffset:0,maxBound:Py(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return Ey(s)}(e,i,n,r,o);return Iy(e)-Iy(t)+a},rx=y.none,ox=y.none,ix=ex(-1),ax=ex(1),ux={"top-left":y.none(),top:y.some(function(t,e){ky(t,Cy(ey(e)))}),"top-right":y.none(),right:y.none(),"bottom-right":y.none(),bottom:y.some(function(t,e){ky(t,Cy(iy(e)))}),"bottom-left":y.none(),left:y.none()},sx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=tx(t,e,n),o=Zy(r);return Qy(t,o),r},setToMin:function(t,e){var n=Zb(e);Qy(t,Zy(n))},setToMax:function(t,e){var n=ry(e);Qy(t,Zy(n))},findValueOfOffset:tx,getValueFromEvent:function(t){return Jb(t).map(function(t){return t.top()})},findPositionOfValue:nx,setPositionFromValue:function(t,e,n,r){var o=xy(n),i=nx(t,r.getSpectrum(t),o.y(),r.getTopEdge(t),r.getBottomEdge(t),n),a=Pi(e.element())/2;di(e.element(),"top",i-a+"px")},onLeft:rx,onRight:ox,onUp:ix,onDown:ax,edgeActions:ux}),cx=function(t,e){xr(t,Xb(),{value:e})},lx=function(t,e){return{x:o(t),y:o(e)}},fx=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?Ty:Sy,i=e?xy(r).x():o(xy(r).x(),Qb(r),ny(r),fy(r)),a=e?o(xy(r).y(),Zb(r),ry(r),fy(r)):xy(r).y();return cx(n,lx(i,a)),y.some(i)}(t,e,n,r).map(function(){return!0})}},dx=fx(-1,!1),mx=fx(1,!1),hx=fx(-1,!0),px=fx(1,!0),gx={"top-left":y.some(function(t,e){ky(t,_y(ty(e),ey(e)))}),top:y.some(function(t,e){ky(t,_y(cy(e),ey(e)))}),"top-right":y.some(function(t,e){ky(t,_y(oy(e),ey(e)))}),right:y.some(function(t,e){ky(t,_y(oy(e),ly(e)))}),"bottom-right":y.some(function(t,e){ky(t,_y(oy(e),iy(e)))}),bottom:y.some(function(t,e){ky(t,_y(cy(e),iy(e)))}),"bottom-left":y.some(function(t,e){ky(t,_y(ty(e),iy(e)))}),left:y.some(function(t,e){ky(t,_y(ty(e),ly(e)))})},vx=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=Uy(t,e,n.left()),o=tx(t,e,n.top()),i=lx(r,o);return cx(t,i),i},setToMin:function(t,e){var n=Qb(e),r=Zb(e);cx(t,lx(n,r))},setToMax:function(t,e){var n=ny(e),r=ry(e);cx(t,lx(n,r))},getValueFromEvent:function(t){return Jb(t)},setPositionFromValue:function(t,e,n,r){var o=xy(n),i=qy(t,r.getSpectrum(t),o.x(),r.getLeftEdge(t),r.getRightEdge(t),n),a=nx(t,r.getSpectrum(t),o.y(),r.getTopEdge(t),r.getBottomEdge(t),n),u=zi(e.element())/2,s=Pi(e.element())/2;di(e.element(),"left",i-u+"px"),di(e.element(),"top",a-s+"px")},onLeft:dx,onRight:mx,onUp:hx,onDown:px,edgeActions:gx}),bx=Wl({name:"Slider",configFields:[Fe("stepSize",1),Fe("onChange",n),Fe("onChoose",n),Fe("onInit",n),Fe("onDragStart",n),Fe("onDragEnd",n),Fe("snapToGrid",!1),Fe("rounded",!0),Re("snapStart"),ke("model",he("mode",{x:[Fe("minX",0),Fe("maxX",100),$e("value",function(t){return Ye(t.mode.minX)}),_e("getInitialValue"),Aa("manager",Jy)],y:[Fe("minY",0),Fe("maxY",100),$e("value",function(t){return Ye(t.mode.minY)}),_e("getInitialValue"),Aa("manager",sx)],xy:[Fe("minX",0),Fe("maxX",100),Fe("minY",0),Fe("maxY",100),$e("value",function(t){return Ye({x:o(t.mode.minX),y:o(t.mode.minY)})}),_e("getInitialValue"),Aa("manager",vx)]})),Uc("sliderBehaviours",[qd,zc]),$e("mouseIsDown",function(){return Ye(!1)})],partFields:Kb,factory:function(t,e,n,r){var i,a=function(e){return Nl(e,t,"thumb")},u=function(e){return Nl(e,t,"spectrum")},s=function(e){return El(e,t,"left-edge")},c=function(e){return El(e,t,"right-edge")},l=function(e){return El(e,t,"top-edge")},f=function(e){return El(e,t,"bottom-edge")},d=t.model,m=d.manager,h=function(e,n){m.setPositionFromValue(e,n,t,{getLeftEdge:s,getRightEdge:c,getTopEdge:l,getBottomEdge:f,getSpectrum:u})},p=function(e,n){d.value.set(n);var r=a(e);return h(e,r),t.onChange(e,r,n),y.some(!0)},g=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&El(e,t,"thumb").each(function(n){var r=d.value.get();t.onChoose(e,n,r)})},v=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,a(e))},b=function(e,n){n.stop(),t.onDragEnd(e,a(e)),g(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:qc(t.sliderBehaviours,[qd.config({mode:"special",focusIn:function(e){return El(e,t,"spectrum").map(qd.focusIn).map(o(!0))}}),zc.config({store:{mode:"manual",getValue:function(t){return d.value.get()}}}),Cu.config({channels:(i={},i[Sc()]={onReceive:g},i)})]),events:Sr([Dr(Xb(),function(t,e){p(t,e.event().value())}),Mr(function(e,n){var r=d.getInitialValue();d.value.set(r);var o=a(e);h(e,o);var i=u(e);t.onInit(e,o,i,d.value.get())}),Dr(En(),v),Dr(An(),b),Dr(Bn(),v),Dr(Mn(),b)]),apis:{resetToMin:function(e){m.setToMin(e,t)},resetToMax:function(e){m.setToMax(e,t)},changeValue:p,refresh:h},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),yx=function(t,e){var n=bx.parts().spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=bx.parts().thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return bx.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:o({y:o(0)})},components:[n,r],sliderBehaviours:hu([nm.config({})]),onChange:function(t,e,n){xr(t,Fb,{value:n})}})},xx=[Uc("formBehaviours",[zc])],wx=function(t){return"<alloy.field."+t+">"},Cx=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:qc(t.formBehaviours,[zc.config({store:{mode:"manual",getValue:function(e){var n=Rl(e,t);return vt(n,function(t,e){return t().bind(function(t){var n,r;return n=Kl.getCurrent(t),r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+bo(t.element())),n.fold(function(){return it.error(r)},it.value)}).map(zc.getValue)})},setValue:function(e,n){gt(n,function(n,r){El(e,t,r).each(function(t){Kl.getCurrent(t).each(function(t){zc.setValue(t,n)})})})}}})]),apis:{getField:function(e,n){return El(e,t,n).bind(Kl.getCurrent)}}}},_x={getField:Lo(function(t,e,n){return t.getField(e,n)}),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),kl("form",wx(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=H(r,function(t){return pl({name:t,pname:wx(t)})});return Hl("form",xx,o,Cx,n)}},kx=Co("valid-input"),Sx=Co("invalid-input"),Tx=Co("validating-input"),Ox=function(t,e,r,o){var i=function(n,r){return hb.config({invalidClass:e("invalid"),notify:{onValidate:function(t){xr(t,Tx,{type:n})},onValid:function(t){xr(t,kx,{type:n,value:zc.getValue(t)})},onInvalid:function(t){xr(t,Sx,{type:n,value:zc.getValue(t)})}},validator:{validate:function(e){var n=zc.getValue(e),o=r(n)?it.value(!0):it.error(t("aria.input.invalid"));return ob(o)},validateOnLoad:!1}})},a=function(r,o,a,u,s){var c=t("colorcustom.rgb.range"),l=[Ov.parts().label({dom:{tag:"label",innerHtml:a,attributes:{"aria-label":u}}}),Ov.parts().field({data:s,factory:Gv,inputAttributes:d({type:"text"},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:hu([i(o,r),Nv.config({})]),onSetValue:function(t){hb.isInvalid(t)&&hb.run(t).get(n)}})],f="hex"!==o?[Ov.parts()["aria-descriptor"]({text:c})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:l.concat(f)}},u=function(t,e){var n=e.red,r=e.green,o=e.blue;zc.setValue(t,{red:n,green:r,blue:o})},s=Xm({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),c=function(t,e){s.getOpt(t).each(function(t){di(t.element(),"background-color","#"+e.value)})};return Ul({factory:function(){var n={red:Ye(y.some(255)),green:Ye(y.some(255)),blue:Ye(y.some(255)),hex:Ye(y.some("ffffff"))},i=function(t){return n[t].get()},l=function(t,e){n[t].set(e)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",y.some(e)),l("green",y.some(n)),l("blue",y.some(r))},d=function(t,e){var n=e.event();"hex"!==n.type()?l(n.type(),y.none()):o(t)},m=function(t,e){var n=e.event();"hex"!==n.type()?function(t,e,n){var r=parseInt(n,10);l(e,y.some(r)),i("red").bind(function(t){return i("green").bind(function(e){return i("blue").map(function(n){return Og(t,e,n,1)})})}).each(function(e){var n=function(t,e){var n=wg(e);return _x.getField(t,"hex").each(function(e){nm.isFocused(e)||zc.setValue(t,{hex:n.value})}),n}(t,e);c(t,n)})}(t,n.type(),n.value()):function(t,e){r(t);var n=gg(e);l("hex",y.some(e));var o=Ng(n);u(t,o),f(o),xr(t,Lb,{hex:n}),c(t,n)}(t,n.value())},h=function(e){return{label:t("colorcustom.rgb."+e+".label"),description:t("colorcustom.rgb."+e+".description")}},p=h("red"),g=h("green"),v=h("blue"),b=h("hex");return Dt(_x.sketch(function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",Ov.sketch(a(Dg,"red",p.label,p.description,255))),n.field("green",Ov.sketch(a(Dg,"green",g.label,g.description,255))),n.field("blue",Ov.sketch(a(Dg,"blue",v.label,v.description,255))),n.field("hex",Ov.sketch(a(yg,"hex",b.label,b.description,"ffffff"))),s.asSpec()],formBehaviours:hu([hb.config({invalidClass:e("form-invalid")}),Jd("rgb-form-events",[Dr(kx,m),Dr(Sx,d),Dr(Tx,d)])])}}),{apis:{updateHex:function(t,e){zc.setValue(t,{hex:e.value}),function(t,e){var n=Ng(e);u(t,n),f(n)}(t,e),c(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}})},Dx=function(t,e){var n=bx.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=bx.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),i=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var a=o.createLinearGradient(0,0,0,r);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=a,o.fillRect(0,0,n,r)}};return Ul({factory:function(t){var a=o({x:o(0),y:o(0)}),u=hu([Kl.config({find:y.some}),nm.config({})]);return bx.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:a},rounded:!1,components:[n,r],onChange:function(t,e,n){xr(t,Hb,{value:n})},onInit:function(t,e,n,r){i(n.element().dom(),Rg(Bg))},sliderBehaviours:u})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,e,n){!function(t,e){var n=t.components()[0].element().dom();i(n,Rg(e))}(e,n)}},extraApis:{}})},Ex=function(t,e){return Ul({name:"ColourPicker",configFields:[_e("dom"),Fe("onValidHex",n),Fe("onInvalidHex",n)],factory:function(n){var r,o=Ox(t,e,n.onValidHex,n.onInvalidHex),i=Dx(0,e),a={paletteRgba:Ye(Bg)},u=Xm(i.sketch({})),s=Xm(o.sketch({})),c=function(t,e){u.getOpt(t).each(function(t){var n=Ng(e);a.paletteRgba.set(n),i.setRgba(t,n)})},l=function(t,e){s.getOpt(t).each(function(t){o.updateHex(t,e)})},f=function(t,e,n){j(n,function(n){n(t,e)})};return{uid:n.uid,dom:n.dom,components:[u.asSpec(),yx(0,e),s.asSpec()],behaviours:hu([Jd("colour-picker-events",[Dr(Hb,(r=[l],function(t,e){var n=e.event().value(),o=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,a=t.blue/255,u=Math.min(o,Math.min(i,a)),s=Math.max(o,Math.max(i,a));return u===s?Mb(0,0,100*(r=u)):(n=60*((n=o===u?3:a===u?1:5)-(o===u?i-a:a===u?o-i:a-o)/(s-u)),e=(s-u)/s,r=s,Mb(Math.round(n),Math.round(100*e),Math.round(100*r)))}(a.paletteRgba.get()),i=Mb(o.hue,n.x(),100-n.y()),u=Eg(i),s=wg(u);f(t,s,r)})),Dr(Fb,function(){var t=[c,l];return function(e,n){var r=function(t){var e=Mb((100-t)/100*360,100,100),n=Eg(e);return wg(n)}(n.event().value().y());f(e,r,t)}}())]),Kl.config({find:function(t){return s.getOpt(t)}}),qd.config({mode:"acyclic"})])}}})},Nx=function(){return Kl.config({find:y.some})},Ax=function(t){return Kl.config({find:t.getOpt})},Rx=function(t){return Kl.config({find:function(e){return Zr(e.element(),t).bind(function(t){return e.getSystem().getByDom(t).toOption()})}})},Bx={"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"},Ix=function(t){return function(t){return Bx[t]}(t)},Px=tinymce.util.Tools.resolve("tinymce.Resource"),Mx=Qt([Fe("preprocess",i),Fe("postprocess",i)]),Lx=function(t,e,n){return zc.config(Dt({store:{mode:"manual",getValue:e,setValue:n}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},Fx=function(t,e){var n=fe("RepresentingConfigs.memento processors",Mx,e);return zc.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=zc.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);zc.setValue(i,o)}}})},Hx=Lx,jx=function(t){return function(t,e,n){return Lx(t,function(t){return e(t.element())},function(t,e){return n(t.element(),e)})}(t,so,co)},Vx=function(t){return zc.config({store:{mode:"memory",initialValue:t}})},zx=Co("alloy-fake-before-tabstop"),Ux=Co("alloy-fake-after-tabstop"),Wx=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:hu([nm.config({ignore:!0}),Nv.config({})])}},qx=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[Wx([zx]),t,Wx([Ux])],behaviours:hu([Rx(1)])}},$x=function(t,e){xr(t,jn(),{raw:{which:9,shiftKey:e}})},Yx=function(t,e){var n=e.element();Qo(n,zx)?$x(t,!0):Qo(n,Ux)&&$x(t,!1)},Gx=function(t){return fv(t,["."+zx,"."+Ux].join(","),o(!1))},Kx=!(bn().browser.isIE()||bn().browser.isEdge());function Xx(t,n){return Zx(e.document.createElement("canvas"),t,n)}function Jx(t){var e=Xx(t.width,t.height);return Qx(e).drawImage(t,0,0),e}function Qx(t){return t.getContext("2d")}function Zx(t,e,n){return t.width=e,t.height=n,t}function tw(t){return t.naturalWidth||t.width}function ew(t){return t.naturalHeight||t.height}var nw=window.Promise?window.Promise:function(){var t=function(t){if("object"!=_typeof(this))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(t,r(a,this),r(u,this))},n=t.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){e.setTimeout(t,1)};function r(t,e){return function(){return t.apply(e,arguments)}}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t){var e=this;null!==this._state?n(function(){var n=e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void t.reject(e)}t.resolve(r)}else(e._state?t.resolve:t.reject)(e._value)}):this._deferreds.push(t)}function a(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==_typeof(t)||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void l(r(e,t),r(a,this),r(u,this))}this._state=!0,this._value=t,s.call(this)}catch(t){u.call(this,t)}}function u(t){this._state=!1,this._value=t,s.call(this)}function s(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];i.call(this,n)}this._deferreds=[]}function c(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function l(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(t){if(r)return;r=!0,n(t)}}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.then=function(e,n){var r=this;return new t(function(t,o){i.call(r,new c(e,n,t,o))})},t.all=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Array.prototype.slice.call(1===e.length&&o(e[0])?e[0]:e);return new t(function(t,e){if(0===r.length)return t([]);var n=r.length;function o(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(t){o(i,t)},e)}r[i]=a,0==--n&&t(r)}catch(t){e(t)}}for(var i=0;i<r.length;i++)o(i,r[i])})},t.resolve=function(e){return e&&"object"==_typeof(e)&&e.constructor===t?e:new t(function(t){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.race=function(e){return new t(function(t,n){for(var r=0,o=e;r<o.length;r++)o[r].then(t,n)})},t}();function rw(t,n,r){return n=n||"image/png",e.HTMLCanvasElement.prototype.toBlob?new nw(function(e,o){t.toBlob(function(t){t?e(t):o()},n,r)}):function(t){return new nw(function(n,r){(function(t){var n=t.split(","),r=/data:([^;]+)/.exec(n[0]);if(!r)return y.none();for(var o=r[1],i=n[1],a=e.atob(i),u=a.length,s=Math.ceil(u/1024),c=new Array(s),l=0;l<s;++l){for(var f=1024*l,d=Math.min(f+1024,u),m=new Array(d-f),h=f,p=0;h<d;++p,++h)m[p]=a[h].charCodeAt(0);c[l]=new Uint8Array(m)}return y.some(new e.Blob(c,{type:o}))})(t).fold(function(){r("uri is not base64: "+t)},n)})}(t.toDataURL(n,r))}function ow(t){return function(t){return new nw(function(n,r){var o=e.URL.createObjectURL(t),i=new e.Image,a=function(){i.removeEventListener("load",u),i.removeEventListener("error",s)};function u(){a(),n(i)}function s(){a(),r("Unable to load data of type "+t.type+": "+o)}i.addEventListener("load",u),i.addEventListener("error",s),i.src=o,i.complete&&u()})}(t).then(function(t){!function(t){e.URL.revokeObjectURL(t.src)}(t);var n=Xx(tw(t),ew(t));return Qx(n).drawImage(t,0,0),n})}function iw(t,e,n){var r=e.type;function i(e,n){return t.then(function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)})}return{getType:o(r),toBlob:function(){return nw.resolve(e)},toDataURL:o(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then(function(t){return rw(t,e,n)})},toAdjustedDataURL:i,toAdjustedBase64:function(t,e){return i(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(Jx)}}}function aw(t,e){return rw(t,e).then(function(e){return iw(nw.resolve(t),e,t.toDataURL())})}function uw(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r}var sw=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function cw(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var a=0;a<5;a++)r[a]=e[a+5*i];for(a=0;a<5;a++){n=0;for(var u=0;u<5;u++)n+=t[a+5*u]*r[u];o[a+5*i]=n}}return o}function lw(t,e){return t.toCanvas().then(function(n){return function(t,e,n){var r=Qx(t),o=function(t,e){for(var n,r,o,i,a=t.data,u=e[0],s=e[1],c=e[2],l=e[3],f=e[4],d=e[5],m=e[6],h=e[7],p=e[8],g=e[9],v=e[10],b=e[11],y=e[12],x=e[13],w=e[14],C=e[15],_=e[16],k=e[17],S=e[18],T=e[19],O=0;O<a.length;O+=4)n=a[O],r=a[O+1],o=a[O+2],i=a[O+3],a[O]=n*u+r*s+o*c+i*l+f,a[O+1]=n*d+r*m+o*h+i*p+g,a[O+2]=n*v+r*b+o*y+i*x+w,a[O+3]=n*C+r*_+o*k+i*S+T;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),aw(t,e)}(n,t.getType(),e)})}function fw(t){return function(e,n){return lw(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}}var dw,mw,hw=function(t){return function(e){return lw(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),pw=fw(function(t,e){return cw(t,[1,0,0,0,e=uw(255*e,-255,255),0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])}),gw=fw(function(t,e){var n;return e=uw(e,-1,1),cw(t,[(n=(e*=100)<0?127+e/100*127:127*(n=0==(n=e%1)?sw[e]:sw[Math.floor(e)]*(1-n)+sw[Math.floor(e)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])}),vw=(dw=[0,-1,0,-1,5,-1,0,-1,0],function(t){return function(t,e){return t.toCanvas().then(function(n){return function(t,e,n){var r=Qx(t),o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){function r(t,e,n){return t>n?t=n:t<e&&(t=e),t}for(var o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),a=t.data,u=e.data,s=t.width,c=t.height,l=0;l<c;l++)for(var f=0;f<s;f++){for(var d=0,m=0,h=0,p=0;p<o;p++)for(var g=0;g<o;g++){var v=r(f+g-i,0,s-1),b=4*(r(l+p-i,0,c-1)*s+v),y=n[p*o+g];d+=a[b]*y,m+=a[b+1]*y,h+=a[b+2]*y}var x=4*(l*s+f);u[x]=r(d,0,255),u[x+1]=r(m,0,255),u[x+2]=r(h,0,255)}return e}(o,i,n),r.putImageData(i,0,0),aw(t,e)}(n,t.getType(),e)})}(t,dw)}),bw=(mw=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then(function(n){return function(t,e,n){for(var r=Qx(t),o=new Array(256),i=0;i<o.length;i++)o[i]=mw(i,n);var a=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(a,0,0),aw(t,e)}(n,t.getType(),e)})});var yw=function(t){return hw(t)},xw=function(t){return vw(t)},ww=function(t,e){return bw(t,e)},Cw=function(t,e){return pw(t,e)},_w=function(t,e){return gw(t,e)},kw=function(t,e){return function(t,e){return t.toCanvas().then(function(n){return function(t,e,n){var r=Xx(t.width,t.height),o=Qx(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),aw(r,e)}(n,t.getType(),e)})}(t,e)},Sw=function(t,e,n){return function(t,e,n){return t.toCanvas().then(function(r){return function t(e,n,r){var o=tw(e),i=ew(e),a=n/o,u=r/i,s=!1;(a<.5||a>2)&&(a=a<.5?.5:2,s=!0),(u<.5||u>2)&&(u=u<.5?.5:2,s=!0);var c=function(t,e,n){return new nw(function(r){var o=tw(t),i=ew(t),a=Math.floor(o*e),u=Math.floor(i*n),s=Xx(a,u);Qx(s).drawImage(t,0,0,o,i,0,0,a,u),r(s)})}(e,a,u);return s?c.then(function(e){return t(e,n,r)}):c}(r,e,n).then(function(e){return aw(e,t.getType())})})}(t,e,n)},Tw=function(t,e){return function(t,e){return t.toCanvas().then(function(n){return function(t,e,n){var r=Xx(t.width,t.height),o=Qx(r),i=0,a=0;return 90!==(n=n<0?360+n:n)&&270!==n||Zx(r,r.height,r.width),90!==n&&180!==n||(i=r.width),270!==n&&180!==n||(a=r.height),o.translate(i,a),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),aw(r,e)}(n,t.getType(),e)})}(t,e)},Ow=function(t,e){return d({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},e)},Dw=function(t,e){return Ow(Qm(t,e),{})},Ew=function(t,e){return Ow(Qm(t,e),{behaviours:hu([Xd.config({})])})},Nw=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:hu([Xd.config({})])}},Aw=Co("toolbar.button.execute"),Rw={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},Bw=Co("update-menu-text"),Iw=Co("update-menu-icon"),Pw=function(t,e,r){var o=Ye(n),i=t.text.map(function(t){return Xm(Nw(t,e,r.providers))}),a=t.icon.map(function(t){return Xm(Ew(t,r.providers.icons))}),u=function(t,e){var n=zc.getValue(t);return nm.focus(n),xr(n,"keydown",{raw:e.event().raw()}),Nb.close(n),y.some(!0)},s=t.role.fold(function(){return{}},function(t){return{role:t}}),c=t.tooltip.fold(function(){return{}},function(t){var e=r.providers.translate(t);return{title:e,"aria-label":e}});return Xm(Nb.sketch(d(d({},s),{dom:{tag:"button",classes:[e,e+"--select"].concat(H(t.classes,function(t){return e+"--"+t})),attributes:d({},c)},components:Xp([a.map(function(t){return t.asSpec()}),i.map(function(t){return t.asSpec()}),y.some({dom:{tag:"div",classes:[e+"__select-chevron"],innerHtml:Qm("chevron-down",r.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:hu(h(t.dropdownBehaviours,[zp(function(){return t.disabled||r.providers.isReadOnly()}),jp(),Rb.config({}),Xd.config({}),Jd("dropdown-events",[$p(t,o),Yp(t,o)]),Jd("menubutton-update-display-text",[Dr(Bw,function(t,e){i.bind(function(e){return e.getOpt(t)}).each(function(t){Xd.set(t,[Di(r.providers.translate(e.event().text()))])})}),Dr(Iw,function(t,e){a.bind(function(e){return e.getOpt(t)}).each(function(t){Xd.set(t,[Ew(e.event().icon(),r.providers.icons)])})})])])),eventOrder:Dt(Rw,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:hu([qd.config({mode:"special",onLeft:u,onRight:u})]),lazySink:r.getSink,toggleClass:e+"--active",parts:{menu:Rh(0,t.columns,t.presets)},fetch:function(){return rb(t.fetch)}}))).asSpec()},Mw=function(t){return"separator"===t.type},Lw={type:"separator"},Fw=function(t,e){return function(t){return _t(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=Hw(n,e);return{item:t,menus:Dt(r.menus,jt(t.value,r.items)),expansions:Dt(r.expansions,jt(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}},Hw=function(t,e){var n=function(t,e){var n=W(t,function(t,n){return C(n)?""===n?t:"|"===n?t.length>0&&!Mw(t[t.length-1])?t.concat([Lw]):t:_t(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])},[]);return n.length>0&&Mw(n[n.length-1])&&n.pop(),n}(C(t)?t.split(" "):t,e);return U(n,function(t,n){var r=function(t){if(Mw(t))return t;var e=Ct(t,"value").getOrThunk(function(){return Co("generated-menu-item")});return Dt({value:e},t)}(n),o=Fw(r,e);return{menus:Dt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:Dt(t.expansions,o.expansions)}},{menus:{},expansions:{},items:[]})},jw=function(t,e,n,r){var o=Co("primary-menu"),i=Hw(t,n.shared.providers.menuItems());if(0===i.items.length)return y.none();var a=ov(o,i.items,e,n,r),u=vt(i.menus,function(t,r){return ov(r,t,e,n,!1)}),s=Dt(u,jt(o,a));return y.from(Pm.tieredData(o,s,i.expansions))},Vw=function(t){return{isDisabled:function(){return dp.isDisabled(t)},setDisabled:function(e){return dp.set(t,e)},setActive:function(e){var n=t.element();e?(Xo(n,"tox-tbtn--enabled"),fo(n,"aria-pressed",!0)):(Jo(n,"tox-tbtn--enabled"),go(n,"aria-pressed"))},isActive:function(){return Qo(t.element(),"tox-tbtn--enabled")}}},zw=function(t,e,n,r){return Pw({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e){t.fetch(function(t){e(jw(t,xh.CLOSE_ON_EXECUTE,n,!1))})},onSetup:t.onSetup,getApi:Vw,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Nv.config({})]},e,n.shared)},Uw=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each(function(n){e().getOpt(n).each(function(e){ku(e.element()),xr(e,Fv,{name:t.name,value:t.storage.get()})})})}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(H(t,function(t){var e=t.text.fold(function(){return{}},function(t){return{text:t}});return d(d({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})}))}},Ww=function(t,e,n,r,o,i){void 0===n&&(n=[]);var a=e.fold(function(){return{}},function(t){return{action:t}}),u=d({buttonBehaviours:hu([zp(function(){return t.disabled||i.isReadOnly()}),jp(),Nv.config({}),Jd("button press",[Or("click"),Or("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},a),s=Dt(u,{dom:r});return Dt(s,{components:o})},qw=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map(function(t){return{"aria-label":n.translate(t),title:n.translate(t)}}).getOr({})},i=t.icon.map(function(t){return Dw(t,n.icons)}),a=Xp([i]);return Ww(t,e,r,o,a,n)},$w=function(t,e,n,r){void 0===r&&(r=[]);var o=qw(t,y.some(e),n,r);return Km.sketch(o)},Yw=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),a=t.icon?t.icon.map(function(t){return Dw(t,n.icons)}):y.none(),u=a.isSome()?Xp([a]):[],s=a.isSome()?{}:{innerHtml:i},c=h(t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],a.isSome()?["tox-button--icon"]:[],t.borderless?["tox-button--naked"]:[],o),l=d(d({tag:"button",classes:c},s),{attributes:{title:i}});return Ww(t,e,r,l,u,n)},Gw=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=Yw(t,y.some(e),n,r,o);return Km.sketch(i)},Kw=function(t,n){return function(r){"custom"===n?xr(r,Fv,{name:t,value:{}}):"submit"===n?yr(r,Hv):"cancel"===n?yr(r,Lv):e.console.error("Unknown button type: ",n)}},Xw=function(t,r,o){if("menu"===r){var i=t,a=d(d({},t),{onSetup:function(e){return e.setDisabled(t.disabled),n},fetch:Uw(i.items,function(){return u},o)}),u=Xm(zw(a,"tox-tbtn",o,y.none()));return u.asSpec()}if("custom"===r||"cancel"===r||"submit"===r){var s=Kw(t.name,r),c=d(d({},t),{borderless:!1});return Gw(c,s,o.shared.providers,[])}e.console.error("Unknown footer button type: ",r)},Jw=o([Fe("field1Name","field1"),Fe("field2Name","field2"),Ea("onLockedChange"),Sa(["lockClass"]),Fe("locked",!1),$c("coupledFieldBehaviours",[Kl,zc])]),Qw=function(t,e){return pl({factory:Ov,name:t,overrides:function(t){return{fieldBehaviours:hu([Jd("coupled-input-behaviour",[Dr(zn(),function(n){(function(t,e,n){return El(t,e,n).bind(Kl.getCurrent)})(n,t,e).each(function(e){El(n,t,"lock").each(function(r){hm.isOn(r)&&t.onLockedChange(n,e,r)})})})])])}}})},Zw=o([Qw("field1","field2"),Qw("field2","field1"),pl({factory:Km,schema:[_e("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:hu([hm.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),tC=Wl({name:"FormCoupledInputs",configFields:Jw(),partFields:Zw(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Yc(t.coupledFieldBehaviours,[Kl.config({find:y.some}),zc.config({store:{mode:"manual",getValue:function(e){var n,r=Il(e,t,["field1","field2"]);return(n={})[t.field1Name]=zc.getValue(r.field1()),n[t.field2Name]=zc.getValue(r.field2()),n},setValue:function(e,n){var r=Il(e,t,["field1","field2"]);kt(n,t.field1Name)&&zc.setValue(r.field1(),n[t.field1Name]),kt(n,t.field2Name)&&zc.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return El(e,t,"field1")},getField2:function(e){return El(e,t,"field2")},getLock:function(e){return El(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),eC=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return it.value({value:n,unit:r})}return it.error(t)},nC=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return Object.prototype.hasOwnProperty.call(n,t)};return t.unit===e?y.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?y.some(t.value):y.some(t.value/n[t.unit]*n[e]):y.none()},rC=function(t){return y.none()},oC=function(t,e){var n=rC,r=Co("ratio-event"),o=tC.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:Qm("lock",e.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:Qm("unlock",e.icons)}}],buttonBehaviours:hu([dp.config({disabled:function(){return t.disabled||e.isReadOnly()}}),jp(),Nv.config({})])}),i=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},a=function(n){return Ov.parts().field({factory:Gv,inputClasses:["tox-textfield"],inputBehaviours:hu([dp.config({disabled:function(){return t.disabled||e.isReadOnly()}}),jp(),Nv.config({}),Jd("size-input-events",[Dr(Fn(),function(t,e){xr(t,r,{isField1:n})}),Dr(Un(),function(e,n){xr(e,Pv,{name:t.name})})])]),selectOnFocus:!1})},u=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=tC.parts().field1(i([Ov.parts().label(u("Width")),a(!0)])),c=tC.parts().field2(i([Ov.parts().label(u("Height")),a(!1)]));return tC.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,c,i([u("&nbsp;"),o])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){eC(zc.getValue(t)).each(function(t){n(t).each(function(t){zc.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))})})},coupledFieldBehaviours:hu([dp.config({disabled:function(){return t.disabled||e.isReadOnly()},onDisabled:function(t){tC.getField1(t).bind(Ov.getField).each(dp.disable),tC.getField2(t).bind(Ov.getField).each(dp.disable),tC.getLock(t).each(dp.disable)},onEnabled:function(t){tC.getField1(t).bind(Ov.getField).each(dp.enable),tC.getField2(t).bind(Ov.getField).each(dp.enable),tC.getLock(t).each(dp.enable)}}),jp(),Jd("size-input-events2",[Dr(r,function(t,e){var r=e.event().isField1(),o=r?tC.getField1(t):tC.getField2(t),i=r?tC.getField2(t):tC.getField1(t),a=o.map(zc.getValue).getOr(""),u=i.map(zc.getValue).getOr("");n=function(t,e){var n,r,o;return(n=eC(t).toOption(),r=eC(e).toOption(),o=function(t,e){return nC(t,e.unit).map(function(t){return e.value/t}).map(function(t){return function(t,e){return function(n){return nC(n,e).map(function(n){return{value:n*t,unit:e}})}}(t,e.unit)}).getOr(rC)},n.isSome()&&r.isSome()?y.some(o(n.getOrDie(),r.getOrDie())):y.none()).getOr(rC)}(a,u)})])])})},iC={undo:o(Co("undo")),redo:o(Co("redo")),zoom:o(Co("zoom")),back:o(Co("back")),apply:o(Co("apply")),swap:o(Co("swap")),transform:o(Co("transform")),tempTransform:o(Co("temp-transform")),transformApply:o(Co("transform-apply"))},aC=o("save-state"),uC=o("disable"),sC=o("enable"),cC={formActionEvent:Fv,saveState:aC,disable:uC,enable:sC},lC=function(t,e){var r=function(t,n,r,o){return Xm(Gw({name:t,text:t,disabled:r,primary:o,icon:y.none(),borderless:!1},n,e))},i=function(t,n,r,o){return Xm($w({name:t,icon:y.some(t),tooltip:y.some(n),disabled:o,primary:!1,borderless:!1},r,e))},a=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(dp)&&dp.disable(n)})},u=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(dp)&&dp.enable(n)})},s={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},c=n,l=function(t,e,n){xr(t,e,n)},f=function(t){return yr(t,cC.disable())},d=function(t){return yr(t,cC.enable())},m=function(t,e){f(t),l(t,iC.transform(),{transform:e}),d(t)},h=function(t){return function(){et.getOpt(t).each(function(t){Xd.set(t,[Z])})}},p=function(t,e){f(t),l(t,iC.transformApply(),{transform:e,swap:h(t)}),d(t)},g=function(){return r("Back",function(t){return l(t,iC.back(),{swap:h(t)})},!1,!1)},v=function(){return Xm({dom:{tag:"div",classes:["tox-spacer"]},behaviours:hu([dp.config({})])})},b=function(){return r("Apply",function(t){return l(t,iC.apply(),{swap:h(t)})},!0,!0)},x=function(){return function(e){var n=t.getRect();return function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then(function(i){return function(t,e,n,r,o,i){var a=Xx(o,i);return Qx(a).drawImage(t,-n,-r),aw(a,e)}(i,t.getType(),e,n,r,o)})}(t,e,n,r,o)}(e,n.x,n.y,n.w,n.h)}},w=[g(),v(),r("Apply",function(e){var n=x();p(e,n),t.hideCrop()},!1,!0)],C=_v.sketch({dom:s,components:w.map(function(t){return t.asSpec()}),containerBehaviours:hu([Jd("image-tools-crop-buttons-events",[Dr(cC.disable(),function(t,e){a(w,t)}),Dr(cC.enable(),function(t,e){u(w,t)})])])}),_=Xm(oC({name:"size",label:y.none(),constrain:!0,disabled:!1},e)),k=[g(),v(),_,v(),r("Apply",function(t){_.getOpt(t).each(function(e){var n=zc.getValue(e),r=function(t,e){return function(n){return Sw(n,t,e)}}(parseInt(n.width,10),parseInt(n.height,10));p(t,r)})},!1,!0)],S=_v.sketch({dom:s,components:k.map(function(t){return t.asSpec()}),containerBehaviours:hu([Jd("image-tools-resize-buttons-events",[Dr(cC.disable(),function(t,e){a(k,t)}),Dr(cC.enable(),function(t,e){u(k,t)})])])}),T=function(t,e){return function(n){return t(n,e)}},O=T(kw,"h"),D=T(kw,"v"),E=T(Tw,-90),N=T(Tw,90),A=function(t,e){!function(t,e){f(t),l(t,iC.tempTransform(),{transform:e}),d(t)}(t,e)},R=[g(),v(),i("flip-horizontally","Flip horizontally",function(t){A(t,O)},!1),i("flip-vertically","Flip vertically",function(t){A(t,D)},!1),i("rotate-left","Rotate counterclockwise",function(t){A(t,E)},!1),i("rotate-right","Rotate clockwise",function(t){A(t,N)},!1),v(),b()],B=_v.sketch({dom:s,components:R.map(function(t){return t.asSpec()}),containerBehaviours:hu([Jd("image-tools-fliprotate-buttons-events",[Dr(cC.disable(),function(t,e){a(R,t)}),Dr(cC.enable(),function(t,e){u(R,t)})])])}),I=function(t,n,r,i,a){var u=bx.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),s=bx.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=bx.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Xm(bx.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:a,getInitialValue:o({x:o(i)})},components:[u,s,c],sliderBehaviours:hu([nm.config({})]),onChoose:n}))},P=function(t,e,n,r,o){return I(t,function(t,n,r){var o=T(e,r.x()/100);m(t,o)},n,r,o)},M=function(t,e,n,r,o){var i=function(t,e,n,r,o){return[g(),P(t,e,n,r,o),b()]}(t,e,n,r,o);return _v.sketch({dom:s,components:i.map(function(t){return t.asSpec()}),containerBehaviours:hu([Jd("image-tools-filter-panel-buttons-events",[Dr(cC.disable(),function(t,e){a(i,t)}),Dr(cC.enable(),function(t,e){u(i,t)})])])})},L=[g(),v(),b()],F=_v.sketch({dom:s,components:L.map(function(t){return t.asSpec()})}),H=M("Brightness",Cw,-100,0,100),j=M("Contrast",_w,-100,0,100),V=M("Gamma",ww,-100,0,100),z=function(t,e,n){return function(r){return function(t,e,n,r){return function(t,e,n,r){return lw(t,function(t,e,n,r){return cw([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],[e=uw(e,0,2),0,0,0,0,0,n=uw(n,0,2),0,0,0,0,0,r=uw(r,0,2),0,0,0,0,0,1,0,0,0,0,0,1])}(0,e,n,r))}(t,e,n,r)}(r,t,e,n)}},U=function(t){return I(t,function(t,e,n){var r=W.getOpt(t),o=$.getOpt(t),i=q.getOpt(t);r.each(function(e){o.each(function(n){i.each(function(r){var o=zc.getValue(e).x()/100,i=zc.getValue(r).x()/100,a=zc.getValue(n).x()/100,u=z(o,i,a);m(t,u)})})})},0,100,200)},W=U("R"),q=U("G"),$=U("B"),Y=[g(),W,q,$,b()],G=_v.sketch({dom:s,components:Y.map(function(t){return t.asSpec()})}),K=function(t,e,n){return function(r){l(r,iC.swap(),{transform:e,swap:function(){et.getOpt(r).each(function(e){Xd.set(e,[t]),n(e)})}})}},X=y.some(xw),J=y.some(yw),Q=[i("crop","Crop",K(C,y.none(),function(e){t.showCrop()}),!1),i("resize","Resize",K(S,y.none(),function(e){_.getOpt(e).each(function(e){var n=t.getMeasurements(),r=n.width,o=n.height;zc.setValue(e,{width:r,height:o})})}),!1),i("orientation","Orientation",K(B,y.none(),c),!1),i("brightness","Brightness",K(H,y.none(),c),!1),i("sharpen","Sharpen",K(F,X,c),!1),i("contrast","Contrast",K(j,y.none(),c),!1),i("color-levels","Color levels",K(G,y.none(),c),!1),i("gamma","Gamma",K(V,y.none(),c),!1),i("invert","Invert",K(F,J,c),!1)],Z=_v.sketch({dom:s,components:Q.map(function(t){return t.asSpec()})}),tt=_v.sketch({dom:{tag:"div"},components:[Z],containerBehaviours:hu([Xd.config({})])}),et=Xm(tt);return{memContainer:et,getApplyButton:function(t){return et.getOpt(t).map(function(t){var e=t.components()[0];return e.components()[e.components().length-1]})}}},fC=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),dC=tinymce.util.Tools.resolve("tinymce.geom.Rect"),mC=tinymce.util.Tools.resolve("tinymce.util.Observable"),hC=tinymce.util.Tools.resolve("tinymce.util.Tools"),pC=tinymce.util.Tools.resolve("tinymce.util.VK");function gC(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]}function vC(t,n){var r,o,i,a,u=n.document||e.document;n=n||{};var s=u.getElementById(n.handle||t),c=function(t){if(gC(t),t.button!==o)return l(t);t.deltaX=t.screenX-i,t.deltaY=t.screenY-a,t.preventDefault(),n.drag(t)},l=function t(e){gC(e),fC(u).off("mousemove touchmove",c).off("mouseup touchend",t),r.remove(),n.stop&&n.stop(e)};this.destroy=function(){fC(s).off()},fC(s).on("mousedown touchstart",function(t){var f,d=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),a=e(n.offsetWidth,r.offsetWidth),u=e(n.scrollHeight,r.scrollHeight),s=e(n.clientHeight,r.clientHeight);return{width:o<a?i:o,height:u<e(n.offsetHeight,r.offsetHeight)?s:u}}(u);gC(t),t.preventDefault(),o=t.button;var m=s;i=t.screenX,a=t.screenY,f=e.window.getComputedStyle?e.window.getComputedStyle(m,null).getPropertyValue("cursor"):m.runtimeStyle.cursor,r=fC("<div></div>").css({position:"absolute",top:0,left:0,width:d.width,height:d.height,zIndex:2147483647,opacity:1e-4,cursor:f}).appendTo(u.body),fC(u).on("mousemove touchmove",c).on("mouseup touchend",l),n.start(t)})}var bC,yC,xC=0,wC=function(t){var e=Xm({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),n=Ye(1),r=Ye(y.none()),o=Ye({x:0,y:0,w:1,h:1}),i=Ye({x:0,y:0,w:1,h:1}),a=function(t,i){c.getOpt(t).each(function(t){var a=n.get(),u=zi(t.element()),s=Pi(t.element()),c=i.dom().naturalWidth*a,l=i.dom().naturalHeight*a,f=Math.max(0,u/2-c/2),d=Math.max(0,s/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:c.toString()+"px",height:l.toString()+"px",position:"absolute"};mi(i,m),e.getOpt(t).each(function(t){mi(t.element(),m)}),r.get().each(function(t){var e=o.get();t.setRect({x:e.x*a+f,y:e.y*a+d,w:e.w*a,h:e.h*a}),t.setClampRect({x:f,y:d,w:c,h:l}),t.setViewPortRect({x:0,y:0,w:u,h:s})})})},u=function(t,e){var r,u=Ke.fromTag("img");return fo(u,"src",e),(r=u.dom(),new dh(function(t){r.complete?t(r):r.addEventListener("load",function e(){r.removeEventListener("load",e),t(r)})})).then(function(){return c.getOpt(t).map(function(t){var e=Ei({element:u});Xd.replaceAt(t,1,y.some(e));var r=i.get(),s={x:0,y:0,w:u.dom().naturalWidth,h:u.dom().naturalHeight};i.set(s);var l=dC.inflate(s,-20,-20);return o.set(l),r.w===s.w&&r.h===s.h||function(t,e){c.getOpt(t).each(function(t){var r=zi(t.element()),o=Pi(t.element()),i=e.dom().naturalWidth,a=e.dom().naturalHeight,u=Math.min(r/i,o/a);u>=1?n.set(1):n.set(u)})}(t,u),a(t,u),u})})},s=_v.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[e.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:hu([Jd("image-panel-crop-events",[Mr(function(t){c.getOpt(t).each(function(t){var e=function(t,e,n,r,o){var i,a="tox-crid-"+xC++,u=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],s=["top","right","bottom","left"],c=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}};function l(e,r,o,i){var a,u,s,l,f;a=r.x,u=r.y,s=r.w,l=r.h,a+=o*e.deltaX,u+=i*e.deltaY,(s+=o*e.deltaW)<20&&(s=20),(l+=i*e.deltaH)<20&&(l=20),f=t=dC.clamp({x:a,y:u,w:s,h:l},n,"move"===e.name),f=c(n,f),h.fire("updateRect",{rect:f}),m(f)}function f(t){function n(t,e){e.h<0&&(e.h=0),e.w<0&&(e.w=0),fC("#"+a+"-"+t,r).css({left:e.x,top:e.y,width:e.w,height:e.h})}hC.each(u,function(e){fC("#"+a+"-"+e.name,r).css({left:t.w*e.xMul+t.x,top:t.h*e.yMul+t.y})}),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)}function d(e){f(t=e)}function m(t){var e,r;d((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))}fC('<div id="'+a+'" class="tox-croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),hC.each(s,function(t){fC("#"+a,r).append('<div id="'+a+"-"+t+'"class="tox-croprect-block" style="display: none" data-mce-bogus="all">')}),hC.each(u,function(t){fC("#"+a,r).append('<div id="'+a+"-"+t.name+'" class="tox-croprect-handle tox-croprect-handle-'+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')}),i=hC.map(u,function(e){var n;return new vC(a,{document:r.ownerDocument,handle:a+"-"+e.name,start:function(){n=t},drag:function(t){l(e,n,t.deltaX,t.deltaY)}})}),f(t),fC(r).on("focusin focusout",function(t){fC(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")}),fC(r).on("keydown",function(e){var n;function r(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),l(n,r,o,i)}switch(hC.each(u,function(t){if(e.target.id===a+"-"+t.name)return n=t,!1}),e.keyCode){case pC.LEFT:r(e,0,t,-10,0);break;case pC.RIGHT:r(e,0,t,10,0);break;case pC.UP:r(e,0,t,0,-10);break;case pC.DOWN:r(e,0,t,0,10);break;case pC.ENTER:case pC.SPACEBAR:e.preventDefault(),o()}});var h=hC.extend({toggleVisibility:function(t){var e=hC.map(u,function(t){return"#"+a+"-"+t.name}).concat(hC.map(s,function(t){return"#"+a+"-"+t})).join(",");t?fC(e,r).show():fC(e,r).hide()},setClampRect:function(e){n=e,f(t)},setRect:d,getInnerRect:function(){return c(n,t)},setInnerRect:m,setViewPortRect:function(n){e=n,f(t)},destroy:function(){hC.each(i,function(t){t.destroy()}),i=[]}},mC);return h}({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t.element().dom(),function(){});e.toggleVisibility(!1),e.on("updateRect",function(t){var e=t.rect,r=n.get(),i={x:Math.round(e.x/r),y:Math.round(e.y/r),w:Math.round(e.w/r),h:Math.round(e.h/r)};o.set(i)}),r.set(y.some(e))})})])])}],containerBehaviours:hu([Xd.config({}),Jd("image-panel-events",[Mr(function(e){u(e,t)})])])}),c=Xm(s);return{memContainer:c,updateSrc:u,zoom:function(t,e){var r=n.get(),o=e>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),c.getOpt(t).each(function(t){var e=t.components()[1].element();a(t,e)})},showCrop:function(){r.get().each(function(t){t.toggleVisibility(!0)})},hideCrop:function(){r.get().each(function(t){t.toggleVisibility(!1)})},getRect:function(){return o.get()},getMeasurements:function(){var t=i.get();return{width:t.w,height:t.h}}}},CC=function(t,e,n,r,o){return $w({name:t,icon:y.some(e),disabled:n,tooltip:y.some(t),primary:!1,borderless:!1},r,o)},_C=function(t,e){e?dp.enable(t):dp.disable(t)},kC=function(t,r){var o=function(t){var n=Ye(t),r=Ye(y.none()),o=function(){var t=[],e=-1;function n(){return e>0}function r(){return-1!==e&&e<t.length-1}return{data:t,add:function(n){var r=t.splice(++e);return t.push(n),{state:n,removed:r}},undo:function(){if(n())return t[--e]},redo:function(){if(r())return t[++e]},canUndo:n,canRedo:r}}();o.add(t);var i=function(t){n.set(t)},a=function(t){return{blob:t,url:e.URL.createObjectURL(t)}},u=function(t){e.URL.revokeObjectURL(t.url)},s=function(){r.get().each(u),r.set(y.none())},c=function(t){var e,n=a(t);return i(n),e=o.add(n).removed,hC.each(e,u),n.url};return{getBlobState:function(){return n.get()},setBlobState:i,addBlobState:c,getTempState:function(){return r.get().fold(function(){return n.get()},function(t){return t})},updateTempState:function(t){var e=a(t);return s(),r.set(y.some(e)),e.url},addTempState:function(t){var e=a(t);return r.set(y.some(e)),e.url},applyTempState:function(t){return r.get().fold(function(){},function(e){c(e.blob),t()})},destroyTempState:s,undo:function(){var t=o.undo();return i(t),t.url},redo:function(){var t=o.redo();return i(t),t.url},getHistoryStates:function(){return{undoEnabled:o.canUndo(),redoEnabled:o.canRedo()}}}}(t.currentState),i=function(t){var e=o.getHistoryStates();h.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),xr(t,cC.formActionEvent,{name:cC.saveState(),value:e.undoEnabled})},a=function(t){return t.toBlob()},u=function(t){xr(t,cC.formActionEvent,{name:cC.disable(),value:{}})},s=function(t){p.getApplyButton(t).each(function(t){dp.enable(t)}),xr(t,cC.formActionEvent,{name:cC.enable(),value:{}})},c=function(t,e){return u(t),m.updateSrc(t,e)},l=function(t,n,r,o,l){return u(t),function(t){return function(t){return new nw(function(n){var r=new e.FileReader;r.onloadend=function(){n(r.result)},r.readAsDataURL(t)})}(t).then(function(e){return iw(ow(t),t,e)})}(n).then(r).then(a).then(o).then(function(e){return c(t,e).then(function(e){return i(t),l(),s(t),e})}).catch(function(n){return e.console.log(n),s(t),n})},f=function(t,e,n){var r=o.getBlobState().blob;l(t,r,e,function(t){return o.updateTempState(t)},n)},d=function(t){var e=o.getBlobState().url;return o.destroyTempState(),i(t),e},m=wC(t.currentState.url),h=function(t){var e=Xm(CC("Undo","undo",!0,function(t){xr(t,iC.undo(),{direction:1})},t)),n=Xm(CC("Redo","redo",!0,function(t){xr(t,iC.redo(),{direction:1})},t));return{container:_v.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),CC("Zoom in","zoom-in",!1,function(t){xr(t,iC.zoom(),{direction:1})},t),CC("Zoom out","zoom-out",!1,function(t){xr(t,iC.zoom(),{direction:-1})},t)]}),updateButtonUndoStates:function(t,r,o){e.getOpt(t).each(function(t){_C(t,r)}),n.getOpt(t).each(function(t){_C(t,o)})}}}(r),p=lC(m,r);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[p.memContainer.asSpec(),m.memContainer.asSpec(),h.container],behaviours:hu([zc.config({store:{mode:"manual",getValue:function(){return o.getBlobState()}}}),Jd("image-tools-events",[Dr(iC.undo(),function(t,e){var n=o.undo();c(t,n).then(function(e){s(t),i(t)})}),Dr(iC.redo(),function(t,e){var n=o.redo();c(t,n).then(function(e){s(t),i(t)})}),Dr(iC.zoom(),function(t,e){var n=e.event().direction();m.zoom(t,n)}),Dr(iC.back(),function(t,e){!function(t){var e=d(t);c(t,e).then(function(e){s(t)})}(t),e.event().swap()(),m.hideCrop()}),Dr(iC.apply(),function(t,e){o.applyTempState(function(){d(t),e.event().swap()()})}),Dr(iC.transform(),function(t,e){return f(t,e.event().transform(),n)}),Dr(iC.tempTransform(),function(t,e){return function(t,e){var r=o.getTempState().blob;l(t,r,e,function(t){return o.addTempState(t)},n)}(t,e.event().transform())}),Dr(iC.transformApply(),function(t,e){return function(t,e,n){var r=o.getBlobState().blob;l(t,r,e,function(e){var n=o.addBlobState(e);return d(t),n},n)}(t,e.event().transform(),e.event().swap())}),Dr(iC.swap(),function(t,e){!function(t){h.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event().transform(),r=e.event().swap();n.fold(function(){r()},function(e){f(t,e,r)})})]),Nx()])}},SC=Ul({name:"HtmlSelect",configFields:[_e("options"),Uc("selectBehaviours",[nm,zc]),Fe("selectClasses",[]),Fe("selectAttributes",{}),Re("data")],factory:function(t,e){var n=H(t.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),r=t.data.map(function(t){return jt("initialValue",t)}).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:qc(t.selectBehaviours,[nm.config({}),zc.config({store:d({mode:"manual",getValue:function(t){return Ci(t.element())},setValue:function(e,n){q(t.options,function(t){return t.value===n}).isSome()&&_i(e.element(),n)}},r)})])}}}),TC=function(t,e){var n=t.label.map(function(t){return Iv(t,e)}),r=[dp.config({disabled:function(){return t.disabled||e.isReadOnly()}}),jp(),qd.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return yr(t,Hv),y.some(!0)}}),Jd("textfield-change",[Dr(zn(),function(e,n){xr(e,Pv,{name:t.name})}),Dr(Xn(),function(e,n){xr(e,Pv,{name:t.name})})]),Nv.config({})],i=t.validation.map(function(t){return hb.config({getRoot:function(t){return Xr(t.element())},invalidClass:"tox-invalid",validator:{validate:function(e){var n=zc.getValue(e),r=t.validator(n);return ob(!0===r?it.value(n):it.error(r))},validateOnLoad:t.validateOnLoad}})}).toArray(),a=t.placeholder.fold(o({}),function(t){return{placeholder:e.translate(t)}}),u=t.inputMode.fold(o({}),function(t){return{inputmode:t}}),s=d(d({},a),u),c=Ov.parts().field({tag:!0===t.multiline?"textarea":"input",inputAttributes:s,inputClasses:[t.classname],inputBehaviours:hu(Y([r,i])),selectOnFocus:!1,factory:Gv}),l=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),f=[dp.config({disabled:function(){return t.disabled||e.isReadOnly()},onDisabled:function(t){Ov.getField(t).each(dp.disable)},onEnabled:function(t){Ov.getField(t).each(dp.enable)}}),jp()];return Av(n,c,l,f)},OC=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return Sr([Dr(t.event,n),Lr(function(){return e.cancel()})].concat(t.cancelEvent.map(function(t){return[Dr(t,function(){return e.cancel()})]}).getOr([])))}}),DC=function(t){var e=Ye(null);return Ho({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},EC=Object.freeze({__proto__:null,throttle:DC,init:function(t){return t.stream.streams.state(t)}}),NC=[ke("stream",he("mode",{throttle:[_e("delay"),Fe("stopEvent",!0),Aa("streams",{setup:function(t,e){var n=t.stream,r=rh(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:DC})]})),Fe("event","input"),Re("cancelEvent"),Ea("onStream")],AC=gu({fields:NC,name:"streaming",active:OC,state:EC}),RC=function(t,e,n){var r=zc.getValue(n);zc.setValue(e,r),IC(e)},BC=function(t,e){var n=t.element(),r=Ci(n),o=n.dom();"number"!==mo(n,"type")&&e(o,r)},IC=function(t){BC(t,function(t,e){return t.setSelectionRange(e.length,e.length)})},PC=o("alloy.typeahead.itemexecute"),MC=o([Re("lazySink"),_e("fetch"),Fe("minChars",5),Fe("responseTime",1e3),Oa("onOpen"),Fe("getHotspot",y.some),Fe("getAnchorOverrides",o({})),Fe("layouts",y.none()),Fe("eventOrder",{}),qe("model",{},[Fe("getDisplayText",function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value}),Fe("selectsOver",!0),Fe("populateFromBrowse",!0)]),Oa("onSetValue"),Da("onExecute"),Oa("onItemExecute"),Fe("inputClasses",[]),Fe("inputAttributes",{}),Fe("inputStyles",{}),Fe("matchWidth",!0),Fe("useMinWidth",!1),Fe("dismissOnBlur",!0),Sa(["openClass"]),Re("initialData"),Uc("typeaheadBehaviours",[nm,zc,AC,qd,hm,vb]),$e("previewing",function(){return Ye(!0)})].concat(Wv()).concat(Ob())),LC=o([gl({schema:[ka()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each(function(r){(function(t,e,n){if(t.selectsOver){var r=zc.getValue(e),o=t.getDisplayText(r),i=zc.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?y.some(function(){RC(0,e,n),function(t,e){BC(t,function(t,n){return t.setSelectionRange(e,n.length)})}(e,o.length)}):y.none()}return y.none()})(t.model,r,n).fold(function(){return af.dehighlight(e,n)},function(t){return t()})}):e.getSystem().getByUid(t.uid).each(function(e){t.model.populateFromBrowse&&RC(t.model,e,n)}),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOption().map(function(t){return xr(t,PC(),{item:n}),!0})},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each(function(e){t.model.populateFromBrowse&&RC(t.model,e,n)})}}}})]),FC=Wl({name:"Typeahead",configFields:MC(),partFields:LC(),factory:function(t,e,r,o){var i=function(e,r,i){t.previewing.set(!1);var a=vb.getCoupled(e,"sandbox");Cc.isOpen(a)?Kl.getCurrent(a).each(function(t){af.getHighlighted(t).fold(function(){i(t)},function(){kr(a,t.element(),"keydown",r)})}):wb(t,u(e),e,a,o,function(t){Kl.getCurrent(t).each(i)},Jv.HighlightFirst).get(n)},a=qv(t),u=function(t){return function(e){return e.map(function(e){var n=wt(e.menus),r=G(n,function(t){return z(t.items,function(t){return"item"===t.type})});return zc.getState(t).update(H(r,function(t){return t.data})),e})}},s=[nm.config({}),zc.config({onSetValue:t.onSetValue,store:d({mode:"dataset",getDataKey:function(t){return Ci(t.element())},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){_i(e.element(),t.model.getDisplayText(n))}},t.initialData.map(function(t){return jt("initialValue",t)}).getOr({}))}),AC.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,r){var i=vb.getCoupled(e,"sandbox");if(nm.isFocused(e)&&Ci(e.element()).length>=t.minChars){var a=Kl.getCurrent(i).bind(function(t){return af.getHighlighted(t).map(zc.getValue)});t.previewing.set(!0),wb(t,u(e),e,i,o,function(e){Kl.getCurrent(i).each(function(e){a.fold(function(){t.model.selectsOver&&af.highlightFirst(e)},function(t){af.highlightBy(e,function(e){return zc.getValue(e).value===t.value}),af.getHighlighted(e).orThunk(function(){return af.highlightFirst(e),y.none()})})})},Jv.HighlightFirst).get(n)}},cancelEvent:rr()}),qd.config({mode:"special",onDown:function(t,e){return i(t,e,af.highlightFirst),y.some(!0)},onEscape:function(t){var e=vb.getCoupled(t,"sandbox");return Cc.isOpen(e)?(Cc.close(e),y.some(!0)):y.none()},onUp:function(t,e){return i(t,e,af.highlightLast),y.some(!0)},onEnter:function(e){var n=vb.getCoupled(e,"sandbox"),r=Cc.isOpen(n);if(r&&!t.previewing.get())return Kl.getCurrent(n).bind(function(t){return af.getHighlighted(t)}).map(function(t){return xr(e,PC(),{item:t}),!0});var o=zc.getValue(e);return yr(e,rr()),t.onExecute(n,e,o),r&&Cc.close(n),y.some(!0)}}),hm.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),vb.config({others:{sandbox:function(e){return Sb(t,e,{onOpen:function(){return hm.on(e)},onClose:function(){return hm.off(e)}})}}}),Jd("typeaheadevents",[Hr(function(e){var r=n;Cb(t,u(e),e,o,r,Jv.HighlightFirst).get(n)}),Dr(PC(),function(e,n){var r=vb.getCoupled(e,"sandbox");RC(t.model,e,n.event().item()),yr(e,rr()),t.onItemExecute(e,r,n.event().item(),zc.getValue(e)),Cc.close(r),IC(e)})].concat(t.dismissOnBlur?[Dr(Kn(),function(t){var e=vb.getCoupled(t,"sandbox");Tu(e.element()).isNone()&&Cc.close(e)})]:[]))];return{uid:t.uid,dom:Yv(Dt(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:d(d({},a),qc(t.typeaheadBehaviours,s)),eventOrder:t.eventOrder}}}),HC=function(t){return function t(n){return d(d({},n),{toCached:function(){return t(n.toCached())},bindFuture:function(e){return t(n.bind(function(t){return t.fold(function(t){return ob(it.error(t))},function(t){return e(t)})}))},bindResult:function(e){return t(n.map(function(t){return t.bind(e)}))},mapResult:function(e){return t(n.map(function(t){return t.map(e)}))},mapError:function(e){return t(n.map(function(t){return t.mapError(e)}))},foldResult:function(t,e){return n.map(function(n){return n.fold(t,e)})},withTimeout:function(r,o){return t(rb(function(t){var i=!1,a=e.setTimeout(function(){i=!0,t(it.error(o()))},r);n.get(function(n){i||(e.clearTimeout(a),t(n))})}))}})}(rb(t))},jC={type:"separator"},VC=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},zC=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:function(){}}},UC=function(t,e){return function(t){return H(t,VC)}(function(t,e){return z(e,function(e){return e.type===t})}(t,e))},WC=function(t){return UC("header",t.targets)},qC=function(t){return UC("anchor",t.targets)},$C=function(t){return y.from(t.anchorTop).map(function(t){return zC("<top>",t)}).toArray()},YC=function(t){return y.from(t.anchorBottom).map(function(t){return zC("<bottom>",t)}).toArray()},GC=function(t,e){var n=t.toLowerCase();return z(e,function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return sn(e.toLowerCase(),n)||sn(t.value.toLowerCase(),n)})},KC=Co("aria-invalid"),XC=function(t){return function(e,n,r){return Ct(n,"name").fold(function(){return t(n,r)},function(o){return e.field(o,t(n,r))})}},JC={bar:XC(function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:H(t.items,e.interpreter)}}(t,e.shared)}),collection:XC(function(t,e){return function(t,e){var n,r=t.label.map(function(t){return Iv(t,e)}),o=function(t){return function(e,n){la(n.event().target(),"[data-collection-item-value]").each(function(r){t(e,n,r,mo(r,"data-collection-item-value"))})}},a=o(function(n,r,o,i){r.stop(),e.isReadOnly()||xr(n,Fv,{name:t.name,value:i})}),u=[Dr(Ln(),o(function(t,e,n){ku(n)})),Dr(Wn(),a),Dr(tr(),a),Dr(Fn(),o(function(t,e,n){ca(t.element(),"."+Sh).each(function(t){Jo(t,Sh)}),Xo(n,Sh)})),Dr(Hn(),o(function(t){ca(t.element(),"."+Sh).each(function(t){Jo(t,Sh)})})),Hr(o(function(e,n,r,o){xr(e,Fv,{name:t.name,value:o})}))],s=function(t,e){return H(ys(t.element(),".tox-collection__item"),e)},c=Ov.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:i},behaviours:hu([dp.config({disabled:e.isReadOnly,onDisabled:function(t){s(t,function(t){Xo(t,"tox-collection__item--state-disabled"),fo(t,"aria-disabled",!0)})},onEnabled:function(t){s(t,function(t){Jo(t,"tox-collection__item--state-disabled"),go(t,"aria-disabled")})}}),jp(),Xd.config({}),zc.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=H(r,function(n){var r,o=np.translate(n.text),i=1===t.columns?'<div class="tox-collection__item-label">'+o+"</div>":"",a='<div class="tox-collection__item-icon">'+n.icon+"</div>",u={_:" "," - ":" ","-":" "},s=o.replace(/\_| \- |\-/g,function(t){return u[t]});return'<div class="tox-collection__item'+(e.isReadOnly()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+('"'===(r=n.value)?"&quot;":r)+'" title="'+s+'" aria-label="'+s+'">'+a+i+"</div>"}),i=t.columns>1&&"auto"!==t.columns?F(o,t.columns):[o],a=H(i,function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"});co(n.element(),a.join(""))}(n,r),"auto"===t.columns&&qh(n,5,"tox-collection__item").each(function(t){var e=t.numRows,r=t.numColumns;qd.setGridSize(n,e,r)}),yr(n,Uv)}}),Nv.config({}),qd.config((n=t.columns,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:".tox-collection__group",cell:"."+Ch}})),Jd("collection-events",u)]),eventOrder:{"alloy.execute":["disabling","alloy.base.behaviour","collection-events"]}});return Av(r,c,["tox-form__group--collection"],[])}(t,e.shared.providers)}),alertbanner:XC(function(t,e){return function(t,e){return _v.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Km.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Qm(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){xr(e,Fv,{name:"alert-banner",value:t.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)}),input:XC(function(t,e){return function(t,e){return TC({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:y.none(),maximized:t.maximized},e)}(t,e.shared.providers)}),textarea:XC(function(t,e){return function(t,e){return TC({name:t.name,multiline:!0,label:t.label,inputMode:y.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:y.none(),maximized:t.maximized},e)}(t,e.shared.providers)}),label:XC(function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=H(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:hu([Nx(),Xd.config({}),jx(y.none()),qd.config({mode:"acyclic"})])}}(t,e.shared)}),iframe:function(t){return function(e,n,r){var o=Dt(n,{source:"dynamic"});return XC(t)(e,o,r)}}(function(t,e){return function(t,e){var n=Kx&&t.sandboxed,r=d(d({},t.label.map(function(t){return{title:t}}).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=Ye("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)fo(n.element(),"srcdoc",r);else{fo(n.element(),"src","javascript:''");var o=n.element().dom().contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map(function(t){return Iv(t,e)}),a=Ov.parts().field({factory:{sketch:function(t){return qx({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:hu([Nv.config({}),nm.config({}),Hx(y.none(),o.getValue,o.setValue)])})}}});return Av(i,a,["tox-form__group--stretched"],[])}(t,e.shared.providers)}),button:XC(function(t,e){return function(t,e){var n,r,o=Kw(t.name,"custom");return n=y.none(),r=Ov.parts().field(d({factory:Km},Yw(t,y.some(o),e,[Vx(""),Nx()]))),Av(n,r,[],[])}(t,e.shared.providers)}),checkbox:XC(function(t,e){return function(t,e){var n=zc.config({store:{mode:"manual",getValue:function(t){return t.element().dom().checked},setValue:function(t,e){t.element().dom().checked=e}}}),r=function(t){return t.element().dom().click(),y.some(!0)},o=Ov.parts().field({factory:{sketch:i},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:hu([Nx(),dp.config({disabled:function(){return t.disabled||e.isReadOnly()}}),Nv.config({}),nm.config({}),n,qd.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),Jd("checkbox-events",[Dr(Un(),function(e,n){xr(e,Pv,{name:t.name})})])])}),a=Ov.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:hu([Rb.config({})])}),u=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:Qm("checked"===t?"selected":"unselected",e.icons)}}},s=Xm({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[u("checked"),u("unchecked")]});return Ov.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,s.asSpec(),a],fieldBehaviours:hu([dp.config({disabled:function(){return t.disabled||e.isReadOnly()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){Ov.getField(t).each(dp.disable)},onEnabled:function(t){Ov.getField(t).each(dp.enable)}}),jp()])})}(t,e.shared.providers)}),colorinput:XC(function(t,e){return function(t,e,n){var r=Ov.parts().field({factory:Gv,inputClasses:["tox-textfield"],onSetValue:function(t){return hb.run(t).get(function(){})},inputBehaviours:hu([dp.config({disabled:e.providers.isReadOnly}),jp(),Nv.config({}),hb.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return Xr(t.element())},notify:{onValid:function(t){var e=zc.getValue(t);xr(t,Bb,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=zc.getValue(t);if(0===e.length)return ob(it.value(!0));var n=Ke.fromTag("span");di(n,"background-color",e);var r=vi(n,"background-color").fold(function(){return it.error("blah")},function(t){return it.value(e)});return ob(r)}}})]),selectOnFocus:!1}),o=t.label.map(function(t){return Iv(t,e.providers)}),i=function(t,e){xr(t,Ib,{value:e})},a=Xm(function(t,e){return Nb.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:hu([zp(e.providers.isReadOnly),jp(),Rb.config({}),Nv.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return rb(function(e){return t.fetch(e)}).map(function(r){return y.from(iv(Dt(Xg(Co("menu-value"),r,function(e){t.onItemAction(n,e)},t.columns,t.presets,xh.CLOSE_ON_EXECUTE,function(){return!1},e.providers),{movement:Qg(t.columns,t.presets)})))})},parts:{menu:Rh(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[Qa,Ja,nu]},onLtr:function(){return[Ja,Qa,nu]}},components:[],fetch:qg(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){a.getOpt(t).each(function(t){"custom"===e?n.colorPicker(function(e){e.fold(function(){return yr(t,Pb)},function(e){i(t,e),Vg(e)})},"#ffffff"):i(t,"remove"===e?"":e)})}},e));return Ov.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,a.asSpec()]}]),fieldBehaviours:hu([Jd("form-field-events",[Dr(Bb,function(e,n){a.getOpt(e).each(function(t){di(t.element(),"background-color",n.event().color())}),xr(e,Pv,{name:t.name})}),Dr(Ib,function(t,e){Ov.getField(t).each(function(n){zc.setValue(n,e.event().value()),Kl.getCurrent(t).each(nm.focus)})}),Dr(Pb,function(t,e){Ov.getField(t).each(function(e){Kl.getCurrent(t).each(nm.focus)})})])])})}(t,e.shared,e.colorinput)}),colorpicker:XC(function(t){var n=function(t){return"tox-"+t},r=Ex(Ix,n),o=Xm(r.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){xr(t,Fv,{name:"hex-valid",value:!0})},onInvalidHex:function(t){xr(t,Fv,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[o.asSpec()],behaviours:hu([zc.config({store:{mode:"manual",getValue:function(t){var e=o.get(t);return Kl.getCurrent(e).bind(function(t){return zc.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,n){var r=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n),i=o.get(t);Kl.getCurrent(i).fold(function(){e.console.log("Can not find form")},function(t){zc.setValue(t,{hex:y.from(r[1]).getOr("")}),_x.getField(t,"hex").each(function(t){yr(t,zn())})})}}}),Nx()])}}),dropzone:XC(function(t,e){return function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){j(t,function(t){t(e,n)})}},o=function(t,e){if(!dp.isDisabled(t)){var n=e.event().raw();a(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event().raw().target.files;a(t,n)},a=function(e,n){zc.setValue(e,function(t){var e=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i");return z(et(t),function(t){return e.test(t.name)})}(n)),xr(e,Pv,{name:t.name})},u=Xm({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:hu([Jd("input-file-events",[Br(Wn()),Br(tr())])])}),s=t.label.map(function(t){return Iv(t,e)}),c=Ov.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:hu([Vx([]),Nx(),dp.config({}),hm.config({toggleClass:"dragenter",toggleOnExecute:!1}),Jd("dropzone-events",[Dr("dragenter",r([n,hm.toggle])),Dr("dragleave",r([n,hm.toggle])),Dr("dragover",n),Dr("drop",r([n,o])),Dr(Un(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},Km.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[u.asSpec()],action:function(t){u.get(t).element().dom().click()},buttonBehaviours:hu([Nv.config({}),zp(e.isReadOnly),jp()])})]}]}}}});return Av(s,c,["tox-form__group--stretched"],[])}(t,e.shared.providers)}),grid:XC(function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:H(t.items,e.interpreter)}}(t,e.shared)}),selectbox:XC(function(t,e){return function(t,e){var n=H(t.items,function(t){return{text:e.translate(t.text),value:t.value}}),r=t.label.map(function(t){return Iv(t,e)}),o=Ov.parts().field({dom:{},selectAttributes:{size:t.size},options:n,factory:SC,selectBehaviours:hu([dp.config({disabled:function(){return t.disabled||e.isReadOnly()}}),Nv.config({}),Jd("selectbox-change",[Dr(Un(),function(e,n){xr(e,Pv,{name:t.name})})])])}),i=t.size>1?y.none():y.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:Qm("chevron-down",e.icons)}}),a={dom:{tag:"div",classes:["tox-selectfield"]},components:Y([[o],i.toArray()])};return Ov.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Y([r.toArray(),[a]]),fieldBehaviours:hu([dp.config({disabled:function(){return t.disabled||e.isReadOnly()},onDisabled:function(t){Ov.getField(t).each(dp.disable)},onEnabled:function(t){Ov.getField(t).each(dp.enable)}}),jp()])})}(t,e.shared.providers)}),sizeinput:XC(function(t,e){return oC(t,e.shared.providers)}),urlinput:XC(function(t,e){return function(t,e,r){var o,i=e.shared.providers,a=function(e){var n=zc.getValue(e);r.addToHistory(n.value,t.filetype)},u=Ov.parts().field({factory:FC,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":KC,type:"url"},minChars:0,responseTime:0,fetch:function(n){var o=function(t,e,n){var r=zc.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold(function(){return[]},function(e){var r,i=GC(o,function(t){return H(t,function(t){return zC(t,t)})}(n.getHistory(t)));return"file"===t?(r=[i,GC(o,WC(e)),GC(o,Y([$C(e),qC(e),YC(e)]))],W(r,function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(jC,e)},[])):i})}(t.filetype,n,r),i=jw(o,xh.BUBBLE_TO_SANDBOX,e,!1);return ob(i)},getHotspot:function(t){return h.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(hb)&&hb.run(t).get(n)},typeaheadBehaviours:hu(Y([r.getValidationHandler().map(function(e){return hb.config({getRoot:function(t){return Xr(t.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){c.getOpt(t).each(function(t){fo(t.element(),"title",i.translate(e))})}},validator:{validate:function(n){var r=zc.getValue(n);return HC(function(n){e({type:t.filetype,url:r.value},function(t){if("invalid"===t.status){var e=it.error(t.message);n(e)}else{var r=it.value(t.message);n(r)}})})},validateOnLoad:!1}})}).toArray(),[dp.config({disabled:function(){return t.disabled||i.isReadOnly()}}),Nv.config({}),Jd("urlinput-events",Y(["file"===t.filetype?[Dr(zn(),function(e){xr(e,Pv,{name:t.name})})]:[],[Dr(Un(),function(e){xr(e,Pv,{name:t.name}),a(e)}),Dr(Xn(),function(e){xr(e,Pv,{name:t.name}),a(e)})]]))]])),eventOrder:(o={},o[zn()]=["streaming","urlinput-events","invalidating"],o),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:Rh(0,0,"normal")},onExecute:function(t,e,n){xr(e,Hv,{})},onItemExecute:function(e,n,r,o){a(e),xr(e,Pv,{name:t.name})}}),s=t.label.map(function(t){return Iv(t,i)}),c=Xm(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],innerHtml:Qm(n,i.icons),attributes:d({title:i.translate(r),"aria-live":"polite"},e.fold(function(){return{}},function(t){return{id:t}}))}}}("invalid",y.some(KC),"warning")),l=Xm({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),f=r.getUrlPicker(t.filetype),m=Co("browser.url.event"),h=Xm({dom:{tag:"div",classes:["tox-control-wrap"]},components:[u,l.asSpec()],behaviours:hu([dp.config({disabled:function(){return t.disabled||i.isReadOnly()}})])}),p=Xm(Gw({name:t.name,icon:y.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},function(t){return yr(t,m)},i,[],["tox-browse-url"]));return Ov.sketch({dom:Bv([]),components:s.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Y([[h.asSpec()],f.map(function(){return p.asSpec()}).toArray()])}]),fieldBehaviours:hu([dp.config({disabled:function(){return t.disabled||i.isReadOnly()},onDisabled:function(t){Ov.getField(t).each(dp.disable),p.getOpt(t).each(dp.disable)},onEnabled:function(t){Ov.getField(t).each(dp.enable),p.getOpt(t).each(dp.enable)}}),jp(),Jd("url-input-events",[Dr(m,function(e){Kl.getCurrent(e).each(function(n){var r=zc.getValue(n),o=d({fieldname:t.name},r);f.each(function(r){r(o).get(function(r){zc.setValue(n,r),xr(e,Pv,{name:t.name})})})})})])])})}(t,e,e.urlinput)}),customeditor:XC(function(t){var e=Ye(y.none()),n=Xm({dom:{tag:t.tag}}),r=Ye(y.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:hu([Jd("editor-foo-events",[Mr(function(o){n.getOpt(o).each(function(n){(!function(t){return Object.prototype.hasOwnProperty.call(t,"init")}(t)?Px.load(t.scriptId,t.scriptUrl).then(function(e){return e(n.element().dom(),t.settings)}):t.init(n.element().dom())).then(function(t){r.get().each(function(e){t.setValue(e)}),r.set(y.none()),e.set(y.some(t))})})})]),zc.config({store:{mode:"manual",getValue:function(){return e.get().fold(function(){return r.get().getOr("")},function(t){return t.getValue()})},setValue:function(t,n){e.get().fold(function(){r.set(y.some(n))},function(t){return t.setValue(n)})}}}),Nx()]),components:[n.asSpec()]}}),htmlpanel:XC(function(t){return"presentation"===t.presets?_v.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):_v.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:hu([Nv.config({}),nm.config({})])})}),imagetools:XC(function(t,e){return kC(t,e.shared.providers)}),table:XC(function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:H(r,function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}})}]}),(n=t.cells,{dom:{tag:"tbody"},components:H(n,function(t){return{dom:{tag:"tr"},components:H(t,o)}})})],behaviours:hu([Nv.config({}),nm.config({})])}}(t,e.shared.providers)}),panel:XC(function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:H(t.items,e.shared.interpreter)}}(t,e)})},QC={field:function(t,e){return e}},ZC=function(t,e,n){var r=Dt(n,{shared:{interpreter:function(e){return t_(t,e,r)}}});return t_(t,e,r)},t_=function(t,n,r){return Ct(JC,n.type).fold(function(){return e.console.error('Unknown factory type "'+n.type+'", defaulting to container: ',n),n},function(e){return e(t,n,r)})},e_={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},n_=function(t,e,n){var r=Gu(-12,12,e_),o={maxHeightFunction:Wu()};return function(){return n()?{anchor:"node",root:ci($r(t())),node:y.from(t()),bubble:r,layouts:{onRtl:function(){return[qm]},onLtr:function(){return[Wm]}},overrides:o}:{anchor:"hotspot",hotspot:e(),bubble:r,layouts:{onRtl:function(){return[Ja]},onLtr:function(){return[Qa]}},overrides:o}}},r_=function(t,e,n){return function(){return n()?{anchor:"node",root:ci($r(t())),node:y.from(t()),layouts:{onRtl:function(){return[$m]},onLtr:function(){return[$m]}}}:{anchor:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[nu]},onLtr:function(){return[nu]}}}}},o_=function(t,e){return function(){return{anchor:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return y.some(ss.range(Ke.fromDom(e.startContainer),e.startOffset,Ke.fromDom(e.endContainer),e.endOffset))}}}},i_=function(t){return function(e){return{anchor:"node",root:t(),node:e}}},a_=function(t,e,n){var r=Np(t),o=function(){return Ke.fromDom(t.getBody())},i=function(){return Ke.fromDom(t.getContentAreaContainer())},a=function(){return r||!n()};return{inlineDialog:n_(i,e,a),banner:r_(i,e,a),cursor:o_(t,o),node:i_(o)}},u_=function(t){return function(e,n){Kg(t)(e,n)}},s_=function(t){return function(){return Hg(t)}},c_=function(t){return function(){return jg(t)}},l_=function(t){return function(){return zg(t)}},f_=function(t){return{colorPicker:u_(t),hasCustomColors:s_(t),getColors:c_(t),getColorCols:l_(t)}},d_=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},m_=function(t){return{isDraggableModal:d_(t)}},h_=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],p_=function(t){return function(t){return y.from(t.getParam("style_formats")).filter(k)}(t).map(function(e){var n=function(t,e){var n=function t(e){return W(e,function(e,n){if(_t(n,"items")){var r=t(n.items);return{customFormats:e.customFormats.concat(r.customFormats),formats:e.formats.concat([{title:n.title,items:r.formats}])}}if(_t(n,"inline")||_t(n,"block")||_t(n,"selector")){var o="custom-"+n.title.toLowerCase();return{customFormats:e.customFormats.concat([{name:o,format:n}]),formats:e.formats.concat([{title:n.title,format:o,icon:n.icon}])}}return d(d({},e),{formats:e.formats.concat(n)})},{customFormats:[],formats:[]})}(e),r=function(e){j(e,function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)})};return t.formatter?r(n.customFormats):t.on("init",function(){r(n.customFormats)}),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?h_.concat(n):n}).getOr(h_)},g_=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return Dt(t,r)},v_=function(t,e,n,r){return function e(o){return H(o,function(o){var i=ht(o);if(kt(o,"items")){var a=e(o.items);return Dt(Dt(o,{type:"submenu"}),{getStyleItems:function(){return a}})}return kt(o,"format")?g_(o,n,r):1===i.length&&P(i,"title")?Dt(o,{type:"separator"}):function(e){var o=Co(e.title),i={type:"formatter",format:o,isSelected:n(o),getStylePreview:r(o)},a=Dt(e,i);return t.formatter.register(o,a),a}(o)})}(e)},b_=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?y.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):y.none()}},r=function t(e){var n=e.items;return void 0!==n&&n.length>0?G(n,t):[e.format]},o=Ye([]),i=Ye([]),a=Ye([]),u=Ye([]),s=Ye(!1);return t.on("PreInit",function(a){var u=p_(t),s=v_(t,u,e,n);o.set(s),i.set(G(s,r))}),t.on("addStyleModifications",function(o){var i=v_(t,o.items,e,n);a.set(i),s.set(o.replace),u.set(G(i,r))}),{getData:function(){var t=s.get()?[]:o.get(),e=a.get();return t.concat(e)},getFlattenedKeys:function(){var t=s.get()?[]:i.get(),e=u.get();return t.concat(e)}}},y_=hC.trim,x_=function(t){return function(e){if(e&&1===e.nodeType){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},w_=x_("true"),C_=x_("false"),__=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},k_=function(t){return t.innerText||t.textContent},S_=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&O_(t)},T_=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},O_=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return w_(t)}return!1}(t)&&!C_(t)},D_=function(t){return T_(t)&&O_(t)},E_=function(t){var e=function(t){return t.id?t.id:Co("h")}(t);return __("header",k_(t),"#"+e,function(t){return T_(t)?parseInt(t.nodeName.substr(1),10):0}(t),function(){t.id=e})},N_=function(t){var e=t.id||t.name,r=k_(t);return __("anchor",r||"#"+e,"#"+e,0,n)},A_=function(t){return y_(t.title).length>0},R_=function(t){var e=function(t){var e;return e=t,H(ys(Ke.fromDom(e),"h1,h2,h3,h4,h5,h6,a:not([href])"),function(t){return t.dom()})}(t);return z(H(z(e,D_),E_).concat(H(z(e,S_),N_)),A_)},B_="tinymce-url-history",I_=function(t){return C(t)&&/^https?/.test(t)},P_=function(t){return _(t)&&xt(t,function(t){return!(k(e=t)&&e.length<=5&&K(e,I_));var e}).isNone()},M_=function(){var t,n=Pg.getItem(B_);if(null===n)return{};try{t=JSON.parse(n)}catch(t){if(t instanceof SyntaxError)return e.console.log("Local storage "+B_+" was not valid JSON",t),{};throw t}return P_(t)?t:(e.console.log("Local storage "+B_+" was not valid format",t),{})},L_=function(t){var e=M_();return Object.prototype.hasOwnProperty.call(e,t)?e[t]:[]},F_=function(t,e){if(I_(t)){var n=M_(),r=Object.prototype.hasOwnProperty.call(n,e)?n[e]:[],o=z(r,function(e){return e!==t});n[e]=[t].concat(o).slice(0,5),function(t){if(!P_(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));Pg.setItem(B_,JSON.stringify(t))}(n)}},H_=function(t){return!!t},j_=function(t){return vt(hC.makeMap(t,/[, ]/),H_)},V_=function(t){return y.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(D)},z_=function(t){return{getHistory:L_,addToHistory:F_,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?y.none():y.some({targets:R_(t.getBody()),anchorTop:Pp(t),anchorBottom:Mp(t)})}(t)},getValidationHandler:function(){return function(t){return y.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return function(t,e){var n=function(t){var e=y.some(function(t){return t.getParam("file_picker_types")}(t)).filter(H_),n=y.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(H_),r=e.or(n).map(j_);return V_(t).fold(function(){return!1},function(t){return r.fold(function(){return!0},function(t){return ht(t).length>0&&t})})}(t);return S(n)?n?V_(t):y.none():n[e]?V_(t):y.none()}(t,e).map(function(n){return function(r){return rb(function(o){var i=d({filetype:e,fieldname:r.fieldname},y.from(r.meta).getOr({}));n.call(t,function(t,e){if(!C(t))throw new Error("Expected value to be string");if(void 0!==e&&!_(e))throw new Error("Expected meta to be a object");o({value:t,meta:e})},r.value,i)})}})}(t,e)}}},U_=o(function(t,e){!function(t,e){var n=Vi.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);di(t,"max-width",n+"px")}(t,Math.floor(e))}),W_=o([_e("items"),Sa(["itemSelector"]),Uc("tgroupBehaviours",[qd])]),q_=o([bl({name:"items",unit:"item"})]),$_=Wl({name:"ToolbarGroup",configFields:W_(),partFields:q_(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:qc(t.tgroupBehaviours,[qd.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),Y_=o([_e("dom"),Fe("shell",!0),Uc("toolbarBehaviours",[Xd])]),G_=o([vl({name:"groups",overrides:function(){return{behaviours:hu([Xd.config({})])}}})]),K_=Wl({name:"Toolbar",configFields:Y_(),partFields:G_(),factory:function(t,n,r,o){var i=function(e){return t.shell?y.some(e):El(e,t,"groups")},a=t.shell?{behaviours:[Xd.config({})],components:[]}:{behaviours:[],components:n};return{uid:t.uid,dom:t.dom,components:a.components,behaviours:qc(t.toolbarBehaviours,a.behaviours),apis:{setGroups:function(t,n){i(t).fold(function(){throw e.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(t){Xd.set(t,n)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),X_=function(t,e,n){return{within:o(t),extra:o(e),withinWidth:o(n)}},J_=function(t,e,n){var r,i=(r=function(t,e){var r=n(t);return y.some({element:o(t),start:o(e),finish:o(e+r),width:o(r)})},W(t,function(t,e){return r(e,t.len).fold(o(t),function(e){return{len:e.finish(),list:t.list.concat([e])}})},{len:0,list:[]}).list),a=z(i,function(t){return t.finish()<=e}),u=U(a,function(t,e){return t+e.width()},0),s=i.slice(a.length);return{within:o(a),extra:o(s),withinWidth:o(u)}},Q_=function(t){return H(t,function(t){return t.element()})},Z_=function(t,e){var n=H(e,function(t){return Ri(t)});K_.setGroups(t,n)},tk=function(t,e,n){var r=Nl(t,e,"primary"),o=vb.getCoupled(t,"overflowGroup");di(r.element(),"visibility","hidden");var i=e.builtGroups.get().concat([o]),a=nt(i,function(t){return Tu(t.element()).bind(function(e){return t.getSystem().getByDom(e).toOption()})});n([]),Z_(r,i);var u=function(t,e,n,r){var o=function(t,e,n){var r=J_(e,t,n);return 0===r.extra().length?y.some(r):y.none()}(t,e,n).getOrThunk(function(){return J_(e,t-n(r),n)}),i=o.within(),a=o.extra(),u=o.withinWidth();return 1===a.length&&a[0].width()<=n(r)?function(t,e,n){var r=Q_(i.concat(e));return X_(r,[],n)}(0,a,u):a.length>=1?function(t,e,n,r){var o=Q_(i).concat([n]);return X_(o,Q_(e),r)}(0,a,r,u):function(t,e,n){return X_(Q_(i),[],n)}(0,0,u)}(zi(r.element()),e.builtGroups.get(),function(t){return zi(t.element())},o);0===u.extra().length?(Xd.remove(r,o),n([])):(Z_(r,u.within()),n(u.extra())),xi(r.element(),"visibility"),wi(r.element()),a.each(nm.focus)},ek=o([Uc("splitToolbarBehaviours",[vb]),$e("builtGroups",function(){return Ye([])})]),nk=o([Sa(["overflowToggledClass"]),Me("getOverflowBounds"),_e("lazySink"),$e("overflowGroups",function(){return Ye([])})].concat(ek())),rk=o([pl({factory:K_,schema:Y_(),name:"primary"}),gl({schema:Y_(),name:"overflow"}),gl({name:"overflow-button"}),gl({name:"overflow-group"})]),ok=o([Sa(["toggledClass"]),_e("lazySink"),De("fetch"),Me("getBounds"),Le("fireDismissalEventInstead",[Fe("event",fr())]),ts()]),ik=o([gl({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:hu([hm.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),gl({factory:K_,schema:Y_(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:hu([qd.config({mode:"cyclic",onEscape:function(e){return El(e,t,"button").each(nm.focus),y.none()}})])}}})]),ak=function(t,e){var n=vb.getCoupled(t,"toolbarSandbox");Cc.isOpen(n)?Cc.close(n):Cc.open(n,e.toolbar())},uk=function(t,e,n,r){var o=n.getBounds.map(function(t){return t()}),i=n.lazySink(t).getOrDie();tc.positionWithinBounds(i,{anchor:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:U_()}},e,o)},sk=function(t,e,n,r,o){K_.setGroups(e,o),uk(t,e,n,r),hm.on(t)},ck=Wl({name:"FloatingToolbarButton",factory:function(t,e,n,r){return d(d({},Km.sketch(d(d({},r.button()),{action:function(t){ak(t,r)},buttonBehaviours:Yc({dump:r.button().buttonBehaviours},[vb.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=fa();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:hu([qd.config({mode:"special",onEscape:function(t){return Cc.close(t),y.some(!0)}}),Cc.config({onOpen:function(o,i){n.fetch().get(function(o){sk(t,i,n,e.layouts,o),r.link(t.element()),qd.focusIn(i)})},onClose:function(){hm.off(t),nm.focus(t),r.unlink(t.element())},isPartOf:function(e,n,r){return ma(n,r)||ma(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),Cu.config({channels:d(d({},Oc(d({isExtraPart:c},n.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Ec({doReposition:function(){Cc.getState(vb.getCoupled(t,"toolbarSandbox")).each(function(r){uk(t,r,n,e.layouts)})}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){Cc.getState(vb.getCoupled(e,"toolbarSandbox")).each(function(o){sk(e,o,t,n.layouts,r)})},reposition:function(e){Cc.getState(vb.getCoupled(e,"toolbarSandbox")).each(function(r){uk(e,r,t,n.layouts)})},toggle:function(t){ak(t,r)},getToolbar:function(t){return Cc.getState(vb.getCoupled(t,"toolbarSandbox"))}}})},configFields:ok(),partFields:ik(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)}}}),lk=function(t){return H(t,function(t){return Ri(t)})},fk=function(t,e,n){tk(t,n,function(r){n.overflowGroups.set(r),e.getOpt(t).each(function(t){ck.setGroups(t,lk(r))})})},dk=Wl({name:"SplitFloatingToolbar",configFields:nk(),partFields:rk(),factory:function(t,e,n,r){var o=Xm(ck.sketch({fetch:function(){return rb(function(e){e(lk(t.overflowGroups.get()))})},layouts:{onLtr:function(){return[Qa,Ja]},onRtl:function(){return[Ja,Qa]},onBottomLtr:function(){return[tu,Za]},onBottomRtl:function(){return[Za,tu]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:qc(t.splitToolbarBehaviours,[vb.config({others:{overflowGroup:function(){return $_.sketch(d(d({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(H(n,e.getSystem().build)),fk(e,o,t)},refresh:function(e){return fk(e,o,t)},toggle:function(t){o.getOpt(t).each(function(t){ck.toggle(t)})},reposition:function(t){o.getOpt(t).each(function(t){ck.reposition(t)})},getOverflow:function(t){return o.getOpt(t).bind(function(t){return ck.getToolbar(t)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),mk=function(t,e){return e.getAnimationRoot.fold(function(){return t.element()},function(e){return e(t)})},hk=function(t){return t.dimension.property},pk=function(t,e){return t.dimension.getDimension(e)},gk=function(t,e){var n=mk(t,e);ti(n,[e.shrinkingClass,e.growingClass])},vk=function(t,e){Jo(t.element(),e.openClass),Xo(t.element(),e.closedClass),di(t.element(),hk(e),"0px"),wi(t.element())},bk=function(t,e){Jo(t.element(),e.closedClass),Xo(t.element(),e.openClass),xi(t.element(),hk(e))},yk=function(t,e,n,r){n.setCollapsed(),di(t.element(),hk(e),pk(e,t.element())),wi(t.element()),gk(t,e),vk(t,e),e.onStartShrink(t),e.onShrunk(t)},xk=function(t,e,n){var r=pk(e,t.element());("0px"===r?yk:function(t,e,n,r){var o=r.getOrThunk(function(){return pk(e,t.element())});n.setCollapsed(),di(t.element(),hk(e),o),wi(t.element());var i=mk(t,e);Jo(i,e.growingClass),Xo(i,e.shrinkingClass),vk(t,e),e.onStartShrink(t)})(t,e,n,y.some(r))},wk=function(t,e,n){var r=mk(t,e),o=Qo(r,e.shrinkingClass),i=pk(e,t.element());bk(t,e);var a=pk(e,t.element());(o?function(){di(t.element(),hk(e),i),wi(t.element())}:function(){vk(t,e)})(),Jo(r,e.shrinkingClass),Xo(r,e.growingClass),bk(t,e),di(t.element(),hk(e),a),n.setExpanded(),e.onStartGrow(t)},Ck=function(t,e,n){var r=mk(t,e);return!0===Qo(r,e.growingClass)},_k=function(t,e,n){var r=mk(t,e);return!0===Qo(r,e.shrinkingClass)},kk=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){xi(t.element(),hk(e));var r=pk(e,t.element());di(t.element(),hk(e),r)}},grow:function(t,e,n){n.isExpanded()||wk(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&xk(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&yk(t,e,n,y.none())},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:Ck,isShrinking:_k,isTransitioning:function(t,e,n){return!0===Ck(t,e)||!0===_k(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?xk:wk)(t,e,n)},disableTransitions:gk}),Sk=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return Vo(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:jt(e.dimension.property,"0px")})},events:function(t,e){return Sr([Pr(qn(),function(n,r){r.event().raw().propertyName===t.dimension.property&&(gk(n,t),e.isExpanded()&&xi(n.element(),t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))})])}}),Tk=[_e("closedClass"),_e("openClass"),_e("shrinkingClass"),_e("growingClass"),Re("getAnimationRoot"),Oa("onShrunk"),Oa("onStartShrink"),Oa("onGrown"),Oa("onStartGrow"),Fe("expanded",!1),ke("dimension",he("property",{width:[Aa("property","width"),Aa("getDimension",function(t){return zi(t)+"px"})],height:[Aa("property","height"),Aa("getDimension",function(t){return Pi(t)+"px"})]}))],Ok=gu({fields:Tk,name:"sliding",active:Sk,apis:kk,state:Object.freeze({__proto__:null,init:function(t){var e=Ye(t.expanded);return Ho({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:a(e.set,!1),setExpanded:a(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),Dk=o([Sa(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Oa("onOpened"),Oa("onClosed")].concat(ek())),Ek=o([pl({factory:K_,schema:Y_(),name:"primary"}),pl({factory:K_,schema:Y_(),name:"overflow",overrides:function(t){return{toolbarBehaviours:hu([Ok.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){El(e,t,"overflow-button").each(function(t){hm.off(t),nm.focus(t)}),t.onClosed(e)},onGrown:function(e){qd.focusIn(e),t.onOpened(e)},onStartGrow:function(e){El(e,t,"overflow-button").each(hm.on)}}),qd.config({mode:"acyclic",onEscape:function(e){return El(e,t,"overflow-button").each(nm.focus),y.some(!0)}})])}}}),gl({name:"overflow-button",overrides:function(t){return{buttonBehaviours:hu([hm.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),gl({name:"overflow-group"})]),Nk=function(t,e){El(t,e,"overflow").each(function(n){tk(t,e,function(t){var e=H(t,function(t){return Ri(t)});K_.setGroups(n,e)}),El(t,e,"overflow-button").each(function(t){Ok.hasGrown(n)&&hm.on(t)}),Ok.refresh(n)})},Ak=Wl({name:"SplitSlidingToolbar",configFields:Dk(),partFields:Ek(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:qc(t.splitToolbarBehaviours,[vb.config({others:{overflowGroup:function(t){return $_.sketch(d(d({},r["overflow-group"]()),{items:[Km.sketch(d(d({},r["overflow-button"]()),{action:function(e){yr(t,"alloy.toolbar.toggle")}}))]}))}}}),Jd("toolbar-toggle-events",[Dr("alloy.toolbar.toggle",function(e){El(e,t,"overflow").each(function(n){Nk(e,t),Ok.toggleGrow(n)})})])]),apis:{setGroups:function(e,n){!function(e,n){var r=H(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),Nk(e,t)},refresh:function(e){return Nk(e,t)},toggle:function(e){return function(t,e){El(t,e,"overflow").each(function(n){Nk(t,e),Ok.toggleGrow(n)})}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)}}}),Rk=o(Co("toolbar-height-change")),Bk=function(t){var e=t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}});return{dom:d({tag:"div",classes:["tox-toolbar__group"]},e),components:[$_.parts().items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:hu([Nv.config({}),nm.config({})])}},Ik=function(t){return $_.sketch(Bk(t))},Pk=function(t,e){var n=Mr(function(e){var n=H(t.initGroups,Ik);K_.setGroups(e,n)});return hu([Wp(t.providers.isReadOnly),jp(),qd.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Jd("toolbar-events",[n])])},Mk=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":Bk({title:y.none(),items:[]}),"overflow-button":qw({name:"more",icon:y.some("more-drawer"),disabled:!1,tooltip:y.some("More..."),primary:!1,borderless:!1},y.none(),t.providers)},splitToolbarBehaviours:Pk(t,e)}},Lk=function(t){var e=Mk(t),n=dk.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return dk.sketch(d(d({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element(),n=ea(e),r=Gr(e),o=ea(r),i=Math.max(r.dom().scrollHeight,o.height);return Zi(n.x+4,o.y,n.width-8,i)},parts:d(d({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},Fk=function(t){var e=Ak.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=Ak.parts().overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=Mk(t);return Ak.sketch(d(d({},r),{components:[e,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([Rk()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([Rk()],{type:"closed"})}}))},Hk=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return K_.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===yh.scrolling?["tox-toolbar--scrolling"]:[])},components:[K_.parts().groups({})],toolbarBehaviours:Pk(t,e)})},jk=[Ue("disabled",!1),Pe("tooltip"),Pe("icon"),Pe("text"),We("onSetup",function(){return n})],Vk=Qt([Te("type"),De("onAction")].concat(jk)),zk=function(t){return ce("toolbarbutton",Vk,t)},Uk=[Pe("text"),Pe("tooltip"),Pe("icon"),De("fetch"),We("onSetup",function(){return n})],Wk=Qt(h([Te("type")],Uk)),qk=function(t){return ce("menubutton",Wk,t)},$k=Qt([Te("type"),Pe("tooltip"),Pe("icon"),Pe("text"),Me("select"),De("fetch"),We("onSetup",function(){return n}),ze("presets","normal",["normal","color","listpreview"]),Fe("columns",1),De("onAction"),De("onItemAction")]),Yk=[Ue("active",!1)].concat(jk),Gk=Qt(Yk.concat([Te("type"),De("onAction")])),Kk=function(t){return ce("ToggleButton",Gk,t)},Xk=Qt([Te("type"),ke("items",(bC=[ae([Te("name"),Ae("items",be)]),be],{extract:function(t,e,n){for(var r=[],o=0,i=bC;o<i.length;o++){var a=i[o].extract(t,e,n);if(a.stype===p.Value)return a;r.push(a)}return Ut(r)},toString:function(){return"oneOf("+H(bC,function(t){return t.toString()}).join(", ")+")"}}))].concat(jk)),Jk=[We("predicate",function(){return!1}),ze("scope","node",["node","editor"]),ze("position","selection",["node","selection","line"])],Qk=jk.concat([Fe("type","contextformbutton"),Fe("primary",!1),De("onAction"),$e("original",i)]),Zk=Yk.concat([Fe("type","contextformbutton"),Fe("primary",!1),De("onAction"),$e("original",i)]),tS=jk.concat([Fe("type","contextformbutton")]),eS=Yk.concat([Fe("type","contextformtogglebutton")]),nS=he("type",{contextformbutton:Qk,contextformtogglebutton:Zk}),rS=Qt([Fe("type","contextform"),We("initValue",function(){return""}),Pe("label"),Ae("commands",nS),Be("launch",he("type",{contextformbutton:tS,contextformtogglebutton:eS}))].concat(Jk)),oS=Qt([Fe("type","contexttoolbar"),Te("items")].concat(Jk)),iS=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),aS=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each(function(t){var o=t(n,r);e.set(o)}),t.renderComponents.each(function(t){var o=t(r,e.get()),i=H(o,n.getSystem().build);oc(n,i)})};return Sr([Dr(Jn(),function(e,r){var o=r,i=t.channel;P(o.channels(),i)&&n(e,o.data())}),Mr(function(e,r){t.initialData.each(function(t){n(e,t)})})])}}),uS=Object.freeze({__proto__:null,init:function(){var t=Ye(y.none());return{readState:function(){return t.get().fold(function(){return"none"},function(t){return t})},get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(y.none())}}}}),sS=[_e("channel"),Re("renderComponents"),Re("updateState"),Re("initialData")],cS=gu({fields:sS,name:"reflecting",active:aS,apis:iS,state:uS}),lS=o([_e("toggleClass"),_e("fetch"),Ea("onExecute"),Fe("getHotspot",y.some),Fe("getAnchorOverrides",o({})),ts(),Ea("onItemExecute"),Re("lazySink"),_e("dom"),Oa("onOpen"),Uc("splitDropdownBehaviours",[vb,qd,nm]),Fe("matchWidth",!1),Fe("useMinWidth",!1),Fe("eventOrder",{}),Re("role")].concat(Ob())),fS=pl({factory:Km,schema:[_e("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:hu([nm.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(wr)},buttonBehaviours:hu([hm.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),dS=pl({factory:Km,schema:[_e("dom")],name:"button",defaults:function(){return{buttonBehaviours:hu([nm.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(function(n){t.onExecute(n,e)})}}}}),mS=o([fS,dS,vl({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[_e("text")],name:"aria-descriptor"}),gl({schema:[ka()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each(function(r){t.onItemExecute(r,e,n)})}}}}),yb()]),hS=Wl({name:"SplitDropdown",configFields:lS(),partFields:mS(),factory:function(t,e,r,o){var i=function(t){Kl.getCurrent(t).each(function(t){af.highlightFirst(t),qd.focusIn(t)})},a=function(e){Cb(t,function(t){return t},e,o,i,Jv.HighlightFirst).get(n)},u=function(e){var n=Nl(e,t,"button");return wr(n),y.some(!0)},s=d(d({},Sr([Mr(function(e,n){El(e,t,"aria-descriptor").each(function(t){var n=Co("aria");fo(t.element(),"id",n),fo(e.element(),"aria-describedby",n)})})])),gm(y.some(a))),c={repositionMenus:function(t){hm.isOn(t)&&Tb(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:c,eventOrder:d(d({},t.eventOrder),{"alloy.execute":["disabling","toggling","alloy.base.behaviour"]}),events:s,behaviours:qc(t.splitDropdownBehaviours,[vb.config({others:{sandbox:function(e){var n=Nl(e,t,"arrow");return Sb(t,e,{onOpen:function(){hm.on(n),hm.on(e)},onClose:function(){hm.off(n),hm.off(e)}})}}}),qd.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return a(t),y.some(!0)}}),nm.config({}),hm.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),pS=function(t){return{isDisabled:function(){return dp.isDisabled(t)},setDisabled:function(e){return dp.set(t,e)}}},gS=function(t){return{setActive:function(e){hm.set(t,e)},isActive:function(){return hm.isOn(t)},isDisabled:function(){return dp.isDisabled(t)},setDisabled:function(e){return dp.set(t,e)}}},vS=function(t,e){return t.map(function(t){return{"aria-label":e.translate(t),title:e.translate(t)}}).getOr({})},bS=Co("focus-button"),yS=["checklist","ordered-list"],xS=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],wS=function(t,e,n,r,o,i){var a,u=function(t){return np.isRtl()&&P(yS,t)?t+"-rtl":t},s=np.isRtl()&&t.exists(function(t){return P(xS,t)});return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(s?["tox-tbtn__icon-rtl"]:[]),attributes:vS(n,i)},components:Xp([t.map(function(t){return Dw(u(t),i.icons)}),e.map(function(t){return Nw(t,"tox-tbtn",i)})]),eventOrder:(a={},a[Bn()]=["focusing","alloy.base.behaviour","common-button-display-events"],a),buttonBehaviours:hu([Wp(i.isReadOnly),jp(),Jd("common-button-display-events",[Dr(Bn(),function(t,e){e.event().prevent(),yr(t,bS)})])].concat(r.map(function(n){return cS.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return Xp([t.icon.map(function(t){return Dw(u(t),i.icons)}),t.text.map(function(t){return Nw(t,"tox-tbtn",i)})])}})}).toArray()).concat(o.getOr([])))}},CS=function(t,e,r){var o,i=Ye(n),a=wS(t.icon,t.text,t.tooltip,y.none(),y.none(),r);return Km.sketch({dom:a.dom,components:a.components,eventOrder:Rw,buttonBehaviours:hu([Jd("toolbar-button-events",[(o={onAction:t.onAction,getApi:e.getApi},Hr(function(t,e){qp(o,t)(function(e){xr(t,Aw,{buttonApi:e}),o.onAction(e)})})),$p(e,i),Yp(e,i)]),Wp(function(){return t.disabled||r.isReadOnly()}),jp()].concat(e.toolbarButtonBehaviours))})},_S=function(t,e,n){return CS(t,{toolbarButtonBehaviours:[].concat(n.length>0?[Jd("toolbarButtonWith",n)]:[]),getApi:pS,onSetup:t.onSetup},e)},kS=function(t,e,n){return Dt(CS(t,{toolbarButtonBehaviours:[Xd.config({}),hm.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[Jd("toolbarToggleButtonWith",n)]:[]),getApi:gS,onSetup:t.onSetup},e))},SS=function(t,e,n){return function(r){return rb(function(t){return e.fetch(t)}).map(function(o){return y.from(iv(Dt(Xg(Co("menu-value"),o,function(n){e.onItemAction(t(r),n)},e.columns,e.presets,xh.CLOSE_ON_EXECUTE,e.select.getOr(function(){return!1}),n),{movement:Qg(e.columns,e.presets),menuBehaviours:$h("auto"!==e.columns?[]:[Mr(function(t,n){qh(t,4,Th(e.presets)).each(function(e){var n=e.numRows,r=e.numColumns;qd.setGridSize(t,n,r)})})])})))})}},TS=function(t,e){return Dr(Aw,function(n,r){var o=function(t){return{hide:function(){return yr(t,nr())},getValue:function(){return zc.getValue(t)}}}(t.get(n));e.onAction(o,r.event().buttonApi())})},OS=function(t,e){var n=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),r=Xm(Gv.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:hu([qd.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map(function(t){return wr(t),!0})},onLeft:function(t,e){return e.cut(),y.none()},onRight:function(t,e){return e.cut(),y.none()}})])})),o=function(t,e,n){var r=H(e,function(e){return Xm(function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original,o=(r.primary,m(r,["primary"])),i=le(Kk(d(d({},o),{type:"togglebutton",onAction:function(){}})));return kS(i,n.backstage.shared.providers,[TS(t,e)])}(t,e,r):function(t,e,n){var r=e.original,o=(r.primary,m(r,["primary"])),i=le(zk(d(d({},o),{type:"button",onAction:function(){}})));return _S(i,n.backstage.shared.providers,[TS(t,e)])}(t,e,r)}(t,e,n))});return{asSpecs:function(){return H(r,function(t){return t.asSpec()})},findPrimary:function(t){return nt(e,function(e,n){return e.primary?y.from(r[n]).bind(function(e){return e.getOpt(t)}).filter(u(dp.isDisabled)):y.none()})}}}(r,t.commands,e);return[{title:y.none(),items:[r.asSpec()]},{title:y.none(),items:o.asSpecs()}]},DS=function(t,n){var r=Xi(e.window),o=ta(Ke.fromDom(t.getContentAreaContainer())),i=xp(t)||wp(t)||_p(t),a=function(t,e){var n=Math.max(e.x,t.x),r=t.right-n,o=e.width-(n-e.x);return{x:n,width:Math.min(r,o)}}(o,r),u=a.x,s=a.width;if(t.inline&&!i)return Zi(u,r.y,s,r.height);var c=function(t,e,n,r){var o=Ke.fromDom(t.getContainer()),i=ca(o,".tox-editor-header").getOr(o),a=ta(i),u=a.y>=e.bottom,s=r&&!u;if(t.inline&&s)return{y:Math.max(a.bottom,n.y),bottom:n.bottom};if(t.inline&&!s)return{y:n.y,bottom:Math.min(a.y,n.bottom)};var c=ta(o);return s?{y:Math.max(a.bottom,n.y),bottom:Math.min(c.bottom,n.bottom)}:{y:Math.max(c.y,n.y),bottom:Math.min(a.y,n.bottom)}}(t,o,r,n.header.isPositionedAtTop()),l=c.y,f=c.bottom;return Zi(u,l,s,f-l)},ES=function(t,e){var n=z(e,function(e){return e.predicate(t.dom())}),r=V(n,function(t){return"contexttoolbar"===t.type});return{contextToolbars:r.pass,contextForms:r.fail}},NS=function(t,e){var n={},r=[],o=[],i={},a={},u=function(t,u){var s=le(ce("ContextForm",rS,u));n[t]=s,s.launch.map(function(n){i["form:"+t]=d(d({},u.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(s)}})}),"editor"===s.scope?o.push(s):r.push(s),a[t]=s},s=ht(t);return j(s,function(e){var n=t[e];"contextform"===n.type?u(e,n):"contexttoolbar"===n.type&&function(t,e){var n;(n=e,ce("ContextToolbar",oS,n)).each(function(n){"editor"===e.scope?o.push(n):r.push(n),a[t]=n})}(e,n)}),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:a,formNavigators:i}},AS=Co("forward-slide"),RS=Co("backward-slide"),BS=Co("change-slide-event"),IS=function(t,e,n){var r=function(t,r,i,a){var u=e.shared.providers.translate(t.title);if("separator"===t.type)return y.some({type:"separator",text:u});if("submenu"===t.type){var s=G(t.getStyleItems(),function(t){return o(t,r,a)});return 0===r&&s.length<=0?y.none():y.some({type:"nestedmenuitem",text:u,disabled:s.length<=0,getSubmenuItems:function(){return G(t.getStyleItems(),function(t){return o(t,r,a)})}})}return y.some(d({type:"togglemenuitem",text:u,icon:t.icon,active:t.isSelected(a),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold(function(){return{}},function(t){return{meta:{style:t}}})))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return G(t,function(t){return o(t,r,e)})};return{validateItems:i,getFetch:function(t,e){return function(n){var r=e(),o=i(r);n(jw(o,xh.CLOSE_ON_EXECUTE,t,!1))}}}},PS=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return H(r.data,function(t){return g_(t,n.isSelectedFor,n.getPreviewFor)})}:r.getData;return{items:IS(0,e,n),getStyleItems:o}},MS=function(t,e,r){var o=PS(0,e,r),i=o.items,a=o.getStyleItems;return Pw({text:r.icon.isSome()?y.none():y.some(""),icon:r.icon,tooltip:y.from(r.tooltip),role:y.none(),fetch:i.getFetch(e,a),onSetup:function(e){return r.setInitialValue.each(function(t){return t(e.getComponent())}),r.nodeChangeHandler.map(function(n){var r=n(e.getComponent());return t.on("NodeChange",r),function(){t.off("NodeChange",r)}}).getOr(n)},getApi:function(t){return{getComponent:function(){return t}}},columns:1,presets:"normal",classes:r.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(yC||(yC={}));var LS,FS=function(t,e,n,r){return{type:"basic",data:function(t){return H(t,function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}})}(function(t,e){return r===yC.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string")))}},HS=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],jS=function(t){var e=function(e){var n=q(HS,function(e){return t.formatter.match(e.format)}).fold(function(){return"left"},function(t){return t.title.toLowerCase()});xr(e,Iw,{icon:"align-"+n})},n=y.some(function(t){return function(){return e(t)}}),r=y.some(function(t){return e(t)}),i={type:"basic",data:HS};return{tooltip:"Align",icon:y.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:o(y.none()),getPreviewFor:function(t){return function(){return y.none()}},onAction:function(e){return function(){return q(HS,function(t){return t.format===e.format}).each(function(e){return t.execCommand(e.command)})}},setInitialValue:r,nodeChangeHandler:n,dataset:i,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},VS=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],zS=function(t){var e=t.split(/\s*,\s*/);return H(e,function(t){return t.replace(/^['"]+|['"]+$/g,"")})},US=function(t){var e=function(){var e=function(t){return t?zS(t)[0]:""},n=t.queryCommandValue("FontName"),r=i.data,o=n?n.toLowerCase():"";return{matchOpt:q(r,function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()}).orThunk(function(){return 0===(t=o).indexOf("-apple-system")&&(e=zS(t.toLowerCase()),K(VS,function(t){return e.indexOf(t.toLowerCase())>-1}))?y.from({title:"System Font",format:o}):y.none();var t,e}),font:n}},n=function(t){var n=e(),r=n.matchOpt,o=n.font,i=r.fold(function(){return o},function(t){return t.title});xr(t,Bw,{text:i})},r=y.some(function(t){return function(){return n(t)}}),o=y.some(function(t){return n(t)}),i=FS(t,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",yC.SemiColon);return{tooltip:"Fonts",icon:y.none(),isSelectedFor:function(t){return function(e){return e.exists(function(e){return e.format===t})}},getCurrentValue:function(){return e().matchOpt},getPreviewFor:function(t){return function(){return y.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("FontName",!1,e.format)})}},setInitialValue:o,nodeChangeHandler:r,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},WS={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},qS=function(t){var e=function(){var e=y.none(),n=u.data,r=t.queryCommandValue("FontSize");if(r)for(var o=function(t){var o=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":t}(r,t),i=Ct(WS,o).getOr("");e=q(n,function(t){return t.format===r||t.format===o||t.format===i})},i=3;e.isNone()&&i>=0;i--)o(i);return{matchOpt:e,size:r}},n=o(o(y.none())),r=function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(function(){return o},function(t){return t.title});xr(t,Bw,{text:i})},i=y.some(function(t){return function(){return r(t)}}),a=y.some(function(t){return r(t)}),u=FS(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",yC.Space);return{tooltip:"Font sizes",icon:y.none(),isSelectedFor:function(t){return function(e){return e.exists(function(e){return e.format===t})}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("FontSize",!1,e.format)})}},setInitialValue:a,nodeChangeHandler:i,dataset:u,shouldHide:!1,isInvalid:function(){return!1}}},$S=function(t,e,n){var r=e();return nt(n,function(e){return q(r,function(n){return t.formatter.matchNode(e,n.format)})}).orThunk(function(){return t.formatter.match("p")?y.some({title:"Paragraph",format:"p"}):y.none()})},YS=function(t){var e=t.selection.getStart(!0)||t.getBody();return t.dom.getParents(e,function(){return!0},t.getBody())},GS=function(t,e){return function(n){var r=Ye(y.none()),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive).unbind;r.set(y.some(o))};return t.initialized?o():t.on("init",o),function(){return r.get().each(function(t){return t()})}}},KS=function(t){return function(e){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)})}}},XS=function(t){var e=function(e,n){var r=$S(t,function(){return i.data},e).fold(function(){return"Paragraph"},function(t){return t.title});xr(n,Bw,{text:r})},n=y.some(function(t){return function(n){return e(n.parents,t)}}),r=y.some(function(n){var r=YS(t);e(r,n)}),i=FS(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",yC.SemiColon);return{tooltip:"Blocks",icon:y.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:o(y.none()),getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return y.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:KS(t),setInitialValue:r,nodeChangeHandler:n,dataset:i,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},JS=function(t,e){var n=function(e,n){var r=G(p_(t),function t(e){var n=e.items;return void 0!==n&&n.length>0?G(n,t):[{title:e.title,format:e.format}]}),o=$S(t,function(){return r},e).fold(function(){return"Paragraph"},function(t){return t.title});xr(n,Bw,{text:o})},r=y.some(function(t){return function(e){return n(e.parents,t)}}),i=y.some(function(e){var r=YS(t);n(r,e)});return{tooltip:"Formats",icon:y.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:o(y.none()),getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?y.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):y.none()}},onAction:KS(t),setInitialValue:i,nodeChangeHandler:r,shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},QS=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],ZS=function(t,e){return function(n,r,o){var i=t(n).mapError(function(t){return de(t)}).getOrDie();return e(i,r,o)}},tT={button:ZS(zk,function(t,e){return n=t,r=e.backstage.shared.providers,_S(n,r,[]);var n,r}),togglebutton:ZS(Kk,function(t,e){return n=t,r=e.backstage.shared.providers,kS(n,r,[]);var n,r}),menubutton:ZS(qk,function(t,e){return zw(t,"tox-tbtn",e.backstage,y.none())}),splitbutton:ZS(function(t){return ce("SplitButton",$k,t)},function(t,e){return function(t,e){var r,o=Co("channel-update-split-dropdown-display"),i=function(t){return{isDisabled:function(){return dp.isDisabled(t)},setDisabled:function(e){return dp.set(t,e)},setIconFill:function(e,n){ca(t.element(),'svg path[id="'+e+'"], rect[id="'+e+'"]').each(function(t){fo(t,"fill",n)})},setIconStroke:function(e,n){ca(t.element(),'svg path[id="'+e+'"], rect[id="'+e+'"]').each(function(t){fo(t,"stroke",n)})},setActive:function(e){fo(t.element(),"aria-pressed",e),ca(t.element(),"span").each(function(n){t.getSystem().getByDom(n).each(function(t){return hm.set(t,e)})})},isActive:function(){return ca(t.element(),"span").exists(function(e){return t.getSystem().getByDom(e).exists(hm.isOn)})}}},a=Ye(n),u={getApi:i,onSetup:t.onSetup};return hS.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:d({"aria-pressed":!1},vS(t.tooltip,e.providers))},onExecute:function(e){t.onAction(i(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:hu([Up(e.providers.isReadOnly),jp(),Jd("split-dropdown-events",[Dr(bS,nm.focus),$p(u,a),Yp(u,a)]),Rb.config({})]),eventOrder:(r={},r[cr()]=["alloy.base.behaviour","split-dropdown-events"],r),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:SS(i,t,e.providers),parts:{menu:Rh(0,t.columns,t.presets)},components:[hS.parts().button(wS(t.icon,t.text,y.none(),y.some(o),y.some([hm.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),hS.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Qm("chevron-down",e.providers.icons)},buttonBehaviours:hu([Up(e.providers.isReadOnly),jp()])}),hS.parts()["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})}(t,e.backstage.shared)}),grouptoolbarbutton:ZS(function(t){return ce("GroupToolbarButton",Xk,t)},function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[Qu]=e.backstage.shared.header.isPositionedAtTop()?ha.TopToBottom:ha.BottomToTop,r);switch(Sp(n)){case yh.floating:return function(t,e,n,r){var o=e.shared;return ck.sketch({lazySink:o.getSink,fetch:function(){return rb(function(e){e(H(n(t.items),Ik))})},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:wS(t.icon,t.text,t.tooltip,y.none(),y.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,function(t){return oT(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,y.none())},i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}}),styleSelectButton:function(t,e){return function(t,e){var n=d({type:"advanced"},e.styleselect);return MS(t,e,JS(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return MS(t,e,qS(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return MS(t,e,US(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return MS(t,e,XS(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return MS(t,e,jS(t))}(t,e.backstage)}},eT={styleselect:tT.styleSelectButton,fontsizeselect:tT.fontsizeSelectButton,fontselect:tT.fontSelectButton,formatselect:tT.formatButton,align:tT.alignMenuButton},nT=function(t){var n,r=t.toolbar,o=t.buttons;return!1===r?[]:void 0===r||!0===r?function(t){var e=H(QS,function(e){var n=z(e.items,function(e){return _t(t,e)||_t(eT,e)});return{name:e.name,items:n}});return z(e,function(t){return t.items.length>0})}(o):C(r)?(n=r.split("|"),H(n,function(t){return{items:t.trim().split(" ")}})):N(r,function(t){return _t(t,"name")&&_t(t,"items")})?r:(e.console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},rT=function(t,n,r,o,i,a){return Ct(n,r.toLowerCase()).orThunk(function(){return a.bind(function(t){return nt(t,function(t){return Ct(n,t+r.toLowerCase())})})}).fold(function(){return Ct(eT,r.toLowerCase()).map(function(e){return e(t,i)}).orThunk(function(){return y.none()})},function(n){return"grouptoolbarbutton"!==n.type||o?function(t,n,r){return Ct(tT,t.type).fold(function(){return e.console.error("skipping button defined by",t),y.none()},function(e){return y.some(e(t,n,r))})}(n,i,t):(e.console.warn("Ignoring the '"+r+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),y.none())})},oT=function(t,e,n,r){var o=nT(e),i=H(o,function(o){var i=G(o.items,function(o){return 0===o.trim().length?[]:rT(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()});return{title:y.from(t.translate(o.name)),items:i}});return z(i,function(t){return t.items.length>0})},iT={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},aT={maxHeightFunction:Wu(),maxWidthFunction:U_()},uT={onLtr:function(){return[eu,nu,Za,Ja,tu,Qa,$m,Ym,Wm,zm,qm,Um]},onRtl:function(){return[eu,nu,tu,Qa,Za,Ja,$m,Ym,qm,Um,Wm,zm]}},sT={onLtr:function(){return[nu,Ja,Qa,Za,tu,eu,$m,Ym,Wm,zm,qm,Um]},onRtl:function(){return[nu,Qa,Ja,tu,Za,eu,$m,Ym,qm,Um,Wm,zm]}},cT=function(t,e,n,r){var o,i,a=bn().deviceType.isTouch,u=Ai((o={sink:n,onEscape:function(){return t.focus(),y.some(!0)}},i=Ye([]),Mm.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),Mm.getContent(t).each(function(t){xi(t.element(),"visibility")}),Jo(t.element(),"tox-pop--resizing"),xi(t.element(),"width")},inlineBehaviours:hu([Jd("context-toolbar-events",[Pr(qn(),function(t,e){Jo(t.element(),"tox-pop--resizing"),xi(t.element(),"width")}),Dr(BS,function(t,e){xi(t.element(),"width");var n=zi(t.element());Mm.setContent(t,e.event().contents()),Xo(t.element(),"tox-pop--resizing");var r=zi(t.element());di(t.element(),"width",n+"px"),Mm.getContent(t).each(function(n){e.event().focus().bind(function(e){return ku(e),Tu(t.element())}).orThunk(function(){return qd.focusIn(n),Su()})}),Gm.setTimeout(function(){di(t.element(),"width",r+"px")},0)}),Dr(AS,function(t,e){Mm.getContent(t).each(function(t){i.set(i.get().concat([{bar:t,focus:Su()}]))}),xr(t,BS,{contents:e.event().forwardContents(),focus:y.none()})}),Dr(RS,function(t,e){tt(i.get()).each(function(e){i.set(i.get().slice(0,i.get().length-1)),xr(t,BS,{contents:Ri(e.bar),focus:e.focus})})})]),qd.config({mode:"special",onEscape:function(t){return tt(i.get()).fold(function(){return o.onEscape()},function(e){return yr(t,RS),y.some(!0)})}})]),lazySink:function(){return it.value(o.sink)}}))),s=function(){return DS(t,r.backstage.shared)},c=function(){if(a()&&r.backstage.isContextMenuOpen())return!0;var e,n,o,i,u,c,l=(e=h.get().map(function(t){return t.getBoundingClientRect()}).getOrThunk(function(){return t.selection.getRng().getBoundingClientRect()}),n=t.inline?Yi().top():ea(Ke.fromDom(t.getBody())).y,{y:e.top+n,bottom:e.bottom+n}),f=s();return o=l.y,i=l.bottom,u=f.y,c=f.bottom,!(Math.max(o,u)<=Math.min(i,c))},l=function(){Mm.hide(u)},f=function(){m.get().each(function(t){var e=u.element();xi(e,"display"),c()?di(e,"display","none"):tc.positionWithinBounds(n,t,u,y.some(s()))})},m=Ye(y.none()),h=Ye(y.none()),p=Ye(null),g=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:hu([qd.config({mode:"acyclic"}),Jd("pop-dialog-wrap-events",[Mr(function(e){t.shortcuts.add("ctrl+F9","focus statusbar",function(){return qd.focusIn(e)})}),Lr(function(e){t.shortcuts.remove("ctrl+F9")})])])}},v=Nt(function(){return NS(e,function(t){var e=b([t]);xr(u,AS,{forwardContents:g(e)})})}),b=function(e){var n=t.ui.registry.getAll().buttons,o=v(),i=d(d({},n),o.formNavigators),a=Sp(t)===yh.scrolling?yh.scrolling:yh.default,u=Y(H(e,function(e){return"contexttoolbar"===e.type?oT(t,{buttons:i,toolbar:e.items,allowToolbarGroups:!1},r,y.some(["form:"])):function(t,e){return OS(t,e)}(e,r.backstage.shared.providers)}));return Hk({type:a,uid:Co("context-toolbar"),initGroups:u,onEscape:y.none,cyclicKeying:!0,providers:r.backstage.shared.providers})};t.on("contexttoolbar-show",function(e){var n=v();Ct(n.lookupTable,e.toolbarKey).each(function(n){x([n],e.target===t?y.none():y.some(e)),Mm.getContent(u).each(qd.focusIn)})});var x=function(t,e){if(C(),!a()||!r.backstage.isContextMenuOpen()){var n=b(t),o=e.map(Ke.fromDom),i=function(t,e){var n="node"===t?r.backstage.shared.anchors.node(e):r.backstage.shared.anchors.cursor();return Dt(n,function(t,e){return"line"===t?{bubble:Gu(12,0,iT),layouts:{onLtr:function(){return[ru]},onRtl:function(){return[ou]}},overrides:aT}:{bubble:Gu(0,12,iT),layouts:e?sT:uT,overrides:aT}}(t,a()))}(t[0].position,o);m.set(y.some(i)),h.set(e);var l=u.element();xi(l,"display"),Mm.showWithinBounds(u,i,g(n),function(){return y.some(s())}),c()&&di(l,"display","none")}},w=function(){t.hasFocus()&&function(t,e){var n=Ke.fromDom(e.getBody()),r=function(t){return wn(t,n)},o=Ke.fromDom(e.selection.getNode());return function(t){return!r(t)&&!_n(n,t)}(o)?y.none():function(t,e,n){var r=ES(t,e);if(r.contextForms.length>0)return y.some({elem:t,toolbars:[r.contextForms[0]]});var o=ES(t,n);if(o.contextForms.length>0)return y.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return M(t,function(t){return t.position===e})},n=function(e){return z(t,function(t){return t.position===e})},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),a=H(n("selection"),function(t){return d(d({},t),{position:"node"})});return i.concat(a)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return y.some({elem:t,toolbars:i})}return y.none()}(o,t.inNodeScope,t.inEditorScope).orThunk(function(){return function(t,e,n){return t(e)?y.none():Sn(e,function(t){var e=ES(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return q(t,function(t){return t.position===e})};return e("selection").orThunk(function(){return e("node")}).orThunk(function(){return e("line")}).map(function(t){return t.position}).fold(function(){return[]},function(e){return z(t,function(t){return t.position===e})})}(r);return i.length>0?y.some({elem:t,toolbars:i}):y.none()},t)}(r,o,t)})}(v(),t).fold(function(){m.set(y.none()),Mm.hide(u)},function(t){x(t.toolbars,y.some(t.elem.dom()))})},C=function(){var t=p.get();null!==t&&(Gm.clearTimeout(t),p.set(null))},_=function(t){C(),p.set(t)};t.on("init",function(){t.on("contexttoolbar-hide",l),t.on("ScrollContent ScrollWindow longpress",f),t.on("click keyup focus SetContent ObjectResized ResizeEditor",function(){_(Gm.setEditorTimeout(t,w,0))}),t.on("focusout",function(e){Gm.setEditorTimeout(t,function(){Tu(n.element()).isNone()&&Tu(u.element()).isNone()&&(m.set(y.none()),Mm.hide(u))},0)}),t.on("SwitchMode",function(){t.mode.isReadOnly()&&(m.set(y.none()),Mm.hide(u))}),t.on("NodeChange",function(e){Tu(u.element()).fold(function(){_(Gm.setEditorTimeout(t,w,0))},function(t){})})})},lT=Ll,fT=xl,dT=o([Fe("shell",!1),_e("makeItem"),Fe("setupItem",n),$c("listBehaviours",[Xd])]),mT=vl({name:"items",overrides:function(){return{behaviours:hu([Xd.config({})])}}}),hT=o([mT]),pT=Wl({name:o("CustomList")(),configFields:dT(),partFields:hT(),factory:function(t,n,r,o){var i=t.shell?{behaviours:[Xd.config({})],components:[]}:{behaviours:[],components:n};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:qc(t.listBehaviours,i.behaviours),apis:{setItems:function(n,r){(function(e){return t.shell?y.some(e):El(e,t,"items")})(n).fold(function(){throw e.console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},function(e){var o=Xd.contents(e),i=r.length,a=i-o.length,u=a>0?L(a,function(){return t.makeItem()}):[],s=o.slice(i);j(s,function(t){return Xd.remove(e,t)}),j(u,function(t){return Xd.append(e,t)});var c=Xd.contents(e);j(c,function(e,o){t.setupItem(n,e,r[o],o)})})}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),gT=function(t){return(vi(t,"position").is("fixed")?y.none():Jr(t)).orThunk(function(){var e=Ke.fromTag("span");return Xr(t).bind(function(t){ro(t,e);var n=Jr(e);return ao(e),n})})},vT=function(t){return gT(t).map(Hi).getOrThunk(function(){return Li(0,0)})},bT=St([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),yT=function(t,e,n){return K(t,function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}})},xT=function(t,e){return e.getInitialPosition().map(function(e){return Zi(e.bounds.x,e.bounds.y,zi(t),Pi(t))})},wT=function(t,e,n){return n.getInitialPosition().bind(function(r){switch(n.setInitialPosition(y.none()),r.position){case"static":return y.some(bT.static());case"absolute":var o=gT(t).map(ta).getOrThunk(function(){return ta(si())});return y.some(bT.absolute(Du("absolute",Ct(r.style,"left").map(function(t){return e.x-o.x}),Ct(r.style,"top").map(function(t){return e.y-o.y}),Ct(r.style,"right").map(function(t){return o.right-e.right}),Ct(r.style,"bottom").map(function(t){return o.bottom-e.bottom}))));default:return y.none()}})},CT=function(t,e,n){var r=t.element();return vi(r,"position").is("fixed")?function(t,e,n){return xT(t,n).filter(function(t){return yT(n.getModes(),t,e)}).bind(function(e){return wT(t,e,n)})}(r,e,n):function(t,e,n){var r=ta(t);if(yT(n.getModes(),r,e))return y.none();!function(t,e,n){n.setInitialPosition(y.some({style:bi(t),position:pi(t,"position")||"static",bounds:e}))}(t,r,n);var o=na(),i=r.x-o.x,a=e.y-o.y,u=o.bottom-e.bottom,s=r.y<=e.y;return y.some(bT.fixed(Du("fixed",y.some(i),s?y.some(a):y.none(),y.none(),s?y.none():y.some(u))))}(r,e,n)},_T=function(t,e){j(["left","right","top","bottom","position"],function(e){return xi(t.element(),e)}),e.onUndocked(t)},kT=function(t,e,n){Eu(t.element(),n),("fixed"===n.position()?e.onDocked:e.onUndocked)(t)},ST=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each(function(e){e.lazyContext(t).each(function(i){var a=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);a!==n.isVisible()&&(n.setVisible(a),o&&!a?(Zo(t.element(),[e.fadeOutClass]),e.onHide(t)):(a?function(t,e){var n=t.element();Xo(n,e.transitionClass),Jo(n,e.fadeOutClass),Xo(n,e.fadeInClass),e.onShow(t)}:function(t,e){var n=t.element();Xo(n,e.transitionClass),Jo(n,e.fadeInClass),Xo(n,e.fadeOutClass),e.onHide(t)})(t,e))})})},TT=function(t,e,r){var o=t.element();r.setDocked(!1),function(t,e){var n=t.element();return xT(n,e).bind(function(t){return wT(n,t,e)})}(t,r).each(function(r){r.fold(function(){return _T(t,e)},function(n){return kT(t,e,n)},n)}),r.setVisible(!0),e.contextual.each(function(e){ti(o,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)}),OT(t,e,r)},OT=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t),o=n.isDocked();o&&ST(t,e,n,r),CT(t,r,n).each(function(i){n.setDocked(!o),i.fold(function(){return _T(t,e)},function(n){return kT(t,e,n)},function(o){ST(t,e,n,r,!0),kT(t,e,o)})})}(t,e,n)},DT=function(t,e,n){n.isDocked()&&TT(t,e,n)},ET=Object.freeze({__proto__:null,refresh:OT,reset:DT,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),NT=Object.freeze({__proto__:null,events:function(t,e){return Sr([Pr(qn(),function(n,r){t.contextual.each(function(t){Qo(n.element(),t.transitionClass)&&(ti(n.element(),[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n)),r.stop()})}),Dr(ur(),function(n,r){OT(n,t,e)}),Dr(sr(),function(n,r){DT(n,t,e)})])}}),AT=[Le("contextual",[Te("fadeInClass"),Te("fadeOutClass"),Te("transitionClass"),De("lazyContext"),Oa("onShow"),Oa("onShown"),Oa("onHide"),Oa("onHidden")]),We("lazyViewport",na),He("modes",["top","bottom"],Zt(be)),Oa("onDocked"),Oa("onUndocked")],RT=Object.freeze({__proto__:null,init:function(t){var e=Ye(!1),n=Ye(!0),r=Ye(y.none()),o=Ye(t.modes);return Ho({isDocked:e.get,setDocked:e.set,getInitialPosition:r.get,setInitialPosition:r.set,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked:  "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}}),BT=gu({fields:AT,name:"docking",active:NT,apis:ET,state:RT}),IT={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},PT=function(t){var e=t.element();Xr(e).each(function(n){var r="padding-"+BT.getModes(t)[0];if(BT.isDocked(t)){var o=zi(n);di(e,"width",o+"px"),di(n,r,function(t){return Mi(t)+(parseInt(pi(t,"margin-top"),10)||0)+(parseInt(pi(t,"margin-bottom"),10)||0)}(e)+"px")}else xi(e,"width"),xi(n,r)})},MT=function(t,e){e?(Jo(t,IT.fadeOutClass),Zo(t,[IT.transitionClass,IT.fadeInClass])):(Jo(t,IT.fadeInClass),Zo(t,[IT.fadeOutClass,IT.transitionClass]))},LT=function(t,e){var n=Ke.fromDom(t.getContainer());e?(Xo(n,"tox-tinymce--toolbar-sticky-on"),Jo(n,"tox-tinymce--toolbar-sticky-off")):(Xo(n,"tox-tinymce--toolbar-sticky-off"),Jo(n,"tox-tinymce--toolbar-sticky-on"))},FT=function(t,e){var n,r=Ye(y.none()),o=e.getSink,i=function(t){o().each(function(e){return t(e.element())})},a=function(e){t.inline||PT(e),LT(t,BT.isDocked(e)),e.getSystem().broadcastOn([kc()],{}),o().each(function(t){return t.getSystem().broadcastOn([kc()],{})})},u=t.inline?[]:[Cu.config({channels:(n={},n[Rk()]={onReceive:PT},n)})];return h([nm.config({}),BT.config({contextual:d({lazyContext:function(e){var n,r=Mi(e.element()),o=t.inline?t.getContentAreaContainer():t.getContainer(),i=ta(Ke.fromDom(o)),a=i.height-r,u=i.y+(n=e,"top",P(BT.getModes(n),"top")?0:r);return y.some(Zi(i.x,u,i.width,a))},onShow:function(){i(function(t){return MT(t,!0)})},onShown:function(t){i(function(t){return ti(t,[IT.transitionClass,IT.fadeInClass])}),r.get().each(function(e){var n,o,i;n=t.element(),i=$r(o=e),Su(i).filter(function(t){return!wn(o,t)}).filter(function(t){return wn(t,Ke.fromDom(i.dom().body))||_n(n,t)}).each(function(){return ku(o)}),r.set(y.none())})},onHide:function(t){r.set(function(t,e){return Tu(t).orThunk(function(){return e().toOption().bind(function(t){return Tu(t.element())})})}(t.element(),o)),i(function(t){return MT(t,!1)})},onHidden:function(){i(function(t){return ti(t,[IT.transitionClass])})}},IT),modes:[e.header.getDockingMode()],onDocked:a,onUndocked:a})],u)},HT=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",function(){n().each(BT.reset)}),t.on("ResizeWindow ResizeEditor",function(){n().each(PT)}),t.on("SkinLoaded",function(){n().each(function(t){BT.isDocked(t)?BT.reset(t):BT.refresh(t)})}),t.on("FullscreenStateChanged",function(){n().each(BT.reset)})),t.on("AfterScrollIntoView",function(t){n().each(function(e){BT.refresh(e);var n=e.element();Hf(n)&&function(t,e){var n=$r(e),r=n.dom().defaultView.innerHeight,o=Yi(n),i=Ke.fromDom(t.elm),a=ea(i),u=Pi(i),s=a.y,c=s+u,l=Hi(e),f=Pi(e),d=l.top(),m=d+f,h=Math.abs(d-o.top())<2,p=Math.abs(m-(o.top()+r))<2;if(h&&s<m)Gi(o.left(),s-f,n);else if(p&&c>d){var g=s-r+u+f;Gi(o.left(),g,n)}}(t,n)})}),t.on("PostRender",function(){LT(t,!1)})},isDocked:function(t){return t().map(BT.isDocked).getOr(!1)},getBehaviours:FT}),jT=n,VT=c,zT=o([]),UT=Object.freeze({__proto__:null,setup:jT,isDocked:VT,getBehaviours:zT}),WT=Ul({factory:function(t,e){var n={focus:qd.focusIn,setMenus:function(t,n){var r=H(n,function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=qk(n).mapError(function(t){return de(t)}).getOrDie();return zw(r,"tox-mbtn",e.backstage,y.some("menuitem"))});Xd.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:hu([Xd.config({}),Jd("menubar-events",[Mr(function(e){t.onSetup(e)}),Dr(Ln(),function(t,e){ca(t.element(),".tox-mbtn--active").each(function(n){la(e.event().target(),".tox-mbtn").each(function(e){wn(n,e)||t.getSystem().getByDom(n).each(function(n){t.getSystem().getByDom(e).each(function(t){Nb.expand(t),Nb.close(n),nm.focus(t)})})})})}),Dr(mr(),function(t,e){e.event().prevFocus().bind(function(e){return t.getSystem().getByDom(e).toOption()}).each(function(n){e.event().newFocus().bind(function(e){return t.getSystem().getByDom(e).toOption()}).each(function(t){Nb.isOpen(n)&&(Nb.expand(t),Nb.close(n))})})})]),qd.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),y.some(!0)}}),Nv.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[_e("dom"),_e("uid"),_e("onEscape"),_e("backstage"),Fe("onSetup",n)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),qT=[Uc("slotBehaviours",[])],$T=function(t){return"<alloy.field."+t+">"},YT=function(t,e){var n,r=function(e){return Bl(t)},o=function(e,n){return function(r,o){return El(r,t,o).map(function(t){return e(t,o)}).getOr(n)}},i=function(t,e){return"true"!==mo(t.element(),"aria-hidden")},a=o(i,!1),u=o(function(t,e){if(i(t)){var n=t.element();di(n,"display","none"),fo(n,"aria-hidden","true"),xr(t,hr(),{name:e,visible:!1})}}),s=(n=u,function(t,e){j(e,function(e){return n(t,e)})}),c=o(function(t,e){if(!i(t)){var n=t.element();xi(n,"display"),go(n,"aria-hidden"),xr(t,hr(),{name:e,visible:!0})}}),l={getSlotNames:r,getSlot:function(e,n){return El(e,t,n)},isShowing:a,hideSlot:u,hideAllSlots:function(t){return s(t,r())},showSlot:c};return{uid:t.uid,dom:t.dom,components:e,behaviours:Wc(t.slotBehaviours),apis:l}},GT=vt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},function(t){return Lo(t)}),KT=d(d({},GT),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),kl("container",$T(e),n)},record:function(){return t}}}(),n=t(e),r=e.record(),o=H(r,function(t){return pl({name:t,pname:$T(t)})});return Hl("container",qT,o,YT,n)}}),XT=Qt([Pe("icon"),Pe("tooltip"),We("onShow",n),We("onHide",n),We("onSetup",function(){return n})]),JT=function(t){return{element:function(){return t.element().dom()}}},QT=function(t,e){var r=H(ht(e),function(t){var n=e[t],r=le(ce("sidebar",XT,n));return{name:t,getApi:JT,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}});return H(r,function(e){var o=Ye(n);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:$h([$p(e,o),Yp(e,o),Dr(hr(),function(t,e){var n=e.event();q(r,function(t){return t.name===n.name()}).each(function(e){(n.visible()?e.onShow:e.onHide)(e.getApi(t))})})])})})},ZT=function(t){return KT.sketch(function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:QT(e,t),slotBehaviours:$h([Mr(function(t){return KT.hideAllSlots(t)})])}})},tO=function(t){return Kl.getCurrent(t).bind(function(t){return Ok.isGrowing(t)||Ok.hasGrown(t)?Kl.getCurrent(t).bind(function(t){return q(KT.getSlotNames(t),function(e){return KT.isShowing(t,e)})}):y.none()})},eO=Co("FixSizeEvent"),nO=Co("AutoSizeEvent"),rO=function(t){var e=Ke.fromHtml(t),n=Qr(e),r=function(t){var e=void 0!==t.dom().attributes?t.dom().attributes:[];return W(e,function(t,e){var n;return"class"===e.name?t:d(d({},t),((n={})[e.name]=e.value,n))},{})}(e),o=function(t){return Array.prototype.slice.call(t.dom().classList,0)}(e),i=0===n.length?{}:{innerHtml:so(e)};return d({tag:jr(e),classes:o,attributes:r},i)},oO=function(t){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:rO('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:hu([qd.config({mode:"special",onTab:function(){return y.some(!0)},onShiftTab:function(){return y.some(!0)}}),nm.config({})])}},iO=function(t,e,n){var r=Ye(!1),o=Ye(y.none()),i=function(t){t!==r.get()&&(function(t,e,n){var r=t.element();!0===e?(Xd.set(t,[oO(n)]),xi(r,"display"),go(r,"aria-hidden")):(Xd.set(t,[]),di(r,"display","none"),fo(r,"aria-hidden","true"))}(e(),t,n.providers),r.set(t))};t.on("ProgressState",function(e){if(o.get().each(Gm.clearTimeout),E(e.time)){var n=Gm.setEditorTimeout(t,function(){return i(e.state)},e.time);o.set(y.some(n))}else i(e.state),o.set(y.none())})},aO=fT.optional({factory:WT,name:"menubar",schema:[_e("backstage")]}),uO=fT.optional({factory:{sketch:function(t){return pT.sketch({uid:t.uid,dom:t.dom,listBehaviours:hu([qd.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return Hk({type:t.type,uid:Co("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return y.none()}})},setupItem:function(t,e,n,r){K_.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[_e("dom"),_e("onEscape")]}),sO=fT.optional({factory:{sketch:function(t){return function(t){return t.type===yh.sliding?Fk:t.type===yh.floating?Lk:Hk}(t)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),y.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[_e("dom"),_e("onEscape"),_e("getSink")]}),cO=fT.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?FT:zT;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:hu(n(e,t.sharedBackstage))}}},name:"header",schema:[_e("dom")]}),lO=fT.optional({name:"socket",schema:[_e("dom")]}),fO=fT.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:hu([Nv.config({}),nm.config({}),Ok.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){Kl.getCurrent(t).each(KT.hideAllSlots),yr(t,nO)},onGrown:function(t){yr(t,nO)},onStartGrow:function(t){xr(t,eO,{width:vi(t.element(),"width").getOr("")})},onStartShrink:function(t){xr(t,eO,{width:zi(t.element())+"px"})}}),Xd.config({}),Kl.config({find:function(t){var e=Xd.contents(t);return Z(e)}})])}],behaviours:hu([Rx(0),Jd("sidebar-sliding-events",[Dr(eO,function(t,e){di(t.element(),"width",e.event().width())}),Dr(nO,function(t,e){xi(t.element(),"width")})])])}}},name:"sidebar",schema:[_e("dom")]}),dO=fT.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:hu([Xd.config({})]),components:[]}}},name:"throbber",schema:[_e("dom")]}),mO=Wl({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return lT.getPart(e,t,"socket")},setSidebar:function(e,n){lT.getPart(e,t,"sidebar").each(function(t){return function(t,e){Kl.getCurrent(t).each(function(t){return Xd.set(t,[ZT(e)])})}(t,n)})},toggleSidebar:function(e,n){lT.getPart(e,t,"sidebar").each(function(t){return function(t,e){Kl.getCurrent(t).each(function(t){Kl.getCurrent(t).each(function(n){Ok.hasGrown(t)?KT.isShowing(n,e)?Ok.shrink(t):(KT.hideAllSlots(n),KT.showSlot(n,e)):(KT.hideAllSlots(n),KT.showSlot(n,e),Ok.grow(t))})})}(t,n)})},whichSidebar:function(e){return lT.getPart(e,t,"sidebar").bind(tO).getOrNull()},getHeader:function(e){return lT.getPart(e,t,"header")},getToolbar:function(e){return lT.getPart(e,t,"toolbar")},setToolbar:function(e,n){lT.getPart(e,t,"toolbar").each(function(t){t.getApis().setGroups(t,n)})},setToolbars:function(e,n){lT.getPart(e,t,"multiple-toolbar").each(function(t){pT.setItems(t,n)})},refreshToolbar:function(e){lT.getPart(e,t,"toolbar").each(function(t){return t.getApis().refresh(t)})},getThrobber:function(e){return lT.getPart(e,t,"throbber")},focusToolbar:function(e){lT.getPart(e,t,"toolbar").orThunk(function(){return lT.getPart(e,t,"multiple-toolbar")}).each(function(t){qd.focusIn(t)})},setMenubar:function(e,n){lT.getPart(e,t,"menubar").each(function(t){WT.setMenus(t,n)})},focusMenubar:function(e){lT.getPart(e,t,"menubar").each(function(t){WT.focus(t)})}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[_e("dom"),_e("behaviours")],partFields:[cO,aO,sO,uO,lO,fO,dO],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=H(n,function(t){return Ik(t)});t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=H(n,function(t){return H(t,Ik)});t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),hO={file:{title:"File",items:"newdocument restoredraft | preview | print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},pO=function(t){return"string"==typeof t?t.split(" "):t},gO=function(t,e){var n=d(d({},hO),e.menus),r=ht(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?pO("file edit view insert format tools table help"):pO(!1===e.menubar?"":e.menubar),i=z(o,function(t){return r&&e.menus.hasOwnProperty(t)&&e.menus[t].hasOwnProperty("items")||hO.hasOwnProperty(t)}),a=H(i,function(r){var o=n[r];return function(t,e,n){var r=n.getParam("removed_menuitems","").split(/[ ,]/);return{text:t.title,getItems:function(){return G(t.items,function(t){var n=t.toLowerCase();return 0===n.trim().length||M(r,function(t){return t===n})?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]})}}}({title:o.title,items:pO(o.items)},e,t)});return z(a,function(t){return t.getItems().length>0&&M(t.getItems(),function(t){return"separator"!==t.type})})},vO=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},bO=function(t,e){var n,r=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):mp.baseURL+"/skins/ui/"+r}return n}(e);r&&(n=r+"/skin.min.css",e.contentCSS.push(r+(t?"/content.inline":"/content")+".min.css")),!1==(!1===e.getParam("skin"))&&n?e.ui.styleSheetLoader.load(n,vO(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:"Skin could not be loaded"})}}(e)):vO(e)()},yO=a(bO,!1),xO=a(bO,!0),wO=function(t,e,n,r){var o=e.outerContainer,i=n.toolbar,a=n.buttons;if(N(i,C)){var u=i.map(function(e){var o={toolbar:e,buttons:a,allowToolbarGroups:n.allowToolbarGroups};return oT(t,o,{backstage:r},y.none())});mO.setToolbars(o,u)}else mO.setToolbar(o,oT(t,n,{backstage:r},y.none()))},CO=ep.DOM,_O=bn(),kO=_O.os.isiOS()&&_O.os.version.major<=12,SO=Object.freeze({__proto__:null,render:function(t,n,r,o,i){var a=Ye(0);yO(t);var u,s=Ke.fromDom(i.targetNode),c=(u=ii(s),ni(u)?u:Ke.fromDom(Yr(u).dom().body));!function(t,e){fc(t,e,eo)}(s,n.mothership),lc(c,n.uiMothership),t.on("PostRender",function(){wO(t,n,r,o),a.set(t.getWin().innerWidth),mO.setMenubar(n.outerContainer,gO(t,r)),mO.setSidebar(n.outerContainer,r.sidebar),function(t){var e=t.getWin(),n=t.getDoc().documentElement,r=Ye(Li(e.innerWidth,e.innerHeight)),o=Ye(Li(n.offsetWidth,n.offsetHeight)),i=function(n){var o=r.get();o.left()===e.innerWidth&&o.top()===e.innerHeight||(r.set(Li(e.innerWidth,e.innerHeight)),Ig(t,n))},a=function(e){var n=t.getDoc().documentElement,r=o.get();r.left()===n.offsetWidth&&r.top()===n.offsetHeight||(o.set(Li(n.offsetWidth,n.offsetHeight)),Ig(t,e))},u=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};CO.bind(e,"resize",i),CO.bind(e,"scroll",u);var s=cv(Ke.fromDom(t.getBody()),"load",a);t.on("NodeChange",a),t.on("remove",function(){s.unbind(),CO.unbind(e,"resize",i),CO.unbind(e,"scroll",u)})}(t)});var l,f,d=mO.getSocket(n.outerContainer).getOrDie("Could not find expected socket element");if(!0===kO){mi(d.element(),{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var m=(l=function(){t.fire("ScrollContent")},20,f=null,{cancel:function(){null!==f&&(e.clearTimeout(f),f=null)},throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null===f&&(f=e.setTimeout(function(){l.apply(null,t),f=null},20))}});sv(d.element(),"scroll",m.throttle)}Hp(t,n),t.addCommand("ToggleSidebar",function(e,r){mO.toggleSidebar(n.outerContainer,r),t.fire("ToggleSidebar")}),t.addQueryValueHandler("ToggleSidebar",function(){return mO.whichSidebar(n.outerContainer)});var h=Sp(t);return h!==yh.sliding&&h!==yh.floating||t.on("ResizeWindow ResizeEditor ResizeContent",function(){var e=t.getWin().innerWidth;e!==a.get()&&(mO.refreshToolbar(n.outerContainer),a.set(e))}),{iframeContainer:d.element().dom(),editorContainer:n.outerContainer.element().dom()}}}),TO=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?y.some(parseInt(""+t,10)):y.none()},OO=function(t){return E(t)?t+"px":t},DO=function(t,e,n){var r=e.filter(function(e){return t<e}),o=n.filter(function(e){return t>e});return r.or(o).getOr(t)},EO=function(t){var e=pp(t),n=gp(t),r=bp(t);return TO(e).map(function(t){return DO(t,n,r)})},NO=function(t,e){var n=ta(t);return{pos:e?n.y:n.bottom,bounds:n}},AO=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,a=e.uiMothership,u=e.outerContainer,s=Ye(null),c=Ke.fromDom(o.targetNode),l=function(t,e,n,r,o){var i=n.uiMothership,a=n.outerContainer,u=ep.DOM,s=Np(t),c=Rp(t),l=bp(t).or(EO(t)),f=r.shared.header,d=f.isPositionedAtTop,m=Sp(t),h=m===yh.sliding||m===yh.floating,p=Ye(!1),g=function(){return p.get()&&!t.removed},v=function(t){return h?t.fold(function(){return 0},function(t){return t.components().length>1?Pi(t.components()[1].element()):0}):0},b=function(){i.broadcastOn([kc()],{})},y=function(t){if(void 0===t&&(t=!1),g()){var n;if(s||(n=l.getOrThunk(function(){var t=TO(pi(si(),"margin-left")).getOr(0);return zi(si())-Hi(e).left()+t}),di(o.get().element(),"max-width",n+"px")),h&&mO.refreshToolbar(a),s||function(){var t=mO.getToolbar(a),n=v(t),r=ta(e),i=d()?Math.max(r.y-Pi(o.get().element())+n,0):r.bottom;mi(a.element(),{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),c){var r=o.get();t?BT.reset(r):BT.refresh(r)}b()}},x=function(n){if(void 0===n&&(n=!0),!s&&c&&g()){var r=f.getDockingMode(),i=function(n){switch(Op(t)){case kp.auto:var r=mO.getToolbar(a),o=v(r),i=Pi(n.element())-o,u=ta(e);if(u.y>i)return"top";var s=Gr(e),c=Math.max(s.dom().scrollHeight,Pi(s));return u.bottom<c-i||na().bottom<u.bottom-i?"bottom":"top";case kp.bottom:return"bottom";case kp.top:default:return"top"}}(o.get());i!==r&&(function(t){var e=o.get();BT.setModes(e,[t]),f.setDockingMode(t);var n=d()?ha.TopToBottom:ha.BottomToTop;fo(e.element(),Qu,n)}(i),n&&y(!0))}};return{isVisible:g,isPositionedAtTop:d,show:function(){p.set(!0),di(a.element(),"display","flex"),u.addClass(t.getBody(),"mce-edit-focus"),xi(i.element(),"display"),x(!1),y()},hide:function(){p.set(!1),n.outerContainer&&(di(a.element(),"display","none"),u.removeClass(t.getBody(),"mce-edit-focus")),di(i.element(),"display","none")},update:y,updateMode:x,repositionPopups:b}}(t,c,e,r,s);xO(t);var f=function(){if(s.get())l.show();else{s.set(mO.getHeader(u).getOrDie());var o=function(t){return Ep(t).getOr(si())}(t);lc(o,i),lc(o,a),wO(t,e,n,r),mO.setMenubar(u,gO(t,n)),l.show(),function(t,e,n){var r=Ye(NO(e,n.isPositionedAtTop())),o=function(o){var i=NO(e,n.isPositionedAtTop()),a=i.pos,u=i.bounds,s=r.get(),c=s.pos,l=s.bounds,f=u.height!==l.height||u.width!==l.width;r.set({pos:a,bounds:u}),f&&Ig(t,o),n.isVisible()&&(c!==a?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};t.on("activate",n.show),t.on("deactivate",n.hide),t.on("SkinLoaded ResizeWindow",function(){return n.update(!0)}),t.on("NodeChange keydown",function(t){Gm.requestAnimationFrame(function(){return o(t)})}),t.on("ScrollWindow",function(){return n.updateMode()});var i=function(){return t=function(t){t.unbind()},e=Ye(y.none()),n=function(){e.get().each(t)},{clear:function(){n(),e.set(y.none())},isSet:function(){return e.get().isSome()},set:function(t){n(),e.set(y.some(t))}};var t,e,n}();i.set(cv(Ke.fromDom(t.getBody()),"load",o)),t.on("remove",function(){i.clear()})}(t,c,l),t.nodeChanged()}};return t.on("focus",f),t.on("blur hide",l.hide),t.on("init",function(){t.hasFocus()&&f()}),Hp(t,e),{editorContainer:u.element().dom()}}}),RO=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},BO=function(t){(function(t){!function(t){hC.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:GS(t,e.name),onAction:RO(t,e.name)})});for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:GS(t,n),onAction:RO(t,n)})}}(t),function(t){hC.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)}})})}(t),function(t){hC.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:function(){return t.execCommand(e.action)},onSetup:GS(t,e.name)})})}(t)})(t),function(t){hC.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:function(){return t.execCommand(e.action)}})}),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:RO(t,"code")})}(t)},IO=function(t,e,n){var r=function(){return!!e.undoManager&&e.undoManager[n]()},o=function(){t.setDisabled(e.mode.isReadOnly()||!r())};return t.setDisabled(!r()),e.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o),function(){return e.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o)}},PO=function(t,e){!function(t){hC.each([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,onAction:function(){return t.execCommand(e.cmd)},icon:e.icon,onSetup:GS(t,e.name)})});t.ui.registry.addButton("alignnone",{tooltip:"No alignment",onAction:function(){return t.execCommand("JustifyNone")},icon:"align-none"})}(t),BO(t),function(t,e){!function(t,e){var n=PS(0,e,jS(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=PS(0,e,US(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=d({type:"advanced"},e.styleselect),r=PS(0,e,JS(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=PS(0,e,XS(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=PS(0,e,qS(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)}(t,e),function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(e){return IO(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(e){return IO(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(e){return IO(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(e){return IO(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(t)}(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",function(e,n){!function(t,e,n){t.undoManager.transact(function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()})}(t,e,n)}),t.addCommand("mceRemoveTextcolor",function(e){!function(t,e){t.undoManager.transact(function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()})}(t,e)})}(t);var e=Ye(null),n=Ye(null);Yg(t,"forecolor","forecolor","Text color",e),Yg(t,"backcolor","hilitecolor","Background color",n),Gg(t,"forecolor","forecolor","Text color"),Gg(t,"backcolor","hilitecolor","Background color")}(t),function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return t.execCommand("mceToggleVisualAid")}})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(e){return function(t,e){t.setActive(e.hasVisual);var n=function(e){t.setActive(e.hasVisual)};return e.on("VisualAid",n),function(){return e.off("VisualAid",n)}}(e,t)},onAction:function(){t.execCommand("mceToggleVisualAid")}})}(t)}(t),function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(e){return function(t,e){t.setDisabled(!e.queryCommandState("outdent"));var n=function(){t.setDisabled(!e.queryCommandState("outdent"))};return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}(e,t)},onAction:function(){return t.execCommand("outdent")}}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return t.execCommand("indent")}})}(t)}(t)},MO=function(t,e){return{anchor:"makeshift",x:t,y:e}},LO=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},FO=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(LO(t)){var e=t.touches[0];return MO(e.pageX,e.pageY)}return MO(t.pageX,t.pageY)}(e):function(t,e){var n=ep.DOM.getPos(t);return function(t,e,n){return MO(t.x+e,t.y+n)}(e,n.x,n.y)}(t.getContentAreaContainer(),function(t){if(LO(t)){var e=t.touches[0];return MO(e.clientX,e.clientY)}return MO(t.clientX,t.clientY)}(e)):HO(t)},HO=function(t){return{anchor:"selection",root:Ke.fromDom(t.selection.getNode())}},jO=function(t){return{anchor:"node",node:y.some(Ke.fromDom(t.selection.getNode())),root:Ke.fromDom(t.getBody())}},VO={onLtr:function(){return[nu,Ja,Qa,Za,tu,eu,$m,Ym,Wm,zm,qm,Um]},onRtl:function(){return[nu,Qa,Ja,tu,Za,eu,$m,Ym,qm,Um,Wm,zm]}},zO={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},UO=function(t,e,n,r,o,i){var a=bn(),u=a.os.isiOS(),s=a.os.isOSX(),c=a.os.isAndroid(),l=a.deviceType.isTouch(),f=function(){var a=n();!function(t,e,n,r,o,i,a){var u=function(t,e,n){var r=i?jO(t):FO(t,n);return d({bubble:Gu(0,12,zO),layouts:VO,overrides:{maxWidthFunction:U_(),maxHeightFunction:Wu()}},r)}(t,0,e);jw(n,xh.CLOSE_ON_EXECUTE,r,!0).map(function(n){e.preventDefault(),Mm.showMenuWithinBounds(o,u,{menu:{markers:Eh("normal"),highlightImmediately:a},data:n,type:"horizontal"},function(){return y.some(DS(t,r.shared))}),t.fire("contexttoolbar-hide")})}(t,e,a,r,o,i,!(c||u||s&&l))};if(!s&&!u||i)c&&!i&&t.selection.setCursorLocation(e.target,0),f();else{var m=function(){!function(t){var e=t.selection.getRng(),n=function(){Gm.setEditorTimeout(t,function(){t.selection.setRng(e)},10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),f()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return ws(t.getWin(),ss.domRange(o)).exists(function(t){return t.left()<=r.clientX&&t.right()>=r.clientX&&t.top()<=r.clientY&&t.bottom()>=r.clientY})}(t,e)?(t.once("selectionchange",m),t.once("touchend",function(){return t.off("selectionchange",m)})):m()}},WO=function(t){return"string"==typeof t?t.split(/[ ,]/):t},qO=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},$O=function(t){return C(t)?"|"===t:"separator"===t.type},YO={type:"separator"},GO=function t(e){if(C(e))return e;switch(e.type){case"separator":return YO;case"submenu":return{type:"nestedmenuitem",text:e.text,icon:e.icon,getSubmenuItems:function(){var n=e.getSubmenuItems();return C(n)?n:H(n,t)}};default:return{type:"menuitem",text:e.text,icon:e.icon,onAction:(n=e.onAction,function(){return n()})}}var n},KO=function(t,e){if(0===e.length)return t;var n=tt(t).filter(function(t){return!$O(t)}).fold(function(){return[]},function(t){return[YO]});return t.concat(n).concat(e).concat([YO])},XO=function(t,e,n){var r=bn().deviceType.isTouch,o=Ai(Mm.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:hu([Jd("dismissContextMenu",[Dr(fr(),function(e,n){Cc.close(e),t.focus()})])])})),i=function(t){return Mm.hide(o)},a=function(e){if(qO(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!qO(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var i=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)}(t,e);(r()?UO:function(t,e,n,r,o,i){var a=n(),u=function(t,e,n){return i?jO(t):FO(t,e)}(t,e);jw(a,xh.CLOSE_ON_EXECUTE,r,!1).map(function(t){e.preventDefault(),Mm.showMenuAt(o,u,{menu:{markers:Eh("normal")},data:t})})})(t,e,function(){var n=i?t.selection.getStart(!0):e.target,r=t.ui.registry.getAll(),o=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return y.from(t.getParam("contextmenu")).map(WO).getOrThunk(function(){return z(WO("link linkchecker image imagetools table spellchecker configurepermanentpen"),function(t){return _t(r,t)})})}(t)}(t);return function(t,e,n){var r=W(o,function(e,r){if(_t(t,r)){var o=t[r].update(n);if(C(o))return KO(e,o.split(" "));if(o.length>0){var i=H(o,GO);return KO(e,i)}return e}return e.concat([r])},[]);return r.length>0&&$O(r[r.length-1])&&r.pop(),r}(r.contextMenus,0,n)},n,o,i)}};t.on("init",function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");t.on(e,i),t.on("longpress contextmenu",a)})},JO=St([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),QO=function(t){return function(e){return e.translate(-t.left(),-t.top())}},ZO=function(t){return function(e){return e.translate(t.left(),t.top())}},tD=function(t){return function(e,n){return W(t,function(t,e){return e(t)},Li(e,n))}},eD=function(t,e,n){return t.fold(tD([ZO(n),QO(e)]),tD([QO(e)]),tD([]))},nD=function(t,e,n){return t.fold(tD([ZO(n)]),tD([]),tD([ZO(e)]))},rD=function(t,e,n){return t.fold(tD([]),tD([QO(n)]),tD([ZO(e),QO(n)]))},oD=function(t,e,n){var r=t.fold(function(t,e){return{position:y.some("absolute"),left:y.some(t+"px"),top:y.some(e+"px")}},function(t,e){return{position:y.some("absolute"),left:y.some(t-n.left()+"px"),top:y.some(e-n.top()+"px")}},function(t,e){return{position:y.some("fixed"),left:y.some(t+"px"),top:y.some(e+"px")}});return d({right:y.none(),bottom:y.none()},r)},iD=function(t,e,n,r){var o=function(t,o){return function(i,a){var u=t(e,n,r);return o(i.getOr(u.left()),a.getOr(u.top()))}};return t.fold(o(rD,aD),o(nD,uD),o(eD,sD))},aD=JO.offset,uD=JO.absolute,sD=JO.fixed,cD=function(t,e){var n=mo(t,e);return T(n)?NaN:parseInt(n,10)},lD=function(t,e,n,r,o,i){var a=function(t,e,n,r){return function(t,e){var n=t.element(),r=cD(n,e.leftAttr),o=cD(n,e.topAttr);return isNaN(r)||isNaN(o)?y.none():y.some(Li(r,o))}(t,e).fold(function(){return n},function(t){return sD(t.left()+r.left(),t.top()+r.top())})}(t,e,n,r),u=e.mustSnap?dD(t,e,a,o,i):mD(t,e,a,o,i),s=eD(a,o,i);return function(t,e,n){var r=t.element();fo(r,e.leftAttr,n.left()+"px"),fo(r,e.topAttr,n.top()+"px")}(t,e,s),u.fold(function(){return{coord:sD(s.left(),s.top()),extra:y.none()}},function(t){return{coord:t.output,extra:t.extra}})},fD=function(t,e,n,r){return nt(t,function(t){var o=t.sensor;return function(t,e,n,r,o,i){var a=nD(t,o,i),u=nD(e,o,i);return Math.abs(a.left()-u.left())<=n&&Math.abs(a.top()-u.top())<=r}(e,o,t.range.left(),t.range.top(),n,r)?y.some({output:iD(t.output,e,n,r),extra:t.extra}):y.none()})},dD=function(t,e,n,r,o){var i=e.getSnapPoints(t);return fD(i,n,r,o).orThunk(function(){return W(i,function(t,e){var i=e.sensor,a=function(t,e,n,r,o,i){var a=nD(t,o,i),u=nD(e,o,i),s=Math.abs(a.left()-u.left()),c=Math.abs(a.top()-u.top());return Li(s,c)}(n,i,e.range.left(),e.range.top(),r,o);return t.deltas.fold(function(){return{deltas:y.some(a),snap:y.some(e)}},function(n){return(a.left()+a.top())/2<=(n.left()+n.top())/2?{deltas:y.some(a),snap:y.some(e)}:t})},{deltas:y.none(),snap:y.none()}).snap.map(function(t){return{output:iD(t.output,n,r,o),extra:t.extra}})})},mD=function(t,e,n,r,o){var i=e.getSnapPoints(t);return fD(i,n,r,o)},hD=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element());if(e.repositionTarget){var i=$r(t.element()),a=Yi(i),u=vT(o),s=function(t,e,n){return{coord:iD(t.output,t.output,e,n),extra:t.extra}}(r,a,u),c=oD(s.coord,0,u);hi(o,c)}}}),pD=function(t,e){t.getSystem().addToGui(e),function(t){Xr(t.element()).filter(zr).each(function(e){vi(e,"z-index").each(function(t){fo(e,"data-initial-z-index",t)}),di(e,"z-index",pi(t.element(),"z-index"))})}(e)},gD=function(t){!function(t){Xr(t.element()).filter(zr).each(function(t){ho(t,"data-initial-z-index").fold(function(){return xi(t,"z-index")},function(e){return di(t,"z-index",e)}),go(t,"data-initial-z-index")})}(t),t.getSystem().removeFromGui(t)},vD=function(t,e,n){return t.getSystem().build(_v.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},bD=Le("snaps",[_e("getSnapPoints"),Oa("onSensor"),_e("leftAttr"),_e("topAttr"),Fe("lazyViewport",na),Fe("mustSnap",!1)]),yD=[Fe("useFixed",c),_e("blockerClass"),Fe("getTarget",i),Fe("onDrag",n),Fe("repositionTarget",!0),Fe("onDrop",n),We("getBounds",na),bD],xD=function(t,e){return{bounds:t.getBounds(),height:Mi(e.element()),width:Ui(e.element())}},wD=function(t,e,n,r,o){var i=n.update(r,o),a=n.getStartData().getOrThunk(function(){return xD(e,t)});i.each(function(n){!function(t,e,n,r){var o=e.getTarget(t.element());if(e.repositionTarget){var i=$r(t.element()),a=Yi(i),u=vT(o),s=function(t){return(e=vi(t,"left"),n=vi(t,"top"),r=vi(t,"position"),o=function(t,e,n){return("fixed"===n?sD:aD)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?y.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):y.none()).getOrThunk(function(){var e=Hi(t);return uD(e.left(),e.top())});var e,n,r,o}(o),c=function(t,e,n,r,o,i,a){return function(t,e,n,r,o){var i=o.bounds,a=nD(e,n,r),u=Hu(a.left(),i.x,i.x+i.width-o.width),s=Hu(a.top(),i.y,i.y+i.height-o.height),c=uD(u,s);return e.fold(function(){var t=rD(c,n,r);return aD(t.left(),t.top())},function(){return c},function(){var t=eD(c,n,r);return sD(t.left(),t.top())})}(0,e.fold(function(){var t,e,a,u=(t=n,e=i.left(),a=i.top(),t.fold(function(t,n){return aD(t+e,n+a)},function(t,n){return uD(t+e,n+a)},function(t,n){return sD(t+e,n+a)})),s=eD(u,r,o);return sD(s.left(),s.top())},function(e){var a=lD(t,e,n,i,r,o);return a.extra.each(function(n){e.onSensor(t,n)}),a.coord}),r,o,a)}(t,e.snaps,s,a,u,r,n),l=oD(c,0,u);hi(o,l)}e.onDrag(t,o,r)}(t,e,a,n)})},CD=function(t,e,n,r){e.each(gD),n.snaps.each(function(e){!function(t,e){!function(t,e){var n=t.element();go(n,e.leftAttr),go(n,e.topAttr)}(t,e)}(t,e)});var o=n.getTarget(t.element());r.reset(),n.onDrop(t,o)},_D=function(t){return function(e,n){var r=function(t){n.setStartData(xD(e,t))};return Sr(h([Dr(ur(),function(t){n.getStartData().each(function(){return r(t)})})],t(e,n,r)))}},kD=Object.freeze({__proto__:null,getData:function(t){return y.from(Li(t.x(),t.y()))},getDelta:function(t,e){return Li(e.left()-t.left(),e.top()-t.top())}}),SD=function(t,e,n){return[Dr(Bn(),function(r,o){if(0===o.event().raw().button){o.stop();var i=function(){return CD(r,y.some(s),t,e)},a=dv(i,200),u={drop:i,delayDrop:a.schedule,forceDrop:i,move:function(n){a.cancel(),wD(r,t,e,kD,n)}},s=vD(r,t.blockerClass,function(t){return Sr([Dr(Bn(),t.forceDrop),Dr(Mn(),t.drop),Dr(In(),function(e,n){t.move(n.event())}),Dr(Pn(),t.delayDrop)])}(u));n(r),pD(r,s)}})]},TD=h(yD,[Aa("dragger",{handlers:_D(SD)})]),OD=Object.freeze({__proto__:null,getData:function(t){var e=t.raw().touches;return 1===e.length?function(t){var e=t[0];return y.some(Li(e.clientX,e.clientY))}(e):y.none()},getDelta:function(t,e){return Li(e.left()-t.left(),e.top()-t.top())}}),DD=function(t,e,n){var r=Ye(y.none());return[Dr(En(),function(o,i){i.stop();var a=function(){CD(o,r.get(),t,e),r.set(y.none())},u={drop:a,delayDrop:function(){},forceDrop:a,move:function(n){wD(o,t,e,OD,n)}},s=vD(o,t.blockerClass,function(t){return Sr([Dr(En(),t.forceDrop),Dr(An(),t.drop),Dr(Rn(),t.drop),Dr(Nn(),function(e,n){t.move(n.event())})])}(u));r.set(y.some(s)),n(o),pD(o,s)}),Dr(Nn(),function(n,r){r.stop(),wD(n,t,e,OD,r.event())}),Dr(An(),function(n,o){o.stop(),CD(n,r.get(),t,e),r.set(y.none())}),Dr(Rn(),function(n){CD(n,r.get(),t,e),r.set(y.none())})]},ED=TD,ND=h(yD,[Aa("dragger",{handlers:_D(DD)})]),AD=h(yD,[Aa("dragger",{handlers:_D(function(t,e,n){return h(SD(t,e,n),DD(t,e,n))})})]),RD=bu({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:ED,touch:ND,mouseOrTouch:AD}),name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:y.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var t=y.none(),e=y.none(),n=o({});return Ho({readState:n,reset:function(){t=y.none(),e=y.none()},update:function(e,n){return e.getData(n).bind(function(n){return function(e,n){var r=t.map(function(t){return e.getDelta(t,n)});return t=y.some(n),r}(e,n)})},getStartData:function(){return e},setStartData:function(t){e=y.some(t)}})}}),apis:hD}),BD=function(t,e,n,r,o,i){return t.fold(function(){return RD.snap({sensor:uD(n-20,r-20),range:Li(o,i),output:uD(y.some(n),y.some(r)),extra:{td:e}})},function(t){var o=n-20,i=r-20,a=t.element().dom().getBoundingClientRect();return RD.snap({sensor:uD(o,i),range:Li(40,40),output:uD(y.some(n-a.width/2),y.some(r-a.height/2)),extra:{td:e}})})},ID=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists(function(t){return wn(t,e)})})(e.get(),o)||(e.set(y.some(o)),n(o))},mustSnap:!0}},PD=function(t){return Xm(Km.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:hu([RD.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),Rb.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},MD=function(t,e){var n=Ye([]),r=Ye([]),o=Ye(!1),i=Ye(y.none()),a=Ye(y.none()),u=function(t){var n=ea(t);return BD(f.getOpt(e),t,n.x,n.y,n.width,n.height)},s=function(t){var n=ea(t);return BD(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},c=ID(function(){return H(n.get(),function(t){return u(t)})},i,function(e){a.get().each(function(n){t.fire("TableSelectorChange",{start:e,finish:n})})}),l=ID(function(){return H(r.get(),function(t){return s(t)})},a,function(e){i.get().each(function(n){t.fire("TableSelectorChange",{start:n,finish:e})})}),f=PD(c),d=PD(l),m=Ai(f.asSpec()),h=Ai(d.asSpec()),p=function(e,n,r,o){var i=r(n);RD.snapTo(e,i),function(e,n,r,o){var i=n.dom().getBoundingClientRect();xi(e.element(),"display");var a=Kr(Ke.fromDom(t.getBody())).dom().innerHeight,u=r(i),s=o(i,a);(u||s)&&di(e.element(),"display","none")}(e,n,function(t){return t[o]<0},function(t,e){return t[o]>e})},g=function(t){return p(m,t,u,"top")},v=function(t){return p(h,t,s,"bottom")};bn().deviceType.isTouch()&&(t.on("TableSelectionChange",function(t){o.get()||(ic(e,m),ic(e,h),o.set(!0)),i.set(y.some(t.start)),a.set(y.some(t.finish)),t.otherCells.each(function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),g(t.start),v(t.finish)})}),t.on("ResizeEditor ResizeWindow ScrollContent",function(){i.get().each(g),a.get().each(v)}),t.on("TableSelectionClear",function(){o.get()&&(sc(m),sc(h),o.set(!1)),i.set(y.none()),a.set(y.none())}))};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(LS||(LS={}));var LD=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},FD=function(t,e){var n,r,o=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(function(t,e,n){return e.delimiter||(e.delimiter="»"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:hu([qd.config({mode:"flow",selector:"div[role=button]"}),dp.config({disabled:n.isReadOnly}),jp(),Nv.config({}),Xd.config({}),Jd("elementPathEvents",[Mr(function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return qd.focusIn(r)}),t.on("NodeChange",function(o){var i,a,u=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!LD(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);u.length>0?Xd.set(r,(i=H(u||[],function(e,r){return Km.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:hu([zp(n.isReadOnly),jp()])})}),a={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},W(i.slice(1),function(t,e){var n=t;return n.push(a),n.push(e),n},[i[0]]))):Xd.set(r,[])})})])]),components:[]}}(t,{},e)),sn(t.getParam("plugins","","string"),"wordcount")&&r.push(function(t,e){var n=function(t,n,r){return Xd.set(t,[Di(e.translate(["{0} "+r,n[r]]))])};return Km.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:hu([zp(e.isReadOnly),jp(),Nv.config({}),Xd.config({}),zc.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Jd("wordcount-events",[Hr(function(t){var e=zc.getValue(t),r="words"===e.mode?"characters":"words";zc.setValue(t,{mode:r,count:e.count}),n(t,e.count,r)}),Mr(function(e){t.on("wordCountUpdate",function(t){var r=zc.getValue(e).mode;zc.setValue(e,{mode:r,count:t.wordCount}),n(e,t.wordCount,r)})})])]),eventOrder:{"alloy.execute":["disabling","alloy.base.behaviour","wordcount-events"]}})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=np.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(n=o(),r=function(t){var e=!sn(t.getParam("plugins","","string"),"autoresize"),n=t.getParam("resize",e);return!1===n?LS.None:"both"===n?LS.Both:LS.Vertical}(t),r!==LS.None&&n.push(function(n){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize"),"aria-hidden":"true"},innerHtml:Qm("resize-handle",e.icons)},behaviours:hu([RD.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){!function(t,e,n){var r=Ke.fromDom(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=DO(r+e.top(),vp(t),yp(t)),n===LS.Both&&(i.width=DO(o+e.left(),gp(t),bp(t))),i}(t,e,n,Pi(r),zi(r));gt(o,function(t,e){return di(r,e,OO(t))}),function(t){t.fire("ResizeEditor")}(t)}(t,o,n)},blockerClass:"tox-blocker"})])}}(r)),n)}},HD=function(t){var n,r=t.inline,o=r?AO:SO,i=Rp(t)?HT:UT,a=y.none(),u=bn(),s=u.browser.isIE()?["tox-platform-ie"]:[],c=u.deviceType.isTouch()?["tox-platform-touch"]:[],l=Dp(t),f=np.isRtl()?{attributes:{dir:"rtl"}}:{},m={attributes:(n={},n[Qu]=l?ha.BottomToTop:ha.TopToBottom,n)},h=function(){return a.bind(mO.getHeader)},p=Ai({dom:d({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(s).concat(c)},f),behaviours:hu([tc.config({useFixed:function(){return i.isDocked(h)}})])}),g=function(){return it.value(p)},v=Xm({dom:{tag:"div",classes:["tox-anchorbar"]}}),b=function(){return a.bind(function(t){return mO.getThrobber(t)}).getOrDie("Could not find throbber element")},x=function(t,e,n){var r=Ye(!1),o=function(t){var e=Ye(Dp(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:np.translate,isReadOnly:function(){return e.mode.isReadOnly()}},interpreter:function(t){return function(t,e){return t_(QC,t,i)}(t)},anchors:a_(e,n,o.isPositionedAtTop),header:o,getSink:function(){return it.value(t)}},urlinput:z_(e),styleselect:b_(e),colorinput:f_(e),dialog:m_(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i}(p,t,function(){return a.bind(function(t){return v.getOpt(t)}).getOrDie("Could not find a anchor bar element")}),w=mO.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:x,onEscape:function(){t.focus()}}),C=Sp(t),_=mO.parts().toolbar(d({dom:{tag:"div",classes:["tox-toolbar"]},getSink:g,providers:x.shared.providers,onEscape:function(){t.focus()},type:C,lazyToolbar:function(){return a.bind(function(t){return mO.getToolbar(t)}).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return h().getOrDie("Could not find header element")}},m)),k=mO.parts()["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:x.shared.providers,onEscape:function(){},type:C}),S=mO.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),T=mO.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),O=mO.parts().throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:x}),D=t.getParam("statusbar",!0,"boolean")&&!r?y.some(FD(t,x.shared.providers)):y.none(),E={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[S,T]},N=_p(t),A=wp(t),R=xp(t),B=mO.parts().header({dom:d({tag:"div",classes:["tox-editor-header"]},m),components:Y([R?[w]:[],N?[k]:A?[_]:[],Np(t)?[]:[v.asSpec()]]),sticky:Rp(t),editor:t,sharedBackstage:x.shared}),I=Y([l?[]:[B],r?[]:[E],l?[B]:[]]),P=Y([[{dom:{tag:"div",classes:["tox-editor-container"]},components:I}],r?[]:D.toArray(),[O]]),M=Ap(t),L=d(d({role:"application"},np.isRtl()?{dir:"rtl"}:{}),M?{"aria-hidden":"true"}:{}),F=Ai(mO.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(r?["tox-tinymce-inline"]:[]).concat(l?["tox-tinymce--toolbar-bottom"]:[]).concat(c).concat(s),styles:d({visibility:"hidden"},M?{opacity:"0",border:"0"}:{}),attributes:L},components:P,behaviours:hu([qd.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a"})])}));a=y.some(F),t.shortcuts.add("alt+F9","focus menubar",function(){mO.focusMenubar(F)}),t.shortcuts.add("alt+F10","focus toolbar",function(){mO.focusToolbar(F)});var H=kv(F),V=kv(p);!function(t,n,r){var o=function(t,e){j([n,r],function(n){n.broadcastEvent(t,e)})},i=function(t,e){j([n,r],function(n){n.broadcastOn([t],e)})},a=function(t){return i(_c(),{target:t.target()})},u=sv(Ke.fromDom(e.document),"touchstart",a),s=sv(Ke.fromDom(e.document),"touchmove",function(t){return o(ir(),t)}),c=sv(Ke.fromDom(e.document),"touchend",function(t){return o(ar(),t)}),l=sv(Ke.fromDom(e.document),"mousedown",a),f=sv(Ke.fromDom(e.document),"mouseup",function(t){0===t.raw().button&&i(Sc(),{target:t.target()})}),d=function(t){return i(_c(),{target:Ke.fromDom(t.target)})},m=function(t){0===t.button&&i(Sc(),{target:Ke.fromDom(t.target)})},h=function(t){return o(ur(),lv(t))},p=function(t){i(kc(),{}),o(sr(),lv(t))},g=function(){return i(kc(),{})};t.on("PostRender",function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("ScrollWindow",h),t.on("ResizeWindow",p),t.on("ResizeEditor",g)}),t.on("remove",function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("ScrollWindow",h),t.off("ResizeWindow",p),t.off("ResizeEditor",g),l.unbind(),u.unbind(),s.unbind(),c.unbind(),f.unbind()}),t.on("detach",function(){dc(n),dc(r),n.destroy(),r.destroy()})}(t,H,V);var z=function(){var e=OO(function(t){return function(t){var e=hp(t),n=vp(t),r=yp(t);return TO(e).map(function(t){return DO(t,n,r)})}(t).getOr(hp(t))}(t)),n=OO(function(t){return EO(t).getOr(pp(t))}(t));return t.inline||(yi("div","width",n)&&di(F.element(),"width",n),yi("div","height",e)?di(F.element(),"height",e):di(F.element(),"height","200px")),e};return{mothership:H,uiMothership:V,backstage:x,renderUI:function(){i.setup(t,x.shared,h),PO(t,x),XO(t,g,x),function(t){var e=t.ui.registry.getAll().sidebars;j(ht(e),function(n){var r=e[n],o=function(){return y.from(t.queryCommandValue("ToggleSidebar")).is(n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})})}(t),iO(t,b,x.shared),vt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),function(e,n){t.ui.registry.addGroupToolbarButton(n,e)});var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,a=e.contextToolbars,u=e.sidebars,s=Cp(t),c={menuItems:r,menus:Bp(t),menubar:Ip(t),toolbar:s.getOrThunk(function(){return function(t){return t.getParam("toolbar",!0)}(t)}),allowToolbarGroups:C===yh.floating,buttons:n,sidebar:u};cT(t,a,p,{backstage:x}),MD(t,p);var l=t.getElement(),f=z(),d={mothership:H,uiMothership:V,outerContainer:F},m={targetNode:l,height:f};return o.render(t,d,c,x,m)},getUi:function(){return{channels:{broadcastAll:V.broadcast,broadcastOn:V.broadcastOn,register:function(){}}}}}},jD=o([_e("lazySink"),Re("dragBlockClass"),We("getBounds",na),Fe("useTabstopAt",o(!0)),Fe("eventOrder",{}),Uc("modalBehaviours",[qd]),Da("onExecute"),Na("onEscape")]),VD={sketch:i},zD=o([vl({name:"draghandle",overrides:function(t,e){return{behaviours:hu([RD.config({mode:"mouse",getTarget:function(t){return sa(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),pl({schema:[_e("dom")],name:"title"}),pl({factory:VD,schema:[_e("dom")],name:"close"}),pl({factory:VD,schema:[_e("dom")],name:"body"}),vl({factory:VD,schema:[_e("dom")],name:"footer"}),gl({factory:{sketch:function(t,e){return d(d({},t),{dom:e.dom,components:e.components})}},schema:[Fe("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Fe("components",[])],name:"blocker"})]),UD=Wl({name:"ModalDialog",configFields:jD(),partFields:zD(),factory:function(t,e,n,r){var o=Co("alloy.dialog.busy"),a=Co("alloy.dialog.idle"),u=hu([qd.config({mode:"special",onTab:function(){return y.some(!0)},onShiftTab:function(){return y.some(!0)}}),nm.config({})]),s=Co("modal-events"),c=d(d({},t.eventOrder),{"alloy.system.attached":[s].concat(t.eventOrder["alloy.system.attached"]||[])});return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){var n=t.lazySink(e).getOrDie(),i=Ye(y.none()),s=r.blocker(),c=n.getSystem().build(d(d({},s),{components:s.components.concat([Ri(e)]),behaviours:hu([nm.config({}),Jd("dialog-blocker-events",[Pr(Fn(),function(){qd.focusIn(e)}),Dr(a,function(t,n){po(e.element(),"aria-busy")&&(go(e.element(),"aria-busy"),i.get().each(function(t){return Xd.remove(e,t)}))}),Dr(o,function(t,n){fo(e.element(),"aria-busy","true");var r=n.event().getBusySpec();i.get().each(function(t){Xd.remove(e,t)});var o=r(e,u),a=t.getSystem().build(o);i.set(y.some(a)),Xd.append(e,Ri(a)),a.hasConfigured(qd)&&qd.focusIn(a)})])])}));ic(n,c),qd.focusIn(e)},hide:function(t){Xr(t.element()).each(function(e){t.getSystem().getByDom(e).each(function(t){sc(t)})})},getBody:function(e){return Nl(e,t,"body")},getFooter:function(e){return Nl(e,t,"footer")},setIdle:function(t){yr(t,a)},setBusy:function(t,e){xr(t,o,{getBusySpec:e})}},eventOrder:c,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:qc(t.modalBehaviours,[Xd.config({}),qd.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),Jd(s,[Mr(function(e){var n,r,o,a,u,s;n=e.element(),r=Nl(e,t,"title").element(),o=y.from(mo(n,"id")).fold(function(){var t=Co("dialog-label");return fo(r,"id",t),t},i),fo(n,"aria-labelledby",o),a=e.element(),u=Nl(e,t,"body").element(),s=y.from(mo(a,"id")).fold(function(){var t=Co("dialog-describe");return fo(u,"id",t),t},i),fo(a,"aria-describedby",s)})])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),WD=Qt([Te("type"),Te("name")].concat(Hh)),qD=ye,$D=[re("name","name",Mt(function(){return Co("button-name")}),be),Pe("icon"),ze("align","end",["start","end"]),Ue("primary",!1),Ue("disabled",!1)],YD=h($D,[Te("text")]),GD=h([Oe("type",["submit","cancel","custom"])],YD),KD=h([Oe("type",["menu"]),Pe("text"),Pe("tooltip"),Pe("icon"),Ae("items",WD)],$D),XD=he("type",{submit:GD,cancel:GD,custom:GD,menu:KD}),JD=[Te("type"),Te("text"),Oe("level",["info","warn","error","success"]),Te("icon"),Fe("url","")],QD=Qt(JD),ZD=[Te("type"),Te("text"),Ue("disabled",!1),Ue("primary",!1),re("name","name",Mt(function(){return Co("button-name")}),be),Pe("icon"),Ue("borderless",!1)],tE=Qt(ZD),eE=[Te("type"),Te("name"),Te("label"),Ue("disabled",!1)],nE=Qt(eE),rE=ye,oE=[Te("type"),Te("name")],iE=oE.concat([Pe("label")]),aE=Qt(iE),uE=be,sE=Qt(iE),cE=be,lE=Qt(iE),fE=Zt(ie),dE=function(t){return[Te("type"),Se("columns"),t]},mE=iE.concat([Ue("sandboxed",!0)]),hE=Qt(mE),pE=be,gE=iE.concat([Pe("inputMode"),Pe("placeholder"),Ue("maximized",!1),Ue("disabled",!1)]),vE=Qt(gE),bE=be,yE=iE.concat([Ne("items",[Te("text"),Te("value")]),je("size",1),Ue("disabled",!1)]),xE=Qt(yE),wE=be,CE=iE.concat([Ue("constrain",!0),Ue("disabled",!1)]),_E=Qt(CE),kE=Qt([Te("width"),Te("height")]),SE=iE.concat([Pe("placeholder"),Ue("maximized",!1),Ue("disabled",!1)]),TE=Qt(SE),OE=be,DE=iE.concat([ze("filetype","file",["image","media","file"]),Fe("disabled",!1)]),EE=Qt(DE),NE=Qt([Te("value"),Fe("meta",{})]),AE=oE.concat([Ve("tag","textarea"),Te("scriptId"),Te("scriptUrl"),He("settings",void 0,we)]),RE=oE.concat([Ve("tag","textarea"),De("init")]),BE=ue(function(t){return ce("customeditor.old",Jt(RE),t).orThunk(function(){return ce("customeditor.new",Jt(AE),t)})}),IE=be,PE=[Te("type"),Te("html"),ze("presets","presentation",["presentation","document"])],ME=Qt(PE),LE=iE.concat([ke("currentState",Qt([_e("blob"),Te("url")]))]),FE=Qt(LE),HE=iE.concat([Fe("columns","auto")]),jE=Qt(HE),VE=ae([Te("value"),Te("text"),Te("icon")]),zE=function(t){return[Te("type"),Te("label"),t]},UE=[Te("type"),Ae("header",be),Ae("cells",Zt(be))],WE=Qt(UE),qE=function(t){return re("items","items",It(),Zt(ue(function(e){return ce("Checking item of "+t,$E,e).fold(function(t){return it.error(de(t))},function(t){return it.value(t)})})))},$E=function(t){return{extract:function(e,n,r){return t().extract(e,n,r)},toString:function(){return t().toString()}}}(function(){return me("type",{alertbanner:QD,bar:Qt((t=qE("bar"),[Te("type"),t])),button:tE,checkbox:nE,colorinput:aE,colorpicker:sE,dropzone:lE,grid:Qt(dE(qE("grid"))),iframe:hE,input:vE,selectbox:xE,sizeinput:_E,textarea:TE,urlinput:EE,customeditor:BE,htmlpanel:ME,imagetools:FE,collection:jE,label:Qt(zE(qE("label"))),table:WE,panel:GE});var t}),YE=[Te("type"),Fe("classes",[]),Ae("items",$E)],GE=Qt(YE),KE=[re("name","name",Mt(function(){return Co("tab-name")}),be),Te("title"),Ae("items",$E)],XE=[Te("type"),Ne("tabs",KE)],JE=Qt(XE),QE=YD,ZE=XD,tN=Qt([Te("title"),ke("body",me("type",{panel:GE,tabpanel:JE})),Ve("size","normal"),Ae("buttons",ZE),Fe("initialData",{}),We("onAction",n),We("onChange",n),We("onSubmit",n),We("onClose",n),We("onCancel",n),Fe("onTabChange",n)]),eN=function(t){return C(t.type)&&C(t.name)},nN={checkbox:rE,colorinput:uE,colorpicker:cE,dropzone:fE,input:bE,iframe:pE,sizeinput:kE,selectbox:wE,size:kE,textarea:OE,urlinput:NE,customeditor:IE,collection:VE,togglemenuitem:qD},rN=function(t){var e=function(t){return z(function t(e){return _(e)?[e].concat(G(wt(e),t)):k(e)?G(e,t):[]}(t),eN)}(t),n=G(e,function(t){return function(t){return y.from(nN[t.type])}(t).fold(function(){return[]},function(e){return[ke(t.name,e)]})});return Qt(n)},oN=Qt(h([Oe("type",["cancel","custom"])],QE)),iN=Qt([Te("title"),Te("url"),Ie("height"),Ie("width"),Be("buttons",Zt(oN)),We("onAction",n),We("onCancel",n),We("onClose",n),We("onMessage",n)]),aN=function(t){return{internalDialog:le(ce("dialog",tN,t)),dataValidator:rN(t),initialData:t.initialData}},uN={open:function(t,e){var n=aN(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(le(ce("dialog",iN,e)))},redial:function(t){return aN(t)}},sN=function(t){var e=[],n={};return gt(t,function(t,r){t.fold(function(){e.push(r)},function(t){n[r]=t})}),e.length>0?it.error(e):it.value(n)},cN=function(t,n){var r=Xm(_x.sketch(function(e){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:H(t.items,function(t){return ZC(e,t,n)})}}));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[r.asSpec()]}],behaviours:hu([qd.config({mode:"acyclic",useTabstopAt:u(Gx)}),Ax(r),Fx(r,{postprocess:function(t){return sN(t).fold(function(t){return e.console.error(t),{}},function(t){return t})}})])}},lN=Ul({name:"TabButton",configFields:[Fe("uid",void 0),_e("value"),re("dom","dom",Lt(function(){return{attributes:{role:"tab",id:Co("aria"),"aria-selected":"false"}}}),pe()),Re("action"),Fe("domModification",{}),Uc("tabButtonBehaviours",[nm,qd,zc]),_e("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:gm(t.action),behaviours:qc(t.tabButtonBehaviours,[nm.config({}),qd.config({mode:"execution",useSpace:!0,useEnter:!0}),zc.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),fN=o([_e("tabs"),_e("dom"),Fe("clickToDismiss",!1),Uc("tabbarBehaviours",[af,qd]),Sa(["tabClass","selectedClass"])]),dN=bl({factory:lN,name:"tabs",unit:"tab",overrides:function(t){return{action:function(e){var r=e.getSystem().getByUid(t.uid).getOrDie(),o=af.isHighlighted(r,e);(o&&t.clickToDismiss?function(t,e){af.dehighlight(t,e),xr(t,gr(),{tabbar:t,button:e})}:o?n:function(t,e){af.highlight(t,e),xr(t,pr(),{tabbar:t,button:e})})(r,e)},domModification:{classes:[t.markers.tabClass]}}}}),mN=o([dN]),hN=Wl({name:"Tabbar",configFields:fN(),partFields:mN(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:qc(t.tabbarBehaviours,[af.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){fo(e.element(),"aria-selected","true")},onDehighlight:function(t,e){fo(e.element(),"aria-selected","false")}}),qd.config({mode:"flow",getInitial:function(t){return af.getHighlighted(t).map(function(t){return t.element()})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),pN=Ul({name:"Tabview",configFields:[Uc("tabviewBehaviours",[Xd])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:qc(t.tabviewBehaviours,[Xd.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),gN=o([Fe("selectFirst",!0),Oa("onChangeTab"),Oa("onDismissTab"),Fe("tabs",[]),Uc("tabSectionBehaviours",[])]),vN=pl({factory:hN,schema:[_e("dom"),Ee("markers",[_e("tabClass"),_e("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),bN=pl({factory:pN,name:"tabview"}),yN=o([vN,bN]),xN=Wl({name:"TabSection",configFields:gN(),partFields:yN(),factory:function(t,e,n,r){var o=function(e,n){El(e,t,"tabbar").each(function(t){n(t).each(wr)})};return{uid:t.uid,dom:t.dom,components:e,behaviours:Wc(t.tabSectionBehaviours),events:Sr(Y([t.selectFirst?[Mr(function(t,e){o(t,af.getFirst)})]:[],[Dr(pr(),function(e,n){!function(e){var n=zc.getValue(e);El(e,t,"tabview").each(function(r){q(t.tabs,function(t){return t.value===n}).each(function(n){var o=n.view();ho(e.element(),"id").each(function(t){fo(r.element(),"aria-labelledby",t)}),Xd.set(r,o),t.onChangeTab(r,e,o)})})}(n.event().button())}),Dr(gr(),function(e,n){var r=n.event().button();t.onDismissTab(e,r)})]])),apis:{getViewItems:function(e){return El(e,t,"tabview").map(function(t){return Xd.contents(t)}).getOr([])},showTab:function(t,e){o(t,function(t){var n=af.getCandidates(t);return q(n,function(t){return zc.getValue(t)===e}).filter(function(e){return!af.isHighlighted(t,e)})})}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),wN=function(t,e){di(t,"height",e+"px"),bn().browser.isIE()?xi(t,"flex-basis"):di(t,"flex-basis",e+"px")},CN=function(t,n,r){sa(t,'[role="dialog"]').each(function(t){ca(t,'[role="tablist"]').each(function(o){r.get().map(function(r){return di(n,"height","0"),di(n,"flex-basis","0"),Math.min(r,function(t,n,r){var o,i=Gr(t).dom(),a=sa(t,".tox-dialog-wrap").getOr(t);o="fixed"===pi(a,"position")?Math.max(i.clientHeight,e.window.innerHeight):Math.max(i.offsetHeight,i.scrollHeight);var u=Pi(n),s=n.dom().offsetLeft>=r.dom().offsetLeft+zi(r)?Math.max(Pi(r),u):u,c=parseInt(pi(t,"margin-top"),10)||0,l=parseInt(pi(t,"margin-bottom"),10)||0;return o-(Pi(t)+c+l-s)}(t,n,o))}).each(function(t){wN(n,t)})})})},_N=function(t){return ca(t,'[role="tabpanel"]')},kN=function(t,e){var n=Ye({}),r=function(t){var e=zc.getValue(t),r=sN(e).getOr({}),o=n.get(),i=Dt(o,r);n.set(i)},o=function(t){var e=n.get();zc.setValue(t,e)},i=Ye(null),a=H(t.tabs,function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[_x.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"]},components:H(t.items,function(t){return ZC(n,t,e)}),formBehaviours:hu([qd.config({mode:"acyclic",useTabstopAt:u(Gx)}),Jd("TabView.form.events",[Mr(o),Lr(r)]),Cu.config({channels:Vt([{key:"send-data-to-section",value:{onReceive:r}},{key:"send-data-to-view",value:{onReceive:o}}])})])}})]}}}),s=function(t){var e;return{smartTabHeight:(e=Ye(y.none()),{extraEvents:[Mr(function(n){var r=n.element();_N(r).each(function(o){di(o,"visibility","hidden"),n.getSystem().getByDom(o).toOption().each(function(n){var r=function(t){return Z(Q(t,function(t,e){return t>e?-1:t<e?1:0}))}(function(t,e,n){return H(t,function(r,o){Xd.set(n,t[o].view());var i=e.dom().getBoundingClientRect();return Xd.set(n,[]),i.height})}(t,o,n));e.set(r)}),CN(r,o,e),xi(o,"visibility"),function(t,e){Z(t).each(function(t){return xN.showTab(e,t.value)})}(t,n),Gm.requestAnimationFrame(function(){CN(r,o,e)})})}),Dr(sr(),function(t){var n=t.element();_N(n).each(function(t){CN(n,t,e)})}),Dr(Uv,function(t,n){var r=t.element();_N(r).each(function(t){var n=Su();di(t,"visibility","hidden");var o=vi(t,"height").map(function(t){return parseInt(t,10)});xi(t,"height"),xi(t,"flex-basis");var i=t.dom().getBoundingClientRect().height;o.forall(function(t){return i>t})?(e.set(y.from(i)),CN(r,t,e)):o.each(function(e){wN(t,e)}),xi(t,"visibility"),n.each(ku)})})],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}}(a).smartTabHeight;return xN.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=zc.getValue(e);xr(t,zv,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[xN.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[hN.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:hu([Nv.config({})])}),xN.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:s.selectFirst,tabSectionBehaviours:hu([Jd("tabpanel",s.extraEvents),qd.config({mode:"acyclic"}),Kl.config({find:function(t){return Z(xN.getViewItems(t))}}),zc.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn(["send-data-to-section"],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn(["send-data-to-view"],{})}}})])})},SN=Co("update-dialog"),TN=Co("update-title"),ON=Co("update-body"),DN=Co("update-footer"),EN=Co("body-send-message"),NN=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:d(d({},e.map(function(t){return{id:t}}).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:hu([Rx(0),cS.config({channel:ON,updateState:function(t,e){return y.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[kN(t.body,n)];default:return[cN(t.body,n)]}},initialData:t})])}},AN=Zp.deviceType.isTouch(),RN=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},BN=function(t,e){return UD.parts().close(Km.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:hu([Nv.config({})])}))},IN=function(){return UD.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},PN=function(t,e){return UD.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:rO("<p>"+e.translate(t)+"</p>")}]}]})},MN=function(t){return UD.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},LN=function(t,e){return[_v.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),_v.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},FN=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return UD.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),y.some(!0)},useTabstopAt:function(t){return!Gx(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:d({position:"relative"},t.extraStyles)},components:h([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:rO('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:AN?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:hu(h([nm.config({}),Jd("dialog-events",t.dialogEvents.concat([Pr(Fn(),function(t,e){qd.focusIn(t)})])),Jd("scroll-lock",[Mr(function(){Xo(si(),i)}),Lr(function(){Jo(si(),i)})])],t.extraBehaviours)),eventOrder:d((e={},e[Qn()]=["dialog-events"],e[cr()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[lr()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},HN=function(t){return Km.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M17.953 7.453L13.422 12l4.531 4.547-1.406 1.406L12 13.422l-4.547 4.531-1.406-1.406L10.578 12 6.047 7.453l1.406-1.406L12 10.578l4.547-4.531z" fill-rule="evenodd"></path></svg>'}}],action:function(t){yr(t,Lv)}})},jN=function(t,e,n){var r=function(t){return[Di(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:d({},e.map(function(t){return{id:t}}).getOr({}))},components:r(t),behaviours:hu([cS.config({channel:TN,renderComponents:r})])}},VN=function(){return{dom:rO('<div class="tox-dialog__draghandle"></div>')}},zN=function(t,e){return function(t,e){var n=UD.parts().title(jN(t,y.none(),e)),r=UD.parts().draghandle(VN()),o=UD.parts().close(HN(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return _v.sketch({dom:rO('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},UN=function(t,e){return{onClose:function(){return e.closeWindow()},onBlock:function(e){UD.setBusy(t(),function(t,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:n,components:[{dom:rO('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})},onUnblock:function(){UD.setIdle(t())}}},WN=function(t,e,n,r){var o;return Ai(FN(d(d({},t),{lazySink:r.shared.getSink,extraBehaviours:h([cS.config({channel:SN,updateState:function(t,e){return y.some(e)},initialData:e}),Vx({})],t.extraBehaviours),onEscape:function(t){yr(t,Lv)},dialogEvents:n,eventOrder:(o={},o[Jn()]=["reflecting","receiving"],o[cr()]=["scroll-lock","reflecting","messages","dialog-events","alloy.base.behaviour"],o[lr()]=["alloy.base.behaviour","dialog-events","messages","reflecting","scroll-lock"],o)})))},qN=function(t){return H(t,function(t){return"menu"===t.type?function(t){var e=H(t.items,function(t){var e=Ye(!1);return d(d({},t),{storage:e})});return d(d({},t),{items:e})}(t):t})},$N=function(t){return W(t,function(t,e){return"menu"===e.type?W(e.items,function(t,e){return t[e.name]=e.storage,t},t):t},{})},YN=function(t,e){return[Rr(Fn(),Yx),t(Mv,function(t,n){e.onClose(),n.onClose()}),t(Lv,function(t,e,n,r){e.onCancel(t),yr(r,Mv)}),Dr(Vv,function(t,n){return e.onUnblock()}),Dr(jv,function(t,n){return e.onBlock(n.event())})]},GN=function(t,e){var n=function(e,n){return Dr(e,function(e,o){r(e,function(r,i){n(t(),r,o.event(),e)})})},r=function(t,e){cS.getState(t).get().each(function(n){e(n,t)})};return h(YN(n,e),[n(Fv,function(t,e,n){e.onAction(t,{name:n.name()})})])},KN=function(t,e,n){var r=function(e,n){return Dr(e,function(e,r){o(e,function(o,i){n(t(),o,r.event(),e)})})},o=function(t,e){cS.getState(t).get().each(function(n){e(n.internalDialog,t)})};return h(YN(r,e),[r(Hv,function(t,e){return e.onSubmit(t)}),r(Pv,function(t,e,n){e.onChange(t,{name:n.name()})}),r(Fv,function(t,e,r,o){var i=function(){return qd.focusIn(o)},a=function(t){return po(t,"disabled")||ho(t,"aria-disabled").exists(function(t){return"true"===t})},u=Su();e.onAction(t,{name:r.name(),value:r.value()}),Su().fold(i,function(t){a(t)||u.exists(function(e){return _n(t,e)&&a(e)})?i():n().toOption().filter(function(e){return!_n(e.element(),t)}).each(i)})}),r(zv,function(t,e,n){e.onTabChange(t,{newTabName:n.name(),oldTabName:n.oldName()})}),Lr(function(e){var n=t();zc.setValue(e,n.getData())})])},XN=function(t,e){var n=e.map(function(t){return t.footerButtons}).getOr([]),r=V(n,function(t){return"start"===t.align}),o=function(t,e){return _v.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:H(e,function(t){return t.memento.asSpec()})})};return[o("start",r.pass),o("end",r.fail)]},JN=function(t,e){return{dom:rO('<div class="tox-dialog__footer"></div>'),components:[],behaviours:hu([cS.config({channel:DN,initialData:t,updateState:function(t,n){var r=H(n.buttons,function(t){var n=Xm(function(t,e){return Xw(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}});return y.some({lookupByName:function(t,e){return function(t,e,n){return q(r,function(t){return t.name===n}).bind(function(e){return e.memento.getOpt(t)})}(t,0,e)},footerButtons:r})},renderComponents:XN})])}},QN=function(t,e){return UD.parts().footer(JN(t,e))},ZN=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=Kl.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return _x.getField(n,e).fold(function(){var r=t.getFooter();return cS.getState(r).get().bind(function(t){return t.lookupByName(n,e)})},function(t){return y.some(t)})}return y.none()},tA=function(t,e,n){var r=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},o={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=zc.getValue(r),i=vt(n,function(t){return t.get()});return d(d({},o),i)},setData:function(e){r(function(r){var i=o.getData(),a=d(d({},i),e),u=function(t,e){var n=t.getRoot();return cS.getState(n).get().map(function(t){return le(ce("data",t.dataValidator,e))}).getOr(e)}(t,a),s=t.getFormWrapper();zc.setValue(s,u),gt(n,function(t,e){_t(a,e)&&t.set(a[e])})})},disable:function(e){ZN(t,e).each(dp.disable)},enable:function(e){ZN(t,e).each(dp.enable)},focus:function(e){ZN(t,e).each(nm.focus)},block:function(t){if(!C(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r(function(e){xr(e,jv,{message:t})})},unblock:function(){r(function(t){yr(t,Vv)})},showTab:function(e){r(function(n){var r=t.getBody();cS.getState(r).get().exists(function(t){return t.isTabPanel()})&&Kl.getCurrent(r).each(function(t){xN.showTab(t,e)})})},redial:function(t){r(function(n){var r=e(t);n.getSystem().broadcastOn([SN],r),n.getSystem().broadcastOn([TN],r.internalDialog),n.getSystem().broadcastOn([ON],r.internalDialog),n.getSystem().broadcastOn([DN],r.internalDialog),o.setData(r.initialData)})},close:function(){r(function(t){yr(t,Mv)})}};return o},eA=tinymce.util.Tools.resolve("tinymce.util.URI"),nA=["insertContent","setContent","execCommand","close","block","unblock"],rA=function(t){return _(t)&&-1!==nA.indexOf(t.mceAction)},oA=function(t,n,r,o){var i,a,s,c=zN(t.title,o),l=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[qx({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:hu([Nv.config({}),nm.config({})])})]}],behaviours:hu([qd.config({mode:"acyclic",useTabstopAt:u(Gx)})])};return UD.parts().body(e)}(t),f=t.buttons.bind(function(t){return 0===t.length?y.none():y.some(QN({buttons:t},o))}),m=GN(function(){return k},UN(function(){return w},n)),h=d(d({},t.height.fold(function(){return{}},function(t){return{height:t+"px","max-height":t+"px"}})),t.width.fold(function(){return{}},function(t){return{width:t+"px","max-width":t+"px"}})),p=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],g=new eA(t.url,{base_uri:new eA(e.window.location.href)}),v=g.protocol+"://"+g.host+(g.port?":"+g.port:""),b=Ye(y.none()),x=[Jd("messages",[Mr(function(){var n=sv(Ke.fromDom(e.window),"message",function(e){if(g.isSameOrigin(new eA(e.raw().origin))){var n=e.raw().data;rA(n)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!S(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(r,k,n):function(t){return!rA(t)&&_(t)&&_t(t,"mceAction")}(n)&&t.onMessage(k,n)}});b.set(y.some(n))}),Lr(function(){b.get().each(function(t){return t.unbind()})})]),Cu.config({channels:(i={},i[EN]={onReceive:function(t,e){ca(t.element(),"iframe").each(function(t){t.dom().contentWindow.postMessage(e,v)})}},i)})],w=WN({header:c,body:l,footer:f,extraClasses:p,extraBehaviours:x,extraStyles:h},t,m,o),k=(a=w,s=function(t){a.getSystem().isConnected()&&t(a)},{block:function(t){if(!C(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");s(function(e){xr(e,jv,{message:t})})},unblock:function(){s(function(t){yr(t,Vv)})},close:function(){s(function(t){yr(t,Mv)})},sendMessage:function(t){s(function(e){e.getSystem().broadcastOn([EN],t)})}});return{dialog:w,instanceApi:k}},iA=function(t,e,n){return e&&n?[]:[BT.config({contextual:{lazyContext:function(){return y.some(ta(Ke.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},aA=function(t){var e=t.backstage,n=t.editor,r=Rp(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){UD.hide(s),r()},i=Xm(Xw({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:y.none()},"cancel",t.backstage)),a=IN(),u=BN(o,e.providers),s=Ai(FN({lazySink:function(){return e.getSink()},header:RN(a,u),body:PN(n,e.providers),footer:y.some(MN(LN([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Dr(Lv,o)],eventOrder:{}}));UD.show(s);var c=i.get(s);nm.focus(c)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){UD.hide(c),r(t)},i=Xm(Xw({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:y.none()},"submit",t.backstage)),a=Xw({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:y.none()},"cancel",t.backstage),u=IN(),s=BN(function(){return o(!1)},e.providers),c=Ai(FN({lazySink:function(){return e.getSink()},header:RN(u,s),body:PN(n,e.providers),footer:y.some(MN(LN([],[a,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Dr(Lv,function(){return o(!1)}),Dr(Hv,function(){return o(!0)})],eventOrder:{}}));UD.show(c);var l=i.get(c);nm.focus(l)}}}(t),a=function(t,r){return uN.openUrl(function(t){var o=oA(t,{closeWindow:function(){UD.hide(o.dialog),r(o.instanceApi)}},n,e);return UD.show(o.dialog),o.instanceApi},t)},u=function(t,n){return uN.open(function(t,r,o){var i=r,a=function(t,e,n){var r=zN(t.internalDialog.title,n),o=function(t,e){var n=NN(t,y.none(),e,!1);return UD.parts().body(n)}({body:t.internalDialog.body},n),i=qN(t.internalDialog.buttons),a=$N(i),u=QN({buttons:i},n),s=KN(function(){return d},UN(function(){return f},e),n.shared.getSink),c="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],l={header:r,body:o,footer:y.some(u),extraClasses:c,extraBehaviours:[],extraStyles:{}},f=WN(l,t,s,n),d=tA({getRoot:function(){return f},getBody:function(){return UD.getBody(f)},getFooter:function(){return UD.getFooter(f)},getFormWrapper:function(){var t=UD.getBody(f);return Kl.getCurrent(t).getOr(t)}},e.redial,a);return{dialog:f,instanceApi:d}}({dataValidator:o,initialData:i,internalDialog:t},{redial:uN.redial,closeWindow:function(){UD.hide(a.dialog),n(a.instanceApi)}},e);return UD.show(a.dialog),a.instanceApi.setData(i),a.instanceApi},t)},s=function(t,o,i,a){return uN.open(function(t,u,s){var c,l=le(ce("data",s,u)),f=(c=Ye(y.none()),{clear:function(){c.set(y.none())},set:function(t){c.set(y.some(t))},isSet:function(){return c.get().isSome()},on:function(t){c.get().each(t)}}),m=e.shared.header.isPositionedAtTop(),p=function(){return f.on(function(t){Mm.reposition(t),BT.refresh(t)})},g=function(t,e,n,r){var o,i,a,u,s,c=Co("dialog-label"),l=Co("dialog-content"),f=Xm((a={title:t.internalDialog.title,draggable:!0},u=c,s=n.shared.providers,_v.sketch({dom:rO('<div class="tox-dialog__header"></div>'),components:[jN(a,y.some(u),s),VN(),HN(s)],containerBehaviours:hu([RD.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return la(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=Xm(function(t,e,n,r){return NN(t,y.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=qN(t.internalDialog.buttons),h=$N(m),p=Xm(JN({buttons:m},n)),g=KN(function(){return b},{onBlock:function(){},onUnblock:function(){},onClose:function(){return e.closeWindow()}},n.shared.getSink),v=Ai({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=c,o["aria-describedby"]=""+l,o)},eventOrder:(i={},i[Jn()]=[cS.name(),Cu.name()],i[Qn()]=["execute-on-form"],i[cr()]=["reflecting","execute-on-form"],i),behaviours:hu([qd.config({mode:"cyclic",onEscape:function(t){return yr(t,Mv),y.some(!0)},useTabstopAt:function(t){return!Gx(t)&&("button"!==jr(t)||"disabled"!==mo(t,"disabled"))}}),cS.config({channel:SN,updateState:function(t,e){return y.some(e)},initialData:t}),nm.config({}),Jd("execute-on-form",g.concat([Pr(Fn(),function(t,e){qd.focusIn(t)})])),Vx({})]),components:[f.asSpec(),d.asSpec(),p.asSpec()]}),b=tA({getRoot:function(){return v},getFooter:function(){return p.get(v)},getBody:function(){return d.get(v)},getFormWrapper:function(){var t=d.get(v);return Kl.getCurrent(t).getOr(t)}},e.redial,h);return{dialog:v,instanceApi:b}}({dataValidator:s,initialData:l,internalDialog:t},{redial:uN.redial,closeWindow:function(){f.on(Mm.hide),n.off("ResizeEditor",p),f.clear(),i(g.instanceApi)}},e,a),v=Ai(Mm.sketch(d(d({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},m?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:hu(h([Jd("window-manager-inline-events",[Dr(fr(),function(t,e){yr(g.dialog,Lv)})])],iA(n,r,m))),isExtraPart:function(t,e){return function(t){return fv(t,".tox-alert-dialog")||fv(t,".tox-confirm-dialog")}(e)}})));return f.set(v),Mm.showWithin(v,o,Ri(g.dialog),y.some(si())),r&&m||(BT.refresh(v),n.on("ResizeEditor",p)),g.instanceApi.setData(l),qd.focusIn(g.dialog),g.instanceApi},t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?s(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?s(t,e.shared.anchors.cursor(),r,n.ariaAttrs):u(t,r)},openUrl:function(t,e){return a(t,e)},alert:function(t,e){o.open(t,function(){e()})},close:function(t){t.close()},confirm:function(t,e){i.open(t,function(t){e(t)})}}};f.add("silver",function(t){var e=HD(t),n=e.uiMothership,r=e.backstage,i=e.renderUI,a=e.getUi;av(t,r.shared);var u=aA({editor:t,backstage:r});return{renderUI:i,getWindowManagerImpl:o(u),getNotificationManagerImpl:function(){return function(t,e,n){var r=e.backstage;return{open:function(t,o){var i=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),a=function(){o(),Mm.hide(s)},u=Ai(eh.sketch({text:t.text,level:P(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:y.from(t.icon),closeButton:!i,onAction:a,iconProvider:r.shared.providers.icons,translationProvider:r.shared.providers.translate})),s=Ai(Mm.sketch(d({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:e.backstage.shared.getSink,fireDismissalEventInstead:{}},r.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return n.add(s),t.timeout>0&&Gm.setTimeout(function(){a()},t.timeout),{close:a,moveTo:function(t,e){Mm.showAt(s,{anchor:"makeshift",x:t,y:e},Ri(u))},moveRel:function(t,n){if("banner"!==n){var r=function(t){switch(n){case"bc-bc":return Ym;case"tc-tc":return $m;case"tc-bc":return eu;case"bc-tc":default:return nu}}(),o={anchor:"node",root:si(),node:y.some(Ke.fromDom(t)),layouts:{onRtl:function(){return[r]},onLtr:function(){return[r]}}};Mm.showAt(s,o,Ri(u))}else Mm.showAt(s,e.backstage.shared.anchors.banner(),Ri(u))},text:function(t){eh.updateText(u,t)},settings:t,getEl:function(){return u.element().dom()},progressBar:{value:function(t){eh.updateProgress(u,t)}}}},close:function(t){t.close()},reposition:function(t){!function(t){j(t,function(t){return t.moveTo(0,0)})}(t),function(t){t.length>0&&(Z(t).each(function(t){return t.moveRel(null,"banner")}),j(t,function(e,n){n>0&&e.moveRel(t[n-1].getEl(),"bc-tc")}))}(t)},getArgs:function(t){return t.settings}}}(0,{backstage:r},n)},ui:a()}})}(window)}).call(this,n("yLpj"))},CgaS:function(t,e,n){"use strict";var r=n("xTJ+"),o=n("MLWZ"),i=n("9rSQ"),a=n("UnBK"),u=n("SntB");function s(t){this.defaults=t,this.interceptors={request:new i,response:new i}}s.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=u(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[a,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},s.prototype.getUri=function(t){return t=u(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],function(t){s.prototype[t]=function(e,n){return this.request(r.merge(n||{},{method:t,url:e}))}}),r.forEach(["post","put","patch"],function(t){s.prototype[t]=function(e,n,o){return this.request(r.merge(o||{},{method:t,url:e,data:n}))}}),t.exports=s},CumE:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(n){return!!t.data(n,e)}}):function(e,n,r){return!!t.data(e,r[3])}})})?r.apply(e,o):r)||(t.exports=i)},DWi2:function(t,e,n){n("Aw8l")},DfZB:function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},EVdn:function(t,e,n){var r;!function(e,n){"use strict";"object"==_typeof(t.exports)?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,function(n,o){"use strict";var i=[],a=Object.getPrototypeOf,u=i.slice,s=i.flat?function(t){return i.flat.call(t)}:function(t){return i.concat.apply([],t)},c=i.push,l=i.indexOf,f={},d=f.toString,m=f.hasOwnProperty,h=m.toString,p=h.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},b=function(t){return null!=t&&t===t.window},y=n.document,x={type:!0,src:!0,nonce:!0,noModule:!0};function w(t,e,n){var r,o,i=(n=n||y).createElement("script");if(i.text=t,e)for(r in x)(o=e[r]||e.getAttribute&&e.getAttribute(r))&&i.setAttribute(r,o);n.head.appendChild(i).parentNode.removeChild(i)}function C(t){return null==t?t+"":"object"==_typeof(t)||"function"==typeof t?f[d.call(t)]||"object":_typeof(t)}var _=function t(e,n){return new t.fn.init(e,n)};function k(t){var e=!!t&&"length"in t&&t.length,n=C(t);return!v(t)&&!b(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}_.fn=_.prototype={jquery:"3.5.1",constructor:_,length:0,toArray:function(){return u.call(this)},get:function(t){return null==t?u.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=_.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return _.each(this,t)},map:function(t){return this.pushStack(_.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(_.grep(this,function(t,e){return(e+1)%2}))},odd:function(){return this.pushStack(_.grep(this,function(t,e){return e%2}))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:c,sort:i.sort,splice:i.splice},_.extend=_.fn.extend=function(){var t,e,n,r,o,i,a=arguments[0]||{},u=1,s=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[u]||{},u++),"object"==_typeof(a)||v(a)||(a={}),u===s&&(a=this,u--);u<s;u++)if(null!=(t=arguments[u]))for(e in t)r=t[e],"__proto__"!==e&&a!==r&&(c&&r&&(_.isPlainObject(r)||(o=Array.isArray(r)))?(n=a[e],i=o&&!Array.isArray(n)?[]:o||_.isPlainObject(n)?n:{},o=!1,a[e]=_.extend(c,i,r)):void 0!==r&&(a[e]=r));return a},_.extend({expando:"jQuery"+("3.5.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==d.call(t)||(e=a(t))&&("function"!=typeof(n=m.call(e,"constructor")&&e.constructor)||h.call(n)!==p))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){w(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,r=0;if(k(t))for(n=t.length;r<n&&!1!==e.call(t[r],r,t[r]);r++);else for(r in t)if(!1===e.call(t[r],r,t[r]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(k(Object(t))?_.merge(n,"string"==typeof t?[t]:t):c.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:l.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,o=t.length;r<n;r++)t[o++]=e[r];return t.length=o,t},grep:function(t,e,n){for(var r=[],o=0,i=t.length,a=!n;o<i;o++)!e(t[o],o)!==a&&r.push(t[o]);return r},map:function(t,e,n){var r,o,i=0,a=[];if(k(t))for(r=t.length;i<r;i++)null!=(o=e(t[i],i,n))&&a.push(o);else for(i in t)null!=(o=e(t[i],i,n))&&a.push(o);return s(a)},guid:1,support:g}),"function"==typeof Symbol&&(_.fn[Symbol.iterator]=i[Symbol.iterator]),_.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){f["[object "+e+"]"]=e.toLowerCase()});var S=function(t){var e,n,r,o,i,a,u,s,c,l,f,d,m,h,p,g,v,b,y,x="sizzle"+1*new Date,w=t.document,C=0,_=0,k=st(),S=st(),T=st(),O=st(),D=function(t,e){return t===e&&(f=!0),0},E={}.hasOwnProperty,N=[],A=N.pop,R=N.push,B=N.push,I=N.slice,P=function(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",H="\\["+L+"*("+F+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+L+"*\\]",j=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+H+")*)|.*)\\)|)",V=new RegExp(L+"+","g"),z=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),U=new RegExp("^"+L+"*,"+L+"*"),W=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),q=new RegExp(L+"|>"),$=new RegExp(j),Y=new RegExp("^"+F+"$"),G={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+j),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ot=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},it=function(){d()},at=xt(function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{B.apply(N=I.call(w.childNodes),w.childNodes),N[w.childNodes.length].nodeType}catch(t){B={apply:N.length?function(t,e){R.apply(t,I.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function ut(t,e,r,o){var i,u,c,l,f,h,v,b=e&&e.ownerDocument,w=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return r;if(!o&&(d(e),e=e||m,p)){if(11!==w&&(f=Z.exec(t)))if(i=f[1]){if(9===w){if(!(c=e.getElementById(i)))return r;if(c.id===i)return r.push(c),r}else if(b&&(c=b.getElementById(i))&&y(e,c)&&c.id===i)return r.push(c),r}else{if(f[2])return B.apply(r,e.getElementsByTagName(t)),r;if((i=f[3])&&n.getElementsByClassName&&e.getElementsByClassName)return B.apply(r,e.getElementsByClassName(i)),r}if(n.qsa&&!O[t+" "]&&(!g||!g.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(v=t,b=e,1===w&&(q.test(t)||W.test(t))){for((b=tt.test(t)&&vt(e.parentNode)||e)===e&&n.scope||((l=e.getAttribute("id"))?l=l.replace(rt,ot):e.setAttribute("id",l=x)),u=(h=a(t)).length;u--;)h[u]=(l?"#"+l:":scope")+" "+yt(h[u]);v=h.join(",")}try{return B.apply(r,b.querySelectorAll(v)),r}catch(e){O(t,!0)}finally{l===x&&e.removeAttribute("id")}}}return s(t.replace(z,"$1"),e,r,o)}function st(){var t=[];return function e(n,o){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=o}}function ct(t){return t[x]=!0,t}function lt(t){var e=m.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ft(t,e){for(var n=t.split("|"),o=n.length;o--;)r.attrHandle[n[o]]=e}function dt(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function mt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ht(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function pt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return ct(function(e){return e=+e,ct(function(n,r){for(var o,i=t([],n.length,e),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function vt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=ut.support={},i=ut.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!K.test(e||n&&n.nodeName||"HTML")},d=ut.setDocument=function(t){var e,o,a=t?t.ownerDocument||t:w;return a!=m&&9===a.nodeType&&a.documentElement?(h=(m=a).documentElement,p=!i(m),w!=m&&(o=m.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",it,!1):o.attachEvent&&o.attachEvent("onunload",it)),n.scope=lt(function(t){return h.appendChild(t).appendChild(m.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length}),n.attributes=lt(function(t){return t.className="i",!t.getAttribute("className")}),n.getElementsByTagName=lt(function(t){return t.appendChild(m.createComment("")),!t.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(m.getElementsByClassName),n.getById=lt(function(t){return h.appendChild(t).id=x,!m.getElementsByName||!m.getElementsByName(x).length}),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&p){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&p){var n,r,o,i=e.getElementById(t);if(i){if((n=i.getAttributeNode("id"))&&n.value===t)return[i];for(o=e.getElementsByName(t),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===t)return[i]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&p)return e.getElementsByClassName(t)},v=[],g=[],(n.qsa=Q.test(m.querySelectorAll))&&(lt(function(t){var e;h.appendChild(t).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+L+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+L+"*(?:value|"+M+")"),t.querySelectorAll("[id~="+x+"-]").length||g.push("~="),(e=m.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\["+L+"*name"+L+"*="+L+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")}),lt(function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=m.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+L+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),h.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")})),(n.matchesSelector=Q.test(b=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&lt(function(t){n.disconnectedMatch=b.call(t,"*"),b.call(t,"[s!='']:x"),v.push("!=",j)}),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),e=Q.test(h.compareDocumentPosition),y=e||Q.test(h.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},D=e?function(t,e){if(t===e)return f=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t==m||t.ownerDocument==w&&y(w,t)?-1:e==m||e.ownerDocument==w&&y(w,e)?1:l?P(l,t)-P(l,e):0:4&r?-1:1)}:function(t,e){if(t===e)return f=!0,0;var n,r=0,o=t.parentNode,i=e.parentNode,a=[t],u=[e];if(!o||!i)return t==m?-1:e==m?1:o?-1:i?1:l?P(l,t)-P(l,e):0;if(o===i)return dt(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?dt(a[r],u[r]):a[r]==w?-1:u[r]==w?1:0},m):m},ut.matches=function(t,e){return ut(t,null,null,e)},ut.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&p&&!O[e+" "]&&(!v||!v.test(e))&&(!g||!g.test(e)))try{var r=b.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){O(e,!0)}return ut(e,m,null,[t]).length>0},ut.contains=function(t,e){return(t.ownerDocument||t)!=m&&d(t),y(t,e)},ut.attr=function(t,e){(t.ownerDocument||t)!=m&&d(t);var o=r.attrHandle[e.toLowerCase()],i=o&&E.call(r.attrHandle,e.toLowerCase())?o(t,e,!p):void 0;return void 0!==i?i:n.attributes||!p?t.getAttribute(e):(i=t.getAttributeNode(e))&&i.specified?i.value:null},ut.escape=function(t){return(t+"").replace(rt,ot)},ut.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ut.uniqueSort=function(t){var e,r=[],o=0,i=0;if(f=!n.detectDuplicates,l=!n.sortStable&&t.slice(0),t.sort(D),f){for(;e=t[i++];)e===t[i]&&(o=r.push(i));for(;o--;)t.splice(r[o],1)}return l=null,t},o=ut.getText=function(t){var e,n="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=o(t)}else if(3===i||4===i)return t.nodeValue}else for(;e=t[r++];)n+=o(e);return n},(r=ut.selectors={cacheLength:50,createPseudo:ct,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||ut.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&ut.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&$.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=k[t+" "];return e||(e=new RegExp("(^|"+L+")"+t+"("+L+"|$)"))&&k(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(r){var o=ut.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o.replace(V," ")+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),a="last"!==t.slice(-4),u="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,s){var c,l,f,d,m,h,p=i!==a?"nextSibling":"previousSibling",g=e.parentNode,v=u&&e.nodeName.toLowerCase(),b=!s&&!u,y=!1;if(g){if(i){for(;p;){for(d=e;d=d[p];)if(u?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=p="only"===t&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&b){for(y=(m=(c=(l=(f=(d=g)[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]||[])[0]===C&&c[1])&&c[2],d=m&&g.childNodes[m];d=++m&&d&&d[p]||(y=m=0)||h.pop();)if(1===d.nodeType&&++y&&d===e){l[t]=[C,m,y];break}}else if(b&&(y=m=(c=(l=(f=(d=e)[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]||[])[0]===C&&c[1]),!1===y)for(;(d=++m&&d&&d[p]||(y=m=0)||h.pop())&&((u?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++y||(b&&((l=(f=d[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[t]=[C,y]),d!==e)););return(y-=o)===r||y%r==0&&y/r>=0}}},PSEUDO:function(t,e){var n,o=r.pseudos[t]||r.setFilters[t.toLowerCase()]||ut.error("unsupported pseudo: "+t);return o[x]?o(e):o.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ct(function(t,n){for(var r,i=o(t,e),a=i.length;a--;)t[r=P(t,i[a])]=!(n[r]=i[a])}):function(t){return o(t,0,n)}):o}},pseudos:{not:ct(function(t){var e=[],n=[],r=u(t.replace(z,"$1"));return r[x]?ct(function(t,e,n,o){for(var i,a=r(t,null,o,[]),u=t.length;u--;)(i=a[u])&&(t[u]=!(e[u]=i))}):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}}),has:ct(function(t){return function(e){return ut(t,e).length>0}}),contains:ct(function(t){return t=t.replace(et,nt),function(e){return(e.textContent||o(e)).indexOf(t)>-1}}),lang:ct(function(t){return Y.test(t||"")||ut.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=p?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===h},focus:function(t){return t===m.activeElement&&(!m.hasFocus||m.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:pt(!1),disabled:pt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return J.test(t.nodeName)},input:function(t){return X.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:gt(function(){return[0]}),last:gt(function(t,e){return[e-1]}),eq:gt(function(t,e,n){return[n<0?n+e:n]}),even:gt(function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t}),odd:gt(function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t}),lt:gt(function(t,e,n){for(var r=n<0?n+e:n>e?e:n;--r>=0;)t.push(r);return t}),gt:gt(function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[e]=mt(e);for(e in{submit:!0,reset:!0})r.pseudos[e]=ht(e);function bt(){}function yt(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function xt(t,e,n){var r=e.dir,o=e.next,i=o||r,a=n&&"parentNode"===i,u=_++;return e.first?function(e,n,o){for(;e=e[r];)if(1===e.nodeType||a)return t(e,n,o);return!1}:function(e,n,s){var c,l,f,d=[C,u];if(s){for(;e=e[r];)if((1===e.nodeType||a)&&t(e,n,s))return!0}else for(;e=e[r];)if(1===e.nodeType||a)if(l=(f=e[x]||(e[x]={}))[e.uniqueID]||(f[e.uniqueID]={}),o&&o===e.nodeName.toLowerCase())e=e[r]||e;else{if((c=l[i])&&c[0]===C&&c[1]===u)return d[2]=c[2];if(l[i]=d,d[2]=t(e,n,s))return!0}return!1}}function wt(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function Ct(t,e,n,r,o){for(var i,a=[],u=0,s=t.length,c=null!=e;u<s;u++)(i=t[u])&&(n&&!n(i,r,o)||(a.push(i),c&&e.push(u)));return a}function _t(t,e,n,r,o,i){return r&&!r[x]&&(r=_t(r)),o&&!o[x]&&(o=_t(o,i)),ct(function(i,a,u,s){var c,l,f,d=[],m=[],h=a.length,p=i||function(t,e,n){for(var r=0,o=e.length;r<o;r++)ut(t,e[r],n);return n}(e||"*",u.nodeType?[u]:u,[]),g=!t||!i&&e?p:Ct(p,d,t,u,s),v=n?o||(i?t:h||r)?[]:a:g;if(n&&n(g,v,u,s),r)for(c=Ct(v,m),r(c,[],u,s),l=c.length;l--;)(f=c[l])&&(v[m[l]]=!(g[m[l]]=f));if(i){if(o||t){if(o){for(c=[],l=v.length;l--;)(f=v[l])&&c.push(g[l]=f);o(null,v=[],c,s)}for(l=v.length;l--;)(f=v[l])&&(c=o?P(i,f):d[l])>-1&&(i[c]=!(a[c]=f))}}else v=Ct(v===a?v.splice(h,v.length):v),o?o(null,a,v,s):B.apply(a,v)})}function kt(t){for(var e,n,o,i=t.length,a=r.relative[t[0].type],u=a||r.relative[" "],s=a?1:0,l=xt(function(t){return t===e},u,!0),f=xt(function(t){return P(e,t)>-1},u,!0),d=[function(t,n,r){var o=!a&&(r||n!==c)||((e=n).nodeType?l(t,n,r):f(t,n,r));return e=null,o}];s<i;s++)if(n=r.relative[t[s].type])d=[xt(wt(d),n)];else{if((n=r.filter[t[s].type].apply(null,t[s].matches))[x]){for(o=++s;o<i&&!r.relative[t[o].type];o++);return _t(s>1&&wt(d),s>1&&yt(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(z,"$1"),n,s<o&&kt(t.slice(s,o)),o<i&&kt(t=t.slice(o)),o<i&&yt(t))}d.push(n)}return wt(d)}return bt.prototype=r.filters=r.pseudos,r.setFilters=new bt,a=ut.tokenize=function(t,e){var n,o,i,a,u,s,c,l=S[t+" "];if(l)return e?0:l.slice(0);for(u=t,s=[],c=r.preFilter;u;){for(a in n&&!(o=U.exec(u))||(o&&(u=u.slice(o[0].length)||u),s.push(i=[])),n=!1,(o=W.exec(u))&&(n=o.shift(),i.push({value:n,type:o[0].replace(z," ")}),u=u.slice(n.length)),r.filter)!(o=G[a].exec(u))||c[a]&&!(o=c[a](o))||(n=o.shift(),i.push({value:n,type:a,matches:o}),u=u.slice(n.length));if(!n)break}return e?u.length:u?ut.error(t):S(t,s).slice(0)},u=ut.compile=function(t,e){var n,o=[],i=[],u=T[t+" "];if(!u){for(e||(e=a(t)),n=e.length;n--;)(u=kt(e[n]))[x]?o.push(u):i.push(u);(u=T(t,function(t,e){var n=e.length>0,o=t.length>0,i=function(i,a,u,s,l){var f,h,g,v=0,b="0",y=i&&[],x=[],w=c,_=i||o&&r.find.TAG("*",l),k=C+=null==w?1:Math.random()||.1,S=_.length;for(l&&(c=a==m||a||l);b!==S&&null!=(f=_[b]);b++){if(o&&f){for(h=0,a||f.ownerDocument==m||(d(f),u=!p);g=t[h++];)if(g(f,a||m,u)){s.push(f);break}l&&(C=k)}n&&((f=!g&&f)&&v--,i&&y.push(f))}if(v+=b,n&&b!==v){for(h=0;g=e[h++];)g(y,x,a,u);if(i){if(v>0)for(;b--;)y[b]||x[b]||(x[b]=A.call(s));x=Ct(x)}B.apply(s,x),l&&!i&&x.length>0&&v+e.length>1&&ut.uniqueSort(s)}return l&&(C=k,c=w),y};return n?ct(i):i}(i,o))).selector=t}return u},s=ut.select=function(t,e,n,o){var i,s,c,l,f,d="function"==typeof t&&t,m=!o&&a(t=d.selector||t);if(n=n||[],1===m.length){if((s=m[0]=m[0].slice(0)).length>2&&"ID"===(c=s[0]).type&&9===e.nodeType&&p&&r.relative[s[1].type]){if(!(e=(r.find.ID(c.matches[0].replace(et,nt),e)||[])[0]))return n;d&&(e=e.parentNode),t=t.slice(s.shift().value.length)}for(i=G.needsContext.test(t)?0:s.length;i--&&(c=s[i],!r.relative[l=c.type]);)if((f=r.find[l])&&(o=f(c.matches[0].replace(et,nt),tt.test(s[0].type)&&vt(e.parentNode)||e))){if(s.splice(i,1),!(t=o.length&&yt(s)))return B.apply(n,o),n;break}}return(d||u(t,m))(o,e,!p,n,!e||tt.test(t)&&vt(e.parentNode)||e),n},n.sortStable=x.split("").sort(D).join("")===x,n.detectDuplicates=!!f,d(),n.sortDetached=lt(function(t){return 1&t.compareDocumentPosition(m.createElement("fieldset"))}),lt(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||ft("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),n.attributes&&lt(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||ft("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),lt(function(t){return null==t.getAttribute("disabled")})||ft(M,function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null}),ut}(n);_.find=S,_.expr=S.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=S.uniqueSort,_.text=S.getText,_.isXMLDoc=S.isXML,_.contains=S.contains,_.escapeSelector=S.escape;var T=function(t,e,n){for(var r=[],o=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&_(t).is(n))break;r.push(t)}return r},O=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},D=_.expr.match.needsContext;function E(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(t,e,n){return v(e)?_.grep(t,function(t,r){return!!e.call(t,r,t)!==n}):e.nodeType?_.grep(t,function(t){return t===e!==n}):"string"!=typeof e?_.grep(t,function(t){return l.call(e,t)>-1!==n}):_.filter(e,t,n)}_.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?_.find.matchesSelector(r,t)?[r]:[]:_.find.matches(t,_.grep(e,function(t){return 1===t.nodeType}))},_.fn.extend({find:function(t){var e,n,r=this.length,o=this;if("string"!=typeof t)return this.pushStack(_(t).filter(function(){for(e=0;e<r;e++)if(_.contains(o[e],this))return!0}));for(n=this.pushStack([]),e=0;e<r;e++)_.find(t,o[e],n);return r>1?_.uniqueSort(n):n},filter:function(t){return this.pushStack(A(this,t||[],!1))},not:function(t){return this.pushStack(A(this,t||[],!0))},is:function(t){return!!A(this,"string"==typeof t&&D.test(t)?_(t):t||[],!1).length}});var R,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(t,e,n){var r,o;if(!t)return this;if(n=n||R,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:B.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof _?e[0]:e,_.merge(this,_.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:y,!0)),N.test(r[1])&&_.isPlainObject(e))for(r in e)v(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(o=y.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==n.ready?n.ready(t):t(_):_.makeArray(t,this)}).prototype=_.fn,R=_(y);var I=/^(?:parents|prev(?:Until|All))/,P={children:!0,contents:!0,next:!0,prev:!0};function M(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}_.fn.extend({has:function(t){var e=_(t,this),n=e.length;return this.filter(function(){for(var t=0;t<n;t++)if(_.contains(this,e[t]))return!0})},closest:function(t,e){var n,r=0,o=this.length,i=[],a="string"!=typeof t&&_(t);if(!D.test(t))for(;r<o;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&_.find.matchesSelector(n,t))){i.push(n);break}return this.pushStack(i.length>1?_.uniqueSort(i):i)},index:function(t){return t?"string"==typeof t?l.call(_(t),this[0]):l.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),_.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return T(t,"parentNode")},parentsUntil:function(t,e,n){return T(t,"parentNode",n)},next:function(t){return M(t,"nextSibling")},prev:function(t){return M(t,"previousSibling")},nextAll:function(t){return T(t,"nextSibling")},prevAll:function(t){return T(t,"previousSibling")},nextUntil:function(t,e,n){return T(t,"nextSibling",n)},prevUntil:function(t,e,n){return T(t,"previousSibling",n)},siblings:function(t){return O((t.parentNode||{}).firstChild,t)},children:function(t){return O(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(E(t,"template")&&(t=t.content||t),_.merge([],t.childNodes))}},function(t,e){_.fn[t]=function(n,r){var o=_.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=_.filter(r,o)),this.length>1&&(P[t]||_.uniqueSort(o),I.test(t)&&o.reverse()),this.pushStack(o)}});var L=/[^\x20\t\r\n\f]+/g;function F(t){return t}function H(t){throw t}function j(t,e,n,r){var o;try{t&&v(o=t.promise)?o.call(t).done(e).fail(n):t&&v(o=t.then)?o.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}_.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return _.each(t.match(L)||[],function(t,n){e[n]=!0}),e}(t):_.extend({},t);var e,n,r,o,i=[],a=[],u=-1,s=function(){for(o=o||t.once,r=e=!0;a.length;u=-1)for(n=a.shift();++u<i.length;)!1===i[u].apply(n[0],n[1])&&t.stopOnFalse&&(u=i.length,n=!1);t.memory||(n=!1),e=!1,o&&(i=n?[]:"")},c={add:function(){return i&&(n&&!e&&(u=i.length-1,a.push(n)),function e(n){_.each(n,function(n,r){v(r)?t.unique&&c.has(r)||i.push(r):r&&r.length&&"string"!==C(r)&&e(r)})}(arguments),n&&!e&&s()),this},remove:function(){return _.each(arguments,function(t,e){for(var n;(n=_.inArray(e,i,n))>-1;)i.splice(n,1),n<=u&&u--}),this},has:function(t){return t?_.inArray(t,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=a=[],n||e||(i=n=""),this},locked:function(){return!!o},fireWith:function(t,n){return o||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||s()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},_.extend({Deferred:function(t){var e=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],r="pending",o={state:function(){return r},always:function(){return i.done(arguments).fail(arguments),this},catch:function(t){return o.then(null,t)},pipe:function(){var t=arguments;return _.Deferred(function(n){_.each(e,function(e,r){var o=v(t[r[4]])&&t[r[4]];i[r[1]](function(){var t=o&&o.apply(this,arguments);t&&v(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,o?[t]:arguments)})}),t=null}).promise()},then:function(t,r,o){var i=0;function a(t,e,r,o){return function(){var u=this,s=arguments,c=function(){var n,c;if(!(t<i)){if((n=r.apply(u,s))===e.promise())throw new TypeError("Thenable self-resolution");c=n&&("object"==_typeof(n)||"function"==typeof n)&&n.then,v(c)?o?c.call(n,a(i,e,F,o),a(i,e,H,o)):(i++,c.call(n,a(i,e,F,o),a(i,e,H,o),a(i,e,F,e.notifyWith))):(r!==F&&(u=void 0,s=[n]),(o||e.resolveWith)(u,s))}},l=o?c:function(){try{c()}catch(n){_.Deferred.exceptionHook&&_.Deferred.exceptionHook(n,l.stackTrace),t+1>=i&&(r!==H&&(u=void 0,s=[n]),e.rejectWith(u,s))}};t?l():(_.Deferred.getStackHook&&(l.stackTrace=_.Deferred.getStackHook()),n.setTimeout(l))}}return _.Deferred(function(n){e[0][3].add(a(0,n,v(o)?o:F,n.notifyWith)),e[1][3].add(a(0,n,v(t)?t:F)),e[2][3].add(a(0,n,v(r)?r:H))}).promise()},promise:function(t){return null!=t?_.extend(t,o):o}},i={};return _.each(e,function(t,n){var a=n[2],u=n[5];o[n[1]]=a.add,u&&a.add(function(){r=u},e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(n[3].fire),i[n[0]]=function(){return i[n[0]+"With"](this===i?void 0:this,arguments),this},i[n[0]+"With"]=a.fireWith}),o.promise(i),t&&t.call(i,i),i},when:function(t){var e=arguments.length,n=e,r=Array(n),o=u.call(arguments),i=_.Deferred(),a=function(t){return function(n){r[t]=this,o[t]=arguments.length>1?u.call(arguments):n,--e||i.resolveWith(r,o)}};if(e<=1&&(j(t,i.done(a(n)).resolve,i.reject,!e),"pending"===i.state()||v(o[n]&&o[n].then)))return i.then();for(;n--;)j(o[n],a(n),i.reject);return i.promise()}});var V=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&V.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},_.readyException=function(t){n.setTimeout(function(){throw t})};var z=_.Deferred();function U(){y.removeEventListener("DOMContentLoaded",U),n.removeEventListener("load",U),_.ready()}_.fn.ready=function(t){return z.then(t).catch(function(t){_.readyException(t)}),this},_.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==t&&--_.readyWait>0||z.resolveWith(y,[_]))}}),_.ready.then=z.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?n.setTimeout(_.ready):(y.addEventListener("DOMContentLoaded",U),n.addEventListener("load",U));var W=function t(e,n,r,o,i,a,u){var s=0,c=e.length,l=null==r;if("object"===C(r))for(s in i=!0,r)t(e,n,s,r[s],!0,a,u);else if(void 0!==o&&(i=!0,v(o)||(u=!0),l&&(u?(n.call(e,o),n=null):(l=n,n=function(t,e,n){return l.call(_(t),n)})),n))for(;s<c;s++)n(e[s],r,u?o:o.call(e[s],s,n(e[s],r)));return i?e:l?n.call(e):c?n(e[0],r):a},q=/^-ms-/,$=/-([a-z])/g;function Y(t,e){return e.toUpperCase()}function G(t){return t.replace(q,"ms-").replace($,Y)}var K=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function X(){this.expando=_.expando+X.uid++}X.uid=1,X.prototype={cache:function(t){var e=t[this.expando];return e||(e={},K(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var r,o=this.cache(t);if("string"==typeof e)o[G(e)]=n;else for(r in e)o[G(r)]=e[r];return o},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][G(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r=t[this.expando];if(void 0!==r){if(void 0!==e){n=(e=Array.isArray(e)?e.map(G):(e=G(e))in r?[e]:e.match(L)||[]).length;for(;n--;)delete r[e[n]]}(void 0===e||_.isEmptyObject(r))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!_.isEmptyObject(e)}};var J=new X,Q=new X,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,tt=/[A-Z]/g;function et(t,e,n){var r;if(void 0===n&&1===t.nodeType)if(r="data-"+e.replace(tt,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(r))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:Z.test(t)?JSON.parse(t):t)}(n)}catch(t){}Q.set(t,e,n)}else n=void 0;return n}_.extend({hasData:function(t){return Q.hasData(t)||J.hasData(t)},data:function(t,e,n){return Q.access(t,e,n)},removeData:function(t,e){Q.remove(t,e)},_data:function(t,e,n){return J.access(t,e,n)},_removeData:function(t,e){J.remove(t,e)}}),_.fn.extend({data:function(t,e){var n,r,o,i=this[0],a=i&&i.attributes;if(void 0===t){if(this.length&&(o=Q.get(i),1===i.nodeType&&!J.get(i,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=G(r.slice(5)),et(i,r,o[r]));J.set(i,"hasDataAttrs",!0)}return o}return"object"==_typeof(t)?this.each(function(){Q.set(this,t)}):W(this,function(e){var n;if(i&&void 0===e)return void 0!==(n=Q.get(i,t))||void 0!==(n=et(i,t))?n:void 0;this.each(function(){Q.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){Q.remove(this,t)})}}),_.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=J.get(t,e),n&&(!r||Array.isArray(n)?r=J.access(t,e,_.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=_.queue(t,e),r=n.length,o=n.shift(),i=_._queueHooks(t,e);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===e&&n.unshift("inprogress"),delete i.stop,o.call(t,function(){_.dequeue(t,e)},i)),!r&&i&&i.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return J.get(t,n)||J.access(t,n,{empty:_.Callbacks("once memory").add(function(){J.remove(t,[e+"queue",n])})})}}),_.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?_.queue(this[0],t):void 0===e?this:this.each(function(){var n=_.queue(this,t,e);_._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&_.dequeue(this,t)})},dequeue:function(t){return this.each(function(){_.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,o=_.Deferred(),i=this,a=this.length,u=function(){--r||o.resolveWith(i,[i])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)(n=J.get(i[a],t+"queueHooks"))&&n.empty&&(r++,n.empty.add(u));return u(),o.promise(e)}});var nt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,rt=new RegExp("^(?:([+-])=|)("+nt+")([a-z%]*)$","i"),ot=["Top","Right","Bottom","Left"],it=y.documentElement,at=function(t){return _.contains(t.ownerDocument,t)},ut={composed:!0};it.getRootNode&&(at=function(t){return _.contains(t.ownerDocument,t)||t.getRootNode(ut)===t.ownerDocument});var st=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&at(t)&&"none"===_.css(t,"display")};function ct(t,e,n,r){var o,i,a=20,u=r?function(){return r.cur()}:function(){return _.css(t,e,"")},s=u(),c=n&&n[3]||(_.cssNumber[e]?"":"px"),l=t.nodeType&&(_.cssNumber[e]||"px"!==c&&+s)&&rt.exec(_.css(t,e));if(l&&l[3]!==c){for(s/=2,c=c||l[3],l=+s||1;a--;)_.style(t,e,l+c),(1-i)*(1-(i=u()/s||.5))<=0&&(a=0),l/=i;l*=2,_.style(t,e,l+c),n=n||[]}return n&&(l=+l||+s||0,o=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=l,r.end=o)),o}var lt={};function ft(t){var e,n=t.ownerDocument,r=t.nodeName,o=lt[r];return o||(e=n.body.appendChild(n.createElement(r)),o=_.css(e,"display"),e.parentNode.removeChild(e),"none"===o&&(o="block"),lt[r]=o,o)}function dt(t,e){for(var n,r,o=[],i=0,a=t.length;i<a;i++)(r=t[i]).style&&(n=r.style.display,e?("none"===n&&(o[i]=J.get(r,"display")||null,o[i]||(r.style.display="")),""===r.style.display&&st(r)&&(o[i]=ft(r))):"none"!==n&&(o[i]="none",J.set(r,"display",n)));for(i=0;i<a;i++)null!=o[i]&&(t[i].style.display=o[i]);return t}_.fn.extend({show:function(){return dt(this,!0)},hide:function(){return dt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){st(this)?_(this).show():_(this).hide()})}});var mt,ht,pt=/^(?:checkbox|radio)$/i,gt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,vt=/^$|^module$|\/(?:java|ecma)script/i;mt=y.createDocumentFragment().appendChild(y.createElement("div")),(ht=y.createElement("input")).setAttribute("type","radio"),ht.setAttribute("checked","checked"),ht.setAttribute("name","t"),mt.appendChild(ht),g.checkClone=mt.cloneNode(!0).cloneNode(!0).lastChild.checked,mt.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!mt.cloneNode(!0).lastChild.defaultValue,mt.innerHTML="<option></option>",g.option=!!mt.lastChild;var bt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function yt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&E(t,e)?_.merge([t],n):n}function xt(t,e){for(var n=0,r=t.length;n<r;n++)J.set(t[n],"globalEval",!e||J.get(e[n],"globalEval"))}bt.tbody=bt.tfoot=bt.colgroup=bt.caption=bt.thead,bt.th=bt.td,g.option||(bt.optgroup=bt.option=[1,"<select multiple='multiple'>","</select>"]);var wt=/<|&#?\w+;/;function Ct(t,e,n,r,o){for(var i,a,u,s,c,l,f=e.createDocumentFragment(),d=[],m=0,h=t.length;m<h;m++)if((i=t[m])||0===i)if("object"===C(i))_.merge(d,i.nodeType?[i]:i);else if(wt.test(i)){for(a=a||f.appendChild(e.createElement("div")),u=(gt.exec(i)||["",""])[1].toLowerCase(),s=bt[u]||bt._default,a.innerHTML=s[1]+_.htmlPrefilter(i)+s[2],l=s[0];l--;)a=a.lastChild;_.merge(d,a.childNodes),(a=f.firstChild).textContent=""}else d.push(e.createTextNode(i));for(f.textContent="",m=0;i=d[m++];)if(r&&_.inArray(i,r)>-1)o&&o.push(i);else if(c=at(i),a=yt(f.appendChild(i),"script"),c&&xt(a),n)for(l=0;i=a[l++];)vt.test(i.type||"")&&n.push(i);return f}var _t=/^key/,kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,St=/^([^.]*)(?:\.(.+)|)/;function Tt(){return!0}function Ot(){return!1}function Dt(t,e){return t===function(){try{return y.activeElement}catch(t){}}()==("focus"===e)}function Et(t,e,n,r,o,i){var a,u;if("object"==_typeof(e)){for(u in"string"!=typeof n&&(r=r||n,n=void 0),e)Et(t,u,n,r,e[u],i);return t}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=Ot;else if(!o)return t;return 1===i&&(a=o,(o=function(t){return _().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=_.guid++)),t.each(function(){_.event.add(this,e,o,r,n)})}function Nt(t,e,n){n?(J.set(t,e,!1),_.event.add(t,e,{namespace:!1,handler:function(t){var r,o,i=J.get(this,e);if(1&t.isTrigger&&this[e]){if(i.length)(_.event.special[e]||{}).delegateType&&t.stopPropagation();else if(i=u.call(arguments),J.set(this,e,i),r=n(this,e),this[e](),i!==(o=J.get(this,e))||r?J.set(this,e,!1):o={},i!==o)return t.stopImmediatePropagation(),t.preventDefault(),o.value}else i.length&&(J.set(this,e,{value:_.event.trigger(_.extend(i[0],_.Event.prototype),i.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===J.get(t,e)&&_.event.add(t,e,Tt)}_.event={global:{},add:function(t,e,n,r,o){var i,a,u,s,c,l,f,d,m,h,p,g=J.get(t);if(K(t))for(n.handler&&(n=(i=n).handler,o=i.selector),o&&_.find.matchesSelector(it,o),n.guid||(n.guid=_.guid++),(s=g.events)||(s=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(e){return void 0!==_&&_.event.triggered!==e.type?_.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(L)||[""]).length;c--;)m=p=(u=St.exec(e[c])||[])[1],h=(u[2]||"").split(".").sort(),m&&(f=_.event.special[m]||{},m=(o?f.delegateType:f.bindType)||m,f=_.event.special[m]||{},l=_.extend({type:m,origType:p,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&_.expr.match.needsContext.test(o),namespace:h.join(".")},i),(d=s[m])||((d=s[m]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(m,a)),f.add&&(f.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),o?d.splice(d.delegateCount++,0,l):d.push(l),_.event.global[m]=!0)},remove:function(t,e,n,r,o){var i,a,u,s,c,l,f,d,m,h,p,g=J.hasData(t)&&J.get(t);if(g&&(s=g.events)){for(c=(e=(e||"").match(L)||[""]).length;c--;)if(m=p=(u=St.exec(e[c])||[])[1],h=(u[2]||"").split(".").sort(),m){for(f=_.event.special[m]||{},d=s[m=(r?f.delegateType:f.bindType)||m]||[],u=u[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=d.length;i--;)l=d[i],!o&&p!==l.origType||n&&n.guid!==l.guid||u&&!u.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(d.splice(i,1),l.selector&&d.delegateCount--,f.remove&&f.remove.call(t,l));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(t,h,g.handle)||_.removeEvent(t,m,g.handle),delete s[m])}else for(m in s)_.event.remove(t,m+e[c],n,r,!0);_.isEmptyObject(s)&&J.remove(t,"handle events")}},dispatch:function(t){var e,n,r,o,i,a,u=new Array(arguments.length),s=_.event.fix(t),c=(J.get(this,"events")||Object.create(null))[s.type]||[],l=_.event.special[s.type]||{};for(u[0]=s,e=1;e<arguments.length;e++)u[e]=arguments[e];if(s.delegateTarget=this,!l.preDispatch||!1!==l.preDispatch.call(this,s)){for(a=_.event.handlers.call(this,s,c),e=0;(o=a[e++])&&!s.isPropagationStopped();)for(s.currentTarget=o.elem,n=0;(i=o.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!1!==i.namespace&&!s.rnamespace.test(i.namespace)||(s.handleObj=i,s.data=i.data,void 0!==(r=((_.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,s),s.result}},handlers:function(t,e){var n,r,o,i,a,u=[],s=e.delegateCount,c=t.target;if(s&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(i=[],a={},n=0;n<s;n++)void 0===a[o=(r=e[n]).selector+" "]&&(a[o]=r.needsContext?_(o,this).index(c)>-1:_.find(o,this,null,[c]).length),a[o]&&i.push(r);i.length&&u.push({elem:c,handlers:i})}return c=this,s<e.length&&u.push({elem:c,handlers:e.slice(s)}),u},addProp:function(t,e){Object.defineProperty(_.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[_.expando]?t:new _.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return pt.test(e.type)&&e.click&&E(e,"input")&&Nt(e,"click",Tt),!1},trigger:function(t){var e=this||t;return pt.test(e.type)&&e.click&&E(e,"input")&&Nt(e,"click"),!0},_default:function(t){var e=t.target;return pt.test(e.type)&&e.click&&E(e,"input")&&J.get(e,"click")||E(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},_.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},_.Event=function(t,e){if(!(this instanceof _.Event))return new _.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Tt:Ot,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&_.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[_.expando]=!0},_.Event.prototype={constructor:_.Event,isDefaultPrevented:Ot,isPropagationStopped:Ot,isImmediatePropagationStopped:Ot,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Tt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Tt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Tt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},_.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(t){var e=t.button;return null==t.which&&_t.test(t.type)?null!=t.charCode?t.charCode:t.keyCode:!t.which&&void 0!==e&&kt.test(t.type)?1&e?1:2&e?3:4&e?2:0:t.which}},_.event.addProp),_.each({focus:"focusin",blur:"focusout"},function(t,e){_.event.special[t]={setup:function(){return Nt(this,t,Dt),!1},trigger:function(){return Nt(this,t),!0},delegateType:e}}),_.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){_.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=t.relatedTarget,o=t.handleObj;return r&&(r===this||_.contains(this,r))||(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}}),_.fn.extend({on:function(t,e,n,r){return Et(this,t,e,n,r)},one:function(t,e,n,r){return Et(this,t,e,n,r,1)},off:function(t,e,n){var r,o;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,_(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==_typeof(t)){for(o in t)this.off(o,e,t[o]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=Ot),this.each(function(){_.event.remove(this,t,n,e)})}});var At=/<script|<style|<link/i,Rt=/checked\s*(?:[^=]|=\s*.checked.)/i,Bt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function It(t,e){return E(t,"table")&&E(11!==e.nodeType?e:e.firstChild,"tr")&&_(t).children("tbody")[0]||t}function Pt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Mt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Lt(t,e){var n,r,o,i,a,u;if(1===e.nodeType){if(J.hasData(t)&&(u=J.get(t).events))for(o in J.remove(e,"handle events"),u)for(n=0,r=u[o].length;n<r;n++)_.event.add(e,o,u[o][n]);Q.hasData(t)&&(i=Q.access(t),a=_.extend({},i),Q.set(e,a))}}function Ft(t,e){var n=e.nodeName.toLowerCase();"input"===n&&pt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function Ht(t,e,n,r){e=s(e);var o,i,a,u,c,l,f=0,d=t.length,m=d-1,h=e[0],p=v(h);if(p||d>1&&"string"==typeof h&&!g.checkClone&&Rt.test(h))return t.each(function(o){var i=t.eq(o);p&&(e[0]=h.call(this,o,i.html())),Ht(i,e,n,r)});if(d&&(i=(o=Ct(e,t[0].ownerDocument,!1,t,r)).firstChild,1===o.childNodes.length&&(o=i),i||r)){for(u=(a=_.map(yt(o,"script"),Pt)).length;f<d;f++)c=o,f!==m&&(c=_.clone(c,!0,!0),u&&_.merge(a,yt(c,"script"))),n.call(t[f],c,f);if(u)for(l=a[a.length-1].ownerDocument,_.map(a,Mt),f=0;f<u;f++)c=a[f],vt.test(c.type||"")&&!J.access(c,"globalEval")&&_.contains(l,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?_._evalUrl&&!c.noModule&&_._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},l):w(c.textContent.replace(Bt,""),c,l))}return t}function jt(t,e,n){for(var r,o=e?_.filter(e,t):t,i=0;null!=(r=o[i]);i++)n||1!==r.nodeType||_.cleanData(yt(r)),r.parentNode&&(n&&at(r)&&xt(yt(r,"script")),r.parentNode.removeChild(r));return t}_.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var r,o,i,a,u=t.cloneNode(!0),s=at(t);if(!(g.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||_.isXMLDoc(t)))for(a=yt(u),r=0,o=(i=yt(t)).length;r<o;r++)Ft(i[r],a[r]);if(e)if(n)for(i=i||yt(t),a=a||yt(u),r=0,o=i.length;r<o;r++)Lt(i[r],a[r]);else Lt(t,u);return(a=yt(u,"script")).length>0&&xt(a,!s&&yt(t,"script")),u},cleanData:function(t){for(var e,n,r,o=_.event.special,i=0;void 0!==(n=t[i]);i++)if(K(n)){if(e=n[J.expando]){if(e.events)for(r in e.events)o[r]?_.event.remove(n,r):_.removeEvent(n,r,e.handle);n[J.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),_.fn.extend({detach:function(t){return jt(this,t,!0)},remove:function(t){return jt(this,t)},text:function(t){return W(this,function(t){return void 0===t?_.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return Ht(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||It(this,t).appendChild(t)})},prepend:function(){return Ht(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=It(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return Ht(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return Ht(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(_.cleanData(yt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return _.clone(this,t,e)})},html:function(t){return W(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!At.test(t)&&!bt[(gt.exec(t)||["",""])[1].toLowerCase()]){t=_.htmlPrefilter(t);try{for(;n<r;n++)1===(e=this[n]||{}).nodeType&&(_.cleanData(yt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return Ht(this,arguments,function(e){var n=this.parentNode;_.inArray(this,t)<0&&(_.cleanData(yt(this)),n&&n.replaceChild(e,this))},t)}}),_.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){_.fn[t]=function(t){for(var n,r=[],o=_(t),i=o.length-1,a=0;a<=i;a++)n=a===i?this:this.clone(!0),_(o[a])[e](n),c.apply(r,n.get());return this.pushStack(r)}});var Vt=new RegExp("^("+nt+")(?!px)[a-z%]+$","i"),zt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},Ut=function(t,e,n){var r,o,i={};for(o in e)i[o]=t.style[o],t.style[o]=e[o];for(o in r=n.call(t),e)t.style[o]=i[o];return r},Wt=new RegExp(ot.join("|"),"i");function qt(t,e,n){var r,o,i,a,u=t.style;return(n=n||zt(t))&&(""!==(a=n.getPropertyValue(e)||n[e])||at(t)||(a=_.style(t,e)),!g.pixelBoxStyles()&&Vt.test(a)&&Wt.test(e)&&(r=u.width,o=u.minWidth,i=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=o,u.maxWidth=i)),void 0!==a?a+"":a}function $t(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(l){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",it.appendChild(c).appendChild(l);var t=n.getComputedStyle(l);r="1%"!==t.top,s=12===e(t.marginLeft),l.style.right="60%",a=36===e(t.right),o=36===e(t.width),l.style.position="absolute",i=12===e(l.offsetWidth/3),it.removeChild(c),l=null}}function e(t){return Math.round(parseFloat(t))}var r,o,i,a,u,s,c=y.createElement("div"),l=y.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===l.style.backgroundClip,_.extend(g,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),s},scrollboxSize:function(){return t(),i},reliableTrDimensions:function(){var t,e,r,o;return null==u&&(t=y.createElement("table"),e=y.createElement("tr"),r=y.createElement("div"),t.style.cssText="position:absolute;left:-11111px",e.style.height="1px",r.style.height="9px",it.appendChild(t).appendChild(e).appendChild(r),o=n.getComputedStyle(e),u=parseInt(o.height)>3,it.removeChild(t)),u}}))}();var Yt=["Webkit","Moz","ms"],Gt=y.createElement("div").style,Kt={};function Xt(t){return _.cssProps[t]||Kt[t]||(t in Gt?t:Kt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Yt.length;n--;)if((t=Yt[n]+e)in Gt)return t}(t)||t)}var Jt=/^(none|table(?!-c[ea]).+)/,Qt=/^--/,Zt={position:"absolute",visibility:"hidden",display:"block"},te={letterSpacing:"0",fontWeight:"400"};function ee(t,e,n){var r=rt.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function ne(t,e,n,r,o,i){var a="width"===e?1:0,u=0,s=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(s+=_.css(t,n+ot[a],!0,o)),r?("content"===n&&(s-=_.css(t,"padding"+ot[a],!0,o)),"margin"!==n&&(s-=_.css(t,"border"+ot[a]+"Width",!0,o))):(s+=_.css(t,"padding"+ot[a],!0,o),"padding"!==n?s+=_.css(t,"border"+ot[a]+"Width",!0,o):u+=_.css(t,"border"+ot[a]+"Width",!0,o));return!r&&i>=0&&(s+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-i-s-u-.5))||0),s}function re(t,e,n){var r=zt(t),o=(!g.boxSizingReliable()||n)&&"border-box"===_.css(t,"boxSizing",!1,r),i=o,a=qt(t,e,r),u="offset"+e[0].toUpperCase()+e.slice(1);if(Vt.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&o||!g.reliableTrDimensions()&&E(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===_.css(t,"display",!1,r))&&t.getClientRects().length&&(o="border-box"===_.css(t,"boxSizing",!1,r),(i=u in t)&&(a=t[u])),(a=parseFloat(a)||0)+ne(t,e,n||(o?"border":"content"),i,r,a)+"px"}function oe(t,e,n,r,o){return new oe.prototype.init(t,e,n,r,o)}_.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=qt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,i,a,u=G(e),s=Qt.test(e),c=t.style;if(s||(e=Xt(u)),a=_.cssHooks[e]||_.cssHooks[u],void 0===n)return a&&"get"in a&&void 0!==(o=a.get(t,!1,r))?o:c[e];"string"===(i=_typeof(n))&&(o=rt.exec(n))&&o[1]&&(n=ct(t,e,o),i="number"),null!=n&&n==n&&("number"!==i||s||(n+=o&&o[3]||(_.cssNumber[u]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(s?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var o,i,a,u=G(e);return Qt.test(e)||(e=Xt(u)),(a=_.cssHooks[e]||_.cssHooks[u])&&"get"in a&&(o=a.get(t,!0,n)),void 0===o&&(o=qt(t,e,r)),"normal"===o&&e in te&&(o=te[e]),""===n||n?(i=parseFloat(o),!0===n||isFinite(i)?i||0:o):o}}),_.each(["height","width"],function(t,e){_.cssHooks[e]={get:function(t,n,r){if(n)return!Jt.test(_.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?re(t,e,r):Ut(t,Zt,function(){return re(t,e,r)})},set:function(t,n,r){var o,i=zt(t),a=!g.scrollboxSize()&&"absolute"===i.position,u=(a||r)&&"border-box"===_.css(t,"boxSizing",!1,i),s=r?ne(t,e,r,u,i):0;return u&&a&&(s-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(i[e])-ne(t,e,"border",!1,i)-.5)),s&&(o=rt.exec(n))&&"px"!==(o[3]||"px")&&(t.style[e]=n,n=_.css(t,e)),ee(0,n,s)}}}),_.cssHooks.marginLeft=$t(g.reliableMarginLeft,function(t,e){if(e)return(parseFloat(qt(t,"marginLeft"))||t.getBoundingClientRect().left-Ut(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),_.each({margin:"",padding:"",border:"Width"},function(t,e){_.cssHooks[t+e]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];r<4;r++)o[t+ot[r]+e]=i[r]||i[r-2]||i[0];return o}},"margin"!==t&&(_.cssHooks[t+e].set=ee)}),_.fn.extend({css:function(t,e){return W(this,function(t,e,n){var r,o,i={},a=0;if(Array.isArray(e)){for(r=zt(t),o=e.length;a<o;a++)i[e[a]]=_.css(t,e[a],!1,r);return i}return void 0!==n?_.style(t,e,n):_.css(t,e)},t,e,arguments.length>1)}}),_.Tween=oe,oe.prototype={constructor:oe,init:function(t,e,n,r,o,i){this.elem=t,this.prop=n,this.easing=o||_.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=i||(_.cssNumber[n]?"":"px")},cur:function(){var t=oe.propHooks[this.prop];return t&&t.get?t.get(this):oe.propHooks._default.get(this)},run:function(t){var e,n=oe.propHooks[this.prop];return this.options.duration?this.pos=e=_.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):oe.propHooks._default.set(this),this}},oe.prototype.init.prototype=oe.prototype,oe.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=_.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){_.fx.step[t.prop]?_.fx.step[t.prop](t):1!==t.elem.nodeType||!_.cssHooks[t.prop]&&null==t.elem.style[Xt(t.prop)]?t.elem[t.prop]=t.now:_.style(t.elem,t.prop,t.now+t.unit)}}},oe.propHooks.scrollTop=oe.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},_.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},_.fx=oe.prototype.init,_.fx.step={};var ie,ae,ue=/^(?:toggle|show|hide)$/,se=/queueHooks$/;function ce(){ae&&(!1===y.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ce):n.setTimeout(ce,_.fx.interval),_.fx.tick())}function le(){return n.setTimeout(function(){ie=void 0}),ie=Date.now()}function fe(t,e){var n,r=0,o={height:t};for(e=e?1:0;r<4;r+=2-e)o["margin"+(n=ot[r])]=o["padding"+n]=t;return e&&(o.opacity=o.width=t),o}function de(t,e,n){for(var r,o=(me.tweeners[e]||[]).concat(me.tweeners["*"]),i=0,a=o.length;i<a;i++)if(r=o[i].call(n,e,t))return r}function me(t,e,n){var r,o,i=0,a=me.prefilters.length,u=_.Deferred().always(function(){delete s.elem}),s=function(){if(o)return!1;for(var e=ie||le(),n=Math.max(0,c.startTime+c.duration-e),r=1-(n/c.duration||0),i=0,a=c.tweens.length;i<a;i++)c.tweens[i].run(r);return u.notifyWith(t,[c,r,n]),r<1&&a?n:(a||u.notifyWith(t,[c,1,0]),u.resolveWith(t,[c]),!1)},c=u.promise({elem:t,props:_.extend({},e),opts:_.extend(!0,{specialEasing:{},easing:_.easing._default},n),originalProperties:e,originalOptions:n,startTime:ie||le(),duration:n.duration,tweens:[],createTween:function(e,n){var r=_.Tween(t,c.opts,e,n,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(r),r},stop:function(e){var n=0,r=e?c.tweens.length:0;if(o)return this;for(o=!0;n<r;n++)c.tweens[n].run(1);return e?(u.notifyWith(t,[c,1,0]),u.resolveWith(t,[c,e])):u.rejectWith(t,[c,e]),this}}),l=c.props;for(function(t,e){var n,r,o,i,a;for(n in t)if(o=e[r=G(n)],i=t[n],Array.isArray(i)&&(o=i[1],i=t[n]=i[0]),n!==r&&(t[r]=i,delete t[n]),(a=_.cssHooks[r])&&"expand"in a)for(n in i=a.expand(i),delete t[r],i)n in t||(t[n]=i[n],e[n]=o);else e[r]=o}(l,c.opts.specialEasing);i<a;i++)if(r=me.prefilters[i].call(c,t,l,c.opts))return v(r.stop)&&(_._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return _.map(l,de,c),v(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),_.fx.timer(_.extend(s,{elem:t,anim:c,queue:c.opts.queue})),c}_.Animation=_.extend(me,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return ct(n.elem,t,rt.exec(e),n),n}]},tweener:function(t,e){v(t)?(e=t,t=["*"]):t=t.match(L);for(var n,r=0,o=t.length;r<o;r++)n=t[r],me.tweeners[n]=me.tweeners[n]||[],me.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var r,o,i,a,u,s,c,l,f="width"in e||"height"in e,d=this,m={},h=t.style,p=t.nodeType&&st(t),g=J.get(t,"fxshow");for(r in n.queue||(null==(a=_._queueHooks(t,"fx")).unqueued&&(a.unqueued=0,u=a.empty.fire,a.empty.fire=function(){a.unqueued||u()}),a.unqueued++,d.always(function(){d.always(function(){a.unqueued--,_.queue(t,"fx").length||a.empty.fire()})})),e)if(o=e[r],ue.test(o)){if(delete e[r],i=i||"toggle"===o,o===(p?"hide":"show")){if("show"!==o||!g||void 0===g[r])continue;p=!0}m[r]=g&&g[r]||_.style(t,r)}if((s=!_.isEmptyObject(e))||!_.isEmptyObject(m))for(r in f&&1===t.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(c=g&&g.display)&&(c=J.get(t,"display")),"none"===(l=_.css(t,"display"))&&(c?l=c:(dt([t],!0),c=t.style.display||c,l=_.css(t,"display"),dt([t]))),("inline"===l||"inline-block"===l&&null!=c)&&"none"===_.css(t,"float")&&(s||(d.done(function(){h.display=c}),null==c&&(l=h.display,c="none"===l?"":l)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",d.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),s=!1,m)s||(g?"hidden"in g&&(p=g.hidden):g=J.access(t,"fxshow",{display:c}),i&&(g.hidden=!p),p&&dt([t],!0),d.done(function(){for(r in p||dt([t]),J.remove(t,"fxshow"),m)_.style(t,r,m[r])})),s=de(p?g[r]:0,r,d),r in g||(g[r]=s.start,p&&(s.end=s.start,s.start=0))}],prefilter:function(t,e){e?me.prefilters.unshift(t):me.prefilters.push(t)}}),_.speed=function(t,e,n){var r=t&&"object"==_typeof(t)?_.extend({},t):{complete:n||!n&&e||v(t)&&t,duration:t,easing:n&&e||e&&!v(e)&&e};return _.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in _.fx.speeds?r.duration=_.fx.speeds[r.duration]:r.duration=_.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&_.dequeue(this,r.queue)},r},_.fn.extend({fadeTo:function(t,e,n,r){return this.filter(st).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var o=_.isEmptyObject(t),i=_.speed(e,n,r),a=function(){var e=me(this,_.extend({},t),i);(o||J.get(this,"finish"))&&e.stop(!0)};return a.finish=a,o||!1===i.queue?this.each(a):this.queue(i.queue,a)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each(function(){var e=!0,o=null!=t&&t+"queueHooks",i=_.timers,a=J.get(this);if(o)a[o]&&a[o].stop&&r(a[o]);else for(o in a)a[o]&&a[o].stop&&se.test(o)&&r(a[o]);for(o=i.length;o--;)i[o].elem!==this||null!=t&&i[o].queue!==t||(i[o].anim.stop(n),e=!1,i.splice(o,1));!e&&n||_.dequeue(this,t)})},finish:function(t){return!1!==t&&(t=t||"fx"),this.each(function(){var e,n=J.get(this),r=n[t+"queue"],o=n[t+"queueHooks"],i=_.timers,a=r?r.length:0;for(n.finish=!0,_.queue(this,t,[]),o&&o.stop&&o.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===t&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<a;e++)r[e]&&r[e].finish&&r[e].finish.call(this);delete n.finish})}}),_.each(["toggle","show","hide"],function(t,e){var n=_.fn[e];_.fn[e]=function(t,r,o){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(fe(e,!0),t,r,o)}}),_.each({slideDown:fe("show"),slideUp:fe("hide"),slideToggle:fe("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){_.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}}),_.timers=[],_.fx.tick=function(){var t,e=0,n=_.timers;for(ie=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||_.fx.stop(),ie=void 0},_.fx.timer=function(t){_.timers.push(t),_.fx.start()},_.fx.interval=13,_.fx.start=function(){ae||(ae=!0,ce())},_.fx.stop=function(){ae=null},_.fx.speeds={slow:600,fast:200,_default:400},_.fn.delay=function(t,e){return t=_.fx&&_.fx.speeds[t]||t,e=e||"fx",this.queue(e,function(e,r){var o=n.setTimeout(e,t);r.stop=function(){n.clearTimeout(o)}})},function(){var t=y.createElement("input"),e=y.createElement("select").appendChild(y.createElement("option"));t.type="checkbox",g.checkOn=""!==t.value,g.optSelected=e.selected,(t=y.createElement("input")).value="t",t.type="radio",g.radioValue="t"===t.value}();var he,pe=_.expr.attrHandle;_.fn.extend({attr:function(t,e){return W(this,_.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){_.removeAttr(this,t)})}}),_.extend({attr:function(t,e,n){var r,o,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===t.getAttribute?_.prop(t,e,n):(1===i&&_.isXMLDoc(t)||(o=_.attrHooks[e.toLowerCase()]||(_.expr.match.bool.test(e)?he:void 0)),void 0!==n?null===n?void _.removeAttr(t,e):o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:(t.setAttribute(e,n+""),n):o&&"get"in o&&null!==(r=o.get(t,e))?r:null==(r=_.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&E(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,o=e&&e.match(L);if(o&&1===t.nodeType)for(;n=o[r++];)t.removeAttribute(n)}}),he={set:function(t,e,n){return!1===e?_.removeAttr(t,n):t.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),function(t,e){var n=pe[e]||_.find.attr;pe[e]=function(t,e,r){var o,i,a=e.toLowerCase();return r||(i=pe[a],pe[a]=o,o=null!=n(t,e,r)?a:null,pe[a]=i),o}});var ge=/^(?:input|select|textarea|button)$/i,ve=/^(?:a|area)$/i;function be(t){return(t.match(L)||[]).join(" ")}function ye(t){return t.getAttribute&&t.getAttribute("class")||""}function xe(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(L)||[]}_.fn.extend({prop:function(t,e){return W(this,_.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[_.propFix[t]||t]})}}),_.extend({prop:function(t,e,n){var r,o,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&_.isXMLDoc(t)||(e=_.propFix[e]||e,o=_.propHooks[e]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:t[e]=n:o&&"get"in o&&null!==(r=o.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=_.find.attr(t,"tabindex");return e?parseInt(e,10):ge.test(t.nodeName)||ve.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(_.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this}),_.fn.extend({addClass:function(t){var e,n,r,o,i,a,u,s=0;if(v(t))return this.each(function(e){_(this).addClass(t.call(this,e,ye(this)))});if((e=xe(t)).length)for(;n=this[s++];)if(o=ye(n),r=1===n.nodeType&&" "+be(o)+" "){for(a=0;i=e[a++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");o!==(u=be(r))&&n.setAttribute("class",u)}return this},removeClass:function(t){var e,n,r,o,i,a,u,s=0;if(v(t))return this.each(function(e){_(this).removeClass(t.call(this,e,ye(this)))});if(!arguments.length)return this.attr("class","");if((e=xe(t)).length)for(;n=this[s++];)if(o=ye(n),r=1===n.nodeType&&" "+be(o)+" "){for(a=0;i=e[a++];)for(;r.indexOf(" "+i+" ")>-1;)r=r.replace(" "+i+" "," ");o!==(u=be(r))&&n.setAttribute("class",u)}return this},toggleClass:function(t,e){var n=_typeof(t),r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):v(t)?this.each(function(n){_(this).toggleClass(t.call(this,n,ye(this),e),e)}):this.each(function(){var e,o,i,a;if(r)for(o=0,i=_(this),a=xe(t);e=a[o++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else void 0!==t&&"boolean"!==n||((e=ye(this))&&J.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":J.get(this,"__className__")||""))})},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+be(ye(n))+" ").indexOf(e)>-1)return!0;return!1}});var we=/\r/g;_.fn.extend({val:function(t){var e,n,r,o=this[0];return arguments.length?(r=v(t),this.each(function(n){var o;1===this.nodeType&&(null==(o=r?t.call(this,n,_(this).val()):t)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=_.map(o,function(t){return null==t?"":t+""})),(e=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))})):o?(e=_.valHooks[o.type]||_.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(we,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(t){var e=_.find.attr(t,"value");return null!=e?e:be(_.text(t))}},select:{get:function(t){var e,n,r,o=t.options,i=t.selectedIndex,a="select-one"===t.type,u=a?null:[],s=a?i+1:o.length;for(r=i<0?s:a?i:0;r<s;r++)if(((n=o[r]).selected||r===i)&&!n.disabled&&(!n.parentNode.disabled||!E(n.parentNode,"optgroup"))){if(e=_(n).val(),a)return e;u.push(e)}return u},set:function(t,e){for(var n,r,o=t.options,i=_.makeArray(e),a=o.length;a--;)((r=o[a]).selected=_.inArray(_.valHooks.option.get(r),i)>-1)&&(n=!0);return n||(t.selectedIndex=-1),i}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=_.inArray(_(t).val(),e)>-1}},g.checkOn||(_.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),g.focusin="onfocusin"in n;var Ce=/^(?:focusinfocus|focusoutblur)$/,_e=function(t){t.stopPropagation()};_.extend(_.event,{trigger:function(t,e,r,o){var i,a,u,s,c,l,f,d,h=[r||y],p=m.call(t,"type")?t.type:t,g=m.call(t,"namespace")?t.namespace.split("."):[];if(a=d=u=r=r||y,3!==r.nodeType&&8!==r.nodeType&&!Ce.test(p+_.event.triggered)&&(p.indexOf(".")>-1&&(g=p.split("."),p=g.shift(),g.sort()),c=p.indexOf(":")<0&&"on"+p,(t=t[_.expando]?t:new _.Event(p,"object"==_typeof(t)&&t)).isTrigger=o?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),e=null==e?[t]:_.makeArray(e,[t]),f=_.event.special[p]||{},o||!f.trigger||!1!==f.trigger.apply(r,e))){if(!o&&!f.noBubble&&!b(r)){for(s=f.delegateType||p,Ce.test(s+p)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||y)&&h.push(u.defaultView||u.parentWindow||n)}for(i=0;(a=h[i++])&&!t.isPropagationStopped();)d=a,t.type=i>1?s:f.bindType||p,(l=(J.get(a,"events")||Object.create(null))[t.type]&&J.get(a,"handle"))&&l.apply(a,e),(l=c&&a[c])&&l.apply&&K(a)&&(t.result=l.apply(a,e),!1===t.result&&t.preventDefault());return t.type=p,o||t.isDefaultPrevented()||f._default&&!1!==f._default.apply(h.pop(),e)||!K(r)||c&&v(r[p])&&!b(r)&&((u=r[c])&&(r[c]=null),_.event.triggered=p,t.isPropagationStopped()&&d.addEventListener(p,_e),r[p](),t.isPropagationStopped()&&d.removeEventListener(p,_e),_.event.triggered=void 0,u&&(r[c]=u)),t.result}},simulate:function(t,e,n){var r=_.extend(new _.Event,n,{type:t,isSimulated:!0});_.event.trigger(r,null,e)}}),_.fn.extend({trigger:function(t,e){return this.each(function(){_.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return _.event.trigger(t,e,n,!0)}}),g.focusin||_.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){_.event.simulate(e,t.target,_.event.fix(t))};_.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,o=J.access(r,e);o||r.addEventListener(t,n,!0),J.access(r,e,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,o=J.access(r,e)-1;o?J.access(r,e,o):(r.removeEventListener(t,n,!0),J.remove(r,e))}}});var ke=n.location,Se={guid:Date.now()},Te=/\?/;_.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||_.error("Invalid XML: "+t),e};var Oe=/\[\]$/,De=/\r?\n/g,Ee=/^(?:submit|button|image|reset|file)$/i,Ne=/^(?:input|select|textarea|keygen)/i;function Ae(t,e,n,r){var o;if(Array.isArray(e))_.each(e,function(e,o){n||Oe.test(t)?r(t,o):Ae(t+"["+("object"==_typeof(o)&&null!=o?e:"")+"]",o,n,r)});else if(n||"object"!==C(e))r(t,e);else for(o in e)Ae(t+"["+o+"]",e[o],n,r)}_.param=function(t,e){var n,r=[],o=function(t,e){var n=v(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!_.isPlainObject(t))_.each(t,function(){o(this.name,this.value)});else for(n in t)Ae(n,t[n],e,o);return r.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=_.prop(this,"elements");return t?_.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!_(this).is(":disabled")&&Ne.test(this.nodeName)&&!Ee.test(t)&&(this.checked||!pt.test(t))}).map(function(t,e){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,function(t){return{name:e.name,value:t.replace(De,"\r\n")}}):{name:e.name,value:n.replace(De,"\r\n")}}).get()}});var Re=/%20/g,Be=/#.*$/,Ie=/([?&])_=[^&]*/,Pe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Me=/^(?:GET|HEAD)$/,Le=/^\/\//,Fe={},He={},je="*/".concat("*"),Ve=y.createElement("a");function ze(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,o=0,i=e.toLowerCase().match(L)||[];if(v(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Ue(t,e,n,r){var o={},i=t===He;function a(u){var s;return o[u]=!0,_.each(t[u]||[],function(t,u){var c=u(e,n,r);return"string"!=typeof c||i||o[c]?i?!(s=c):void 0:(e.dataTypes.unshift(c),a(c),!1)}),s}return a(e.dataTypes[0])||!o["*"]&&a("*")}function We(t,e){var n,r,o=_.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((o[n]?t:r||(r={}))[n]=e[n]);return r&&_.extend(!0,t,r),t}Ve.href=ke.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ke.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ke.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":je,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?We(We(t,_.ajaxSettings),e):We(_.ajaxSettings,t)},ajaxPrefilter:ze(Fe),ajaxTransport:ze(He),ajax:function(t,e){"object"==_typeof(t)&&(e=t,t=void 0),e=e||{};var r,o,i,a,u,s,c,l,f,d,m=_.ajaxSetup({},e),h=m.context||m,p=m.context&&(h.nodeType||h.jquery)?_(h):_.event,g=_.Deferred(),v=_.Callbacks("once memory"),b=m.statusCode||{},x={},w={},C="canceled",k={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=Pe.exec(i);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?i:null},setRequestHeader:function(t,e){return null==c&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,x[t]=e),this},overrideMimeType:function(t){return null==c&&(m.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)k.always(t[k.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||C;return r&&r.abort(e),S(0,e),this}};if(g.promise(k),m.url=((t||m.url||ke.href)+"").replace(Le,ke.protocol+"//"),m.type=e.method||e.type||m.method||m.type,m.dataTypes=(m.dataType||"*").toLowerCase().match(L)||[""],null==m.crossDomain){s=y.createElement("a");try{s.href=m.url,s.href=s.href,m.crossDomain=Ve.protocol+"//"+Ve.host!=s.protocol+"//"+s.host}catch(t){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=_.param(m.data,m.traditional)),Ue(Fe,m,e,k),c)return k;for(f in(l=_.event&&m.global)&&0==_.active++&&_.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!Me.test(m.type),o=m.url.replace(Be,""),m.hasContent?m.data&&m.processData&&0===(m.contentType||"").indexOf("application/x-www-form-urlencoded")&&(m.data=m.data.replace(Re,"+")):(d=m.url.slice(o.length),m.data&&(m.processData||"string"==typeof m.data)&&(o+=(Te.test(o)?"&":"?")+m.data,delete m.data),!1===m.cache&&(o=o.replace(Ie,"$1"),d=(Te.test(o)?"&":"?")+"_="+Se.guid+++d),m.url=o+d),m.ifModified&&(_.lastModified[o]&&k.setRequestHeader("If-Modified-Since",_.lastModified[o]),_.etag[o]&&k.setRequestHeader("If-None-Match",_.etag[o])),(m.data&&m.hasContent&&!1!==m.contentType||e.contentType)&&k.setRequestHeader("Content-Type",m.contentType),k.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+je+"; q=0.01":""):m.accepts["*"]),m.headers)k.setRequestHeader(f,m.headers[f]);if(m.beforeSend&&(!1===m.beforeSend.call(h,k,m)||c))return k.abort();if(C="abort",v.add(m.complete),k.done(m.success),k.fail(m.error),r=Ue(He,m,e,k)){if(k.readyState=1,l&&p.trigger("ajaxSend",[k,m]),c)return k;m.async&&m.timeout>0&&(u=n.setTimeout(function(){k.abort("timeout")},m.timeout));try{c=!1,r.send(x,S)}catch(t){if(c)throw t;S(-1,t)}}else S(-1,"No Transport");function S(t,e,a,s){var f,d,y,x,w,C=e;c||(c=!0,u&&n.clearTimeout(u),r=void 0,i=s||"",k.readyState=t>0?4:0,f=t>=200&&t<300||304===t,a&&(x=function(t,e,n){for(var r,o,i,a,u=t.contents,s=t.dataTypes;"*"===s[0];)s.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(o in u)if(u[o]&&u[o].test(r)){s.unshift(o);break}if(s[0]in n)i=s[0];else{for(o in n){if(!s[0]||t.converters[o+" "+s[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==s[0]&&s.unshift(i),n[i]}(m,k,a)),!f&&_.inArray("script",m.dataTypes)>-1&&(m.converters["text script"]=function(){}),x=function(t,e,n,r){var o,i,a,u,s,c={},l=t.dataTypes.slice();if(l[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(i=l.shift();i;)if(t.responseFields[i]&&(n[t.responseFields[i]]=e),!s&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),s=i,i=l.shift())if("*"===i)i=s;else if("*"!==s&&s!==i){if(!(a=c[s+" "+i]||c["* "+i]))for(o in c)if((u=o.split(" "))[1]===i&&(a=c[s+" "+u[0]]||c["* "+u[0]])){!0===a?a=c[o]:!0!==c[o]&&(i=u[0],l.unshift(u[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+s+" to "+i}}}return{state:"success",data:e}}(m,x,k,f),f?(m.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(_.lastModified[o]=w),(w=k.getResponseHeader("etag"))&&(_.etag[o]=w)),204===t||"HEAD"===m.type?C="nocontent":304===t?C="notmodified":(C=x.state,d=x.data,f=!(y=x.error))):(y=C,!t&&C||(C="error",t<0&&(t=0))),k.status=t,k.statusText=(e||C)+"",f?g.resolveWith(h,[d,C,k]):g.rejectWith(h,[k,C,y]),k.statusCode(b),b=void 0,l&&p.trigger(f?"ajaxSuccess":"ajaxError",[k,m,f?d:y]),v.fireWith(h,[k,C]),l&&(p.trigger("ajaxComplete",[k,m]),--_.active||_.event.trigger("ajaxStop")))}return k},getJSON:function(t,e,n){return _.get(t,e,n,"json")},getScript:function(t,e){return _.get(t,void 0,e,"script")}}),_.each(["get","post"],function(t,e){_[e]=function(t,n,r,o){return v(n)&&(o=o||r,r=n,n=void 0),_.ajax(_.extend({url:t,type:e,dataType:o,data:n,success:r},_.isPlainObject(t)&&t))}}),_.ajaxPrefilter(function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")}),_._evalUrl=function(t,e,n){return _.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){_.globalEval(t,e,n)}})},_.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=_(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return v(t)?this.each(function(e){_(this).wrapInner(t.call(this,e))}):this.each(function(){var e=_(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=v(t);return this.each(function(n){_(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){_(this).replaceWith(this.childNodes)}),this}}),_.expr.pseudos.hidden=function(t){return!_.expr.pseudos.visible(t)},_.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var qe={0:200,1223:204},$e=_.ajaxSettings.xhr();g.cors=!!$e&&"withCredentials"in $e,g.ajax=$e=!!$e,_.ajaxTransport(function(t){var e,r;if(g.cors||$e&&!t.crossDomain)return{send:function(o,i){var a,u=t.xhr();if(u.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)u[a]=t.xhrFields[a];for(a in t.mimeType&&u.overrideMimeType&&u.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)u.setRequestHeader(a,o[a]);e=function(t){return function(){e&&(e=r=u.onload=u.onerror=u.onabort=u.ontimeout=u.onreadystatechange=null,"abort"===t?u.abort():"error"===t?"number"!=typeof u.status?i(0,"error"):i(u.status,u.statusText):i(qe[u.status]||u.status,u.statusText,"text"!==(u.responseType||"text")||"string"!=typeof u.responseText?{binary:u.response}:{text:u.responseText},u.getAllResponseHeaders()))}},u.onload=e(),r=u.onerror=u.ontimeout=e("error"),void 0!==u.onabort?u.onabort=r:u.onreadystatechange=function(){4===u.readyState&&n.setTimeout(function(){e&&r()})},e=e("abort");try{u.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),_.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return _.globalEval(t),t}}}),_.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),_.ajaxTransport("script",function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,o){e=_("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&o("error"===t.type?404:200,t.type)}),y.head.appendChild(e[0])},abort:function(){n&&n()}}});var Ye,Ge=[],Ke=/(=)\?(?=&|$)|\?\?/;_.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ge.pop()||_.expando+"_"+Se.guid++;return this[t]=!0,t}}),_.ajaxPrefilter("json jsonp",function(t,e,r){var o,i,a,u=!1!==t.jsonp&&(Ke.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ke.test(t.data)&&"data");if(u||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,u?t[u]=t[u].replace(Ke,"$1"+o):!1!==t.jsonp&&(t.url+=(Te.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return a||_.error(o+" was not called"),a[0]},t.dataTypes[0]="json",i=n[o],n[o]=function(){a=arguments},r.always(function(){void 0===i?_(n).removeProp(o):n[o]=i,t[o]&&(t.jsonpCallback=e.jsonpCallback,Ge.push(o)),a&&v(i)&&i(a[0]),a=i=void 0}),"script"}),g.createHTMLDocument=((Ye=y.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ye.childNodes.length),_.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(g.createHTMLDocument?((r=(e=y.implementation.createHTMLDocument("")).createElement("base")).href=y.location.href,e.head.appendChild(r)):e=y),i=!n&&[],(o=N.exec(t))?[e.createElement(o[1])]:(o=Ct([t],e,i),i&&i.length&&_(i).remove(),_.merge([],o.childNodes)));var r,o,i},_.fn.load=function(t,e,n){var r,o,i,a=this,u=t.indexOf(" ");return u>-1&&(r=be(t.slice(u)),t=t.slice(0,u)),v(e)?(n=e,e=void 0):e&&"object"==_typeof(e)&&(o="POST"),a.length>0&&_.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done(function(t){i=arguments,a.html(r?_("<div>").append(_.parseHTML(t)).find(r):t)}).always(n&&function(t,e){a.each(function(){n.apply(this,i||[t.responseText,e,t])})}),this},_.expr.pseudos.animated=function(t){return _.grep(_.timers,function(e){return t===e.elem}).length},_.offset={setOffset:function(t,e,n){var r,o,i,a,u,s,c=_.css(t,"position"),l=_(t),f={};"static"===c&&(t.style.position="relative"),u=l.offset(),i=_.css(t,"top"),s=_.css(t,"left"),("absolute"===c||"fixed"===c)&&(i+s).indexOf("auto")>-1?(a=(r=l.position()).top,o=r.left):(a=parseFloat(i)||0,o=parseFloat(s)||0),v(e)&&(e=e.call(t,n,_.extend({},u))),null!=e.top&&(f.top=e.top-u.top+a),null!=e.left&&(f.left=e.left-u.left+o),"using"in e?e.using.call(t,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),l.css(f))}},_.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){_.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,r=this[0],o={top:0,left:0};if("fixed"===_.css(r,"position"))e=r.getBoundingClientRect();else{for(e=this.offset(),n=r.ownerDocument,t=r.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===_.css(t,"position");)t=t.parentNode;t&&t!==r&&1===t.nodeType&&((o=_(t).offset()).top+=_.css(t,"borderTopWidth",!0),o.left+=_.css(t,"borderLeftWidth",!0))}return{top:e.top-o.top-_.css(r,"marginTop",!0),left:e.left-o.left-_.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===_.css(t,"position");)t=t.offsetParent;return t||it})}}),_.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n="pageYOffset"===e;_.fn[t]=function(r){return W(this,function(t,r,o){var i;if(b(t)?i=t:9===t.nodeType&&(i=t.defaultView),void 0===o)return i?i[e]:t[r];i?i.scrollTo(n?i.pageXOffset:o,n?o:i.pageYOffset):t[r]=o},t,r,arguments.length)}}),_.each(["top","left"],function(t,e){_.cssHooks[e]=$t(g.pixelPosition,function(t,n){if(n)return n=qt(t,e),Vt.test(n)?_(t).position()[e]+"px":n})}),_.each({Height:"height",Width:"width"},function(t,e){_.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,r){_.fn[r]=function(o,i){var a=arguments.length&&(n||"boolean"!=typeof o),u=n||(!0===o||!0===i?"margin":"border");return W(this,function(e,n,o){var i;return b(e)?0===r.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(i=e.documentElement,Math.max(e.body["scroll"+t],i["scroll"+t],e.body["offset"+t],i["offset"+t],i["client"+t])):void 0===o?_.css(e,n,u):_.style(e,n,o,u)},e,a?o:void 0,a)}})}),_.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){_.fn[e]=function(t){return this.on(e,t)}}),_.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),_.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){_.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}});var Xe=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;_.proxy=function(t,e){var n,r,o;if("string"==typeof e&&(n=t[e],e=t,t=n),v(t))return r=u.call(arguments,2),(o=function(){return t.apply(e||this,r.concat(u.call(arguments)))}).guid=t.guid=t.guid||_.guid++,o},_.holdReady=function(t){t?_.readyWait++:_.ready(!0)},_.isArray=Array.isArray,_.parseJSON=JSON.parse,_.nodeName=E,_.isFunction=v,_.isWindow=b,_.camelCase=G,_.type=C,_.now=Date.now,_.isNumeric=function(t){var e=_.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},_.trim=function(t){return null==t?"":(t+"").replace(Xe,"")},void 0===(r=function(){return _}.apply(e,[]))||(t.exports=r);var Je=n.jQuery,Qe=n.$;return _.noConflict=function(t){return n.$===_&&(n.$=Qe),t&&n.jQuery===_&&(n.jQuery=Je),_},void 0===o&&(n.jQuery=n.$=_),_})},"GC/X":function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.ui.escapeSelector=(e=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,function(t){return t.replace(e,"\\$1")});var e})?r.apply(e,o):r)||(t.exports=i)},HSsa:function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},JAFY:function(t,e){!function(t){"use strict";var e,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(){},a=function(t){return function(){return t}},u=function(t){return function(e){return!t(e)}},s=a(!1),c=a(!0),l=function(){return f},f=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:s,isSome:s,isNone:c,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(void 0),or:n,orThunk:e,map:l,each:i,bind:l,exists:s,forall:c,filter:l,equals:t,equals_:t,toArray:function(){return[]},toString:a("none()")}}(),d=function t(e){var n=a(e),r=function(){return i},o=function(t){return t(e)},i={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:c,isNone:s,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:r,orThunk:r,map:function(n){return t(n(e))},each:function(t){t(e)},bind:o,exists:o,forall:o,filter:function(t){return t(e)?i:f},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(s,function(t){return n(e,t)})}};return i},m=d,h=l,p=function(t){return null==t?f:d(t)},g=function(t){return function(e){return r=_typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},v=function(t){return function(e){return _typeof(e)===t}},b=g("string"),y=g("array"),x=v("boolean"),w=v("function"),C=v("number"),_=Array.prototype.slice,k=Array.prototype.push,S=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},T=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},O=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},D=function(t,e,n){return T(t,function(t){n=e(n,t)}),n},E=function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return m(i);if(n(i,r))break}return h()},N=function(t,e){return E(t,e,s)},A=function(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!y(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);k.apply(e,t[n])}return e}(S(t,e))},R=function(t){var e=_.call(t,0);return e.reverse(),e},B=function(t){return 0===t.length?h():m(t[0])},I=function(t){return 0===t.length?h():m(t[t.length-1])},P=function(){return(P=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},M=function(){return L(0,0)},L=function(t,e){return{major:t,minor:e}},F=function(t,e){var n=String(e).toLowerCase();return 0===t.length?M():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return L(r(1),r(2))}(t,n)},H=M,j=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},V=function(){return j({current:void 0,version:H()})},z=j,U=(a("Edge"),a("Chrome"),a("IE"),a("Opera"),a("Firefox"),a("Safari"),function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}}),W=function(){return U({current:void 0,version:H()})},q=U,$=(a("Windows"),a("iOS"),a("Android"),a("Linux"),a("OSX"),a("Solaris"),a("FreeBSD"),a("ChromeOS"),function(t,e){var n=String(e).toLowerCase();return N(t,function(t){return t.search(n)})}),Y=function(t,e){return-1!==t.indexOf(e)},G=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,K=function(t){return function(e){return Y(e,t)}},X=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Y(t,"edge/")&&Y(t,"chrome")&&Y(t,"safari")&&Y(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,G],search:function(t){return Y(t,"chrome")&&!Y(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Y(t,"msie")||Y(t,"trident")}},{name:"Opera",versionRegexes:[G,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:K("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:K("firefox")},{name:"Safari",versionRegexes:[G,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Y(t,"safari")||Y(t,"mobile/"))&&Y(t,"applewebkit")}}],J=[{name:"Windows",search:K("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Y(t,"iphone")||Y(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:K("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:K("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:K("linux"),versionRegexes:[]},{name:"Solaris",search:K("sunos"),versionRegexes:[]},{name:"FreeBSD",search:K("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:K("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Q={browsers:a(X),oses:a(J)},Z=function(t,e){var n=Q.browsers(),r=Q.oses(),o=function(t,e){return $(t,e).map(function(t){var n=F(t.versionRegexes,e);return{current:t.name,version:n}})}(n,t).fold(V,z),i=function(t,e){return $(t,e).map(function(t){var n=F(t.versionRegexes,e);return{current:t.name,version:n}})}(r,t).fold(W,q);return{browser:o,os:i,deviceType:function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,u=t.isiOS()||t.isAndroid(),s=u||r("(pointer:coarse)"),c=o||!i&&u&&r("(min-device-width:768px)"),l=i||u&&!c,f=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),d=!l&&!c&&!f;return{isiPad:a(o),isiPhone:a(i),isTablet:a(c),isPhone:a(l),isTouch:a(s),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:a(f),isDesktop:a(d)}}(i,o,t,e)}},tt=function(e){return t.window.matchMedia(e).matches},et=(e=function(){return Z(t.navigator.userAgent,tt)},r=!1,function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return r||(r=!0,n=e.apply(null,t)),n}),nt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:a(t)}},rt=function(e,n){var r=(n||t.document).createElement(e);return nt(r)},ot=nt,it=function(t,e){return t.dom()===e.dom()},at=function(e,n){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(e.dom(),n.dom(),t.Node.DOCUMENT_POSITION_CONTAINED_BY)},ut=function(t,e){var n=t.dom();if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},st=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),ct=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),lt=tinymce.util.Tools.resolve("tinymce.util.VK"),ft=function(t,e,n){return t.isSome()&&e.isSome()?m(n(t.getOrDie(),e.getOrDie())):h()},dt=(void 0!==t.window?t.window:Function("return this;")(),function(t){return t.dom().nodeName.toLowerCase()}),mt=(1,function(t){return 1===function(t){return t.dom().nodeType}(t)}),ht=function(t){return p(t.dom().parentNode).map(ot)},pt=function(t){return S(t.dom().childNodes,ot)},gt=function(t,e){var n=t.dom().childNodes;return p(n[e]).map(ot)},vt=function(t){return gt(t,0)},bt=function(t){return gt(t,t.dom().childNodes.length-1)},yt=function(t,e){ht(t).each(function(n){n.dom().insertBefore(e.dom(),t.dom())})},xt=function(t,e){t.dom().appendChild(e.dom())},wt=function(t,e){T(e,function(e){xt(t,e)})},Ct=function(t){var e=t.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},_t=function(t,e,n){return t.fire("ListMutation",{action:e,element:n})},kt=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),St=tinymce.util.Tools.resolve("tinymce.util.Tools"),Tt=function(t){return function(e){return e&&e.nodeName.toLowerCase()===t}},Ot=function(t){return function(e){return e&&t.test(e.nodeName)}},Dt=function(t){return t&&3===t.nodeType},Et=Ot(/^(OL|UL|DL)$/),Nt=Ot(/^(OL|UL)$/),At=Tt("ol"),Rt=Ot(/^(LI|DT|DD)$/),Bt=Ot(/^(DT|DD)$/),It=Ot(/^(TH|TD)$/),Pt=Tt("br"),Mt=function(t,e){return e&&!!t.schema.getTextBlockElements()[e.nodeName]},Lt=function(t,e){return t&&t.nodeName in e},Ft=function(t,e,n){var r=t.isEmpty(e);return!(n&&t.select("span[data-mce-type=bookmark]",e).length>0)&&r},Ht=function(t,e){return t.isChildOf(e,t.getRoot())},jt=function(t,e){var n=e||t.selection.getStart(!0);return t.dom.getParent(n,"OL,UL,DL",zt(t,n))},Vt=function(t){var e=t.selection.getSelectedBlocks();return St.grep(function(t,e){var n=St.map(e,function(e){return t.dom.getParent(e,"li,dd,dt",zt(t,e))||e});return kt.unique(n)}(t,e),function(t){return Rt(t)})},zt=function(t,e){var n=t.dom.getParents(e,"TD,TH");return n.length>0?n[0]:t.getBody()},Ut=function(t,e){var n=t.dom.getParents(e,"ol,ul",zt(t,e));return I(n)},Wt=function(t,e){var n=S(e,function(e){return Ut(t,e).getOr(e)});return kt.unique(n)},qt=function(t,e){var n,r,o,i=t.dom,a=t.schema.getBlockElements(),u=i.createFragment(),s=function(t){var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}(t);if(s&&((r=i.create(s)).tagName===s.toUpperCase()&&i.setAttribs(r,function(t){return t.getParam("forced_root_block_attrs",{})}(t)),Lt(e.firstChild,a)||u.appendChild(r)),e)for(;n=e.firstChild;){var c=n.nodeName;o||"SPAN"===c&&"bookmark"===n.getAttribute("data-mce-type")||(o=!0),Lt(n,a)?(u.appendChild(n),r=null):s?(r||(r=i.create(s),u.appendChild(r)),r.appendChild(n)):u.appendChild(n)}return s?o||r.appendChild(i.create("br",{"data-mce-bogus":"1"})):u.appendChild(i.create("br")),u},$t=Object.keys,Yt=function(t,e){for(var n=$t(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},Gt=function(e,n){var r=e.dom();Yt(n,function(e,n){!function(e,n,r){if(!(b(r)||x(r)||C(r)))throw t.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,r+"")}(r,n,e)})},Kt=function(t){return D(t.dom().attributes,function(t,e){return t[e.name]=e.value,t},{})},Xt=(w(t.Element.prototype.attachShadow)&&w(t.Node.prototype.getRootNode),function(e,n,r){if(!b(r))throw t.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",e),new Error("CSS value must be a string: "+r);(function(t){return void 0!==t.style&&w(t.style.getPropertyValue)})(e)&&e.style.setProperty(n,r)}),Jt=function(t){return function(t,e){return ot(t.dom().cloneNode(!0))}(t)},Qt=function(t,e){var n=function(t,e){var n=rt(e),r=Kt(t);return Gt(n,r),n}(t,e);yt(t,n);var r=pt(t);return wt(n,r),Ct(t),n},Zt=function(t,e){xt(t.item,e.list)},te=function(t,e){var n={list:rt(e,t),item:rt("li",t)};return xt(n.list,n.item),n},ee=function(t){return ut(t,"OL,UL")},ne=function(t){return vt(t).map(ee).getOr(!1)},re=function(t){return t.depth>0},oe=function(t){return t.isSelected},ie=function(t){var e=pt(t),n=bt(t).map(ee).getOr(!1)?e.slice(0,-1):e;return S(n,Jt)},ae=function(t){return T(t,function(e,n){(function(t,e){var n=t[e].depth,r=function(t){return t.depth===n&&!t.dirty},o=function(t){return t.depth<n};return E(R(t.slice(0,e)),r,o).orThunk(function(){return E(t.slice(e+1),r,o)})})(t,n).fold(function(){var t;e.dirty&&((t=e).listAttributes=function(t,e){var n={};return function(t,e,n,r){Yt(t,function(t,o){(e(t,o)?n:r)(t,o)})}(t,e,function(t){return function(e,n){t[n]=e}}(n),i),n}(t.listAttributes,function(t,e){return"start"!==e}))},function(t){return r=t,(n=e).listType=r.listType,void(n.listAttributes=P({},r.listAttributes));var n,r})}),t},ue=function(t,e,n,r){return vt(r).filter(ee).fold(function(){e.each(function(t){it(t.start,r)&&n.set(!0)});var o=function(t,e,n){return ht(t).filter(mt).map(function(r){return{depth:e,dirty:!1,isSelected:n,content:ie(t),itemAttributes:Kt(t),listAttributes:Kt(r),listType:dt(r)}})}(r,t,n.get());e.each(function(t){it(t.end,r)&&n.set(!1)});var i=bt(r).filter(ee).map(function(r){return se(t,e,n,r)}).getOr([]);return o.toArray().concat(i)},function(r){return se(t,e,n,r)})},se=function t(e,n,r,o){return A(pt(o),function(o){return(ee(o)?t:ue)(e+1,n,r,o)})},ce=function(e,n){var r=ae(n);return S(r,function(n){var r,o,i=(r=n.content,o=t.document.createDocumentFragment(),T(r,function(t){o.appendChild(t.dom())}),ot(o));return ot(qt(e,i.dom()))})},le=function(t,e){var n=ae(e);return function(t,e){var n=D(e,function(e,n){return n.depth>e.length?function(t,e,n){var r,o=function(t,e,n){for(var r=[],o=0;o<n;o++)r.push(te(t,e.listType));return r}(t,n,n.depth-e.length);return function(t){for(var e=1;e<t.length;e++)Zt(t[e-1],t[e])}(o),function(t,e){for(var n=0;n<t.length-1;n++)r=t[n].item.dom(),Xt(r,"list-style-type","none");var r;I(t).each(function(t){Gt(t.list,e.listAttributes),Gt(t.item,e.itemAttributes),wt(t.item,e.content)})}(o,n),r=o,ft(I(e),B(r),Zt),e.concat(o)}(t,e,n):function(t,e,n){var r=e.slice(0,n.depth);return I(r).each(function(e){!function(t,e){xt(t.list,e),t.item=e}(e,function(t,e,n){var r=rt("li",t);return Gt(r,e),wt(r,n),r}(t,n.itemAttributes,n.content)),function(t,e){dt(t.list)!==e.listType&&(t.list=Qt(t.list,e.listType)),Gt(t.list,e.listAttributes)}(e,n)}),r}(t,e,n)},[]);return B(n).map(function(t){return t.list})}(t.contentDocument,n).toArray()},fe=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),de=fe.DOM,me=function(t){ut(t,"dt")&&Qt(t,"dd")},he=function(t,e){if(Dt(t))return{container:t,offset:e};var n=st.getNode(t,e);return Dt(n)?{container:n,offset:e>=t.childNodes.length?n.data.length:0}:n.previousSibling&&Dt(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&Dt(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:t,offset:e}},pe=function(t){var e=t.cloneRange(),n=he(t.startContainer,t.startOffset);e.setStart(n.container,n.offset);var r=he(t.endContainer,t.endOffset);return e.setEnd(r.container,r.offset),e},ge=function(t,e){var n=S(function(t){var e=function(t){var e=Ut(t,t.selection.getStart()),n=O(t.selection.getSelectedBlocks(),Nt);return e.toArray().concat(n)}(t);return Wt(t,e)}(t),ot),r=S(function(t){return O(Vt(t),Bt)}(t),ot),o=!1;if(n.length||r.length){var i=t.selection.getBookmark();(function(t,e,n){var r=function(t,e){var n,r=(n=!1,{get:function(){return n},set:function(t){n=t}});return S(t,function(t){return{sourceList:t,entries:se(0,e,r,t)}})}(e,function(t){var e=S(Vt(t),ot);return ft(N(e,u(ne)),N(R(e),u(ne)),function(t,e){return{start:t,end:e}})}(t));T(r,function(e){!function(t,e){T(O(t,oe),function(t){return function(t,e){switch(t){case"Indent":e.depth++;break;case"Outdent":e.depth--;break;case"Flatten":e.depth=0}e.dirty=!0}(e,t)})}(e.entries,n);var r,o=function(t,e){return A(function(t,e){if(0===t.length)return[];for(var n=e(t[0]),r=[],o=[],i=0,a=t.length;i<a;i++){var u=t[i],s=e(u);s!==n&&(r.push(o),o=[]),n=s,o.push(u)}return 0!==o.length&&r.push(o),r}(e,re),function(e){return B(e).map(re).getOr(!1)?le(t,e):ce(t,e)})}(t,e.entries);T(o,function(e){_t(t,"Indent"===n?"IndentList":"OutdentList",e.dom())}),r=e.sourceList,T(o,function(t){yt(r,t)}),Ct(e.sourceList)})})(t,n,e),function(t,e,n){T(r,"Indent"===e?me:function(e){return function(t,e){ut(e,"dd")?Qt(e,"dt"):ut(e,"dt")&&ht(e).each(function(n){return function(t,e,n){var r=de.select('span[data-mce-type="bookmark"]',e),o=qt(t,n),i=de.createRng();i.setStartAfter(n),i.setEndAfter(e);for(var a,u=i.extractContents(),s=u.firstChild;s;s=s.firstChild)if("LI"===s.nodeName&&t.dom.isEmpty(s)){de.remove(s);break}t.dom.isEmpty(u)||de.insertAfter(u,e),de.insertAfter(o,e),Ft(t.dom,n.parentNode)&&(a=n.parentNode,St.each(r,function(t){a.parentNode.insertBefore(t,n.parentNode)}),de.remove(a)),de.remove(n),Ft(t.dom,e)&&de.remove(e)}(t,n.dom(),e.dom())})}(t,e)})}(t,e),t.selection.moveToBookmark(i),t.selection.setRng(pe(t.selection.getRng())),t.nodeChanged(),o=!0}return o},ve=function(t){return ge(t,"Indent")},be=function(t){return ge(t,"Outdent")},ye=function(t){return ge(t,"Flatten")},xe=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),we=fe.DOM,Ce=function(t){var e={},n=function(n){var r,o,i;o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===o.nodeType&&(r=we.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(i=Math.min(i,o.childNodes.length-1),n?o.insertBefore(r,o.childNodes[i]):we.insertAfter(r,o.childNodes[i])):o.appendChild(r),o=r,i=0),e[n?"startContainer":"endContainer"]=o,e[n?"startOffset":"endOffset"]=i};return n(!0),t.collapsed||n(),e},_e=function(t){function e(e){var n,r,o;n=o=t[e?"startContainer":"endContainer"],r=t[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(r=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(n),n=n.parentNode,we.remove(o),!n.hasChildNodes()&&we.isBlock(n)&&n.appendChild(we.create("br"))),t[e?"startContainer":"endContainer"]=n,t[e?"startOffset":"endOffset"]=r)}e(!0),e();var n=we.createRng();return n.setStart(t.startContainer,t.startOffset),t.endContainer&&n.setEnd(t.endContainer,t.endOffset),pe(n)},ke=function(t){switch(t){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Se=function(t){return/\btox\-/.test(t.className)},Te=function(t,e,n){return function(){var r=function(t){var r=E(t.parents,Et,It).filter(function(t){return t.nodeName===e&&!Se(t)}).isSome();n(r)};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}},Oe=function(t,e){St.each(e,function(e,n){t.setAttribute(n,e)})},De=function(t,e,n){!function(t,e,n){var r=n["list-style-type"]?n["list-style-type"]:null;t.setStyle(e,"list-style-type",r)}(t,e,n),function(t,e,n){Oe(e,n["list-attributes"]),St.each(t.select("li",e),function(t){Oe(t,n["list-item-attributes"])})}(t,e,n)},Ee=function(t,e,n,r){var o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!n&&Pt(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Mt(t,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Ne=function(t,e,n){return function(t,e){return t&&e&&Et(t)&&t.nodeName===e.nodeName}(e,n)&&function(t,e,n){return t.getStyle(e,"list-style-type",!0)===t.getStyle(n,"list-style-type",!0)}(t,e,n)&&(r=n,e.className===r.className);var r},Ae=function(t,e){var n,r;if(n=e.nextSibling,Ne(t,e,n)){for(;r=n.firstChild;)e.appendChild(r);t.remove(n)}if(n=e.previousSibling,Ne(t,e,n)){for(;r=n.lastChild;)e.insertBefore(r,e.firstChild);t.remove(n)}},Re=function(t){return"list-style-type"in t},Be=function(t,e,n){var r=jt(t),o=function(t){var e=jt(t),n=t.selection.getSelectedBlocks();return function(t,e){return t&&1===e.length&&e[0]===t}(e,n)?function(t){return St.grep(t.querySelectorAll("ol,ul,dl"),function(t){return Et(t)})}(e):St.grep(n,function(t){return Et(t)&&e!==t})}(t);n=n||{},r&&o.length>0?function(t,e,n,r,o){if(e.nodeName!==r||Re(o)){var i=Ce(t.selection.getRng(!0));St.each([e].concat(n),function(e){!function(t,e,n,r){if(e.nodeName!==n){var o=t.dom.rename(e,n);De(t.dom,o,r),_t(t,ke(n),o)}else De(t.dom,e,r),_t(t,ke(n),e)}(t,e,r,o)}),t.selection.setRng(_e(i))}else ye(t)}(t,r,o,e,n):function(t,e,n,r){if(e!==t.getBody())if(e)if(e.nodeName!==n||Re(r)||Se(e)){var o=Ce(t.selection.getRng(!0));De(t.dom,e,r);var i=t.dom.rename(e,n);Ae(t.dom,i),t.selection.setRng(_e(o)),_t(t,ke(n),i)}else ye(t);else(function(t,e,n){void 0===n&&(n={});var r=t.selection.getRng(),o="LI",i=zt(t,t.selection.getStart(!0)),a=t.dom;if("false"!==a.getContentEditable(t.selection.getNode())){"DL"===(e=e.toUpperCase())&&(o="DT");var u=Ce(r);St.each(function(t,e,n){for(var r,o=[],i=t.dom,a=Ee(t,e,!0,n),u=Ee(t,e,!1,n),s=[],c=a;c&&(s.push(c),c!==u);c=c.nextSibling);return St.each(s,function(e){if(Mt(t,e))return o.push(e),void(r=null);if(i.isBlock(e)||Pt(e))return Pt(e)&&i.remove(e),void(r=null);var a=e.nextSibling;xe.isBookmarkNode(e)&&(Mt(t,a)||!a&&e.parentNode===n)?r=null:(r||(r=i.create("p"),e.parentNode.insertBefore(r,e),o.push(r)),r.appendChild(e))}),o}(t,r,i),function(r){var i,u=r.previousSibling;u&&Et(u)&&u.nodeName===e&&function(t,e,n){var r=a.getStyle(e,"list-style-type"),o=n?n["list-style-type"]:"";return r===(null===o?"":o)}(0,u,n)?(i=u,r=a.rename(r,o),u.appendChild(r)):(i=a.create(e),r.parentNode.insertBefore(i,r),i.appendChild(r),r=a.rename(r,o)),function(t,e,n){St.each(["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],function(n){var r;return t.setStyle(e,((r={})[n]="",r))})}(a,r),De(a,i,n),Ae(t.dom,i)}),t.selection.setRng(_e(u))}})(t,n,r),_t(t,ke(n),e)}(t,r,e,n)},Ie=fe.DOM,Pe=function(t,e,n,r){var o=e.startContainer,i=e.startOffset;if(Dt(o)&&(n?i<o.data.length:i>0))return o;var a=t.schema.getNonEmptyElements();1===o.nodeType&&(o=st.getNode(o,i));var u=new ct(o,r);for(n&&function(t,e){return!!Pt(e)&&!(!t.isBlock(e.nextSibling)||Pt(e.previousSibling))}(t.dom,o)&&u.next();o=u[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(a[o.nodeName])return o;if(Dt(o)&&o.data.length>0)return o}},Me=function(t,e){var n=e.childNodes;return 1===n.length&&!Et(n[0])&&t.isBlock(n[0])},Le=function(t,e,n){var r,o=e.parentNode;if(Ht(t,e)&&Ht(t,n)){Et(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&Pt(o.previousSibling)&&t.remove(o.previousSibling);var i=n.lastChild;i&&Pt(i)&&e.hasChildNodes()&&t.remove(i),Ft(t,n,!0)&&t.$(n).empty(),function(t,e,n){var r,o=Me(t,n)?n.firstChild:n;if(function(t,e){Me(t,e)&&t.remove(e.firstChild,!0)}(t,e),!Ft(t,e,!0))for(;r=e.firstChild;)o.appendChild(r)}(t,e,n),r&&n.appendChild(r);var a=function(t,e){return et().browser.isIE()?at(t,e):function(t,e){var n=t.dom(),r=e.dom();return n!==r&&n.contains(r)}(t,e)}(ot(n),ot(e))?t.getParents(e,Et,n):[];t.remove(e),T(a,function(e){Ft(t,e)&&e!==t.getRoot()&&t.remove(e)})}},Fe=function(t,e){var n=t.dom,r=t.selection,o=r.getStart(),i=zt(t,o),a=n.getParent(r.getStart(),"LI",i);if(a){var u=a.parentNode;if(u===t.getBody()&&Ft(n,u))return!0;var s=pe(r.getRng()),c=n.getParent(Pe(t,s,e,i),"LI",i);if(c&&c!==a)return t.undoManager.transact(function(){var n;e?function(t,e,n,r){var o=t.dom;if(o.isEmpty(r))!function(t,e,n){t.dom.$(n).empty(),Le(t.dom,e,n),t.selection.setCursorLocation(n)}(t,n,r);else{var i=Ce(e);Le(o,n,r),t.selection.setRng(_e(i))}}(t,s,c,a):(n=a).parentNode.firstChild===n?be(t):function(t,e,n,r){var o=Ce(s);Le(t.dom,n,r);var i=_e(o);t.selection.setRng(i)}(t,0,a,c)}),!0;if(!c&&!e&&0===s.startOffset&&0===s.endOffset)return t.undoManager.transact(function(){ye(t)}),!0}return!1},He=function(t,e){return t.selection.isCollapsed()?function(t,e){return Fe(t,e)||function(t,e){var n=t.dom,r=t.selection.getStart(),o=zt(t,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){var a=pe(t.selection.getRng()),u=n.getParent(Pe(t,a,e,o),"LI",o);if(u)return t.undoManager.transact(function(){!function(t,e,n){var r=t.getParent(e.parentNode,t.isBlock,n);t.remove(e),r&&t.isEmpty(r)&&t.remove(r)}(n,i,o),Ae(n,u.parentNode),t.selection.select(u,!0),t.selection.collapse(e)}),!0}return!1}(t,e)}(t,e):function(t){var e=t.selection.getStart(),n=zt(t,e);return!!(t.dom.getParent(e,"LI,DT,DD",n)||Vt(t).length>0)&&(t.undoManager.transact(function(){t.execCommand("Delete"),function(t,e){St.each(St.grep(t.select("ol,ul",e)),function(e){!function(t,e){var n,r=e.parentNode;"LI"===r.nodeName&&r.firstChild===e&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(e),Ft(t,r)&&Ie.remove(r)):Ie.setStyle(r,"listStyleType","none")),Et(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(e)}(t,e)})}(t.dom,t.getBody())}),!0)}(t)},je=function(t){var e=t.dom,n=jt(t);At(n)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:e.getAttrib(n,"start")||"1"},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(n){var r=n.getData();t.undoManager.transact(function(){e.setAttrib(jt(t),"start","1"===r.start?"":r.start)}),n.close()}})},Ve=function(t,e){return function(){var n=t.dom.getParent(t.selection.getStart(),"UL,OL,DL");return n&&n.nodeName===e}};o.add("lists",function(t){return!1===function(t){return!(!/(^|[ ,])rtc([, ]|$)/.test(t.getParam("plugins","","string"))||!o.get("rtc"))}(t)&&(function(t){(function(t){return t.getParam("lists_indent_on_tab",!0)})(t)&&function(t){t.on("keydown",function(e){e.keyCode!==lt.TAB||lt.metaKeyPressed(e)||t.undoManager.transact(function(){(e.shiftKey?be(t):ve(t))&&e.preventDefault()})})}(t),function(t){t.on("keydown",function(e){e.keyCode===lt.BACKSPACE?He(t,!1)&&e.preventDefault():e.keyCode===lt.DELETE&&He(t,!0)&&e.preventDefault()})}(t)}(t),function(t){t.on("BeforeExecCommand",function(e){var n=e.command.toLowerCase();"indent"===n?ve(t):"outdent"===n&&be(t)}),t.addCommand("InsertUnorderedList",function(e,n){Be(t,"UL",n)}),t.addCommand("InsertOrderedList",function(e,n){Be(t,"OL",n)}),t.addCommand("InsertDefinitionList",function(e,n){Be(t,"DL",n)}),t.addCommand("RemoveList",function(){ye(t)}),t.addCommand("mceListProps",function(){je(t)}),t.addQueryStateHandler("InsertUnorderedList",Ve(t,"UL")),t.addQueryStateHandler("InsertOrderedList",Ve(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",Ve(t,"DL"))}(t)),function(t){var e=function(e){return function(){return t.execCommand(e)}};(function(t,e){var n=t.getParam("plugins","","string");return-1!==St.inArray(n.split(/[ ,]/),"advlist")})(t)||(t.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:e("InsertOrderedList"),onSetup:function(e){return Te(t,"OL",e.setActive)}}),t.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:e("InsertUnorderedList"),onSetup:function(e){return Te(t,"UL",e.setActive)}}))}(t),function(t){var e={text:"List properties...",icon:"ordered-list",onAction:function(){return je(t)},onSetup:function(e){return Te(t,"OL",function(t){return e.setDisabled(!t)})}};t.ui.registry.addMenuItem("listprops",e),t.ui.registry.addContextMenu("lists",{update:function(e){var n=jt(t,e);return At(n)?["listprops"]:[]}})}(t),function(t){return{backspaceDelete:function(e){He(t,e)}}}(t)})}(window)},JEQr:function(t,e,n){"use strict";(function(e){var r=n("xTJ+"),o=n("yK9s"),i={"Content-Type":"application/x-www-form-urlencoded"};function a(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var u,s={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e))&&(u=n("tQ2B")),u),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(a(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(a(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(t){s.headers[t]={}}),r.forEach(["post","put","patch"],function(t){s.headers[t]=r.merge(i)}),t.exports=s}).call(this,n("8oxB"))},Jchv:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return function(){var e,n=Math.max,r=Math.abs,o=/left|center|right/,i=/top|center|bottom/,a=/[\+\-]\d+(\.[\d]+)?%?/,u=/^\w+/,s=/%$/,c=t.fn.position;function l(t,e,n){return[parseFloat(t[0])*(s.test(t[0])?e/100:1),parseFloat(t[1])*(s.test(t[1])?n/100:1)]}function f(e,n){return parseInt(t.css(e,n),10)||0}t.position={scrollbarWidth:function(){if(void 0!==e)return e;var n,r,o=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),i=o.children()[0];return t("body").append(o),n=i.offsetWidth,o.css("overflow","scroll"),n===(r=i.offsetWidth)&&(r=o[0].clientWidth),o.remove(),e=n-r},getScrollInfo:function(e){var n=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),r=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),o="scroll"===n||"auto"===n&&e.width<e.element[0].scrollWidth;return{width:"scroll"===r||"auto"===r&&e.height<e.element[0].scrollHeight?t.position.scrollbarWidth():0,height:o?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var n=t(e||window),r=t.isWindow(n[0]),o=!!n[0]&&9===n[0].nodeType;return{element:n,isWindow:r,isDocument:o,offset:r||o?{left:0,top:0}:t(e).offset(),scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:n.outerWidth(),height:n.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return c.apply(this,arguments);e=t.extend({},e);var s,d,m,h,p,g,v=t(e.of),b=t.position.getWithinInfo(e.within),y=t.position.getScrollInfo(b),x=(e.collision||"flip").split(" "),w={};return g=function(e){var n=e[0];return 9===n.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(n)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}(v),v[0].preventDefault&&(e.at="left top"),d=g.width,m=g.height,h=g.offset,p=t.extend({},h),t.each(["my","at"],function(){var t,n,r=(e[this]||"").split(" ");1===r.length&&(r=o.test(r[0])?r.concat(["center"]):i.test(r[0])?["center"].concat(r):["center","center"]),r[0]=o.test(r[0])?r[0]:"center",r[1]=i.test(r[1])?r[1]:"center",t=a.exec(r[0]),n=a.exec(r[1]),w[this]=[t?t[0]:0,n?n[0]:0],e[this]=[u.exec(r[0])[0],u.exec(r[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?p.left+=d:"center"===e.at[0]&&(p.left+=d/2),"bottom"===e.at[1]?p.top+=m:"center"===e.at[1]&&(p.top+=m/2),s=l(w.at,d,m),p.left+=s[0],p.top+=s[1],this.each(function(){var o,i,a=t(this),u=a.outerWidth(),c=a.outerHeight(),g=f(this,"marginLeft"),C=f(this,"marginTop"),_=u+g+f(this,"marginRight")+y.width,k=c+C+f(this,"marginBottom")+y.height,S=t.extend({},p),T=l(w.my,a.outerWidth(),a.outerHeight());"right"===e.my[0]?S.left-=u:"center"===e.my[0]&&(S.left-=u/2),"bottom"===e.my[1]?S.top-=c:"center"===e.my[1]&&(S.top-=c/2),S.left+=T[0],S.top+=T[1],o={marginLeft:g,marginTop:C},t.each(["left","top"],function(n,r){t.ui.position[x[n]]&&t.ui.position[x[n]][r](S,{targetWidth:d,targetHeight:m,elemWidth:u,elemHeight:c,collisionPosition:o,collisionWidth:_,collisionHeight:k,offset:[s[0]+T[0],s[1]+T[1]],my:e.my,at:e.at,within:b,elem:a})}),e.using&&(i=function(t){var o=h.left-S.left,i=o+d-u,s=h.top-S.top,l=s+m-c,f={target:{element:v,left:h.left,top:h.top,width:d,height:m},element:{element:a,left:S.left,top:S.top,width:u,height:c},horizontal:i<0?"left":o>0?"right":"center",vertical:l<0?"top":s>0?"bottom":"middle"};d<u&&r(o+i)<d&&(f.horizontal="center"),m<c&&r(s+l)<m&&(f.vertical="middle"),n(r(o),r(i))>n(r(s),r(l))?f.important="horizontal":f.important="vertical",e.using.call(this,t,f)}),a.offset(t.extend(S,{using:i}))})},t.ui.position={fit:{left:function(t,e){var r,o=e.within,i=o.isWindow?o.scrollLeft:o.offset.left,a=o.width,u=t.left-e.collisionPosition.marginLeft,s=i-u,c=u+e.collisionWidth-a-i;e.collisionWidth>a?s>0&&c<=0?(r=t.left+s+e.collisionWidth-a-i,t.left+=s-r):t.left=c>0&&s<=0?i:s>c?i+a-e.collisionWidth:i:s>0?t.left+=s:c>0?t.left-=c:t.left=n(t.left-u,t.left)},top:function(t,e){var r,o=e.within,i=o.isWindow?o.scrollTop:o.offset.top,a=e.within.height,u=t.top-e.collisionPosition.marginTop,s=i-u,c=u+e.collisionHeight-a-i;e.collisionHeight>a?s>0&&c<=0?(r=t.top+s+e.collisionHeight-a-i,t.top+=s-r):t.top=c>0&&s<=0?i:s>c?i+a-e.collisionHeight:i:s>0?t.top+=s:c>0?t.top-=c:t.top=n(t.top-u,t.top)}},flip:{left:function(t,e){var n,o,i=e.within,a=i.offset.left+i.scrollLeft,u=i.width,s=i.isWindow?i.scrollLeft:i.offset.left,c=t.left-e.collisionPosition.marginLeft,l=c-s,f=c+e.collisionWidth-u-s,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,m="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,h=-2*e.offset[0];l<0?((n=t.left+d+m+h+e.collisionWidth-u-a)<0||n<r(l))&&(t.left+=d+m+h):f>0&&((o=t.left-e.collisionPosition.marginLeft+d+m+h-s)>0||r(o)<f)&&(t.left+=d+m+h)},top:function(t,e){var n,o,i=e.within,a=i.offset.top+i.scrollTop,u=i.height,s=i.isWindow?i.scrollTop:i.offset.top,c=t.top-e.collisionPosition.marginTop,l=c-s,f=c+e.collisionHeight-u-s,d="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,m="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,h=-2*e.offset[1];l<0?((o=t.top+d+m+h+e.collisionHeight-u-a)<0||o<r(l))&&(t.top+=d+m+h):f>0&&((n=t.top-e.collisionPosition.marginTop+d+m+h-s)>0||r(n)<f)&&(t.top+=d+m+h)}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position})?r.apply(e,o):r)||(t.exports=i)},LYNF:function(t,e,n){"use strict";var r=n("OH9c");t.exports=function(t,e,n,o,i){var a=new Error(t);return r(a,e,n,o,i)}},Lmem:function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},MIQu:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){var e,n=0,r=Array.prototype.slice;return t.cleanData=(e=t.cleanData,function(n){var r,o,i;for(i=0;null!=(o=n[i]);i++)try{(r=t._data(o,"events"))&&r.remove&&t(o).triggerHandler("remove")}catch(t){}e(n)}),t.widget=function(e,n,r){var o,i,a,u={},s=e.split(".")[0],c=s+"-"+(e=e.split(".")[1]);return r||(r=n,n=t.Widget),t.isArray(r)&&(r=t.extend.apply(null,[{}].concat(r))),t.expr[":"][c.toLowerCase()]=function(e){return!!t.data(e,c)},t[s]=t[s]||{},o=t[s][e],i=t[s][e]=function(t,e){if(!this._createWidget)return new i(t,e);arguments.length&&this._createWidget(t,e)},t.extend(i,o,{version:r.version,_proto:t.extend({},r),_childConstructors:[]}),(a=new n).options=t.widget.extend({},a.options),t.each(r,function(e,r){t.isFunction(r)?u[e]=function(){function t(){return n.prototype[e].apply(this,arguments)}function o(t){return n.prototype[e].apply(this,t)}return function(){var e,n=this._super,i=this._superApply;return this._super=t,this._superApply=o,e=r.apply(this,arguments),this._super=n,this._superApply=i,e}}():u[e]=r}),i.prototype=t.widget.extend(a,{widgetEventPrefix:o&&a.widgetEventPrefix||e},u,{constructor:i,namespace:s,widgetName:e,widgetFullName:c}),o?(t.each(o._childConstructors,function(e,n){var r=n.prototype;t.widget(r.namespace+"."+r.widgetName,i,n._proto)}),delete o._childConstructors):n._childConstructors.push(i),t.widget.bridge(e,i),i},t.widget.extend=function(e){for(var n,o,i=r.call(arguments,1),a=0,u=i.length;a<u;a++)for(n in i[a])o=i[a][n],i[a].hasOwnProperty(n)&&void 0!==o&&(t.isPlainObject(o)?e[n]=t.isPlainObject(e[n])?t.widget.extend({},e[n],o):t.widget.extend({},o):e[n]=o);return e},t.widget.bridge=function(e,n){var o=n.prototype.widgetFullName||e;t.fn[e]=function(i){var a="string"==typeof i,u=r.call(arguments,1),s=this;return a?this.length||"instance"!==i?this.each(function(){var n,r=t.data(this,o);return"instance"===i?(s=r,!1):r?t.isFunction(r[i])&&"_"!==i.charAt(0)?(n=r[i].apply(r,u))!==r&&void 0!==n?(s=n&&n.jquery?s.pushStack(n.get()):n,!1):void 0:t.error("no such method '"+i+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+i+"'")}):s=void 0:(u.length&&(i=t.widget.extend.apply(null,[i].concat(u))),this.each(function(){var e=t.data(this,o);e?(e.option(i||{}),e._init&&e._init()):t.data(this,o,new n(i,this))})),s}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,r){r=t(r||this.defaultElement||this)[0],this.element=t(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},r!==this&&(t.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===r&&this.destroy()}}),this.document=t(r.style?r.ownerDocument:r.document||r),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,n){e._removeClass(n,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,n){var r,o,i,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},r=e.split("."),e=r.shift(),r.length){for(o=a[e]=t.widget.extend({},this.options[e]),i=0;i<r.length-1;i++)o[r[i]]=o[r[i]]||{},o=o[r[i]];if(e=r.pop(),1===arguments.length)return void 0===o[e]?null:o[e];o[e]=n}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=n}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var n,r,o;for(n in e)o=this.classesElementLookup[n],e[n]!==this.options.classes[n]&&o&&o.length&&(r=t(o.get()),this._removeClass(o,n),r.addClass(this._classes({element:r,keys:n,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){var n=[],r=this;function o(o,i){var a,u;for(u=0;u<o.length;u++)a=r.classesElementLookup[o[u]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),r.classesElementLookup[o[u]]=a,n.push(o[u]),i&&e.classes[o[u]]&&n.push(e.classes[o[u]])}return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&o(e.keys.match(/\S+/g)||[],!0),e.extra&&o(e.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(e){var n=this;t.each(n.classesElementLookup,function(r,o){-1!==t.inArray(e.target,o)&&(n.classesElementLookup[r]=t(o.not(e.target).get()))})},_removeClass:function(t,e,n){return this._toggleClass(t,e,n,!1)},_addClass:function(t,e,n){return this._toggleClass(t,e,n,!0)},_toggleClass:function(t,e,n,r){r="boolean"==typeof r?r:n;var o="string"==typeof t||null===t,i={extra:o?e:n,keys:o?t:e,element:o?this.element:t,add:r};return i.element.toggleClass(this._classes(i),r),this},_on:function(e,n,r){var o,i=this;"boolean"!=typeof e&&(r=n,n=e,e=!1),r?(n=o=t(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,o=this.widget()),t.each(r,function(r,a){function u(){if(e||!0!==i.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"==typeof a?i[a]:a).apply(i,arguments)}"string"!=typeof a&&(u.guid=a.guid=a.guid||u.guid||t.guid++);var s=r.match(/^([\w:-]*)\s*(.*)$/),c=s[1]+i.eventNamespace,l=s[2];l?o.on(c,l,u):n.on(c,u)})},_off:function(e,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(n).off(n),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){var n=this;return setTimeout(function(){return("string"==typeof t?n[t]:t).apply(n,arguments)},e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,n,r){var o,i,a=this.options[e];if(r=r||{},(n=t.Event(n)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),n.target=this.element[0],i=n.originalEvent)for(o in i)o in n||(n[o]=i[o]);return this.element.trigger(n,r),!(t.isFunction(a)&&!1===a.apply(this.element[0],[n].concat(r))||n.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,n){t.Widget.prototype["_"+e]=function(r,o,i){var a;"string"==typeof o&&(o={effect:o});var u=o?!0===o||"number"==typeof o?n:o.effect||n:e;"number"==typeof(o=o||{})&&(o={duration:o}),a=!t.isEmptyObject(o),o.complete=i,o.delay&&r.delay(o.delay),a&&t.effects&&t.effects.effect[u]?r[e](o):u!==e&&r[u]?r[u](o.duration,o.easing,i):r.queue(function(n){t(this)[e](),i&&i.call(r[0]),n()})}}),t.widget})?r.apply(e,o):r)||(t.exports=i)},MLWZ:function(t,e,n){"use strict";var r=n("xTJ+");function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var a=[];r.forEach(e,function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),a.push(o(e)+"="+o(t))}))}),i=a.join("&")}if(i){var u=t.indexOf("#");-1!==u&&(t=t.slice(0,u)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},N6cA:function(t,e,n){var r,o,i;o=[n("EVdn"),n("121P"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var n=e.data("ui-form-reset-instances");t.each(n,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}}})?r.apply(e,o):r)||(t.exports=i)},NHgk:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase())})?r.apply(e,o):r)||(t.exports=i)},NvoQ:function(t,e,n){var r,o,i;o=[n("EVdn"),n("iGnl"),n("CumE"),n("NHgk"),n("8Iik"),n("Qwlt"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){return t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,n){return t>=e&&t<e+n},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,n){var r=null,o=!1,i=this;return!(this.reverting||this.options.disabled||"static"===this.options.type||(this._refreshItems(e),t(e.target).parents().each(function(){if(t.data(this,i.widgetName+"-item")===i)return r=t(this),!1}),t.data(e.target,i.widgetName+"-item")===i&&(r=t(e.target)),!r||this.options.handle&&!n&&(t(this.options.handle,r).find("*").addBack().each(function(){this===e.target&&(o=!0)}),!o)||(this.currentItem=r,this._removeCurrentsFromItems(),0)))},_mouseStart:function(e,n,r){var o,i,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(i=this.document.find("body"),this.storedCursor=i.css("cursor"),i.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(i)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!r)for(o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var n,r,o,i,a=this.options,u=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?u=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(u=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?u=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(u=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),!1!==u&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),n=this.items.length-1;n>=0;n--)if(o=(r=this.items[n]).item[0],(i=this._intersectsWithPointer(r))&&r.instance===this.currentContainer&&!(o===this.currentItem[0]||this.placeholder[1===i?"next":"prev"]()[0]===o||t.contains(this.placeholder[0],o)||"semi-dynamic"===this.options.type&&t.contains(this.element[0],o))){if(this.direction=1===i?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(r))break;this._rearrange(e,r),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,n){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var r=this,o=this.placeholder.offset(),i=this.options.axis,a={};i&&"x"!==i||(a.left=o.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),i&&"y"!==i||(a.top=o.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){r._clear(e)})}else this._clear(e,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var n=this._getItemsAsjQuery(e&&e.connected),r=[];return e=e||{},t(n).each(function(){var n=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);n&&r.push((e.key||n[1]+"[]")+"="+(e.key&&e.expression?n[1]:n[2]))}),!r.length&&e.key&&r.push(e.key+"="),r.join("&")},toArray:function(e){var n=this._getItemsAsjQuery(e&&e.connected),r=[];return e=e||{},n.each(function(){r.push(t(e.item||this).attr(e.attribute||"id")||"")}),r},_intersectsWith:function(t){var e=this.positionAbs.left,n=e+this.helperProportions.width,r=this.positionAbs.top,o=r+this.helperProportions.height,i=t.left,a=i+t.width,u=t.top,s=u+t.height,c=this.offset.click.top,l=this.offset.click.left,f="x"===this.options.axis||r+c>u&&r+c<s,d="y"===this.options.axis||e+l>i&&e+l<a,m=f&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?m:i<e+this.helperProportions.width/2&&n-this.helperProportions.width/2<a&&u<r+this.helperProportions.height/2&&o-this.helperProportions.height/2<s},_intersectsWithPointer:function(t){var e,n,r="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),o="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!r||!o)&&(e=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection(),this.floating?"right"===n||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),n=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),r=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&n||"left"===o&&!n:r&&("down"===r&&e||"up"===r&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var n,r,o,i,a=[],u=[],s=this._connectWith();if(s&&e)for(n=s.length-1;n>=0;n--)for(r=(o=t(s[n],this.document[0])).length-1;r>=0;r--)(i=t.data(o[r],this.widgetFullName))&&i!==this&&!i.options.disabled&&u.push([t.isFunction(i.options.items)?i.options.items.call(i.element):t(i.options.items,i.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),i]);function c(){a.push(this)}for(u.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),n=u.length-1;n>=0;n--)u[n][0].each(c);return t(a)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var n=0;n<e.length;n++)if(e[n]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var n,r,o,i,a,u,s,c,l=this.items,f=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(n=d.length-1;n>=0;n--)for(r=(o=t(d[n],this.document[0])).length-1;r>=0;r--)(i=t.data(o[r],this.widgetFullName))&&i!==this&&!i.options.disabled&&(f.push([t.isFunction(i.options.items)?i.options.items.call(i.element[0],e,{item:this.currentItem}):t(i.options.items,i.element),i]),this.containers.push(i));for(n=f.length-1;n>=0;n--)for(a=f[n][1],r=0,c=(u=f[n][0]).length;r<c;r++)(s=t(u[r])).data(this.widgetName+"-item",a),l.push({item:s,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){var n,r,o,i;for(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),n=this.items.length-1;n>=0;n--)(r=this.items[n]).instance!==this.currentContainer&&this.currentContainer&&r.item[0]!==this.currentItem[0]||(o=this.options.toleranceElement?t(this.options.toleranceElement,r.item):r.item,e||(r.width=o.outerWidth(),r.height=o.outerHeight()),i=o.offset(),r.left=i.left,r.top=i.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--)i=this.containers[n].element.offset(),this.containers[n].containerCache.left=i.left,this.containers[n].containerCache.top=i.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight();return this},_createPlaceholder:function(e){var n,r=(e=e||this).options;r.placeholder&&r.placeholder.constructor!==String||(n=r.placeholder,r.placeholder={element:function(){var r=e.currentItem[0].nodeName.toLowerCase(),o=t("<"+r+">",e.document[0]);return e._addClass(o,"ui-sortable-placeholder",n||e.currentItem[0].className)._removeClass(o,"ui-sortable-helper"),"tbody"===r?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(o)):"tr"===r?e._createTrPlaceholder(e.currentItem,o):"img"===r&&o.attr("src",e.currentItem.attr("src")),n||o.css("visibility","hidden"),o},update:function(t,o){n&&!r.forcePlaceholderSize||(o.height()||o.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),o.width()||o.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(r.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),r.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,n){var r=this;e.children().each(function(){t("<td>&#160;</td>",r.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)})},_contactContainers:function(e){var n,r,o,i,a,u,s,c,l,f,d=null,m=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(d&&t.contains(this.containers[n].element[0],d.element[0]))continue;d=this.containers[n],m=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",e,this._uiHash(this)),this.containers[n].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger("over",e,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(o=1e4,i=null,a=(l=d.floating||this._isFloating(this.currentItem))?"left":"top",u=l?"width":"height",f=l?"pageX":"pageY",r=this.items.length-1;r>=0;r--)t.contains(this.containers[m].element[0],this.items[r].item[0])&&this.items[r].item[0]!==this.currentItem[0]&&(s=this.items[r].item.offset()[a],c=!1,e[f]-s>this.items[r][u]/2&&(c=!0),Math.abs(e[f]-s)<o&&(o=Math.abs(e[f]-s),i=this.items[r],this.direction=c?"up":"down"));if(!i&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[m])return void(this.currentContainer.containerCache.over||(this.containers[m]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1));i?this._rearrange(e,i,null,!0):this._rearrange(e,null,this.containers[m].element,!0),this._trigger("change",e,this._uiHash()),this.containers[m]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[m],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[m]._trigger("over",e,this._uiHash(this)),this.containers[m].containerCache.over=1}},_createHelper:function(e){var n=this.options,r=t.isFunction(n.helper)?t(n.helper.apply(this.element[0],[e,this.currentItem])):"clone"===n.helper?this.currentItem.clone():this.currentItem;return r.parents("body").length||t("parent"!==n.appendTo?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),r[0].style.width&&!n.forceHelperSize||r.width(this.currentItem.width()),r[0].style.height&&!n.forceHelperSize||r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,n,r,o=this.options;"parent"===o.containment&&(o.containment=this.helper[0].parentNode),"document"!==o.containment&&"window"!==o.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===o.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===o.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(o.containment)||(e=t(o.containment)[0],n=t(o.containment).offset(),r="hidden"!==t(e).css("overflow"),this.containment=[n.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(r?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,n){n||(n=this.position);var r="absolute"===e?1:-1,o="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(o[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():i?0:o.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():i?0:o.scrollLeft())*r}},_generatePosition:function(e){var n,r,o=this.options,i=e.pageX,a=e.pageY,u="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(u[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),o.grid&&(n=this.originalPageY+Math.round((a-this.originalPageY)/o.grid[1])*o.grid[1],a=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-o.grid[1]:n+o.grid[1]:n,r=this.originalPageX+Math.round((i-this.originalPageX)/o.grid[0])*o.grid[0],i=this.containment?r-this.offset.click.left>=this.containment[0]&&r-this.offset.click.left<=this.containment[2]?r:r-this.offset.click.left>=this.containment[0]?r-o.grid[0]:r+o.grid[0]:r)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():s?0:u.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():s?0:u.scrollLeft())}},_rearrange:function(t,e,n,r){n?n[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!r)})},_clear:function(t,e){this.reverting=!1;var n,r=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)"auto"!==this._storedCSS[n]&&"static"!==this._storedCSS[n]||(this._storedCSS[n]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function o(t,e,n){return function(r){n._trigger(t,r,e._uiHash(e))}}for(this.fromOutside&&!e&&r.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||r.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(r.push(function(t){this._trigger("remove",t,this._uiHash())}),r.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),n=this.containers.length-1;n>=0;n--)e||r.push(o("deactivate",this,this.containers[n])),this.containers[n].containerCache.over&&(r.push(o("out",this,this.containers[n])),this.containers[n].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(n=0;n<r.length;n++)r[n].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===t.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(e){var n=e||this;return{helper:n.helper,placeholder:n.placeholder||t([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:e?e.element:null}}})})?r.apply(e,o):r)||(t.exports=i)},OH9c:function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},OTTw:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},Qjfq:function(t,e,n){n("vn/0")},Qwlt:function(t,e,n){var r,o,i;o=[n("EVdn")],void 0===(i="function"==typeof(r=function(t){return t.ui=t.ui||{},t.ui.version="1.12.1"})?r.apply(e,o):r)||(t.exports=i)},"Rn+g":function(t,e,n){"use strict";var r=n("LYNF");t.exports=function(t,e,n){var o=n.config.validateStatus;!o||o(n.status)?t(n):e(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},SntB:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=function(t,e){e=e||{};var n={},o=["url","method","params","data"],i=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(o,function(t){void 0!==e[t]&&(n[t]=e[t])}),r.forEach(i,function(o){r.isObject(e[o])?n[o]=r.deepMerge(t[o],e[o]):void 0!==e[o]?n[o]=e[o]:r.isObject(t[o])?n[o]=r.deepMerge(t[o]):void 0!==t[o]&&(n[o]=t[o])}),r.forEach(a,function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])});var u=o.concat(i).concat(a),s=Object.keys(e).filter(function(t){return-1===u.indexOf(t)});return r.forEach(s,function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])}),n}},UTCq:function(t,e,n){var r,o,i;o=[n("EVdn"),n("GC/X"),n("N6cA"),n("r15H"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){return t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,n,r=this,o=this._super()||{};return this._readType(),n=this.element.labels(),this.label=t(n[n.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){r.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),this.originalLabel&&(o.label=this.originalLabel),null!=(e=this.element[0].disabled)&&(o.disabled=e),o},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e=this.element[0].name,n="input[name='"+t.ui.escapeSelector(e)+"']";return e?(this.form.length?t(this.form[0].elements).filter(n):t(n).filter(function(){return 0===t(this).form().length})).not(this.element):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(e){var n="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(n+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):n+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",n),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio})?r.apply(e,o):r)||(t.exports=i)},UnBK:function(t,e,n){"use strict";var r=n("xTJ+"),o=n("xAGQ"),i=n("Lmem"),a=n("JEQr");function u(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return u(t),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||a.adapter)(t).then(function(e){return u(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(u(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},"Vn+K":function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt"),n("vBzC")],void 0===(i="function"==typeof(r=function(t){var e;function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=r(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function r(e){var n="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",n,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",n,o)}function o(){t.datepicker._isDisabledDatepicker(e.inline?e.dpDiv.parent()[0]:e.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function i(e,n){for(var r in t.extend(e,n),n)null==n[r]&&(e[r]=n[r]);return e}return t.extend(t.ui,{datepicker:{version:"1.12.1"}}),t.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return i(this._defaults,t||{}),this},_attachDatepicker:function(e,n){var r,o,i;o="div"===(r=e.nodeName.toLowerCase())||"span"===r,e.id||(this.uuid+=1,e.id="dp"+this.uuid),(i=this._newInst(t(e),o)).settings=t.extend({},n||{}),"input"===r?this._connectDatepicker(e,i):o&&this._inlineDatepicker(e,i)},_newInst:function(e,n){return{id:e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:n,dpDiv:n?r(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,n){var r=t(e);n.append=t([]),n.trigger=t([]),r.hasClass(this.markerClassName)||(this._attachments(r,n),r.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(n),t.data(e,"datepicker",n),n.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,n){var r,o,i,a=this._get(n,"appendText"),u=this._get(n,"isRTL");n.append&&n.append.remove(),a&&(n.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[u?"before":"after"](n.append)),e.off("focus",this._showDatepicker),n.trigger&&n.trigger.remove(),"focus"!==(r=this._get(n,"showOn"))&&"both"!==r||e.on("focus",this._showDatepicker),"button"!==r&&"both"!==r||(o=this._get(n,"buttonText"),i=this._get(n,"buttonImage"),n.trigger=t(this._get(n,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:i,alt:o,title:o}):t("<button type='button'></button>").addClass(this._triggerClass).html(i?t("<img/>").attr({src:i,alt:o,title:o}):o)),e[u?"before":"after"](n.trigger),n.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,n,r,o,i=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(n=0,r=0,o=0;o<t.length;o++)t[o].length>n&&(n=t[o].length,r=o);return r},i.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),i.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-i.getDay())),t.input.attr("size",this._formatDate(t,i).length)}},_inlineDatepicker:function(e,n){var r=t(e);r.hasClass(this.markerClassName)||(r.addClass(this.markerClassName).append(n.dpDiv),t.data(e,"datepicker",n),this._setDate(n,this._getDefaultDate(n),!0),this._updateDatepicker(n),this._updateAlternate(n),n.settings.disabled&&this._disableDatepicker(e),n.dpDiv.css("display","block"))},_dialogDatepicker:function(e,n,r,o,a){var u,s,c,l,f,d=this._dialogInst;return d||(this.uuid+=1,u="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+u+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),(d=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},t.data(this._dialogInput[0],"datepicker",d)),i(d.settings,o||{}),n=n&&n.constructor===Date?this._formatDate(d,n):n,this._dialogInput.val(n),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(s=document.documentElement.clientWidth,c=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,f=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[s/2-100+l,c/2-150+f]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=r,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(n){var r,o=t(n),i=t.data(n,"datepicker");o.hasClass(this.markerClassName)&&(r=n.nodeName.toLowerCase(),t.removeData(n,"datepicker"),"input"===r?(i.append.remove(),i.trigger.remove(),o.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==r&&"span"!==r||o.removeClass(this.markerClassName).empty(),e===i&&(e=null))},_enableDatepicker:function(e){var n,r,o=t(e),i=t.data(e,"datepicker");o.hasClass(this.markerClassName)&&("input"===(n=e.nodeName.toLowerCase())?(e.disabled=!1,i.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==n&&"span"!==n||((r=o.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var n,r,o=t(e),i=t.data(e,"datepicker");o.hasClass(this.markerClassName)&&("input"===(n=e.nodeName.toLowerCase())?(e.disabled=!0,i.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==n&&"span"!==n||((r=o.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,n,r){var o,a,u,s,c=this._getInst(e);if(2===arguments.length&&"string"==typeof n)return"defaults"===n?t.extend({},t.datepicker._defaults):c?"all"===n?t.extend({},c.settings):this._get(c,n):null;o=n||{},"string"==typeof n&&((o={})[n]=r),c&&(this._curInst===c&&this._hideDatepicker(),a=this._getDateDatepicker(e,!0),u=this._getMinMaxDate(c,"min"),s=this._getMinMaxDate(c,"max"),i(c.settings,o),null!==u&&void 0!==o.dateFormat&&void 0===o.minDate&&(c.settings.minDate=this._formatDate(c,u)),null!==s&&void 0!==o.dateFormat&&void 0===o.maxDate&&(c.settings.maxDate=this._formatDate(c,s)),"disabled"in o&&(o.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),c),this._autoSize(c),this._setDate(c,a),this._updateAlternate(c),this._updateDatepicker(c))},_changeDatepicker:function(t,e,n){this._optionDatepicker(t,e,n)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var n=this._getInst(t);n&&(this._setDate(n,e),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(t,e){var n=this._getInst(t);return n&&!n.inline&&this._setDateFromField(n,e),n?this._getDate(n):null},_doKeyDown:function(e){var n,r,o,i=t.datepicker._getInst(e.target),a=!0,u=i.dpDiv.is(".ui-datepicker-rtl");if(i._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return(o=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",i.dpDiv))[0]&&t.datepicker._selectDay(e.target,i.selectedMonth,i.selectedYear,o[0]),(n=t.datepicker._get(i,"onSelect"))?(r=t.datepicker._formatDate(i),n.apply(i.input?i.input[0]:null,[r,i])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(i,"stepBigMonths"):-t.datepicker._get(i,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(i,"stepBigMonths"):+t.datepicker._get(i,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,u?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(i,"stepBigMonths"):-t.datepicker._get(i,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,u?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(i,"stepBigMonths"):+t.datepicker._get(i,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var n,r,o=t.datepicker._getInst(e.target);if(t.datepicker._get(o,"constrainInput"))return n=t.datepicker._possibleChars(t.datepicker._get(o,"dateFormat")),r=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||r<" "||!n||n.indexOf(r)>-1},_doKeyUp:function(e){var n=t.datepicker._getInst(e.target);if(n.input.val()!==n.lastVal)try{t.datepicker.parseDate(t.datepicker._get(n,"dateFormat"),n.input?n.input.val():null,t.datepicker._getFormatConfig(n))&&(t.datepicker._setDateFromField(n),t.datepicker._updateAlternate(n),t.datepicker._updateDatepicker(n))}catch(t){}return!0},_showDatepicker:function(e){var n,r,o,a,u,s,c;"input"!==(e=e.target||e).nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),t.datepicker._isDisabledDatepicker(e)||t.datepicker._lastInput===e||(n=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==n&&(t.datepicker._curInst.dpDiv.stop(!0,!0),n&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),!1!==(o=(r=t.datepicker._get(n,"beforeShow"))?r.apply(e,[e,n]):{})&&(i(n.settings,o),n.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(n),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),a=!1,t(e).parents().each(function(){return!(a|="fixed"===t(this).css("position"))}),u={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(n),u=t.datepicker._checkOffset(n,u,a),n.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":a?"fixed":"absolute",display:"none",left:u.left+"px",top:u.top+"px"}),n.inline||(s=t.datepicker._get(n,"showAnim"),c=t.datepicker._get(n,"duration"),n.dpDiv.css("z-index",function(t){for(var e,n;t.length&&t[0]!==document;){if(("absolute"===(e=t.css("position"))||"relative"===e||"fixed"===e)&&(n=parseInt(t.css("zIndex"),10),!isNaN(n)&&0!==n))return n;t=t.parent()}return 0}(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[s]?n.dpDiv.show(s,t.datepicker._get(n,"showOptions"),c):n.dpDiv[s||"show"](s?c:null),t.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),t.datepicker._curInst=n)))},_updateDatepicker:function(n){this.maxRows=4,e=n,n.dpDiv.empty().append(this._generateHTML(n)),this._attachHandlers(n);var r,i=this._getNumberOfMonths(n),a=i[1],u=n.dpDiv.find("."+this._dayOverClass+" a");u.length>0&&o.apply(u.get(0)),n.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),a>1&&n.dpDiv.addClass("ui-datepicker-multi-"+a).css("width",17*a+"em"),n.dpDiv[(1!==i[0]||1!==i[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),n.dpDiv[(this._get(n,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),n===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),n.yearshtml&&(r=n.yearshtml,setTimeout(function(){r===n.yearshtml&&n.yearshtml&&n.dpDiv.find("select.ui-datepicker-year:first").replaceWith(n.yearshtml),r=n.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,n,r){var o=e.dpDiv.outerWidth(),i=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,u=e.input?e.input.outerHeight():0,s=document.documentElement.clientWidth+(r?0:t(document).scrollLeft()),c=document.documentElement.clientHeight+(r?0:t(document).scrollTop());return n.left-=this._get(e,"isRTL")?o-a:0,n.left-=r&&n.left===e.input.offset().left?t(document).scrollLeft():0,n.top-=r&&n.top===e.input.offset().top+u?t(document).scrollTop():0,n.left-=Math.min(n.left,n.left+o>s&&s>o?Math.abs(n.left+o-s):0),n.top-=Math.min(n.top,n.top+i>c&&c>i?Math.abs(i+u):0),n},_findPos:function(e){for(var n,r=this._getInst(e),o=this._get(r,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[o?"previousSibling":"nextSibling"];return[(n=t(e).offset()).left,n.top]},_hideDatepicker:function(e){var n,r,o,i,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(n=this._get(a,"showAnim"),r=this._get(a,"duration"),o=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[n]||t.effects[n])?a.dpDiv.hide(n,t.datepicker._get(a,"showOptions"),r,o):a.dpDiv["slideDown"===n?"slideUp":"fadeIn"===n?"fadeOut":"hide"](n?r:null,o),n||o(),this._datepickerShowing=!1,(i=this._get(a,"onClose"))&&i.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var n=t(e.target),r=t.datepicker._getInst(n[0]);(n[0].id===t.datepicker._mainDivId||0!==n.parents("#"+t.datepicker._mainDivId).length||n.hasClass(t.datepicker.markerClassName)||n.closest("."+t.datepicker._triggerClass).length||!t.datepicker._datepickerShowing||t.datepicker._inDialog&&t.blockUI)&&(!n.hasClass(t.datepicker.markerClassName)||t.datepicker._curInst===r)||t.datepicker._hideDatepicker()}},_adjustDate:function(e,n,r){var o=t(e),i=this._getInst(o[0]);this._isDisabledDatepicker(o[0])||(this._adjustInstDate(i,n+("M"===r?this._get(i,"showCurrentAtPos"):0),r),this._updateDatepicker(i))},_gotoToday:function(e){var n,r=t(e),o=this._getInst(r[0]);this._get(o,"gotoCurrent")&&o.currentDay?(o.selectedDay=o.currentDay,o.drawMonth=o.selectedMonth=o.currentMonth,o.drawYear=o.selectedYear=o.currentYear):(n=new Date,o.selectedDay=n.getDate(),o.drawMonth=o.selectedMonth=n.getMonth(),o.drawYear=o.selectedYear=n.getFullYear()),this._notifyChange(o),this._adjustDate(r)},_selectMonthYear:function(e,n,r){var o=t(e),i=this._getInst(o[0]);i["selected"+("M"===r?"Month":"Year")]=i["draw"+("M"===r?"Month":"Year")]=parseInt(n.options[n.selectedIndex].value,10),this._notifyChange(i),this._adjustDate(o)},_selectDay:function(e,n,r,o){var i,a=t(e);t(o).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||((i=this._getInst(a[0])).selectedDay=i.currentDay=t("a",o).html(),i.selectedMonth=i.currentMonth=n,i.selectedYear=i.currentYear=r,this._selectDate(e,this._formatDate(i,i.currentDay,i.currentMonth,i.currentYear)))},_clearDate:function(e){var n=t(e);this._selectDate(n,"")},_selectDate:function(e,n){var r,o=t(e),i=this._getInst(o[0]);n=null!=n?n:this._formatDate(i),i.input&&i.input.val(n),this._updateAlternate(i),(r=this._get(i,"onSelect"))?r.apply(i.input?i.input[0]:null,[n,i]):i.input&&i.input.trigger("change"),i.inline?this._updateDatepicker(i):(this._hideDatepicker(),this._lastInput=i.input[0],"object"!=_typeof(i.input[0])&&i.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var n,r,o,i=this._get(e,"altField");i&&(n=this._get(e,"altFormat")||this._get(e,"dateFormat"),r=this._getDate(e),o=this.formatDate(n,r,this._getFormatConfig(e)),t(i).val(o))},noWeekends:function(t){var e=t.getDay();return[e>0&&e<6,""]},iso8601Week:function(t){var e,n=new Date(t.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),e=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((e-n)/864e5)/7)+1},parseDate:function(e,n,r){if(null==e||null==n)throw"Invalid arguments";if(""===(n="object"==_typeof(n)?n.toString():n+""))return null;var o,i,a,u,s=0,c=(r?r.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),f=(r?r.dayNamesShort:null)||this._defaults.dayNamesShort,d=(r?r.dayNames:null)||this._defaults.dayNames,m=(r?r.monthNamesShort:null)||this._defaults.monthNamesShort,h=(r?r.monthNames:null)||this._defaults.monthNames,p=-1,g=-1,v=-1,b=-1,y=!1,x=function(t){var n=o+1<e.length&&e.charAt(o+1)===t;return n&&o++,n},w=function(t){var e=x(t),r="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,o=new RegExp("^\\d{"+("y"===t?r:1)+","+r+"}"),i=n.substring(s).match(o);if(!i)throw"Missing number at position "+s;return s+=i[0].length,parseInt(i[0],10)},C=function(e,r,o){var i=-1,a=t.map(x(e)?o:r,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(a,function(t,e){var r=e[1];if(n.substr(s,r.length).toLowerCase()===r.toLowerCase())return i=e[0],s+=r.length,!1}),-1!==i)return i+1;throw"Unknown name at position "+s},_=function(){if(n.charAt(s)!==e.charAt(o))throw"Unexpected literal at position "+s;s++};for(o=0;o<e.length;o++)if(y)"'"!==e.charAt(o)||x("'")?_():y=!1;else switch(e.charAt(o)){case"d":v=w("d");break;case"D":C("D",f,d);break;case"o":b=w("o");break;case"m":g=w("m");break;case"M":g=C("M",m,h);break;case"y":p=w("y");break;case"@":p=(u=new Date(w("@"))).getFullYear(),g=u.getMonth()+1,v=u.getDate();break;case"!":p=(u=new Date((w("!")-this._ticksTo1970)/1e4)).getFullYear(),g=u.getMonth()+1,v=u.getDate();break;case"'":x("'")?_():y=!0;break;default:_()}if(s<n.length&&(a=n.substr(s),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===p?p=(new Date).getFullYear():p<100&&(p+=(new Date).getFullYear()-(new Date).getFullYear()%100+(p<=l?0:-100)),b>-1)for(g=1,v=b;!(v<=(i=this._getDaysInMonth(p,g-1)));)g++,v-=i;if((u=this._daylightSavingAdjust(new Date(p,g-1,v))).getFullYear()!==p||u.getMonth()+1!==g||u.getDate()!==v)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(t,e,n){if(!e)return"";var r,o=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,i=(n?n.dayNames:null)||this._defaults.dayNames,a=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,s=function(e){var n=r+1<t.length&&t.charAt(r+1)===e;return n&&r++,n},c=function(t,e,n){var r=""+e;if(s(t))for(;r.length<n;)r="0"+r;return r},l=function(t,e,n,r){return s(t)?r[e]:n[e]},f="",d=!1;if(e)for(r=0;r<t.length;r++)if(d)"'"!==t.charAt(r)||s("'")?f+=t.charAt(r):d=!1;else switch(t.charAt(r)){case"d":f+=c("d",e.getDate(),2);break;case"D":f+=l("D",e.getDay(),o,i);break;case"o":f+=c("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":f+=c("m",e.getMonth()+1,2);break;case"M":f+=l("M",e.getMonth(),a,u);break;case"y":f+=s("y")?e.getFullYear():(e.getFullYear()%100<10?"0":"")+e.getFullYear()%100;break;case"@":f+=e.getTime();break;case"!":f+=1e4*e.getTime()+this._ticksTo1970;break;case"'":s("'")?f+="'":d=!0;break;default:f+=t.charAt(r)}return f},_possibleChars:function(t){var e,n="",r=!1,o=function(n){var r=e+1<t.length&&t.charAt(e+1)===n;return r&&e++,r};for(e=0;e<t.length;e++)if(r)"'"!==t.charAt(e)||o("'")?n+=t.charAt(e):r=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":n+="0123456789";break;case"D":case"M":return null;case"'":o("'")?n+="'":r=!0;break;default:n+=t.charAt(e)}return n},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var n=this._get(t,"dateFormat"),r=t.lastVal=t.input?t.input.val():null,o=this._getDefaultDate(t),i=o,a=this._getFormatConfig(t);try{i=this.parseDate(n,r,a)||o}catch(t){r=e?"":r}t.selectedDay=i.getDate(),t.drawMonth=t.selectedMonth=i.getMonth(),t.drawYear=t.selectedYear=i.getFullYear(),t.currentDay=r?i.getDate():0,t.currentMonth=r?i.getMonth():0,t.currentYear=r?i.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,n,r){var o=null==n||""===n?r:"string"==typeof n?function(n){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),n,t.datepicker._getFormatConfig(e))}catch(t){}for(var r=(n.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=r.getFullYear(),i=r.getMonth(),a=r.getDate(),u=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,s=u.exec(n);s;){switch(s[2]||"d"){case"d":case"D":a+=parseInt(s[1],10);break;case"w":case"W":a+=7*parseInt(s[1],10);break;case"m":case"M":i+=parseInt(s[1],10),a=Math.min(a,t.datepicker._getDaysInMonth(o,i));break;case"y":case"Y":o+=parseInt(s[1],10),a=Math.min(a,t.datepicker._getDaysInMonth(o,i))}s=u.exec(n)}return new Date(o,i,a)}(n):"number"==typeof n?isNaN(n)?r:function(t){var e=new Date;return e.setDate(e.getDate()+t),e}(n):new Date(n.getTime());return(o=o&&"Invalid Date"===o.toString()?r:o)&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,n){var r=!e,o=t.selectedMonth,i=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),o===t.selectedMonth&&i===t.selectedYear||n||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(r?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(e){var n=this._get(e,"stepMonths"),r="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(r,-n,"M")},next:function(){t.datepicker._adjustDate(r,+n,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(r)},selectDay:function(){return t.datepicker._selectDay(r,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(r,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(r,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,n,r,o,i,a,u,s,c,l,f,d,m,h,p,g,v,b,y,x,w,C,_,k,S,T,O,D,E,N,A,R,B,I,P,M,L,F,H,j=new Date,V=this._daylightSavingAdjust(new Date(j.getFullYear(),j.getMonth(),j.getDate())),z=this._get(t,"isRTL"),U=this._get(t,"showButtonPanel"),W=this._get(t,"hideIfNoPrevNext"),q=this._get(t,"navigationAsDateFormat"),$=this._getNumberOfMonths(t),Y=this._get(t,"showCurrentAtPos"),G=this._get(t,"stepMonths"),K=1!==$[0]||1!==$[1],X=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),J=this._getMinMaxDate(t,"min"),Q=this._getMinMaxDate(t,"max"),Z=t.drawMonth-Y,tt=t.drawYear;if(Z<0&&(Z+=12,tt--),Q)for(e=this._daylightSavingAdjust(new Date(Q.getFullYear(),Q.getMonth()-$[0]*$[1]+1,Q.getDate())),e=J&&e<J?J:e;this._daylightSavingAdjust(new Date(tt,Z,1))>e;)--Z<0&&(Z=11,tt--);for(t.drawMonth=Z,t.drawYear=tt,n=this._get(t,"prevText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(tt,Z-G,1)),this._getFormatConfig(t)):n,r=this._canAdjustMonth(t,-1,tt,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(z?"e":"w")+"'>"+n+"</span></a>":W?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(z?"e":"w")+"'>"+n+"</span></a>",o=this._get(t,"nextText"),o=q?this.formatDate(o,this._daylightSavingAdjust(new Date(tt,Z+G,1)),this._getFormatConfig(t)):o,i=this._canAdjustMonth(t,1,tt,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+o+"'><span class='ui-icon ui-icon-circle-triangle-"+(z?"w":"e")+"'>"+o+"</span></a>":W?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+o+"'><span class='ui-icon ui-icon-circle-triangle-"+(z?"w":"e")+"'>"+o+"</span></a>",a=this._get(t,"currentText"),u=this._get(t,"gotoCurrent")&&t.currentDay?X:V,a=q?this.formatDate(a,u,this._getFormatConfig(t)):a,s=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",c=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(z?s:"")+(this._isInRange(t,u)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(z?"":s)+"</div>":"",l=parseInt(this._get(t,"firstDay"),10),l=isNaN(l)?0:l,f=this._get(t,"showWeek"),d=this._get(t,"dayNames"),m=this._get(t,"dayNamesMin"),h=this._get(t,"monthNames"),p=this._get(t,"monthNamesShort"),g=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),b=this._get(t,"selectOtherMonths"),y=this._getDefaultDate(t),x="",C=0;C<$[0];C++){for(_="",this.maxRows=4,k=0;k<$[1];k++){if(S=this._daylightSavingAdjust(new Date(tt,Z,t.selectedDay)),T=" ui-corner-all",O="",K){if(O+="<div class='ui-datepicker-group",$[1]>1)switch(k){case 0:O+=" ui-datepicker-group-first",T=" ui-corner-"+(z?"right":"left");break;case $[1]-1:O+=" ui-datepicker-group-last",T=" ui-corner-"+(z?"left":"right");break;default:O+=" ui-datepicker-group-middle",T=""}O+="'>"}for(O+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+T+"'>"+(/all|left/.test(T)&&0===C?z?i:r:"")+(/all|right/.test(T)&&0===C?z?r:i:"")+this._generateMonthYearHeader(t,Z,tt,J,Q,C>0||k>0,h,p)+"</div><table class='ui-datepicker-calendar'><thead><tr>",D=f?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;w<7;w++)D+="<th scope='col'"+((w+l+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+d[E=(w+l)%7]+"'>"+m[E]+"</span></th>";for(O+=D+"</tr></thead><tbody>",N=this._getDaysInMonth(tt,Z),tt===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,N)),A=(this._getFirstDayOfMonth(tt,Z)-l+7)%7,R=Math.ceil((A+N)/7),B=K&&this.maxRows>R?this.maxRows:R,this.maxRows=B,I=this._daylightSavingAdjust(new Date(tt,Z,1-A)),P=0;P<B;P++){for(O+="<tr>",M=f?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(I)+"</td>":"",w=0;w<7;w++)L=g?g.apply(t.input?t.input[0]:null,[I]):[!0,""],H=(F=I.getMonth()!==Z)&&!b||!L[0]||J&&I<J||Q&&I>Q,M+="<td class='"+((w+l+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(I.getTime()===S.getTime()&&Z===t.selectedMonth&&t._keyEvent||y.getTime()===I.getTime()&&y.getTime()===S.getTime()?" "+this._dayOverClass:"")+(H?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!v?"":" "+L[1]+(I.getTime()===X.getTime()?" "+this._currentClass:"")+(I.getTime()===V.getTime()?" ui-datepicker-today":""))+"'"+(F&&!v||!L[2]?"":" title='"+L[2].replace(/'/g,"&#39;")+"'")+(H?"":" data-handler='selectDay' data-event='click' data-month='"+I.getMonth()+"' data-year='"+I.getFullYear()+"'")+">"+(F&&!v?"&#xa0;":H?"<span class='ui-state-default'>"+I.getDate()+"</span>":"<a class='ui-state-default"+(I.getTime()===V.getTime()?" ui-state-highlight":"")+(I.getTime()===X.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+I.getDate()+"</a>")+"</td>",I.setDate(I.getDate()+1),I=this._daylightSavingAdjust(I);O+=M+"</tr>"}++Z>11&&(Z=0,tt++),_+=O+="</tbody></table>"+(K?"</div>"+($[0]>0&&k===$[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}x+=_}return x+=c,t._keyEvent=!1,x},_generateMonthYearHeader:function(t,e,n,r,o,i,a,u){var s,c,l,f,d,m,h,p,g=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),b=this._get(t,"showMonthAfterYear"),y="<div class='ui-datepicker-title'>",x="";if(i||!g)x+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(s=r&&r.getFullYear()===n,c=o&&o.getFullYear()===n,x+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",l=0;l<12;l++)(!s||l>=r.getMonth())&&(!c||l<=o.getMonth())&&(x+="<option value='"+l+"'"+(l===e?" selected='selected'":"")+">"+u[l]+"</option>");x+="</select>"}if(b||(y+=x+(!i&&g&&v?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",i||!v)y+="<span class='ui-datepicker-year'>"+n+"</span>";else{for(f=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),h=(m=function(t){var e=t.match(/c[+\-].*/)?n+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e})(f[0]),p=Math.max(h,m(f[1]||"")),h=r?Math.max(h,r.getFullYear()):h,p=o?Math.min(p,o.getFullYear()):p,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";h<=p;h++)t.yearshtml+="<option value='"+h+"'"+(h===n?" selected='selected'":"")+">"+h+"</option>";t.yearshtml+="</select>",y+=t.yearshtml,t.yearshtml=null}return y+=this._get(t,"yearSuffix"),b&&(y+=(!i&&g&&v?"":"&#xa0;")+x),y+"</div>"},_adjustInstDate:function(t,e,n){var r=t.selectedYear+("Y"===n?e:0),o=t.selectedMonth+("M"===n?e:0),i=Math.min(t.selectedDay,this._getDaysInMonth(r,o))+("D"===n?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(r,o,i)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),"M"!==n&&"Y"!==n||this._notifyChange(t)},_restrictMinMax:function(t,e){var n=this._getMinMaxDate(t,"min"),r=this._getMinMaxDate(t,"max"),o=n&&e<n?n:e;return r&&o>r?r:o},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,n,r){var o=this._getNumberOfMonths(t),i=this._daylightSavingAdjust(new Date(n,r+(e<0?e:o[0]*o[1]),1));return e<0&&i.setDate(this._getDaysInMonth(i.getFullYear(),i.getMonth())),this._isInRange(t,i)},_isInRange:function(t,e){var n,r,o=this._getMinMaxDate(t,"min"),i=this._getMinMaxDate(t,"max"),a=null,u=null,s=this._get(t,"yearRange");return s&&(n=s.split(":"),r=(new Date).getFullYear(),a=parseInt(n[0],10),u=parseInt(n[1],10),n[0].match(/[+\-].*/)&&(a+=r),n[1].match(/[+\-].*/)&&(u+=r)),(!o||e.getTime()>=o.getTime())&&(!i||e.getTime()<=i.getTime())&&(!a||e.getFullYear()>=a)&&(!u||e.getFullYear()<=u)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,n,r){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var o=e?"object"==_typeof(e)?e:this._daylightSavingAdjust(new Date(r,n,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),o,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var n=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(n)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(n)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(n))},t.datepicker=new n,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.1",t.datepicker})?r.apply(e,o):r)||(t.exports=i)},Y7JG:function(t,e,n){var r,o,i;o=[n("EVdn"),n("b1uY"),n("Qwlt"),n("vBzC"),n("yw1R"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}return t.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),n=this.element;return t.each(["min","max","step"],function(t,r){var o=n.attr(r);null!=o&&o.length&&(e[r]=o)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){var n;function r(){this.element[0]===t.ui.safeActiveElement(this.document[0])||(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n}))}n=this.element[0]===t.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),e.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)}),!1!==this._start(e)&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){if(t(e.currentTarget).hasClass("ui-state-active"))return!1!==this._start(e)&&void this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var n=this.options,r=t.ui.keyCode;switch(e.keyCode){case r.UP:return this._repeat(null,1,e),!0;case r.DOWN:return this._repeat(null,-1,e),!0;case r.PAGE_UP:return this._repeat(null,n.page,e),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,e),!0}return!1},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t)||(this.counter||(this.counter=1),this.spinning=!0,0))},_repeat:function(t,e,n){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,n)},t),this._spin(e*this.options.step,n)},_spin:function(t,e){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:n})||(this._value(n),this.counter++)},_increment:function(e){var n=this.options.incremental;return n?t.isFunction(n)?n(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),n=e.indexOf(".");return-1===n?0:e.length-n-1},_adjustValue:function(t){var e,n,r=this.options;return n=t-(e=null!==r.min?r.min:0),t=e+(n=Math.round(n/r.step)*r.step),t=parseFloat(t.toFixed(this._precision())),null!==r.max&&t>r.max?r.max:null!==r.min&&t<r.min?r.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var n,r,o;if("culture"===t||"numberFormat"===t)return n=this._parse(this.element.val()),this.options[t]=e,void this.element.val(this._format(n));"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(r=this.buttons.first().find(".ui-icon"),this._removeClass(r,null,this.options.icons.up),this._addClass(r,null,e.up),o=this.buttons.last().find(".ui-icon"),this._removeClass(o,null,this.options.icons.down),this._addClass(o,null,e.down)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:e(function(t){this._super(t)}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,e){var n;""!==t&&null!==(n=this._parse(t))&&(e||(n=this._adjustValue(n)),t=this._format(n)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());e(this._value).call(this,t)},widget:function(){return this.uiSpinner}}),!1!==t.uiBackCompat&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),t.ui.spinner})?r.apply(e,o):r)||(t.exports=i)},ZNhe:function(t,e,n){n("7x9u")},b1uY:function(t,e,n){var r,o,i;o=[n("EVdn"),n("u1Bl"),n("UTCq"),n("vBzC"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){var e;return t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,n){var r="iconPosition"!==e,o=r?this.options.iconPosition:n,i="top"===o||"bottom"===o;this.icon?r&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),r&&this._addClass(this.icon,null,n),this._attachIcon(o),i?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(o))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,n=void 0===t.icon?this.options.icon:t.icon;e||n||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==t.uiBackCompat&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),t.fn.button=(e=t.fn.button,function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==_typeof(arguments[0])&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),t.ui.button})?r.apply(e,o):r)||(t.exports=i)},endd:function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},eqyj:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,a){var u=[];u.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),!0===a&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},"fE+E":function(t,e){!function(t){"use strict";var e,n,r,o=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},u=function(t,e){t.addCommand("mceTogglePlainTextPaste",function(){!function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),a(t,!1)):(e.pasteFormat.set("text"),a(t,!0)),t.focus()}(t,e)}),t.addCommand("mceInsertClipboardContent",function(t,n){n.content&&e.pasteHtml(n.content,n.internal),n.text&&e.pasteText(n.text)})},s=function(t){return function(){return t}},c=s(!1),l=s(!0),f=function(){return d},d=(e=function(t){return t.isNone()},{fold:function(t,e){return t()},is:c,isSome:c,isNone:l,getOr:r=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:s(null),getOrUndefined:s(void 0),or:r,orThunk:n,map:f,each:function(){},bind:f,exists:c,forall:l,filter:f,equals:e,equals_:e,toArray:function(){return[]},toString:s("none()")}),m=function t(e){var n=s(e),r=function(){return i},o=function(t){return t(e)},i={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:l,isNone:c,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:r,orThunk:r,map:function(n){return t(n(e))},each:function(t){t(e)},bind:o,exists:o,forall:o,filter:function(t){return t(e)?i:d},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(c,function(t){return n(e,t)})}};return i},h=m,p=f,g=("function",function(t){return"function"===_typeof(t)}),v=Array.prototype.slice,b=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},y=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},x=g(Array.from)?Array.from:function(t){return v.call(t)},w=tinymce.util.Tools.resolve("tinymce.Env"),C=tinymce.util.Tools.resolve("tinymce.util.Delay"),_=tinymce.util.Tools.resolve("tinymce.util.Promise"),k=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=tinymce.util.Tools.resolve("tinymce.util.VK"),T=function(t){return-1!==t.indexOf("\x3c!-- x-tinymce/html --\x3e")},O=tinymce.util.Tools.resolve("tinymce.html.Entities"),D=tinymce.util.Tools.resolve("tinymce.html.DomParser"),E=tinymce.util.Tools.resolve("tinymce.html.Serializer"),N=tinymce.util.Tools.resolve("tinymce.html.Node"),A=tinymce.util.Tools.resolve("tinymce.html.Schema"),R=function(t){return t.getParam("paste_data_images",!1)},B=function(t){return t.getParam("paste_merge_formats",!0)},I=function(t){return t.getParam("paste_retain_style_properties")},P=function(t){return t.getParam("validate")},M=function(t){return t.getParam("allow_html_data_urls",!1,"boolean")},L=function(t){return t.getParam("paste_data_images",!1,"boolean")};function F(t,e){return k.each(e,function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}function H(t){return F(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(t,e,n){return e||n?" ":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])}var j=function(){return-1!==t.navigator.userAgent.indexOf(" Edge/")};function V(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}function z(t){var e;return t=t.replace(/^[\u00a0 ]+/,""),k.each([/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],function(n){if(n.test(t))return e=!0,!1}),e}function U(t,e,n,r){var o,i={},a=t.dom.parseStyle(r);return k.each(a,function(a,u){switch(u){case"mso-list":(o=/\w+ \w+([0-9]+)/i.exec(r))&&(n._listLevel=parseInt(o[1],10)),/Ignore/i.test(a)&&n.firstChild&&(n._listIgnore=!0,n.firstChild._listIgnore=!0);break;case"horiz-align":u="text-align";break;case"vert-align":u="vertical-align";break;case"font-color":case"mso-foreground":u="color";break;case"mso-background":case"mso-highlight":u="background";break;case"font-weight":case"font-style":return void("normal"!==a&&(i[u]=a));case"mso-element":if(/^(comment|comment-list)$/i.test(a))return void n.remove()}0!==u.indexOf("mso-comment")?0!==u.indexOf("mso-")&&("all"===I(t)||e&&e[u])&&(i[u]=a):n.remove()}),/(bold)/i.test(i["font-weight"])&&(delete i["font-weight"],n.wrap(new N("b",1))),/(italic)/i.test(i["font-style"])&&(delete i["font-style"],n.wrap(new N("i",1))),(i=t.dom.serializeStyle(i,n.name))||null}var W,q=function(t,e){return function(t){return t.getParam("paste_enable_default_filters",!0)}(t)?function(t,e){var n,r=I(t);r&&(n=k.makeMap(r.split(/[, ]/))),e=F(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi," "],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return e.length>0?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join(" "):""}]]);var o=function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")}(t),i=A({valid_elements:o,valid_children:"-li[p]"});k.each(i.elements,function(t){t.attributes.class||(t.attributes.class={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))});var a=D({},i);a.addAttributeFilter("style",function(e){for(var r,o=e.length;o--;)(r=e[o]).attr("style",U(t,n,r,r.attr("style"))),"span"===r.name&&r.parent&&!r.attributes.length&&r.unwrap()}),a.addAttributeFilter("class",function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)}),a.addNodeFilter("del",function(t){for(var e=t.length;e--;)t[e].remove()}),a.addNodeFilter("a",function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()});var u=a.parse(e);return function(t){return t.getParam("paste_convert_word_fake_lists",!0)}(t)&&function(t){var e,n,r=1;function o(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)do{e+=o(t)}while(t=t.next);return e}function i(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!i(t,e))return!1}while(t=t.next);return!0}function a(t,o,a){var u=t._listLevel||r;u!==r&&(u<r?e&&(e=e.parent.parent):(n=e,e=null)),e&&e.name===o?e.append(t):(n=n||e,e=new N(o,1),a>1&&e.attr("start",""+a),t.wrap(e)),t.name="li",u>r&&n&&n.lastChild.append(e),r=u,function t(e){if(e._listIgnore)e.remove();else if(e=e.firstChild)do{t(e)}while(e=e.next)}(t),i(t,/^\u00a0+/),i(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),i(t,/^\u00a0+/)}for(var u=[],s=t.firstChild;null!=s;)if(u.push(s),null!==(s=s.walk()))for(;void 0!==s&&s.parent!==t;)s=s.walk();for(var c=0;c<u.length;c++)if("p"===(t=u[c]).name&&t.firstChild){var l=o(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(l)){a(t,"ul");continue}if(z(l)){var f=/([0-9]+)\./.exec(l),d=1;f&&(d=parseInt(f[1],10)),a(t,"ol",d);continue}if(t._listLevel){a(t,"ul",1);continue}e=null}else n=e,e=null}(u),E({validate:P(t)},i).serialize(u)}(t,e):e},$=function(t,e){return{content:t,cancelled:e}},Y=function(t,e){return t.insertContent(e,{merge:B(t),paste:!0}),!0},G=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},K=function(t){return G(t)&&/.(gif|jpe?g|png)$/.test(t)},X=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!G(e))&&function(t,e,n){return t.undoManager.extra(function(){n(t,e)},function(){t.execCommand("mceInsertLink",!1,e)}),!0}(t,e,n)},J=function(t,e,n){return!!K(e)&&function(t,e,n){return t.undoManager.extra(function(){n(t,e)},function(){t.insertContent('<img src="'+e+'">')}),!0}(t,e,n)},Q=function(t){return"\n"===t||"\r"===t},Z=function(t,e,n,r){var o=function(t,e,n){var r=V(e);return function(t,e,n,r){var o=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})}(t,e,n,r),i=function(t,e){var n=D({},t.schema);n.addNodeFilter("meta",function(t){k.each(t,function(t){return t.remove()})});var r=n.parse(e,{forced_root_block:!1,isRootContent:!0});return E({validate:P(t)},t.schema).serialize(r)}(t,o.content);return t.hasEventListeners("PastePostProcess")&&!o.isDefaultPrevented()?function(t,e,n,r){var o=t.dom.create("div",{style:"display:none"},e),i=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})}(t,o,n,r);return $(i.node.innerHTML,i.isDefaultPrevented())}(t,i,n,r):$(i,o.isDefaultPrevented())}(t,r?q(t,e):e,n,r)}(t,e,n);!1===o.cancelled&&function(t,e,n){n||!1===function(t){return t.getParam("smart_paste",!0)}(t)?Y(t,e):function(t,e){k.each([X,J,Y],function(n){return!0!==n(t,e,Y)})}(t,e)}(t,o.content,r)},tt=function(t,e,n){var r=n||T(e);Z(t,e.replace("\x3c!-- x-tinymce/html --\x3e",""),r,!1)},et=function(t,e){var n=function(t,e,n){return e?function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==_typeof(e)){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+O.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",a=k.map(r,function(t){return t.split(/\n/).join("<br />")});return 1===a.length?a[0]:k.map(a,function(t){return o+t+i}).join("")}(t,!0===e?"p":e,n):function(t){return t.replace(/\r?\n/g,"<br>")}(t)}(function(t){return function(t,e,n){return y(t,function(t){n=e(n,t)}),n}(t,function(e,n){return-1!==" \f\t\v".indexOf(n)||" "===n?e.pcIsSpace||""===e.str||e.str.length===t.length-1||function(t,e){return e<t.length&&e>=0&&Q(t[e])}(t,e.str.length+1)?{pcIsSpace:!1,str:e.str+" "}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:Q(n),str:e.str+n}},{pcIsSpace:!1,str:""}).str}(t.dom.encode(e).replace(/\r\n/g,"\n")),function(t){return t.getParam("forced_root_block")}(t),function(t){return t.getParam("forced_root_block_attrs")}(t));Z(t,n,!1,!0)},nt=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&n.length>0&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(t){e[o]=""}}}return e},rt=function(t,e){return e in t&&t[e].length>0},ot=function(t){return rt(t,"text/html")||rt(t,"text/plain")},it=("mceclip",W=0,function(){return"mceclip"+W++}),at=function(e,n){var r,o,i=(r=n.uri,(o=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(r))?{type:o[1],data:decodeURIComponent(o[2])}:{type:null,data:null}),a=i.data,u=i.type,s=it(),c=e.getParam("images_reuse_filename")&&n.blob.name?function(t,e){var n=e.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i);return n?t.dom.encode(n[1]):null}(e,n.blob.name):s,l=new t.Image;if(l.src=n.uri,function(t,e){var n=function(t){return t.getParam("images_dataimg_filter")}(t);return!n||n(e)}(e,l)){var f=e.editorUpload.blobCache,d=void 0,m=f.getByData(a,u);m?d=m:(d=f.create(s,n.blob,a,c),f.add(d)),tt(e,'<img src="'+d.blobUri()+'">',!1)}else tt(e,'<img src="'+n.uri+'">',!1)},ut=function(t,e,n){var r,o="paste"===e.type?e.clipboardData:e.dataTransfer;if(L(t)&&o){var i=function(t){var e=t.items?b(x(t.items),function(t){return t.getAsFile()}):[],n=t.files?x(t.files):[];return function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i)&&n.push(i)}return n}(e.length>0?e:n,function(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)})}(o);if(i.length>0)return e.preventDefault(),(r=i,_.all(b(r,function(t){return new _(function(e){var n=t.getAsFile?t.getAsFile():t,r=new window.FileReader;r.onload=function(){e({blob:n,uri:r.result})},r.readAsDataURL(n)})}))).then(function(e){n&&t.selection.setRng(n),y(e,function(e){at(t,e)})}),!0}return!1},st=function(t){return S.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},ct=function(e,n,r){var i,a,u=(i=o(p()),{clear:function(){i.set(p())},set:function(t){i.set(h(t))},isSet:function(){return i.get().isSome()},on:function(t){i.get().each(t)}});function s(t,r,o,i){var a;rt(t,"text/html")?a=t["text/html"]:(a=n.getHtml(),i=i||T(a),n.isDefaultContent(a)&&(o=!0)),a=H(a),n.remove();var u=!1===i&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(a),s=K(a);(!a.length||u&&!s)&&(o=!0),(o||s)&&(a=rt(t,"text/plain")&&u?t["text/plain"]:function(t){var e=A(),n=D({},e),r="",o=e.getShortEndedElements(),i=k.makeMap("script noscript style textarea video audio iframe object"," "),a=e.getBlockElements();return t=F(t,[/<!\[[^\]]+\]>/g]),function t(e){var n=e.name,u=e;if("br"!==n){if("wbr"!==n)if(o[n]&&(r+=" "),i[n])r+=" ";else{if(3===e.type&&(r+=e.value),!e.shortEnded&&(e=e.firstChild))do{t(e)}while(e=e.next);a[n]&&u.next&&(r+="\n","p"===n&&(r+="\n"))}}else r+="\n"}(n.parse(t)),r}(a)),n.isDefaultContent(a)?r||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):o?et(e,a):tt(e,a,i)}e.on("keydown",function(r){function o(t){st(t)&&!t.isDefaultPrevented()&&n.remove()}if(st(r)&&!r.isDefaultPrevented()){if((a=r.shiftKey&&86===r.keyCode)&&w.webkit&&-1!==t.navigator.userAgent.indexOf("Version/"))return;if(r.stopImmediatePropagation(),u.set(r),window.setTimeout(function(){u.clear()},100),w.ie&&a)return r.preventDefault(),void function(t,e){t.fire("paste",{ieFake:!0})}(e);n.remove(),n.create(),e.once("keyup",o),e.once("paste",function(){e.off("keyup",o)})}}),e.on("paste",function(o){var i=u.isSet(),c=function(t,e){var n=nt(o.clipboardData||t.getDoc().dataTransfer);return j()?k.extend(n,{"text/html":""}):n}(e),l="text"===r.get()||a,f=rt(c,"x-tinymce/html");a=!1,o.isDefaultPrevented()||function(e){var n=o.clipboardData;return-1!==t.navigator.userAgent.indexOf("Android")&&n&&n.items&&0===n.items.length}()?n.remove():ot(c)||!ut(e,o,n.getLastRng()||e.selection.getRng())?(i||o.preventDefault(),!w.ie||i&&!o.ieFake||rt(c,"text/html")||(n.create(),e.dom.bind(n.getEl(),"paste",function(t){t.stopPropagation()}),e.getDoc().execCommand("Paste",!1,null),c["text/html"]=n.getHtml()),rt(c,"text/html")?(o.preventDefault(),f||(f=T(c["text/html"])),s(c,i,l,f)):C.setEditorTimeout(e,function(){s(c,i,l,f)},0)):n.remove()})},lt=function(e){return w.ie&&e.inline?t.document.body:e.getBody()},ft=function(t){return t.dom.get("mcepastebin")},dt=function(t,e){return e===t},mt=function(t,e){var n,r=ft(t);return(n=r)&&"mcepastebin"===n.id&&dt(e,r.innerHTML)},ht=function(t){var e=o(null);return{create:function(){return function(t,e,n){var r=t.dom,o=t.getBody();e.set(t.selection.getRng());var i=t.dom.add(lt(t),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n);(w.ie||w.gecko)&&r.setStyle(i,"left","rtl"===r.getStyle(o,"direction",!0)?65535:-65535),r.bind(i,"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),function(t,e,n){(function(t){return lt(t)!==t.getBody()})(t)&&t.dom.bind(e,"paste keyup",function(e){mt(t,n)||t.fire("paste")})}(t,i,n),i.focus(),t.selection.select(i,!0)}(t,e,"%MCEPASTEBIN%")},remove:function(){return function(t,e){if(ft(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return ft(t)},getHtml:function(){return function(t){var e=function(e,n){e.appendChild(n),t.dom.remove(n,!0)},n=k.grep(lt(t).childNodes,function(t){return"mcepastebin"===t.id}),r=n.shift();k.each(n,function(t){e(r,t)});for(var o=t.dom.select("div[id=mcepastebin]",r),i=o.length-1;i>=0;i--){var a=t.dom.create("div");r.insertBefore(a,o[i]),e(a,o[i])}return r?r.innerHTML:""}(t)},getLastRng:function(){return e.get()},isDefault:function(){return mt(t,"%MCEPASTEBIN%")},isDefaultContent:function(t){return dt("%MCEPASTEBIN%",t)}}},pt=function(t,e,n,r){!function(t,e,n){if(!function(t){return!1===w.iOS&&void 0!==t&&"function"==typeof t.setData&&!0!==j()}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData("x-tinymce/html",e),!0}catch(t){return!1}}(t.clipboardData,e.html,e.text)?n(e.html,r):(t.preventDefault(),r())},gt=function(t){return function(e,n){var r="\x3c!-- x-tinymce/html --\x3e"+e,o=t.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),i=t.dom.create("div",{contenteditable:"true"},r);t.dom.setStyles(o,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),o.appendChild(i),t.dom.add(t.getBody(),o);var a=t.selection.getRng();i.focus();var u=t.dom.createRng();u.selectNodeContents(i),t.selection.setRng(u),C.setTimeout(function(){t.selection.setRng(a),o.parentNode.removeChild(o),n()},0)}},vt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},bt=function(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)},yt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),xt=function(t,e){return yt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},wt=function(t,e){t.focus(),t.selection.setRng(e)};function Ct(t,e){t.on("PastePreProcess",function(n){n.content=e(t,n.content,n.internal,n.wordContent)})}function _t(t,e){if(!V(e))return e;var n=[];return k.each(t.schema.getBlockElements(),function(t,e){n.push(e)}),e=F(e,[[new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g"),"$1"]]),F(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function kt(t,e,n,r){if(r||n)return e;var o,i=function(t){return t.getParam("paste_webkit_styles")}(t);if(!1===function(t){return t.getParam("paste_remove_styles_if_webkit",!0)}(t)||"all"===i)return e;if(i&&(o=i.split(/[, ]/)),o){var a=t.dom,u=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var i=a.parseStyle(a.decode(n)),s={};if("none"===o)return e+r;for(var c=0;c<o.length;c++){var l=i[o[c]],f=a.getStyle(u,o[c],!0);/color/.test(o[c])&&(l=a.toHex(l),f=a.toHex(f)),f!==l&&(s[o[c]]=l)}return(s=a.serializeStyle(s,"span"))?e+' style="'+s+'"'+r:e+r})}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(t,e,n,r){return e+' style="'+n+'"'+r})}function St(t,e){t.$("a",e).find("font,u").each(function(e,n){t.dom.remove(n,!0)})}var Tt=function(t,e){return function(n){n.setActive("text"===e.pasteFormat.get());var r=function(t){return n.setActive(t.state)};return t.on("PastePlainTextToggle",r),function(){return t.off("PastePlainTextToggle",r)}}};i.add("paste",function(e){if(!1===function(e){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(e.getParam("plugins"))||!i.get("powerpaste")||(void 0!==t.window.console&&t.window.console.log&&t.window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))}(e)){var n=o(!1),r=o(e.getParam("paste_as_text",!1)?"text":"html"),a=function(t,e){var n=ht(t);return t.on("PreInit",function(){return function(t,e,n){var r;ct(t,e,n),t.parser.addNodeFilter("img",function(e,n,o){var i=function(t){t.attr("data-mce-object")||r===w.transparentSrc||t.remove()},a=function(t){return 0===t.indexOf("webkit-fake-url")},u=function(t){return 0===t.indexOf("data:")};if(!L(t)&&function(t){return t.data&&!0===t.data.paste}(o))for(var s=e.length;s--;)(r=e[s].attr("src"))&&(a(r)||!M(t)&&u(r))&&i(e[s])})}(t,n,e)}),{pasteFormat:e,pasteHtml:function(e,n){return tt(t,e,n)},pasteText:function(e){return et(t,e)},pasteImageData:function(e,n){return ut(t,e,n)},getDataTransferItems:nt,hasHtmlOrText:ot,hasContentType:rt}}(e,r),s=function(t){w.webkit&&Ct(t,kt),w.ie&&(Ct(t,_t),function(t,e){t.on("PastePostProcess",function(n){e(t,n.node)})}(t,St))}(e);return function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Tt(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:Tt(t,e)})}(e,a),u(e,a),function(t){var e=t.plugins.paste,n=function(t){return t.getParam("paste_preprocess")}(t);n&&t.on("PastePreProcess",function(t){n.call(e,e,t)});var r=function(t){return t.getParam("paste_postprocess")}(t);r&&t.on("PastePostProcess",function(t){r.call(e,e,t)})}(e),function(t){t.on("cut",function(t){return function(e){bt(t)&&pt(e,vt(t),gt(t),function(){if(w.browser.isChrome()){var e=t.selection.getRng();C.setEditorTimeout(t,function(){t.selection.setRng(e),t.execCommand("Delete")},0)}else t.execCommand("Delete")})}}(t)),t.on("copy",function(t){return function(e){bt(t)&&pt(e,vt(t),gt(t),function(){})}}(t))}(e),function(t,e,n){(function(t){return t.getParam("paste_block_drop",!1)})(t)&&t.on("dragend dragover draggesture dragdrop drop drag",function(t){t.preventDefault(),t.stopPropagation()}),R(t)||t.on("drop",function(t){var e=t.dataTransfer;e&&e.files&&e.files.length>0&&t.preventDefault()}),t.on("drop",function(r){var o=xt(t,r);if(!r.isDefaultPrevented()&&!n.get()){var i,a=e.getDataTransferItems(r.dataTransfer),u=e.hasContentType(a,"x-tinymce/html");if((e.hasHtmlOrText(a)&&(!(i=a["text/plain"])||0!==i.indexOf("file://"))||!e.pasteImageData(r,o))&&o&&function(t){return t.getParam("paste_filter_drop",!0)}(t)){var s=a["mce-internal"]||a["text/html"]||a["text/plain"];s&&(r.preventDefault(),C.setEditorTimeout(t,function(){t.undoManager.transact(function(){a["mce-internal"]&&t.execCommand("Delete"),wt(t,o),s=H(s),a["text/html"]?e.pasteHtml(s,u):e.pasteText(s)})}))}}}),t.on("dragstart",function(t){n.set(!0)}),t.on("dragover dragend",function(e){R(t)&&!1===n.get()&&(e.preventDefault(),wt(t,xt(t,e))),"dragend"===e.type&&n.set(!1)})}(e,a,n),{clipboard:a,quirks:s}}})}(window)},g7np:function(t,e,n){"use strict";var r=n("2SVd"),o=n("5oMp");t.exports=function(t,e){return t&&!r(e)?o(t,e):e}},hOyB:function(t,e,n){n("JAFY")},hVuo:function(t,e,n){n("4tak")},iGnl:function(t,e,n){var r,o,i;o=[n("EVdn"),n("NHgk"),n("Qwlt"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){var e=!1;return t(document).on("mouseup",function(){e=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(n){if(!0===t.data(n.target,e.widgetName+".preventClickEvent"))return t.removeData(n.target,e.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(n){if(!e){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(n),this._mouseDownEvent=n;var r=this,o=1===n.which,i=!("string"!=typeof this.options.cancel||!n.target.nodeName)&&t(n.target).closest(this.options.cancel).length;return!(o&&!i&&this._mouseCapture(n)&&(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(n)&&this._mouseDelayMet(n)&&(this._mouseStarted=!1!==this._mouseStart(n),!this._mouseStarted)?(n.preventDefault(),0):(!0===t.data(n.target,this.widgetName+".preventClickEvent")&&t.removeData(n.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return r._mouseMove(t)},this._mouseUpDelegate=function(t){return r._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),n.preventDefault(),e=!0,0)))}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(n){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,n.target===this._mouseDownEvent.target&&t.data(n.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(n)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,e=!1,n.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})?r.apply(e,o):r)||(t.exports=i)},"jfS+":function(t,e,n){"use strict";var r=n("endd");function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},t.exports=o},r15H:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt"),n("GC/X")],void 0===(i="function"==typeof(r=function(t){return t.fn.labels=function(){var e,n,r,o,i;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(o=this.eq(0).parents("label"),(r=this.attr("id"))&&(i=(e=this.eq(0).parents().last()).add(e.length?e.siblings():this.siblings()),n="label[for='"+t.ui.escapeSelector(r)+"']",o=o.add(i.find(n).addBack(n))),this.pushStack(o))}})?r.apply(e,o):r)||(t.exports=i)},tQ2B:function(t,e,n){"use strict";var r=n("xTJ+"),o=n("Rn+g"),i=n("MLWZ"),a=n("g7np"),u=n("w0Vi"),s=n("OTTw"),c=n("LYNF");t.exports=function(t){return new Promise(function(e,l){var f=t.data,d=t.headers;r.isFormData(f)&&delete d["Content-Type"];var m=new XMLHttpRequest;if(t.auth){var h=t.auth.username||"",p=t.auth.password||"";d.Authorization="Basic "+btoa(h+":"+p)}var g=a(t.baseURL,t.url);if(m.open(t.method.toUpperCase(),i(g,t.params,t.paramsSerializer),!0),m.timeout=t.timeout,m.onreadystatechange=function(){if(m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in m?u(m.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:t,request:m};o(e,l,r),m=null}},m.onabort=function(){m&&(l(c("Request aborted",t,"ECONNABORTED",m)),m=null)},m.onerror=function(){l(c("Network Error",t,null,m)),m=null},m.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),l(c(e,t,"ECONNABORTED",m)),m=null},r.isStandardBrowserEnv()){var v=n("eqyj"),b=(t.withCredentials||s(g))&&t.xsrfCookieName?v.read(t.xsrfCookieName):void 0;b&&(d[t.xsrfHeaderName]=b)}if("setRequestHeader"in m&&r.forEach(d,function(t,e){void 0===f&&"content-type"===e.toLowerCase()?delete d[e]:m.setRequestHeader(e,t)}),r.isUndefined(t.withCredentials)||(m.withCredentials=!!t.withCredentials),t.responseType)try{m.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&m.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){m&&(m.abort(),l(t),m=null)}),void 0===f&&(f=null),m.send(f)})}},u1Bl:function(t,e,n){var r,o,i;o=[n("EVdn"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){var e=/ui-corner-([a-z]){2,6}/g;return t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,n=[];t.each(this.options.items,function(r,o){var i,a={};if(o)return"controlgroupLabel"===r?((i=e.element.find(o)).each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(i,null,"ui-widget ui-widget-content ui-state-default"),void(n=n.concat(i.get()))):void(t.fn[r]&&(a=e["_"+r+"Options"]?e["_"+r+"Options"]("middle"):{classes:{}},e.element.find(o).each(function(){var o=t(this),i=o[r]("instance"),u=t.widget.extend({},a);if("button"!==r||!o.parent(".ui-spinner").length){i||(i=o[r]()[r]("instance")),i&&(u.classes=e._resolveClassesValues(u.classes,i)),o[r](u);var s=o[r]("widget");t.data(s[0],"ui-controlgroup-data",i||o[r]("instance")),n.push(s[0])}})))}),this.childWidgets=t(t.unique(n)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var n=t(this).data("ui-controlgroup-data");n&&n[e]&&n[e]()})},_updateCornerClass:function(t,e){var n=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,n)},_buildSimpleOptions:function(t,e){var n="vertical"===this.options.direction,r={classes:{}};return r.classes[e]={middle:"",first:"ui-corner-"+(n?"top":"left"),last:"ui-corner-"+(n?"bottom":"right"),only:"ui-corner-all"}[t],r},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:!!e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(n,r){var o={};return t.each(n,function(i){var a=r.options.classes[i]||"";a=t.trim(a.replace(e,"")),o[i]=(a+" "+n[i]).replace(/\s+/g," ")}),o},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var e,n=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,r){var o=e[r]().data("ui-controlgroup-data");if(o&&n["_"+o.widgetName+"Options"]){var i=n["_"+o.widgetName+"Options"](1===e.length?"only":r);i.classes=n._resolveClassesValues(i.classes,o),o.element[o.widgetName](i)}else n._updateCornerClass(e[r](),r)}),this._callChildMethod("refresh"))}})})?r.apply(e,o):r)||(t.exports=i)},vBzC:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}})?r.apply(e,o):r)||(t.exports=i)},vDqi:function(t,e,n){t.exports=n("zuR4")},vFQT:function(t,e,n){n("fE+E")},"vn/0":function(t,e){!function(t){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),r=function(t){return function(e){return r=_typeof(n=e),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}},o=function(t){return function(e){return _typeof(e)===t}},i=r("string"),a=r("array"),u=(null,function(t){return null===t}),s=o("boolean"),c=o("function"),l=function(t){var e=t.getParam("link_assume_external_targets",!1);return s(e)&&e?1:!i(e)||"http"!==e&&"https"!==e?0:e},f=function(t){return t.getParam("default_link_target")},d=function(t){return t.getParam("target_list",!0)},m=function(t){return t.getParam("rel_list",[],"array")},h=function(t){return t.getParam("link_title",!0,"boolean")},p=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},g=function(t){return t.getParam("link_default_protocol","http","string")},v=function(){},b=function(t){return function(){return t}},y=b(!1),x=b(!0),w=function(){return C},C=function(){var t=function(t){return t.isNone()},e=function(t){return t()},n=function(t){return t};return{fold:function(t,e){return t()},is:y,isSome:y,isNone:x,getOr:n,getOrThunk:e,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:b(null),getOrUndefined:b(void 0),or:n,orThunk:e,map:w,each:v,bind:w,exists:y,forall:x,filter:w,equals:t,equals_:t,toArray:function(){return[]},toString:b("none()")}}(),_=function t(e){var n=b(e),r=function(){return i},o=function(t){return t(e)},i={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:x,isNone:y,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:r,orThunk:r,map:function(n){return t(n(e))},each:function(t){t(e)},bind:o,exists:o,forall:o,filter:function(t){return t(e)?i:C},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(y,function(t){return n(e,t)})}};return i},k=_,S=w,T=function(t){return null==t?C:_(t)},O=Array.prototype.indexOf,D=Array.prototype.push,E=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!a(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);D.apply(e,t[n])}return e},N=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return S()},A=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},R=tinymce.util.Tools.resolve("tinymce.util.Tools"),B=function(t){return i(t.value)?t.value:""},I=function(t){return void 0===t&&(t=B),function(e){return T(e).map(function(e){return function(t,e){var n=[];return R.each(t,function(t){var r=i(t.text)?t.text:i(t.title)?t.title:"";if(void 0!==t.menu);else{var o=e(t);n.push({text:r,value:o})}}),n}(e,t)})}},P=function(t){return I(B)(t)},M=I,L=function(t,e){return function(n){return{name:t,type:"selectbox",label:e,items:n}}},F=B,H=function(){return(H=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},j=Object.keys,V=function(t){return!(!/(^|[ ,])rtc([, ]|$)/.test(t.getParam("plugins","","string"))||!e.get("rtc"))},z=function(t){return/^\w+:/i.test(t)},U=function(t){return t.getAttribute("data-mce-href")||t.getAttribute("href")},W=function(t,e){var n=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter(function(t){return-1===R.inArray(n,t)})},i=e?function(t){return(t=o(t)).length>0?t.concat(n):n}(r):o(r);return i.length>0?function(t){return R.trim(t.sort().join(" "))}(i):""},q=function(t,e){return e=e||t.selection.getNode(),X(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},$=function(t,e){return function(t){return t.replace(/\uFEFF/g,"")}(e?e.innerText||e.textContent:t.getContent({format:"text"}))},Y=function(t){return t&&"A"===t.nodeName&&!!U(t)},G=function(t){return R.grep(t,Y).length>0},K=function(t){return!(/</.test(t)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(t)||-1===t.indexOf("href=")))},X=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},J=function(t,e,n){var r=t.selection.getNode(),o=q(t,r),i=function(t,e){var n=H({},e);if(!(m(t).length>0)&&!1===p(t)){var r=W(n.rel,"_blank"===n.target);n.rel=r||null}return T(n.target).isNone()&&!1===d(t)&&(n.target=f(t)),n.href=function(t,e){return"http"!==e&&"https"!==e||z(t)?t:e+"://"+t}(n.href,l(t)),n}(t,function(t){return e=function(e,n){return t[n].each(function(t){e[n]=t.length>0?t:null}),e},n={href:t.href},function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n])}(["title","rel","class","target"],function(t){n=e(n,t)}),n;var e,n}(n));t.undoManager.transact(function(){n.href===e.href&&e.attach(),o?(t.focus(),function(t,e,n,r){n.each(function(t){e.hasOwnProperty("innerText")?e.innerText=t:e.textContent=t}),t.dom.setAttribs(e,r),t.selection.select(e)}(t,o,n.text,i)):function(t,e,n,r){X(e)?nt(t,e,r):n.fold(function(){t.execCommand("mceInsertLink",!1,r)},function(e){t.insertContent(t.dom.createHTML("a",r,t.dom.encode(e)))})}(t,r,n.text,i)})},Q=function(t){var e=t.class,n=t.href,r=t.rel,o=t.target,i=t.text,a=t.title;return function(t,e){var n,r={};return function(t,e,n,r){(function(t,e){for(var n=j(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}})(t,function(t,o){(e(t,o)?n:r)(t,o)})}(t,function(t,e){return!1===u(t)},(n=r,function(t,e){n[e]=t}),v),r}({class:e.getOrNull(),href:n,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:a.getOrNull()})},Z=function(t,e,n){V(t)?t.execCommand("createlink",!1,Q(n)):J(t,e,n)},tt=function(t){V(t)?t.execCommand("unlink"):function(t){t.undoManager.transact(function(){var e=t.selection.getNode();if(X(e))et(t,e);else{var n=t.dom.getParent(e,"a[href]",t.getBody());n&&t.dom.remove(n,!0)}t.focus()})}(t)},et=function(t,e){var n=t.dom.select("img",e)[0];if(n){var r=t.dom.getParents(n,"a[href]",e)[0];r&&(r.parentNode.insertBefore(n,r),t.dom.remove(r))}},nt=function(t,e,n){var r=t.dom.select("img",e)[0];if(r){var o=t.dom.create("a",n);r.parentNode.insertBefore(o,r),o.appendChild(r)}},rt=function(t,e){var n,r,o=(n=t.text,r=n,{get:function(){return r},set:function(t){r=t}}),i=function(t,n){var r,i,a=(r=e,i=n.name,"link"===i?r.catalogs.link:"anchor"===i?r.catalogs.anchor:S()).getOr([]);return function(t,e,n,r){var o=r[e],i=t.length>0;return void 0!==o?function(t,e){return N(n,function(e){return k(e).filter(function(e){return e.value===t})})}(o).map(function(e){return{url:{value:e.value,meta:{text:i?t:e.text,attach:v}},text:i?t:e.text}}):S()}(o.get(),n.name,a,t)};return{onChange:function(t,e){return"url"===e.name?function(t){if(o.get().length<=0){var e=void 0!==t.url.meta.text?t.url.meta.text:t.url.value,n=void 0!==t.url.meta.title?t.url.meta.title:"";return k({text:e,title:n})}return S()}(t()):function(t,e){return function(t,e){return O.call(t,e)}(t,e)>-1}(["anchor","link"],e.name)?i(t(),e):"text"===e.name?(o.set(t().text),S()):S()}}},ot=tinymce.util.Tools.resolve("tinymce.util.Delay"),it=tinymce.util.Tools.resolve("tinymce.util.Promise"),at=function(t){var e=t.href;return e.indexOf("@")>0&&-1===e.indexOf("/")&&-1===e.indexOf("mailto:")?k({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return H(H({},t),{href:"mailto:"+e})}}):S()},ut=function(t,e){return function(n){var r=n.href;return 1===t&&!z(r)||0===t&&/^\s*www[\.|\d\.]/i.test(r)?k({message:"The URL you entered seems to be an external link. Do you want to add the required "+e+":// prefix?",preprocess:function(t){return H(H({},t),{href:e+"://"+r})}}):S()}},st=function(t){var e=function(t,e){return E(function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}(t,e))}(t.dom.select("a:not([href])"),function(t){var e=t.name||t.id;return e?[{text:e,value:"#"+e}]:[]});return e.length>0?k([{text:"None",value:""}].concat(e)):S()},ct=function(t){var e=function(t){return t.getParam("link_class_list",[],"array")}(t);return e.length>0?P(e):S()},lt=tinymce.util.Tools.resolve("tinymce.util.XHR"),ft=function(t,e){var n=m(t);if(n.length>0){var r=e.is("_blank");return(!1===p(t)?M(function(t){return W(F(t),r)}):P)(n)}return S()},dt=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],mt=function(t){var e=d(t);return a(e)?P(e).orThunk(function(){return k(dt)}):!1===e?S():k(dt)},ht=function(t,e,n){var r=t.getAttrib(e,n);return null!==r&&r.length>0?k(r):S()},pt=function(t,e){return function(t){var e=function(e){return t.convertURL(e.value||e.url,"href")},n=function(t){return t.getParam("link_list")}(t);return new it(function(t){i(n)?lt.send({url:n,success:function(e){return t(function(t){try{return k(JSON.parse(t))}catch(t){return S()}}(e))},error:function(e){return t(S())}}):c(n)?n(function(e){return t(k(e))}):t(T(n))}).then(function(t){return t.bind(M(e)).map(function(t){return t.length>0?[{text:"None",value:""}].concat(t):t})})}(t).then(function(n){var r=function(t,e){var n=t.dom,r=K(t.selection.getContent())?k($(t.selection,e)):S(),o=e?k(n.getAttrib(e,"href")):S(),i=e?T(n.getAttrib(e,"target")):S(),a=ht(n,e,"rel"),u=ht(n,e,"class");return{url:o,text:r,title:ht(n,e,"title"),target:i,rel:a,linkClass:u}}(t,e);return{anchor:r,catalogs:{targets:mt(t),rels:ft(t,r.target),classes:ct(t),anchor:st(t),link:n},optNode:T(e),flags:{titleEnabled:h(t)}}})},gt=function(t){(function(t){var e=q(t);return pt(t,e)})(t).then(function(e){var n=function(t,e){return function(n){var r=n.getData();if(!r.url.value)return tt(t),void n.close();var o=function(t){return T(r[t]).filter(function(n){return!e.anchor[t].is(n)})},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},a={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:function(){}};(function(t,e){return N([at,ut(l(t),g(t))],function(t){return t(e)}).fold(function(){return it.resolve(e)},function(n){return new it(function(r){!function(t,e,n){var r=t.selection.getRng();ot.setEditorTimeout(t,function(){t.windowManager.confirm(e,function(e){t.selection.setRng(r),n(e)})})}(t,n.message,function(t){r(t?n.preprocess(e):e)})})})})(t,i).then(function(e){Z(t,a,e)}),n.close()}}(t,e);return function(t,e,n){var r=t.anchor.text.map(function(){return{name:"text",type:"input",label:"Text to display"}}).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,e){return{url:{value:t.anchor.url.getOr(""),meta:{attach:function(){},text:t.anchor.url.fold(function(){return""},function(){return t.anchor.text.getOr("")}),original:{value:t.anchor.url.getOr("")}}},text:t.anchor.text.getOr(""),title:t.anchor.title.getOr(""),anchor:t.anchor.url.getOr(""),link:t.anchor.url.getOr(""),rel:t.anchor.rel.getOr(""),target:t.anchor.target.or(e).getOr(""),linkClass:t.anchor.linkClass.getOr("")}}(t,T(f(n))),a=rt(i,t),u=t.catalogs;return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:E([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],r,o,A([u.anchor.map(L("anchor","Anchors")),u.rels.map(L("rel","Rel")),u.targets.map(L("target","Open link in...")),u.link.map(L("link","Link list")),u.classes.map(L("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:function(t,e){var n=e.name;a.onChange(t.getData,{name:n}).each(function(e){t.setData(e)})},onSubmit:e}}(e,n,t)}).then(function(e){t.windowManager.open(e)})},vt=function(e){var n=t.document.createElement("a");n.target="_blank",n.href=e,n.rel="noreferrer noopener";var r=t.document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,t.window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(e,n){t.document.body.appendChild(e),e.dispatchEvent(n),t.document.body.removeChild(e)}(n,r)},bt=function(t,e){return t.dom.getParent(e,"a[href]")},yt=function(t){return bt(t,t.selection.getStart())},xt=function(t,e){if(e){var n=U(e);if(/^#/.test(n)){var r=t.$(n);r.length&&t.selection.scrollIntoView(r[0],!0)}else vt(e.href)}},wt=function(t){return function(){gt(t)}},Ct=function(t){return function(){xt(t,yt(t))}},_t=function(t){return function(e){var n=function(n){return e.setActive(!t.mode.isReadOnly()&&!!q(t,n.element))};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}},kt=function(t){return function(e){var n=t.dom.getParents(t.selection.getStart());e.setDisabled(!G(n));var r=function(t){return e.setDisabled(!G(t.parents))};return t.on("NodeChange",r),function(){return t.off("NodeChange",r)}}};e.add("link",function(t){!function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:wt(t),onSetup:_t(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Ct(t),onSetup:kt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return tt(t)},onSetup:kt(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Ct(t),onSetup:kt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:wt(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return tt(t)},onSetup:kt(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(e){return G(t.dom.getParents(e,"a"))?"link unlink openlink":"link"}})}(t),function(t){var e=function(e){var n=t.selection.getNode();return e.setDisabled(!q(t,n)),function(){}};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:_t(t)},label:"Link",predicate:function(e){return!!q(t,e)&&function(t){return t.getParam("link_context_toolbar",!1,"boolean")}(t)},initValue:function(){var e=q(t);return e?U(e):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(e){var n=t.selection.getNode();return e.setActive(!!q(t,n)),_t(t)(e)},onAction:function(e){var n=q(t),r=e.getValue();if(n)t.undoManager.transact(function(){t.dom.setAttrib(n,"href",r),function(t){t.selection.collapse(!1)}(t),e.hide()});else{var o={href:r,attach:function(){}},i=K(t.selection.getContent())?k($(t.selection,n)).filter(function(t){return t.length>0}).or(T(r)):S();Z(t,o,{href:r,text:i,title:S(),rel:S(),target:S(),class:S()}),e.hide()}}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:e,onAction:function(e){tt(t),e.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:e,onAction:function(e){Ct(t)(),e.hide()}}]})}(t),function(t){t.on("click",function(e){var r=bt(t,e.target);r&&n.metaKeyPressed(e)&&(e.preventDefault(),xt(t,r))}),t.on("keydown",function(e){var n=yt(t);n&&13===e.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(e)&&(e.preventDefault(),xt(t,n))})}(t),function(t){t.addCommand("mceLink",function(){!function(t){return t.getParam("link_quicklink",!1,"boolean")}(t)?wt(t)():t.fire("contexttoolbar-show",{toolbarKey:"quicklink"})})}(t),function(t){t.addShortcut("Meta+K","",function(){t.execCommand("mceLink")})}(t)})}(window)},w0Vi:function(t,e,n){"use strict";var r=n("xTJ+"),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,a={};return t?(r.forEach(t.split("\n"),function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(a[e]&&o.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}}),a):a}},wCe6:function(t,e,n){var r,o,i;o=[n("EVdn"),n("vBzC"),n("Jchv"),n("yw1R"),n("y6ec"),n("Qwlt"),n("MIQu")],void 0===(i="function"==typeof(r=function(t){return t.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var n=t(e.target),r=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&n.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),n.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&r.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var n=t(e.target).closest(".ui-menu-item"),r=t(e.currentTarget);n[0]===r[0]&&(this._removeClass(r.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,r))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var n=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,n)},blur:function(e){this._delay(function(){!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]))&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),e.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var n,r,o,i,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,r=this.previousFilter||"",i=!1,o=e.keyCode>=96&&e.keyCode<=105?(e.keyCode-96).toString():String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),o===r?i=!0:o=r+o,n=this._filterMenuItems(o),(n=i&&-1!==n.index(this.active.next())?this.active.nextAll(".ui-menu-item"):n).length||(o=String.fromCharCode(e.keyCode),n=this._filterMenuItems(o)),n.length?(this.focus(e,n),this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,n,r,o,i=this,a=this.options.icons.submenu,u=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),n=u.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),n=e.prev(),r=t("<span>").data("ui-menu-submenu-caret",!0);i._addClass(r,"ui-menu-icon","ui-icon "+a),n.attr("aria-haspopup","true").prepend(r),e.attr("aria-labelledby",n.attr("id"))}),this._addClass(n,"ui-menu","ui-widget ui-widget-content ui-front"),(e=u.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var e=t(this);i._isDivider(e)&&i._addClass(e,"ui-menu-divider","ui-widget-content")}),o=(r=e.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(r,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),e.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var n=this.element.find(".ui-menu-icon");this._removeClass(n,null,this.options.icons.submenu)._addClass(n,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var n,r,o;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),r=this.active.children(".ui-menu-item-wrapper"),this._addClass(r,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),o=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(o,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(n=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(n),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var n,r,o,i,a,u;this._hasScroll()&&(n=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,o=e.offset().top-this.activeMenu.offset().top-n-r,i=this.activeMenu.scrollTop(),a=this.activeMenu.height(),u=e.outerHeight(),o<0?this.activeMenu.scrollTop(i+o):o+u>a&&this.activeMenu.scrollTop(i+o-a+u))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var n=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(e,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(e),this._removeClass(r.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=r},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,n){var r;this.active&&(r="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),r&&r.length&&this.active||(r=this.activeMenu.find(this.options.items)[e]()),this.focus(n,r)},nextPage:function(e){var n,r,o;this.active?this.isLastItem()||(this._hasScroll()?(r=this.active.offset().top,o=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return(n=t(this)).offset().top-r-o<0}),this.focus(e,n)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())):this.next(e)},previousPage:function(e){var n,r,o;this.active?this.isFirstItem()||(this._hasScroll()?(r=this.active.offset().top,o=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return(n=t(this)).offset().top-r+o>0}),this.focus(e,n)):this.focus(e,this.activeMenu.find(this.options.items).first())):this.next(e)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,n)},_filterMenuItems:function(e){var n=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),r=new RegExp("^"+n,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return r.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))})}})})?r.apply(e,o):r)||(t.exports=i)},xAGQ:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},"xTJ+":function(t,e,n){"use strict";var r=n("HSsa"),o=Object.prototype.toString;function i(t){return"[object Array]"===o.call(t)}function a(t){return void 0===t}function u(t){return null!==t&&"object"==_typeof(t)}function s(t){return"[object Function]"===o.call(t)}function c(t,e){if(null!=t)if("object"!=_typeof(t)&&(t=[t]),i(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:i,isArrayBuffer:function(t){return"[object ArrayBuffer]"===o.call(t)},isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:u,isUndefined:a,isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:s,isStream:function(t){return u(t)&&s(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function t(){var e={};function n(n,r){"object"==_typeof(e[r])&&"object"==_typeof(n)?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==_typeof(e[r])&&"object"==_typeof(n)?e[r]=t(e[r],n):e[r]="object"==_typeof(n)?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},y6ec:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.fn.extend({uniqueId:(e=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}});var e})?r.apply(e,o):r)||(t.exports=i)},yK9s:function(t,e,n){"use strict";var r=n("xTJ+");t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},yLpj:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==("undefined"==typeof window?"undefined":_typeof(window))&&(n=window)}t.exports=n},yw1R:function(t,e,n){var r,o,i;o=[n("EVdn"),n("Qwlt")],void 0===(i="function"==typeof(r=function(t){return t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(n){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e}})?r.apply(e,o):r)||(t.exports=i)},zuR4:function(t,e,n){"use strict";var r=n("xTJ+"),o=n("HSsa"),i=n("CgaS"),a=n("SntB");function u(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var s=u(n("JEQr"));s.Axios=i,s.create=function(t){return u(a(s.defaults,t))},s.Cancel=n("endd"),s.CancelToken=n("jfS+"),s.isCancel=n("Lmem"),s.all=function(t){return Promise.all(t)},s.spread=n("DfZB"),t.exports=s,t.exports.default=s}}]);