alchemy_cms 6.0.14 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +0 -3
- data/.github/workflows/stale.yml +2 -0
- data/CHANGELOG.md +34 -5
- data/Gemfile +2 -2
- data/alchemy_cms.gemspec +2 -1
- data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +13 -11
- data/app/assets/stylesheets/alchemy/_variables.scss +9 -4
- data/app/assets/stylesheets/alchemy/elements.scss +96 -4
- data/app/assets/stylesheets/alchemy/forms.scss +59 -17
- data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +3 -3
- data/app/controllers/alchemy/admin/ingredients_controller.rb +1 -1
- data/app/controllers/alchemy/admin/pages_controller.rb +3 -3
- data/app/controllers/alchemy/api/ingredients_controller.rb +22 -0
- data/app/controllers/alchemy/messages_controller.rb +1 -1
- data/app/controllers/alchemy/pages_controller.rb +19 -5
- data/app/decorators/alchemy/ingredient_editor.rb +4 -0
- data/app/helpers/alchemy/elements_helper.rb +0 -8
- data/app/helpers/alchemy/url_helper.rb +0 -8
- data/app/models/alchemy/element/definitions.rb +16 -2
- data/app/models/alchemy/element/dom_id.rb +30 -0
- data/app/models/alchemy/element/presenters.rb +1 -1
- data/app/models/alchemy/element.rb +12 -3
- data/app/models/alchemy/ingredients/headline.rb +4 -1
- data/app/models/alchemy/ingredients/text.rb +3 -0
- data/app/models/alchemy/page/page_layouts.rb +128 -0
- data/app/models/alchemy/page.rb +4 -2
- data/app/models/alchemy/picture_thumb/create.rb +1 -1
- data/app/models/concerns/alchemy/dom_ids.rb +32 -0
- data/app/serializers/alchemy/ingredient_serializer.rb +11 -0
- data/app/views/alchemy/admin/elements/update.js.erb +3 -0
- data/app/views/alchemy/admin/ingredients/_dom_id_fields.html.erb +4 -0
- data/app/views/alchemy/admin/ingredients/_headline_fields.html.erb +3 -0
- data/app/views/alchemy/admin/ingredients/_text_fields.html.erb +3 -0
- data/app/views/alchemy/admin/ingredients/update.js.erb +7 -0
- data/app/views/alchemy/admin/languages/_form.html.erb +1 -1
- data/app/views/alchemy/admin/languages/_language.html.erb +1 -1
- data/app/views/alchemy/admin/pages/_page_layout_filter.html.erb +1 -1
- data/app/views/alchemy/admin/partials/_routes.html.erb +2 -1
- data/app/views/alchemy/ingredients/_headline_editor.html.erb +22 -20
- data/app/views/alchemy/ingredients/_headline_view.html.erb +1 -0
- data/app/views/alchemy/ingredients/_text_editor.html.erb +3 -0
- data/app/views/alchemy/ingredients/_text_view.html.erb +7 -3
- data/app/views/alchemy/ingredients/shared/_anchor.html.erb +9 -0
- data/app/views/alchemy/messages_mailer/contact_form_mail.de.text.erb +2 -0
- data/app/views/alchemy/messages_mailer/contact_form_mail.en.text.erb +2 -0
- data/app/views/alchemy/messages_mailer/contact_form_mail.es.text.erb +2 -0
- data/config/locales/alchemy.en.yml +5 -2
- data/config/routes.rb +1 -0
- data/lib/alchemy/error_tracking/error_logger.rb +13 -0
- data/lib/alchemy/error_tracking.rb +3 -1
- data/lib/alchemy/install/tasks.rb +1 -7
- data/lib/alchemy/page_layout.rb +0 -113
- data/lib/alchemy/test_support/shared_dom_ids_examples.rb +119 -0
- data/lib/alchemy/upgrader/tasks/add_page_versions.rb +2 -2
- data/lib/alchemy/upgrader/tasks/ingredients_migrator.rb +7 -5
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy.rb +4 -0
- data/lib/alchemy_cms.rb +1 -1
- data/lib/generators/alchemy/elements/templates/view.html.erb +1 -1
- data/lib/generators/alchemy/elements/templates/view.html.haml +1 -1
- data/lib/generators/alchemy/elements/templates/view.html.slim +1 -1
- data/lib/tasks/alchemy/thumbnails.rake +1 -1
- data/package/admin.js +2 -0
- data/package/src/ingredient_anchor_link.js +17 -0
- data/package.json +2 -2
- data/vendor/assets/javascripts/tinymce/tinymce.min.js +2 -2
- metadata +32 -6
- data/lib/non_stupid_digest_assets.rb +0 -55
@@ -1,2 +1,2 @@
|
|
1
|
-
// 4.
|
2
|
-
!function(){"use strict";var e,t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},q=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,arguments))}},H=function(e){return function(){return e}},j=function(e){return e},b=function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var a=new Array(arguments.length-1),n=1;n<arguments.length;n++)a[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=a.concat(n);return i.apply(null,o)}},y=H(!1),C=H(!0),x=y,w=C,N=function(){return E},E=(r={fold:function(e,t){return e()},is:x,isSome:x,isNone:w,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:N,ap:N,each:function(){},bind:N,flatten:N,exists:x,forall:w,filter:N,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:H("none()")},Object.freeze&&Object.freeze(r),r),S=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:w,isNone:x,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return S(e(n))},ap:function(e){return e.fold(N,function(e){return S(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:E},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(x,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},A={some:S,none:N,from:function(e){return null===e||e===undefined?E:S(e)}},T=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},k=T("string"),_=T("object"),R=T("array"),D=T("null"),B=T("boolean"),O=T("function"),P=T("number"),L=(o=Array.prototype.indexOf)===undefined?function(e,t){return X(e,t)}:function(e,t){return o.call(e,t)},I=function(e,t){return-1<L(e,t)},M=function(e,t){return K(e,t).isSome()},$=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},F=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},W=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o,e)?n:r).push(a)}return{pass:n,fail:r}},U=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},z=function(e,t,n){return F(e,function(e){n=t(n,e)}),n},V=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return A.some(o)}return A.none()},K=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return A.some(n);return A.none()},X=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},Y=Array.prototype.push,G=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);Y.apply(t,e[n])}return t}($(e,t))},J=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},Q=Array.prototype.slice,Z=function(e,t){return U(e,function(e){return!I(t,e)})},ee=function(e){return 0===e.length?A.none():A.some(e[0])},te=function(e){return 0===e.length?A.none():A.some(e[e.length-1])},ne=O(Array.from)?Array.from:function(e){return Q.call(e)},re="undefined"!=typeof window?window:Function("return this;")(),oe=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:re,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},ie={getOrDie:function(e,t){var n=oe(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n}},ae=function(){return ie.getOrDie("URL")},ue={createObjectURL:function(e){return ae().createObjectURL(e)},revokeObjectURL:function(e){ae().revokeObjectURL(e)}},se=navigator,ce=se.userAgent,le=function(e){return"matchMedia"in window&&matchMedia(e).matches};d=/Android/.test(ce),a=(a=!(i=/WebKit/.test(ce))&&/MSIE/gi.test(ce)&&/Explorer/gi.test(se.appName))&&/MSIE (\w+)\./.exec(ce)[1],u=-1!==ce.indexOf("Trident/")&&(-1!==ce.indexOf("rv:")||-1!==se.appName.indexOf("Netscape"))&&11,s=-1!==ce.indexOf("Edge/")&&!a&&!u&&12,a=a||u||s,c=!i&&!u&&/Gecko/.test(ce),l=-1!==ce.indexOf("Mac"),f=/(iPad|iPhone)/.test(ce),m="FormData"in window&&"FileReader"in window&&"URL"in window&&!!ue.createObjectURL,g=le("only screen and (max-device-width: 480px)")&&(d||f),p=le("only screen and (min-width: 800px)")&&(d||f),h=-1!==ce.indexOf("Windows Phone"),s&&(i=!1);var fe,de,me,ge,pe,he,ve,be,ye,Ce,xe,we,Ne,Ee,Se,Te,ke,Ae,_e,Re={opera:!1,webkit:i,ie:a,gecko:c,mac:l,iOS:f,android:d,contentEditable:!f||m||534<=parseInt(ce.match(/AppleWebKit\/(\d*)/)[1],10),transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==a,range:window.getSelection&&"Range"in window,documentMode:a&&!s?document.documentMode||7:10,fileApi:m,ceFalse:!1===a||8<a,cacheSuffix:null,container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===a||11<a,desktop:!g&&!p,windowsPhone:h},De=window.Promise?window.Promise:function(){function r(e,t){return function(){e.apply(t,arguments)}}var e=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=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,r(o,this),r(u,this))},t=i.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};function a(r){var o=this;null!==this._state?t(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void l(r(t,e),r(o,this),r(u,this))}this._state=!0,this._value=e,s.call(this)}catch(n){u.call(this,n)}}function u(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;e<t;e++)a.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function l(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}return i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(n,r){var o=this;return new i(function(e,t){a.call(o,new c(n,r,e,t))})},i.all=function(){var s=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i}(),Be=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},Oe=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},Pe=function(t,n){var r,e;return(e=function(){var e=arguments;clearTimeout(r),r=Be(function(){t.apply(this,e)},n)}).stop=function(){clearTimeout(r)},e},Le={requestAnimationFrame:function(e,t){fe?fe.then(e):fe=new De(function(e){t||(t=document.body),function(e,t){var n,r=window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(e){window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:Be,setInterval:Oe,setEditorTimeout:function(e,t,n){return Be(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=Oe(function(){e.removed?clearInterval(r):t()},n)},debounce:Pe,throttle:Pe,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},Ie=/^(?:mouse|contextmenu)|click/,Me={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},Fe=function(){return!1},Ue=function(){return!0},ze=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},Ve=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},qe=function(e,t){var n,r,o=t||{};for(n in e)Me[n]||(o[n]=e[n]);if(o.target||(o.target=o.srcElement||document),Re.experimentalShadowDom&&(o.target=function(e,t){if(e.composedPath){var n=e.composedPath();if(n&&0<n.length)return n[0]}return t}(e,o.target)),e&&Ie.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var i=o.target.ownerDocument||document,a=i.documentElement,u=i.body;o.pageX=e.clientX+(a&&a.scrollLeft||u&&u.scrollLeft||0)-(a&&a.clientLeft||u&&u.clientLeft||0),o.pageY=e.clientY+(a&&a.scrollTop||u&&u.scrollTop||0)-(a&&a.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=Ue,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=Ue,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},!(o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=Ue,o.stopPropagation()})==((r=o).isDefaultPrevented===Ue||r.isDefaultPrevented===Fe)&&(o.isDefaultPrevented=Fe,o.isPropagationStopped=Fe,o.isImmediatePropagationStopped=Fe),"undefined"==typeof o.metaKey&&(o.metaKey=!1),o},He=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){n.domLoaded||(n.domLoaded=!0,t(o))},u=function(){i()&&(Ve(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void Le.setTimeout(s)}a()};!r.addEventListener||Re.ie&&Re.ie<11?(ze(r,"readystatechange",u),r.documentElement.doScroll&&e.self===e.top&&s()):i()?a():ze(e,"DOMContentLoaded",a),ze(e,"load",a)}},je=function(){var m,g,p,h,v,b=this,y={};g="mce-data-"+(+new Date).toString(32),h="onmouseenter"in document.documentElement,p="onfocusin"in document.documentElement,v={mouseenter:"mouseover",mouseleave:"mouseout"},m=1,b.domLoaded=!1,b.events=y;var C=function(e,t){var n,r,o,i,a=y[t];if(n=a&&a[e.type])for(r=0,o=n.length;r<o;r++)if((i=n[r])&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return};b.bind=function(e,t,n,r){var o,i,a,u,s,c,l,f=window,d=function(e){C(qe(e||f.event),o)};if(e&&3!==e.nodeType&&8!==e.nodeType){for(e[g]?o=e[g]:(o=m++,e[g]=o,y[o]={}),r=r||e,a=(t=t.split(" ")).length;a--;)c=d,s=l=!1,"DOMContentLoaded"===(u=t[a])&&(u="ready"),b.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,qe({type:u})):(h||(s=v[u])&&(c=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=qe(e||f.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,C(e,o))}),p||"focusin"!==u&&"focusout"!==u||(l=!0,s="focusin"===u?"focus":"blur",c=function(e){(e=qe(e||f.event)).type="focus"===e.type?"focusin":"focusout",C(e,o)}),(i=y[o][u])?"ready"===u&&b.domLoaded?n({type:u}):i.push({func:n,scope:r}):(y[o][u]=i=[{func:n,scope:r}],i.fakeName=s,i.capture=l,i.nativeHandler=c,"ready"===u?He(e,c,b):ze(e,s||u,c,l)));return e=i=0,n}},b.unbind=function(e,t,n){var r,o,i,a,u,s;if(!e||3===e.nodeType||8===e.nodeType)return b;if(r=e[g]){if(s=y[r],t){for(i=(t=t.split(" ")).length;i--;)if(o=s[u=t[i]]){if(n)for(a=o.length;a--;)if(o[a].func===n){var c=o.nativeHandler,l=o.fakeName,f=o.capture;(o=o.slice(0,a).concat(o.slice(a+1))).nativeHandler=c,o.fakeName=l,o.capture=f,s[u]=o}n&&0!==o.length||(delete s[u],Ve(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in s)o=s[u],Ve(e,o.fakeName||u,o.nativeHandler,o.capture);s={}}for(u in s)return b;delete y[r];try{delete e[g]}catch(d){e[g]=null}}return b},b.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return b;for((n=qe(null,n)).type=t,n.target=e;(r=e[g])&&C(n,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!n.isPropagationStopped(););return b},b.clean=function(e){var t,n,r=b.unbind;if(!e||3===e.nodeType||8===e.nodeType)return b;if(e[g]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[g]&&r(e);return b},b.destroy=function(){y={}},b.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};je.Event=new je,je.Event.bind(window,"ready",function(){});var $e="sizzle"+-new Date,We=window.document,Ke=0,Xe=0,Ye=kt(),Ge=kt(),Je=kt(),Qe=function(e,t){return e===t&&(we=!0),0},Ze=typeof undefined,et={}.hasOwnProperty,tt=[],nt=tt.pop,rt=tt.push,ot=tt.push,it=tt.slice,at=tt.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},ut="[\\x20\\t\\r\\n\\f]",st="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ct="\\["+ut+"*("+st+")(?:"+ut+"*([*^$|!~]?=)"+ut+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+st+"))|)"+ut+"*\\]",lt=":("+st+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ct+")*)|.*)\\)|)",ft=new RegExp("^"+ut+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ut+"+$","g"),dt=new RegExp("^"+ut+"*,"+ut+"*"),mt=new RegExp("^"+ut+"*([>+~]|"+ut+")"+ut+"*"),gt=new RegExp("="+ut+"*([^\\]'\"]*?)"+ut+"*\\]","g"),pt=new RegExp(lt),ht=new RegExp("^"+st+"$"),vt={ID:new RegExp("^#("+st+")"),CLASS:new RegExp("^\\.("+st+")"),TAG:new RegExp("^("+st+"|[*])"),ATTR:new RegExp("^"+ct),PSEUDO:new RegExp("^"+lt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ut+"*(even|odd|(([+-]|)(\\d*)n|)"+ut+"*(?:([+-]|)"+ut+"*(\\d+)|))"+ut+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+ut+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ut+"*((?:-\\d)?\\d*)"+ut+"*\\)|)(?=[^-]|$)","i")},bt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,Ct=/^[^{]+\{\s*\[native \w/,xt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,wt=/[+~]/,Nt=/'|\\/g,Et=new RegExp("\\\\([\\da-f]{1,6}"+ut+"?|("+ut+")|.)","ig"),St=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{ot.apply(tt=it.call(We.childNodes),We.childNodes),tt[We.childNodes.length].nodeType}catch(nN){ot={apply:tt.length?function(e,t){rt.apply(e,it.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var Tt=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:We)!==Ee&&Ne(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Ee).nodeType)&&9!==u)return[];if(Te&&!r){if(o=xt.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&_e(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return ot.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&me.getElementsByClassName)return ot.apply(n,t.getElementsByClassName(a)),n}if(me.qsa&&(!ke||!ke.test(e))){if(f=l=$e,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=ve(e),(l=t.getAttribute("id"))?f=l.replace(Nt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Lt(c[s]);d=wt.test(e)&&Ot(t.parentNode)||t,m=c.join(",")}if(m)try{return ot.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||t.removeAttribute("id")}}}return ye(e.replace(ft,"$1"),t,n,r)};function kt(){var r=[];return function e(t,n){return r.push(t+" ")>ge.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function At(e){return e[$e]=!0,e}function _t(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function Rt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Dt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function Bt(a){return At(function(i){return i=+i,At(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function Ot(e){return e&&typeof e.getElementsByTagName!==Ze&&e}for(de in me=Tt.support={},he=Tt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Ne=Tt.setDocument=function(e){var t,s=e?e.ownerDocument||e:We,n=s.defaultView;return s!==Ee&&9===s.nodeType&&s.documentElement?(Se=(Ee=s).documentElement,Te=!he(s),n&&n!==function(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){Ne()},!1):n.attachEvent&&n.attachEvent("onunload",function(){Ne()})),me.attributes=!0,me.getElementsByTagName=!0,me.getElementsByClassName=Ct.test(s.getElementsByClassName),me.getById=!0,ge.find.ID=function(e,t){if(typeof t.getElementById!==Ze&&Te){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},ge.filter.ID=function(e){var t=e.replace(Et,St);return function(e){return e.getAttribute("id")===t}},ge.find.TAG=me.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Ze)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},ge.find.CLASS=me.getElementsByClassName&&function(e,t){if(Te)return t.getElementsByClassName(e)},Ae=[],ke=[],me.disconnectedMatch=!0,ke=ke.length&&new RegExp(ke.join("|")),Ae=Ae.length&&new RegExp(Ae.join("|")),t=Ct.test(Se.compareDocumentPosition),_e=t||Ct.test(Se.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Qe=t?function(e,t){if(e===t)return we=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!me.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===We&&_e(We,e)?-1:t===s||t.ownerDocument===We&&_e(We,t)?1:xe?at.call(xe,e)-at.call(xe,t):0:4&n?-1:1)}:function(e,t){if(e===t)return we=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:xe?at.call(xe,e)-at.call(xe,t):0;if(o===i)return _t(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?_t(a[r],u[r]):a[r]===We?-1:u[r]===We?1:0},s):Ee},Tt.matches=function(e,t){return Tt(e,null,null,t)},Tt.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Ee&&Ne(e),t=t.replace(gt,"='$1']"),me.matchesSelector&&Te&&(!Ae||!Ae.test(t))&&(!ke||!ke.test(t)))try{var n=(void 0).call(e,t);if(n||me.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(nN){}return 0<Tt(t,Ee,null,[e]).length},Tt.contains=function(e,t){return(e.ownerDocument||e)!==Ee&&Ne(e),_e(e,t)},Tt.attr=function(e,t){(e.ownerDocument||e)!==Ee&&Ne(e);var n=ge.attrHandle[t.toLowerCase()],r=n&&et.call(ge.attrHandle,t.toLowerCase())?n(e,t,!Te):undefined;return r!==undefined?r:me.attributes||!Te?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},Tt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},Tt.uniqueSort=function(e){var t,n=[],r=0,o=0;if(we=!me.detectDuplicates,xe=!me.sortStable&&e.slice(0),e.sort(Qe),we){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return xe=null,e},pe=Tt.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=pe(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=pe(t);return n},(ge=Tt.selectors={cacheLength:50,createPseudo:At,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Et,St),e[3]=(e[3]||e[4]||e[5]||"").replace(Et,St),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Tt.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Tt.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return vt.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pt.test(n)&&(t=ve(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Et,St).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Ye[e+" "];return t||(t=new RegExp("(^|"+ut+")"+e+"("+ut+"|$)"))&&Ye(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Ze&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=Tt.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1<t.indexOf(o):"$="===r?o&&t.slice(-o.length)===o:"~="===r?-1<(" "+t+" ").indexOf(o):"|="===r&&(t===o||t.slice(0,o.length+1)===o+"-"))}},CHILD:function(m,e,t,g,p){var h="nth"!==m.slice(0,3),v="last"!==m.slice(-4),b="of-type"===e;return 1===g&&0===p?function(e){return!!e.parentNode}:function(e,t,n){var r,o,i,a,u,s,c=h!==v?"nextSibling":"previousSibling",l=e.parentNode,f=b&&e.nodeName.toLowerCase(),d=!n&&!b;if(l){if(h){for(;c;){for(i=e;i=i[c];)if(b?i.nodeName.toLowerCase()===f:1===i.nodeType)return!1;s=c="only"===m&&!s&&"nextSibling"}return!0}if(s=[v?l.firstChild:l.lastChild],v&&d){for(u=(r=(o=l[$e]||(l[$e]={}))[m]||[])[0]===Ke&&r[1],a=r[0]===Ke&&r[2],i=u&&l.childNodes[u];i=++u&&i&&i[c]||(a=u=0)||s.pop();)if(1===i.nodeType&&++a&&i===e){o[m]=[Ke,u,a];break}}else if(d&&(r=(e[$e]||(e[$e]={}))[m])&&r[0]===Ke)a=r[1];else for(;(i=++u&&i&&i[c]||(a=u=0)||s.pop())&&((b?i.nodeName.toLowerCase()!==f:1!==i.nodeType)||!++a||(d&&((i[$e]||(i[$e]={}))[m]=[Ke,a]),i!==e)););return(a-=p)===g||a%g==0&&0<=a/g}}},PSEUDO:function(e,i){var t,a=ge.pseudos[e]||ge.setFilters[e.toLowerCase()]||Tt.error("unsupported pseudo: "+e);return a[$e]?a(i):1<a.length?(t=[e,e,"",i],ge.setFilters.hasOwnProperty(e.toLowerCase())?At(function(e,t){for(var n,r=a(e,i),o=r.length;o--;)e[n=at.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:At(function(e){var r=[],o=[],u=be(e.replace(ft,"$1"));return u[$e]?At(function(e,t,n,r){for(var o,i=u(e,null,r,[]),a=e.length;a--;)(o=i[a])&&(e[a]=!(t[a]=o))}):function(e,t,n){return r[0]=e,u(r,null,n,o),!o.pop()}}),has:At(function(t){return function(e){return 0<Tt(t,e).length}}),contains:At(function(t){return t=t.replace(Et,St),function(e){return-1<(e.textContent||e.innerText||pe(e)).indexOf(t)}}),lang:At(function(n){return ht.test(n||"")||Tt.error("unsupported lang: "+n),n=n.replace(Et,St).toLowerCase(),function(e){var t;do{if(t=Te?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===Se},focus:function(e){return e===Ee.activeElement&&(!Ee.hasFocus||Ee.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!ge.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return bt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:Bt(function(){return[0]}),last:Bt(function(e,t){return[t-1]}),eq:Bt(function(e,t,n){return[n<0?n+t:n]}),even:Bt(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:Bt(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:Bt(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:Bt(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=ge.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})ge.pseudos[de]=Rt(de);for(de in{submit:!0,reset:!0})ge.pseudos[de]=Dt(de);function Pt(){}function Lt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function It(a,e,t){var u=e.dir,s=t&&"parentNode"===u,c=Xe++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||s)return a(e,t,n)}:function(e,t,n){var r,o,i=[Ke,c];if(n){for(;e=e[u];)if((1===e.nodeType||s)&&a(e,t,n))return!0}else for(;e=e[u];)if(1===e.nodeType||s){if((r=(o=e[$e]||(e[$e]={}))[u])&&r[0]===Ke&&r[1]===c)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function Mt(o){return 1<o.length?function(e,t,n){for(var r=o.length;r--;)if(!o[r](e,t,n))return!1;return!0}:o[0]}function Ft(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function Ut(m,g,p,h,v,e){return h&&!h[$e]&&(h=Ut(h)),v&&!v[$e]&&(v=Ut(v,e)),At(function(e,t,n,r){var o,i,a,u=[],s=[],c=t.length,l=e||function(e,t,n){for(var r=0,o=t.length;r<o;r++)Tt(e,t[r],n);return n}(g||"*",n.nodeType?[n]:n,[]),f=!m||!e&&g?l:Ft(l,u,m,n,r),d=p?v||(e?m:c||h)?[]:t:f;if(p&&p(f,d,n,r),h)for(o=Ft(d,s),h(o,[],n,r),i=o.length;i--;)(a=o[i])&&(d[s[i]]=!(f[s[i]]=a));if(e){if(v||m){if(v){for(o=[],i=d.length;i--;)(a=d[i])&&o.push(f[i]=a);v(null,d=[],o,r)}for(i=d.length;i--;)(a=d[i])&&-1<(o=v?at.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=Ft(d===t?d.splice(c,d.length):d),v?v(null,t,d,r):ot.apply(t,d)})}function zt(e){for(var r,t,n,o=e.length,i=ge.relative[e[0].type],a=i||ge.relative[" "],u=i?1:0,s=It(function(e){return e===r},a,!0),c=It(function(e){return-1<at.call(r,e)},a,!0),l=[function(e,t,n){return!i&&(n||t!==Ce)||((r=t).nodeType?s(e,t,n):c(e,t,n))}];u<o;u++)if(t=ge.relative[e[u].type])l=[It(Mt(l),t)];else{if((t=ge.filter[e[u].type].apply(null,e[u].matches))[$e]){for(n=++u;n<o&&!ge.relative[e[n].type];n++);return Ut(1<u&&Mt(l),1<u&&Lt(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(ft,"$1"),t,u<n&&zt(e.slice(u,n)),n<o&&zt(e=e.slice(n)),n<o&&Lt(e))}l.push(t)}return Mt(l)}Pt.prototype=ge.filters=ge.pseudos,ge.setFilters=new Pt,ve=Tt.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Ge[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=ge.preFilter;a;){for(i in n&&!(r=dt.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=mt.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(ft," ")}),a=a.slice(n.length)),ge.filter)!(r=vt[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 t?a.length:a?Tt.error(e):Ge(e,u).slice(0)},be=Tt.compile=function(e,t){var n,h,v,b,y,r,o=[],i=[],a=Je[e+" "];if(!a){for(t||(t=ve(e)),n=t.length;n--;)(a=zt(t[n]))[$e]?o.push(a):i.push(a);(a=Je(e,(h=i,b=0<(v=o).length,y=0<h.length,r=function(e,t,n,r,o){var i,a,u,s=0,c="0",l=e&&[],f=[],d=Ce,m=e||y&&ge.find.TAG("*",o),g=Ke+=null==d?1:Math.random()||.1,p=m.length;for(o&&(Ce=t!==Ee&&t);c!==p&&null!=(i=m[c]);c++){if(y&&i){for(a=0;u=h[a++];)if(u(i,t,n)){r.push(i);break}o&&(Ke=g)}b&&((i=!u&&i)&&s--,e&&l.push(i))}if(s+=c,b&&c!==s){for(a=0;u=v[a++];)u(l,f,t,n);if(e){if(0<s)for(;c--;)l[c]||f[c]||(f[c]=nt.call(r));f=Ft(f)}ot.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&Tt.uniqueSort(r)}return o&&(Ke=g,Ce=d),l},b?At(r):r))).selector=e}return a},ye=Tt.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&ve(e=c.selector||e);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&me.getById&&9===t.nodeType&&Te&&ge.relative[i[1].type]){if(!(t=(ge.find.ID(a.matches[0].replace(Et,St),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=vt.needsContext.test(e)?0:i.length;o--&&(a=i[o],!ge.relative[u=a.type]);)if((s=ge.find[u])&&(r=s(a.matches[0].replace(Et,St),wt.test(i[0].type)&&Ot(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&Lt(i)))return ot.apply(n,r),n;break}}return(c||be(e,l))(r,t,!Te,n,wt.test(e)&&Ot(t.parentNode)||t),n},me.sortStable=$e.split("").sort(Qe).join("")===$e,me.detectDuplicates=!!we,Ne(),me.sortDetached=!0;var Vt=Array.isArray,qt=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,e.length!==undefined){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},Ht=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},jt={isArray:Vt,toArray:function(e){var t,n,r=e;if(!Vt(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:qt,map:function(n,r){var o=[];return qt(n,function(e,t){o.push(r(e,t,n))}),o},filter:function(n,r){var o=[];return qt(n,function(e,t){r&&!r(e,t,n)||o.push(e)}),o},indexOf:function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},findIndex:Ht,find:function(e,t,n){var r=Ht(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},$t=/^\s*|\s*$/g,Wt=function(e){return null===e||e===undefined?"":(""+e).replace($t,"")},Kt=function(e,t){return t?!("array"!==t||!jt.isArray(e))||typeof e===t:e!==undefined},Xt=function(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),jt.each(e,function(e,t){if(!1===n.call(o,e,t,r))return!1;Xt(e,n,r,o)}))},Yt={trim:Wt,isArray:jt.isArray,is:Kt,toArray:jt.toArray,makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:jt.each,map:jt.map,grep:jt.filter,inArray:jt.indexOf,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n,r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var u,s=arguments;for(n=1,r=s.length;n<r;n++)for(o in t=s[n])t.hasOwnProperty(o)&&(u=t[o])!==undefined&&(e[o]=u);return e},create:function(e,t,n){var r,o,i,a,u,s=this,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],!(o=s.createNS(e[3].replace(/\.\w+$/,""),n))[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},c=1),o[i]=t[i],s.extend(o[i].prototype,t),e[5]&&(r=s.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],u=o[i],o[i]=c?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],u.apply(this,arguments)},o[i].prototype[i]=o[i],s.each(r,function(e,t){o[i].prototype[t]=r[t]}),s.each(t,function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==i&&(o[i].prototype[t]=e)})),s.each(t["static"],function(e,t){o[i][t]=e})}},walk:Xt,createNS:function(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Kt(e,"array")?e:jt.map(e.split(t||","),Wt)},_addCacheSuffix:function(e){var t=Re.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Gt=document,Jt=Array.prototype.push,Qt=Array.prototype.slice,Zt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,en=je.Event,tn=Yt.makeMap("children,contents,next,prev"),nn=function(e){return void 0!==e},rn=function(e){return"string"==typeof e},on=function(e,t){var n,r,o;for(o=(t=t||Gt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},an=function(e,t,n,r){var o;if(rn(t))t=on(t,Cn(e[0]));else if(t.length&&!t.nodeType){if(t=pn.makeArray(t),r)for(o=t.length-1;0<=o;o--)an(e,t[o],n,r);else for(o=0;o<t.length;o++)an(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},un=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},sn=function(e,t,n){var r,o;return t=pn(t)[0],e.each(function(){var e=this;n&&r===e.parentNode||(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e)),o.appendChild(e)}),e},cn=Yt.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),ln=Yt.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),fn={"for":"htmlFor","class":"className",readonly:"readOnly"},dn={"float":"cssFloat"},mn={},gn={},pn=function(e,t){return new pn.fn.init(e,t)},hn=/^\s*|\s*$/g,vn=function(e){return null===e||e===undefined?"":(""+e).replace(hn,"")},bn=function(e,t){var n,r,o,i;if(e)if((n=e.length)===undefined){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},yn=function(e,n){var r=[];return bn(e,function(e,t){n(t,e)&&r.push(t)}),r},Cn=function(e){return e?9===e.nodeType?e:e.ownerDocument:Gt};pn.fn=pn.prototype={constructor:pn,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return pn(e).attr(t);o.context=t=document}if(rn(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Zt.exec(e)))return pn(t).find(e);if(n[1])for(r=on(e,Cn(t)).firstChild;r;)Jt.call(o,r),r=r.nextSibling;else{if(!(r=Cn(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Yt.toArray(this)},add:function(e,t){var n,r,o=this;if(rn(e))return o.add(pn(e));if(!1!==t)for(n=pn.unique(o.toArray().concat(pn.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Jt.apply(o,pn.makeArray(e));return o},attr:function(t,n){var e,r=this;if("object"==typeof t)bn(t,function(e,t){r.attr(e,t)});else{if(!nn(n)){if(r[0]&&1===r[0].nodeType){if((e=mn[t])&&e.get)return e.get(r[0],t);if(ln[t])return r.prop(t)?t:undefined;null===(n=r[0].getAttribute(t,2))&&(n=undefined)}return n}this.each(function(){var e;if(1===this.nodeType){if((e=mn[t])&&e.set)return void e.set(this,n);null===n?this.removeAttribute(t,2):this.setAttribute(t,n,2)}})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=fn[e]||e))bn(e,function(e,t){n.prop(e,t)});else{if(!nn(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(n,r){var e,o,i=this,t=function(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})},a=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})};if("object"==typeof n)bn(n,function(e,t){i.css(e,t)});else if(nn(r))n=t(n),"number"!=typeof r||cn[n]||(r=r.toString()+"px"),i.each(function(){var e=this.style;if((o=gn[n])&&o.set)o.set(this,r);else{try{this.style[dn[n]||n]=r}catch(t){}null!==r&&""!==r||(e.removeProperty?e.removeProperty(a(n)):e.removeAttribute(n))}});else{if(e=i[0],(o=gn[n])&&o.get)return o.get(e);if(!e.ownerDocument.defaultView)return e.currentStyle?e.currentStyle[t(n)]:"";try{return e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(a(n))}catch(u){return undefined}}return i},remove:function(){for(var e,t=this.length;t--;)e=this[t],en.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(nn(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){pn(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(nn(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return an(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return an(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?an(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?an(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return pn(e).append(this),this},prependTo:function(e){return pn(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return sn(this,e)},wrapAll:function(e){return sn(this,e,!0)},wrapInner:function(e){return this.each(function(){pn(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){pn(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),pn(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(o,i){var e=this;return"string"!=typeof o||(-1!==o.indexOf(" ")?bn(o.split(" "),function(){e.toggleClass(this,i)}):e.each(function(e,t){var n,r;(r=un(t,o))!==i&&(n=t.className,r?t.className=vn((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return un(this[0],e)},each:function(e){return bn(this,e)},on:function(e,t){return this.each(function(){en.bind(this,e,t)})},off:function(e,t){return this.each(function(){en.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?en.fire(this,e.type,e):en.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new pn(Qt.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)pn.find(e,this[t],r);return pn(r)},filter:function(n){return pn("function"==typeof n?yn(this.toArray(),function(e,t){return n(t,e)}):pn.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof pn&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&pn(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),pn(r)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Jt,sort:[].sort,splice:[].splice},Yt.extend(pn,{extend:Yt.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:Yt.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:Yt.isArray,each:bn,trim:vn,grep:yn,find:Tt,expr:Tt.selectors,unique:Tt.uniqueSort,text:Tt.getText,contains:Tt.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?pn.find.matchesSelector(t[0],e)?[t[0]]:[]:pn.find.matches(e,t)}});var xn=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof pn&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&pn(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},wn=function(e,t,n,r){var o=[];for(r instanceof pn&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&pn(e).is(r))break}o.push(e)}return o},Nn=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};bn({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xn(e,"parentNode")},next:function(e){return Nn(e,"nextSibling",1)},prev:function(e){return Nn(e,"previousSibling",1)},children:function(e){return wn(e.firstChild,"nextSibling",1)},contents:function(e){return Yt.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,r){pn.fn[e]=function(t){var n=[];return this.each(function(){var e=r.call(n,this,t,n);e&&(pn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(tn[e]||(n=pn.unique(n)),0===e.indexOf("parents")&&(n=n.reverse())),n=pn(n),t?n.filter(t):n}}),bn({parentsUntil:function(e,t){return xn(e,"parentNode",t)},nextUntil:function(e,t){return wn(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return wn(e,"previousSibling",1,t).slice(1)}},function(r,o){pn.fn[r]=function(t,e){var n=[];return this.each(function(){var e=o.call(n,this,t,n);e&&(pn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(n=pn.unique(n),0!==r.indexOf("parents")&&"prevUntil"!==r||(n=n.reverse())),n=pn(n),e?n.filter(e):n}}),pn.fn.is=function(e){return!!e&&0<this.filter(e).length},pn.fn.init.prototype=pn.fn,pn.overrideDefaults=function(n){var r,o=function(e,t){return r=r||n(),0===arguments.length&&(e=r.element),t||(t=r.context),new o.fn.init(e,t)};return pn.extend(o,this),o};var En=function(n,r,e){bn(e,function(e,t){n[e]=n[e]||{},n[e][r]=t})};Re.ie&&Re.ie<8&&(En(mn,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?undefined:t},size:function(e){var t=e.size;return 20===t?undefined:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?undefined:t}}),En(mn,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),Re.ie&&Re.ie<9&&(dn["float"]="styleFloat",En(gn,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),pn.attrHooks=mn,pn.cssHooks=gn;var Sn=function(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}},Tn=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return An(r(1),r(2))},kn=function(){return An(0,0)},An=function(e,t){return{major:e,minor:t}},_n={nu:An,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?kn():Tn(e,n)},unknown:kn},Rn="Firefox",Dn=function(e,t){return function(){return t===e}},Bn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Dn("Edge",t),isChrome:Dn("Chrome",t),isIE:Dn("IE",t),isOpera:Dn("Opera",t),isFirefox:Dn(Rn,t),isSafari:Dn("Safari",t)}},On={unknown:function(){return Bn({current:undefined,version:_n.unknown()})},nu:Bn,edge:H("Edge"),chrome:H("Chrome"),ie:H("IE"),opera:H("Opera"),firefox:H(Rn),safari:H("Safari")},Pn="Windows",Ln="Android",In="Solaris",Mn="FreeBSD",Fn=function(e,t){return function(){return t===e}},Un=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Fn(Pn,t),isiOS:Fn("iOS",t),isAndroid:Fn(Ln,t),isOSX:Fn("OSX",t),isLinux:Fn("Linux",t),isSolaris:Fn(In,t),isFreeBSD:Fn(Mn,t)}},zn={unknown:function(){return Un({current:undefined,version:_n.unknown()})},nu:Un,windows:H(Pn),ios:H("iOS"),android:H(Ln),linux:H("Linux"),osx:H("OSX"),solaris:H(In),freebsd:H(Mn)},Vn=function(e,t){var n=String(t).toLowerCase();return V(e,function(e){return e.search(n)})},qn=function(e,n){return Vn(e,n).map(function(e){var t=_n.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Hn=function(e,n){return Vn(e,n).map(function(e){var t=_n.detect(e.versionRegexes,n);return{current:e.name,version:t}})},jn=function(e,t){return-1!==e.indexOf(t)},$n=function(e){return e.replace(/^\s+|\s+$/g,"")},Wn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Kn=function(t){return function(e){return jn(e,t)}},Xn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return jn(e,"edge/")&&jn(e,"chrome")&&jn(e,"safari")&&jn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Wn],search:function(e){return jn(e,"chrome")&&!jn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return jn(e,"msie")||jn(e,"trident")}},{name:"Opera",versionRegexes:[Wn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Kn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Kn("firefox")},{name:"Safari",versionRegexes:[Wn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(jn(e,"safari")||jn(e,"mobile/"))&&jn(e,"applewebkit")}}],Yn=[{name:"Windows",search:Kn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return jn(e,"iphone")||jn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Kn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Kn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Kn("linux"),versionRegexes:[]},{name:"Solaris",search:Kn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Kn("freebsd"),versionRegexes:[]}],Gn={browsers:H(Xn),oses:H(Yn)},Jn=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=Gn.browsers(),m=Gn.oses(),g=qn(d,e).fold(On.unknown,On.nu),p=Hn(m,e).fold(zn.unknown,zn.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,a=t.isAndroid()&&3===t.version.major,u=t.isAndroid()&&4===t.version.major,s=o||a||u&&!0===/mobile/i.test(r),c=t.isiOS()||t.isAndroid(),l=c&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:H(o),isiPhone:H(i),isTablet:H(s),isPhone:H(l),isTouch:H(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:H(f)})}},Qn={detect:Sn(function(){var e=navigator.userAgent;return Jn(e)})},Zn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:H(e)}},er={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return Zn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return Zn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return Zn(n)},fromDom:Zn,fromPoint:function(e,t,n){var r=e.dom();return A.from(r.elementFromPoint(t,n)).map(Zn)}},tr={ATTRIBUTE:Node.ATTRIBUTE_NODE,CDATA_SECTION:Node.CDATA_SECTION_NODE,COMMENT:Node.COMMENT_NODE,DOCUMENT:Node.DOCUMENT_NODE,DOCUMENT_TYPE:Node.DOCUMENT_TYPE_NODE,DOCUMENT_FRAGMENT:Node.DOCUMENT_FRAGMENT_NODE,ELEMENT:Node.ELEMENT_NODE,TEXT:Node.TEXT_NODE,PROCESSING_INSTRUCTION:Node.PROCESSING_INSTRUCTION_NODE,ENTITY_REFERENCE:Node.ENTITY_REFERENCE_NODE,ENTITY:Node.ENTITY_NODE,NOTATION:Node.NOTATION_NODE},nr=function(e){return e.dom().nodeName.toLowerCase()},rr=function(e){return e.dom().nodeType},or=function(t){return function(e){return rr(e)===t}},ir=or(tr.ELEMENT),ar=or(tr.TEXT),ur=or(tr.DOCUMENT),sr={name:nr,type:rr,value:function(e){return e.dom().nodeValue},isElement:ir,isText:ar,isDocument:ur,isComment:function(e){return rr(e)===tr.COMMENT||"#comment"===nr(e)}},cr=Object.keys,lr=function(e,t){for(var n=cr(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},fr=function(r,o){var i={};return lr(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},dr=function(e,t,n){if(!(k(n)||B(n)||P(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},mr=function(e,t,n){dr(e.dom(),t,n)},gr=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},pr=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},hr={clone:function(e){return z(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},set:mr,setAll:function(e,t){var n=e.dom();lr(t,function(e,t){dr(n,t,e)})},get:gr,has:pr,remove:function(e,t){e.dom().removeAttribute(t)},hasNone:function(e){var t=e.dom().attributes;return t===undefined||null===t||0===t.length},transfer:function(o,i,e){sr.isElement(o)&&sr.isElement(i)&&F(e,function(e){var t,n,r;n=i,pr(t=o,r=e)&&!pr(n,r)&&mr(n,r,gr(t,r))})}},vr=Sn(function(){return br(er.fromDom(document))}),br=function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return er.fromDom(t)},yr={body:vr,getBody:br,inBody:function(e){var t=sr.isText(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}},Cr=function(e){return e.style!==undefined},xr=function(e,t,n){if(!k(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Cr(e)&&e.style.setProperty(t,n)},wr=function(e,t){return Cr(e)?e.style.getPropertyValue(t):""},Nr=function(e,t){var n=e.dom(),r=wr(n,t);return A.from(r).filter(function(e){return 0<e.length})},Er=function(e,t){var n=e.dom();lr(t,function(e,t){xr(n,t,e)})},Sr=function(e,t){var n=e.dom(),r=window.getComputedStyle(n).getPropertyValue(t),o=""!==r||yr.inBody(e)?r:wr(n,t);return null===o?undefined:o},Tr=Nr,kr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return F(t,function(e,t){r[e]=H(n[t])}),r}},Ar=function(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n},_r=function(){return ie.getOrDie("Node")},Rr=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},Dr=function(e,t){return Rr(e,t,_r().DOCUMENT_POSITION_CONTAINED_BY)},Br=tr.ELEMENT,Or=tr.DOCUMENT,Pr=function(e){return e.nodeType!==Br&&e.nodeType!==Or||0===e.childElementCount},Lr={all:function(e,t){var n=t===undefined?document:t.dom();return Pr(n)?[]:$(n.querySelectorAll(e),er.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==Br)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return Pr(n)?A.none():A.from(n.querySelector(e)).map(er.fromDom)}},Ir=function(e,t){return e.dom()===t.dom()},Mr=Qn.detect().browser.isIE()?function(e,t){return Dr(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Fr={eq:Ir,isEqualNode:function(e,t){return e.dom().isEqualNode(t.dom())},member:function(e,t){return M(t,b(Ir,e))},contains:Mr,is:Lr.is},Ur=function(e){var t=e.dom();return A.from(t.parentNode).map(er.fromDom)},zr=function(e){var t=e.dom();return A.from(t.previousSibling).map(er.fromDom)},Vr=function(e){var t=e.dom();return A.from(t.nextSibling).map(er.fromDom)},qr=function(e){var t=e.dom();return $(t.childNodes,er.fromDom)},Hr=function(e,t){var n=e.dom().childNodes;return A.from(n[t]).map(er.fromDom)},jr=kr("element","offset"),$r={owner:function(e){return er.fromDom(e.dom().ownerDocument)},defaultView:function(e){var t=e.dom().ownerDocument.defaultView;return er.fromDom(t)},documentElement:function(e){return er.fromDom(e.dom().ownerDocument.documentElement)},parent:Ur,findIndex:function(n){return Ur(n).bind(function(e){var t=qr(e);return K(t,function(e){return Fr.eq(n,e)})})},parents:function(e,t){for(var n=O(t)?t:H(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=er.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o},siblings:function(t){return Ur(t).map(qr).map(function(e){return U(e,function(e){return!Fr.eq(t,e)})}).getOr([])},prevSibling:zr,offsetParent:function(e){var t=e.dom();return A.from(t.offsetParent).map(er.fromDom)},prevSiblings:function(e){return t=Ar(e,zr),(n=Q.call(t,0)).reverse(),n;var t,n},nextSibling:Vr,nextSiblings:function(e){return Ar(e,Vr)},children:qr,child:Hr,firstChild:function(e){return Hr(e,0)},lastChild:function(e){return Hr(e,e.dom().childNodes.length-1)},childNodesCount:function(e){return e.dom().childNodes.length},hasChildNodes:function(e){return e.dom().hasChildNodes()},leaf:function(e,t){var n=qr(e);return 0<n.length&&t<n.length?jr(n[t],0):jr(e,t)}},Wr=Qn.detect().browser,Kr=function(e){return V(e,sr.isElement)},Xr={getPos:function(e,t,n){var r,o,i,a=0,u=0,s=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===Sr(er.fromDom(e),"position"))return{x:a=(o=t.getBoundingClientRect()).left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,y:u=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType;)a+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType;)a-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=(i=er.fromDom(t),Wr.isFirefox()&&"table"===sr.name(i)?Kr($r.children(i)).filter(function(e){return"caption"===sr.name(e)}).bind(function(o){return Kr($r.nextSiblings(o)).map(function(e){var t=e.dom().offsetTop,n=o.dom().offsetTop,r=o.dom().offsetHeight;return t<=n?-r:0})}).getOr(0):0)}return{x:a,y:u}}},Yr=function(e){var n=A.none(),t=[],r=function(e){o()?a(e):t.push(e)},o=function(){return n.isSome()},i=function(e){F(e,a)},a=function(t){n.each(function(e){setTimeout(function(){t(e)},0)})};return e(function(e){n=A.some(e),i(t),t=[]}),{get:r,map:function(n){return Yr(function(t){r(function(e){t(n(e))})})},isReady:o}},Gr={nu:Yr,pure:function(t){return Yr(function(e){e(t)})}},Jr=function(t){var e=function(e){var r;t((r=e,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this;setTimeout(function(){r.apply(n,e)},0)}))},n=function(){return Gr.nu(e)};return{map:function(r){return Jr(function(n){e(function(e){var t=r(e);n(t)})})},bind:function(n){return Jr(function(t){e(function(e){n(e).get(t)})})},anonBind:function(n){return Jr(function(t){e(function(e){n.get(t)})})},toLazy:n,toCached:function(){var t=null;return Jr(function(e){null===t&&(t=n()),t.get(e)})},get:e}},Qr={nu:Jr,pure:function(t){return Jr(function(e){e(t)})}},Zr=function(a,e){return e(function(r){var o=[],i=0;0===a.length?r([]):F(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})})},eo=function(e){return Zr(e,Qr.nu)},to=function(n){return{is:function(e){return n===e},isValue:C,isError:y,getOr:H(n),getOrThunk:H(n),getOrDie:H(n),or:function(e){return to(n)},orThunk:function(e){return to(n)},fold:function(e,t){return t(n)},map:function(e){return to(e(n))},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return A.some(n)}}},no=function(n){return{is:y,isValue:y,isError:C,getOr:j,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return no(n)},each:v,bind:function(e){return no(n)},exists:y,forall:C,toOption:A.none}},ro={value:to,error:no};function oo(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"lastChild","previousSibling",e)}}var io,ao,uo,so=function(t){var n;return function(e){return(n=n||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(t,H(!0))).hasOwnProperty(sr.name(e))}},co=so(["h1","h2","h3","h4","h5","h6"]),lo=so(["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"]),fo=function(e){return sr.isElement(e)&&!lo(e)},mo=function(e){return sr.isElement(e)&&"br"===sr.name(e)},go=so(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),po=so(["ul","ol","dl"]),ho=so(["li","dd","dt"]),vo=so(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),bo=so(["thead","tbody","tfoot"]),yo=so(["td","th"]),Co=so(["pre","script","textarea","style"]),xo=function(t){return function(e){return!!e&&e.nodeType===t}},wo=xo(1),No=function(e){var r=e.toLowerCase().split(" ");return function(e){var t,n;if(e&&e.nodeType)for(n=e.nodeName.toLowerCase(),t=0;t<r.length;t++)if(n===r[t])return!0;return!1}},Eo=function(t){return function(e){if(wo(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},So=xo(3),To=xo(8),ko=xo(9),Ao=No("br"),_o=Eo("true"),Ro=Eo("false"),Do={isText:So,isElement:wo,isComment:To,isDocument:ko,isBr:Ao,isContentEditableTrue:_o,isContentEditableFalse:Ro,matchNodeNames:No,hasPropValue:function(t,n){return function(e){return wo(e)&&e[t]===n}},hasAttribute:function(t,e){return function(e){return wo(e)&&e.hasAttribute(t)}},hasAttributeValue:function(t,n){return function(e){return wo(e)&&e.getAttribute(t)===n}},matchStyleValues:function(r,e){var o=e.toLowerCase().split(" ");return function(e){var t;if(wo(e))for(t=0;t<o.length;t++){var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if((n?n.getPropertyValue(r):null)===o[t])return!0}return!1}},isBogus:function(e){return wo(e)&&e.hasAttribute("data-mce-bogus")},isBogusAll:function(e){return wo(e)&&"all"===e.getAttribute("data-mce-bogus")},isTable:function(e){return wo(e)&&"TABLE"===e.tagName}},Bo=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Oo=function(e,t){var n,r=t.childNodes;if(!Do.isElement(t)||!Bo(t)){for(n=r.length-1;0<=n;n--)Oo(e,r[n]);if(!1===Do.isDocument(t)){if(Do.isText(t)&&0<t.nodeValue.length){var o=Yt.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||0<o)return;if(0===o&&(a=(i=t).previousSibling&&"SPAN"===i.previousSibling.nodeName,u=i.nextSibling&&"SPAN"===i.nextSibling.nodeName,a&&u))return}else if(Do.isElement(t)&&(1===(r=t.childNodes).length&&Bo(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||vo(er.fromDom(t))))return;e.remove(t)}var i,a,u;return t}},Po={trimNode:Oo},Lo=Yt.makeMap,Io=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Mo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Fo=/[<>&\"\']/g,Uo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,zo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};ao={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},uo={"<":"<",">":">","&":"&",""":'"',"'":"'"};var Vo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),ao[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};io=Vo("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);var qo=function(e,t){return e.replace(t?Io:Mo,function(e){return ao[e]||e})},Ho=function(e,t){return e.replace(t?Io:Mo,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":ao[e]||"&#"+e.charCodeAt(0)+";"})},jo=function(e,t,n){return n=n||io,e.replace(t?Io:Mo,function(e){return ao[e]||n[e]||e})},$o={encodeRaw:qo,encodeAllRaw:function(e){return(""+e).replace(Fo,function(e){return ao[e]||e})},encodeNumeric:Ho,encodeNamed:jo,getEncodeFunc:function(e,t){var n=Vo(t)||io,r=Lo(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?Io:Mo,function(e){return ao[e]!==undefined?ao[e]:n[e]!==undefined?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return jo(e,t,n)}:jo:r.numeric?Ho:qo},decode:function(e){return e.replace(Uo,function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):zo[t]||String.fromCharCode(t):uo[e]||io[e]||(n=e,(r=er.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},Wo={},Ko={},Xo=Yt.makeMap,Yo=Yt.each,Go=Yt.extend,Jo=Yt.explode,Qo=Yt.inArray,Zo=function(e,t){return(e=Yt.trim(e))?e.split(t||" "):[]},ei=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};for(t=t||"","string"==typeof(n=n||[])&&(n=Zo(n)),r=(e=Zo(e)).length;r--;)i={attributes:a(o=Zo([u,t].join(" "))),attributesOrder:o,children:a(n,Ko)},s[e[r]]=i},c=function(e,t){var n,r,o,i;for(n=(e=Zo(e)).length,t=Zo(t);n--;)for(r=s[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])};return Wo[e]?Wo[e]:(u="id accesskey class dir lang style tabindex title role",t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",n="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(u+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",t+=" article aside details dialog figure header footer hgroup section nav",n+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(u+=" xml:lang",n=[n,i="acronym applet basefont big font strike tt"].join(" "),Yo(Zo(i),function(e){a(e,"",n)}),t=[t,o="center dir isindex noframes"].join(" "),r=[t,n].join(" "),Yo(Zo(o),function(e){a(e,"",r)})),r=r||[t,n].join(" "),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",r),a("address dt dd div caption","",r),a("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","",n),a("blockquote","cite",r),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",r),a("dl","","dt dd"),a("a","href target rel media hreflang type",n),a("q","cite",n),a("ins del","cite datetime",r),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",r),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width height",[r,"param"].join(" ")),a("param","name value"),a("map","name",[r,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",r),a("th","colspan rowspan headers scope abbr",r),a("form","accept-charset action autocomplete enctype method name novalidate target",r),a("fieldset","disabled form name",[r,"legend"].join(" ")),a("label","form for",n),a("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"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?r:n),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[r,"li"].join(" ")),a("noscript","",r),"html4"!==e&&(a("wbr"),a("ruby","",[n,"rt rp"].join(" ")),a("figcaption","",r),a("mark rt rp summary bdi","",n),a("canvas","width height",r),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[r,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[r,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[n,"option"].join(" ")),a("article section nav aside header footer","",r),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[r,"figcaption"].join(" ")),a("time","datetime",n),a("dialog","open",r),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",n),a("progress","value max",n),a("meter","value min max low high optimum",n),a("details","open",[r,"summary"].join(" ")),a("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(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","onchange"),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"!==e&&(c("input button select textarea","autofocus"),c("input textarea","placeholder"),c("a","download"),c("link script img","crossorigin"),c("iframe","sandbox seamless allowfullscreen")),Yo(Zo("a form meter progress dfn"),function(e){s[e]&&delete s[e].children[e]}),delete s.caption.children.table,delete s.script,Wo[e]=s)},ti=function(e,n){var r;return e&&(r={},"string"==typeof e&&(e={"*":e}),Yo(e,function(e,t){r[t]=r[t.toUpperCase()]="map"===n?Xo(e,/[, ]/):Jo(e,/[, ]/)})),r};function ni(i){var e,t,n,r,o,a,u,s,c,l,f,d,m,N={},g={},E=[],p={},h={},v=function(e,t,n){var r=i[e];return r?r=Xo(r,/[, ]/,Xo(r.toUpperCase(),/[, ]/)):(r=Wo[e])||(r=Xo(t," ",Xo(t.toUpperCase()," ")),r=Go(r,n),Wo[e]=r),r};n=ei((i=i||{}).schema),!1===i.verify_html&&(i.valid_elements="*[*]"),e=ti(i.valid_styles),t=ti(i.invalid_styles,"map"),s=ti(i.valid_classes,"map"),r=v("whitespace_elements","pre script noscript style textarea video audio iframe object code"),o=v("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=v("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=v("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=v("non_empty_elements","td th iframe video audio object script pre code",a),f=v("move_caret_before_on_enter_elements","table",l),d=v("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),c=v("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",d),m=v("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),Yo((i.special||"script noscript noframes noembed title style textarea xmp").split(" "),function(e){h[e]=new RegExp("</"+e+"[^>]*>","gi")});var S=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},b=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,x=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,w=/[*?+]/;if(e)for(e=Zo(e,","),N["@"]&&(h=N["@"].attributes,v=N["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=C.exec(e[t])){if(g=i[1],c=i[2],p=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===g&&(a.paddEmpty=!0),"-"===g&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),h){for(b in h)d[b]=h[b];m.push.apply(m,v)}if(s)for(r=0,o=(s=Zo(s,"|")).length;r<o;r++)if(i=x.exec(s[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),g=i[3],y=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){delete d[l],m.splice(Qo(m,l),1);continue}g&&("="===g&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:y}),u.defaultValue=y),":"===g&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:y}),u.forcedValue=y),"<"===g&&(u.validValues=Xo(y,"?"))),w.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=S(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)}h||"@"!==c||(h=d,v=m),p&&(a.outputName=c,N[p]=a),w.test(c)?(a.pattern=S(c),E.push(a)):N[c]=a}},y=function(e){N={},E=[],b(e),Yo(n,function(e,t){g[t]=e.children})},C=function(e){var a=/^(~)?(.+)$/;e&&(Wo.text_block_elements=Wo.block_elements=null,Yo(Zo(e,","),function(e){var t=a.exec(e),n="~"===t[1],r=n?"span":"div",o=t[2];if(g[o]=g[r],p[o]=r,n||(c[o.toUpperCase()]={},c[o]={}),!N[o]){var i=N[r];delete(i=Go({},i)).removeEmptyAttrs,delete i.removeEmpty,N[o]=i}Yo(g,function(e,t){e[r]&&(g[t]=e=Go({},g[t]),e[o]=e[r])})}))},x=function(e){var o=/^([+\-]?)(\w+)\[([^\]]+)\]$/;Wo[i.schema]=null,e&&Yo(Zo(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?g[r[2]]:g[r[2]]={"#comment":{}},t=g[r[2]],Yo(Zo(r[3],"|"),function(e){"-"===n?delete t[e]:t[e]={}}))})},w=function(e){var t,n=N[e];if(n)return n;for(t=E.length;t--;)if((n=E[t]).pattern.test(e))return n};return i.valid_elements?y(i.valid_elements):(Yo(n,function(e,t){N[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},g[t]=e.children}),"html5"!==i.schema&&Yo(Zo("strong/b em/i"),function(e){e=Zo(e,"/"),N[e[1]].outputName=e[0]}),Yo(Zo("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){N[e]&&(N[e].removeEmpty=!0)}),Yo(Zo("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){N[e].paddEmpty=!0}),Yo(Zo("span"),function(e){N[e].removeEmptyAttrs=!0})),C(i.custom_elements),x(i.valid_children),b(i.extended_valid_elements),x("+ol[ul|ol],+ul[ul|ol]"),Yo({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},function(e,t){N[t]&&(N[t].parentsRequired=Zo(e))}),i.invalid_elements&&Yo(Jo(i.invalid_elements),function(e){N[e]&&delete N[e]}),w("span")||b("span[!data-mce-type|*]"),{children:g,elements:N,getValidStyles:function(){return e},getValidClasses:function(){return s},getBlockElements:function(){return c},getInvalidStyles:function(){return t},getShortEndedElements:function(){return a},getTextBlockElements:function(){return d},getTextInlineElements:function(){return m},getBoolAttrs:function(){return u},getElementRule:w,getSelfClosingElements:function(){return o},getNonEmptyElements:function(){return l},getMoveCaretBeforeOnEnterElements:function(){return f},getWhiteSpaceElements:function(){return r},getSpecialElements:function(){return h},isValidChild:function(e,t){var n=g[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=w(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return p},addValidElements:b,setValidElements:y,addCustomElements:C,addValidChildren:x}}var ri=function(e,t,n,r){var o=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+o(t)+o(n)+o(r)};function oi(y,e){var C,t,c,l,x=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,w=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,N=/\s*([^:]+):\s*([^;]+);?/g,E=/\s+$/,S={},T="\ufeff";for(y=y||{},e&&(c=e.getValidStyles(),l=e.getInvalidStyles()),t=("\\\" \\' \\; \\: ; : "+T).split(" "),C=0;C<t.length;C++)S[t[C]]=T+C,S[T+C]=t[C];return{toHex:function(e){return e.replace(x,ri)},parse:function(e){var t,n,r,o,i,a,u,s,c={},l=y.url_converter,f=y.url_converter_scope||this,d=function(e,t,n){var r,o,i,a;if((r=c[e+"-top"+t])&&(o=c[e+"-right"+t])&&(i=c[e+"-bottom"+t])&&(a=c[e+"-left"+t])){var u=[r,o,i,a];for(C=u.length-1;C--&&u[C]===u[C+1];);-1<C&&n||(c[e+t]=-1===C?u[0]:u.join(" "),delete c[e+"-top"+t],delete c[e+"-right"+t],delete c[e+"-bottom"+t],delete c[e+"-left"+t])}},m=function(e){var t,n=c[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return c[e]=n[0],!0}},g=function(e){return o=!0,S[e]},p=function(e,t){return o&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return S[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},h=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},v=function(e){return e.replace(/\\[0-9a-f]+/gi,h)},b=function(e,t,n,r,o,i){if(o=o||i)return"'"+(o=p(o)).replace(/\'/g,"\\'")+"'";if(t=p(t||n||r),!y.allow_script_urls){var a=t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!y.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return l&&(t=l.call(f,t,"style")),"url('"+t.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,g).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,g)});t=N.exec(e);)if(N.lastIndex=t.index+t[0].length,n=t[1].replace(E,"").toLowerCase(),r=t[2].replace(E,""),n&&r){if(n=v(n),r=v(r),-1!==n.indexOf(T)||-1!==n.indexOf('"'))continue;if(!y.allow_script_urls&&("behavior"===n||/expression\s*\(|\/\*|\*\//.test(r)))continue;"font-weight"===n&&"700"===r?r="bold":"color"!==n&&"background-color"!==n||(r=r.toLowerCase()),r=(r=r.replace(x,ri)).replace(w,b),c[n]=o?p(r,!0):r}d("border","",!0),d("border","-width"),d("border","-color"),d("border","-style"),d("padding",""),d("margin",""),i="border",u="border-style",s="border-color",m(a="border-width")&&m(u)&&m(s)&&(c[i]=c[a]+" "+c[u]+" "+c[s],delete c[a],delete c[u],delete c[s]),"medium none"===c.border&&delete c.border,"none"===c["border-image"]&&delete c["border-image"]}return c},serialize:function(i,e){var t,n,r,o,a,u="",s=function(e){var t,n,r,o;if(t=c[e])for(n=0,r=t.length;n<r;n++)e=t[n],(o=i[e])&&(u+=(0<u.length?" ":"")+e+": "+o+";")};if(e&&c)s("*"),s(e);else for(t in i)!(n=i[t])||l&&(r=t,o=e,a=void 0,(a=l["*"])&&a[r]||(a=l[o])&&a[r])||(u+=(0<u.length?" ":"")+t+": "+n+";");return u}}}var ii,ai=Yt.each,ui=Yt.grep,si=Re.ie,ci=/^([a-z0-9],?)+$/i,li=/^[ \t\r\n]*$/,fi=function(n,r,o){var e={},i=r.keep_values,t={set:function(e,t,n){r.url_converter&&(t=r.url_converter.call(r.url_converter_scope||o(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}};return e={style:{set:function(e,t){null===t||"object"!=typeof t?(i&&e.attr("data-mce-style",t),e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return t=n.serialize(n.parse(t),e[0].nodeName)}}},i&&(e.href=e.src=t),e},di=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},mi=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};function gi(a,u){var s,c=this;void 0===u&&(u={});var r={},i=window,o={},t=0,e=function(m,e){var g,p=0,h={};g=(e=e||{}).maxLoadTime||5e3;var v=function(e){m.getElementsByTagName("head")[0].appendChild(e)},n=function(e,t,n){var o,r,i,a,u=function(){for(var e=a.passed,t=e.length;t--;)e[t]();a.status=2,a.passed=[],a.failed=[]},s=function(){for(var e=a.failed,t=e.length;t--;)e[t]();a.status=3,a.passed=[],a.failed=[]},c=function(e,t){e()||((new Date).getTime()-i<g?Le.setTimeout(t):s())},l=function(){c(function(){for(var e,t,n=m.styleSheets,r=n.length;r--;)if((t=(e=n[r]).ownerNode?e.ownerNode:e.owningElement)&&t.id===o.id)return u(),!0},l)},f=function(){c(function(){try{var e=r.sheet.cssRules;return u(),!!e}catch(t){}},f)};if(e=Yt._addCacheSuffix(e),h[e]?a=h[e]:(a={passed:[],failed:[]},h[e]=a),t&&a.passed.push(t),n&&a.failed.push(n),1!==a.status)if(2!==a.status)if(3!==a.status){if(a.status=1,(o=m.createElement("link")).rel="stylesheet",o.type="text/css",o.id="u"+p++,o.async=!1,o.defer=!1,i=(new Date).getTime(),"onload"in o&&!((d=navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(d[1],10)<536))o.onload=l,o.onerror=s;else{if(0<navigator.userAgent.indexOf("Firefox"))return(r=m.createElement("style")).textContent='@import "'+e+'"',f(),void v(r);l()}var d;v(o),o.href=e}else s();else u()},t=function(t){return Qr.nu(function(e){n(t,q(e,H(ro.value(t))),q(e,H(ro.error(t))))})},o=function(e){return e.fold(j,j)};return{load:n,loadAll:function(e,n,r){eo($(e,t)).get(function(e){var t=W(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(o)):n(t.pass.map(o))})}}}(a),l=[],f=u.schema?u.schema:ni({}),d=oi({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema),m=u.ownEvents?new je(u.proxy):je.Event,n=f.getBlockElements(),g=pn.overrideDefaults(function(){return{context:a,element:V.getRoot()}}),p=function(e){if(e&&a&&"string"==typeof e){var t=a.getElementById(e);return t&&t.id!==e?a.getElementsByName(e)[1]:t}return e},h=function(e){return"string"==typeof e&&(e=p(e)),g(e)},v=function(e,t,n){var r,o,i=h(e);return i.length&&(o=(r=s[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},b=function(e){var t=p(e);return t?t.attributes:[]},y=function(e,t,n){var r,o;""===n&&(n=null);var i=h(e);r=i.attr(t),i.length&&((o=s[t])&&o.set?o.set(i,n,t):i.attr(t,n),r!==n&&u.onSetAttrib&&u.onSetAttrib({attrElm:i,attrName:t,attrValue:n}))},C=function(){return u.root_element||a.body},x=function(e,t){return Xr.getPos(a.body,p(e),t)},w=function(e,t,n){var r=h(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=Re.ie&&Re.ie<12?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:undefined)},N=function(e){var t,n;return e=p(e),t=w(e,"width"),n=w(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},E=function(e,t){var n;if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(ci.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;0<=n;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<Tt(t,i[0].ownerDocument||i[0],null,i).length},S=function(e,t,n,r){var o,i=[],a=p(e);for(r=r===undefined,n=n||("BODY"!==C().nodeName?C().parentNode:null),Yt.is(t,"string")&&(t="*"===(o=t)?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},T=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return E(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},k=function(e,n,r){var o,t="string"==typeof e?p(e):e;if(!t)return!1;if(Yt.isArray(t)&&(t.length||0===t.length))return o=[],ai(t,function(e,t){e&&("string"==typeof e&&(e=p(e)),o.push(n.call(r,e,t)))}),o;var i=r||c;return n.call(i,t)},A=function(e,t){h(e).each(function(e,n){ai(t,function(e,t){y(n,t,e)})})},_=function(e,r){var t=h(e);si?t.each(function(e,t){if(!1!==t.canHaveHTML){for(;t.firstChild;)t.removeChild(t.firstChild);try{t.innerHTML="<br>"+r,t.removeChild(t.firstChild)}catch(n){pn("<div></div>").html("<br>"+r).contents().slice(1).appendTo(t)}return r}}):t.html(r)},R=function(e,n,r,o,i){return k(e,function(e){var t="string"==typeof n?a.createElement(n):n;return A(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&_(t,o)),i?t:e.appendChild(t)})},D=function(e,t,n){return R(a.createElement(e),e,t,n,!0)},B=$o.decode,O=$o.encodeAllRaw,P=function(e,t){var n=h(e);return t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():n.remove(),1<n.length?n.toArray():n[0]},L=function(e,t,n){h(e).toggleClass(t,n).each(function(){""===this.className&&pn(this).attr("class",null)})},I=function(t,e,n){return k(e,function(e){return Yt.is(e,"array")&&(t=t.cloneNode(!0)),n&&ai(ui(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},M=function(){return a.createRange()},F=function(e,t,n,r){if(Yt.isArray(e)){for(var o=e.length;o--;)e[o]=F(e[o],t,n,r);return e}return!u.collect||e!==a&&e!==i||l.push([e,t,n,r]),m.bind(e,t,n,r||V)},U=function(e,t,n){var r;if(Yt.isArray(e)){for(r=e.length;r--;)e[r]=U(e[r],t,n);return e}if(l&&(e===a||e===i))for(r=l.length;r--;){var o=l[r];e!==o[0]||t&&t!==o[1]||n&&n!==o[2]||m.unbind(o[0],o[1],o[2])}return m.unbind(e,t,n)},z=function(e){if(e&&Do.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},V={doc:a,settings:u,win:i,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:e,boundEvents:l,styles:d,schema:f,events:m,isBlock:function(e){if("string"==typeof e)return!!n[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!n[e.nodeName])}return!1},$:g,$$:h,root:null,clone:function(t,e){if(!si||1!==t.nodeType||e)return t.cloneNode(e);if(!e){var n=a.createElement(t.nodeName);return ai(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),n}return null},getRoot:C,getViewPort:function(e){var t=e||i,n=t.document,r=n.documentElement;return{x:t.pageXOffset||r.scrollLeft,y:t.pageYOffset||r.scrollTop,w:t.innerWidth||r.clientWidth,h:t.innerHeight||r.clientHeight}},getRect:function(e){var t,n;return e=p(e),t=x(e),n=N(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:function(e,t,n){var r=S(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:S,get:p,getNext:function(e,t){return T(e,t,"nextSibling")},getPrev:function(e,t){return T(e,t,"previousSibling")},select:function(e,t){return Tt(e,p(t)||u.root_element||a,[])},is:E,add:R,create:D,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+=" "+r+'="'+O(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n=a.createElement("div"),r=a.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r},remove:P,setStyle:function(e,t,n){var r=h(e).css(t,n);u.update_styles&&di(d,r)},getStyle:w,setStyles:function(e,t){var n=h(e).css(t);u.update_styles&&di(d,n)},removeAllAttribs:function(e){return k(e,function(e){var t,n=e.attributes;for(t=n.length-1;0<=t;t--)e.removeAttributeNode(n.item(t))})},setAttrib:y,setAttribs:A,getAttrib:v,getPos:x,parseStyle:function(e){return d.parse(e)},serializeStyle:function(e,t){return d.serialize(e,t)},addStyle:function(e){var t,n;if(V!==gi.DOM&&a===document){if(r[e])return;r[e]=!0}(n=a.getElementById("mceDefaultStyles"))||((n=a.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=a.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(a.createTextNode(e))},loadCSS:function(e){var n;V===gi.DOM||a!==document?(e||(e=""),n=a.getElementsByTagName("head")[0],ai(e.split(","),function(e){var t;e=Yt._addCacheSuffix(e),o[e]||(o[e]=!0,t=D("link",{rel:"stylesheet",href:e}),n.appendChild(t))})):gi.DOM.loadCSS(e)},addClass:function(e,t){h(e).addClass(t)},removeClass:function(e,t){L(e,t,!1)},hasClass:function(e,t){return h(e).hasClass(t)},toggleClass:L,show:function(e){h(e).show()},hide:function(e){h(e).hide()},isHidden:function(e){return"none"===h(e).css("display")},uniqueId:function(e){return(e||"mce_")+t++},setHTML:_,getOuterHTML:function(e){var t="string"==typeof e?p(e):e;return Do.isElement(t)?t.outerHTML:pn("<div></div>").append(pn(t).clone()).html()},setOuterHTML:function(e,t){h(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}P(pn(this).html(t),!0)})},decode:B,encode:O,insertAfter:function(e,t){var r=p(t);return k(e,function(e){var t,n;return t=r.parentNode,(n=r.nextSibling)?t.insertBefore(e,n):t.appendChild(e),e})},replace:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=D(e),ai(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),I(n,t,!0)),n||t},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return d.toHex(Yt.trim(e))},run:k,getAttribs:b,isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new oo(e,e.parentNode),t=t||(f?f.getNonEmptyElements():null),i=f?f.getWhiteSpaceElements():{};do{if(o=e.nodeType,Do.isElement(e)){var c=e.getAttribute("data-mce-bogus");if(c){e=a.next("all"===c);continue}if(u=e.nodeName.toLowerCase(),t&&t[u]){if("br"===u){s++,e=a.next();continue}return!1}for(n=(r=b(e)).length;n--;)if("name"===(u=r[n].nodeName)||"data-mce-bookmark"===u)return!1}if(8===o)return!1;if(3===o&&!li.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&li.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:M,nodeIndex:mi,split:function(e,t,n){var r,o,i,a=M();if(e&&t)return a.setStart(e.parentNode,mi(e)),a.setEnd(t.parentNode,mi(t)),r=a.extractContents(),(a=M()).setStart(t.parentNode,mi(t)+1),a.setEnd(e.parentNode,mi(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(Po.trimNode(V,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Po.trimNode(V,o),e),P(e),n||t},bind:F,unbind:U,fire:function(e,t,n){return m.fire(e,t,n)},getContentEditable:z,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=z(e));e=e.parentNode);return n},destroy:function(){if(l)for(var e=l.length;e--;){var t=l[e];m.unbind(t[0],t[1],t[2])}Tt.setDocument&&Tt.setDocument()},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}};return s=fi(d,u,function(){return V}),V}(ii=gi||(gi={})).DOM=ii(document),ii.nodeIndex=mi;var pi=gi,hi=pi.DOM,vi=Yt.each,bi=Yt.grep,yi=function(e){return"function"==typeof e},Ci=function(){var l={},o=[],i={},a=[],f=0;this.isDone=function(e){return 2===l[e]},this.markDone=function(e){l[e]=2},this.add=this.load=function(e,t,n,r){l[e]===undefined&&(o.push(e),l[e]=0),t&&(i[e]||(i[e]=[]),i[e].push({success:t,failure:r,scope:n||this}))},this.remove=function(e){delete l[e],delete i[e]},this.loadQueue=function(e,t,n){this.loadScripts(o,e,t,n)},this.loadScripts=function(n,e,t,r){var u,s=[],c=function(t,e){vi(i[e],function(e){yi(e[t])&&e[t].call(e.scope)}),i[e]=undefined};a.push({success:e,failure:r,scope:t||this}),(u=function(){var e=bi(n);if(n.length=0,vi(e,function(e){var t,n,r,o,i,a;2!==l[e]?3!==l[e]?1!==l[e]&&(l[e]=1,f++,t=e,n=function(){l[e]=2,f--,c("success",e),u()},r=function(){l[e]=3,f--,s.push(e),c("failure",e),u()},i=(a=hi).uniqueId(),(o=document.createElement("script")).id=i,o.type="text/javascript",o.src=Yt._addCacheSuffix(t),o.onload=function(){a.remove(i),o&&(o.onreadystatechange=o.onload=o=null),n()},o.onerror=function(){yi(r)?r():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(o)):c("failure",e):c("success",e)}),!f){var t=a.slice(0);a.length=0,vi(t,function(e){0===s.length?yi(e.success)&&e.success.call(e.scope):yi(e.failure)&&e.failure.call(e.scope,s)})}})()}};Ci.ScriptLoader=new Ci;var xi,wi=Yt.each;function Ni(){var r=this,o=[],a={},u={},i=[],s=function(e){var t;return u[e]&&(t=u[e].dependencies),t||[]},c=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},l=function(e,n,t,r){var o=s(e);wi(o,function(e){var t=c(n,e);f(t.resource,t,undefined,undefined)}),t&&(r?t.call(r):t.call(Ci))},f=function(e,t,n,r,o){if(!a[e]){var i="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==i.indexOf("/")&&-1===i.indexOf("://")&&(i=Ni.baseURL+"/"+i),a[e]=i.substring(0,i.lastIndexOf("/")),u[e]?l(e,t,n,r):Ci.ScriptLoader.add(i,function(){return l(e,t,n,r)},r,o)}};return{items:o,urls:a,lookup:u,_listeners:i,get:function(e){return u[e]?u[e].instance:undefined},dependencies:s,requireLangPack:function(e,t){var n=Ni.language;if(n&&!1!==Ni.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;Ci.ScriptLoader.add(a[e]+"/langs/"+n+".js")}},add:function(t,e,n){o.push(e),u[t]={instance:e,dependencies:n};var r=W(i,function(e){return e.name===t});return i=r.fail,wi(r.pass,function(e){e.callback()}),e},remove:function(e){delete a[e],delete u[e]},createUrl:c,addComponents:function(e,t){var n=r.urls[e];wi(t,function(e){Ci.ScriptLoader.add(n+"/"+e)})},load:f,waitFor:function(e,t){u.hasOwnProperty(e)?t():i.push({name:e,callback:t})}}}(xi=Ni||(Ni={})).PluginManager=xi(),xi.ThemeManager=xi();var Ei=function(t,n){$r.parent(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},Si=function(e,t){e.dom().appendChild(t.dom())},Ti={before:Ei,after:function(e,t){$r.nextSibling(e).fold(function(){$r.parent(e).each(function(e){Si(e,t)})},function(e){Ei(e,t)})},prepend:function(t,n){$r.firstChild(t).fold(function(){Si(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},append:Si,appendAt:function(e,t,n){$r.child(e,n).fold(function(){Si(e,t)},function(e){Ei(e,t)})},wrap:function(e,t){Ei(e,t),Si(t,e)}},ki=function(t,e){F(e,function(e){Ti.before(t,e)})},Ai=function(t,e){F(e,function(e){Ti.append(t,e)})},_i=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Ri={empty:function(e){e.dom().textContent="",F($r.children(e),function(e){_i(e)})},remove:_i,unwrap:function(e){var t=$r.children(e);0<t.length&&ki(e,t),_i(e)}},Di=function(n,r){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null===o&&(o=setTimeout(function(){n.apply(null,e),o=null},r))}}},Bi=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Bi(n())}}},Oi=function(e,t){var n=hr.get(e,t);return n===undefined||""===n?[]:n.split(" ")},Pi=Oi,Li=function(e,t,n){var r=Oi(e,t).concat([n]);return hr.set(e,t,r.join(" ")),!0},Ii=function(e,t,n){var r=U(Oi(e,t),function(e){return e!==n});return 0<r.length?hr.set(e,t,r.join(" ")):hr.remove(e,t),!1},Mi=function(e){return Pi(e,"class")},Fi=function(e,t){return Li(e,"class",t)},Ui=function(e,t){return Ii(e,"class",t)},zi=Mi,Vi=Fi,qi=Ui,Hi=function(e,t){return I(Mi(e),t)?Ui(e,t):Fi(e,t)},ji=function(e){return e.dom().classList!==undefined},$i=function(e,t){return ji(e)&&e.dom().classList.contains(t)},Wi={add:function(e,t){ji(e)?e.dom().classList.add(t):Vi(e,t)},remove:function(e,t){var n;ji(e)?e.dom().classList.remove(t):qi(e,t),0===(ji(n=e)?n.dom().classList:zi(n)).length&&hr.remove(n,"class")},toggle:function(e,t){return ji(e)?e.dom().classList.toggle(t):Hi(e,t)},toggler:function(e,t){var n,r,o,i,a,u,s=ji(e),c=e.dom().classList;return n=function(){s?c.remove(t):qi(e,t)},r=function(){s?c.add(t):Vi(e,t)},o=$i(e,t),i=o||!1,{on:a=function(){r(),i=!0},off:u=function(){n(),i=!1},toggle:function(){(i?u:a)()},isOn:function(){return i}}},has:$i},Ki=function(e,t){return Lr.all(t,e)};function Xi(e,t,n,r,o){return e(n,r)?A.some(n):O(o)&&o(n)?A.none():t(n,r,o)}var Yi,Gi=function(e,t,n){for(var r=e.dom(),o=O(n)?n:H(!1);r.parentNode;){r=r.parentNode;var i=er.fromDom(r);if(t(i))return A.some(i);if(o(i))break}return A.none()},Ji=function(e,t){return V(e.dom().childNodes,q(t,er.fromDom)).map(er.fromDom)},Qi=function(e,r){var o=function(e){for(var t=0;t<e.childNodes.length;t++){if(r(er.fromDom(e.childNodes[t])))return A.some(er.fromDom(e.childNodes[t]));var n=o(e.childNodes[t]);if(n.isSome())return n}return A.none()};return o(e.dom())},Zi={first:function(e){return Qi(yr.body(),e)},ancestor:Gi,closest:function(e,t,n){return Xi(function(e){return t(e)},Gi,e,t,n)},sibling:function(t,n){var e=t.dom();return e.parentNode?Ji(er.fromDom(e.parentNode),function(e){return!Fr.eq(t,e)&&n(e)}):A.none()},child:Ji,descendant:Qi},ea=function(e,t,n){return Zi.ancestor(e,function(e){return Lr.is(e,t)},n)},ta=ea,na=function(e,t){return Lr.one(t,e)},ra=function(e,t,n){return Xi(Lr.is,ea,e,t,n)},oa=H("mce-annotation"),ia=H("data-mce-annotation"),aa=H("data-mce-annotation-uid"),ua=function(r,e){var t=r.selection.getRng(),n=er.fromDom(t.startContainer),o=er.fromDom(r.getBody()),i=e.fold(function(){return"."+oa()},function(e){return"["+ia()+'="'+e+'"]'}),a=$r.child(n,t.startOffset).getOr(n),u=ra(a,i,function(e){return Fr.eq(e,o)}),s=function(e,t){return hr.has(e,t)?A.some(hr.get(e,t)):A.none()};return u.bind(function(e){return s(e,""+aa()).bind(function(n){return s(e,""+ia()).map(function(e){var t=sa(r,n);return{uid:n,name:e,elements:t}})})})},sa=function(e,t){var n=er.fromDom(e.getBody());return Ki(n,"["+aa()+'="'+t+'"]')},ca=function(i,e){var n,r,o,a=Bi({}),c=function(e,t){u(e,function(e){return t(e),e})},u=function(e,t){var n=a.get(),r=t(n.hasOwnProperty(e)?n[e]:{listeners:[],previous:Bi(A.none())});n[e]=r,a.set(n)},t=(n=function(){var e,t,n,r=a.get(),o=(e=cr(r),(n=Q.call(e,0)).sort(t),n);F(o,function(e){u(e,function(u){var s=u.previous.get();return ua(i,A.some(e)).fold(function(){var t;s.isSome()&&(c(t=e,function(e){F(e.listeners,function(e){return e(!1,t)})}),u.previous.set(A.none()))},function(e){var t,n,r,o=e.uid,i=e.name,a=e.elements;s.is(o)||(n=o,r=a,c(t=i,function(e){F(e.listeners,function(e){return e(!0,t,{uid:n,nodes:$(r,function(e){return e.dom()})})})}),u.previous.set(A.some(o)))}),{previous:u.previous,listeners:u.listeners}})})},r=30,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==o&&clearTimeout(o),o=setTimeout(function(){n.apply(null,e),o=null},r)}});return i.on("remove",function(){t.cancel()}),i.on("nodeChange",function(){t.throttle()}),{addListener:function(e,t){u(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})}}},la=function(e,n){e.on("init",function(){e.serializer.addNodeFilter("span",function(e){F(e,function(t){var e;(e=t,A.from(e.attributes.map[ia()]).bind(n.lookup)).each(function(e){!1===e.persistent&&t.unwrap()})})})})},fa=0,da=function(t,e){F(e,function(e){Wi.add(t,e)})},ma=function(e,t){return er.fromDom(e.dom().cloneNode(t))},ga=function(e){return ma(e,!0)},pa=function(e){return ma(e,!1)},ha=ga,va=[].slice,ba=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=va.call(arguments);return r.length-1>=e.length?e.apply(this,r.slice(1)):function(){var e=r.concat([].slice.call(arguments));return ba.apply(this,e)}},ya={constant:function(e){return function(){return e}},negate:function(t){return function(e){return!t(e)}},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=va.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=va.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},curry:ba,compose:function(t,n){return function(e){return t(n(e))}},noop:function(){}},Ca="\ufeff",xa=function(e){return e===Ca},wa=Ca,Na=function(e){return e.replace(new RegExp(Ca,"g"),"")},Ea=Do.isElement,Sa=Do.isText,Ta=function(e){return Sa(e)&&(e=e.parentNode),Ea(e)&&e.hasAttribute("data-mce-caret")},ka=function(e){return Sa(e)&&xa(e.data)},Aa=function(e){return Ta(e)||ka(e)},_a=function(e){return e.firstChild!==e.lastChild||!Do.isBr(e.firstChild)},Ra=function(e){var t=e.container();return e&&Do.isText(t)&&t.data.charAt(e.offset())===wa},Da=function(e){var t=e.container();return e&&Do.isText(t)&&t.data.charAt(e.offset()-1)===wa},Ba=function(e,t,n){var r,o,i;return(r=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(((i=document.createElement("br")).setAttribute("data-mce-bogus","1"),i)),o=t.parentNode,n?o.insertBefore(r,t):t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r),r},Oa=function(e){return Sa(e)&&e.data[0]===wa},Pa=function(e){return Sa(e)&&e.data[e.data.length-1]===wa},La=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],Do.isBogus(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},Ia=Do.isContentEditableTrue,Ma=Do.isContentEditableFalse,Fa=Do.isBr,Ua=Do.isText,za=Do.matchNodeNames("script style textarea"),Va=Do.matchNodeNames("img input textarea hr iframe video audio object"),qa=Do.matchNodeNames("table"),Ha=Aa,ja=function(e){return!Ha(e)&&(Ua(e)?!za(e.parentNode):Va(e)||Fa(e)||qa(e)||$a(e))},$a=function(e){return!1===(t=e,Do.isElement(t)&&"true"===t.getAttribute("unselectable"))&&Ma(e);var t},Wa=function(e,t){return ja(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if($a(e))return!1;if(Ia(e))return!0}return!0}(e,t)},Ka=Math.round,Xa=function(e){return e?{left:Ka(e.left),top:Ka(e.top),bottom:Ka(e.bottom),right:Ka(e.right),width:Ka(e.width),height:Ka(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Ya=function(e,t){return e=Xa(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e},Ga=function(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2},Ja=function(e,t){return e.bottom-e.height/2<t.top||!(e.top>t.bottom)&&Ga(t.top-e.bottom,e,t)},Qa=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&Ga(t.bottom-e.top,e,t)},Za=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},eu=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},tu=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),nu=function(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&tu.test(e)},ru=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return A.none();n.push(o.getOrDie())}return A.some(t.apply(null,n))},ou=Do.isElement,iu=ja,au=Do.matchStyleValues("display","block table"),uu=Do.matchStyleValues("float","left right"),su=ya.and(ou,iu,ya.negate(uu)),cu=ya.negate(Do.matchStyleValues("white-space","pre pre-line pre-wrap")),lu=Do.isText,fu=Do.isBr,du=pi.nodeIndex,mu=eu,gu=function(e){return"createRange"in e?e.createRange():pi.DOM.createRng()},pu=function(e){return e&&/[\r\n\t ]/.test(e)},hu=function(e){return!!e.setStart&&!!e.setEnd},vu=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(pu(e.toString())&&cu(n.parentNode)&&Do.isText(n)&&(t=n.data,pu(t[r-1])||pu(t[r+1])))},bu=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},yu=function(e){var t,n,r,o,i,a,u,s;return t=0<(n=e.getClientRects()).length?Xa(n[0]):Xa(e.getBoundingClientRect()),!hu(e)&&fu(e)&&bu(t)?(i=(r=e).ownerDocument,a=gu(i),u=i.createTextNode("\xa0"),(s=r.parentNode).insertBefore(u,r),a.setStart(u,0),a.setEnd(u,1),o=Xa(a.getBoundingClientRect()),s.removeChild(u),o):bu(t)&&hu(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&Do.isText(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),yu(i)}return null}(e):t},Cu=function(e,t){var n=Ya(e,t);return n.width=1,n.right=n.left+1,n},xu=function(e){var t,n,r=[],o=function(e){var t,n;0!==e.height&&(0<r.length&&(t=e,n=r[r.length-1],t.left===n.left&&t.top===n.top&&t.bottom===n.bottom&&t.right===n.right)||r.push(e))},i=function(e,t){var n=gu(e.ownerDocument);if(t<e.data.length){if(nu(e.data[t]))return r;if(nu(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!vu(n)))return o(Cu(yu(n),!1)),r}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),vu(n)||o(Cu(yu(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),vu(n)||o(Cu(yu(n),!0)))};if(lu(e.container()))return i(e.container(),e.offset()),r;if(ou(e.container()))if(e.isAtEnd())n=mu(e.container(),e.offset()),lu(n)&&i(n,n.data.length),su(n)&&!fu(n)&&o(Cu(yu(n),!1));else{if(n=mu(e.container(),e.offset()),lu(n)&&i(n,0),su(n)&&e.isAtEnd())return o(Cu(yu(n),!1)),r;t=mu(e.container(),e.offset()-1),su(t)&&!fu(t)&&(au(t)||au(n)||!su(n))&&o(Cu(yu(t),!1)),su(n)&&o(Cu(yu(n),!0))}return r};function wu(t,n,e){var r=function(){return e||(e=xu(wu(t,n))),e};return{container:ya.constant(t),offset:ya.constant(n),toRange:function(){var e;return(e=gu(t.ownerDocument)).setStart(t,n),e.setEnd(t,n),e},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return lu(t),0===n},isAtEnd:function(){return lu(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return mu(t,e?n-1:n)}}}(Yi=wu||(wu={})).fromRangeStart=function(e){return Yi(e.startContainer,e.startOffset)},Yi.fromRangeEnd=function(e){return Yi(e.endContainer,e.endOffset)},Yi.after=function(e){return Yi(e.parentNode,du(e)+1)},Yi.before=function(e){return Yi(e.parentNode,du(e))},Yi.isAbove=function(e,t){return ru([ee(t.getClientRects()),te(e.getClientRects())],Ja).getOr(!1)},Yi.isBelow=function(e,t){return ru([te(t.getClientRects()),ee(e.getClientRects())],Qa).getOr(!1)},Yi.isAtStart=function(e){return!!e&&e.isAtStart()},Yi.isAtEnd=function(e){return!!e&&e.isAtEnd()},Yi.isTextPosition=function(e){return!!e&&Do.isText(e.container())},Yi.isElementPosition=function(e){return!1===Yi.isTextPosition(e)};var Nu,Eu,Su=wu,Tu=Do.isText,ku=Do.isBogus,Au=pi.nodeIndex,_u=function(e){var t=e.parentNode;return ku(t)?_u(t):t},Ru=function(e){return e?jt.reduce(e.childNodes,function(e,t){return ku(t)&&"BR"!==t.nodeName?e=e.concat(Ru(t)):e.push(t),e},[]):[]},Du=function(t){return function(e){return t===e}},Bu=function(e){var t,r,n,o;return(Tu(e)?"text()":e.nodeName.toLowerCase())+"["+(r=Ru(_u(t=e)),n=jt.findIndex(r,Du(t),t),r=r.slice(0,n+1),o=jt.reduce(r,function(e,t,n){return Tu(t)&&Tu(r[n-1])&&e++,e},0),r=jt.filter(r,Do.matchNodeNames(t.nodeName)),(n=jt.findIndex(r,Du(t),t))-o)+"]"},Ou=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),Tu(n)?o=function(e,t){for(;(e=e.previousSibling)&&Tu(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Bu(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=jt.filter(a,ya.negate(Do.isBogus)),(u=u.concat(jt.map(a,function(e){return Bu(e)}))).reverse().join("/")+","+o},Pu=function(e,t){var n,r,o;return t?(t=(n=t.split(","))[0].split("/"),o=1<n.length?n[1]:"before",(r=jt.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),n=e,r=t[1],o=parseInt(t[2],10),i=Ru(n),i=jt.filter(i,function(e,t){return!Tu(e)||!Tu(i[t-1])}),(i=jt.filter(i,Do.matchNodeNames(r)))[o]):null;var n,r,o,i},e))?Tu(r)?function(e,t){for(var n,r=e,o=0;Tu(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!Tu(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return Tu(e)&&t>e.data.length&&(t=e.data.length),Su(e,t)}(r,parseInt(o,10)):(o="after"===o?Au(r)+1:Au(r),Su(r.parentNode,o)):null):null},Lu=Do.isContentEditableFalse,Iu=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=e.getRoot();for(Do.isText(a)?s.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&Do.isText(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(e.nodeIndex(a,n));return s},Mu=function(e){Do.isText(e)&&0===e.data.length&&e.parentNode.removeChild(e)},Fu=function(e,t,n){var r=0;return Yt.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},Uu=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],Do.isElement(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},zu=function(e){return Uu(e,!0),Uu(e,!1),e},Vu=function(e,t){var n;if(Do.isElement(e)&&(e=eu(e,t),Lu(e)))return e;if(Aa(e)){if(Do.isText(e)&&Ta(e)&&(e=e.parentNode),n=e.previousSibling,Lu(n))return n;if(n=e.nextSibling,Lu(n))return n}},qu=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Lu(r)||"IMG"===o)return{name:o,index:Fu(n.dom,o,r)};var a,u,s,c,l,f,d,m=Vu((a=i).startContainer,a.startOffset)||Vu(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:Fu(n.dom,o,m)}:(u=e,c=t,l=i,f=(s=n).dom,(d={}).start=Iu(f,u,c,l,!0),s.isCollapsed()||(d.end=Iu(f,u,c,l,!1)),d)},Hu=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,""):e.create("span",r)},ju=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:Fu(n,u,a)};var s=zu(r.cloneRange());if(!i){s.collapse(!1);var c=Hu(n,o+"_end",t);s.insertNode(c),Mu(c.nextSibling)}(r=zu(r)).collapse(!0);var l=Hu(n,o+"_start",t);return r.insertNode(l),Mu(l.previousSibling),Mu(l.nextSibling),e.moveToBookmark({id:o,keep:1}),{id:o}},$u={getBookmark:function(e,t,n){return 2===t?qu(Na,n,e):3===t?(o=(r=e).getRng(),{start:Ou(r.dom.getRoot(),Su.fromRangeStart(o)),end:Ou(r.dom.getRoot(),Su.fromRangeEnd(o))}):t?{rng:e.getRng()}:ju(e,!1);var r,o},getUndoBookmark:b(qu,j,!0),getPersistentBookmark:ju},Wu="_mce_caret",Ku=function(e){return Do.isElement(e)&&e.id===Wu},Xu=function(e,t){for(;t&&t!==e;){if(t.id===Wu)return t;t=t.parentNode}return null},Yu=Do.isElement,Gu=Do.isText,Ju=function(e){var t=e.parentNode;t&&t.removeChild(e)},Qu=function(e,t){0===t.length?Ju(e):e.nodeValue=t},Zu=function(e){var t=Na(e);return{count:e.length-t.length,text:t}},es=function(e,t){return rs(e),t},ts=function(e,t){var n,r,o,i=t.container(),a=(n=ne(i.childNodes),r=e,o=L(n,r),-1===o?A.none():A.some(o)).map(function(e){return e<t.offset()?Su(i,t.offset()-1):t}).getOr(t);return rs(e),a},ns=function(e,t){return Gu(e)&&t.container()===e?(r=t,o=Zu((n=e).data.substr(0,r.offset())),i=Zu(n.data.substr(r.offset())),0<(a=o.text+i.text).length?(Qu(n,a),Su(n,r.offset()-o.count)):r):es(e,t);var n,r,o,i,a},rs=function(e){if(Yu(e)&&Aa(e)&&(_a(e)?e.removeAttribute("data-mce-caret"):Ju(e)),Gu(e)){var t=Na(function(e){try{return e.nodeValue}catch(t){return""}}(e));Qu(e,t)}},os={removeAndReposition:function(e,t){return Su.isTextPosition(t)?ns(e,t):(n=e,(r=t).container()===n.parentNode?ts(n,r):es(n,r));var n,r},remove:rs},is=Do.isContentEditableTrue,as=Do.isContentEditableFalse,us=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},ss=function(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:((r=(n=t).ownerDocument.createRange()).selectNode(n),r)},cs=function(e,t,n){var r=Gc(1,e.getBody(),t),o=Su.fromRangeStart(r),i=o.getNode();if(as(i))return us(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(as(a))return us(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return as(e)||is(e)});return as(u)?us(1,e,u,!1,n):null},ls=function(e,t,n){if(!t||!t.collapsed)return t;var r=cs(e,t,n);return r||t};(Eu=Nu||(Nu={}))[Eu.Backwards=-1]="Backwards",Eu[Eu.Forwards=1]="Forwards";var fs,ds,ms=Do.isContentEditableFalse,gs=Do.isText,ps=Do.isElement,hs=Do.isBr,vs=ja,bs=function(e){return Va(e)||!!$a(t=e)&&!0!==jt.reduce(t.getElementsByTagName("*"),function(e,t){return e||Ia(t)},!1);var t},ys=Wa,Cs=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},xs=function(e,t){if(Uc(e)){if(vs(t.previousSibling)&&!gs(t.previousSibling))return Su.before(t);if(gs(t))return Su(t,0)}if(zc(e)){if(vs(t.nextSibling)&&!gs(t.nextSibling))return Su.after(t);if(gs(t))return Su(t,t.data.length)}return zc(e)?hs(t)?Su.before(t):Su.after(t):Su.before(t)},ws=function(e,t,n){var r,o,i,a,u;if(!ps(n)||!t)return null;if(t.isEqual(Su.after(n))&&n.lastChild){if(u=Su.after(n.lastChild),zc(e)&&vs(n.lastChild)&&ps(n.lastChild))return hs(n.lastChild)?Su.before(n.lastChild):u}else u=t;var s,c,l,f=u.container(),d=u.offset();if(gs(f)){if(zc(e)&&0<d)return Su(f,--d);if(Uc(e)&&d<f.length)return Su(f,++d);r=f}else{if(zc(e)&&0<d&&(o=Cs(f,d-1),vs(o)))return!bs(o)&&(i=qc(o,e,ys,o))?gs(i)?Su(i,i.data.length):Su.after(i):gs(o)?Su(o,o.data.length):Su.before(o);if(Uc(e)&&d<f.childNodes.length&&(o=Cs(f,d),vs(o)))return hs(o)&&n.lastChild===o?null:(s=o,c=n,Do.isBr(s)&&(l=ws(1,Su.after(s),c))&&!jc(Su.before(s),Su.before(l),c)?ws(e,Su.after(o),n):!bs(o)&&(i=qc(o,e,ys,o))?gs(i)?Su(i,0):Su.before(i):gs(o)?Su(o,0):Su.after(o));r=o||u.getNode()}return(Uc(e)&&u.isAtEnd()||zc(e)&&u.isAtStart())&&(r=qc(r,e,ya.constant(!0),n,!0),ys(r,n))?xs(e,r):(o=qc(r,e,ys,n),!(a=jt.last(jt.filter(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(f,n),ms)))||o&&a.contains(o)?o?xs(e,o):null:u=Uc(e)?Su.after(a):Su.before(a))},Ns=function(t){return{next:function(e){return ws(Nu.Forwards,e,t)},prev:function(e){return ws(Nu.Backwards,e,t)}}};(ds=fs||(fs={}))[ds.Br=0]="Br",ds[ds.Block=1]="Block",ds[ds.Wrap=2]="Wrap",ds[ds.Eol=3]="Eol";var Es,Ss,Ts,ks,As,_s=function(e,t){return e===Nu.Backwards?t.reverse():t},Rs=function(e,t,n,r){for(var o,i,a,u,s,c,l=Ns(n),f=r,d=[];f&&(s=l,c=f,o=t===Nu.Forwards?s.next(c):s.prev(c));){if(Do.isBr(o.getNode(!1)))return t===Nu.Forwards?{positions:_s(t,d).concat([o]),breakType:fs.Br,breakAt:A.some(o)}:{positions:_s(t,d),breakType:fs.Br,breakAt:A.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,Do.isBr(u.getNode(i===Nu.Forwards))?fs.Br:!1===jc(a,u)?fs.Block:fs.Wrap);return{positions:_s(t,d),breakType:m,breakAt:A.some(o)}}d.push(o),f=o}else f=o}return{positions:_s(t,d),breakType:fs.Eol,breakAt:A.none()}},Ds=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===Nu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},Bs=function(e,i){return z(e,function(e,o){return e.fold(function(){return A.some(o)},function(r){return ru([ee(r.getClientRects()),ee(o.getClientRects())],function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},A.none())},Os=function(t,e){return ee(e.getClientRects()).bind(function(e){return Bs(t,e.left)})},Ps=b(Rs,wu.isAbove,-1),Ls=b(Rs,wu.isBelow,1),Is=b(Ds,-1,Ps),Ms=b(Ds,1,Ls),Fs=function(e,t,n,r,o){var i,a,u,s,c=Ki(er.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),l=U((i=e,G(c,function(e){var t,n,r=(t=Xa(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(a=l,u=r,s=o,z(a,function(e,r){return e.fold(function(){return A.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-u)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-u)+Math.abs(r.y-s));return A.some(n<t?r:e)})},A.none())).map(function(e){return e.cell})},Us=b(Fs,function(e){return e.bottom},function(e,t){return e.y<t}),zs=b(Fs,function(e){return e.top},function(e,t){return e.y>t}),Vs=function(t,n){return ee(n.getClientRects()).bind(function(e){return Us(t,e.left,e.top)}).bind(function(e){return Os((t=e,fl.lastPositionIn(t).map(function(e){return Ps(t,e).positions.concat(e)}).getOr([])),n);var t})},qs=function(t,n){return te(n.getClientRects()).bind(function(e){return zs(t,e.left,e.top)}).bind(function(e){return Os((t=e,fl.firstPositionIn(t).map(function(e){return[e].concat(Ls(t,e).positions)}).getOr([])),n);var t})},Hs=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},js=function(e,t,n){var r,o,i,a,u,s=e.dom,c=s.getRoot(),l=0;if(u={elm:t,alignToTop:n},e.fire("scrollIntoView",u),!u.isDefaultPrevented()&&Do.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==c.nodeName){var f=e.selection.getScrollContainer();if(f)return r=Hs(t).y-Hs(f).y+l,a=f.clientHeight,void((r<(i=f.scrollTop)||i+a<r+25)&&(f.scrollTop=r<i?r:r-a+25))}o=s.getViewPort(e.getWin()),r=s.getPos(t).y+l,i=o.y,a=o.h,(r<o.y||i+a<r+25)&&e.getWin().scrollTo(0,r<i?r:r-a+25)}},$s=function(d,e){ee(wu.fromRangeStart(e).getClientRects()).each(function(e){var t,n,r,o,i,a,u,s,c,l=function(e){if(e.inline)return e.getBody().getBoundingClientRect();var t=e.getWin();return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight}}(d),f={x:(i=t=l,a=n=e,a.left>i.left&&a.right<i.right?0:a.left<i.left?a.left-i.left:a.right-i.right),y:(r=t,o=n,o.top>r.top&&o.bottom<r.bottom?0:o.top<r.top?o.top-r.top:o.bottom-r.bottom)};s=0!==f.x?0<f.x?f.x+4:f.x-4:0,c=0!==f.y?0<f.y?f.y+4:f.y-4:0,(u=d).inline?(u.getBody().scrollLeft+=s,u.getBody().scrollTop+=c):u.getWin().scrollBy(s,c)})},Ws=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},Ks=function(e){return e.getParam("iframe_attrs",{})},Xs=function(e){return e.getParam("doctype","<!DOCTYPE html>")},Ys=function(e){return e.getParam("document_base_url","")},Gs=function(e){return Ws(e,"body_id","tinymce")},Js=function(e){return Ws(e,"body_class","")},Qs=function(e){return e.getParam("content_security_policy","")},Zs=function(e){return e.getParam("br_in_pre",!0)},ec=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},tc=function(e){return e.getParam("forced_root_block_attrs",{})},nc=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},rc=function(e){return e.getParam("no_newline_selector","")},oc=function(e){return e.getParam("keep_styles",!0)},ic=function(e){return e.getParam("end_container_on_empty_block",!1)},ac=function(e){return Yt.explode(e.getParam("font_size_style_values",""))},uc=function(e){return Yt.explode(e.getParam("font_size_classes",""))},sc=function(e){return e.getParam("images_dataimg_filter",H(!0),"function")},cc=function(e){return e.getParam("automatic_uploads",!0,"boolean")},lc=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},fc=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},dc=function(e){return e.getParam("images_upload_url","","string")},mc=function(e){return e.getParam("images_upload_base_path","","string")},gc=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},pc=function(e){return e.getParam("images_upload_handler",null,"function")},hc=Qn.detect().browser,vc=function(){return hc.isIE()||hc.isEdge()||hc.isFirefox()},bc=function(e,t){e.selection.setRng(t),$s(e,t)},yc=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===fs.Wrap&&0===a.positions.length||!Do.isBr(n.getNode())&&(i=u).breakType===fs.Br&&1===i.positions.length?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},Cc=ya.curry(yc,Ps),xc=ya.curry(yc,Ls),wc=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(vc()&&(o=t,i=s,a=n,u=Su.fromRangeStart(i),fl.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=us(c,e,n,!t,!0);return bc(e,l),!0}return!1},Nc=function(e,t){var n=t.getNode(e);return Do.isElement(n)&&"TABLE"===n.nodeName?A.some(n):A.none()},Ec=function(u,s,c){var e=Nc(!!s,c),t=!1===s;e.fold(function(){return bc(u,c.toRange())},function(a){return fl.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return bc(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=ec(r=u))?r.undoManager.transact(function(){var e=er.fromTag(i);hr.setAll(e,tc(r)),Ti.append(e,er.fromTag("br")),n?Ti.after(er.fromDom(o),e):Ti.before(er.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),bc(r,t)}):bc(r,t.toRange()));var n,r,o,t,i})})},Sc=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=Su.fromRangeStart(l),d=e.getBody();if(!t&&Cc(r,f)){var m=(u=d,Vs(s=n,c=f).orThunk(function(){return ee(c.getClientRects()).bind(function(e){return Bs(Is(u,Su.before(s)),e.left)})}).getOr(Su.before(s)));return Ec(e,t,m),!0}return!(!t||!xc(r,f))&&(o=d,m=qs(i=n,a=f).orThunk(function(){return ee(a.getClientRects()).bind(function(e){return Bs(Ms(o,Su.after(i)),e.left)})}).getOr(Su.after(i)),Ec(e,t,m),!0)},Tc=function(t,n){return function(){return A.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return A.from(t.dom.getParent(e,"table")).map(function(e){return wc(t,n,e)})}).getOr(!1)}},kc=function(n,r){return function(){return A.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return A.from(n.dom.getParent(t,"table")).map(function(e){return Sc(n,r,e,t)})}).getOr(!1)}},Ac=Do.isContentEditableFalse,_c=function(e,t,n){var r,o,i,a,u,s=Ya(t.getBoundingClientRect(),n);return"BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,i=e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,i=e.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,0<(a=t.offsetWidth-t.clientWidth)&&(n&&(a*=-1),s.left+=a,s.right+=a),s},Rc=function(a,u,e){var t,s,c=Bi(A.none()),l=function(){!function(e){var t,n,r,o,i;for(t=pn("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,Pa(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,Oa(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(a),s&&(os.remove(s),s=null),c.get().each(function(e){pn(e.caret).remove(),c.set(A.none())}),clearInterval(t)},f=function(){t=Le.setInterval(function(){e()?pn("div.mce-visual-caret",a).toggleClass("mce-visual-caret-hidden"):pn("div.mce-visual-caret",a).addClass("mce-visual-caret-hidden")},500)};return{show:function(t,e){var n,r,o;if(l(),o=e,Do.isElement(o)&&/^(TD|TH)$/i.test(o.tagName))return null;if(!u(e))return s=function(e,t){var n,r,o;if(r=e.ownerDocument.createTextNode(wa),o=e.parentNode,t){if(n=e.previousSibling,Sa(n)){if(Aa(n))return n;if(Pa(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,Sa(n)){if(Aa(n))return n;if(Oa(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(e,t),r=e.ownerDocument.createRange(),Ac(s.nextSibling)?(r.setStart(s,0),r.setEnd(s,0)):(r.setStart(s,1),r.setEnd(s,1)),r;s=Ba("p",e,t),n=_c(a,e,t),pn(s).css("top",n.top);var i=pn('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(n).appendTo(a)[0];return c.set(A.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&pn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:l,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(){c.get().each(function(e){var t=_c(a,e.element,e.before);pn(e.caret).css(t)})},destroy:function(){return Le.clearInterval(t)}}},Dc=function(e){return Ac(e)||Do.isTable(e)&&vc()},Bc=Do.isContentEditableFalse,Oc=Do.matchStyleValues("display","block table table-cell table-caption list-item"),Pc=Aa,Lc=Ta,Ic=ya.curry,Mc=Do.isElement,Fc=ja,Uc=function(e){return 0<e},zc=function(e){return e<0},Vc=function(e,t){for(var n;n=e(t);)if(!Lc(n))return n;return null},qc=function(e,t,n,r,o){var i=new oo(e,r);if(zc(t)){if((Bc(e)||Lc(e))&&n(e=Vc(i.prev,!0)))return e;for(;e=Vc(i.prev,o);)if(n(e))return e}if(Uc(t)){if((Bc(e)||Lc(e))&&n(e=Vc(i.next,!0)))return e;for(;e=Vc(i.next,o);)if(n(e))return e}return null},Hc=function(e,t){for(;e&&e!==t;){if(Oc(e))return e;e=e.parentNode}return null},jc=function(e,t,n){return Hc(e.container(),n)===Hc(t.container(),n)},$c=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),Mc(n)?n.childNodes[r+e]:null):null},Wc=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},Kc=function(e,t,n){var r,o,i,a;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],Pc(r)&&(r=r[o]),Bc(r)){if(a=n,Hc(r,i=t)===Hc(a,i))return r;break}if(Fc(r))break;n=n.parentNode}return null},Xc=Ic(Wc,!0),Yc=Ic(Wc,!1),Gc=function(e,t,n){var r,o,i,a,u=Ic(Kc,!0,t),s=Ic(Kc,!1,t);if(o=n.startContainer,i=n.startOffset,Ta(o)){if(Mc(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,Dc(r)))return Xc(r);if("after"===a&&(r=o.previousSibling,Dc(r)))return Yc(r)}if(!n.collapsed)return n;if(Do.isText(o)){if(Pc(o)){if(1===e){if(r=s(o))return Xc(r);if(r=u(o))return Yc(r)}if(-1===e){if(r=u(o))return Yc(r);if(r=s(o))return Xc(r)}return n}if(Pa(o)&&i>=o.data.length-1)return 1===e&&(r=s(o))?Xc(r):n;if(Oa(o)&&i<=1)return-1===e&&(r=u(o))?Yc(r):n;if(i===o.data.length)return(r=s(o))?Xc(r):n;if(0===i)return(r=u(o))?Yc(r):n}return n},Jc=function(e,t){var n=$c(e,t);return Bc(n)&&!Do.isBogusAll(n)},Qc=function(e,t){return Do.isTable($c(e,t))},Zc=function(e,t){return A.from($c(e?0:-1,t)).filter(Bc)},el=function(e,t,n){var r=Gc(e,t,n);return-1===e?wu.fromRangeStart(r):wu.fromRangeEnd(r)},tl=Ic(Jc,0),nl=Ic(Jc,-1),rl=Ic(Qc,0),ol=Ic(Qc,-1),il=function(e){return Su.isTextPosition(e)?0===e.offset():ja(e.getNode())},al=function(e){if(Su.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return ja(e.getNode(!0))},ul=function(e,t){return!Su.isTextPosition(e)&&!Su.isTextPosition(t)&&e.getNode()===t.getNode(!0)},sl=function(e,t,n){return e?!ul(t,n)&&(r=t,!(!Su.isTextPosition(r)&&Do.isBr(r.getNode())))&&al(t)&&il(n):!ul(n,t)&&il(t)&&al(n);var r},cl=function(e,t,n){var r=Ns(t);return A.from(e?r.next(n):r.prev(n))},ll=function(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return Do.isText(u)?A.some(Su(u,e?0:u.data.length)):u?ja(u)?A.some(e?Su.before(u):(a=u,Do.isBr(a)?Su.before(a):Su.after(a))):(r=t,o=u,i=(n=e)?Su.before(o):Su.after(o),cl(n,r,i)):A.none()},fl={fromPosition:cl,nextPosition:b(cl,!0),prevPosition:b(cl,!1),navigate:function(t,n,r){return cl(t,n,r).bind(function(e){return jc(r,e,n)&&sl(t,r,e)?cl(t,n,e):A.some(e)})},positionIn:ll,firstPositionIn:b(ll,!0),lastPositionIn:b(ll,!1)},dl=function(e,t){return!e.isBlock(t)||t.innerHTML||Re.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t},ml=function(e,t){return fl.lastPositionIn(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},gl=function(e,t,n){return!(!1!==t.hasChildNodes()||!Xu(e,t)||(o=n,i=(r=t).ownerDocument.createTextNode(wa),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},pl=function(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,gl(c,i,r))return!0;if(s[o]>u.length-1)return!!gl(c,i,r)||ml(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)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},hl=function(e){return Do.isText(e)&&0<e.data.length},vl=function(e,t,n){var r,o,i,a,u,s,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,"start"===t?l?c.hasChildNodes()?(r=c.firstChild,o=1):hl(c.nextSibling)?(r=c.nextSibling,o=0):hl(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)+1):o=e.nodeIndex(c):l?c.hasChildNodes()?(r=c.firstChild,o=1):hl(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)):o=e.nodeIndex(c),u=r,s=o,!l){for(a=c.previousSibling,i=c.nextSibling,Yt.each(Yt.grep(c.childNodes),function(e){Do.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&Do.isText(a)&&!Re.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return A.some(Su(u,s))}return A.none()},bl=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b=e.dom;if(t){if(v=t,Yt.isArray(v.start))return p=t,h=(g=b).createRng(),pl(g,!0,p,h)&&pl(g,!1,p,h)?A.some(h):A.none();if("string"==typeof t.start)return A.some((f=t,d=(l=b).createRng(),m=Pu(l.getRoot(),f.start),d.setStart(m.container(),m.offset()),m=Pu(l.getRoot(),f.end),d.setEnd(m.container(),m.offset()),d));if(t.hasOwnProperty("id"))return s=vl(o=b,"start",i=t),c=vl(o,"end",i),ru([s,(a=c,u=s,a.isSome()?a:u)],function(e,t){var n=o.createRng();return n.setStart(dl(o,e.container()),e.offset()),n.setEnd(dl(o,t.container()),t.offset()),n});if(t.hasOwnProperty("name"))return n=b,r=t,A.from(n.select(r.name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.hasOwnProperty("rng"))return A.some(t.rng)}return A.none()},yl=function(e,t,n){return $u.getBookmark(e,t,n)},Cl=function(t,e){bl(t,e).each(function(e){t.setRng(e)})},xl=function(e){return Do.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},wl=function(e){return e&&/^(IMG)$/.test(e.nodeName)},Nl=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},El=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},Sl={isInlineBlock:wl,moveStart:function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!wl(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?r=new oo(u=i[a],e.getParent(u,e.isBlock)):(r=new oo(u=i[i.length-1],e.getParent(u,e.isBlock))).next(!0),o=r.current();o;o=r.next())if(3===o.nodeType&&!Nl(o))return n.setStart(o,0),void t.setRng(n)},getNonWhiteSpaceSibling:function(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1===e.nodeType||!Nl(e))return e},isTextBlock:function(e,t){return t.nodeType&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},isValid:function(e,t,n){return e.schema.isValidChild(t,n)},isWhiteSpaceNode:Nl,replaceVars:function(e,n){return"string"!=typeof e?e=e(n):n&&(e=e.replace(/%(\w+)/g,function(e,t){return n[t]||e})),e},isEq:function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},normalizeStyleValue:El,getStyle:function(e,t,n){return El(e,e.getStyle(t,n),n)},getTextDecoration:function(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n},getParents:function(e,t,n){return e.getParents(t,n,e.getRoot())}},Tl=xl,kl=Sl.getParents,Al=Sl.isWhiteSpaceNode,_l=Sl.isTextBlock,Rl=function(e,t){for(void 0===t&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)(e=e.childNodes[t])&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}},Dl=function(e,t){for(var n=t;n;){if(1===n.nodeType&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},Bl=function(e,t,n,r){var o,i,a=n.nodeValue;return void 0===r&&(r=e?a.length:0),e?(o=a.lastIndexOf(" ",r),-1===(o=(i=a.lastIndexOf("\xa0",r))<o?o:i)||t||o++):(o=a.indexOf(" ",r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},Ol=function(e,t,n,r,o,i){var a,u,s,c;if(3===n.nodeType){if(-1!==(s=Bl(o,i,n,r)))return{container:n,offset:s};c=n}for(a=new oo(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3!==u.nodeType||Tl(u.parentNode)){if(e.isBlock(u)||Sl.isEq(u,"BR"))break}else if(-1!==(s=Bl(o,i,c=u)))return{container:u,offset:s};if(c)return{container:c,offset:r=o?0:c.length}},Pl=function(e,t,n,r,o){var i,a,u,s;for(3===r.nodeType&&0===r.nodeValue.length&&r[o]&&(r=r[o]),i=kl(e,r),a=0;a<i.length;a++)for(u=0;u<t.length;u++)if(!("collapsed"in(s=t[u])&&s.collapsed!==n.collapsed)&&e.is(i[a],s.selector))return i[a];return r},Ll=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(3===n.nodeType?n.parentNode:n,function(e){return e!==a&&_l(t,e)},u)}if(o&&e[0].wrapper&&(o=kl(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Sl.isEq(o,"br")););return o||n},Il=function(e,t,n,r,o,i,a){var u,s,c,l,f,d;if(u=s=a?n:o,l=a?"previousSibling":"nextSibling",f=e.getRoot(),3===u.nodeType&&!Al(u)&&(a?0<r:i<u.nodeValue.length))return u;for(;;){if(!t[0].block_expand&&e.isBlock(s))return s;for(c=s[l];c;c=c[l])if(!Tl(c)&&!Al(c)&&("BR"!==(d=c).nodeName||!d.getAttribute("data-mce-bogus")||d.nextSibling))return s;if(s===f||s.parentNode===f){u=s;break}s=s.parentNode}return u},Ml=function(e,t,n,r){var o,i=t.startContainer,a=t.startOffset,u=t.endContainer,s=t.endOffset,c=e.dom;return 1===i.nodeType&&i.hasChildNodes()&&3===(i=eu(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=eu(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=Dl(c,i),u=Dl(c,u),(Tl(i.parentNode)||Tl(i))&&(i=Tl(i)?i:i.parentNode,3===(i=t.collapsed?i.previousSibling||i:i.nextSibling||i).nodeType&&(a=t.collapsed?i.length:0)),(Tl(u.parentNode)||Tl(u))&&(u=Tl(u)?u:u.parentNode,3===(u=t.collapsed?u.nextSibling||u:u.previousSibling||u).nodeType&&(s=t.collapsed?0:u.length)),t.collapsed&&((o=Ol(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=Ol(c,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),n[0].inline&&(u=r?u:function(e,t){var n=Rl(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=Rl(n.node.previousSibling);n.node&&0<n.offset&&3===n.node.nodeType&&" "===n.node.nodeValue.charAt(n.offset-1)&&1<n.offset&&(e=n.node).splitText(n.offset-1)}return e}(u,s)),(n[0].inline||n[0].block_expand)&&(n[0].inline&&3===i.nodeType&&0!==a||(i=Il(c,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=Il(c,n,i,a,u,s,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(i=Pl(c,n,t,i,"previousSibling"),u=Pl(c,n,t,u,"nextSibling")),(n[0].block||n[0].selector)&&(i=Ll(e,n,i,"previousSibling"),u=Ll(e,n,u,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=Il(c,n,i,a,u,s,!0)),c.isBlock(u)||(u=Il(c,n,i,a,u,s,!1)))),1===i.nodeType&&(a=c.nodeIndex(i),i=i.parentNode),1===u.nodeType&&(s=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:i,startOffset:a,endContainer:u,endOffset:s}},Fl=Yt.each,Ul=function(e,t,o){var n,r,i,a,u,s,c,l=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset;if(0<(c=e.select("td[data-mce-selected],th[data-mce-selected]")).length)Fl(c,function(e){o([e])});else{var g,p,h,v=function(e){var t;return 3===(t=e[0]).nodeType&&t===l&&f>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0<e.length&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e},b=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},y=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},C=function(e,t,n){var r=n?"nextSibling":"previousSibling";for(u=(a=e).parentNode;a&&a!==t;a=u)u=a.parentNode,(s=b(a===e?a:a[r],r)).length&&(n||s.reverse(),o(v(s)))};if(1===l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(p=m,h=(g=d).childNodes,--p>h.length-1?p=h.length-1:p<0&&(p=0),d=h[p]||g),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=y(l,n)||l,i=y(d,n)||d,C(l,r,!0),(s=b(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},zl=(Es=sr.isText,Ss="text",Ts=function(e){return Es(e)?A.from(e.dom().nodeValue):A.none()},ks=Qn.detect().browser,{get:function(e){if(!Es(e))throw new Error("Can only get "+Ss+" value of a "+Ss+" node");return As(e).getOr("")},getOption:As=ks.isIE()&&10===ks.version.major?function(e){try{return Ts(e)}catch(nN){return A.none()}}:Ts,set:function(e,t){if(!Es(e))throw new Error("Can only set raw "+Ss+" value of a "+Ss+" node");e.dom().nodeValue=t}}),Vl=function(e){return zl.get(e)},ql=function(r,o,i,a){return $r.parent(o).fold(function(){return"skipping"},function(e){return"br"===a||(n=o,sr.isText(n)&&"\ufeff"===Vl(n))?"skipping":(t=o,sr.isElement(t)&&Wi.has(t,oa())?"existing":Ku(o)?"caret":Sl.isValid(r,i,a)&&Sl.isValid(r,sr.name(e),i)?"valid":"invalid-child");var t,n})},Hl=undefined&&undefined.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n},jl=function(r,e,t,n,o){var i,a,u=o.uid,s=void 0===u?(i="mce-annotation",a=(new Date).getTime(),i+"_"+Math.floor(1e9*Math.random())+ ++fa+String(a)):u,c=Hl(o,["uid"]),l=[],f=er.fromTag("span");Wi.add(f,oa()),hr.set(f,""+aa(),s),hr.set(f,""+ia(),t);var d=n(s,c),m=d.attributes,g=void 0===m?{}:m,p=d.classes,h=void 0===p?[]:p;hr.setAll(f,g),da(f,h);var v=Bi(A.none()),b=function(){v.set(A.none())},y=function(e){F(e,C)},C=function(e){switch(ql(r,e,"span",sr.name(e))){case"invalid-child":b();var t=$r.children(e);y(t),b();break;case"valid":var n=v.get().getOrThunk(function(){var e=pa(f);return l.push(e),v.set(A.some(e)),e});Ti.wrap(e,n)}};return Ul(r.dom,e,function(e){var t;b(),t=$(e,er.fromDom),y(t)}),l},$l=function(a,u,s,c){a.undoManager.transact(function(){var e,t,n,r=a.selection.getRng();r.collapsed&&(n=Ml(e=a,t=r,[{inline:!0}],!1),t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t));var o=$u.getPersistentBookmark(a.selection,!0),i=a.selection.getRng();jl(a,i,u,s.decorate,c),a.selection.moveToBookmark(o)})};function Wl(s){var n,r=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return n.hasOwnProperty(e)?A.from(n[e]).map(function(e){return e.settings}):A.none()}});la(s,r);var o=ca(s);return{register:function(e,t){r.register(e,t)},annotate:function(t,n){r.lookup(t).each(function(e){$l(s,t,e,n)})},annotationChanged:function(e,t){o.addListener(e,t)},remove:function(e){ua(s,A.some(e)).each(function(e){var t=e.elements;F(t,Ri.unwrap)})},getAll:function(e){var t,n,r,o,i,a,u=(t=s,n=e,r=er.fromDom(t.getBody()),o=Ki(r,"["+ia()+'="'+n+'"]'),i={},F(o,function(e){var t=hr.get(e,aa()),n=i.hasOwnProperty(t)?i[t]:[];i[t]=n.concat([e])}),i);return a=function(e){return $(e,function(e){return e.dom()})},fr(u,function(e,t,n){return{k:t,v:a(e,t,n)}})}}}var Kl=function(e){return Yt.grep(e.childNodes,function(e){return"LI"===e.nodeName})},Xl=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||Do.isBr(t));var t},Yl=function(e){return 0<e.length&&(!(t=e[e.length-1]).firstChild||Xl(t))?e.slice(0,-1):e;var t},Gl=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Jl=function(e,t){var n=Su.after(e),r=Ns(t).prev(n);return r?r.toRange():null},Ql=function(t,e,n){var r,o,i,a,u=t.parentNode;return Yt.each(e,function(e){u.insertBefore(e,t)}),r=t,o=n,i=Su.before(r),(a=Ns(o).next(i))?a.toRange():null},Zl=function(e,t){var n,r,o,i,a,u,s=t.firstChild,c=t.lastChild;return s&&"meta"===s.name&&(s=s.next),c&&"mce_marker"===c.attr("id")&&(c=c.prev),r=c,u=(n=e).getNonEmptyElements(),r&&(r.isEmpty(u)||(o=r,n.getBlockElements()[o.name]&&(a=o).firstChild&&a.firstChild===a.lastChild&&("br"===(i=o.firstChild).name||"\xa0"===i.value)))&&(c=c.prev),!(!s||s!==c||"ul"!==s.name&&"ol"!==s.name)},ef=function(e,o,i,t){var n,r,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x,w,N=(n=o,r=t,c=e.serialize(r),l=n.createFragment(c),u=(a=l).firstChild,s=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),s&&"mce_marker"===s.id&&s.parentNode.removeChild(s),a),E=Gl(o,i.startContainer),S=Yl(Kl(N.firstChild)),T=o.getRoot(),k=function(e){var t=Su.fromRangeStart(i),n=Ns(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||Gl(o,r.getNode())!==E};return k(1)?Ql(E,S,T):k(2)?(f=E,d=S,m=T,o.insertAfter(d.reverse(),f),Jl(d[0],m)):(p=S,h=T,v=g=E,y=(b=i).cloneRange(),C=b.cloneRange(),y.setStartBefore(v),C.setEndAfter(v),x=[y.cloneContents(),C.cloneContents()],(w=g.parentNode).insertBefore(x[0],g),Yt.each(p,function(e){w.insertBefore(e,g)}),w.insertBefore(x[1],g),w.removeChild(g),Jl(p[p.length-1],h))},tf=function(e,t){return!!Gl(e,t)},nf=Yt.each,rf=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return nf(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!(!r(n(e),n(t))||!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))||xl(e)||xl(t))}},of=function(e){var t=Ki(e,"br"),n=U(function(e){for(var t=[],n=e.dom();n;)t.push(er.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),mo);t.length===n.length&&F(n,Ri.remove)},af=function(e){Ri.empty(e),Ti.append(e,er.fromHtml('<br data-mce-bogus="1">'))},uf=function(n){$r.lastChild(n).each(function(t){$r.prevSibling(t).each(function(e){lo(n)&&mo(t)&&lo(e)&&Ri.remove(t)})})},sf=Yt.makeMap;function cf(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=sf(e.indent_before||""),c=sf(e.indent_after||""),l=$o.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n"),d.push("<",e),t)for(r=0,o=t.length;r<o;r++)i=t[r],d.push(" ",i.name,'="',l(i.value,!0),'"');d[d.length]=!n||f?">":" />",n&&u&&c[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n")},end:function(e){var t;d.push("</",e,">"),u&&c[e]&&0<d.length&&0<(t=d[d.length-1]).length&&"\n"!==t&&d.push("\n")},text:function(e,t){0<e.length&&(d[d.length]=t?e:l(e))},cdata:function(e){d.push("<![CDATA[",e,"]]>")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push("<?",e," ",l(t),"?>"):d.push("<?",e,"?>"),u&&d.push("\n")},doctype:function(e){d.push("<!DOCTYPE",e,">",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function lf(t,g){void 0===g&&(g=ni());var p=cf(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1<r.length&&((a=[]).map={},c=g.getElementRule(e.name))){for(u=0,s=c.attributesOrder.length;u<s;u++)(o=c.attributesOrder[u])in r.map&&(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));for(u=0,s=r.length;u<s;u++)(o=r[u].name)in a.map||(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));r=a}if(p.start(e.name,r,n),!n){if(e=e.firstChild)for(;m(e),e=e.next;);p.end(t)}}};return 1!==e.type||t.inner?f[11](e):m(e),p.getContent()}}}var ff=function(a){var u=Su.fromRangeStart(a),s=Su.fromRangeEnd(a),c=a.commonAncestorContainer;return fl.fromPosition(!1,c,s).map(function(e){return!jc(u,s,c)&&jc(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},df=function(e){return e.collapsed?e:ff(e)},mf=Do.matchNodeNames("td th"),gf=function(o,e,t){var n,r,i,a,u,s,c,l,f,d,m,g,p=o.schema.getTextInlineElements(),h=o.selection,v=o.dom;if(/^ | $/.test(e)&&(e=function(e){var t,n,r;t=h.getRng(),n=t.startContainer,r=t.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(0<r?e=e.replace(/^ /," "):o("previousSibling")||(e=e.replace(/^ /," ")),r<n.length?e=e.replace(/ (<br>|)$/," "):o("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}(e)),n=o.parser,g=t.merge,r=lf({validate:o.settings.validate},o.schema),m='<span id="mce_marker" data-mce-type="bookmark">​</span>',s={content:e,format:"html",selection:!0,paste:t.paste},(s=o.fire("BeforeSetContent",s)).isDefaultPrevented())o.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:t.paste});else{-1===(e=s.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,m);var b,y,C,x,w=(l=h.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=o.getBody();w===N&&h.isCollapsed()&&v.isBlock(N.firstChild)&&(b=N.firstChild)&&!o.schema.getShortEndedElements()[b.nodeName]&&v.isEmpty(N.firstChild)&&((l=v.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),h.setRng(l)),h.isCollapsed()||(o.selection.setRng(df(o.selection.getRng())),o.getDoc().execCommand("Delete",!1,null),C=(y=h.getRng()).startContainer,x=y.startOffset,3===C.nodeType&&y.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(e)||(e+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(e)||(e=" "+e))));var E,S,T,k={context:(i=h.getNode()).nodeName.toLowerCase(),data:t.data,insert:!0};if(u=n.parse(e,k),!0===t.paste&&Zl(o.schema,u)&&tf(v,i))return l=ef(r,v,o.selection.getRng(),u),o.selection.setRng(l),void o.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!v.isBlock(f.name)){o.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(o._selectionOverrides.showBlockCaretContainer(i),k.invalid){for(h.setContent(m),i=h.getNode(),a=o.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;e=i===a?a.innerHTML:v.getOuterHTML(i),e=r.serialize(n.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return r.serialize(u)}))),i===a?v.setHTML(a,e):v.setOuterHTML(i,e)}else e=r.serialize(u),function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):e.selection.setContent(t)}}(o,e,i);!function(){if(g){var n=o.getBody(),r=new rf(v);Yt.each(v.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==n;t=t.parentNode)p[e.nodeName.toLowerCase()]&&r.compare(t,e)&&v.remove(e,!0)})}}(),function(e){var t,n,r;if(e){if(h.scrollIntoView(e),t=function(e){for(var t=o.getBody();e&&e!==t;e=e.parentNode)if("false"===o.dom.getContentEditable(e))return e;return null}(e))return v.remove(e),h.select(t);l=v.createRng(),(f=e.previousSibling)&&3===f.nodeType?(l.setStart(f,f.nodeValue.length),Re.ie||(d=e.nextSibling)&&3===d.nodeType&&(f.appendData(d.data),d.parentNode.removeChild(d))):(l.setStartBefore(e),l.setEndBefore(e)),n=v.getParent(e,v.isBlock),v.remove(e),n&&v.isEmpty(n)&&(o.$(n).empty(),l.setStart(n,0),l.setEnd(n,0),mf(n)||n.getAttribute("data-mce-fragment")||!(r=function(e){var t=Su.fromRangeStart(e);if(t=Ns(o.getBody()).next(t))return t.toRange()}(l))?v.add(n,v.create("br",{"data-mce-bogus":"1"})):(l=r,v.remove(n))),h.setRng(l)}}(v.get("mce_marker")),E=o.getBody(),Yt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=o.dom,T=o.selection.getStart(),A.from(S.getParent(T,"td,th")).map(er.fromDom).each(uf),o.fire("SetContent",s),o.addVisual()}},pf=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Yt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};gf(e,o.content,o.details)},hf=kr("sections","settings"),vf=Qn.detect().deviceType.isTouch(),bf=["lists","autolink","autosave"],yf={theme:"mobile"},Cf=function(e){var t=R(e)?e.join(" "):e,n=$(k(t)?t.split(" "):[],$n);return U(n,function(e){return 0<e.length})},xf=function(n,e){var r,o,i,t=(r=function(e,t){return I(n,t)},o={},i={},lr(e,function(e,t){(r(e,t)?o:i)[t]=e}),{t:o,f:i});return hf(t.t,t.f)},wf=function(e,t){return e.sections().hasOwnProperty(t)},Nf=function(e,t,n,r){var o,i=Cf(n.forced_plugins),a=Cf(r.plugins),u=e&&wf(t,"mobile")?U(a,b(I,bf)):a,s=(o=u,[].concat(Cf(i)).concat(Cf(o)));return Yt.extend(r,{plugins:s.join(" ")})},Ef=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=xf(["mobile"],r),p=Yt.extend(t,n,g.settings(),(f=e,m=(d=g).settings().inline,f&&wf(d,"mobile")&&!m?(u="mobile",s=yf,c=g.sections(),l=c.hasOwnProperty(u)?c[u]:{},Yt.extend({},s,l)):{}),{validate:!0,content_editable:g.settings().inline,external_plugins:(o=n,i=g.settings(),a=i.external_plugins?i.external_plugins:{},o&&o.external_plugins?Yt.extend({},o.external_plugins,a):a)});return Nf(e,g,n,p)},Sf=function(e,t,n){return A.from(t.settings[n]).filter(e)},Tf=b(Sf,k),kf=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?F(0<i.indexOf("=")?i.split(/[;,](?![^=;,]*(?:[;,]|$))/):i.split(","),function(e){var t=e.split("=");1<t.length?a[Yt.trim(t[0])]=Yt.trim(t[1]):a[Yt.trim(t[0])]=Yt.trim(t)}):a=i,a):"string"===r?Sf(k,e,t).getOr(n):"number"===r?Sf(P,e,t).getOr(n):"boolean"===r?Sf(B,e,t).getOr(n):"object"===r?Sf(_,e,t).getOr(n):"array"===r?Sf(R,e,t).getOr(n):"string[]"===r?Sf((o=k,function(e){return R(e)&&J(e,o)}),e,t).getOr(n):"function"===r?Sf(O,e,t).getOr(n):u},Af=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,_f=function(e,t){var n=t.container(),r=t.offset();return e?ka(n)?Do.isText(n.nextSibling)?Su(n.nextSibling,0):Su.after(n):Ra(t)?Su(n,r+1):t:ka(n)?Do.isText(n.previousSibling)?Su(n.previousSibling,n.previousSibling.data.length):Su.before(n):Da(t)?Su(n,r-1):t},Rf={isInlineTarget:function(e,t){var n=Tf(e,"inline_boundaries_selector").getOr("a[href],code");return Lr.is(er.fromDom(t),n)},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,U(pi.DOM.getParents(i.container(),"*",o),r));return A.from(a[a.length-1])},isRtl:function(e){return"rtl"===pi.DOM.getStyle(e,"direction",!0)||(t=e.textContent,Af.test(t));var t},isAtZwsp:function(e){return Ra(e)||Da(e)},normalizePosition:_f,normalizeForwards:b(_f,!0),normalizeBackwards:b(_f,!1),hasSameParentBlock:function(e,t,n){var r=Hc(t,e),o=Hc(n,e);return r&&r===o}},Df=function(e,t){return Fr.contains(e,t)?Zi.closest(t,function(e){return go(e)||ho(e)},(n=e,function(e){return Fr.eq(n,er.fromDom(e.dom().parentNode))})):A.none();var n},Bf=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},Of=function(i,a,u){return ru([fl.firstPositionIn(u),fl.lastPositionIn(u)],function(e,t){var n=Rf.normalizePosition(!0,e),r=Rf.normalizePosition(!1,t),o=Rf.normalizePosition(!1,a);return i?fl.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):fl.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Pf=function(e,t,n){return ta(e,t,n).isSome()},Lf=function(e,t){return Do.isText(t)&&/^[ \t\r\n]*$/.test(t.data)&&!1===(n=e,r=t,o=er.fromDom(n),i=er.fromDom(r),Pf(i,"pre,code",b(Fr.eq,o)));var n,r,o,i},If=function(e,t){return ja(t)&&!1===Lf(e,t)||(n=t,Do.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||Mf(t);var n},Mf=Do.hasAttribute("data-mce-bookmark"),Ff=Do.hasAttribute("data-mce-bogus"),Uf=Do.hasAttributeValue("data-mce-bogus","all"),zf=function(e){return function(e){var t,n,r=0;if(If(e,e))return!1;if(!(n=e.firstChild))return!0;t=new oo(n,e);do{if(Uf(n))n=t.next(!0);else if(Ff(n))n=t.next();else if(Do.isBr(n))r++,n=t.next();else{if(If(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Vf=kr("block","position"),qf=kr("from","to"),Hf=function(e,t){var n=er.fromDom(e),r=er.fromDom(t.container());return Df(n,r).map(function(e){return Vf(e,t)})},jf=function(o,i,e){var t=Hf(o,Su.fromRangeStart(e)),n=t.bind(function(e){return fl.fromPosition(i,o,e.position()).bind(function(e){return Hf(o,e).map(function(e){return t=o,n=i,r=e,Do.isBr(r.position().getNode())&&!1===zf(r.block())?fl.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?fl.fromPosition(n,t,e).bind(function(e){return Hf(t,e)}):A.some(r)}).getOr(r):r;var t,n,r})})});return ru([t,n],qf).filter(function(e){return r=e,!1===Fr.eq(r.from().block(),r.to().block())&&(n=e,$r.parent(n.from().block()).bind(function(t){return $r.parent(n.to().block()).filter(function(e){return Fr.eq(t,e)})}).isSome())&&(t=e,!1===Do.isContentEditableFalse(t.from().block())&&!1===Do.isContentEditableFalse(t.to().block()));var t,n,r})},$f=function(e,t,n){return n.collapsed?jf(e,t,n):A.none()},Wf=function(e,t,n){return Fr.contains(t,e)?$r.parents(e,function(e){return n(e)||Fr.eq(e,t)}).slice(0,-1):[]},Kf=function(e,t){return Wf(e,t,H(!1))},Xf=Kf,Yf=function(e,t){return[e].concat(Kf(e,t))},Gf=function(e){var t,n,r=(t=e,n=$r.children(t),K(n,lo).fold(function(){return n},function(e){return n.slice(0,e)}));return F(r,Ri.remove),r},Jf=function(e,t){var n=Yf(t,e);return V(n.reverse(),zf).each(Ri.remove)},Qf=function(e,t,n,r){if(zf(n))return af(n),fl.firstPositionIn(n.dom());var o;o=r,0===U($r.prevSiblings(o),function(e){return!zf(e)}).length&&zf(t)&&Ti.before(r,er.fromTag("br"));var i=fl.prevPosition(n.dom(),Su.before(r.dom()));return F(Gf(t),function(e){Ti.before(r,e)}),Jf(e,t),i},Zf=function(e,t,n){if(zf(n))return Ri.remove(n),zf(t)&&af(t),fl.firstPositionIn(t.dom());var r=fl.lastPositionIn(n.dom());return F(Gf(t),function(e){Ti.append(n,e)}),Jf(e,t),r},ed=function(e,t){return Fr.contains(t,e)?(n=Yf(e,t),A.from(n[n.length-1])):A.none();var n},td=function(e,t){fl.positionIn(e,t.dom()).map(function(e){return e.getNode()}).map(er.fromDom).filter(mo).each(Ri.remove)},nd=function(e,t,n){return td(!0,t),td(!1,n),ed(t,n).fold(b(Zf,e,t,n),b(Qf,e,t,n))},rd=function(e,t,n,r){return t?nd(e,r,n):nd(e,n,r)},od=function(t,n){var e,r=er.fromDom(t.getBody());return(e=$f(r.dom(),n,t.selection.getRng()).bind(function(e){return rd(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},id=function(e,t){var n=er.fromDom(t),r=b(Fr.eq,e);return Zi.ancestor(n,yo,r).isSome()},ad=function(e,t){var n,r,o=fl.prevPosition(e.dom(),Su.fromRangeStart(t)).isNone(),i=fl.nextPosition(e.dom(),Su.fromRangeEnd(t)).isNone();return!(id(n=e,(r=t).startContainer)||id(n,r.endContainer))&&o&&i},ud=function(e){var n,r,o,t,i=er.fromDom(e.getBody()),a=e.selection.getRng();return ad(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),ru([Df(n,er.fromDom(o.startContainer)),Df(n,er.fromDom(o.endContainer))],function(e,t){return!1===Fr.eq(e,t)&&(o.deleteContents(),rd(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},sd=function(e,t){return!e.selection.isCollapsed()&&ud(e)},cd=function(a){if(!R(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return F(a,function(e,r){var t=cr(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!R(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=cr(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!J(u,function(e){return I(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:o,params:n})}}}}),n},ld=cd([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),fd=function(e,t,n,r){var o=r.getNode(!1===t);return Df(er.fromDom(e),er.fromDom(n.getNode())).map(function(e){return zf(e)?ld.remove(e.dom()):ld.moveToElement(o)}).orThunk(function(){return A.some(ld.moveToElement(o))})},dd=function(u,s,c){return fl.fromPosition(s,u,c).bind(function(e){return a=e.getNode(),yo(er.fromDom(a))||ho(er.fromDom(a))?A.none():(t=u,o=e,i=function(e){return fo(er.fromDom(e))&&!jc(r,o,t)},Zc(!(n=s),r=c).fold(function(){return Zc(n,o).fold(H(!1),i)},i)?A.none():s&&Do.isContentEditableFalse(e.getNode())?fd(u,s,c,e):!1===s&&Do.isContentEditableFalse(e.getNode(!0))?fd(u,s,c,e):s&&nl(c)?A.some(ld.moveToPosition(e)):!1===s&&tl(c)?A.some(ld.moveToPosition(e)):A.none());var t,n,r,o,i,a})},md=function(r,e,o){return i=e,a=o.getNode(!1===i),u=i?"after":"before",Do.isElement(a)&&a.getAttribute("data-mce-caret")===u?(t=e,n=o.getNode(!1===e),t&&Do.isContentEditableFalse(n.nextSibling)?A.some(ld.moveToElement(n.nextSibling)):!1===t&&Do.isContentEditableFalse(n.previousSibling)?A.some(ld.moveToElement(n.previousSibling)):A.none()).fold(function(){return dd(r,e,o)},A.some):dd(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return A.some(ld.remove(e))},function(e){return A.some(ld.moveToElement(e))},function(e){return jc(n,e,t)?A.none():A.some(ld.moveToPosition(e))});var t,n});var t,n,i,a,u},gd=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===Su.isTextPosition(n)&&o===r.parentNode&&i>Su.before(r).offset()?Su(t.container(),t.offset()-1):t;var n,r,o,i},pd=function(e){return ja(e.previousSibling)?A.some((t=e.previousSibling,Do.isText(t)?Su(t,t.data.length):Su.after(t))):e.previousSibling?fl.lastPositionIn(e.previousSibling):A.none();var t},hd=function(e){return ja(e.nextSibling)?A.some((t=e.nextSibling,Do.isText(t)?Su(t,0):Su.before(t))):e.nextSibling?fl.firstPositionIn(e.nextSibling):A.none();var t},vd=function(r,o){return pd(o).orThunk(function(){return hd(o)}).orThunk(function(){return e=r,t=o,n=Su.before(t.previousSibling?t.previousSibling:t.parentNode),fl.prevPosition(e,n).fold(function(){return fl.nextPosition(e,Su.after(t))},A.some);var e,t,n})},bd=function(n,r){return hd(r).orThunk(function(){return pd(r)}).orThunk(function(){return e=n,t=r,fl.nextPosition(e,Su.after(t)).fold(function(){return fl.prevPosition(e,Su.before(t))},A.some);var e,t})},yd=function(e,t,n){return(r=e,o=t,i=n,r?bd(o,i):vd(o,i)).map(b(gd,n));var r,o,i},Cd=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},xd=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(sr.name(t))},wd=function(e){if(zf(e)){var t=er.fromHtml('<br data-mce-bogus="1">');return Ri.empty(e),Ti.append(e,t),A.some(Su.before(t.dom()))}return A.none()},Nd=function(t,n,e){var r,a,o,i=yd(n,t.getBody(),e.dom()),u=Zi.ancestor(e,b(xd,t),(r=t.getBody(),function(e){return e.dom()===r})),s=(a=e,o=i,ru([$r.prevSibling(a),$r.nextSibling(a),o],function(e,t,n){var r,o=e.dom(),i=t.dom();return Do.isText(o)&&Do.isText(i)?(r=o.data.length,o.appendData(i.data),Ri.remove(t),Ri.remove(a),n.container()===i?Su(o,r):n):(Ri.remove(a),n)}).orThunk(function(){return Ri.remove(a),o}));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(wd).fold(function(){Cd(t,n,s)},function(e){Cd(t,n,A.some(e))})},Ed=function(a,u){var e,t,n,r,o;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=Gc(t?1:-1,e,n),o=Su.fromRangeStart(r),!1===t&&nl(o)?A.some(ld.remove(o.getNode(!0))):t&&tl(o)?A.some(ld.remove(o.getNode())):md(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),Nd(o,i,er.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?Su.before(e):Su.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},Sd=function(e,t){var n,r=e.selection.getNode();return!!Do.isContentEditableFalse(r)&&(n=er.fromDom(e.getBody()),F(Ki(n,".mce-offscreen-selection"),Ri.remove),Nd(e,t,er.fromDom(e.selection.getNode())),Bf(e),!0)},Td=function(e,t){return e.selection.isCollapsed()?Ed(e,t):Sd(e,t)},kd=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(Do.isContentEditableTrue(t)||Do.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return Do.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(Su.before(t).toRange())),!0},Ad=Do.isText,_d=function(e){return Ad(e)&&e.data[0]===wa},Rd=function(e){return Ad(e)&&e.data[e.data.length-1]===wa},Dd=function(e){return e.ownerDocument.createTextNode(wa)},Bd=function(e,t){return e?function(e){if(Ad(e.previousSibling))return Rd(e.previousSibling)||e.previousSibling.appendData(wa),e.previousSibling;if(Ad(e))return _d(e)||e.insertData(0,wa),e;var t=Dd(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(Ad(e.nextSibling))return _d(e.nextSibling)||e.nextSibling.insertData(0,wa),e.nextSibling;if(Ad(e))return Rd(e)||e.appendData(wa),e;var t=Dd(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},Od=b(Bd,!0),Pd=b(Bd,!1),Ld=function(e,t){return Do.isText(e.container())?Bd(t,e.container()):Bd(t,e.getNode())},Id=function(e,t){var n=t.get();return n&&e.container()===n&&ka(n)},Md=function(n,e){return e.fold(function(e){os.remove(n.get());var t=Od(e);return n.set(t),A.some(Su(t,t.length-1))},function(e){return fl.firstPositionIn(e).map(function(e){if(Id(e,n))return Su(n.get(),1);os.remove(n.get());var t=Ld(e,!0);return n.set(t),Su(t,1)})},function(e){return fl.lastPositionIn(e).map(function(e){if(Id(e,n))return Su(n.get(),n.get().length-1);os.remove(n.get());var t=Ld(e,!1);return n.set(t),Su(t,t.length-1)})},function(e){os.remove(n.get());var t=Pd(e);return n.set(t),A.some(Su(t,1))})},Fd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return A.none()},Ud=cd([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),zd=function(e,t){var n=Hc(t,e);return n||e},Vd=function(e,t,n){var r=Rf.normalizeForwards(n),o=zd(t,r.container());return Rf.findRootInline(e,o,r).fold(function(){return fl.nextPosition(o,r).bind(b(Rf.findRootInline,e,o)).map(function(e){return Ud.before(e)})},A.none)},qd=function(e,t){return null===Xu(e,t)},Hd=function(e,t,n){return Rf.findRootInline(e,t,n).filter(b(qd,t))},jd=function(e,t,n){var r=Rf.normalizeBackwards(n);return Hd(e,t,r).bind(function(e){return fl.prevPosition(e,r).isNone()?A.some(Ud.start(e)):A.none()})},$d=function(e,t,n){var r=Rf.normalizeForwards(n);return Hd(e,t,r).bind(function(e){return fl.nextPosition(e,r).isNone()?A.some(Ud.end(e)):A.none()})},Wd=function(e,t,n){var r=Rf.normalizeBackwards(n),o=zd(t,r.container());return Rf.findRootInline(e,o,r).fold(function(){return fl.prevPosition(o,r).bind(b(Rf.findRootInline,e,o)).map(function(e){return Ud.after(e)})},A.none)},Kd=function(e){return!1===Rf.isRtl(Yd(e))},Xd=function(e,t,n){return Fd([Vd,jd,$d,Wd],[e,t,n]).filter(Kd)},Yd=function(e){return e.fold(j,j,j,j)},Gd=function(e){return e.fold(H("before"),H("start"),H("end"),H("after"))},Jd=function(e){return e.fold(Ud.before,Ud.before,Ud.after,Ud.after)},Qd=function(n,e,r,t,o,i){return ru([Rf.findRootInline(e,r,t),Rf.findRootInline(e,r,o)],function(e,t){return e!==t&&Rf.hasSameParentBlock(r,e,t)?Ud.after(n?e:t):i}).getOr(i)},Zd=function(e,r){return e.fold(H(!0),function(e){return n=r,!(Gd(t=e)===Gd(n)&&Yd(t)===Yd(n));var t,n})},em=function(e,t){return e?t.fold(q(A.some,Ud.start),A.none,q(A.some,Ud.after),A.none):t.fold(A.none,q(A.some,Ud.before),A.none,q(A.some,Ud.end))},tm=function(a,u,s,c){var e=Rf.normalizePosition(a,c),l=Xd(u,s,e);return Xd(u,s,e).bind(b(em,a)).orThunk(function(){return t=a,n=u,r=s,o=l,e=c,i=Rf.normalizePosition(t,e),fl.fromPosition(t,r,i).map(b(Rf.normalizePosition,t)).fold(function(){return o.map(Jd)},function(e){return Xd(n,r,e).map(b(Qd,t,n,r,i,e)).filter(b(Zd,o))}).filter(Kd);var t,n,r,o,e,i})},nm=Xd,rm=tm,om=(b(tm,!1),b(tm,!0),Jd),im=function(e){return e.fold(Ud.start,Ud.start,Ud.end,Ud.end)},am=function(e){return O(e.selection.getSel().modify)},um=function(e,t,n){var r=e?1:-1;return t.setRng(Su(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},sm=function(e,t){var n=t.selection.getRng(),r=e?Su.fromRangeEnd(n):Su.fromRangeStart(n);return!!am(t)&&(e&&Ra(r)?um(!0,t.selection,r):!(e||!Da(r))&&um(!1,t.selection,r))},cm=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},lm=function(e){return!1!==e.settings.inline_boundaries},fm=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},dm=function(t,e,n){return Md(e,n).map(function(e){return cm(t,e),n})},mm=function(e,t,n){return function(){return!!lm(t)&&sm(e,t)}},gm={move:function(a,u,s){return function(){return!!lm(a)&&(t=a,n=u,e=s,r=t.getBody(),o=Su.fromRangeStart(t.selection.getRng()),i=b(Rf.isInlineTarget,t),rm(e,i,r,o).bind(function(e){return dm(t,n,e)})).isSome();var t,n,e,r,o,i}},moveNextWord:b(mm,!0),movePrevWord:b(mm,!1),setupSelectedState:function(a){var u=Bi(null),s=b(Rf.isInlineTarget,a);return a.on("NodeChange",function(e){var t,n,r,o,i;lm(a)&&(t=s,n=a.dom,r=e.parents,o=U(n.select('*[data-mce-selected="inline-boundary"]'),t),i=U(r,t),F(Z(o,i),b(fm,!1)),F(Z(i,o),b(fm,!0)),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=Su.fromRangeStart(e.selection.getRng());Su.isTextPosition(n)&&!1===Rf.isAtZwsp(n)&&(cm(e,os.removeAndReposition(t.get(),n)),t.set(null))}}(a,u),function(n,r,o,e){if(r.selection.isCollapsed()){var t=U(e,n);F(t,function(e){var t=Su.fromRangeStart(r.selection.getRng());nm(n,r.getBody(),t).bind(function(e){return dm(r,o,e)})})}}(s,a,u,e.parents))}),u},setCaretPosition:cm},pm=function(t,n){return function(e){return Md(n,e).map(function(e){return gm.setCaretPosition(t,e),!0}).getOr(!1)}},hm=function(r,o,i,a){var u=r.getBody(),s=b(Rf.isInlineTarget,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),nm(s,u,Su.fromRangeStart(r.selection.getRng())).map(im).map(pm(r,o))}),r.nodeChanged()},vm=function(n,r,i,o){var e,t,a=(e=n.getBody(),t=o.container(),Hc(t,e)||e),u=b(Rf.isInlineTarget,n),s=nm(u,a,o);return s.bind(function(e){return i?e.fold(H(A.some(im(e))),A.none,H(A.some(om(e))),A.none):e.fold(A.none,H(A.some(om(e))),A.none,H(A.some(im(e))))}).map(pm(n,r)).getOrThunk(function(){var t=fl.navigate(i,a,o),e=t.bind(function(e){return nm(u,a,e)});return s.isSome()&&e.isSome()?Rf.findRootInline(u,a,o).map(function(e){return o=e,!!ru([fl.firstPositionIn(o),fl.lastPositionIn(o)],function(e,t){var n=Rf.normalizePosition(!0,e),r=Rf.normalizePosition(!1,t);return fl.nextPosition(o,n).map(function(e){return e.isEqual(r)}).getOr(!0)}).getOr(!0)&&(Nd(n,i,er.fromDom(e)),!0);var o}).getOr(!1):e.bind(function(e){return t.map(function(e){return i?hm(n,r,o,e):hm(n,r,e,o),!0})}).getOr(!1)})},bm=function(e,t,n){if(e.selection.isCollapsed()&&!1!==e.settings.inline_boundaries){var r=Su.fromRangeStart(e.selection.getRng());return vm(e,t,n,r)}return!1},ym=kr("start","end"),Cm=kr("rng","table","cells"),xm=cd([{removeTable:["element"]},{emptyCells:["cells"]}]),wm=function(e,t){return ra(er.fromDom(e),"td,th",t)},Nm=function(e,t){return ta(e,"table",t)},Em=function(e){return!1===Fr.eq(e.start(),e.end())},Sm=function(e,n){return Nm(e.start(),n).bind(function(t){return Nm(e.end(),n).bind(function(e){return Fr.eq(t,e)?A.some(t):A.none()})})},Tm=function(e){return Ki(e,"td,th")},km=function(r,e){var t=wm(e.startContainer,r),n=wm(e.endContainer,r);return e.collapsed?A.none():ru([t,n],ym).fold(function(){return t.fold(function(){return n.bind(function(t){return Nm(t,r).bind(function(e){return ee(Tm(e)).map(function(e){return ym(e,t)})})})},function(t){return Nm(t,r).bind(function(e){return te(Tm(e)).map(function(e){return ym(t,e)})})})},function(e){return Am(r,e)?A.none():(n=r,Nm((t=e).start(),n).bind(function(e){return te(Tm(e)).map(function(e){return ym(t.start(),e)})}));var t,n})},Am=function(e,t){return Sm(t,e).isSome()},_m=function(e,t){var n,r,o,i,a,u=(n=e,b(Fr.eq,n));return(r=t,o=u,i=wm(r.startContainer,o),a=wm(r.endContainer,o),ru([i,a],ym).filter(Em).filter(function(e){return Am(o,e)}).orThunk(function(){return km(o,r)})).bind(function(e){return Sm(t=e,u).map(function(e){return Cm(t,e,Tm(e))});var t})},Rm=function(e,t){return K(e,function(e){return Fr.eq(e,t)})},Dm=function(n){return(r=n,ru([Rm(r.cells(),r.rng().start()),Rm(r.cells(),r.rng().end())],function(e,t){return r.cells().slice(e,t+1)})).map(function(e){var t=n.cells();return e.length===t.length?xm.removeTable(n.table()):xm.emptyCells(e)});var r},Bm=function(e,t){return _m(e,t).bind(Dm)},Om=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},Pm=Om,Lm=function(e){return G(e,function(e){var t=Za(e);return t?[er.fromDom(t)]:[]})},Im=function(e){return 1<Om(e).length},Mm=function(e){return U(Lm(e),yo)},Fm=function(e){return Ki(e,"td[data-mce-selected],th[data-mce-selected]")},Um=function(e,t){var n=Fm(t),r=Mm(e);return 0<n.length?n:r},zm=Um,Vm=function(e){return Um(Pm(e.selection.getSel()),er.fromDom(e.getBody()))},qm=function(e,t){return F(t,af),e.selection.setCursorLocation(t[0].dom(),0),!0},Hm=function(e,t){return Nd(e,!1,t),!0},jm=function(n,e,r,t){return Wm(e,t).fold(function(){return t=n,Bm(e,r).map(function(e){return e.fold(b(Hm,t),b(qm,t))});var t},function(e){return Km(n,e)}).getOr(!1)},$m=function(e,t){return V(Yf(t,e),yo)},Wm=function(e,t){return V(Yf(t,e),function(e){return"caption"===sr.name(e)})},Km=function(e,t){return af(t),e.selection.setCursorLocation(t.dom(),0),A.some(!0)},Xm=function(u,s,c,l,f){return fl.navigate(c,u.getBody(),f).bind(function(e){return r=l,o=c,i=f,a=e,fl.firstPositionIn(r.dom()).bind(function(t){return fl.lastPositionIn(r.dom()).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?Km(u,l):(t=l,n=e,Wm(s,er.fromDom(n.getNode())).map(function(e){return!1===Fr.eq(e,t)}));var t,n,r,o,i,a}).or(A.some(!0))},Ym=function(a,u,s,e){var c=Su.fromRangeStart(a.selection.getRng());return $m(s,e).bind(function(e){return zf(e)?Km(a,e):(t=a,n=s,r=u,o=e,i=c,fl.navigate(r,t.getBody(),i).bind(function(e){return $m(n,er.fromDom(e.getNode())).map(function(e){return!1===Fr.eq(e,o)})}));var t,n,r,o,i})},Gm=function(a,u,e){var s=er.fromDom(a.getBody());return Wm(s,e).fold(function(){return Ym(a,u,s,e)},function(e){return t=a,n=u,r=s,o=e,i=Su.fromRangeStart(t.selection.getRng()),zf(o)?Km(t,o):Xm(t,r,n,o,i);var t,n,r,o,i}).getOr(!1)},Jm=function(e,t){var n,r,o,i,a,u=er.fromDom(e.selection.getStart(!0)),s=Vm(e);return e.selection.isCollapsed()&&0===s.length?Gm(e,t,u):(n=e,r=u,o=er.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=Vm(n)).length?qm(n,a):jm(n,o,i,r))},Qm=function(e,t){e.getDoc().execCommand(t,!1,null)},Zm=function(e){Td(e,!1)||bm(e,!1)||od(e,!1)||Jm(e)||sd(e,!1)||(Qm(e,"Delete"),Bf(e))},eg=function(e){Td(e,!0)||bm(e,!0)||od(e,!0)||Jm(e)||sd(e,!0)||Qm(e,"ForwardDelete")},tg=function(s){return function(u,e){return A.from(e).map(er.fromDom).filter(sr.isElement).bind(function(e){return(r=s,o=u,i=e.dom(),a=function(e){return Tr(e,r)},Zi.closest(er.fromDom(i),function(e){return a(e).isSome()},function(e){return Fr.eq(er.fromDom(o),e)}).bind(a)).or((t=s,n=e.dom(),A.from(pi.DOM.getStyle(n,t,!0))));var t,n,r,o,i,a}).getOr("")}},ng={getFontSize:tg("font-size"),getFontFamily:q(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},tg("font-family")),toPt:function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,r=t||0,o=Math.pow(10,r),Math.round(n*o)/o+"pt"):e;var n,r,o}},rg=function(e){return fl.firstPositionIn(e.getBody()).map(function(e){var t=e.container();return Do.isText(t)?t.parentNode:t})},og=function(o){return A.from(o.selection.getRng()).bind(function(e){var t,n,r=o.getBody();return n=r,(t=e).startContainer===n&&0===t.startOffset?A.none():A.from(o.selection.getStart(!0))})},ig=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=ac(e),o=uc(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},ag=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},ug=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},sg=function(e,t,n){return ug(e,t,function(e){return e.nodeName===n})},cg=function(e){return e&&"TABLE"===e.nodeName},lg=function(e,t,n){for(var r=new oo(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(Do.isBr(t))return!0},fg=function(e,t,n,r,o){var i,a,u,s,c,l,f=e.getRoot(),d=e.schema.getNonEmptyElements();if(u=e.getParent(o.parentNode,e.isBlock)||f,r&&Do.isBr(o)&&t&&e.isEmpty(u))return A.some(wu(o.parentNode,e.nodeIndex(o)));for(i=new oo(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||(l=f,Aa(c=s)&&!1===ug(c,l,Ku)))return A.none();if(Do.isText(s)&&0<s.nodeValue.length)return!1===sg(s,f,"A")?A.some(wu(s,r?s.nodeValue.length:0)):A.none();if(e.isBlock(s)||d[s.nodeName.toLowerCase()])return A.none();a=s}return n&&a?A.some(wu(a,0)):A.none()},dg=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=e.getRoot(),p=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],l=Do.isElement(o)&&i===o.childNodes.length,s=e.schema.getNonEmptyElements(),c=n,Aa(o))return A.none();if(Do.isElement(o)&&i>o.childNodes.length-1&&(c=!1),Do.isDocument(o)&&(o=g,i=0),o===g){if(c&&(u=o.childNodes[0<i?i-1:0])){if(Aa(u))return A.none();if(s[u.nodeName]||cg(u))return A.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&0<i?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Do.isText(o)&&l?o.data.length:0,!t&&o===g.lastChild&&cg(o))return A.none();if(function(e,t){for(;t&&t!==e;){if(Do.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(g,o)||Aa(o))return A.none();if(o.hasChildNodes()&&!1===cg(o)){a=new oo(u=o,g);do{if(Do.isContentEditableFalse(u)||Aa(u)){p=!1;break}if(Do.isText(u)&&0<u.nodeValue.length){i=c?0:u.nodeValue.length,o=u,p=!0;break}if(s[u.nodeName.toLowerCase()]&&(!(f=u)||!/^(TD|TH|CAPTION)$/.test(f.nodeName))){i=e.nodeIndex(u),o=u.parentNode,c||i++,p=!0;break}}while(u=c?a.next():a.prev())}}}return t&&(Do.isText(o)&&0===i&&fg(e,l,t,!0,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),Do.isElement(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Do.isBr(u)||(m="A",(d=u).previousSibling&&d.previousSibling.nodeName===m)||lg(e,u,!1)||lg(e,u,!0)||fg(e,l,t,!0,u).each(function(e){o=e.container(),i=e.offset(),p=!0}))),c&&!t&&Do.isText(o)&&i===o.nodeValue.length&&fg(e,l,t,!1,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),p?A.some(wu(o,i)):A.none()},mg=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=wu.fromRangeStart(t);return dg(e,n,!0,r).each(function(e){n&&wu.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||dg(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),ag(t,r)?A.none():A.some(r)},gg=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},pg=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},hg=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();mg(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.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=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new oo(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0<r.length)return!0}(e.schema,s,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),a.insertNode(n),gg(i,o,n),pg(i,o,n,r),e.undoManager.add()},vg=function(e,t){var n=er.fromTag("br");Ti.before(er.fromDom(t),n),e.undoManager.add()},bg=function(e,t){yg(e.getBody(),t)||Ti.after(er.fromDom(t),er.fromTag("br"));var n=er.fromTag("br");Ti.after(er.fromDom(t),n),gg(e.dom,e.selection,n.dom()),pg(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},yg=function(e,t){return n=Su.after(t),!!Do.isBr(n.getNode())||fl.nextPosition(e,Su.after(t)).map(function(e){return Do.isBr(e.getNode())}).getOr(!1);var n},Cg=function(e){return e&&"A"===e.nodeName&&"href"in e},xg=function(e){return e.fold(H(!1),Cg,Cg,H(!1))},wg=function(e,t){t.fold(v,b(vg,e),b(bg,e),v)},Ng=function(e,t){var n,r,o,i=(n=e,r=b(Rf.isInlineTarget,n),o=Su.fromRangeStart(n.selection.getRng()),nm(r,n.getBody(),o).filter(xg));i.isSome()?i.each(b(wg,e)):hg(e,t)},Eg=cd([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Sg=(Eg.before,Eg.on,Eg.after,function(e){return e.fold(j,j,j)}),Tg=cd([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),kg=kr("start","soffset","finish","foffset"),Ag={domRange:Tg.domRange,relative:Tg.relative,exact:Tg.exact,exactFromRange:function(e){return Tg.exact(e.start(),e.soffset(),e.finish(),e.foffset())},range:kg,getWin:function(e){var t=e.match({domRange:function(e){return er.fromDom(e.startContainer)},relative:function(e,t){return Sg(e)},exact:function(e,t,n,r){return e}});return $r.defaultView(t)}},_g=Qn.detect().browser,Rg=function(e,t){var n=sr.isText(t)?Vl(t).length:$r.children(t).length+1;return n<e?n:e<0?0:e},Dg=function(e){return Ag.range(e.start(),Rg(e.soffset(),e.start()),e.finish(),Rg(e.foffset(),e.finish()))},Bg=function(e,t){return Fr.contains(e,t)||Fr.eq(e,t)},Og=function(t){return function(e){return Bg(t,e.start())&&Bg(t,e.finish())}},Pg=function(e){return!0===e.inline||_g.isIE()},Lg=function(e){return Ag.range(er.fromDom(e.startContainer),e.startOffset,er.fromDom(e.endContainer),e.endOffset)},Ig=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?A.from(t.getRangeAt(0)):A.none()).map(Lg)},Mg=function(e){var t=$r.defaultView(e);return Ig(t.dom()).filter(Og(e))},Fg=function(e,t){return A.from(t).filter(Og(e)).map(Dg)},Ug=function(e){var t=document.createRange();try{return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),A.some(t)}catch(n){return A.none()}},zg=function(e){return(e.bookmark?e.bookmark:A.none()).bind(b(Fg,er.fromDom(e.getBody()))).bind(Ug)},Vg=function(e){var t=Pg(e)?Mg(er.fromDom(e.getBody())):A.none();e.bookmark=t.isSome()?t:e.bookmark},qg=function(t){zg(t).each(function(e){t.selection.setRng(e)})},Hg=zg,jg=function(e,t){var n=e.settings,r=e.dom,o=e.selection,i=e.formatter,a=/[a-z%]+$/i.exec(n.indentation)[0],u=parseInt(n.indentation,10),s=e.getParam("indent_use_margin",!1);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||(n.forced_root_block||r.getParent(o.getNode(),r.isBlock)||i.apply("div"),F(o.getSelectedBlocks(),function(e){return function(e,t,n,r,o,i){if("false"!==e.getContentEditable(i)&&"LI"!==i.nodeName){var a=n?"margin":"padding";if(a="TABLE"===i.nodeName?"margin":a,a+="rtl"===e.getStyle(i,"direction",!0)?"Right":"Left","outdent"===t){var u=Math.max(0,parseInt(i.style[a]||0,10)-r);e.setStyle(i,a,u?u+o:"")}else u=parseInt(i.style[a]||0,10)+r+o,e.setStyle(i,a,u)}}(r,t,s,u,a,e)}))},$g=Yt.each,Wg=Yt.extend,Kg=Yt.map,Xg=Yt.inArray;function Yg(s){var o,i,a,t,c={state:{},exec:{},value:{}},n=s.settings;s.on("PreInit",function(){o=s.dom,i=s.selection,n=s.settings,a=s.formatter});var r=function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.state[e])return t(e);try{return s.getDoc().queryCommandState(e)}catch(n){}return!1}},e=function(e,n){n=n||"exec",$g(e,function(t,e){$g(e.toLowerCase().split(","),function(e){c[n][e]=t})})},u=function(e,t,n){e=e.toLowerCase(),c.value[e]=function(){return t.call(n||s)}};Wg(this,{execCommand:function(t,n,r,e){var o,i,a=!1;if(!s.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||e&&e.skip_focus?qg(s):s.focus(),(e=s.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;if(i=t.toLowerCase(),o=c.exec[i])return o(i,n,r),s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if($g(s.plugins,function(e){if(e.execCommand&&e.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!(a=!0)}),a)return a;if(s.theme&&s.theme.execCommand&&s.theme.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{a=s.getDoc().execCommand(t,n,r)}catch(u){}return!!a&&(s.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},queryCommandState:r,queryCommandValue:function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.value[e])return t(e);try{return s.getDoc().queryCommandValue(e)}catch(n){}}},queryCommandSupported:function(e){if(e=e.toLowerCase(),c.exec[e])return!0;try{return s.getDoc().queryCommandSupported(e)}catch(t){}return!1},addCommands:e,addCommand:function(e,o,i){e=e.toLowerCase(),c.exec[e]=function(e,t,n,r){return o.call(i||s,t,n,r)}},addQueryStateHandler:function(e,t,n){e=e.toLowerCase(),c.state[e]=function(){return t.call(n||s)}},addQueryValueHandler:u,hasCustomCommand:function(e){return e=e.toLowerCase(),!!c.exec[e]}});var l=function(e,t,n){return t===undefined&&(t=!1),n===undefined&&(n=null),s.getDoc().execCommand(e,t,n)},f=function(e){return a.match(e)},d=function(e,t){a.toggle(e,t?{value:t}:undefined),s.nodeChanged()},m=function(e){t=i.getBookmark(e)},g=function(){i.moveToBookmark(t)};e({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){s.undoManager.add()},"Cut,Copy,Paste":function(e){var t,n=s.getDoc();try{l(e)}catch(o){t=!0}if("paste"!==e||n.queryCommandEnabled(e)||(t=!0),t||!n.queryCommandSupported(e)){var r=s.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");Re.mac&&(r=r.replace(/Ctrl\+/g,"\u2318+")),s.notificationManager.open({text:r,type:"error"})}},unlink:function(){if(i.isCollapsed()){var e=s.dom.getParent(s.selection.getStart(),"a");e&&s.dom.remove(e,!0)}else a.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),$g("left,center,right,justify".split(","),function(e){t!==e&&a.remove("align"+e)}),"none"!==t&&d("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;l(e),(t=o.getParent(i.getNode(),"ol,ul"))&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(m(),o.split(n,t),g()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){d(e)},"ForeColor,HiliteColor":function(e,t,n){d(e,n)},FontName:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontname",{value:ig(r,o)}),r.nodeChanged()},FontSize:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontsize",{value:ig(r,o)}),r.nodeChanged()},RemoveFormat:function(e){a.remove(e)},mceBlockQuote:function(){d("blockquote")},FormatBlock:function(e,t,n){return d(n||"p")},mceCleanup:function(){var e=i.getBookmark();s.setContent(s.getContent()),i.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var r=n||i.getNode();r!==s.getBody()&&(m(),s.dom.remove(r,!0),g())},mceSelectNodeDepth:function(e,t,n){var r=0;o.getParent(i.getNode(),function(e){if(1===e.nodeType&&r++===n)return i.select(e),!1},s.getBody())},mceSelectNode:function(e,t,n){i.select(n)},mceInsertContent:function(e,t,n){pf(s,n)},mceInsertRawHTML:function(e,t,n){var r=s.getContent();i.setContent("tiny_mce_marker"),s.setContent(r.replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){d(n)},mceSetContent:function(e,t,n){s.setContent(n)},"Indent,Outdent":function(e){jg(s,e)},mceRepaint:function(){},InsertHorizontalRule:function(){s.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),Do.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){Zm(s)},forwardDelete:function(){eg(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return Ng(s,n),!0}});var p=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=Kg(e,function(e){return!!a.matchNode(e,n)});return-1!==Xg(t,!0)}};e({JustifyLeft:p("alignleft"),JustifyCenter:p("aligncenter"),JustifyRight:p("alignright"),JustifyFull:p("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(n.inline_styles){if((e=o.getParent(i.getStart(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0;if((e=o.getParent(i.getEnd(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0}return r("InsertUnorderedList")||r("InsertOrderedList")||!n.inline_styles&&!!o.getParent(i.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=o.getParent(i.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),e({Undo:function(){s.undoManager.undo()},Redo:function(){s.undoManager.redo()}}),u("FontName",function(){return og(t=s).fold(function(){return rg(t).map(function(e){return ng.getFontFamily(t.getBody(),e)}).getOr("")},function(e){return ng.getFontFamily(t.getBody(),e)});var t},this),u("FontSize",function(){return og(t=s).fold(function(){return rg(t).map(function(e){return ng.getFontSize(t.getBody(),e)}).getOr("")},function(e){return ng.getFontSize(t.getBody(),e)});var t},this)}var Gg=Yt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," "),Jg=function(a){var u,s,c=this,l={},f=function(){return!1},d=function(){return!0};u=(a=a||{}).scope||c,s=a.toggleEvent||f;var r=function(e,t,n,r){var o,i,a;if(!1===t&&(t=f),t)for(t={func:t},r&&Yt.extend(t,r),a=(i=e.toLowerCase().split(" ")).length;a--;)e=i[a],(o=l[e])||(o=l[e]=[],s(e,!0)),n?o.unshift(t):o.push(t);return c},m=function(e,t){var n,r,o,i,a;if(e)for(n=(i=e.toLowerCase().split(" ")).length;n--;){if(e=i[n],r=l[e],!e){for(o in l)s(o,!1),delete l[o];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),l[e]=r);else r.length=0;r.length||(s(e,!1),delete l[e])}}else{for(e in l)s(e,!1);l={}}return c};c.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=u),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=d},t.stopPropagation=function(){t.isPropagationStopped=d},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=d},t.isDefaultPrevented=f,t.isPropagationStopped=f,t.isImmediatePropagationStopped=f),a.beforeFire&&a.beforeFire(t),n=l[e])for(r=0,o=n.length;r<o;r++){if((i=n[r]).once&&m(e,i.func),t.isImmediatePropagationStopped())return t.stopPropagation(),t;if(!1===i.func.call(u,t))return t.preventDefault(),t}return t},c.on=r,c.off=m,c.once=function(e,t,n){return r(e,t,n,{once:!0})},c.has=function(e){return e=e.toLowerCase(),!(!l[e]||0===l[e].length)}};Jg.isNative=function(e){return!!Gg[e.toLowerCase()]};var Qg,Zg=function(n){return n._eventDispatcher||(n._eventDispatcher=new Jg({scope:n,toggleEvent:function(e,t){Jg.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher},ep={fire:function(e,t,n){if(this.removed&&"remove"!==e)return t;if(t=Zg(this).fire(e,t,n),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},on:function(e,t,n){return Zg(this).on(e,t,n)},off:function(e,t){return Zg(this).off(e,t)},once:function(e,t){return Zg(this).once(e,t)},hasEventListeners:function(e){return Zg(this).has(e)}},tp=function(e,t){return e.fire("PreProcess",t)},np=function(e,t){return e.fire("PostProcess",t)},rp=function(e){return e.fire("remove")},op=function(e,t){return e.fire("SwitchMode",{mode:t})},ip=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},ap=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},up=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},sp=function(e,t){var n,r,o;n=er.fromDom(e.getBody()),r="mce-content-readonly",o=t,Wi.has(n,r)&&!1===o?Wi.remove(n,r):o&&Wi.add(n,r),t?(e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable="false"):(e.readonly=!1,e.getBody().contentEditable="true",up(e,"StyleWithCSS",!1),up(e,"enableInlineTableEditing",!1),up(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},cp=function(e){return e.readonly?"readonly":"design"},lp=pi.DOM,fp=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=lp.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},dp=function(e,t,n){var r;(r=e).hidden||r.readonly?!0===e.readonly&&n.preventDefault():e.fire(t,n)},mp=function(i,a){var e,t;if(i.delegates||(i.delegates={}),!i.delegates[a]&&!i.removed)if(e=fp(i,a),i.settings.event_root){if(Qg||(Qg={},i.editorManager.on("removeEditor",function(){var e;if(!i.editorManager.activeEditor&&Qg){for(e in Qg)i.dom.unbind(fp(i,e));Qg=null}})),Qg[a])return;t=function(e){for(var t=e.target,n=i.editorManager.get(),r=n.length;r--;){var o=n[r].getBody();(o===t||lp.isChildOf(t,o))&&dp(n[r],a,e)}},Qg[a]=t,lp.bind(e,a,t)}else t=function(e){dp(i,a,e)},lp.bind(e,a,t),i.delegates[a]=t},gp={bindPendingEventDelegates:function(){var t=this;Yt.each(t._pendingNativeEvents,function(e){mp(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(t?n.initialized?mp(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(fp(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e,t=this,n=t.getBody(),r=t.dom;if(t.delegates){for(e in t.delegates)t.dom.unbind(fp(t,e),e,t.delegates[e]);delete t.delegates}!t.inline&&n&&r&&(n.onload=null,r.unbind(t.getWin()),r.unbind(t.getDoc())),r&&(r.unbind(n),r.unbind(t.getContainer()))}},pp=gp=Yt.extend({},ep,gp),hp=Yt.each,vp=Yt.explode,bp={f9:120,f10:121,f11:122},yp=Yt.makeMap("alt,ctrl,shift,meta,access");function Cp(i){var a={},r=[],u=function(e){var t,n,r={};for(n in hp(vp(e,"+"),function(e){e in yp?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=bp[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],yp)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,Re.mac?r.ctrl=!0:r.shift=!0),r.meta&&(Re.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},s=function(e,t,n,r){var o;return(o=Yt.map(vp(e,">"),u))[o.length-1]=Yt.extend(o[o.length-1],{func:n,scope:r||i}),Yt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(hp(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Yt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),hp(vp(Yt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var xp=function(e){var t=e!==undefined?e.dom():document;return A.from(t.activeElement).map(er.fromDom)},wp=function(e){var t=$r.owner(e).dom();return e.dom()===t.activeElement},Np=function(t){return xp($r.owner(t)).filter(function(e){return t.dom().contains(e.dom())})},Ep=function(t,e){return(n=e,n.collapsed?A.from(eu(n.startContainer,n.startOffset)).map(er.fromDom):A.none()).bind(function(e){return bo(e)?A.some(e):!1===Fr.contains(t,e)?A.some(t):A.none()});var n},Sp=function(t,e){Ep(er.fromDom(t.getBody()),e).bind(function(e){return fl.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},Tp=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},kp=function(e){var t,n=e.getBody();return n&&(t=er.fromDom(n),wp(t)||Np(t).isSome())},Ap=function(e){return e.inline?kp(e):(t=e).iframeElement&&wp(er.fromDom(t.iframeElement));var t},_p=function(e){return e.editorManager.setActive(e)},Rp=function(e,t){e.removed||(t?_p(e):function(t){var e=t.selection,n=t.settings.content_editable,r=t.getBody(),o=e.getRng();t.quirks.refreshContentEditable();var i,a,u=(i=t,a=e.getNode(),i.dom.getParent(a,function(e){return"true"===i.dom.getContentEditable(e)}));if(t.$.contains(r,u))return Tp(u),Sp(t,o),_p(t);t.bookmark!==undefined&&!1===Ap(t)&&Hg(t).each(function(e){t.selection.setRng(e),o=e}),n||(Re.opera||Tp(r),t.getWin().focus()),(Re.gecko||n)&&(Tp(r),Sp(t,o)),_p(t)}(e))},Dp=Ap,Bp=function(e,t){return t.dom()[e]},Op=function(e,t){return parseInt(Sr(t,e),10)},Pp=b(Bp,"clientWidth"),Lp=b(Bp,"clientHeight"),Ip=b(Op,"margin-top"),Mp=b(Op,"margin-left"),Fp=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m=er.fromDom(e.getBody()),g=e.inline?m:$r.documentElement(m),p=(r=e.inline,i=t,a=n,u=(o=g).dom().getBoundingClientRect(),{x:i-(r?u.left+o.dom().clientLeft+Mp(o):0),y:a-(r?u.top+o.dom().clientTop+Ip(o):0)});return c=p.x,l=p.y,f=Pp(s=g),d=Lp(s),0<=c&&0<=l&&c<=f&&l<=d},Up=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,A.from(t).map(er.fromDom)).map(function(e){return Fr.contains($r.owner(e),e)}).getOr(!1)};function zp(n){var t,o=[],i=function(){var e,t=n.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},a=function(){0<o.length&&i().reposition(o)},u=function(t){K(o,function(e){return e===t}).each(function(e){o.splice(e,1)})},r=function(r){if(!n.removed&&Up(n))return V(o,function(e){return t=i().getArgs(e),n=r,!(t.type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t,n}).getOrThunk(function(){n.editorManager.setActive(n);var e,t=i().open(r,function(){u(t),a()});return e=t,o.push(e),a(),t})};return(t=n).on("SkinLoaded",function(){var e=t.settings.service_message;e&&r({text:e,type:"warning",timeout:0,icon:""})}),t.on("ResizeEditor ResizeWindow",function(){Le.requestAnimationFrame(a)}),t.on("remove",function(){F(o,function(e){i().close(e)})}),{open:r,close:function(){A.from(o[0]).each(function(e){i().close(e),u(e),a()})},getNotifications:function(){return o}}}function Vp(r){var o=[],i=function(){var e,t=r.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},alert:e,confirm:e,close:e,getParams:e,setParams:e}},a=function(e,t){return function(){return t?t.apply(e,arguments):undefined}},u=function(e){var t;o.push(e),t=e,r.fire("OpenWindow",{win:t})},s=function(n){K(o,function(e){return e===n}).each(function(e){var t;o.splice(e,1),t=n,r.fire("CloseWindow",{win:t}),0===o.length&&r.focus()})},e=function(){return A.from(o[o.length-1])};return r.on("remove",function(){F(o.slice(0),function(e){i().close(e)})}),{windows:o,open:function(e,t){r.editorManager.setActive(r),Vg(r);var n=i().open(e,t,s);return u(n),n},alert:function(e,t,n){var r=i().alert(e,a(n||this,t),s);u(r)},confirm:function(e,t,n){var r=i().confirm(e,a(n||this,t),s);u(r)},close:function(){e().each(function(e){i().close(e),s(e)})},getParams:function(){return e().map(i().getParams).getOr(null)},setParams:function(t){e().each(function(e){i().setParams(e,t)})},getWindows:function(){return o}}}var qp=Ni.PluginManager,Hp=function(e,t){var n=function(e,t){for(var n in qp.urls)if(qp.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?"Failed to load plugin: "+n+" from url "+t:"Failed to load plugin url: "+t},jp=function(e,t){e.notificationManager.open({type:"error",text:t})},$p=function(e,t){e._skinLoaded?jp(e,t):e.on("SkinLoaded",function(){jp(e,t)})},Wp=function(e,t){$p(e,Hp(e,t))},Kp=function(e,t){$p(e,"Failed to upload image: "+t)},Xp=$p,Yp=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},Gp=Ni.PluginManager,Jp=Ni.ThemeManager;function Qp(){return new(ie.getOrDie("XMLHttpRequest"))}function Zp(u,s){var r={},n=function(e,r,o,t){var i,n;(i=new Qp).open("POST",s.url),i.withCredentials=s.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?o("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?r((t=s.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+i.responseText)},(n=new FormData).append("file",e.blob(),e.filename()),i.send(n)},c=function(e,t){return{url:t,blobInfo:e,status:!0}},l=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},f=function(e,t){Yt.each(r[e],function(e){e(t)}),delete r[e]},o=function(e,n){return e=Yt.grep(e,function(e){return!u.isUploaded(e.blobUri())}),De.all(Yt.map(e,function(e){return u.isPending(e.blobUri())?(t=e.blobUri(),new De(function(e){r[t]=r[t]||[],r[t].push(e)})):(o=e,i=s.handler,a=n,u.markPending(o.blobUri()),new De(function(t){var n;try{var r=function(){n&&n.close()};i(o,function(e){r(),u.markUploaded(o.blobUri(),e),f(o.blobUri(),c(o,e)),t(c(o,e))},function(e){r(),u.removeFailed(o.blobUri()),f(o.blobUri(),l(o,e)),t(l(o,e))},function(e){e<0||100<e||(n||(n=a()),n.progressBar.value(e))})}catch(e){t(l(o,e.message))}}));var o,i,a,t}))};return!1===O(s.handler)&&(s.handler=n),{upload:function(e,t){return s.url||s.handler!==n?o(e,t):new De(function(e){e([])})}}}function eh(){return new(ie.getOrDie("FileReader"))}function th(e){return new(ie.getOrDie("Uint8Array"))(e)}var nh=function(e){return ie.getOrDie("atob")(e)},rh=function(e){var t,n,r=decodeURIComponent(e).split(",");return(n=/data:([^;]+)/.exec(r[0]))&&(t=n[1]),{type:t,data:r[1]}},oh=function(e){return 0===e.indexOf("blob:")?(i=e,new De(function(e,t){var n=function(){t("Cannot convert "+i+" to Blob. Resource might not exist or is inaccessible.")};try{var r=new Qp;r.open("GET",i,!0),r.responseType="blob",r.onload=function(){200===this.status?e(this.response):n()},r.onerror=n,r.send()}catch(o){n()}})):0===e.indexOf("data:")?(a=e,new De(function(e){var t,n,r,o=rh(a);try{t=nh(o.data)}catch(nN){return void e(new Blob([]))}for(n=new th(t.length),r=0;r<n.length;r++)n[r]=t.charCodeAt(r);e(new Blob([n],{type:o.type}))})):null;var i,a},ih=function(n){return new De(function(e){var t=new eh;t.onloadend=function(){e(t.result)},t.readAsDataURL(n)})},ah=rh,uh=0,sh=function(e){return(e||"blobid")+uh++},ch=function(n,r,o,t){var i,a;0!==r.src.indexOf("blob:")?(i=ah(r.src).data,(a=n.findFirst(function(e){return e.base64()===i}))?o({image:r,blobInfo:a}):oh(r.src).then(function(e){a=n.create(sh(),e,i),n.add(a),o({image:r,blobInfo:a})},function(e){t(e)})):(a=n.getByUri(r.src))?o({image:r,blobInfo:a}):oh(r.src).then(function(t){ih(t).then(function(e){i=ah(e).data,a=n.create(sh(),t,i),n.add(a),o({image:r,blobInfo:a})})},function(e){t(e)})},lh=function(e){return e?e.getElementsByTagName("img"):[]},fh=0,dh={uuid:function(e){return e+fh+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t}};function mh(u){var n,o,i,t,e,a,r,s,c,l,f=(n=[],o=ya.constant,i=function(e){var t,n,r;if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");return t=e.id||dh.uuid("blobid"),n=e.name||t,{id:o(t),name:o(n),filename:o(n+"."+(r=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[r.toLowerCase()]||"dat")),blob:o(e.blob),base64:o(e.base64),blobUri:o(e.blobUri||ue.createObjectURL(e.blob)),uri:o(e.uri)}},{create:function(e,t,n,r){if(k(e))return i({id:e,name:r,blob:t,base64:n});if(_(e))return i(e);throw new Error("Unknown input type")},add:function(e){t(e.id())||n.push(e)},get:t=function(t){return e(function(e){return e.id()===t})},getByUri:function(t){return e(function(e){return e.blobUri()===t})},findFirst:e=function(e){return jt.filter(n,e)[0]},removeByUri:function(t){n=jt.filter(n,function(e){return e.blobUri()!==t||(ue.revokeObjectURL(e.blobUri()),!1)})},destroy:function(){jt.each(n,function(e){ue.revokeObjectURL(e.blobUri())}),n=[]}}),d=(s={},c=function(e,t){return{status:e,resultUri:t}},{hasBlobUri:l=function(e){return e in s},getResultUri:function(e){var t=s[e];return t?t.resultUri:null},isPending:function(e){return!!l(e)&&1===s[e].status},isUploaded:function(e){return!!l(e)&&2===s[e].status},markPending:function(e){s[e]=c(1,null)},markUploaded:function(e,t){s[e]=c(2,t)},removeFailed:function(e){delete s[e]},destroy:function(){s={}}}),m=[],g=function(t){return function(e){return u.selection?t(e):[]}},p=function(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e},h=function(e,t,n){return e=p(e,'src="'+t+'"','src="'+n+'"'),e=p(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},v=function(t,n){F(u.undoManager.data,function(e){"fragmented"===e.type?e.fragments=$(e.fragments,function(e){return h(e,t,n)}):e.content=h(e.content,t,n)})},b=function(){return u.notificationManager.open({text:u.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},y=function(e,t){f.removeByUri(e.src),v(e.src,t),u.$(e).attr({src:lc(u)?t+"?"+(new Date).getTime():t,"data-mce-src":u.convertURL(t,"src")})},C=function(n){return a||(a=Zp(d,{url:dc(u),basePath:mc(u),credentials:gc(u),handler:pc(u)})),N().then(g(function(r){var e;return e=$(r,function(e){return e.blobInfo}),a.upload(e,b).then(g(function(e){var t=$(e,function(e,t){var n=r[t].image;return e.status&&fc(u)?y(n,e.url):e.error&&Kp(u,e.error),{element:n,status:e.status}});return n&&n(t),t}))}))},x=function(e){if(cc(u))return C(e)},w=function(t){return!1!==J(m,function(e){return e(t)})&&(0!==t.getAttribute("src").indexOf("data:")||sc(u)(t))},N=function(){var o,i,a;return r||(o=d,i=f,a={},r={findAll:function(e,n){var t;n||(n=ya.constant(!0)),t=jt.filter(lh(e),function(e){var t=e.src;return!!Re.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!t||t===Re.transparentSrc)&&(0===t.indexOf("blob:")?!o.isUploaded(t)&&n(e):0===t.indexOf("data:")&&n(e))});var r=jt.map(t,function(n){if(a[n.src])return new De(function(t){a[n.src].then(function(e){if("string"==typeof e)return e;t({image:n,blobInfo:e.blobInfo})})});var e=new De(function(e,t){ch(i,n,e,t)}).then(function(e){return delete a[e.image.src],e})["catch"](function(e){return delete a[n.src],e});return a[n.src]=e});return De.all(r)}}),r.findAll(u.getBody(),w).then(g(function(e){return e=U(e,function(e){return"string"!=typeof e||(Xp(u,e),!1)}),F(e,function(e){v(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))},E=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=d.getResultUri(n);if(t)return'src="'+t+'"';var r=f.getByUri(n);return r||(r=z(u.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),r?'src="data:'+r.blob().type+";base64,"+r.base64()+'"':e})};return u.on("setContent",function(){cc(u)?x():N()}),u.on("RawSaveContent",function(e){e.content=E(e.content)}),u.on("getContent",function(e){e.source_view||"raw"===e.format||(e.content=E(e.content))}),u.on("PostRender",function(){u.parser.addNodeFilter("img",function(e){F(e,function(e){var t=e.attr("src");if(!f.getByUri(t)){var n=d.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:f,addFilter:function(e){m.push(e)},uploadImages:C,uploadImagesAuto:x,scanForImages:N,destroy:function(){f.destroy(),d.destroy(),r=a=null}}}var gh=function(e,t){return e.hasOwnProperty(t.nodeName)},ph=function(e,t){if(Do.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||gh(e,t.nextSibling)))return!0}return!1},hh=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.dom,g=e.selection,p=e.schema,h=p.getBlockElements(),v=g.getStart(),b=e.getBody();if(f=d.forced_root_block,v&&Do.isElement(v)&&f&&(l=b.nodeName.toLowerCase(),p.isValidChild(l,f.toLowerCase())&&(y=h,C=b,x=v,!M(Xf(er.fromDom(x),er.fromDom(C)),function(e){return gh(y,e.dom())})))){var y,C,x,w,N;for(n=(t=g.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=Dp(e),v=b.firstChild;v;)if(w=h,N=v,Do.isText(N)||Do.isElement(N)&&!gh(w,N)&&!xl(N)){if(ph(h,v)){v=(u=v).nextSibling,m.remove(u);continue}a||(a=m.create(f,e.settings.forced_root_block_attrs),v.parentNode.insertBefore(a,v),s=!0),v=(u=v).nextSibling,a.appendChild(u)}else a=null,v=v.nextSibling;s&&c&&(t.setStart(n,r),t.setEnd(o,i),g.setRng(t),e.nodeChanged())}},vh=function(e){e.settings.forced_root_block&&e.on("NodeChange",b(hh,e))},bh=function(t){return $r.firstChild(t).fold(H([t]),function(e){return[t].concat(bh(e))})},yh=function(t){return $r.lastChild(t).fold(H([t]),function(e){return"br"===sr.name(e)?$r.prevSibling(e).map(function(e){return[t].concat(yh(e))}).getOr([]):[t].concat(yh(e))})},Ch=function(o,e){return ru([(i=e,a=i.startContainer,u=i.startOffset,Do.isText(a)?0===u?A.some(er.fromDom(a)):A.none():A.from(a.childNodes[u]).map(er.fromDom)),(t=e,n=t.endContainer,r=t.endOffset,Do.isText(n)?r===n.data.length?A.some(er.fromDom(n)):A.none():A.from(n.childNodes[r-1]).map(er.fromDom))],function(e,t){var n=V(bh(o),b(Fr.eq,e)),r=V(yh(o),b(Fr.eq,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i,a,u},xh=function(e,t,n,r){var o=n,i=new oo(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==Yt.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(Re.ie&&Re.ie<11&&e.isBlock(n)&&e.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},wh=function(e){var t=e.selection.getSel();return t&&0<t.rangeCount};function Nh(i){var r,o=[];"onselectionchange"in i.getDoc()||i.on("NodeChange Click MouseUp KeyUp Focus",function(e){var t,n;n={startContainer:(t=i.selection.getRng()).startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset},"nodechange"!==e.type&&ag(n,r)||i.fire("SelectionChange"),r=n}),i.on("contextmenu",function(){i.fire("SelectionChange")}),i.on("SelectionChange",function(){var e=i.selection.getStart(!0);!e||!Re.range&&i.selection.isCollapsed()||wh(i)&&!function(e){var t,n;if((n=i.$(e).parentsUntil(i.getBody()).add(e)).length===o.length){for(t=n.length;0<=t&&n[t]===o[t];t--);if(-1===t)return o=n,!0}return o=n,!1}(e)&&i.dom.isChildOf(e,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("MouseUp",function(e){!e.isDefaultPrevented()&&wh(i)&&("IMG"===i.selection.getNode().nodeName?Le.setEditorTimeout(i,function(){i.nodeChanged()}):i.nodeChanged())}),this.nodeChanged=function(e){var t,n,r,o=i.selection;i.initialized&&o&&!i.settings.disable_nodechange&&!i.readonly&&(r=i.getBody(),(t=o.getStart(!0)||r).ownerDocument===i.getDoc()&&i.dom.isChildOf(t,r)||(t=r),n=[],i.dom.getParent(t,function(e){if(e===r)return!0;n.push(e)}),(e=e||{}).element=t,e.parents=n,i.fire("NodeChange",e))}}var Eh,Sh,Th=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),n=(t=e.ownerDocument).documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},kh=function(e,t){return n=(u=e).inline?Th(u.getBody()):{left:0,top:0},a=(i=e).getBody(),r=i.inline?{left:a.scrollLeft,top:a.scrollTop}:{left:0,top:0},{pageX:(o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=Th(e.getContentAreaContainer()),r=(i=(o=e).getBody(),a=o.getDoc().documentElement,u={left:i.scrollLeft,top:i.scrollTop},s={left:i.scrollLeft||a.scrollLeft,top:i.scrollTop||a.scrollTop},o.inline?u:s);return{left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}var o,i,a,u,s;return{left:t.pageX,top:t.pageY}}(e,t)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o,i,a,u},Ah=Do.isContentEditableFalse,_h=Do.isContentEditableTrue,Rh=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},Dh=function(u,s){return function(e){if(0===e.button){var t=jt.find(s.dom.getParents(e.target),ya.or(Ah,_h));if(i=s.getBody(),Ah(a=t)&&a!==i){var n=s.dom.getPos(t),r=s.getBody(),o=s.getDoc().documentElement;u.element=t,u.screenX=e.screenX,u.screenY=e.screenY,u.maxX=(s.inline?r.scrollWidth:o.offsetWidth)-2,u.maxY=(s.inline?r.scrollHeight:o.offsetHeight)-2,u.relX=e.pageX-n.x,u.relY=e.pageY-n.y,u.width=t.offsetWidth,u.height=t.offsetHeight,u.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(s,t,u.width,u.height)}}var i,a}},Bh=function(l,f){return function(e){if(l.dragging&&(s=(i=f).selection,c=s.getSel().getRangeAt(0).startContainer,a=3===c.nodeType?c.parentNode:c,u=l.element,a!==u&&!i.dom.isChildOf(a,u)&&!Ah(a))){var t=(r=l.element,(o=r.cloneNode(!0)).removeAttribute("data-mce-selected"),o),n=f.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){Rh(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;Oh(l)}},Oh=function(e){e.dragging=!1,e.element=null,Rh(e.ghost)},Ph=function(e){var t,n,r,o,i,a,p,h,v,u,s,c={};t=pi.DOM,a=document,n=Dh(c,e),p=c,h=e,v=Le.throttle(function(e,t){h._selectionOverrides.hideFakeCaret(),h.selection.placeCaretAt(e,t)},0),r=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m=Math.max(Math.abs(e.screenX-p.screenX),Math.abs(e.screenY-p.screenY));if(p.element&&!p.dragging&&10<m){if(h.fire("dragstart",{target:p.element}).isDefaultPrevented())return;p.dragging=!0,h.focus()}if(p.dragging){var g=(f=p,{pageX:(d=kh(h,e)).pageX-f.relX,pageY:d.pageY+5});c=p.ghost,l=h.getBody(),c.parentNode!==l&&l.appendChild(c),t=p.ghost,n=g,r=p.width,o=p.height,i=p.maxX,a=p.maxY,s=u=0,t.style.left=n.pageX+"px",t.style.top=n.pageY+"px",n.pageX+r>i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=Bh(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),Oh(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},Lh=function(e){var n;Ph(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Ah(t)||Ah(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},Ih=function(e){return jt.reduce(e,function(e,t){return e.concat(function(t){var e=function(e){return jt.map(e,function(e){return(e=Xa(e)).node=t,e})};if(Do.isElement(t))return e(t.getClientRects());if(Do.isText(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}(t))},[])};(Sh=Eh||(Eh={}))[Sh.Up=-1]="Up",Sh[Sh.Down=1]="Down";var Mh=function(o,i,a,e,u,t){var n,s,c=0,l=[],r=function(e){var t,n,r;for(r=Ih([e]),-1===o&&(r=r.reverse()),t=0;t<r.length;t++)if(n=r[t],!a(n,s)){if(0<l.length&&i(n,jt.last(l))&&c++,n.line=c,u(n))return!0;l.push(n)}};return(s=jt.last(t.getClientRects()))&&(r(n=t.getNode()),function(e,t,n,r){for(;r=qc(r,e,Wa,t);)if(n(r))return}(o,e,r,n)),l},Fh=b(Mh,Eh.Up,Ja,Qa),Uh=b(Mh,Eh.Down,Qa,Ja),zh=function(n){return function(e){return t=n,e.line>t;var t}},Vh=function(n){return function(e){return t=n,e.line===t;var t}},qh=Do.isContentEditableFalse,Hh=qc,jh=function(e,t){return Math.abs(e.left-t)},$h=function(e,t){return Math.abs(e.right-t)},Wh=function(e,t){return e>=t.left&&e<=t.right},Kh=function(e,o){return jt.reduce(e,function(e,t){var n,r;return n=Math.min(jh(e,o),$h(e,o)),r=Math.min(jh(t,o),$h(t,o)),Wh(o,t)?t:Wh(o,e)?e:r===n&&qh(t.node)?t:r<n?t:e})},Xh=function(e,t,n,r){for(;r=Hh(r,e,Wa,t);)if(n(r))return},Yh=function(e,t,n){var r,o,i,a,u,s,c,l,f=Ih((o=e,jt.filter(jt.toArray(o.getElementsByTagName("*")),Dc))),d=jt.filter(f,function(e){return n>=e.top&&n<=e.bottom});return(r=Kh(d,t))&&(r=Kh((u=e,l=function(t,e){var n;return n=jt.filter(Ih([e]),function(e){return!t(e,s)}),c=c.concat(n),0===n.length},(c=[]).push(s=r),Xh(Eh.Up,u,b(l,Ja),s.node),Xh(Eh.Down,u,b(l,Qa),s.node),c),t))&&Dc(r.node)?(a=t,{node:(i=r).node,before:jh(i,a)<$h(i,a)}):null},Gh=function(i,a,e){return!e.collapsed&&z(e.getClientRects(),function(e,t){return e||(o=a,(r=i)>=(n=t).left&&r<=n.right&&o>=n.top&&o<=n.bottom);var n,r,o},!1)},Jh=function(t){var e=Di(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=ls(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},Qh={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return Re.mac?e.metaKey:e.ctrlKey&&!e.altKey}},Zh=Do.isContentEditableTrue,ev=Do.isContentEditableFalse,tv=nl,nv=tl,rv=function(e,t){for(var n=e.getBody();t&&t!==n;){if(Zh(t)||ev(t))return t;t=t.parentNode}return null},ov=function(g){var p,e,t,a=g.getBody(),o=Rc(g.getBody(),function(e){return g.dom.isBlock(e)},function(){return Dp(g)}),h="sel-"+g.dom.uniqueId(),u=function(e){e&&g.selection.setRng(e)},s=function(){return g.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},b=function(e,t){return t=Gc(e,a,t),-1===e?Su.fromRangeStart(t):Su.fromRangeEnd(t)},n=function(e){return Aa(e)||Oa(e)||Pa(e)},y=function(e){return n(e.startContainer)||n(e.endContainer)},c=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!y(e))if(!1===t){if(c=b(-1,e),Dc(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(Dc(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=b(1,e),Dc(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(Dc(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&ev(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&(n=i.childNodes[a]),ev(n)?(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=na(er.fromDom(g.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",h)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&Re.ie?(r.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e),F(Ki(er.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){hr.remove(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},l=function(){p&&(p.removeAttribute("data-mce-selected"),na(er.fromDom(g.getBody()),"#"+h).each(Ri.remove),p=null),na(er.fromDom(g.getBody()),"#"+h).each(Ri.remove),p=null},C=function(){o.hide()};return Re.ceFalse&&(function(){g.on("mouseup",function(e){var t=s();t.collapsed&&Fp(g,e.clientX,e.clientY)&&u(cs(g,t,!1))}),g.on("click",function(e){var t;(t=rv(g,e.target))&&(ev(t)&&(e.preventDefault(),g.focus()),Zh(t)&&g.dom.isChildOf(t,g.selection.getNode())&&l())}),g.on("blur NewBlock",function(){l()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==ev(rv(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Ns(e);if(!e.firstChild)return!1;var n=Su.before(e.firstChild),r=t.next(n);return r&&!nv(r)&&!tv(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=rv(n,e.target);ev(t)&&(r||(e.preventDefault(),c(ss(n,t))))}),g.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==Fp(g,e.clientX,e.clientY))if(t=rv(g,n))ev(t)?(e.preventDefault(),c(ss(g,t))):(l(),Zh(t)&&e.shiftKey||Gh(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===Dc(n)){l(),C();var r=Yh(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);g.getBody().focus(),u(o)}}}),g.on("keypress",function(e){Qh.modifierPressed(e)||(e.keyCode,ev(g.selection.getNode())&&e.preventDefault())}),g.on("getSelectionRange",function(e){var t=e.range;if(p){if(!p.parentNode)return void(p=null);(t=t.cloneRange()).selectNode(p),e.range=t}}),g.on("setSelectionRange",function(e){var t;(t=c(e.range,e.forward))&&(e.range=t)}),g.on("AfterSetSelectionRange",function(e){var t,n=e.range;y(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||l()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!Re.ie){var r=(t=g.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),Lh(g),Jh(g)}(),e=g.contentStyles,t=".mce-content-body",e.push(o.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(La(e),u(s()),g.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},iv=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r};function av(F,U){void 0===U&&(U=ni());var e=function(){};!1!==(F=F||{}).fix_self_closing&&(F.fix_self_closing=!0);var z=F.comment?F.comment:e,V=F.cdata?F.cdata:e,q=F.text?F.text:e,H=F.start?F.start:e,j=F.end?F.end:e,$=F.pi?F.pi:e,W=F.doctype?F.doctype:e;return{parse:function(e){var t,n,r,d,o,i,a,m,u,s,g,c,p,l,f,h,v,b,y,C,x,w,N,E,S,T,k,A,_,R=0,D=[],B=0,O=$o.decode,P=Yt.makeMap("src,href,data,background,formaction,poster,xlink:href"),L=/((java|vb)script|mhtml):/i,I=function(e){var t,n;for(t=D.length;t--&&D[t].name!==e;);if(0<=t){for(n=D.length-1;t<=n;n--)(e=D[n]).valid&&j(e.name);D.length=t}},M=function(e,t,n,r,o){var i,a,u,s,c;if(n=(t=t.toLowerCase())in g?t:O(n||r||o||""),p&&!m&&0==(0===(u=t).indexOf("data-")||0===u.indexOf("aria-"))){if(!(i=b[t])&&y){for(a=y.length;a--&&!(i=y[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(P[t]&&!F.allow_script_urls){var l=n.replace(/[\s\u0000-\u001F]+/g,"");try{l=decodeURIComponent(l)}catch(f){l=unescape(l)}if(L.test(l))return;if(c=l,!(s=F).allow_html_data_urls&&(/^data:image\//i.test(c)?!1===s.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(c):/^data:/i.test(c)))return}m&&(t in P||0===t.indexOf("on"))||(d.map[t]=n,d.push({name:t,value:n}))};for(S=new RegExp("<(?:(?:!--([\\w\\W]*?)--\x3e)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),T=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=U.getShortEndedElements(),E=F.self_closing_elements||U.getSelfClosingElements(),g=U.getBoolAttrs(),p=F.validate,u=F.remove_internals,_=F.fix_self_closing,k=U.getSpecialElements(),N=e+">";t=S.exec(N);){if(R<t.index&&q(O(e.substr(R,t.index-R))),n=t[6])":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),I(n);else if(n=t[7]){if(t.index+t[0].length>e.length){q(O(e.substr(t.index))),R=t.index+t[0].length;continue}if(":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,_&&E[n]&&0<D.length&&D[D.length-1].name===n&&I(n),!p||(l=U.getElementRule(n))){if(f=!0,p&&(b=l.attributes,y=l.attributePatterns),(v=t[8])?((m=-1!==v.indexOf("data-mce-type"))&&u&&(f=!1),(d=[]).map={},v.replace(T,M)):(d=[]).map={},p&&!m){if(C=l.attributesRequired,x=l.attributesDefault,w=l.attributesForced,l.removeEmptyAttrs&&!d.length&&(f=!1),w)for(o=w.length;o--;)a=(h=w[o]).name,"{$uid}"===(A=h.value)&&(A="mce_"+B++),d.map[a]=A,d.push({name:a,value:A});if(x)for(o=x.length;o--;)(a=(h=x[o]).name)in d.map||("{$uid}"===(A=h.value)&&(A="mce_"+B++),d.map[a]=A,d.push({name:a,value:A}));if(C){for(o=C.length;o--&&!(C[o]in d.map););-1===o&&(f=!1)}if(h=d.map["data-mce-bogus"]){if("all"===h){R=iv(U,e,S.lastIndex),S.lastIndex=R;continue}f=!1}}f&&H(n,d,c)}else f=!1;if(r=k[n]){r.lastIndex=R=t.index+t[0].length,(t=r.exec(e))?(f&&(i=e.substr(R,t.index-R)),R=t.index+t[0].length):(i=e.substr(R),R=e.length),f&&(0<i.length&&q(i,!0),j(n)),S.lastIndex=R;continue}c||(v&&v.indexOf("/")===v.length-1?f&&j(n):D.push({name:n,valid:f}))}else(n=t[1])?(">"===n.charAt(0)&&(n=" "+n),F.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),z(n)):(n=t[2])?V(n.replace(/<!--|-->/g,"")):(n=t[3])?W(n):(n=t[4])&&$(n,t[5]);R=t.index+t[0].length}for(R<e.length&&q(O(e.substr(R))),o=D.length-1;0<=o;o--)(n=D[o]).valid&&j(n.name)}}}(av||(av={})).findEndTag=iv;var uv=av,sv=function(e,t){var n,r,o,i,a,u,s,c,l=t,f=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=l,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),l=s.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:uv.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return Na(l)},cv={trimExternal:sv,trimInternal:sv},lv=0,fv=2,dv=1,mv=function(g,p){var e=g.length+p.length+2,h=new Array(e),v=new Array(e),c=function(e,t,n,r,o){var i=l(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a<t||u<r;)a<t&&u<r&&g[a]===p[u]?(o.push([0,g[a]]),++a,++u):r-n<t-e?(o.push([2,g[a]]),++a):(o.push([1,p[u]]),++u);else{c(e,i.start,n,i.start-i.diag,o);for(var s=i.start;s<i.end;++s)o.push([0,g[s]]);c(i.end,t,i.end-i.diag,r,o)}},b=function(e,t,n,r){for(var o=e;o-t<r&&o<n&&g[o]===p[o-t];)++o;return{start:e,end:o,diag:t}},l=function(e,t,n,r){var o=t-e,i=r-n;if(0===o||0===i)return null;var a,u,s,c,l,f=o-i,d=i+o,m=(d%2==0?d:d+1)/2;for(h[1+m]=e,v[1+m]=t+1,a=0;a<=m;++a){for(u=-a;u<=a;u+=2){for(s=u+m,u===-a||u!==a&&h[s-1]<h[s+1]?h[s]=h[s+1]:h[s]=h[s-1]+1,l=(c=h[s])-e+n-u;c<t&&l<r&&g[c]===p[l];)h[s]=++c,++l;if(f%2!=0&&f-a<=u&&u<=f+a&&v[s-f]<=h[s])return b(v[s-f],u+e-n,t,r)}for(u=f-a;u<=f+a;u+=2){for(s=u+m-f,u===f-a||u!==f+a&&v[s+1]<=v[s-1]?v[s]=v[s+1]-1:v[s]=v[s-1],l=(c=v[s]-1)-e+n-u;e<=c&&n<=l&&g[c]===p[l];)v[s]=c--,l--;if(f%2==0&&-a<=u&&u<=a&&v[s]<=h[s+f])return b(v[s],u+e-n,t,r)}}},t=[];return c(0,g.length,0,p.length,t),t},gv=function(e){return Do.isElement(e)?e.outerHTML:Do.isText(e)?$o.encodeRaw(e.data,!1):Do.isComment(e)?"\x3c!--"+e.data+"--\x3e":""},pv=function(e,t,n){var r=function(e){var t,n,r;for(r=document.createElement("div"),t=document.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o)}else e.appendChild(r)},hv=function(e){return jt.filter(jt.map(e.childNodes,gv),function(e){return 0<e.length})},vv=function(e,t){var n,r,o,i=jt.map(t.childNodes,gv);return n=mv(i,e),r=t,o=0,jt.each(n,function(e){e[0]===lv?o++:e[0]===dv?(pv(r,e[1],o),o++):e[0]===fv&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(r,o)}),t},bv=function(e,t){var n=(t||document).createElement("div");return n.innerHTML=e,$r.children(er.fromDom(n))},yv=function(e){return e.dom().innerHTML},Cv=yv,xv=function(e,t){var n=$r.owner(e).dom(),r=er.fromDom(n.createDocumentFragment()),o=bv(t,n);Ai(r,o),Ri.empty(e),Ti.append(e,r)},wv=Bi(A.none()),Nv=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},Ev=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},Sv=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},Tv=function(e){var t=er.fromTag("body",wv.get().getOrThunk(function(){var e=document.implementation.createHTMLDocument("undo");return wv.set(A.some(e)),e}));return xv(t,Sv(e)),F(Ki(t,"*[data-mce-bogus]"),Ri.unwrap),Cv(t)},kv=function(n){var e,t,r;return e=hv(n.getBody()),-1!==(t=(r=G(e,function(e){var t=cv.trimInternal(n.serializer,e);return 0<t.length?[t]:[]})).join("")).indexOf("</iframe>")?Nv(r):Ev(t)},Av=function(e,t,n){"fragmented"===t.type?vv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},_v=function(e,t){return!(!e||!t)&&(r=t,Sv(e)===Sv(r)||(n=t,Tv(e)===Tv(n)));var n,r};function Rv(u){var s,r,o=this,c=0,l=[],t=0,f=function(){return 0===t},i=function(e){f()&&(o.typing=e)},d=function(e){u.setDirty(e)},a=function(e){i(!1),o.add({},e)},n=function(){o.typing&&(i(!1),o.add())};return u.on("init",function(){o.add()}),u.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(n(),o.beforeChange())}),u.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),u.on("ObjectResizeStart Cut",function(){o.beforeChange()}),u.on("SaveContent ObjectResized blur",a),u.on("DragEnd",a),u.on("KeyUp",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),u.nodeChanged()),46!==t&&8!==t||u.nodeChanged(),r&&o.typing&&!1===_v(kv(u),l[0])&&(!1===u.isDirty()&&(d(!0),u.fire("change",{level:l[0],lastLevel:null})),u.fire("TypingUndo"),r=!1,u.nodeChanged()))}),u.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)o.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20<t)||224===t||91===t||o.typing||n||(o.beforeChange(),i(!0),o.add({},e),r=!0)}}),u.on("MouseDown",function(e){o.typing&&a(e)}),u.on("input",function(e){var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data)&&a(e)}),u.addShortcut("meta+z","","Undo"),u.addShortcut("meta+y,meta+shift+z","","Redo"),u.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||u.nodeChanged()}),o={data:l,typing:!1,beforeChange:function(){f()&&(s=$u.getUndoBookmark(u.selection))},add:function(e,t){var n,r,o,i=u.settings;if(o=kv(u),e=e||{},e=Yt.extend(e,o),!1===f()||u.removed)return null;if(r=l[c],u.fire("BeforeAddUndo",{level:e,lastLevel:r,originalEvent:t}).isDefaultPrevented())return null;if(r&&_v(r,e))return null;if(l[c]&&(l[c].beforeBookmark=s),i.custom_undo_redo_levels&&l.length>i.custom_undo_redo_levels){for(n=0;n<l.length-1;n++)l[n]=l[n+1];l.length--,c=l.length}e.bookmark=$u.getUndoBookmark(u.selection),c<l.length-1&&(l.length=c+1),l.push(e),c=l.length-1;var a={level:e,lastLevel:r,originalEvent:t};return u.fire("AddUndo",a),0<c&&(d(!0),u.fire("change",a)),e},undo:function(){var e;return o.typing&&(o.add(),o.typing=!1,i(!1)),0<c&&(e=l[--c],Av(u,e,!0),d(!0),u.fire("undo",{level:e})),e},redo:function(){var e;return c<l.length-1&&(e=l[++c],Av(u,e,!1),d(!0),u.fire("redo",{level:e})),e},clear:function(){l=[],c=0,o.typing=!1,o.data=l,u.fire("ClearUndos")},hasUndo:function(){return 0<c||o.typing&&l[0]&&!_v(kv(u),l[0])},hasRedo:function(){return c<l.length-1&&!o.typing},transact:function(e){return n(),o.beforeChange(),o.ignore(e),o.add()},ignore:function(e){try{t++,e()}finally{t--}},extra:function(e,t){var n,r;o.transact(e)&&(r=l[c].bookmark,n=l[c-1],Av(u,n,!0),o.transact(t)&&(l[c-1].beforeBookmark=r))}}}var Dv,Bv,Ov=Sl.isEq,Pv=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},Lv=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,function(e){return!!Pv(t,e,n)||e.parentNode===o||!!Fv(t,e,n,r,!0)}),Fv(t,e,n,r))},Iv=function(e,t,n){return!!Ov(t,n.inline)||!!Ov(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},Mv=function(e,t,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(c)if("undefined"==typeof c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):Sl.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!Ov(u,Sl.normalizeStyleValue(e,Sl.replaceVars(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?e.getAttrib(t,c[s]):Sl.getStyle(e,t,c[s]))return n;return n},Fv=function(e,t,n,r,o){var i,a,u,s,c=e.formatter.get(n),l=e.dom;if(c&&t)for(a=0;a<c.length;a++)if(i=c[a],Iv(e.dom,t,i)&&Mv(l,t,i,"attributes",o,r)&&Mv(l,t,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!e.dom.hasClass(t,s[u]))return;return i}},Uv={matchNode:Fv,matchName:Iv,match:function(e,t,n,r){var o;return r?Lv(e,r,t,n):(r=e.selection.getNode(),!!Lv(e,r,t,n)||!((o=e.selection.getStart())===r||!Lv(e,o,t,n)))},matchAll:function(r,o,i){var e,a=[],u={};return e=r.selection.getStart(),r.dom.getParent(e,function(e){var t,n;for(t=0;t<o.length;t++)n=o[t],!u[n]&&Fv(r,e,n,i)&&(u[n]=!0,a.push(n))},r.dom.getRoot()),a},canApply:function(e,t){var n,r,o,i,a,u=e.formatter.get(t),s=e.dom;if(u)for(n=e.selection.getStart(),r=Sl.getParents(s,n),i=u.length-1;0<=i;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;0<=o;o--)if(s.is(r[o],a))return!0}return!1},matchesUnInheritedFormatSelector:Pv},zv=function(e,t){return e.splitText(t)},Vv=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Do.isText(t)?0<n&&n<t.nodeValue.length&&(t=(r=zv(t,n)).previousSibling,n<o?(t=r=zv(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Do.isText(t)&&0<n&&n<t.nodeValue.length&&(t=zv(t,n),n=0),Do.isText(r)&&0<o&&o<r.nodeValue.length&&(o=(r=zv(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},qv=wa,Hv="_mce_caret",jv=function(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==qv||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length},$v=function(e){var t;if(e)for(e=(t=new oo(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},Wv=function(e){var t=er.fromTag("span");return hr.setAll(t,{id:Hv,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Ti.append(t,er.fromText(qv)),t},Kv=function(e,t,n,r){var o,i,a,u;o=t.getRng(!0),i=e.getParent(n,e.isBlock),jv(n)?(!1!==r&&(o.setStartBefore(n),o.setEndBefore(n)),e.remove(n)):((u=$v(n))&&u.nodeValue.charAt(0)===qv&&u.deleteData(0,1),a=u,o.startContainer===a&&0<o.startOffset&&o.setStart(a,o.startOffset-1),o.endContainer===a&&0<o.endOffset&&o.setEnd(a,o.endOffset-1),e.remove(n,!0)),i&&e.isEmpty(i)&&af(er.fromDom(i)),t.setRng(o)},Xv=function(e,t,n,r,o){if(r)Kv(t,n,r,o);else if(!(r=Xu(e,n.getStart())))for(;r=t.get(Hv);)Kv(t,n,r,!1)},Yv=function(e,t,n){var r=e.dom,o=r.getParent(n,ya.curry(Sl.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(of(er.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},Gv=function(e,t){return e.appendChild(t),t},Jv=function(e,t){var n,r,o=(n=function(e,t){return Gv(e,t.cloneNode(!1))},r=t,function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){r=n(r,e)}),r);return Gv(o,o.ownerDocument.createTextNode(qv))},Qv=function(e){var i=e.dom,a=e.selection,u=e.getBody();e.on("mouseup keydown",function(e){var t,n,r,o;t=u,n=i,r=a,o=e.keyCode,Xv(t,n,r,null,!1),8===o&&r.isCollapsed()&&r.getStart().innerHTML===qv&&Xv(t,n,r,Xu(t,r.getStart())),37!==o&&39!==o||Xv(t,n,r,Xu(t,r.getStart()))})},Zv=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(sr.name(t))&&!Ku(t.dom())&&!Do.isBogus(t.dom())},eb={},tb=jt.filter,nb=jt.each;Bv=function(e){var t,n,r=e.selection.getRng();t=Do.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),nb(tb(tb(n,t),function(e){return t(e.previousSibling)&&-1!==jt.indexOf(n,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,pn(n=e).remove(),pn(t).append("<br><br>").append(n.childNodes)}))},eb[Dv="pre"]||(eb[Dv]=[]),eb[Dv].push(Bv);var rb=function(e,t){nb(eb[e],function(e){e(t)})},ob=/^(src|href|style)$/,ib=Yt.each,ab=Sl.isEq,ub=function(e){return/^(TH|TD)$/.test(e.nodeName)},sb=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],Do.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[i<o?i:o]),Do.isText(r)&&n&&o>=r.nodeValue.length&&(r=new oo(r,e.getBody()).next()||r),Do.isText(r)&&!n&&0===o&&(r=new oo(r,e.getBody()).prev()||r),r},cb=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},lb=function(e,t,n,r){return!(t=Sl.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},fb=function(e,n,r,o,i){var t,a,u,s,c,l,f,d,m,g,p,h,v,b,y=e.dom;if(c=y,!(ab(l=o,(f=n).inline)||ab(l,f.block)||(f.selector?Do.isElement(l)&&c.is(l,f.selector):void 0)||(s=o,n.links&&"A"===s.tagName)))return!1;if("all"!==n.remove)for(ib(n.styles,function(e,t){e=Sl.normalizeStyleValue(y,Sl.replaceVars(e,r),t),"number"==typeof t&&(t=e,i=0),(n.remove_similar||!i||ab(Sl.getStyle(y,i,t),e))&&y.setStyle(o,t,""),u=1}),u&&""===y.getAttrib(o,"style")&&(o.removeAttribute("style"),o.removeAttribute("data-mce-style")),ib(n.attributes,function(e,t){var n;if(e=Sl.replaceVars(e,r),"number"==typeof t&&(t=e,i=0),!i||ab(y.getAttrib(i,t),e)){if("class"===t&&(e=y.getAttrib(o,t))&&(n="",ib(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))return void y.setAttrib(o,t,n);"class"===t&&o.removeAttribute("className"),ob.test(t)&&o.removeAttribute("data-mce-"+t),o.removeAttribute(t)}}),ib(n.classes,function(e){e=Sl.replaceVars(e,r),i&&!y.hasClass(i,e)||y.removeClass(o,e)}),a=y.getAttribs(o),t=0;t<a.length;t++){var C=a[t].nodeName;if(0!==C.indexOf("_")&&0!==C.indexOf("data-"))return!1}return"none"!==n.remove?(d=e,g=n,h=(m=o).parentNode,v=d.dom,b=d.settings.forced_root_block,g.block&&(b?h===v.getRoot()&&(g.list_block&&ab(m,g.list_block)||ib(Yt.grep(m.childNodes),function(e){Sl.isValid(d,b,e.nodeName.toLowerCase())?p?p.appendChild(e):(p=cb(v,e,b),v.setAttribs(p,d.settings.forced_root_block_attrs)):p=0})):v.isBlock(m)&&!v.isBlock(h)&&(lb(v,m,!1)||lb(v,m.firstChild,!0,1)||m.insertBefore(v.create("br"),m.firstChild),lb(v,m,!0)||lb(v,m.lastChild,!1,1)||m.appendChild(v.create("br")))),g.selector&&g.inline&&!ab(g.inline,m)||v.remove(m,1),!0):void 0},db=fb,mb=function(s,c,l,e,f){var t,n,d=s.formatter.get(c),m=d[0],a=!0,u=s.dom,r=s.selection,i=function(e){var n,t,r,o,i,a,u=(n=s,t=e,r=c,o=l,i=f,ib(Sl.getParents(n.dom,t.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=Uv.matchNode(n,e,r,o,i))&&!1!==t.split&&(a=e)}),a);return function(e,t,n,r,o,i,a,u){var s,c,l,f,d,m,g=e.dom;if(n){for(m=n.parentNode,s=r.parentNode;s&&s!==m;s=s.parentNode){for(c=g.clone(s,!1),d=0;d<t.length;d++)if(fb(e,t[d],u,c,c)){c=0;break}c&&(l&&c.appendChild(l),f||(f=c),l=c)}!i||a.mixed&&g.isBlock(n)||(r=g.split(n,r)),l&&(o.parentNode.insertBefore(l,o),f.appendChild(o))}return r}(s,d,u,e,e,!0,m,l)},g=function(e){var t,n,r,o,i;if(Do.isElement(e)&&u.getContentEditable(e)&&(o=a,a="true"===u.getContentEditable(e),i=!0),t=Yt.grep(e.childNodes),a&&!i)for(n=0,r=d.length;n<r&&!fb(s,d[n],l,e,e);n++);if(m.deep&&t.length){for(n=0,r=t.length;n<r;n++)g(t[n]);i&&(a=o)}},p=function(e){var t=u.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return xl(n)&&(n=n[e?"firstChild":"lastChild"]),Do.isText(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),u.remove(t,!0),n},o=function(e){var t,n,r=e.commonAncestorContainer;if(e=Ml(s,e,d,!0),m.split){if(e=Vv(e),(t=sb(s,e,!0))!==(n=sb(s,e))){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"===t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&ub(n)&&n.firstChild&&(n=n.firstChild||n),u.isChildOf(t,n)&&t!==n&&!u.isBlock(n)&&!ub(t)&&!ub(n)){var o=function(e,t,n,r,o){var i=(r?"next":"previous")+"Sibling",a=e.create(n,o);t.parentNode.insertBefore(a,t);for(var u=[t],s=t;s=s[i];)u.push(s);return u.forEach(function(e){return a.appendChild(e)}),a}(u,t,"span",!0,{id:"_start","data-mce-type":"bookmark"});return i(o),void(t=p(!0))}t=cb(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),n=cb(u,n,"span",{id:"_end","data-mce-type":"bookmark"}),i(t),i(n),t=p(!0),n=p()}else t=n=i(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=u.nodeIndex(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=u.nodeIndex(n)+1}Ul(u,e,function(e){ib(e,function(e){g(e),Do.isElement(e)&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===Sl.getTextDecoration(u,e.parentNode)&&fb(s,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})};if(e)e.nodeType?((n=u.createRng()).setStartBefore(e),n.setEndAfter(e),o(n)):o(e);else if("false"!==u.getContentEditable(r.getNode()))r.isCollapsed()&&m.inline&&!u.select("td[data-mce-selected],th[data-mce-selected]").length?function(e,t,n,r){var o,i,a,u,s,c,l,f=e.dom,d=e.selection,m=[],g=d.getRng();for(o=g.startContainer,i=g.startOffset,3===(s=o).nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(Uv.matchNode(e,s,t,n,r)){c=s;break}s.nextSibling&&(u=!0),m.push(s),s=s.parentNode}if(c)if(u){a=d.getBookmark(),g.collapse(!0);var p=Ml(e,g,e.formatter.get(t),!0);p=Vv(p),e.formatter.remove(t,n,p),d.moveToBookmark(a)}else{l=Xu(e.getBody(),c);var h=Wv(!1).dom(),v=Jv(m,h);Yv(e,h,l||c),Kv(f,d,l,!1),d.setCursorLocation(v,1),f.isEmpty(c)&&f.remove(c)}}(s,c,l,f):(t=$u.getPersistentBookmark(s.selection,!0),o(r.getRng()),r.moveToBookmark(t),m.inline&&Uv.match(s,c,l,r.getStart())&&Sl.moveStart(u,r,r.getRng()),s.nodeChanged());else{e=r.getNode();for(var h=0,v=d.length;h<v&&(!d[h].ceFalseOverride||!fb(s,d[h],l,e,e));h++);}},gb=Yt.each,pb=function(e){return e&&1===e.nodeType&&!xl(e)&&!Ku(e)&&!Do.isBogus(e)},hb=function(e,t){var n;for(n=e;n;n=n[t]){if(3===n.nodeType&&0!==n.nodeValue.length)return e;if(1===n.nodeType&&!xl(n))return n}return e},vb=function(e,t,n){var r,o,i=new rf(e);if(t&&n&&(t=hb(t,"previousSibling"),n=hb(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),Yt.each(Yt.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},bb=function(e,t,n){gb(e.childNodes,function(e){pb(e)&&(t(e)&&n(e),e.hasChildNodes()&&bb(e,t,n))})},yb=function(n,e){return b(function(e,t){return!(!t||!Sl.getStyle(n,t,e))},e)},Cb=function(r,e,t){return b(function(e,t,n){r.setStyle(n,e,t),""===n.getAttribute("style")&&n.removeAttribute("style"),xb(r,n)},e,t)},xb=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},wb=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=Sl.getTextDecoration(e,t.parentNode),e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null))},Nb=function(n,e,r,o){gb(e,function(t){gb(n.dom.select(t.inline,o),function(e){pb(e)&&db(n,t,r,e,t.exact?e:null)}),function(r,e,t){if(e.clear_child_styles){var n=e.links?"*:not(a)":"*";gb(r.select(n,t),function(n){pb(n)&&gb(e.styles,function(e,t){r.setStyle(n,t,"")})})}}(n.dom,t,o)})},Eb=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(Yt.walk(r,b(wb,e),"childNodes"),wb(e,r))},Sb=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&bb(r,yb(e,"fontSize"),Cb(e,"backgroundColor",Sl.replaceVars(t.styles.backgroundColor,n)))},Tb=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(bb(r,yb(e,"fontSize"),Cb(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},kb=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=vb(e,Sl.getNonWhiteSpaceSibling(r),r),r=vb(e,r,Sl.getNonWhiteSpaceSibling(r,!0)))},Ab=function(t,n,r,o,i){Uv.matchNode(t,i.parentNode,r,o)&&db(t,n,o,i)||n.merge_with_parents&&t.dom.getParent(i.parentNode,function(e){if(Uv.matchNode(t,e,r,o))return db(t,n,o,i),!0})},_b=Yt.each,Rb=function(g,p,h,r){var e,t,v=g.formatter.get(p),b=v[0],o=!r&&g.selection.isCollapsed(),i=g.dom,n=g.selection,y=function(n,e){if(e=e||b,n){if(e.onformat&&e.onformat(n,e,h,r),_b(e.styles,function(e,t){i.setStyle(n,t,Sl.replaceVars(e,h))}),e.styles){var t=i.getAttrib(n,"style");t&&n.setAttribute("data-mce-style",t)}_b(e.attributes,function(e,t){i.setAttrib(n,t,Sl.replaceVars(e,h))}),_b(e.classes,function(e){e=Sl.replaceVars(e,h),i.hasClass(n,e)||i.addClass(n,e)})}},C=function(e,t){var n=!1;return!!b.selector&&(_b(e,function(e){if(!("collapsed"in e&&e.collapsed!==o))return i.is(t,e.selector)&&!Ku(t)?(y(t,e),!(n=!0)):void 0}),n)},a=function(s,e,t,c){var l,f,d=[],m=!0;l=b.inline||b.block,f=s.create(l),y(f),Ul(s,e,function(e){var a,u=function(e){var t,n,r,o;if(o=m,t=e.nodeName.toLowerCase(),n=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&s.getContentEditable(e)&&(o=m,m="true"===s.getContentEditable(e),r=!0),Sl.isEq(t,"br"))return a=0,void(b.block&&s.remove(e));if(b.wrapper&&Uv.matchNode(g,e,p,h))a=0;else{if(m&&!r&&b.block&&!b.wrapper&&Sl.isTextBlock(g,t)&&Sl.isValid(g,n,l))return e=s.rename(e,l),y(e),d.push(e),void(a=0);if(b.selector){var i=C(v,e);if(!b.inline||i)return void(a=0)}!m||r||!Sl.isValid(g,l,t)||!Sl.isValid(g,n,l)||!c&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||Ku(e)||b.inline&&s.isBlock(e)?(a=0,_b(Yt.grep(e.childNodes),u),r&&(m=o),a=0):(a||(a=s.clone(f,!1),e.parentNode.insertBefore(a,e),d.push(a)),a.appendChild(e))}};_b(e,u)}),!0===b.links&&_b(d,function(e){var t=function(e){"A"===e.nodeName&&y(e,b),_b(Yt.grep(e.childNodes),t)};t(e)}),_b(d,function(e){var t,n,r,o,i,a=function(e){var n=!1;return _b(e.childNodes,function(e){if((t=e)&&1===t.nodeType&&!xl(t)&&!Ku(t)&&!Do.isBogus(t))return n=e,!1;var t}),n};n=0,_b(e.childNodes,function(e){Sl.isWhiteSpaceNode(e)||xl(e)||n++}),t=n,!(1<d.length)&&s.isBlock(e)||0!==t?(b.inline||b.wrapper)&&(b.exact||1!==t||((o=a(r=e))&&!xl(o)&&Uv.matchName(s,o,b)&&(i=s.clone(o,!1),y(i),s.replace(i,r,!0),s.remove(o,1)),e=i||r),Nb(g,v,h,e),Ab(g,b,p,h,e),Sb(s,b,h,e),Tb(s,b,h,e),kb(s,b,h,e)):s.remove(e,1)})};if("false"!==i.getContentEditable(n.getNode())){if(b){if(r)r.nodeType?C(v,r)||((t=i.createRng()).setStartBefore(r),t.setEndAfter(r),a(i,Ml(g,t,v),0,!0)):a(i,r,0,!0);else if(o&&b.inline&&!i.select("td[data-mce-selected],th[data-mce-selected]").length)!function(e,t,n){var r,o,i,a,u,s,c=e.selection;a=(r=c.getRng(!0)).startOffset,s=r.startContainer.nodeValue,(o=Xu(e.getBody(),c.getStart()))&&(i=$v(o));var l,f,d=/[^\s\u00a0\u00ad\u200b\ufeff]/;s&&0<a&&a<s.length&&d.test(s.charAt(a))&&d.test(s.charAt(a-1))?(u=c.getBookmark(),r.collapse(!0),r=Ml(e,r,e.formatter.get(t)),r=Vv(r),e.formatter.apply(t,n,r),c.moveToBookmark(u)):(o&&i.nodeValue===qv||(l=e.getDoc(),f=Wv(!0).dom(),i=(o=l.importNode(f,!0)).firstChild,r.insertNode(o),a=1),e.formatter.apply(t,n,o),c.setCursorLocation(i,a))}(g,p,h);else{var u=g.selection.getNode();g.settings.forced_root_block||!v[0].defaultBlock||i.getParent(u,i.isBlock)||Rb(g,v[0].defaultBlock),g.selection.setRng(df(g.selection.getRng())),e=$u.getPersistentBookmark(g.selection,!0),a(i,Ml(g,n.getRng(),v)),b.styles&&Eb(i,b,h,u),n.moveToBookmark(e),Sl.moveStart(i,n,n.getRng()),g.nodeChanged()}rb(p,g)}}else{r=n.getNode();for(var s=0,c=v.length;s<c;s++)if(v[s].ceFalseOverride&&i.is(r,v[s].selector))return void y(r,v[s])}},Db={applyFormat:Rb},Bb=Yt.each,Ob=function(e,t,n,r,o){var i,a,u,s,c,l,f,d;null===t.get()&&(a=e,u={},(i=t).set({}),a.on("NodeChange",function(n){var r=Sl.getParents(a.dom,n.element),o={};r=Yt.grep(r,function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")}),Bb(i.get(),function(e,n){Bb(r,function(t){return a.formatter.matchNode(t,n,{},e.similar)?(u[n]||(Bb(e,function(e){e(!0,{node:t,format:n,parents:r})}),u[n]=e),o[n]=e,!1):!Uv.matchesUnInheritedFormatSelector(a,t,n)&&void 0})}),Bb(u,function(e,t){o[t]||(delete u[t],Bb(e,function(e){e(!1,{node:n.element,format:t,parents:r})}))})})),c=n,l=r,f=o,d=(s=t).get(),Bb(c.split(","),function(e){d[e]||(d[e]=[],d[e].similar=f),d[e].push(l)}),s.set(d)},Pb={get:function(r){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,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(n,e,t){Yt.each(t,function(e,t){r.setAttrib(n,t,e)})}},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 Yt.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t}},Lb=Yt.each,Ib=pi.DOM,Mb=function(e,t){var n,o,r,m=t&&t.schema||ni({}),g=function(e){var t,n,r;return o="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=Ib.create(o.name),n=t,(r=o).classes.length&&Ib.addClass(n,r.classes.join(" ")),Ib.setAttribs(n,r.attrs),t},p=function(n,e,t){var r,o,i,a,u,s,c,l,f=0<e.length&&e[0],d=f&&f.name;if(u=d,s="string"!=typeof(a=n)?a.nodeName.toLowerCase():a,c=m.getElementRule(s),i=!(!(l=c&&c.parentsRequired)||!l.length)&&(u&&-1!==Yt.inArray(l,u)?u:l[0]))d===i?(o=e[0],e=e.slice(1)):o=i;else if(f)o=e[0],e=e.slice(1);else if(!t)return n;return o&&(r=g(o)).appendChild(n),t&&(r||(r=Ib.create("div")).appendChild(n),Yt.each(t,function(e){var t=g(e);r.insertBefore(t,n)})),p(r,e,o&&o.siblings)};return e&&e.length?(o=e[0],n=g(o),(r=Ib.create("div")).appendChild(p(n,e.slice(1),o.siblings)),r):""},Fb=function(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=Yt.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,o){switch(t){case"#":a.attrs.id=n;break;case".":a.classes.push(n);break;case":":-1!==Yt.inArray("checked disabled enabled read-only required".split(" "),n)&&(a.attrs[n]=n)}if("["===r){var i=o.match(/([\w\-]+)(?:\=\"([^\"]+))?/);i&&(a.attrs[i[1]]=i[2])}return""})),a.name=t||"div",a},Ub=function(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Yt.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Yt.map(e.split(/(?:~\+|~|\+)/),Fb),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},zb=function(n,e){var t,r,o,i,a,u,s="";if(!1===(u=n.settings.preview_styles))return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var c=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}return"preview"in e&&!1===(u=e.preview)?"":(t=e.block||e.inline||"span",(i=Ub(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,r=Mb(i,n)):r=Mb([t],n),o=Ib.select(t,r)[0]||r.firstChild,Lb(e.styles,function(e,t){(e=c(e))&&Ib.setStyle(o,t,e)}),Lb(e.attributes,function(e,t){(e=c(e))&&Ib.setAttrib(o,t,e)}),Lb(e.classes,function(e){e=c(e),Ib.hasClass(o,e)||Ib.addClass(o,e)}),n.fire("PreviewFormats"),Ib.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=Ib.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,Lb(u.split(" "),function(e){var t=Ib.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=Ib.getStyle(n.getBody(),e,!0),"#ffffff"===Ib.toHex(t).toLowerCase())||"color"===e&&"#000000"===Ib.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),Ib.remove(r),s)},Vb=function(e,t,n,r,o){var i=t.get(n);!Uv.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?Db.applyFormat(e,n,r,o):mb(e,n,r,o)},qb=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])};function Hb(e){var t,n,r,o=(t=e,n={},(r=function(e,t){e&&("string"!=typeof e?Yt.each(e,function(e,t){r(t,e)}):(t=t.length?t:[t],Yt.each(t,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),n[e]=t))})(Pb.get(t.dom)),r(t.settings.formats),{get:function(e){return e?n[e]:n},register:r,unregister:function(e){return e&&n[e]&&delete n[e],n}}),i=Bi(null);return qb(e),Qv(e),{get:o.get,register:o.register,unregister:o.unregister,apply:b(Db.applyFormat,e),remove:b(mb,e),toggle:b(Vb,e,o),match:b(Uv.match,e),matchAll:b(Uv.matchAll,e),matchNode:b(Uv.matchNode,e),canApply:b(Uv.canApply,e),formatChanged:b(Ob,e,i),getCssText:b(zb,e)}}var jb,$b=Object.prototype.hasOwnProperty,Wb=(jb=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)$b.call(o,i)&&(n[i]=jb(n[i],o[i]))}return n}),Kb={register:function(t,s,c){t.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)(n=e[r]).attr("tabindex",n.attributes.map["data-mce-tabindex"]),n.attr(t,null)}),t.addAttributeFilter("src,href,style",function(e,t){for(var n,r,o=e.length,i="data-mce-"+t,a=s.url_converter,u=s.url_converter_scope;o--;)(r=(n=e[o]).attributes.map[i])!==undefined?(n.attr(t,0<r.length?r:null),n.attr(i,null)):(r=n.attributes.map[t],"style"===t?r=c.serializeStyle(c.parseStyle(r),n.name):a&&(r=a.call(u,r,t,n.name)),n.attr(t,0<r.length?r:null))}),t.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",0<n.length?n:null))}),t.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attributes.map["data-mce-type"]||n.cleanup||r.remove()}),t.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=$o.decode(t.value))}),t.addNodeFilter("script,style",function(e,t){for(var n,r,o,i=e.length,a=function(e){return e.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,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="// <![CDATA[\n"+a(r)+"\n// ]]>")):"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="\x3c!--\n"+a(r)+"\n--\x3e")}),t.addNodeFilter("#comment",function(e){for(var t,n=e.length;n--;)0===(t=e[n]).value.indexOf("[CDATA[")?(t.name="#cdata",t.type=4,t.value=t.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===t.value.indexOf("mce:protected ")&&(t.name="#text",t.type=3,t.raw=!0,t.value=unescape(t.value).substr(14))}),t.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||"type"in n.attributes.map||n.attr("type","text"))}),t.addAttributeFilter("data-mce-type",function(e){F(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",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})},trimTrailingBr:function(e){var t,n,r=function(e){return e&&"br"===e.name};r(t=e.lastChild)&&r(n=t.prev)&&(t.remove(),n.remove())}},Xb={process:function(e,t,n){return f=n,(l=e)&&l.hasEventListeners("PreProcess")&&!f.no_events?(o=t,i=n,c=(r=e).dom,o=o.cloneNode(!0),(a=document.implementation).createHTMLDocument&&(u=a.createHTMLDocument(""),Yt.each("BODY"===o.nodeName?o.childNodes:[o],function(e){u.body.appendChild(u.importNode(e,!0))}),o="BODY"!==o.nodeName?u.body.firstChild:u.body,s=c.doc,c.doc=u),tp(r,Wb(i,{node:o})),s&&(c.doc=s),o):t;var r,o,i,a,u,s,c,l,f}},Yb=function(e,a,u){e.addNodeFilter("font",function(e){F(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,F(["color","face","size"],function(e){t.attr(e,null)})})})},Gb=function(e,t){var n,r=oi();t.convert_fonts_to_spans&&Yb(e,r,Yt.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){F(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},Jb={register:function(e,t){t.inline_styles&&Gb(e,t)}},Qb=/^[ \t\r\n]*$/,Zb={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},ey=function(e,t,n){var r,o,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i])return e[i];if(e!==t){if(r=e[a])return r;for(o=e.parent;o&&o!==t;o=o.parent)if(r=o[a])return r}},ty=function(){function a(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}return a.create=function(e,t){var n,r;if(n=new a(e,Zb[e]||1),t)for(r in t)n.attr(r,t[r]);return n},a.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},a.prototype.attr=function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(t!==undefined){if(null===t){if(e in n.map)for(delete n.map[e],r=n.length;r--;)if(n[r].name===e)return n=n.splice(r,1),this;return this}if(e in n.map){for(r=n.length;r--;)if(n[r].name===e){n[r].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,this}return n.map[e]}},a.prototype.clone=function(){var e,t,n,r,o,i=new a(this.name,this.type);if(n=this.attributes){for((o=[]).map={},e=0,t=n.length;e<t;e++)"id"!==(r=n[e]).name&&(o[o.length]={name:r.name,value:r.value},o.map[r.name]=r.value);i.attributes=o}return i.value=this.value,i.shortEnded=this.shortEnded,i},a.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},a.prototype.unwrap=function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},a.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},a.prototype.append=function(e){var t;return e.parent&&e.remove(),(t=this.lastChild)?((t.next=e).prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},a.prototype.insert=function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},a.prototype.getAll=function(e){var t,n=[];for(t=this.firstChild;t;t=ey(t,this))t.name===e&&n.push(t);return n},a.prototype.empty=function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=ey(n,this))e.push(n);for(t=e.length;t--;)(n=e[t]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return this.firstChild=this.lastChild=null,this},a.prototype.isEmpty=function(e,t,n){var r,o,i=this.firstChild;if(t=t||{},i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(e[i.name])return!1;for(r=i.attributes.length;r--;)if("name"===(o=i.attributes[r].name)||0===o.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!Qb.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&Qb.test(i.value))return!1;if(n&&n(i))return!1}while(i=ey(i,this));return!0},a.prototype.walk=function(e){return ey(this,null,e)},a}(),ny=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new ty("br",1)).shortEnded=!0:r.empty().append(new ty("#text",3)).value="\xa0"},ry=function(e){return oy(e,"#text")&&"\xa0"===e.firstChild.value},oy=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},iy=function(r,e,t,n){return n.isEmpty(e,t,function(e){return t=e,(n=r.getElementRule(t.name))&&n.paddEmpty;var t,n})},ay=function(e,t){return e&&(t[e.name]||"br"===e.name)},uy=function(e,p){var h=e.schema;p.remove_trailing_brs&&e.addNodeFilter("br",function(e,t,n){var r,o,i,a,u,s,c,l,f=e.length,d=Yt.extend({},h.getBlockElements()),m=h.getNonEmptyElements(),g=h.getNonEmptyElements();for(d.body=1,r=0;r<f;r++)if(i=(o=e[r]).parent,d[o.parent.name]&&o===i.lastChild){for(u=o.prev;u;){if("span"!==(s=u.name)||"bookmark"!==u.attr("data-mce-type")){if("br"!==s)break;if("br"===s){o=null;break}}u=u.prev}o&&(o.remove(),iy(h,m,g,i)&&(c=h.getElementRule(i.name))&&(c.removeEmpty?i.remove():c.paddEmpty&&ny(p,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==p.padd_empty_with_br&&((l=new ty("#text",3)).value="\xa0",o.replace(l))}}),e.addAttributeFilter("href",function(e){var t,n,r,o=e.length;if(!p.allow_unsafe_link_target)for(;o--;)"a"===(t=e[o]).name&&"_blank"===t.attr("target")&&t.attr("rel",(n=t.attr("rel"),r=n?Yt.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}),p.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);}),p.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new ty("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),p.validate&&h.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t,n,r,o,i,a,u,s=e.length,c=h.getValidClasses();s--;){for(n=(t=e[s]).attr("class").split(" "),i="",r=0;r<n.length;r++)o=n[r],u=!1,(a=c["*"])&&a[o]&&(u=!0),a=c[t.name],!u&&a&&a[o]&&(u=!0),u&&(i&&(i+=" "),i+=o);i.length||(i=null),t.attr("class",i)}})},sy=Yt.makeMap,cy=Yt.each,ly=Yt.explode,fy=Yt.extend;function dy(T,k){void 0===k&&(k=ni());var A={},_=[],R={},D={};(T=T||{}).validate=!("validate"in T)||T.validate,T.root_name=T.root_name||"body";var B=function(e){var t,n,r;n in A&&((r=R[n])?r.push(e):R[n]=[e]),t=_.length;for(;t--;)(n=_[t].name)in e.attributes.map&&((r=D[n])?r.push(e):D[n]=[e]);return e},e={schema:k,addAttributeFilter:function(e,n){cy(ly(e),function(e){var t;for(t=0;t<_.length;t++)if(_[t].name===e)return void _[t].callbacks.push(n);_.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(_)},addNodeFilter:function(e,n){cy(ly(e),function(e){var t=A[e];t||(A[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e=[];for(var t in A)A.hasOwnProperty(t)&&e.push({name:t,callbacks:A[t]});return e},filterNode:B,parse:function(e,a){var t,n,r,o,i,u,s,c,l,f,d,m=[];a=a||{},R={},D={},l=fy(sy("script,style,head,html,body,title,meta,param"),k.getBlockElements());var g=k.getNonEmptyElements(),p=k.children,h=T.validate,v="forced_root_block"in a?a.forced_root_block:T.forced_root_block,b=k.getWhiteSpaceElements(),y=/^[ \t\r\n]+/,C=/[ \t\r\n]+$/,x=/[ \t\r\n]+/g,w=/^[ \t\r\n]+$/;f=b.hasOwnProperty(a.context)||b.hasOwnProperty(T.root_name);var N=function(e,t){var n,r=new ty(e,t);return e in A&&((n=R[e])?n.push(r):R[e]=[r]),r},E=function(e){var t,n,r,o,i=k.getBlockElements();for(t=e.prev;t&&3===t.type;){if(0<(r=t.value.replace(C,"")).length)return void(t.value=r);if(n=t.next){if(3===n.type&&n.value.length){t=t.prev;continue}if(!i[n.name]&&"script"!==n.name&&"style"!==n.name){t=t.prev;continue}}o=t.prev,t.remove(),t=o}};t=uv({validate:h,allow_script_urls:T.allow_script_urls,allow_conditional_comments:T.allow_conditional_comments,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(k.getSelfClosingElements()),cdata:function(e){d.append(N("#cdata",4)).value=e},text:function(e,t){var n;f||(e=e.replace(x," "),ay(d.lastChild,l)&&(e=e.replace(y,""))),0!==e.length&&((n=N("#text",3)).raw=!!t,d.append(n).value=e)},comment:function(e){d.append(N("#comment",8)).value=e},pi:function(e,t){d.append(N(e,7)).value=t,E(d)},doctype:function(e){d.append(N("#doctype",10)).value=e,E(d)},start:function(e,t,n){var r,o,i,a,u;if(i=h?k.getElementRule(e):{}){for((r=N(i.outputName||e,1)).attributes=t,r.shortEnded=n,d.append(r),(u=p[d.name])&&p[r.name]&&!u[r.name]&&m.push(r),o=_.length;o--;)(a=_[o].name)in t.map&&((s=D[a])?s.push(r):D[a]=[r]);l[e]&&E(r),n||(d=r),!f&&b[e]&&(f=!0)}},end:function(e){var t,n,r,o,i;if(n=h?k.getElementRule(e):{}){if(l[e]&&!f){if((t=d.firstChild)&&3===t.type)if(0<(r=t.value.replace(y,"")).length)t.value=r,t=t.next;else for(o=t.next,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.next,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o;if((t=d.lastChild)&&3===t.type)if(0<(r=t.value.replace(C,"")).length)t.value=r,t=t.prev;else for(o=t.prev,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.prev,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o}if(f&&b[e]&&(f=!1),n.removeEmpty&&iy(k,g,b,d)&&!d.attributes.map.name&&!d.attr("id"))return i=d.parent,l[d.name]?d.empty().remove():d.unwrap(),void(d=i);n.paddEmpty&&(ry(d)||iy(k,g,b,d))&&ny(T,a,l,d),d=d.parent}}},k);var S=d=new ty(a.context||T.root_name,11);if(t.parse(e),h&&m.length&&(a.context?a.invalid=!0:function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h;for(d=sy("tr,td,th,tbody,thead,tfoot,table"),l=k.getNonEmptyElements(),f=k.getWhiteSpaceElements(),m=k.getTextBlockElements(),g=k.getSpecialElements(),t=0;t<e.length;t++)if((n=e[t]).parent&&!n.fixed)if(m[n.name]&&"li"===n.parent.name){for(p=n.next;p&&m[p.name];)p.name="li",p.fixed=!0,n.parent.insert(p,n.parent),p=p.next;n.unwrap(n)}else{for(o=[n],r=n.parent;r&&!k.isValidChild(r.name,n.name)&&!d[r.name];r=r.parent)o.push(r);if(r&&1<o.length){for(o.reverse(),i=a=B(o[0].clone()),c=0;c<o.length-1;c++){for(k.isValidChild(a.name,o[c].name)?(u=B(o[c].clone()),a.append(u)):u=a,s=o[c].firstChild;s&&s!==o[c+1];)h=s.next,u.append(s),s=h;a=u}iy(k,l,f,i)?r.insert(n,o[0],!0):(r.insert(i,o[0],!0),r.insert(n,i)),r=o[0],(iy(k,l,f,r)||oy(r,"br"))&&r.empty().remove()}else if(n.parent){if("li"===n.name){if((p=n.prev)&&("ul"===p.name||"ul"===p.name)){p.append(n);continue}if((p=n.next)&&("ul"===p.name||"ul"===p.name)){p.insert(n,p.firstChild,!0);continue}n.wrap(B(new ty("ul",1)));continue}k.isValidChild(n.parent.name,"div")&&k.isValidChild("div",n.name)?n.wrap(B(new ty("div",1))):g[n.name]?n.empty().remove():n.unwrap()}}}(m)),v&&("body"===S.name||a.isRootContent)&&function(){var e,t,n=S.firstChild,r=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(y,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(C,"")))};if(k.isValidChild(S.name,v.toLowerCase())){for(;n;)e=n.next,3===n.type||1===n.type&&"p"!==n.name&&!l[n.name]&&!n.attr("data-mce-type")?(t||((t=N(v,1)).attr(T.forced_root_block_attrs),S.insert(t,n)),t.append(n)):(r(t),t=null),n=e;r(t)}}(),!a.invalid){for(c in R){for(s=A[c],i=(n=R[c]).length;i--;)n[i].parent||n.splice(i,1);for(r=0,o=s.length;r<o;r++)s[r](n,c,a)}for(r=0,o=_.length;r<o;r++)if((s=_[r]).name in D){for(i=(n=D[s.name]).length;i--;)n[i].parent||n.splice(i,1);for(i=0,u=s.callbacks.length;i<u;i++)s.callbacks[i](n,s.name,a)}}return S}};return uy(e,T),Jb.register(e,T),e}var my=function(e,t,n){-1===Yt.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},gy=function(e,t,n){var r=Na(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||Co(er.fromDom(t))?r:Yt.trim(r)},py=function(e,t,n){var r=n.selection?Wb({forced_root_block:!1},n):n,o=e.parse(t,r);return Kb.trimTrailingBr(o),o},hy=function(e,t,n,r,o){var i,a,u,s,c=(i=r,lf(t,n).serialize(i));return a=e,s=c,!(u=o).no_events&&a?np(a,Wb(u,{content:s})).content:s};function vy(e,t){var a,u,s,c,l,n,r=(a=e,n=["data-mce-selected"],s=(u=t)&&u.dom?u.dom:pi.DOM,c=u&&u.schema?u.schema:ni(a),a.entity_encoding=a.entity_encoding||"named",a.remove_trailing_brs=!("remove_trailing_brs"in a)||a.remove_trailing_brs,l=dy(a,c),Kb.register(l,a,s),{schema:c,addNodeFilter:l.addNodeFilter,addAttributeFilter:l.addAttributeFilter,serialize:function(e,t){var n=Wb({format:"html"},t||{}),r=Xb.process(u,e,n),o=gy(s,r,n),i=py(l,o,n);return"tree"===n.format?i:hy(u,a,c,i,n)},addRules:function(e){c.addValidElements(e)},setRules:function(e){c.setValidElements(e)},addTempAttr:b(my,l,n),getTempAttrs:function(){return n}});return{schema:r.schema,addNodeFilter:r.addNodeFilter,addAttributeFilter:r.addAttributeFilter,serialize:r.serialize,addRules:r.addRules,setRules:r.setRules,addTempAttr:r.addTempAttr,getTempAttrs:r.getTempAttrs}}function by(e){return{getBookmark:b(yl,e),moveToBookmark:b(Cl,e)}}(by||(by={})).isBookmarkNode=xl;var yy=by,Cy=Do.isContentEditableFalse,xy=Do.isContentEditableTrue,wy=function(r,a){var u,s,c,l,f,d,m,g,p,h,v,b,i,y,C,x,w,N=a.dom,E=Yt.each,S=a.getDoc(),T=document,k=Math.abs,A=Math.round,_=a.getBody();l={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var e=".mce-content-body";a.contentStyles.push(e+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: content-box;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+e+" .mce-resizehandle:hover {background: #000}"+e+" img[data-mce-selected],"+e+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+e+" .mce-clonedresizable {position: absolute;"+(Re.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+e+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");var R=function(e){return e&&("IMG"===e.nodeName||a.dom.is(e,"figure.image"))},n=function(e){var t,n,r=e.target;t=e,n=a.selection.getRng(),!R(t.target)||Gh(t.clientX,t.clientY,n)||e.isDefaultPrevented()||(e.preventDefault(),a.selection.select(r))},D=function(e){return a.dom.is(e,"figure.image")?e.querySelector("img"):e},B=function(e){var t=a.settings.object_resizing;return!1!==t&&!Re.iOS&&("string"!=typeof t&&(t="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==a.getBody()&&Lr.is(er.fromDom(e),t))},O=function(e){var t,n,r,o;t=e.screenX-d,n=e.screenY-m,y=t*f[2]+h,C=n*f[3]+v,y=y<5?5:y,C=C<5?5:C,(R(u)&&!1!==a.settings.resize_img_proportional?!Qh.modifierPressed(e):Qh.modifierPressed(e)||R(u)&&f[2]*f[3]!=0)&&(k(t)>k(n)?(C=A(y*b),y=A(C/b)):(y=A(C/b),C=A(y*b))),N.setStyles(D(s),{width:y,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=y+" × "+C,f[2]<0&&s.clientWidth<=y&&N.setStyle(s,"left",g+(h-y)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",p+(v-C)),(t=_.scrollWidth-x)+(n=_.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(ip(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(D(u),e,t):N.setAttrib(D(u),e,t))};e("width",y),e("height",C),N.unbind(S,"mousemove",O),N.unbind(S,"mouseup",P),T!==S&&(N.unbind(T,"mousemove",O),N.unbind(T,"mouseup",P)),N.remove(s),N.remove(c),o(u),ap(a,u,y,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;L(),F(),t=N.getPos(e,_),g=t.x,p=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,y=C=0),n=a.fire("ObjectSelected",{target:e}),B(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(_,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===Re.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=D(u).clientWidth,v=D(u).clientHeight,b=v/h,(f=n).startPos={x:r*n[0]+g,y:o*n[1]+p},x=_.scrollWidth,w=_.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:g,top:p,margin:0}),s.removeAttribute("data-mce-selected"),_.appendChild(s),N.bind(S,"mousemove",O),N.bind(S,"mouseup",P),T!==S&&(N.bind(T,"mousemove",O),N.bind(T,"mouseup",P)),c=N.add(_,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" × "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+p-t.offsetHeight/2})}):L(),u.setAttribute("data-mce-selected","1")},L=function(){var e,t;for(e in F(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},I=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],_)&&(U(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):L())},M=function(e){return Cy(function(e,t){for(;t&&t!==e;){if(xy(t)||Cy(t))return t;t=t.parentNode}return null}(a.getBody(),e))},F=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},U=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){U(),Re.ie&&11<=Re.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||M(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(_,"mscontrolselect",function(e){var t=function(e){Le.setEditorTimeout(a,function(){a.selection.select(e)})};if(M(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=Le.throttle(function(e){a.composing||I(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",L),a.on("contextmenu",n)}),a.on("remove",F),{isResizable:B,showResizeRect:o,hideResizeRect:L,updateResizeRect:I,destroy:function(){u=s=null}}},Ny=function(e){return Do.isContentEditableTrue(e)||Do.isContentEditableFalse(e)},Ey=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=Yt.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,Do.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Ny))?null:i}return r},Sy=function(n,e){return $(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},Ty=function(e,t){var n=(t||document).createDocumentFragment();return F(e,function(e){n.appendChild(e.dom())}),er.fromDom(n)},ky=kr("element","width","rows"),Ay=kr("element","cells"),_y=kr("x","y"),Ry=function(e,t){var n=parseInt(hr.get(e,t),10);return isNaN(n)?1:n},Dy=function(e){return z(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},By=function(e,t){for(var n=e.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Fr.eq(o[i],t))return A.some(_y(i,r));return A.none()},Oy=function(e,t,n,r,o){for(var i=[],a=e.rows(),u=n;u<=o;u++){var s=a[u].cells(),c=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(Ay(a[u].element(),c))}return i},Py=function(e){var o=ky(pa(e),0,[]);return F(Ki(e,"tr"),function(n,r){F(Ki(n,"td,th"),function(e,t){!function(e,t,n,r,o){for(var i=Ry(o,"rowspan"),a=Ry(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=Ay(ha(r),[]));for(var c=t;c<t+a;c++)u[s].cells()[c]=s===n&&c===t?o:pa(o)}}(o,function(e,t,n){for(;r=t,o=n,i=void 0,((i=e.rows())[o]?i[o].cells():[])[r];)t++;var r,o,i;return t}(o,t,r),r,n,e)})}),ky(o.element(),Dy(o.rows()),o.rows())},Ly=function(e){return n=$((t=e).rows(),function(e){var t=$(e.cells(),function(e){var t=ha(e);return hr.remove(t,"colspan"),hr.remove(t,"rowspan"),t}),n=pa(e.element());return Ai(n,t),n}),r=pa(t.element()),o=er.fromTag("tbody"),Ai(o,n),Ti.append(r,o),r;var t,n,r,o},Iy=function(l,e,t){return By(l,e).bind(function(c){return By(l,t).map(function(e){return t=l,r=e,o=(n=c).x(),i=n.y(),a=r.x(),u=r.y(),s=i<u?Oy(t,o,i,a,u):Oy(t,o,u,a,i),ky(t.element(),Dy(s),s);var t,n,r,o,i,a,u,s})})},My=function(n,t){return V(n,function(e){return"li"===sr.name(e)&&Ch(e,t)}).fold(H([]),function(e){return(t=n,V(t,function(e){return"ul"===sr.name(e)||"ol"===sr.name(e)})).map(function(e){return[er.fromTag("li"),er.fromTag(sr.name(e))]}).getOr([]);var t})},Fy=function(e,t){var n,r=er.fromDom(t.commonAncestorContainer),o=Yf(r,e),i=U(o,function(e){return fo(e)||co(e)}),a=My(o,t),u=i.concat(a.length?a:ho(n=r)?$r.parent(n).filter(po).fold(H([]),function(e){return[n,e]}):po(n)?[n]:[]);return $(u,pa)},Uy=function(){return Ty([])},zy=function(e,t){return n=er.fromDom(t.cloneContents()),r=Fy(e,t),o=z(r,function(e,t){return Ti.append(t,e),t},n),0<r.length?Ty([o]):o;var n,r,o},Vy=function(e,o){return(t=e,n=o[0],ta(n,"table",b(Fr.eq,t))).bind(function(e){var t=o[0],n=o[o.length-1],r=Py(e);return Iy(r,t,n).map(function(e){return Ty([Ly(e)])})}).getOrThunk(Uy);var t,n},qy=function(e,t){var n,r,o=zm(t,e);return 0<o.length?Vy(e,o):(n=e,0<(r=t).length&&r[0].collapsed?Uy():zy(n,r[0]))},Hy=function(e,t){var n,r=e.selection.getRng(),o=e.dom.create("body"),i=e.selection.getSel(),a=Sy(e,Pm(i));if((t=t||{}).get=!0,t.format=t.format||"html",t.selection=!0,(t=e.fire("BeforeGetContent",t)).isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return e.selection.isCollapsed()?"":Na(r.text||(i.toString?i.toString():""));r.cloneContents?(n=t.contextual?qy(er.fromDom(e.getBody()),a).dom():r.cloneContents())&&o.appendChild(n):r.item!==undefined||r.htmlText!==undefined?(o.innerHTML="<br>"+(r.item?r.item(0).outerHTML:r.htmlText),o.removeChild(o.firstChild)):o.innerHTML=r.toString(),t.getInner=!0;var u=e.selection.serializer.serialize(o,t);return"tree"===t.format?u:(t.content=e.selection.isCollapsed()?"":u,e.fire("GetContent",t),t.content)},jy=function(e,t,n){var r,o,i,a=e.selection.getRng(),u=e.getDoc();if((n=n||{format:"html"}).set=!0,n.selection=!0,n.content=t,n.no_events||!(n=e.fire("BeforeSetContent",n)).isDefaultPrevented()){if(t=n.content,a.insertNode){t+='<span id="__caret">_</span>',a.startContainer===u&&a.endContainer===u?u.body.innerHTML=t:(a.deleteContents(),0===u.body.childNodes.length?u.body.innerHTML=t:a.createContextualFragment?a.insertNode(a.createContextualFragment(t)):(o=u.createDocumentFragment(),i=u.createElement("div"),o.appendChild(i),i.outerHTML=t,a.insertNode(o))),r=e.dom.get("__caret"),(a=u.createRange()).setStartBefore(r),a.setEndBefore(r),e.selection.setRng(a),e.dom.remove("__caret");try{e.selection.setRng(a)}catch(s){}}else a.item&&(u.execCommand("Delete",!1,null),a=e.getRng()),/^\s+/.test(t)?(a.pasteHTML('<span id="__mce_tmp">_</span>'+t),e.dom.remove("__mce_tmp")):a.pasteHTML(t);n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},$y=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return A.from(i).map(er.fromDom).map(function(e){return r&&t.collapsed?e:$r.child(e,o(e,a)).getOr(e)}).bind(function(e){return sr.isElement(e)?A.some(e):$r.parent(e)}).map(function(e){return e.dom()}).getOr(e)},Wy=function(e,t,n){return $y(e,t,!0,n,function(e,t){return Math.min($r.childNodesCount(e),t)})},Ky=function(e,t,n){return $y(e,t,!1,n,function(e,t){return 0<t?t-1:t})},Xy=function(e,t){for(var n=e;e&&Do.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},Yy=Yt.each,Gy=function(e){return!!e.select},Jy=function(e){return!(!e||!e.ownerDocument)&&Fr.contains(er.fromDom(e.ownerDocument),er.fromDom(e))},Qy=function(u,s,e,c){var n,t,l,f,a,r=function(e,t){return jy(c,e,t)},o=function(e){var t=m();t.collapse(!!e),i(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},m=function(){var e,t,n,r,o=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;if(null==(r=s.document))return null;if(c.bookmark!==undefined&&!1===Dp(c)){var i=Hg(c);if(i.isSome())return i.map(function(e){return Sy(c,[e])[0]}).getOr(r.createRange())}try{(e=d())&&(t=0<e.rangeCount?e.getRangeAt(0):e.createRange?e.createRange():r.createRange())}catch(a){}return(t=Sy(c,[t])[0])||(t=r.createRange?r.createRange():r.body.createTextRange()),t.setStart&&9===t.startContainer.nodeType&&t.collapsed&&(n=u.getRoot(),t.setStart(n,0),t.setEnd(n,0)),l&&f&&(0===o(t.START_TO_START,t,l)&&0===o(t.END_TO_END,t,l)?t=f:f=l=null),t},i=function(e,t){var n,r;if((o=e)&&(Gy(o)||Jy(o.startContainer)&&Jy(o.endContainer))){var o,i=Gy(e)?e:null;if(i){f=null;try{i.select()}catch(a){}}else{if(n=d(),e=c.fire("SetSelectionRange",{range:e,forward:t}).range,n){f=e;try{n.removeAllRanges(),n.addRange(e)}catch(a){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),l=0<n.rangeCount?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||Re.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(r=e.startContainer.childNodes[e.startOffset])&&"IMG"===r.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(r,0,r,1)),c.fire("AfterSetSelectionRange",{range:e,forward:t})}}},g=function(){var e,t,n=d();return!(n&&n.anchorNode&&n.focusNode)||((e=u.createRng()).setStart(n.anchorNode,n.anchorOffset),e.collapse(!0),(t=u.createRng()).setStart(n.focusNode,n.focusOffset),t.collapse(!0),e.compareBoundaryPoints(e.START_TO_START,t)<=0)},p={bookmarkManager:null,controlSelection:null,dom:u,win:s,serializer:e,editor:c,collapse:o,setCursorLocation:function(e,t){var n=u.createRng();e?(n.setStart(e,t),n.setEnd(e,t),i(n),o(!1)):(xh(u,n,c.getBody(),!0),i(n))},getContent:function(e){return Hy(c,e)},setContent:r,getBookmark:function(e,t){return n.getBookmark(e,t)},moveToBookmark:function(e){return n.moveToBookmark(e)},select:function(e,t){var r,n,o;return(r=u,n=e,o=t,A.from(n).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(xh(r,n,e,!0),xh(r,n,e,!1)),n})).each(i),e},isCollapsed:function(){var e=m(),t=d();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:g,setNode:function(e){return r(u.getOuterHTML(e)),e},getNode:function(){return e=c.getBody(),(t=m())?(r=t.startContainer,o=t.endContainer,i=t.startOffset,a=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Xy(r.nextSibling,!0):r.parentNode,o=0===a?Xy(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n):e;var e,t,n,r,o,i,a},getSel:d,setRng:i,getRng:m,getStart:function(e){return Wy(c.getBody(),m(),e)},getEnd:function(e){return Ky(c.getBody(),m(),e)},getSelectedBlocks:function(e,t){return function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||Wy(i,t,t.collapsed),e.isBlock),r=e.getParent(r||Ky(i,t,t.collapsed),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r)for(var u=new oo(o=n,i);(o=u.next())&&o!==r;)e.isBlock(o)&&a.push(o);return r&&n!==r&&r!==i&&a.push(r),a}(u,m(),e,t)},normalize:function(){var e=m(),t=d();if(!Im(t)&&wh(c)){var n=mg(u,e);return n.each(function(e){i(e,g())}),n.getOr(e)}return e},selectorChanged:function(e,t){var i;return a||(a={},i={},c.on("NodeChange",function(e){var n=e.element,r=u.getParents(n,null,u.getRoot()),o={};Yy(a,function(e,n){Yy(r,function(t){if(u.is(t,n))return i[n]||(Yy(e,function(e){e(!0,{node:t,selector:n,parents:r})}),i[n]=e),o[n]=e,!1})}),Yy(i,function(e,t){o[t]||(delete i[t],Yy(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),p},getScrollContainer:function(){for(var e,t=u.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return js(c,e,t)},placeCaretAt:function(e,t){return i(Ey(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?Su.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=yy(p),t=wy(p,c),p.bookmarkManager=n,p.controlSelection=t,p},Zy=Do.isContentEditableFalse,eC=Za,tC=nl,nC=tl,rC=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},oC=function(e,t,n,r){var o,i,a,u,s,c,l=e===Nu.Forwards,f=l?nC:tC;return!r.collapsed&&(o=eC(r),Zy(o))?us(e,t,o,e===Nu.Backwards,!0):(u=Ta(r.startContainer),f(i=el(e,t.getBody(),r))?ss(t,i.getNode(!l)):(i=n(i))?f(i)?us(e,t,i.getNode(!l),l,!0):f(a=n(i))&&(!(c=jc(s=i,a))&&Do.isBr(s.getNode())||c)?us(e,t,a.getNode(!l),l,!0):u?ls(t,i.toRange(),!0):null:u?r:null)},iC=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=eC(r),o=el(e,t.getBody(),r),i=n(t.getBody(),zh(1),o),a=jt.filter(i,Vh(1)),s=jt.last(o.getClientRects()),(nC(o)||rl(o))&&(d=o.getNode()),(tC(o)||ol(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=Kh(a,c))&&Zy(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),us(e,t,u.node,l<f,!0);if(d){var m=function(e,t,n,r){var o,i,a,u,s,c,l=Ns(t),f=[],d=0,m=function(e){return jt.last(e.getClientRects())};1===e?(o=l.next,i=Qa,a=Ja,u=Su.after(r)):(o=l.prev,i=Ja,a=Qa,u=Su.before(r)),c=m(u);do{if(u.isVisible()&&!a(s=m(u),c)){if(0<f.length&&i(s,jt.last(f))&&d++,(s=Xa(s)).position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f}(e,t.getBody(),zh(1),d);if(u=Kh(jt.filter(m,Vh(1)),c))return ls(t,u.position.toRange(),!0);if(u=jt.last(jt.filter(m,Vh(0))))return ls(t,u.position.toRange(),!0)}},aC=function(e,t,n){var r,o,i,a,u=Ns(e.getBody()),s=ya.curry(rC,u.next),c=ya.curry(rC,u.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?s(Su.fromRangeStart(n)):c(Su.fromRangeStart(n)))||(a=(i=e).dom.create(i.settings.forced_root_block),(!Re.ie||11<=Re.ie)&&(a.innerHTML='<br data-mce-bogus="1">'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},uC=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Ns((e=l).getBody()),o=ya.curry(rC,r.next),i=ya.curry(rC,r.prev),a=t?Nu.Forwards:Nu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=oC(a,e,u,s))?n:(n=aC(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},sC=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?Uh:Fh,i=(e=u).selection.getRng(),(n=iC(r,e,o,i))?n:(n=aC(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}},cC=function(e,r){return G($(e,function(e){return Wb({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:v},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},lC=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}},fC=function(e,t){return V(cC(e,t),function(e){return e.action()})},dC=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=Qn.detect().os,fC([{keyCode:Qh.RIGHT,action:uC(t,!0)},{keyCode:Qh.LEFT,action:uC(t,!1)},{keyCode:Qh.UP,action:sC(t,!1)},{keyCode:Qh.DOWN,action:sC(t,!0)},{keyCode:Qh.RIGHT,action:Tc(t,!0)},{keyCode:Qh.LEFT,action:Tc(t,!1)},{keyCode:Qh.UP,action:kc(t,!1)},{keyCode:Qh.DOWN,action:kc(t,!0)},{keyCode:Qh.RIGHT,action:gm.move(t,n,!0)},{keyCode:Qh.LEFT,action:gm.move(t,n,!1)},{keyCode:Qh.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:gm.moveNextWord(t,n)},{keyCode:Qh.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:gm.movePrevWord(t,n)}],r).each(function(e){r.preventDefault()}))})},mC=function(e){return 1===$r.children(e).length},gC=function(e,t,n,r){var o,i,a,u,s=b(Zv,t),c=$(U(r,s),function(e){return e.dom()});if(0===c.length)Nd(t,e,n);else{var l=(o=n.dom(),i=c,a=Wv(!1),u=Jv(i,a.dom()),Ti.before(er.fromDom(o),a),Ri.remove(er.fromDom(o)),Su(u,0));t.selection.setRng(l.toRange())}},pC=function(n,r){var t,e=er.fromDom(n.getBody()),o=er.fromDom(n.selection.getStart()),i=U((t=Yf(o,e),K(t,lo).fold(H(t),function(e){return t.slice(0,e)})),mC);return te(i).map(function(e){var t=Su.fromRangeStart(n.selection.getRng());return!!Of(r,t,e.dom())&&(gC(r,n,e,i),!0)}).getOr(!1)},hC=function(e,t){return!!e.selection.isCollapsed()&&pC(e,t)},vC=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,fC([{keyCode:Qh.BACKSPACE,action:lC(Td,t,!1)},{keyCode:Qh.DELETE,action:lC(Td,t,!0)},{keyCode:Qh.BACKSPACE,action:lC(bm,t,n,!1)},{keyCode:Qh.DELETE,action:lC(bm,t,n,!0)},{keyCode:Qh.BACKSPACE,action:lC(Jm,t,!1)},{keyCode:Qh.DELETE,action:lC(Jm,t,!0)},{keyCode:Qh.BACKSPACE,action:lC(sd,t,!1)},{keyCode:Qh.DELETE,action:lC(sd,t,!0)},{keyCode:Qh.BACKSPACE,action:lC(od,t,!1)},{keyCode:Qh.DELETE,action:lC(od,t,!0)},{keyCode:Qh.BACKSPACE,action:lC(hC,t,!1)},{keyCode:Qh.DELETE,action:lC(hC,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,fC([{keyCode:Qh.BACKSPACE,action:lC(kd,t)},{keyCode:Qh.DELETE,action:lC(kd,t)}],n))})},bC=function(e){return A.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},yC=function(e,t){var n,r,o,i=t,a=e.dom,u=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var s=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);s&&/^(UL|OL|DL)$/.test(s.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new oo(t,t);r=n.current();){if(Do.isText(r)){o.setStart(r,0),o.setEnd(r,0);break}if(u[r.nodeName.toLowerCase()]){o.setStartBefore(r),o.setEndBefore(r);break}i=r,r=n.next()}r||(o.setStart(i,0),o.setEnd(i,0))}else Do.isBr(t)?t.nextSibling&&a.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),a.remove(void 0),e.selection.scrollIntoView(t)}},CC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},xC=bC,wC=function(e){return bC(e).fold(H(""),function(e){return e.nodeName.toUpperCase()})},NC=function(e){return bC(e).filter(function(e){return ho(er.fromDom(e))}).isSome()},EC=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},SC=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},TC=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},kC=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Do.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},AC=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;SC(u=n)&&SC(u.parentNode)&&(o="LI");var s,c,l=o?t(o):i.create("BR");if(kC(n,r,!0)&&kC(n,r,!1))EC(n,"LI")?i.insertAfter(l,TC(n)):i.replace(l,n);else if(kC(n,r,!0))EC(n,"LI")?(i.insertAfter(l,TC(n)),l.appendChild(i.doc.createTextNode(" ")),l.appendChild(n)):n.parentNode.insertBefore(l,n);else if(kC(n,r,!1))i.insertAfter(l,TC(n));else{n=TC(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var d=f.extractContents();"LI"===o&&(c="LI",(s=d).firstChild&&s.firstChild.nodeName===c)?(l=d.firstChild,i.insertAfter(d,n)):(i.insertAfter(d,n),i.insertAfter(l,n))}i.remove(r),yC(e,l)}},_C=function(e){e.innerHTML='<br data-mce-bogus="1">'},RC=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},DC=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},BC=function(e,t,n){return!1===Do.isText(t)?n:e?1===n&&t.data.charAt(n-1)===wa?0:n:n===t.data.length-1&&t.data.charAt(n)===wa?t.data.length:n},OC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},PC=function(e,t){var n=ec(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,tc(e))},LC=function(a,e){var t,u,s,i,c,n,r,o,l,f,d,m,g,p,h,v,b,y,C=a.dom,x=a.schema,w=x.getNonEmptyElements(),N=a.selection.getRng(),E=function(e){var t,n,r,o=s,i=x.getTextInlineElements();if(e||"TABLE"===f||"HR"===f?(t=C.create(e||m),PC(a,t)):t=c.cloneNode(!1),r=t,!1===oc(a))C.setAttrib(t,"style",null),C.setAttrib(t,"class",null);else do{if(i[o.nodeName]){if(Ku(o))continue;n=o.cloneNode(!1),C.setAttrib(n,"id",""),t.hasChildNodes()?n.appendChild(t.firstChild):r=n,t.appendChild(n)}}while((o=o.parentNode)&&o!==u);return _C(r),t},S=function(e){var t,n,r,o;if(o=BC(e,s,i),Do.isText(s)&&(e?0<o:o<s.nodeValue.length))return!1;if(s.parentNode===c&&g&&!e)return!0;if(e&&Do.isElement(s)&&s===c.firstChild)return!0;if(RC(s,"TABLE")||RC(s,"HR"))return g&&!e||!g&&e;for(t=new oo(s,c),Do.isText(s)&&(e&&0===o?t.prev():e||o!==s.nodeValue.length||t.next());n=t.current();){if(Do.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),w[r]&&"br"!==r))return!1}else if(Do.isText(n)&&!/^[ \t\r\n]*$/.test(n.nodeValue))return!1;e?t.prev():t.next()}return!0},T=function(){r=/^(H[1-6]|PRE|FIGURE)$/.test(f)&&"HGROUP"!==d?E(m):E(),ic(a)&&DC(C,l)&&C.isEmpty(c)?r=C.split(l,c):C.insertAfter(r,c),yC(a,r)};mg(C,N).each(function(e){N.setStart(e.startContainer,e.startOffset),N.setEnd(e.endContainer,e.endOffset)}),s=N.startContainer,i=N.startOffset,m=ec(a),n=e.shiftKey,Do.isElement(s)&&s.hasChildNodes()&&(g=i>s.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=g&&Do.isText(s)?s.nodeValue.length:0),(u=OC(C,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,g=OC(m,r);if(!(a=m.getParent(r,m.isBlock))||!DC(m,a)){if(l=(a=a||g)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),PC(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),PC(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,N,s,i)),c=C.getParent(s,C.isBlock),l=c?C.getParent(c.parentNode,C.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||e.ctrlKey||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&C.isEmpty(c)?AC(a,E,l,c,m):m&&c===a.getBody()||(m=m||"P",Ta(c)?(r=La(c),C.isEmpty(c)&&_C(c),yC(a,r)):S()?T():S(!0)?(r=c.parentNode.insertBefore(E(),c),yC(a,RC(c,"HR")?r:c)):((t=(b=N,y=b.cloneRange(),y.setStart(b.startContainer,BC(!0,b.startContainer,b.startOffset)),y.setEnd(b.endContainer,BC(!1,b.endContainer,b.endOffset)),y).cloneRange()).setEndAfter(c),function(e){for(;Do.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o=t.extractContents()),r=o.firstChild,C.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Do.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=o)&&"A"===a.nodeName&&0===Yt.trim(Na(a.innerText||a.textContent)).length&&e.remove(o);var a}}(C,w,r),p=C,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(p.getStyle(v,"float",!0))||p.add(h,"br"),C.isEmpty(c)&&_C(c),r.normalize(),C.isEmpty(r)?(C.remove(r),T()):yC(a,r)),C.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},IC=function(e,t){return xC(e).filter(function(e){return 0<t.length&&Lr.is(er.fromDom(e),t)}).isSome()},MC=function(e){return IC(e,nc(e))},FC=function(e){return IC(e,rc(e))},UC=cd([{br:[]},{block:[]},{none:[]}]),zC=function(e,t){return FC(e)},VC=function(n){return function(e,t){return""===ec(e)===n}},qC=function(n){return function(e,t){return NC(e)===n}},HC=function(n,r){return function(e,t){return wC(e)===n.toUpperCase()===r}},jC=function(e){return HC("pre",e)},$C=function(n){return function(e,t){return Zs(e)===n}},WC=function(e,t){return MC(e)},KC=function(e,t){return t},XC=function(e){var t=ec(e),n=CC(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},YC=function(e,t){return function(n,r){return z(e,function(e,t){return e&&t(n,r)},!0)?A.some(t):A.none()}},GC=function(e,t){return Fd([YC([zC],UC.none()),YC([HC("summary",!0)],UC.br()),YC([jC(!0),$C(!1),KC],UC.br()),YC([jC(!0),$C(!1)],UC.block()),YC([jC(!0),$C(!0),KC],UC.block()),YC([jC(!0),$C(!0)],UC.br()),YC([qC(!0),KC],UC.br()),YC([qC(!0)],UC.block()),YC([VC(!0),KC,XC],UC.block()),YC([VC(!0)],UC.br()),YC([WC],UC.br()),YC([VC(!1),KC],UC.br()),YC([XC],UC.block())],[e,t.shiftKey]).getOr(UC.none())},JC=function(e,t){GC(e,t).fold(function(){Ng(e,t)},function(){LC(e,t)},v)},QC=function(o){o.on("keydown",function(e){var t,n,r;e.keyCode===Qh.ENTER&&(t=o,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),JC(t,n)})))})},ZC=function(e,t,n){return u=t,!(!ex(n)||!Do.isText(u.container())||(r=e,i=(o=t).container(),a=o.offset(),i.insertData(a,"\xa0"),r.selection.setCursorLocation(i,a+1),0));var r,o,i,a,u},ex=function(e){return e.fold(H(!1),H(!0),H(!0),H(!1))},tx=function(e){return!!e.selection.isCollapsed()&&(t=e,n=b(Rf.isInlineTarget,t),r=Su.fromRangeStart(t.selection.getRng()),nm(n,t.getBody(),r).map(b(ZC,t,r)).getOr(!1));var t,n,r},nx=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,fC([{keyCode:Qh.SPACEBAR,action:lC(tx,t)}],n).each(function(e){n.preventDefault()}))})},rx=function(e,t){var n;t.hasAttribute("data-mce-caret")&&(La(t),(n=e).selection.setRng(n.selection.getRng()),e.selection.scrollIntoView(t))},ox=function(e,t){var n,r=(n=e,na(er.fromDom(n.getBody()),"*[data-mce-caret]").fold(H(null),function(e){return e.dom()}));if(r)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void rx(e,r)):void(_a(r)&&(rx(e,r),e.undoManager.add()))},ix=function(e){e.on("keyup compositionstart",b(ox,e))},ax=function(e){var t=gm.setupSelectedState(e);ix(e),dC(e,t),vC(e,t),QC(e),nx(e)};function ux(u){var s,n,r,o=Yt.each,c=Qh.BACKSPACE,l=Qh.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=Re.gecko,a=Re.ie,m=Re.webkit,g="data:text/mce-internal,",p=a?"Text":"URL",h=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},v=function(e){return e.isDefaultPrevented()},b=function(){u.shortcuts.add("meta+a",null,"SelectAll")},y=function(){u.on("keydown",function(e){if(!v(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11<Re.ie)return void u.getBody().focus();t=u.selection.getRng(),u.getBody().focus(),u.selection.setRng(t),u.selection.normalize(),u.nodeChanged()}}))};return u.on("keydown",function(e){var t,n,r,o,i;if(!v(e)&&e.keyCode===Qh.BACKSPACE&&(n=(t=d.getRng()).startContainer,r=t.startOffset,o=f.getRoot(),i=n,t.collapsed&&0===r)){for(;i&&i.parentNode&&i.parentNode.firstChild===i&&i.parentNode!==o;)i=i.parentNode;"BLOCKQUOTE"===i.tagName&&(u.formatter.toggle("blockquote",null,i),(t=f.createRng()).setStart(n,0),t.setEnd(n,0),d.setRng(t))}}),s=function(e){var t=f.create("body"),n=e.cloneContents();return t.appendChild(n),d.serializer.serialize(t,{format:"html"})},u.on("keydown",function(e){var t,n,r,o,i,a=e.keyCode;if(!v(e)&&(a===l||a===c)){if(t=u.selection.isCollapsed(),n=u.getBody(),t&&!f.isEmpty(n))return;if(!t&&(r=u.selection.getRng(),o=s(r),(i=f.createRng()).selectNode(u.getBody()),o!==s(i)))return;e.preventDefault(),u.setContent(""),n.firstChild&&f.isBlock(n.firstChild)?u.selection.setCursorLocation(n.firstChild,0):u.selection.setCursorLocation(n,0),u.nodeChanged()}}),Re.windowsPhone||u.on("keyup focusin mouseup",function(e){Qh.modifierPressed(e)||d.normalize()},!0),m&&(u.settings.content_editable||f.bind(u.getDoc(),"mousedown mouseup",function(e){var t;if(e.target===u.getDoc().documentElement)if(t=d.getRng(),u.getBody().focus(),"mousedown"===e.type){if(Aa(t.startContainer))return;d.placeCaretAt(e.clientX,e.clientY)}else d.setRng(t)}),u.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==f.getContentEditableParent(t)&&(e.preventDefault(),u.selection.select(t),u.nodeChanged()),"A"===t.nodeName&&f.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),d.select(t))}),e.forced_root_block&&u.on("init",function(){h("DefaultParagraphSeparator",e.forced_root_block)}),u.on("init",function(){u.dom.bind(u.getBody(),"submit",function(e){e.preventDefault()})}),y(),t.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),Re.iOS?(u.inline||u.on("keydown",function(){document.activeElement===document.body&&u.getWin().focus()}),C(),u.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),u.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):b()),11<=Re.ie&&(C(),y()),Re.ie&&(b(),h("AutoUrlDetect",!1),u.on("dragstart",function(e){var t,n,r;(t=e).dataTransfer&&(u.selection.isCollapsed()&&"IMG"===t.target.tagName&&d.select(t.target),0<(n=u.selection.getContent()).length&&(r=g+escape(u.id)+","+escape(n),t.dataTransfer.setData(p,r)))}),u.on("drop",function(e){if(!v(e)){var t=(i=e).dataTransfer&&(a=i.dataTransfer.getData(p))&&0<=a.indexOf(g)?(a=a.substr(g.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null;if(t&&t.id!==u.id){e.preventDefault();var n=Ey(e.x,e.y,u.getDoc());d.setRng(n),r=t.html,o=!0,u.queryCommandSupported("mceInsertClipboardContent")?u.execCommand("mceInsertClipboardContent",!1,{content:r,internal:o}):u.execCommand("mceInsertContent",!1,r)}}var r,o,i,a})),i&&(u.on("keydown",function(e){if(!v(e)&&e.keyCode===c){if(!u.getBody().getElementsByTagName("hr").length)return;if(d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode(),n=t.previousSibling;if("HR"===t.nodeName)return f.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(f.remove(n),e.preventDefault())}}}),Range.prototype.getClientRects||u.on("mousedown",function(e){if(!v(e)&&"HTML"===e.target.nodeName){var t=u.getBody();t.blur(),Le.setEditorTimeout(u,function(){t.focus()})}}),n=function(){var e=f.getAttribs(d.getStart().cloneNode(!1));return function(){var t=d.getStart();t!==u.getBody()&&(f.setAttrib(t,"style",null),o(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!d.isCollapsed()&&f.getParent(d.getStart(),f.isBlock)!==f.getParent(d.getEnd(),f.isBlock)},u.on("keypress",function(e){var t;if(!v(e)&&(8===e.keyCode||46===e.keyCode)&&r())return t=n(),u.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),f.bind(u.getDoc(),"cut",function(e){var t;!v(e)&&r()&&(t=n(),Le.setEditorTimeout(u,function(){t()}))}),e.readonly||u.on("BeforeExecCommand MouseDown",function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),e.object_resizing||h("enableObjectResizing",!1)}),u.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(f.select("a"),function(e){var t=e.parentNode,n=f.getRoot();if(t.lastChild===e){for(;t&&!f.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}f.add(t,"br",{"data-mce-bogus":1})}})}),u.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),Re.mac&&u.on("keydown",function(e){!Qh.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),u.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}),y()),{refreshContentEditable:function(){},isHidden:function(){var e;return!i||u.removed?0:!(e=u.selection.getSel())||!e.rangeCount||0===e.rangeCount}}}var sx=function(e){return Do.isElement(e)&&go(er.fromDom(e))},cx=function(t){t.on("click",function(e){3<=e.detail&&function(e){var t=e.selection.getRng(),n=wu.fromRangeStart(t),r=wu.fromRangeEnd(t);if(wu.isElementPosition(n)){var o=n.container();sx(o)&&fl.firstPositionIn(o).each(function(e){return t.setStart(e.container(),e.offset())})}wu.isElementPosition(r)&&(o=n.container(),sx(o)&&fl.lastPositionIn(o).each(function(e){return t.setEnd(e.container(),e.offset())})),e.selection.setRng(df(t))}(t)})},lx=function(e){var t,n;(t=e).on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}),(n=e).parser.addNodeFilter("details",function(e){F(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),n.serializer.addNodeFilter("details",function(e){F(e,function(e){var t=e.attr("data-mce-open");e.attr("open",k(t)?t:null),e.attr("data-mce-open",null)})})},fx=pi.DOM,dx=function(e){var t;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&Le.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},mx=function(t,e){var n,r,u,o,i,a,s,c,l,f=t.settings,d=t.getElement(),m=t.getDoc();f.inline||(t.getElement().style.visibility=t.orgVisibility),e||f.content_editable||(m.open(),m.write(t.iframeHTML),m.close()),f.content_editable&&(t.on("remove",function(){var e=this.getBody();fx.removeClass(e,"mce-content-body"),fx.removeClass(e,"mce-edit-focus"),fx.setAttrib(e,"contentEditable",null)}),fx.addClass(d,"mce-content-body"),t.contentDocument=m=f.content_document||document,t.contentWindow=f.content_window||window,t.bodyElement=d,f.content_document=f.content_window=null,f.root_name=d.nodeName.toLowerCase()),(n=t.getBody()).disabled=!0,t.readonly=f.readonly,t.readonly||(t.inline&&"static"===fx.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=t.getParam("content_editable_state",!0)),n.disabled=!1,t.editorUpload=mh(t),t.schema=ni(f),t.dom=pi(m,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:f.force_hex_style_colors,class_filter:f.class_filter,update_styles:!0,root_element:t.inline?t.getBody():null,collect:f.content_editable,schema:t.schema,onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((o=dy((u=t).settings,u.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,o,i=e.length,a=u.dom;i--;)if(r=(n=e[i]).attr(t),o="data-mce-"+t,!n.attributes.map[o]){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===t?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(o,r),n.attr(t,r)):"tabindex"===t?(n.attr(o,r),n.attr(t,null)):n.attr(o,u.convertURL(r,t,n.name))}}),o.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)}),o.addNodeFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),o.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=u.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new ty("br",1)).shortEnded=!0)}),o),t.serializer=vy(f,t),t.selection=Qy(t.dom,t.getWin(),t.serializer,t),t.annotator=Wl(t),t.formatter=Hb(t),t.undoManager=Rv(t),t._nodeChangeDispatcher=new Nh(t),t._selectionOverrides=ov(t),lx(t),cx(t),ax(t),vh(t),t.fire("PreInit"),f.browser_spellcheck||f.gecko_spellcheck||(m.body.spellcheck=!1,fx.setAttrib(n,"spellcheck","false")),t.quirks=ux(t),t.fire("PostRender"),f.directionality&&(n.dir=f.directionality),f.nowrap&&(n.style.whiteSpace="nowrap"),f.protect&&t.on("BeforeSetContent",function(t){Yt.each(f.protect,function(e){t.content=t.content.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type}),0<t.contentStyles.length&&(r="",Yt.each(t.contentStyles,function(e){r+=e+"\r\n"}),t.dom.addStyle(r)),(i=t,i.inline?fx.styleSheetLoader:i.dom.styleSheetLoader).loadAll(t.contentCSS,function(e){dx(t)},function(e){dx(t)}),f.content_style&&(a=t,s=f.content_style,c=er.fromDom(a.getDoc().head),l=er.fromTag("style"),hr.set(l,"type","text/css"),Ti.append(l,er.fromText(s)),Ti.append(c,l))},gx=pi.DOM,px=function(e,t){var n,r,o,i,a,u,s,c=e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),l=(n=e.id,r=c,o=t.height,i=Ks(e),s=er.fromTag("iframe"),hr.setAll(s,i),hr.setAll(s,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Er(s,{width:"100%",height:(a=o,u="number"==typeof a?a+"px":a,u||""),display:"block"}),s).dom();l.onload=function(){l.onload=null,e.fire("load")};var f,d,m,g,p=function(e,t){if(document.domain!==window.location.hostname&&Re.ie&&Re.ie<12){var n=dh.uuid("mce");e[n]=function(){mx(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return gx.setAttrib(t,"src",r),!0}return!1}(e,l);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=l,e.iframeHTML=(g=Xs(f=e)+"<html><head>",Ys(f)!==f.documentBaseUrl&&(g+='<base href="'+f.documentBaseURI.getURI()+'" />'),g+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',d=Gs(f),m=Js(f),Qs(f)&&(g+='<meta http-equiv="Content-Security-Policy" content="'+Qs(f)+'" />'),g+='</head><body id="'+d+'" class="mce-content-body '+m+'" data-id="'+f.id+'"><br></body></html>'),gx.add(t.iframeContainer,l),p},hx=function(e,t){var n=px(e,t);t.editorContainer&&(gx.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=gx.isHidden(t.editorContainer)),e.getElement().style.display="none",gx.setAttrib(e.id,"aria-hidden","true"),n||mx(e)},vx=pi.DOM,bx=function(t,n,e){var r,o,i=Gp.get(e);if(r=Gp.urls[e]||t.documentBaseUrl.replace(/\/$/,""),e=Yt.trim(e),i&&-1===Yt.inArray(n,e)){if(Yt.each(Gp.dependencies(e),function(e){bx(t,n,e)}),t.plugins[e])return;o=new i(t,r,t.$),(t.plugins[e]=o).init&&(o.init(t,r),n.push(e))}},yx=function(e){return e.replace(/^\-/,"")},Cx=function(e){return{editorContainer:e,iframeContainer:e}},xx=function(e){var t,n,r=e.getElement();return e.inline?Cx(null):(t=r,n=vx.create("div"),vx.insertAfter(n,t),Cx(n))},wx=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,k(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||vx.getStyle(f,"width")||"100%",a=l.height||vx.getStyle(f,"height")||f.offsetHeight,u=l.min_height||100,(s=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),s.test(""+a)&&(a=Math.max(parseInt(a,10),u)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))<u&&(a=u),c.height=a,c):O(d.theme)?(r=(t=e).getElement(),(n=t.settings.theme(t,r)).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:r.offsetHeight,n):xx(e)},Nx=function(t){var e,n,r,o,i,a,u=t.settings,s=t.getElement();return t.rtl=u.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(u.language),u.aria_label=u.aria_label||vx.getAttrib(s,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),o=(n=t).settings.theme,k(o)?(n.settings.theme=yx(o),r=Jp.get(o),n.theme=new r(n,Jp.urls[o]),n.theme.init&&n.theme.init(n,Jp.urls[o]||n.documentBaseUrl.replace(/\/$/,""),n.$)):n.theme={},i=t,a=[],Yt.each(i.settings.plugins.split(/[ ,]/),function(e){bx(i,a,yx(e))}),e=wx(t),t.editorContainer=e.editorContainer?e.editorContainer:null,u.content_css&&Yt.each(Yt.explode(u.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),u.content_editable?mx(t):hx(t,e)},Ex=pi.DOM,Sx=function(e){return"-"===e.charAt(0)},Tx=function(i,a){var u=Ci.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(k(i)){if(!Sx(i)&&!Jp.urls.hasOwnProperty(i)){var a=o.theme_url;a?Jp.load(i,t.documentBaseURI.toAbsolute(a)):Jp.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){Jp.waitFor(i,r)})}else r()}(u,i,a,function(){var e,t,n,r,o;e=u,(n=(t=i).settings).language&&"en"!==n.language&&!n.language_url&&(n.language_url=t.editorManager.baseURL+"/langs/"+n.language+".js"),n.language_url&&!t.editorManager.i18n.data[n.language]&&e.add(n.language_url),r=i.settings,o=a,Yt.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),Yt.each(r.external_plugins,function(e,t){Gp.load(t,e),r.plugins+=" "+t}),Yt.each(r.plugins.split(/[ ,]/),function(e){if((e=Yt.trim(e))&&!Gp.urls[e])if(Sx(e)){e=e.substr(1,e.length);var t=Gp.dependencies(e);Yt.each(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=Gp.createUrl(t,e),Gp.load(e.resource,e)})}else Gp.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),u.loadQueue(function(){i.removed||Nx(i)},i,function(e){Wp(i,e[0]),i.removed||Nx(i)})})},kx=function(t){var e=t.settings,n=t.id,r=function(){Ex.unbind(window,"ready",r),t.render()};if(je.Event.domLoaded){if(t.getElement()&&Re.contentEditable){e.inline?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var o=t.getElement().form||Ex.getParent(n,"form");o&&(t.formElement=o,e.hidden_input&&!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&(Ex.insertAfter(Ex.create("input",{type:"hidden",name:n}),n),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},Ex.bind(o,"submit reset",t.formEventDelegate),t.on("reset",function(){t.setContent(t.startContent,{format:"raw"})}),!e.submit_patch||o.submit.nodeType||o.submit.length||o._mceOldSubmit||(o._mceOldSubmit=o.submit,o.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),o._mceOldSubmit(o)})),t.windowManager=Vp(t),t.notificationManager=zp(t),"xml"===e.encoding&&t.on("GetContent",function(e){e.save&&(e.content=Ex.encode(e.content))}),e.add_form_submit_trigger&&t.on("submit",function(){t.initialized&&t.save()}),e.add_unload_trigger&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),Tx(t,t.suffix)}}else Ex.bind(window,"ready",r)},Ax=function(e,t,n){var r=e.sidebars?e.sidebars:[];r.push({name:t,settings:n}),e.sidebars=r},_x=Yt.each,Rx=Yt.trim,Dx="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Bx={ftp:21,http:80,https:443,mailto:25},Ox=function(r,e){var t,n,o=this;if(r=Rx(r),t=(e=o.settings=e||{}).base_uri,/^([\w\-]+):([^\/]{2})/i.test(r)||/^\s*#/.test(r))o.source=r;else{var i=0===r.indexOf("//");0!==r.indexOf("/")||i||(r=(t&&t.protocol||"http")+"://mce_host"+r),/^[\w\-]*:?\/\//.test(r)||(n=e.base_uri?e.base_uri.path:new Ox(document.location.href).directory,""==e.base_uri.protocol?r="//mce_host"+o.toAbsPath(n,r):(r=/([^#?]*)([#?]?.*)/.exec(r),r=(t&&t.protocol||"http")+"://mce_host"+o.toAbsPath(n,r[1])+r[2])),r=r.replace(/@@/g,"(mce_at)"),r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(r),_x(Dx,function(e,t){var n=r[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n}),t&&(o.protocol||(o.protocol=t.protocol),o.userInfo||(o.userInfo=t.userInfo),o.port||"mce_host"!==o.host||(o.port=t.port),o.host&&"mce_host"!==o.host||(o.host=t.host),o.source=""),i&&(o.protocol="")}};Ox.prototype={setPath:function(e){e=/^(.*?)\/?(\w+)?$/.exec(e),this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},toRelative:function(e){var t;if("./"===e)return e;if("mce_host"!==(e=new Ox(e,{base_uri:this})).host&&this.host!==e.host&&e.host||this.port!==e.port||this.protocol!==e.protocol&&""!==e.protocol)return e.getURI();var n=this.getURI(),r=e.getURI();return n===r||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===r?n:(t=this.toRelPath(this.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return(e=new Ox(e,{base_uri:this})).getURI(t&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=Bx[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r,o,i=0,a="";if(e=(e=e.substring(0,e.lastIndexOf("/"))).split("/"),n=t.split("/"),e.length>=n.length)for(r=0,o=e.length;r<o;r++)if(r>=n.length||e[r]!==n[r]){i=r+1;break}if(e.length<n.length)for(r=0,o=n.length;r<o;r++)if(r>=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r<o;r++)a+="../";for(r=i-1,o=n.length;r<o;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},toAbsPath:function(e,t){var n,r,o,i=0,a=[];for(r=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),_x(e,function(e){e&&a.push(e)}),e=a,n=t.length-1,a=[];0<=n;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?0<i?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(n.protocol?t+=n.protocol+"://":t+="//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},Ox.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},Ox.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var Px=function(e,t,n){var r,o,i,a,u;if(t.format=t.format?t.format:"html",t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)r=Yt.trim(cv.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=Na(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);i=(o=e).serializer.serialize(n,t),a=ec(o),u=new RegExp("^(<"+a+"[^>]*>( | |\\s|\xa0|<br \\/>|)<\\/"+a+">[\r\n]*|<br \\/>[\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||Co(er.fromDom(n))?t.content=r:t.content=Yt.trim(r),t.no_events||e.fire("GetContent",t),t.content},Lx=function(e,t){t(e),e.firstChild&&Lx(e.firstChild,t),e.next&&Lx(e.next,t)},Ix=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&Lx(t.firstChild,function(t){F(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),F(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);F(r,function(t){F(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Mx=function(e){return e instanceof ty},Fx=function(e,t){var r;e.dom.setHTML(e.getBody(),t),Dp(r=e)&&fl.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=Do.isTable(t)?fl.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},Ux=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=Mx(s)?"":s,Mx(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),A.from(u.getBody()).fold(H(s),function(e){return Mx(s)?function(e,t,n,r){Ix(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=lf({validate:e.validate},e.schema).serialize(n);return r.content=Co(er.fromDom(t))?o:Yt.trim(o),Fx(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='<br data-mce-bogus="1">',"TABLE"===n.nodeName?r="<tr><td>"+a+"</td></tr>":/^(UL|OL)$/.test(n.nodeName)&&(r="<li>"+a+"</li>"),(i=ec(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='<br data-mce-bogus="1">'),Fx(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=lf({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=Co(er.fromDom(n))?r:Yt.trim(r),Fx(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},zx=pi.DOM,Vx=function(e){return A.from(e).each(function(e){return e.destroy()})},qx=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&zx.remove(o.nextSibling),!e.inline&&r&&(i=e,zx.setStyle(i.id,"display",i.orgDisplay)),rp(e),e.editorManager.remove(e),zx.remove(e.getContainer()),Vx(t),Vx(n),e.destroy()}var i},Hx=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Vx(i),Vx(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),zx.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},jx=pi.DOM,$x=Yt.extend,Wx=Yt.each,Kx=Yt.resolve,Xx=Re.ie,Yx=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:i,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_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",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:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=Ef(vf,c,a,u),l.settings=t,Ni.language=t.language||"en",Ni.languageLoad=t.language_load,Ni.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new Ox(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new Cp(l),l.loadedCSS={},l.editorCommands=new Yg(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(Re.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(Re.overrideViewPort=!1),n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=pn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};$x(Yx.prototype={render:function(){kx(this)},focus:function(e){Rp(this,e)},hasFocus:function(){return Dp(this)},execCallback:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?Kx(r):0,o=Kx(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,Array.prototype.slice.call(arguments,1))},translate:function(e){if(e&&Yt.is(e,"string")){var n=this.settings.language||"en",r=this.editorManager.i18n;e=r.data[n+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,t){return r.data[n+"."+t]||"{#"+t+"}"})}return this.editorManager.translate(e)},getLang:function(e,t){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(t!==undefined?t:"{#"+e+"}")},getParam:function(e,t,n){return kf(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.stateSelector&&"undefined"==typeof t.active&&(t.active=!1),t.text||t.icon||(t.icon=e),n.buttons=n.buttons,t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return Ax(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems,n.menuItems[e]=t},addContextToolbar:function(e,t){var n,r=this;r.contextToolbars=r.contextToolbars||[],"string"==typeof e&&(n=e,e=function(e){return r.dom.is(e,n)}),r.contextToolbars.push({id:dh.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(jx.show(this.getContainer()),jx.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(Xx&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(jx.hide(e.getContainer()),jx.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=jx.getParent(r.id,"form"))&&Wx(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){return Ux(this,e,t)},getContent:function(e){return t=this,void 0===(n=e)&&(n={}),A.from(t.getBody()).fold(H("tree"===n.format?new ty("body",11):""),function(e){return Px(t,n,e)});var t,n},insertContent:function(e,t){t&&(e=$x({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){var t,n;(n=e)!==cp(t=this)&&(t.initialized?sp(t,"readonly"===n):t.on("init",function(){sp(t,"readonly"===n)}),op(t,n))},getContainer:function(){return this.container||(this.container=jx.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=jx.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var n,r=this,o=r.settings,i=r.dom;e=e||r.getBody(),r.hasVisual===undefined&&(r.hasVisual=o.visual),Wx(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return n=o.visual_table_class||"mce-item-table",void((t=i.getAttrib(e,"border"))&&"0"!==t||!r.hasVisual?i.removeClass(e,n):i.addClass(e,n));case"A":return void(i.getAttrib(e,"href")||(t=i.getAttrib(e,"name")||e.id,n=o.visual_anchor_class||"mce-item-anchor",t&&r.hasVisual?i.addClass(e,n):i.removeClass(e,n)))}}),r.fire("VisualAid",{element:e,hasVisual:r.hasVisual})},remove:function(){qx(this)},destroy:function(e){Hx(this,e)},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},pp);var Gx,Jx,Qx,Zx={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},ew=function(n,e){var t,r;Qn.detect().browser.isIE()?(r=n).on("focusout",function(){Vg(r)}):(t=e,n.on("mouseup touchend",function(e){t.throttle()})),n.on("keyup nodechange",function(e){var t;"nodechange"===(t=e).type&&t.selectionChange||Vg(n)})},tw=function(e){var t,n,r,o=Di(function(){Vg(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},pi.DOM.bind(document,"mouseup",r),t.on("remove",function(){pi.DOM.unbind(document,"mouseup",r)})),e.on("init",function(){ew(e,o)}),e.on("remove",function(){o.cancel()})},nw=pi.DOM,rw=function(e){return Zx.isEditorUIElement(e)},ow=function(t,e){var n=t?t.settings.custom_ui_selector:"";return null!==nw.getParent(e,function(e){return rw(e)||!!n&&t.dom.is(e,n)})},iw=function(r,e){var t=e.editor;tw(t),t.on("focusin",function(){var e=r.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),r.setActive(this),(r.focusedEditor=this).fire("focus",{blurredEditor:e}),this.focus(!0))}),t.on("focusout",function(){var t=this;Le.setEditorTimeout(t,function(){var e=r.focusedEditor;ow(t,function(){try{return document.activeElement}catch(e){return document.body}}())||e!==t||(t.fire("blur",{focusedEditor:null}),r.focusedEditor=null)})}),Gx||(Gx=function(e){var t,n=r.activeEditor;t=e.target,n&&t.ownerDocument===document&&(t===document.body||ow(n,t)||r.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),r.focusedEditor=null))},nw.bind(document,"focusin",Gx))},aw=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(nw.unbind(document,"focusin",Gx),Gx=null)},uw=function(e){e.on("AddEditor",b(iw,e)),e.on("RemoveEditor",b(aw,e))},sw={},cw="en",lw={setCode:function(e){e&&(cw=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return cw},rtl:!1,add:function(e,t){var n=sw[e];for(var r in n||(sw[e]=n={}),t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=sw[cw]||{},n=function(e){return Yt.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||Yt.is(e,"undefined")},o=function(e){return e=n(e),Yt.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if(Yt.is(e,"object")&&Yt.hasOwn(e,"raw"))return n(e.raw);if(Yt.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return Yt.hasOwn(i,t)?n(i[t]):e})}return o(e).replace(/{context:\w+}$/,"")},data:sw},fw=pi.DOM,dw=Yt.explode,mw=Yt.each,gw=Yt.extend,pw=0,hw=!1,vw=[],bw=[],yw=function(t){mw(Qx.get(),function(e){"scroll"===t.type?e.fire("ScrollWindow",t):e.fire("ResizeWindow",t)})},Cw=function(e){e!==hw&&(e?pn(window).on("resize scroll",yw):pn(window).off("resize scroll",yw),hw=e)},xw=function(t){var e=bw;delete vw[t.id];for(var n=0;n<vw.length;n++)if(vw[n]===t){vw.splice(n,1);break}return bw=U(bw,function(e){return t!==e}),Qx.activeEditor===t&&(Qx.activeEditor=0<bw.length?bw[0]:null),Qx.focusedEditor===t&&(Qx.focusedEditor=null),e.length!==bw.length};gw(Qx={defaultSettings:{},$:pn,majorVersion:"4",minorVersion:"8.3",releaseDate:"2018-09-13",editors:vw,i18n:lw,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=Ox.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),n=window.tinymce||window.tinyMCEPreInit)e=n.base||n.baseURL,o=n.suffix;else{for(var i=document.getElementsByTagName("script"),a=0;a<i.length;a++){var u=(r=i[a].src).substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==u.indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/"));break}}!e&&document.currentScript&&(-1!==(r=document.currentScript.src).indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/")))}this.baseURL=new Ox(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new Ox(this.baseURL),this.suffix=o,uw(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new Ox(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new Ox(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;for(var o in r)Ni.PluginManager.urls[o]=r[o]},init:function(r){var n,u,s=this;u=Yt.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var c=function(e){var t=e.id;return t||(t=(t=e.name)&&!fw.get(t)?e.name:fw.uniqueId(),e.setAttribute("id",t)),t},l=function(e,t){return t.constructor===RegExp?t.test(e.className):fw.hasClass(e,t)},f=function(e){n=e},e=function(){var o,i=0,a=[],n=function(e,t,n){var r=new Yx(e,t,s);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetElm=r.targetElm||n,r.render()};fw.unbind(window,"ready",e),function(e){var t=r[e];t&&t.apply(s,Array.prototype.slice.call(arguments,2))}("onpageload"),o=pn.unique(function(t){var e,n=[];if(Re.ie&&Re.ie<11)return Yp("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(t.types)return mw(t.types,function(e){n=n.concat(fw.select(e.selector))}),n;if(t.selector)return fw.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":0<(e=t.elements||"").length&&mw(dw(e),function(t){var e;(e=fw.get(t))?n.push(e):mw(document.forms,function(e){mw(e.elements,function(e){e.name===t&&(t="mce_editor_"+pw++,fw.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":mw(fw.select("textarea"),function(e){t.editor_deselector&&l(e,t.editor_deselector)||t.editor_selector&&!l(e,t.editor_selector)||n.push(e)})}return n}(r)),r.types?mw(r.types,function(t){Yt.each(o,function(e){return!fw.is(e,t.selector)||(n(c(e),gw({},r,t),e),!1)})}):(Yt.each(o,function(e){var t;(t=s.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(xw(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(o=Yt.grep(o,function(e){return!s.get(e.id)})).length?f([]):mw(o,function(e){var t;t=e,r.inline&&t.tagName.toLowerCase()in u?Yp("Could not initialize inline editor on invalid inline target element",e):n(c(e),r,e)}))};return s.settings=r,fw.bind(window,"ready",e),new De(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?bw.slice(0):k(t)?V(bw,function(e){return e.id===t}).getOr(null):P(t)&&bw[t]?bw[t]:null},add:function(e){var t=this;return vw[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(vw[e.id]=e),vw.push(e),bw.push(e)),Cw(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),Jx||(Jx=function(){t.fire("BeforeUnload")},fw.bind(window,"beforeunload",Jx))),e},createEditor:function(e,t){return this.add(new Yx(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!k(e))return n=e,D(r.get(n.id))?null:(xw(n)&&r.fire("RemoveEditor",{editor:n}),0===bw.length&&fw.unbind(window,"beforeunload",Jx),n.remove(),Cw(0<bw.length),n);mw(fw.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})}else for(t=bw.length-1;0<=t;t--)r.remove(bw[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new Yx(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",0,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){mw(bw,function(e){e.save()})},addI18n:function(e,t){lw.add(e,t)},translate:function(e){return lw.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},ep),Qx.setup();var ww,Nw=Qx;function Ew(n){return{walk:function(e,t){return Ul(n,e,t)},split:Vv,normalize:function(t){return mg(n,t).fold(H(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(ww=Ew||(Ew={})).compareRanges=ag,ww.getCaretRangeFromPoint=Ey,ww.getSelectedNode=Za,ww.getNode=eu;var Sw,Tw,kw=Ew,Aw=Math.min,_w=Math.max,Rw=Math.round,Dw=function(e,t,n){var r,o,i,a,u,s;return r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=Rw(s/2)),"c"===n[1]&&(r+=Rw(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=Rw(a/2)),"c"===n[4]&&(r-=Rw(i/2)),Bw(r,o,i,a)},Bw=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},Ow={inflate:function(e,t,n){return Bw(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:Dw,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=Dw(e,t,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(e,t){var n,r,o,i;return n=_w(e.x,t.x),r=_w(e.y,t.y),o=Aw(e.x+e.w,t.x+t.w),i=Aw(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:Bw(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=_w(0,t.x-u),o=_w(0,t.y-s),i=_w(0,c-f),a=_w(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),Bw(u,s,(c-=i)-u,(l-=a)-s)},create:Bw,fromClientRect:function(e){return Bw(e.left,e.top,e.width,e.height)}},Pw={},Lw={add:function(e,t){Pw[e.toLowerCase()]=t},has:function(e){return!!Pw[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=Pw.hasOwnProperty(t)?Pw[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=Pw[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},Iw=Yt.each,Mw=Yt.extend,Fw=function(){};Fw.extend=Sw=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!Tw&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in Tw=!0,e=new this,Tw=!1,n.Mixins&&(Iw(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&Iw(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&Iw(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&Iw(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=Mw({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=Sw,i};var Uw=Math.min,zw=Math.max,Vw=Math.round,qw=function(e,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"===t){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";r<e.length;r++)o+=(0<r?",":"")+qw(e[r],n);return o+"]"}for(i in o="{",e)e.hasOwnProperty(i)&&(o+="function"!=typeof e[i]?(1<o.length?","+n:n)+i+n+":"+qw(e[i],n):"");return o+"}"}return""+e},Hw={serialize:qw,parse:function(e){try{return JSON.parse(e)}catch(t){}}},jw={callbacks:{},count:0,send:function(t){var n=this,r=pi.DOM,o=t.count!==undefined?t.count:n.count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},$w={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",$w.fire("beforeInitialize",{settings:e}),t=new Qp){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&Yt.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=$w.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};Yt.extend($w,ep);var Ww,Kw,Xw,Yw,Gw=Yt.extend,Jw=function(e){this.settings=Gw({},e),this.count=0};Jw.sendRPC=function(e){return(new Jw).send(e)},Jw.prototype={send:function(n){var r=n.error,o=n.success;(n=Gw(this.settings,n)).success=function(e,t){void 0===(e=Hw.parse(e))&&(e={error:"JSON Parse error."}),e.error?r.call(n.error_scope||n.scope,e.error,t):o.call(n.success_scope||n.scope,e.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=Hw.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",$w.send(n)}};try{Ww=window.localStorage}catch(nN){Kw={},Xw=[],Yw={getItem:function(e){var t=Kw[e];return t||null},setItem:function(e,t){Xw.push(e),Kw[e]=String(t)},key:function(e){return Xw[e]},removeItem:function(t){Xw=Xw.filter(function(e){return e===t}),delete Kw[t]},clear:function(){Xw=[],Kw={}},length:0},Object.defineProperty(Yw,"length",{get:function(){return Xw.length},configurable:!1,enumerable:!1}),Ww=Yw}var Qw,Zw=Nw,eN={geom:{Rect:Ow},util:{Promise:De,Delay:Le,Tools:Yt,VK:Qh,URI:Ox,Class:Fw,EventDispatcher:Jg,Observable:ep,I18n:lw,XHR:$w,JSON:Hw,JSONRequest:Jw,JSONP:jw,LocalStorage:Ww,Color:function(e){var n={},u=0,s=0,c=0,t=function(e){var t;return"object"==typeof e?"r"in e?(u=e.r,s=e.g,c=e.b):"v"in e&&function(e,t,n){var r,o,i,a;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=zw(0,Uw(t,1)),n=zw(0,Uw(n,1)),0!==t){switch(r=e/60,i=(o=n*t)*(1-Math.abs(r%2-1)),a=n-o,Math.floor(r)){case 0:u=o,s=i,c=0;break;case 1:u=i,s=o,c=0;break;case 2:u=0,s=o,c=i;break;case 3:u=0,s=i,c=o;break;case 4:u=i,s=0,c=o;break;case 5:u=o,s=0,c=i;break;default:u=s=c=0}u=Vw(255*(u+a)),s=Vw(255*(s+a)),c=Vw(255*(c+a))}else u=s=c=Vw(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(u=parseInt(t[1],10),s=parseInt(t[2],10),c=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(u=parseInt(t[1],16),s=parseInt(t[2],16),c=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(u=parseInt(t[1]+t[1],16),s=parseInt(t[2]+t[2],16),c=parseInt(t[3]+t[3],16)),u=u<0?0:255<u?255:u,s=s<0?0:255<s?255:s,c=c<0?0:255<c?255:c,n};return e&&t(e),n.toRgb=function(){return{r:u,g:s,b:c}},n.toHsv=function(){return e=u,t=s,n=c,o=0,(i=Uw(e/=255,Uw(t/=255,n/=255)))===(a=zw(e,zw(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:Vw(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:Vw(100*r),v:Vw(100*o)});var e,t,n,r,o,i,a},n.toHex=function(){var e=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+e(u)+e(s)+e(c)},n.parse=t,n}},dom:{EventUtils:je,Sizzle:Tt,DomQuery:pn,TreeWalker:oo,DOMUtils:pi,ScriptLoader:Ci,RangeUtils:kw,Serializer:vy,ControlSelection:wy,BookmarkManager:yy,Selection:Qy,Event:je.Event},html:{Styles:oi,Entities:$o,Node:ty,Schema:ni,SaxParser:uv,DomParser:dy,Writer:cf,Serializer:lf},ui:{Factory:Lw},Env:Re,AddOnManager:Ni,Annotator:Wl,Formatter:Hb,UndoManager:Rv,EditorCommands:Yg,WindowManager:Vp,NotificationManager:zp,EditorObservable:pp,Shortcuts:Cp,Editor:Yx,FocusManager:Zx,EditorManager:Nw,DOM:pi.DOM,ScriptLoader:Ci.ScriptLoader,PluginManager:Ni.PluginManager,ThemeManager:Ni.ThemeManager,trim:Yt.trim,isArray:Yt.isArray,is:Yt.is,toArray:Yt.toArray,makeMap:Yt.makeMap,each:Yt.each,map:Yt.map,grep:Yt.grep,inArray:Yt.inArray,extend:Yt.extend,create:Yt.create,walk:Yt.walk,createNS:Yt.createNS,resolve:Yt.resolve,explode:Yt.explode,_addCacheSuffix:Yt._addCacheSuffix,isOpera:Re.opera,isWebKit:Re.webkit,isIE:Re.ie,isGecko:Re.gecko,isMac:Re.mac},tN=Zw=Yt.extend(Zw,eN);Qw=tN,window.tinymce=Qw,window.tinyMCE=Qw,function(e){if("object"==typeof module)try{module.exports=e}catch(t){}}(tN)}();!function(){"use strict";var e,t,n,r,o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},x=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,arguments))}},C=function(e){return function(){return e}},u=function(e){return e},R=function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var u=new Array(arguments.length-1),n=1;n<arguments.length;n++)u[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=u.concat(n);return i.apply(null,o)}},m=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,arguments)}},a=function(e){return e()},c=C(!1),l=C(!0),f=c,s=l,d=function(){return g},g=(r={fold:function(e,t){return e()},is:f,isSome:f,isNone:s,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:d,ap:d,each:function(){},bind:d,flatten:d,exists:f,forall:s,filter:d,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:C("none()")},Object.freeze&&Object.freeze(r),r),h=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:s,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return h(e(n))},ap:function(e){return e.fold(d,function(e){return h(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:g},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(f,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},S={some:h,none:d,from:function(e){return null===e||e===undefined?g:h(e)}},p=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},v=p("string"),b=p("array"),w=p("boolean"),T=p("function"),N=p("number"),D=(o=Array.prototype.indexOf)===undefined?function(e,t){return _(e,t)}:function(e,t){return o.call(e,t)},E=function(e,t){return-1<D(e,t)},O=function(e,t){return W(e,t).isSome()},A=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},k=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},P=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},I=function(e,t,n){return function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){n=t(n,e)}),n},B=function(e,t,n){return k(e,function(e){n=t(n,e)}),n},M=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return S.some(o)}return S.none()},W=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return S.some(n);return S.none()},_=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},L=Array.prototype.push,q=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);L.apply(t,e[n])}return t},F=function(e,t){var n=A(e,t);return q(n)},j=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},z=Array.prototype.slice,H=function(e){var t=z.call(e,0);return t.reverse(),t},U=(T(Array.from)&&Array.from,Object.keys),V=function(e,t){for(var n=U(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},G=function(e,r){return Y(e,function(e,t,n){return{k:t,v:r(e,t,n)}})},Y=function(r,o){var i={};return V(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},X=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return k(t,function(e,t){r[e]=C(n[t])}),r}},K=function(e){return e.slice(0).sort()},J=function(e,t){throw new Error("All required keys ("+K(e).join(", ")+") were not specified. Specified keys were: "+K(t).join(", ")+".")},$=function(e){throw new Error("Unsupported keys for object: "+K(e).join(", "))},Q=function(t,e){if(!b(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");k(e,function(e){if(!v(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},Z=function(e){var n=K(e);M(n,function(e,t){return t<n.length-1&&e===n[t+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})},ee=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return Q("required",o),Q("optional",i),Z(u),function(t){var n=U(t);j(o,function(e){return E(n,e)})||J(o,n);var e=P(n,function(e){return!E(u,e)});0<e.length&&$(e);var r={};return k(o,function(e){r[e]=C(t[e])}),k(i,function(e){r[e]=C(Object.prototype.hasOwnProperty.call(t,e)?S.some(t[e]):S.none())}),r}},te=X("width","height"),ne=X("rows","columns"),re=X("row","column"),oe=X("x","y"),ie=X("element","rowspan","colspan"),ue=X("element","rowspan","colspan","isNew"),ae={dimensions:te,grid:ne,address:re,coords:oe,extended:X("element","rowspan","colspan","row","column"),detail:ie,detailnew:ue,rowdata:X("element","cells","section"),elementnew:X("element","isNew"),rowdatanew:X("element","cells","section","isNew"),rowcells:X("cells","section"),rowdetails:X("details","section"),bounds:X("startRow","startCol","finishRow","finishCol")},ce=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:C(e)}},le={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return ce(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return ce(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return ce(n)},fromDom:ce,fromPoint:function(e,t,n){var r=e.dom();return S.from(r.elementFromPoint(t,n)).map(ce)}},fe={ATTRIBUTE:Node.ATTRIBUTE_NODE,CDATA_SECTION:Node.CDATA_SECTION_NODE,COMMENT:Node.COMMENT_NODE,DOCUMENT:Node.DOCUMENT_NODE,DOCUMENT_TYPE:Node.DOCUMENT_TYPE_NODE,DOCUMENT_FRAGMENT:Node.DOCUMENT_FRAGMENT_NODE,ELEMENT:Node.ELEMENT_NODE,TEXT:Node.TEXT_NODE,PROCESSING_INSTRUCTION:Node.PROCESSING_INSTRUCTION_NODE,ENTITY_REFERENCE:Node.ENTITY_REFERENCE_NODE,ENTITY:Node.ENTITY_NODE,NOTATION:Node.NOTATION_NODE},se=fe.ELEMENT,de=fe.DOCUMENT,me=function(e){return e.nodeType!==se&&e.nodeType!==de||0===e.childElementCount},ge={all:function(e,t){var n=t===undefined?document:t.dom();return me(n)?[]:A(n.querySelectorAll(e),le.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==se)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return me(n)?S.none():S.from(n.querySelector(e)).map(le.fromDom)}},he=function(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n},pe="undefined"!=typeof window?window:Function("return this;")(),ve=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:pe,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},be=function(e,t){var n=ve(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n},we=function(){return be("Node")},ye=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},xe=function(e,t){return ye(e,t,we().DOCUMENT_POSITION_CONTAINED_BY)},Ce=function(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}},Re=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Te(r(1),r(2))},Se=function(){return Te(0,0)},Te=function(e,t){return{major:e,minor:t}},Ne={nu:Te,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Se():Re(e,n)},unknown:Se},De="Firefox",Ee=function(e,t){return function(){return t===e}},Oe=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Ee("Edge",t),isChrome:Ee("Chrome",t),isIE:Ee("IE",t),isOpera:Ee("Opera",t),isFirefox:Ee(De,t),isSafari:Ee("Safari",t)}},Ae={unknown:function(){return Oe({current:undefined,version:Ne.unknown()})},nu:Oe,edge:C("Edge"),chrome:C("Chrome"),ie:C("IE"),opera:C("Opera"),firefox:C(De),safari:C("Safari")},ke="Windows",Pe="Android",Ie="Solaris",Be="FreeBSD",Me=function(e,t){return function(){return t===e}},We=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Me(ke,t),isiOS:Me("iOS",t),isAndroid:Me(Pe,t),isOSX:Me("OSX",t),isLinux:Me("Linux",t),isSolaris:Me(Ie,t),isFreeBSD:Me(Be,t)}},_e={unknown:function(){return We({current:undefined,version:Ne.unknown()})},nu:We,windows:C(ke),ios:C("iOS"),android:C(Pe),linux:C("Linux"),osx:C("OSX"),solaris:C(Ie),freebsd:C(Be)},Le=function(e,t){var n=String(t).toLowerCase();return M(e,function(e){return e.search(n)})},qe=function(e,n){return Le(e,n).map(function(e){var t=Ne.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Fe=function(e,n){return Le(e,n).map(function(e){var t=Ne.detect(e.versionRegexes,n);return{current:e.name,version:t}})},je=function(e,t){return-1!==e.indexOf(t)},ze=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,He=function(t){return function(e){return je(e,t)}},Ue=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return je(e,"edge/")&&je(e,"chrome")&&je(e,"safari")&&je(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ze],search:function(e){return je(e,"chrome")&&!je(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return je(e,"msie")||je(e,"trident")}},{name:"Opera",versionRegexes:[ze,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:He("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:He("firefox")},{name:"Safari",versionRegexes:[ze,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(je(e,"safari")||je(e,"mobile/"))&&je(e,"applewebkit")}}],Ve=[{name:"Windows",search:He("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return je(e,"iphone")||je(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:He("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:He("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:He("linux"),versionRegexes:[]},{name:"Solaris",search:He("sunos"),versionRegexes:[]},{name:"FreeBSD",search:He("freebsd"),versionRegexes:[]}],Ge={browsers:C(Ue),oses:C(Ve)},Ye=function(e){var t,n,r,o,i,u,a,c,l,f,s,d=Ge.browsers(),m=Ge.oses(),g=qe(d,e).fold(Ae.unknown,Ae.nu),h=Fe(m,e).fold(_e.unknown,_e.nu);return{browser:g,os:h,deviceType:(n=g,r=e,o=(t=h).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,u=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,c=o||u||a&&!0===/mobile/i.test(r),l=t.isiOS()||t.isAndroid(),f=l&&!c,s=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:C(o),isiPhone:C(i),isTablet:C(c),isPhone:C(f),isTouch:C(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:C(s)})}},Xe={detect:Ce(function(){var e=navigator.userAgent;return Ye(e)})},Ke=function(e,t){return e.dom()===t.dom()},Je=Xe.detect().browser.isIE()?function(e,t){return xe(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},$e={eq:Ke,isEqualNode:function(e,t){return e.dom().isEqualNode(t.dom())},member:function(e,t){return O(t,R(Ke,e))},contains:Je,is:ge.is},Qe=function(e){var t=e.dom();return S.from(t.parentNode).map(le.fromDom)},Ze=function(e){var t=e.dom();return S.from(t.previousSibling).map(le.fromDom)},et=function(e){var t=e.dom();return S.from(t.nextSibling).map(le.fromDom)},tt=function(e){var t=e.dom();return A(t.childNodes,le.fromDom)},nt=function(e,t){var n=e.dom().childNodes;return S.from(n[t]).map(le.fromDom)},rt=X("element","offset"),ot={owner:function(e){return le.fromDom(e.dom().ownerDocument)},defaultView:function(e){var t=e.dom().ownerDocument.defaultView;return le.fromDom(t)},documentElement:function(e){return le.fromDom(e.dom().ownerDocument.documentElement)},parent:Qe,findIndex:function(n){return Qe(n).bind(function(e){var t=tt(e);return W(t,function(e){return $e.eq(n,e)})})},parents:function(e,t){for(var n=T(t)?t:C(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=le.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},siblings:function(t){return Qe(t).map(tt).map(function(e){return P(e,function(e){return!$e.eq(t,e)})}).getOr([])},prevSibling:Ze,offsetParent:function(e){var t=e.dom();return S.from(t.offsetParent).map(le.fromDom)},prevSiblings:function(e){return H(he(e,Ze))},nextSibling:et,nextSiblings:function(e){return he(e,et)},children:tt,child:nt,firstChild:function(e){return nt(e,0)},lastChild:function(e){return nt(e,e.dom().childNodes.length-1)},childNodesCount:function(e){return e.dom().childNodes.length},hasChildNodes:function(e){return e.dom().hasChildNodes()},leaf:function(e,t){var n=tt(e);return 0<n.length&&t<n.length?rt(n[t],0):rt(e,t)}},it=function(e,t,n){return F(ot.children(e),function(e){return ge.is(e,t)?n(e)?[e]:[]:it(e,t,n)})},ut={firstLayer:function(e,t){return it(e,t,C(!0))},filterFirstLayer:it},at=function(e){return e.dom().nodeName.toLowerCase()},ct=function(e){return e.dom().nodeType},lt=function(t){return function(e){return ct(e)===t}},ft=lt(fe.ELEMENT),st=lt(fe.TEXT),dt=lt(fe.DOCUMENT),mt={name:at,type:ct,value:function(e){return e.dom().nodeValue},isElement:ft,isText:st,isDocument:dt,isComment:function(e){return ct(e)===fe.COMMENT||"#comment"===at(e)}},gt=function(e,t,n){if(!(v(n)||w(n)||N(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},ht=function(e,t,n){gt(e.dom(),t,n)},pt=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},vt=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},bt={clone:function(e){return B(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},set:ht,setAll:function(e,t){var n=e.dom();V(t,function(e,t){gt(n,t,e)})},get:pt,has:vt,remove:function(e,t){e.dom().removeAttribute(t)},hasNone:function(e){var t=e.dom().attributes;return t===undefined||null===t||0===t.length},transfer:function(o,i,e){mt.isElement(o)&&mt.isElement(i)&&k(e,function(e){var t,n,r;n=i,vt(t=o,r=e)&&!vt(n,r)&&ht(n,r,pt(t,r))})}},wt=Ce(function(){return yt(le.fromDom(document))}),yt=function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return le.fromDom(t)},xt={body:wt,getBody:yt,inBody:function(e){var t=mt.isText(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}},Ct=function(e,t){var n=[];return k(ot.children(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(Ct(e,t))}),n},Rt={all:function(e){return Ct(xt.body(),e)},ancestors:function(e,t,n){return P(ot.parents(e,n),t)},siblings:function(e,t){return P(ot.siblings(e),t)},children:function(e,t){return P(ot.children(e),t)},descendants:Ct},St={all:function(e){return ge.all(e)},ancestors:function(e,t,n){return Rt.ancestors(e,function(e){return ge.is(e,t)},n)},siblings:function(e,t){return Rt.siblings(e,function(e){return ge.is(e,t)})},children:function(e,t){return Rt.children(e,function(e){return ge.is(e,t)})},descendants:function(e,t){return ge.all(t,e)}};function Tt(e,t,n,r,o){return e(n,r)?S.some(n):T(o)&&o(n)?S.none():t(n,r,o)}var Nt,Dt,Et,Ot,At,kt=function(e,t,n){for(var r=e.dom(),o=T(n)?n:C(!1);r.parentNode;){r=r.parentNode;var i=le.fromDom(r);if(t(i))return S.some(i);if(o(i))break}return S.none()},Pt=function(e,t){return M(e.dom().childNodes,x(t,le.fromDom)).map(le.fromDom)},It=function(e,r){var o=function(e){for(var t=0;t<e.childNodes.length;t++){if(r(le.fromDom(e.childNodes[t])))return S.some(le.fromDom(e.childNodes[t]));var n=o(e.childNodes[t]);if(n.isSome())return n}return S.none()};return o(e.dom())},Bt={first:function(e){return It(xt.body(),e)},ancestor:kt,closest:function(e,t,n){return Tt(function(e){return t(e)},kt,e,t,n)},sibling:function(t,n){var e=t.dom();return e.parentNode?Pt(le.fromDom(e.parentNode),function(e){return!$e.eq(t,e)&&n(e)}):S.none()},child:Pt,descendant:It},Mt=function(e,t,n){return Bt.ancestor(e,function(e){return ge.is(e,t)},n)},Wt={first:function(e){return ge.one(e)},ancestor:Mt,sibling:function(e,t){return Bt.sibling(e,function(e){return ge.is(e,t)})},child:function(e,t){return Bt.child(e,function(e){return ge.is(e,t)})},descendant:function(e,t){return ge.one(t,e)},closest:function(e,t,n){return Tt(ge.is,Mt,e,t,n)}},_t=function(e,t,n){var r=n!==undefined?n:C(!1);return r(t)?S.none():E(e,mt.name(t))?S.some(t):Wt.ancestor(t,e.join(","),function(e){return ge.is(e,"table")||r(e)})},Lt=function(t,e){return ot.parent(e).map(function(e){return St.children(e,t)})},qt=R(Lt,"th,td"),Ft=R(Lt,"tr"),jt=function(e,t){return parseInt(bt.get(e,t),10)},zt={cell:function(e,t){return _t(["td","th"],e,t)},firstCell:function(e){return Wt.descendant(e,"th,td")},cells:function(e){return ut.firstLayer(e,"th,td")},neighbourCells:qt,table:function(e,t){return Wt.closest(e,"table",t)},row:function(e,t){return _t(["tr"],e,t)},rows:function(e){return ut.firstLayer(e,"tr")},notCell:function(e,t){return _t(["caption","tr","tbody","tfoot","thead"],e,t)},neighbourRows:Ft,attr:jt,grid:function(e,t,n){var r=jt(e,t),o=jt(e,n);return ae.grid(r,o)}},Ht=function(e){var t=zt.rows(e);return A(t,function(e){var t=e,n=ot.parent(t).map(function(e){var t=mt.name(e);return"tfoot"===t||"thead"===t||"tbody"===t?t:"tbody"}).getOr("tbody"),r=A(zt.cells(e),function(e){var t=bt.has(e,"rowspan")?parseInt(bt.get(e,"rowspan"),10):1,n=bt.has(e,"colspan")?parseInt(bt.get(e,"colspan"),10):1;return ae.detail(e,t,n)});return ae.rowdata(t,r,n)})},Ut=function(e,n){return A(e,function(e){var t=A(zt.cells(e),function(e){var t=bt.has(e,"rowspan")?parseInt(bt.get(e,"rowspan"),10):1,n=bt.has(e,"colspan")?parseInt(bt.get(e,"colspan"),10):1;return ae.detail(e,t,n)});return ae.rowdata(e,t,n.section())})},Vt=function(e,t){return e+","+t},Gt=function(e,t){var n=F(e.all(),function(e){return e.cells()});return P(n,t)},Yt={generate:function(e){var f={},t=[],n=e.length,s=0;k(e,function(e,c){var l=[];k(e.cells(),function(e,t){for(var n=0;f[Vt(c,n)]!==undefined;)n++;for(var r=ae.extended(e.element(),e.rowspan(),e.colspan(),c,n),o=0;o<e.colspan();o++)for(var i=0;i<e.rowspan();i++){var u=n+o,a=Vt(c+i,u);f[a]=r,s=Math.max(s,u+1)}l.push(r)}),t.push(ae.rowdata(e.element(),l,e.section()))});var r=ae.grid(n,s);return{grid:C(r),access:C(f),all:C(t)}},getAt:function(e,t,n){var r=e.access()[Vt(t,n)];return r!==undefined?S.some(r):S.none()},findItem:function(e,t,n){var r=Gt(e,function(e){return n(t,e.element())});return 0<r.length?S.some(r[0]):S.none()},filterItems:Gt,justCells:function(e){var t=A(e.all(),function(e){return e.cells()});return q(t)}},Xt=function(e){return e.style!==undefined},Kt=function(e,t,n){if(!v(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Xt(e)&&e.style.setProperty(t,n)},Jt=function(e,t){Xt(e)&&e.style.removeProperty(t)},$t=function(e,t,n){var r=e.dom();Kt(r,t,n)},Qt=function(e,t){return Xt(e)?e.style.getPropertyValue(t):""},Zt=function(e,t){var n=e.dom(),r=Qt(n,t);return S.from(r).filter(function(e){return 0<e.length})},en={copy:function(e,t){var n=e.dom(),r=t.dom();Xt(n)&&Xt(r)&&(r.style.cssText=n.style.cssText)},set:$t,preserve:function(e,t){var n=bt.get(e,"style"),r=t(e);return(n===undefined?bt.remove:bt.set)(e,"style",n),r},setAll:function(e,t){var n=e.dom();V(t,function(e,t){Kt(n,t,e)})},setOptions:function(e,t){var n=e.dom();V(t,function(e,t){e.fold(function(){Jt(n,t)},function(e){Kt(n,t,e)})})},remove:function(e,t){var n=e.dom();Jt(n,t),bt.has(e,"style")&&""===bt.get(e,"style").replace(/^\s+|\s+$/g,"")&&bt.remove(e,"style")},get:function(e,t){var n=e.dom(),r=window.getComputedStyle(n).getPropertyValue(t),o=""!==r||xt.inBody(e)?r:Qt(n,t);return null===o?undefined:o},getRaw:Zt,getAllRaw:function(e){var t={},n=e.dom();if(Xt(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o]}return t},isValidValue:function(e,t,n){var r=le.fromTag(e);return $t(r,t,n),Zt(r,t).isSome()},reflow:function(e){return e.dom().offsetWidth},transfer:function(r,o,e){mt.isElement(r)&&mt.isElement(o)&&k(e,function(e){var t,n;t=o,Zt(r,n=e).each(function(e){Zt(t,n).isNone()&&$t(t,n,e)})})}},tn=function(t,n){ot.parent(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},nn=function(e,t){e.dom().appendChild(t.dom())},rn={before:tn,after:function(e,t){ot.nextSibling(e).fold(function(){ot.parent(e).each(function(e){nn(e,t)})},function(e){tn(e,t)})},prepend:function(t,n){ot.firstChild(t).fold(function(){nn(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},append:nn,appendAt:function(e,t,n){ot.child(e,n).fold(function(){nn(e,t)},function(e){tn(e,t)})},wrap:function(e,t){tn(e,t),nn(t,e)}},on={before:function(t,e){k(e,function(e){rn.before(t,e)})},after:function(r,o){k(o,function(e,t){var n=0===t?r:o[t-1];rn.after(n,e)})},prepend:function(t,e){k(e.slice().reverse(),function(e){rn.prepend(t,e)})},append:function(t,e){k(e,function(e){rn.append(t,e)})}},un=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},an={empty:function(e){e.dom().textContent="",k(ot.children(e),function(e){un(e)})},remove:un,unwrap:function(e){var t=ot.children(e);0<t.length&&on.before(e,t),un(e)}},cn=X("minRow","minCol","maxRow","maxCol"),ln=function(e,t){var n,i,r,u,a,c,l,o,f,s,d=function(e){return ge.is(e.element(),t)},m=Ht(e),g=Yt.generate(m),h=(i=d,r=(n=g).grid().columns(),u=n.grid().rows(),a=r,l=c=0,V(n.access(),function(e){if(i(e)){var t=e.row(),n=t+e.rowspan()-1,r=e.column(),o=r+e.colspan()-1;t<u?u=t:c<n&&(c=n),r<a?a=r:l<o&&(l=o)}}),cn(u,a,c,l)),p="th:not("+t+"),td:not("+t+")",v=ut.filterFirstLayer(e,"th,td",function(e){return ge.is(e,p)});return k(v,an.remove),function(e,t,n,r){for(var o,i,u,a=t.grid().columns(),c=t.grid().rows(),l=0;l<c;l++)for(var f=!1,s=0;s<a;s++)l<n.minRow()||l>n.maxRow()||s<n.minCol()||s>n.maxCol()||(Yt.getAt(t,l,s).filter(r).isNone()?(o=f,i=e[l].element(),u=le.fromTag("td"),rn.append(u,le.fromTag("br")),(o?rn.append:rn.prepend)(i,u)):f=!0)}(m,g,h,d),o=e,f=h,s=P(ut.firstLayer(o,"tr"),function(e){return 0===e.dom().childElementCount}),k(s,an.remove),f.minCol()!==f.maxCol()&&f.minRow()!==f.maxRow()||k(ut.firstLayer(o,"th,td"),function(e){bt.remove(e,"rowspan"),bt.remove(e,"colspan")}),bt.remove(o,"width"),bt.remove(o,"height"),en.remove(o,"width"),en.remove(o,"height"),e},fn=function(e,t){return le.fromDom(e.dom().cloneNode(t))},sn=function(e){return fn(e,!0)},dn=function(e,t){var n=le.fromTag(t),r=bt.clone(e);return bt.setAll(n,r),n},mn=function(e){return fn(e,!1)},gn=sn,hn=function(e,t){var n=dn(e,t),r=ot.children(sn(e));return on.append(n,r),n},pn=(Nt=mt.isText,Dt="text",Et=function(e){return Nt(e)?S.from(e.dom().nodeValue):S.none()},Ot=Xe.detect().browser,{get:function(e){if(!Nt(e))throw new Error("Can only get "+Dt+" value of a "+Dt+" node");return At(e).getOr("")},getOption:At=Ot.isIE()&&10===Ot.version.major?function(e){try{return Et(e)}catch(t){return S.none()}}:Et,set:function(e,t){if(!Nt(e))throw new Error("Can only set raw "+Dt+" value of a "+Dt+" node");e.dom().nodeValue=t}}),vn={get:function(e){return pn.get(e)},getOption:function(e){return pn.getOption(e)},set:function(e,t){pn.set(e,t)}},bn=function(e){return"img"===mt.name(e)?1:vn.getOption(e).fold(function(){return ot.children(e).length},function(e){return e.length})},wn=["img","br"],yn=bn,xn=function(e){return vn.getOption(e).filter(function(e){return 0!==e.trim().length||-1<e.indexOf("\xa0")}).isSome()||E(wn,mt.name(e))},Cn=function(e,i){var u=function(e){for(var t=ot.children(e),n=t.length-1;0<=n;n--){var r=t[n];if(i(r))return S.some(r);var o=u(r);if(o.isSome())return o}return S.none()};return u(e)},Rn={first:function(e){return Bt.descendant(e,xn)},last:function(e){return Cn(e,xn)}},Sn=function(){var e=le.fromTag("td");return rn.append(e,le.fromTag("br")),e},Tn=function(e,t,n){var r=hn(e,t);return V(n,function(e,t){null===e?bt.remove(r,t):bt.set(r,t,e)}),r},Nn=function(e){return e},Dn=function(e){return function(){return le.fromTag("tr",e.dom())}},En=function(c,e,l){return{row:Dn(e),cell:function(e){var r,o,i,t=ot.owner(e.element()),n=le.fromTag(mt.name(e.element()),t.dom()),u=l.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=0<u.length?(r=e.element(),o=n,i=u,Rn.first(r).map(function(e){var t=i.join(","),n=St.ancestors(e,t,function(e){return $e.eq(e,r)});return I(n,function(e,t){var n=mn(t);return bt.remove(n,"contenteditable"),rn.append(e,n),n},o)}).getOr(o)):n;return rn.append(a,le.fromTag("br")),en.copy(e.element(),n),en.remove(n,"height"),1!==e.colspan()&&en.remove(e.element(),"width"),c(e.element(),n),n},replace:Tn,gap:Sn}},On=function(e){return{row:Dn(e),cell:Sn,replace:Nn,gap:Sn}},An=function(e,t){var n=(t||document).createElement("div");return n.innerHTML=e,ot.children(le.fromDom(n))},kn=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function Pn(){return{up:C({selector:Wt.ancestor,closest:Wt.closest,predicate:Bt.ancestor,all:ot.parents}),down:C({selector:St.descendants,predicate:Rt.descendants}),styles:C({get:en.get,getRaw:en.getRaw,set:en.set,remove:en.remove}),attrs:C({get:bt.get,set:bt.set,remove:bt.remove,copyTo:function(e,t){var n=bt.clone(e);bt.setAll(t,n)}}),insert:C({before:rn.before,after:rn.after,afterAll:on.after,append:rn.append,appendAll:on.append,prepend:rn.prepend,wrap:rn.wrap}),remove:C({unwrap:an.unwrap,remove:an.remove}),create:C({nu:le.fromTag,clone:function(e){return le.fromDom(e.dom().cloneNode(!1))},text:le.fromText}),query:C({comparePosition:function(e,t){return e.dom().compareDocumentPosition(t.dom())},prevSibling:ot.prevSibling,nextSibling:ot.nextSibling}),property:C({children:ot.children,name:mt.name,parent:ot.parent,isText:mt.isText,isComment:mt.isComment,isElement:mt.isElement,getText:vn.get,setText:vn.set,isBoundary:function(e){return!!mt.isElement(e)&&("body"===mt.name(e)||E(kn,mt.name(e)))},isEmptyTag:function(e){return!!mt.isElement(e)&&E(["br","img","hr","input"],mt.name(e))}}),eq:$e.eq,is:$e.is}}var In=X("left","right"),Bn=function(e,t,n){var r=e.property().children(t);return W(r,R(e.eq,n)).map(function(e){return{before:C(r.slice(0,e)),after:C(r.slice(e+1))}})},Mn=function(n,r,o){return Bn(n,r,o).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.before().concat([o])),n.insert().appendAll(r,e.after()),n.insert().before(r,t),In(t,r)})},Wn=function(n,r,e){return Bn(n,r,e).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.after()),n.insert().after(r,t),In(r,t)})},_n=function(i,e,u,a){var r=X("first","second","splits"),c=function(e,t,o){var n=r(e,S.none(),o);return u(e)?r(e,t,o):i.property().parent(e).bind(function(r){return a(i,r,e).map(function(e){var t=[{first:e.left,second:e.right}],n=u(r)?r:e.left();return c(n,S.some(e.right()),o.concat(t))}).getOr(n)})};return c(e,S.none(),[])},Ln=function(r,o,e,t){var n=o(r,e);return I(t,function(e,t){var n=o(r,t);return qn(r,e,n)},n)},qn=function(t,e,n){return e.bind(function(e){return n.filter(R(t.eq,e))})},Fn=function(e,t,n){return 0<n.length?Ln(e,t,(r=n)[0],r.slice(1)):S.none();var r},jn=function(e,t){return R(e.eq,t)},zn=function(t,e,n,r){var o=r!==undefined?r:C(!1),i=[e].concat(t.up().all(e)),u=[n].concat(t.up().all(n)),a=function(t){return W(t,o).fold(function(){return t},function(e){return t.slice(0,e+1)})},c=a(i),l=a(u),f=M(c,function(e){return O(l,jn(t,e))});return{firstpath:C(c),secondpath:C(l),shared:C(f)}},Hn=function(t,e,n){var r=zn(t,e,n);return r.shared().bind(function(e){return function(o,i,e,t){var u=o.property().children(i);if(o.eq(i,e[0]))return S.some([e[0]]);if(o.eq(i,t[0]))return S.some([t[0]]);var n=function(e){var t=H(e),n=W(t,jn(o,i)).getOr(-1),r=n<t.length-1?t[n+1]:t[n];return W(u,jn(o,r))},r=n(e),a=n(t);return r.bind(function(r){return a.map(function(e){var t=Math.min(r,e),n=Math.max(r,e);return u.slice(t,n+1)})})}(t,e,r.firstpath(),r.secondpath())})},Un=zn,Vn=function(e,t,n){return Fn(e,t,n)},Gn=function(e,t,n){return Hn(e,t,n)},Yn=function(e,t,n,r){return Un(e,t,n,r)},Xn=function(e,t,n){return Mn(e,t,n)},Kn=function(e,t,n){return Wn(e,t,n)},Jn=function(e,t,n,r){return _n(e,t,n,r)},$n=Pn(),Qn={sharedOne:function(n,e){return Vn($n,function(e,t){return n(t)},e)},subset:function(e,t){return Gn($n,e,t)},ancestors:function(e,t,n){return Yn($n,e,t,n)},breakToLeft:function(e,t){return Xn($n,e,t)},breakToRight:function(e,t){return Kn($n,e,t)},breakPath:function(e,t,r){return Jn($n,e,t,function(e,t,n){return r(t,n)})}},Zn=function(e,t){return t.column()>=e.startCol()&&t.column()+t.colspan()-1<=e.finishCol()&&t.row()>=e.startRow()&&t.row()+t.rowspan()-1<=e.finishRow()},er=function(e,t){var n=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return n<=e.finishCol()&&r>=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},tr=function(e,t){for(var n=!0,r=R(Zn,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)n=n&&Yt.getAt(e,o,i).exists(r);return n?S.some(t):S.none()},nr=function(e,t,n){var r=Yt.findItem(e,t,$e.eq),o=Yt.findItem(e,n,$e.eq);return r.bind(function(r){return o.map(function(e){return t=r,n=e,ae.bounds(Math.min(t.row(),n.row()),Math.min(t.column(),n.column()),Math.max(t.row()+t.rowspan()-1,n.row()+n.rowspan()-1),Math.max(t.column()+t.colspan()-1,n.column()+n.colspan()-1));var t,n})})},rr=nr,or=function(t,e,n){return nr(t,e,n).bind(function(e){return tr(t,e)})},ir=function(r,e,o,i){return Yt.findItem(r,e,$e.eq).bind(function(e){var t=0<o?e.row()+e.rowspan()-1:e.row(),n=0<i?e.column()+e.colspan()-1:e.column();return Yt.getAt(r,t+o,n+i).map(function(e){return e.element()})})},ur=function(n,e,t){return rr(n,e,t).map(function(e){var t=Yt.filterItems(n,R(er,e));return A(t,function(e){return e.element()})})},ar=function(e,t){return Yt.findItem(e,t,function(e,t){return $e.contains(t,e)}).bind(function(e){return e.element()})},cr=function(e){var t=Ht(e);return Yt.generate(t)},lr=function(n,r,o){return zt.table(n).bind(function(e){var t=cr(e);return ir(t,n,r,o)})},fr=function(e,t,n){var r=cr(e);return ur(r,t,n)},sr=function(e,t,n,r,o){var i=cr(e),u=$e.eq(e,n)?t:ar(i,t),a=$e.eq(e,o)?r:ar(i,r);return ur(i,u,a)},dr=function(e,t,n){var r=cr(e);return or(r,t,n)},mr=function(e,t){return Wt.ancestor(e,"table")},gr=ee(["boxes","start","finish"],[]),hr=function(a,c,r){var l=function(t){return function(e){return r(e)||$e.eq(e,t)}};return $e.eq(a,c)?S.some(gr({boxes:S.some([a]),start:a,finish:c})):mr(a).bind(function(u){return mr(c).bind(function(i){if($e.eq(u,i))return S.some(gr({boxes:fr(u,a,c),start:a,finish:c}));if($e.contains(u,i)){var e=0<(t=St.ancestors(c,"td,th",l(u))).length?t[t.length-1]:c;return S.some(gr({boxes:sr(u,a,u,c,i),start:a,finish:e}))}if($e.contains(i,u)){var t,n=0<(t=St.ancestors(a,"td,th",l(i))).length?t[t.length-1]:a;return S.some(gr({boxes:sr(i,a,u,c,i),start:a,finish:n}))}return Qn.ancestors(a,c).shared().bind(function(e){return Wt.closest(e,"table",r).bind(function(e){var t=St.ancestors(c,"td,th",l(e)),n=0<t.length?t[t.length-1]:c,r=St.ancestors(a,"td,th",l(e)),o=0<r.length?r[r.length-1]:a;return S.some(gr({boxes:sr(e,a,u,c,i),start:o,finish:n}))})})})})},pr=hr,vr=function(e,t){var n=St.descendants(e,t);return 0<n.length?S.some(n):S.none()},br=function(e,t,n,r,o){return(i=e,u=o,M(i,function(e){return ge.is(e,u)})).bind(function(e){return lr(e,t,n).bind(function(e){return t=e,n=r,Wt.ancestor(t,"table").bind(function(e){return Wt.descendant(e,n).bind(function(e){return hr(e,t).bind(function(t){return t.boxes().map(function(e){return{boxes:C(e),start:C(t.start()),finish:C(t.finish())}})})})});var t,n})});var i,u},wr=function(e,t,r){return Wt.descendant(e,t).bind(function(n){return Wt.descendant(e,r).bind(function(t){return Qn.sharedOne(mr,[n,t]).map(function(e){return{first:C(n),last:C(t),table:C(e)}})})})},yr=function(e,t){return vr(e,t)},xr=function(o,e,t){return wr(o,e,t).bind(function(n){var e=function(e){return $e.eq(o,e)},t=Wt.ancestor(n.first(),"thead,tfoot,tbody,table",e),r=Wt.ancestor(n.last(),"thead,tfoot,tbody,table",e);return t.bind(function(t){return r.bind(function(e){return $e.eq(t,e)?dr(n.table(),n.first(),n.last()):S.none()})})})},Cr="data-mce-selected",Rr="data-mce-first-selected",Sr="data-mce-last-selected",Tr={selected:C(Cr),selectedSelector:C("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:C("[data-mce-selected]"),firstSelected:C(Rr),firstSelectedSelector:C("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:C(Sr),lastSelectedSelector:C("td[data-mce-last-selected],th[data-mce-last-selected]")},Nr=function(u){if(!b(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],n={};return k(u,function(e,r){var t=U(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!b(i))throw new Error("case arguments must be an array");a.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=U(e);if(a.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+t.join(","));if(!j(a,function(e){return E(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+a.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:a,constructor:o,params:n})}}}}),n},Dr=Nr([{none:[]},{multiple:["elements"]},{single:["selection"]}]),Er={cata:function(e,t,n,r){return e.fold(t,n,r)},none:Dr.none,multiple:Dr.multiple,single:Dr.single},Or=function(e,t){return Er.cata(t.get(),C([]),u,C([e]))},Ar=function(n,e){return Er.cata(e.get(),S.none,function(t,e){return 0===t.length?S.none():xr(n,Tr.firstSelectedSelector(),Tr.lastSelectedSelector()).bind(function(e){return 1<t.length?S.some({bounds:C(e),cells:C(t)}):S.none()})},S.none)},kr=function(e,t){var n=Or(e,t);return 0<n.length&&j(n,function(e){return bt.has(e,"rowspan")&&1<parseInt(bt.get(e,"rowspan"),10)||bt.has(e,"colspan")&&1<parseInt(bt.get(e,"colspan"),10)})?S.some(n):S.none()},Pr=Or,Ir=function(e){return{element:C(e),mergable:S.none,unmergable:S.none,selection:C([e])}},Br=X("element","clipboard","generators"),Mr={noMenu:Ir,forMenu:function(e,t,n){return{element:C(n),mergable:C(Ar(t,e)),unmergable:C(kr(n,e)),selection:C(Pr(n,e))}},notCell:function(e){return Ir(e)},paste:Br,pasteRows:function(e,t,n,r,o){return{element:C(n),mergable:S.none,unmergable:S.none,selection:C(Pr(n,e)),clipboard:C(r),generators:C(o)}}},Wr=function(a,e,c,l){a.on("BeforeGetContent",function(n){!0===n.selection&&Er.cata(e.get(),y,function(e){var t;n.preventDefault(),(t=e,zt.table(t[0]).map(gn).map(function(e){return[ln(e,Tr.attributeSelector())]})).each(function(e){n.content=A(e,function(e){return t=e,a.selection.serializer.serialize(t.dom(),{});var t}).join("")})},y)}),a.on("BeforeSetContent",function(u){!0===u.selection&&!0===u.paste&&S.from(a.dom.getParent(a.selection.getStart(),"th,td")).each(function(e){var i=le.fromDom(e);zt.table(i).bind(function(t){var e=P(An(u.content),function(e){return"meta"!==mt.name(e)});if(1===e.length&&"table"===mt.name(e[0])){u.preventDefault();var n=le.fromDom(a.getDoc()),r=On(n),o=Mr.paste(i,e[0],r);c.pasteCells(t,o).each(function(e){a.selection.setRng(e),a.focus(),l.clear(t)})}})})})};function _r(r,o){var e=function(e){var t=o(e);if(t<=0||null===t){var n=en.get(e,r);return parseFloat(n)||0}return t},i=function(o,e){return B(e,function(e,t){var n=en.get(o,t),r=n===undefined?0:parseInt(n,10);return isNaN(r)?e:e+r},0)};return{set:function(e,t){if(!N(t)&&!t.match(/^[0-9]+$/))throw r+".set accepts only positive integer values. Value was "+t;var n=e.dom();Xt(n)&&(n.style[r]=t+"px")},get:e,getOuter:e,aggregate:i,max:function(e,t,n){var r=i(e,n);return r<t?t-r:0}}}var Lr=_r("height",function(e){var t=e.dom();return xt.inBody(e)?t.getBoundingClientRect().height:t.offsetHeight}),qr=function(e){return Lr.get(e)},Fr=function(e){return Lr.getOuter(e)},jr=_r("width",function(e){return e.dom().offsetWidth}),zr=function(e){return jr.get(e)},Hr=function(e){return jr.getOuter(e)},Ur=Xe.detect(),Vr=function(e,t,n){return r=en.get(e,t),o=n,i=parseFloat(r),isNaN(i)?o:i;var r,o,i},Gr=function(e){return Ur.browser.isIE()||Ur.browser.isEdge()?(n=Vr(t=e,"padding-top",0),r=Vr(t,"padding-bottom",0),o=Vr(t,"border-top-width",0),i=Vr(t,"border-bottom-width",0),u=t.dom().getBoundingClientRect().height,"border-box"===en.get(t,"box-sizing")?u:u-n-r-(o+i)):Vr(e,"height",qr(e));var t,n,r,o,i,u},Yr=/(\d+(\.\d+)?)(\w|%)*/,Xr=/(\d+(\.\d+)?)%/,Kr=/(\d+(\.\d+)?)px|em/,Jr=function(e,t){en.set(e,"height",t+"px")},$r=function(e,t,n,r){var o,i,u,a,c,l,f,s,d,m=parseInt(e,10);return s=l="%",d=(f=e).length-l.length,""!==s&&(f.length<s.length||f.substr(d,d+s.length)!==s)||"table"===mt.name(t)?m:(o=t,i=m,u=n,a=r,c=zt.table(o).map(function(e){var t=u(e);return Math.floor(i/100*t)}).getOr(i),a(o,c),c)},Qr=function(e){var t,n=(t=e,en.getRaw(t,"height").getOrThunk(function(){return Gr(t)+"px"}));return n?$r(n,e,qr,Jr):qr(e)},Zr=function(e,t){return bt.has(e,t)?parseInt(bt.get(e,t),10):1},eo=function(e){return en.getRaw(e,"width").fold(function(){return S.from(bt.get(e,"width"))},function(e){return S.some(e)})},to=function(e,t){return e/t.pixelWidth()*100},no={percentageBasedSizeRegex:C(Xr),pixelBasedSizeRegex:C(Kr),setPixelWidth:function(e,t){en.set(e,"width",t+"px")},setPercentageWidth:function(e,t){en.set(e,"width",t+"%")},setHeight:Jr,getPixelWidth:function(t,n){return eo(t).fold(function(){return zr(t)},function(e){return function(e,t,n){if(Kr.test(t)){var r=Kr.exec(t);return parseInt(r[1],10)}if(Xr.test(t)){var o=Xr.exec(t),i=parseFloat(o[1]);return i/100*n.pixelWidth()}return zr(e)}(t,e,n)})},getPercentageWidth:function(t,n){return eo(t).fold(function(){var e=zr(t);return to(e,n)},function(e){return function(e,t,n){if(Xr.test(t)){var r=Xr.exec(t);return parseFloat(r[1])}var o=zr(e);return to(o,n)}(t,e,n)})},getGenericWidth:function(e){return eo(e).bind(function(e){if(Yr.test(e)){var t=Yr.exec(e);return S.some({width:C(t[1]),unit:C(t[3])})}return S.none()})},setGenericWidth:function(e,t,n){en.set(e,"width",t+n)},getHeight:function(e){return n="rowspan",Qr(t=e)/Zr(t,n);var t,n},getRawWidth:eo},ro=function(n,r){no.getGenericWidth(n).each(function(e){var t=e.width()/2;no.setGenericWidth(n,t,e.unit()),no.setGenericWidth(r,t,e.unit())})},oo=function(e,t){var n=t||le.fromDom(document.documentElement);return Bt.ancestor(e,R($e.eq,n)).isSome()},io=function(e){var t=e.dom();return t===t.window&&e instanceof Window?e:mt.isDocument(e)?t.defaultView||t.parentWindow:null},uo=function(n,r){return{left:C(n),top:C(r),translate:function(e,t){return uo(n+e,r+t)}}},ao=uo,co=function(e,t){return e!==undefined?e:t!==undefined?t:0},lo=function(e){var t,n=e.dom(),r=n.ownerDocument,o=r.body,i=le.fromDom(r.documentElement);return o===n?ao(o.offsetLeft,o.offsetTop):oo(e,i)?(t=n.getBoundingClientRect(),ao(t.left,t.top)):ao(0,0)},fo=function(e){var t=e.dom().ownerDocument,n=t.body,r=io(le.fromDom(t)),o=t.documentElement,i=co(r.pageYOffset,o.scrollTop),u=co(r.pageXOffset,o.scrollLeft),a=co(o.clientTop,n.clientTop),c=co(o.clientLeft,n.clientLeft);return lo(e).translate(u-c,i-a)},so=X("row","y"),mo=X("col","x"),go=function(e){return fo(e).left()+Hr(e)},ho=function(e){return fo(e).left()},po=function(e,t){return mo(e,ho(t))},vo=function(e,t){return mo(e,go(t))},bo=function(e){return fo(e).top()},wo=function(n,t,r){if(0===r.length)return[];var e=A(r.slice(1),function(e,t){return e.map(function(e){return n(t,e)})}),o=r[r.length-1].map(function(e){return t(r.length-1,e)});return e.concat([o])},yo={delta:u,positions:R(wo,function(e,t){return so(e,bo(t))},function(e,t){return so(e,bo(t)+Fr(t))}),edge:bo},xo={delta:u,edge:ho,positions:R(wo,po,vo)},Co={height:yo,rtl:{delta:function(e,t){return-e},edge:go,positions:R(wo,vo,po)},ltr:xo},Ro={ltr:Co.ltr,rtl:Co.rtl};function So(t){var n=function(e){return t(e).isRtl()?Ro.rtl:Ro.ltr};return{delta:function(e,t){return n(t).delta(e,t)},edge:function(e){return n(e).edge(e)},positions:function(e,t){return n(t).positions(e,t)}}}var To,No=function(e){var t=Ht(e);return Yt.generate(t).grid()},Do=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Do(n())}}},Eo=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return Q("required",o),Z(o),function(t){var n=U(t);j(o,function(e){return E(n,e)})||J(o,n),r(o,n);var e=P(o,function(e){return!i.validate(t[e],e)});return 0<e.length&&function(e,t){throw new Error("All values need to be of type: "+t+". Keys ("+K(e).join(", ")+") were not.")}(e,i.label),t}},Oo=function(t,e){var n=P(e,function(e){return!E(t,e)});0<n.length&&$(n)},Ao=function(e){return Eo(Oo,e,{validate:T,label:"function"})},ko=function(e){var t=bt.has(e,"colspan")?parseInt(bt.get(e,"colspan"),10):1,n=bt.has(e,"rowspan")?parseInt(bt.get(e,"rowspan"),10):1;return{element:C(e),colspan:C(t),rowspan:C(n)}},Po=Ao(["cell","row","replace","gap"]),Io=function(r,e){Po(r);var n=Do(S.none()),o=e!==undefined?e:ko,i=function(e){var t,n=o(e);return t=n,r.cell(t)},u=function(e){var t=i(e);return n.get().isNone()&&n.set(S.some(t)),a=S.some({item:e,replacement:t}),t},a=S.none();return{getOrInit:function(t,n){return a.fold(function(){return u(t)},function(e){return n(t,e.item)?e.replacement:u(t)})},cursor:n.get}},Bo=function(o,a){return function(n){var r=Do(S.none());Po(n);var i=[],u=function(e){var t=n.replace(e,a,{scope:o});return i.push({item:e,sub:t}),r.get().isNone()&&r.set(S.some(t)),t};return{replaceOrInit:function(t,n){return(r=t,o=n,M(i,function(e){return o(e.item,r)})).fold(function(){return u(t)},function(e){return n(t,e.item)?e.sub:u(t)});var r,o},cursor:r.get}}},Mo=function(n){Po(n);var e=Do(S.none());return{combine:function(t){return e.get().isNone()&&e.set(S.some(t)),function(){var e=n.cell({element:C(t),colspan:C(1),rowspan:C(1)});return en.remove(e,"width"),en.remove(t,"width"),e}},cursor:e.get}},Wo=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],_o=function(e,t){var n=e.property().name(t);return E(Wo,n)},Lo=function(e,t){return E(["br","img","hr","input"],e.property().name(t))},qo=_o,Fo=function(e,t){var n=e.property().name(t);return E(["ol","ul"],n)},jo=Lo,zo=Pn(),Ho=function(e){return qo(zo,e)},Uo=function(e){return Fo(zo,e)},Vo=function(e){return jo(zo,e)},Go=function(e){var t,i=function(e){return"br"===mt.name(e)},n=function(o){return Rn.last(o).bind(function(n){var e,r=(e=n,ot.nextSibling(e).map(function(e){return!!Ho(e)||(Vo(e)?"img"!==mt.name(e):void 0)}).getOr(!1));return ot.parent(n).map(function(e){return!0===r||(t=e,"li"===mt.name(t)||Bt.ancestor(t,Uo).isSome())||i(n)||Ho(e)&&!$e.eq(o,e)?[]:[le.fromTag("br")];var t})}).getOr([])},r=0===(t=F(e,function(e){var t=ot.children(e);return j(t,function(e){return i(e)||mt.isText(e)&&0===vn.get(e).trim().length})?[]:t.concat(n(e))})).length?[le.fromTag("br")]:t;an.empty(e[0]),on.append(e[0],r)},Yo=Object.prototype.hasOwnProperty,Xo=(To=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Yo.call(o,i)&&(n[i]=To(n[i],o[i]))}return n}),Ko=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},Jo=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return S.none()},$o=function(e,t){return ae.rowcells(t,e.section())},Qo=function(e,t){return e.cells()[t]},Zo={addCell:function(e,t,n){var r=e.cells(),o=r.slice(0,t),i=r.slice(t),u=o.concat([n]).concat(i);return $o(e,u)},setCells:$o,mutateCell:function(e,t,n){e.cells()[t]=n},getCell:Qo,getCellElement:function(e,t){return Qo(e,t).element()},mapCells:function(e,t){var n=e.cells(),r=A(n,t);return ae.rowcells(r,e.section())},cellLength:function(e){return e.cells().length}},ei=function(e,t){if(0===e.length)return 0;var n=e[0];return W(e,function(e){return!t(n.element(),e.element())}).fold(function(){return e.length},function(e){return e})},ti=function(e,t,n,r){var o,i,u,a,c=(o=e,i=t,o[i]).cells().slice(n),l=ei(c,r),f=(u=e,a=n,A(u,function(e){return Zo.getCell(e,a)})).slice(t),s=ei(f,r);return{colspan:C(l),rowspan:C(s)}},ni=function(o,i){var u=A(o,function(e,t){return A(e.cells(),function(e,t){return!1})});return A(o,function(e,r){var t=F(e.cells(),function(e,t){if(!1===u[r][t]){var n=ti(o,r,t,i);return function(e,t,n,r){for(var o=e;o<e+n;o++)for(var i=t;i<t+r;i++)u[o][i]=!0}(r,t,n.rowspan(),n.colspan()),[ae.detailnew(e.element(),n.rowspan(),n.colspan(),e.isNew())]}return[]});return ae.rowdetails(t,e.section())})},ri=function(e,t,n){for(var r=[],o=0;o<e.grid().rows();o++){for(var i=[],u=0;u<e.grid().columns();u++){var a=Yt.getAt(e,o,u).map(function(e){return ae.elementnew(e.element(),n)}).getOrThunk(function(){return ae.elementnew(t.gap(),!0)});i.push(a)}var c=ae.rowcells(i,e.all()[o].section());r.push(c)}return r},oi=function(e,t,n,r){n===r?bt.remove(e,t):bt.set(e,t,n)},ii=function(o,e){var i=[],u=[],t=function(e,t){var n;0<e.length?function(e,t){var n=Wt.child(o,t).getOrThunk(function(){var e=le.fromTag(t,ot.owner(o).dom());return rn.append(o,e),e});an.empty(n);var r=A(e,function(e){e.isNew()&&i.push(e.element());var t=e.element();return an.empty(t),k(e.cells(),function(e){e.isNew()&&u.push(e.element()),oi(e.element(),"colspan",e.colspan(),1),oi(e.element(),"rowspan",e.rowspan(),1),rn.append(t,e.element())}),t});on.append(n,r)}(e,t):(n=t,Wt.child(o,n).each(an.remove))},n=[],r=[],a=[];return k(e,function(e){switch(e.section()){case"thead":n.push(e);break;case"tbody":r.push(e);break;case"tfoot":a.push(e)}}),t(n,"thead"),t(r,"tbody"),t(a,"tfoot"),{newRows:C(i),newCells:C(u)}},ui=function(e){return A(e,function(e){var n=mn(e.element());return k(e.cells(),function(e){var t=gn(e.element());oi(t,"colspan",e.colspan(),1),oi(t,"rowspan",e.rowspan(),1),rn.append(n,t)}),n})},ai=function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n},ci=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n},li=function(t,n){if(n<0||n>=t.length-1)return S.none();var e=t[n].fold(function(){var e=H(t.slice(0,n));return Jo(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return S.some({value:e,delta:0})}),r=t[n+1].fold(function(){var e=t.slice(n+1);return Jo(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return S.some({value:e,delta:1})});return e.bind(function(n){return r.map(function(e){var t=e.delta+n.delta;return Math.abs(e.value-n.value)/t})})},fi=function(e,t,n){var r=e();return M(r,t).orThunk(function(){return S.from(r[0]).orThunk(n)}).map(function(e){return e.element()})},si=function(n){var e=n.grid(),t=ci(0,e.columns()),r=ci(0,e.rows());return A(t,function(t){return fi(function(){return F(r,function(e){return Yt.getAt(n,e,t).filter(function(e){return e.column()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.colspan()},function(){return Yt.getAt(n,0,t)})})},di=function(n){var e=n.grid(),t=ci(0,e.rows()),r=ci(0,e.columns());return A(t,function(t){return fi(function(){return F(r,function(e){return Yt.getAt(n,t,e).filter(function(e){return e.row()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.rowspan()},function(){return Yt.getAt(n,t,0)})})},mi=function(e,t,n,r,o){var i=le.fromTag("div");return en.setAll(i,{position:"absolute",left:t-r/2+"px",top:n+"px",height:o+"px",width:r+"px"}),bt.setAll(i,{"data-column":e,role:"presentation"}),i},gi=function(e,t,n,r,o){var i=le.fromTag("div");return en.setAll(i,{position:"absolute",left:t+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),bt.setAll(i,{"data-row":e,role:"presentation"}),i},hi=function(e){var t=e.replace(/\./g,"-");return{resolve:function(e){return t+"-"+e}}},pi={resolve:hi("ephox-snooker").resolve},vi=function(e,t){var n=bt.get(e,t);return n===undefined||""===n?[]:n.split(" ")},bi=vi,wi=function(e,t,n){var r=vi(e,t).concat([n]);return bt.set(e,t,r.join(" ")),!0},yi=function(e,t,n){var r=P(vi(e,t),function(e){return e!==n});return 0<r.length?bt.set(e,t,r.join(" ")):bt.remove(e,t),!1},xi=function(e){return bi(e,"class")},Ci=function(e,t){return wi(e,"class",t)},Ri=function(e,t){return yi(e,"class",t)},Si=xi,Ti=Ci,Ni=Ri,Di=function(e,t){return E(xi(e),t)?Ri(e,t):Ci(e,t)},Ei=function(e){return e.dom().classList!==undefined},Oi=function(e,t){return Ei(e)&&e.dom().classList.contains(t)},Ai={add:function(e,t){Ei(e)?e.dom().classList.add(t):Ti(e,t)},remove:function(e,t){var n;Ei(e)?e.dom().classList.remove(t):Ni(e,t),0===(Ei(n=e)?n.dom().classList:Si(n)).length&&bt.remove(n,"class")},toggle:function(e,t){return Ei(e)?e.dom().classList.toggle(t):Di(e,t)},toggler:function(e,t){var n,r,o,i,u,a,c=Ei(e),l=e.dom().classList;return n=function(){c?l.remove(t):Ni(e,t)},r=function(){c?l.add(t):Ti(e,t)},o=Oi(e,t),i=o||!1,{on:u=function(){r(),i=!0},off:a=function(){n(),i=!1},toggle:function(){(i?a:u)()},isOn:function(){return i}}},has:Oi},ki=pi.resolve("resizer-bar"),Pi=pi.resolve("resizer-rows"),Ii=pi.resolve("resizer-cols"),Bi=function(e){var t=St.descendants(e.parent(),"."+ki);k(t,an.remove)},Mi=function(n,e,r){var o=n.origin();k(e,function(e,t){e.each(function(e){var t=r(o,e);Ai.add(t,ki),rn.append(n.parent(),t)})})},Wi=function(e,t,n,r,o,i){var u,a,c,l,f=fo(t),s=0<n.length?o.positions(n,t):[];u=e,a=s,c=f,l=Hr(t),Mi(u,a,function(e,t){var n=gi(t.row(),c.left()-e.left(),t.y()-e.top(),l,7);return Ai.add(n,Pi),n});var d,m,g,h,p=0<r.length?i.positions(r,t):[];d=e,m=p,g=f,h=Fr(t),Mi(d,m,function(e,t){var n=mi(t.col(),t.x()-e.left(),g.top()-e.top(),7,h);return Ai.add(n,Ii),n})},_i=function(e,t){var n=St.descendants(e.parent(),"."+ki);k(n,t)},Li={refresh:function(e,t,n,r){Bi(e);var o=Ht(t),i=Yt.generate(o),u=di(i),a=si(i);Wi(e,t,u,a,n,r)},hide:function(e){_i(e,function(e){en.set(e,"display","none")})},show:function(e){_i(e,function(e){en.set(e,"display","block")})},destroy:Bi,isRowBar:function(e){return Ai.has(e,Pi)},isColBar:function(e){return Ai.has(e,Ii)}},qi=function(e,r){return A(e,function(e){var t,n=(t=e.details(),Jo(t,function(e){return ot.parent(e.element()).map(function(e){var t=ot.parent(e).isNone();return ae.elementnew(e,t)})}).getOrThunk(function(){return ae.elementnew(r.row(),!0)}));return ae.rowdatanew(n.element(),e.details(),e.section(),n.isNew())})},Fi=function(e,t){var n=ni(e,$e.eq);return qi(n,t)},ji=function(e,t){var n=q(A(e.all(),function(e){return e.cells()}));return M(n,function(e){return $e.eq(t,e.element())})},zi=function(a,c,l,f,s){return function(n,r,e,o,i){var t=Ht(r),u=Yt.generate(t);return c(u,e).map(function(e){var t=ri(u,o,!1),n=a(t,e,$e.eq,s(o)),r=Fi(n.grid(),o);return{grid:C(r),cursor:n.cursor}}).fold(function(){return S.none()},function(e){var t=ii(r,e.grid());return l(r,e.grid(),i),f(r),Li.refresh(n,r,Co.height,i),S.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})})}},Hi=Fi,Ui=function(t,e){return zt.cell(e.element()).bind(function(e){return ji(t,e)})},Vi=function(t,e){var n=A(e.selection(),function(e){return zt.cell(e).bind(function(e){return ji(t,e)})}),r=Ko(n);return 0<r.length?S.some(r):S.none()},Gi=function(t,n){return zt.cell(n.element()).bind(function(e){return ji(t,e).map(function(e){return Xo(e,{generators:n.generators,clipboard:n.clipboard})})})},Yi=function(t,e){var n=A(e.selection(),function(e){return zt.cell(e).bind(function(e){return ji(t,e)})}),r=Ko(n);return 0<r.length?S.some(Xo({cells:r},{generators:e.generators,clipboard:e.clipboard})):S.none()},Xi=function(e,t){return t.mergable()},Ki=function(e,t){return t.unmergable()},Ji=function(n){return{is:function(e){return n===e},isValue:l,isError:c,getOr:C(n),getOrThunk:C(n),getOrDie:C(n),or:function(e){return Ji(n)},orThunk:function(e){return Ji(n)},fold:function(e,t){return t(n)},map:function(e){return Ji(e(n))},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return S.some(n)}}},$i=function(n){return{is:c,isValue:c,isError:l,getOr:u,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return $i(n)},each:y,bind:function(e){return $i(n)},exists:c,forall:l,toOption:S.none}},Qi={value:Ji,error:$i},Zi=function(e,t){return A(e,function(){return ae.elementnew(t.cell(),!0)})},eu=function(t,e,n){return t.concat(ai(e,function(e){return Zo.setCells(t[t.length-1],Zi(t[t.length-1].cells(),n))}))},tu=function(e,t,n){return A(e,function(e){return Zo.setCells(e,e.cells().concat(Zi(ci(0,t),n)))})},nu=function(e,t,n){if(e.row()>=t.length||e.column()>Zo.cellLength(t[0]))return Qi.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=t.slice(e.row()),o=r[0].cells().slice(e.column()),i=Zo.cellLength(n[0]),u=n.length;return Qi.value({rowDelta:C(r.length-u),colDelta:C(o.length-i)})},ru=function(e,t){var n=Zo.cellLength(e[0]),r=Zo.cellLength(t[0]);return{rowDelta:C(0),colDelta:C(n-r)}},ou=function(e,t,n){var r=t.colDelta()<0?tu:u;return(t.rowDelta()<0?eu:u)(r(e,Math.abs(t.colDelta()),n),Math.abs(t.rowDelta()),n)},iu=function(e,t,n,r){if(0===e.length)return e;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)Zo.mutateCell(e[o],i,ae.elementnew(r(),!1));return e},uu=function(e,t,n,r){for(var o=!0,i=0;i<e.length;i++)for(var u=0;u<Zo.cellLength(e[0]);u++){var a=n(Zo.getCellElement(e[i],u),t);!0===a&&!1===o?Zo.mutateCell(e[i],u,ae.elementnew(r(),!0)):!0===a&&(o=!1)}return e},au=function(i,u,a,c){if(0<u&&u<i.length){var e=i[u-1].cells(),t=(n=a,B(e,function(e,t){return O(e,function(e){return n(e.element(),t.element())})?e:e.concat([t])},[]));k(t,function(e){for(var t=S.none(),n=u;n<i.length;n++)for(var r=0;r<Zo.cellLength(i[0]);r++){var o=i[n].cells()[r];a(o.element(),e.element())&&(t.isNone()&&(t=S.some(c())),t.each(function(e){Zo.mutateCell(i[n],r,ae.elementnew(e,!0))}))}})}var n;return i},cu=function(n,r,o,i,u){return nu(n,r,o).map(function(e){var t=ou(r,e,i);return function(e,t,n,r,o){for(var i,u,a,c,l,f,s,d=e.row(),m=e.column(),g=d+n.length,h=m+Zo.cellLength(n[0]),p=d;p<g;p++)for(var v=m;v<h;v++){i=t,u=p,a=v,c=o,f=l=void 0,l=Zo.getCell(i[u],a),f=R(c,l.element()),s=i[u],1<i.length&&1<Zo.cellLength(s)&&(0<a&&f(Zo.getCellElement(s,a-1))||a<s.length-1&&f(Zo.getCellElement(s,a+1))||0<u&&f(Zo.getCellElement(i[u-1],a))||u<i.length-1&&f(Zo.getCellElement(i[u+1],a)))&&uu(t,Zo.getCellElement(t[p],v),o,r.cell);var b=Zo.getCellElement(n[p-d],v-m),w=r.replace(b);Zo.mutateCell(t[p],v,ae.elementnew(w,!0))}return t}(n,t,o,i,u)})},lu=function(e,t,n,r,o){au(t,e,o,r.cell);var i=ru(n,t),u=ou(n,i,r),a=ru(t,u),c=ou(t,a,r);return c.slice(0,e).concat(u).concat(c.slice(e,c.length))},fu=function(n,r,e,o,i){var t=n.slice(0,r),u=n.slice(r),a=Zo.mapCells(n[e],function(e,t){return 0<r&&r<n.length&&o(Zo.getCellElement(n[r-1],t),Zo.getCellElement(n[r],t))?Zo.getCell(n[r],t):ae.elementnew(i(e.element(),o),!0)});return t.concat([a]).concat(u)},su=function(e,n,r,o,i){return A(e,function(e){var t=0<n&&n<Zo.cellLength(e)&&o(Zo.getCellElement(e,n-1),Zo.getCellElement(e,n))?Zo.getCell(e,n):ae.elementnew(i(Zo.getCellElement(e,r),o),!0);return Zo.addCell(e,n,t)})},du=function(e,r,o,i,u){var a=o+1;return A(e,function(e,t){var n=t===r?ae.elementnew(u(Zo.getCellElement(e,o),i),!0):Zo.getCell(e,o);return Zo.addCell(e,a,n)})},mu=function(e,t,n,r,o){var i=t+1,u=e.slice(0,i),a=e.slice(i),c=Zo.mapCells(e[t],function(e,t){return t===n?ae.elementnew(o(e.element(),r),!0):e});return u.concat([c]).concat(a)},gu=function(e,t,n){return e.slice(0,t).concat(e.slice(n+1))},hu=function(e,n,r){var t=A(e,function(e){var t=e.cells().slice(0,n).concat(e.cells().slice(r+1));return ae.rowcells(t,e.section())});return P(t,function(e){return 0<e.cells().length})},pu=function(e,n,r,o){return A(e,function(e){return Zo.mapCells(e,function(e){return t=e,O(n,function(e){return r(t.element(),e.element())})?ae.elementnew(o(e.element(),r),!0):e;var t})})},vu=function(e,t,n,r){return Zo.getCellElement(e[t],n)!==undefined&&0<t&&r(Zo.getCellElement(e[t-1],n),Zo.getCellElement(e[t],n))},bu=function(e,t,n){return 0<t&&n(Zo.getCellElement(e,t-1),Zo.getCellElement(e,t))},wu=function(n,r,o,e){var t=F(n,function(e,t){return vu(n,t,r,o)||bu(e,r,o)?[]:[Zo.getCell(e,r)]});return pu(n,t,o,e)},yu=function(n,r,o,e){var i=n[r],t=F(i.cells(),function(e,t){return vu(n,r,t,o)||bu(i,t,o)?[]:[e]});return pu(n,t,o,e)},xu=function(e){return{fold:e}},Cu=function(){return xu(function(e,t,n,r,o){return e()})},Ru=function(i){return xu(function(e,t,n,r,o){return t(i)})},Su=function(i,u){return xu(function(e,t,n,r,o){return n(i,u)})},Tu=function(i,u,a){return xu(function(e,t,n,r,o){return r(i,u,a)})},Nu=function(i,u){return xu(function(e,t,n,r,o){return o(i,u)})},Du=function(e,t,i,u){var n,r,a=e.slice(0),o=(r=t,0===(n=e).length?Cu():1===n.length?Ru(0):0===r?Su(0,1):r===n.length-1?Nu(r-1,r):0<r&&r<n.length-1?Tu(r-1,r,r+1):Cu()),c=function(e){return A(e,C(0))},l=C(c(a)),f=function(e,t){if(0<=i){var n=Math.max(u.minCellWidth(),a[t]-i);return c(a.slice(0,e)).concat([i,n-a[t]]).concat(c(a.slice(t+1)))}var r=Math.max(u.minCellWidth(),a[e]+i),o=a[e]-r;return c(a.slice(0,e)).concat([r-a[e],o]).concat(c(a.slice(t+1)))},s=f;return o.fold(l,function(e){return u.singleColumnWidth(a[e],i)},s,function(e,t,n){return f(t,n)},function(e,t){if(0<=i)return c(a.slice(0,t)).concat([i]);var n=Math.max(u.minCellWidth(),a[t]+i);return c(a.slice(0,t)).concat([n-a[t]])})},Eu=function(e,t){return bt.has(e,t)&&1<parseInt(bt.get(e,t),10)},Ou={hasColspan:function(e){return Eu(e,"colspan")},hasRowspan:function(e){return Eu(e,"rowspan")},minWidth:C(10),minHeight:C(10),getInt:function(e,t){return parseInt(en.get(e,t),10)}},Au=function(e,t,n){return en.getRaw(e,t).fold(function(){return n(e)+"px"},function(e){return e})},ku=function(e){return Au(e,"width",no.getPixelWidth)},Pu=function(e){return Au(e,"height",no.getHeight)},Iu=function(e,t,n,r,o){var i=si(e),u=A(i,function(e){return e.map(t.edge)});return A(i,function(e,t){return e.filter(m(Ou.hasColspan)).fold(function(){var e=li(u,t);return r(e)},function(e){return n(e,o)})})},Bu=function(e){return e.map(function(e){return e+"px"}).getOr("")},Mu=function(e,t,n,r){var o=di(e),i=A(o,function(e){return e.map(t.edge)});return A(o,function(e,t){return e.filter(m(Ou.hasRowspan)).fold(function(){var e=li(i,t);return r(e)},function(e){return n(e)})})},Wu={getRawWidths:function(e,t){return Iu(e,t,ku,Bu)},getPixelWidths:function(e,t,n){return Iu(e,t,no.getPixelWidth,function(e){return e.getOrThunk(n.minCellWidth)},n)},getPercentageWidths:function(e,t,n){return Iu(e,t,no.getPercentageWidth,function(e){return e.fold(function(){return n.minCellWidth()},function(e){return e/n.pixelWidth()*100})},n)},getPixelHeights:function(e,t){return Mu(e,t,no.getHeight,function(e){return e.getOrThunk(Ou.minHeight)})},getRawHeights:function(e,t){return Mu(e,t,Pu,Bu)}},_u=function(e,t,n){for(var r=0,o=e;o<t;o++)r+=n[o]!==undefined?n[o]:0;return r},Lu=function(e,n){var t=Yt.justCells(e);return A(t,function(e){var t=_u(e.column(),e.column()+e.colspan(),n);return{element:e.element,width:C(t),colspan:e.colspan}})},qu=function(e,n){var t=Yt.justCells(e);return A(t,function(e){var t=_u(e.row(),e.row()+e.rowspan(),n);return{element:e.element,height:C(t),rowspan:e.rowspan}})},Fu=function(e,n){return A(e.all(),function(e,t){return{element:e.element,height:C(n[t])}})},ju=function(e){var t=parseInt(e,10),n=u;return{width:C(t),pixelWidth:C(t),getWidths:Wu.getPixelWidths,getCellDelta:n,singleColumnWidth:function(e,t){return[Math.max(Ou.minWidth(),e+t)-e]},minCellWidth:Ou.minWidth,setElementWidth:no.setPixelWidth,setTableWidth:function(e,t,n){var r=I(t,function(e,t){return e+t},0);no.setPixelWidth(e,r)}}},zu=function(e,t){if(no.percentageBasedSizeRegex().test(t)){var n=no.percentageBasedSizeRegex().exec(t);return o=n[1],i=e,u=parseFloat(o),a=zr(i),{width:C(u),pixelWidth:C(a),getWidths:Wu.getPercentageWidths,getCellDelta:function(e){return e/a*100},singleColumnWidth:function(e,t){return[100-e]},minCellWidth:function(){return Ou.minWidth()/a*100},setElementWidth:no.setPercentageWidth,setTableWidth:function(e,t,n){var r=u+n;no.setPercentageWidth(e,r)}}}if(no.pixelBasedSizeRegex().test(t)){var r=no.pixelBasedSizeRegex().exec(t);return ju(r[1])}var o,i,u,a,c=zr(e);return ju(c)},Hu=function(t){return no.getRawWidth(t).fold(function(){var e=zr(t);return ju(e)},function(e){return zu(t,e)})},Uu=function(e){return Yt.generate(e)},Vu=function(e){var t=Ht(e);return Uu(t)},Gu=function(e,t,n,r){var o=Hu(e),i=o.getCellDelta(t),u=Vu(e),a=o.getWidths(u,r,o),c=Du(a,n,i,o),l=A(c,function(e,t){return e+a[t]}),f=Lu(u,l);k(f,function(e){o.setElementWidth(e.element(),e.width())}),n===u.grid().columns()-1&&o.setTableWidth(e,l,i)},Yu=function(e,n,r,t){var o=Vu(e),i=Wu.getPixelHeights(o,t),u=A(i,function(e,t){return r===t?Math.max(n+e,Ou.minHeight()):e}),a=qu(o,u),c=Fu(o,u);k(c,function(e){no.setHeight(e.element(),e.height())}),k(a,function(e){no.setHeight(e.element(),e.height())});var l=I(u,function(e,t){return e+t},0);no.setHeight(e,l)},Xu=function(e,t,n){var r=Hu(e),o=Uu(t),i=r.getWidths(o,n,r),u=Lu(o,i);k(u,function(e){r.setElementWidth(e.element(),e.width())});var a=I(i,function(e,t){return t+e},0);0<u.length&&r.setElementWidth(e,a)},Ku=function(e){0===zt.cells(e).length&&an.remove(e)},Ju=X("grid","cursor"),$u=function(e,t,n){return Qu(e,t,n).orThunk(function(){return Qu(e,0,0)})},Qu=function(e,t,n){return S.from(e[t]).bind(function(e){return S.from(e.cells()[n]).bind(function(e){return S.from(e.element())})})},Zu=function(e,t,n){return Ju(e,Qu(e,t,n))},ea=function(e){return B(e,function(e,t){return O(e,function(e){return e.row()===t.row()})?e:e.concat([t])},[]).sort(function(e,t){return e.row()-t.row()})},ta=function(e){return B(e,function(e,t){return O(e,function(e){return e.column()===t.column()})?e:e.concat([t])},[]).sort(function(e,t){return e.column()-t.column()})},na=function(e,t,n){var r=Ut(e,n),o=Yt.generate(r);return ri(o,t,!0)},ra=Xu,oa={insertRowBefore:zi(function(e,t,n,r){var o=t.row(),i=t.row(),u=fu(e,i,o,n,r.getOrInit);return Zu(u,i,t.column())},Ui,y,y,Io),insertRowsBefore:zi(function(e,t,n,r){var o=t[0].row(),i=t[0].row(),u=ea(t),a=B(u,function(e,t){return fu(e,i,o,n,r.getOrInit)},e);return Zu(a,i,t[0].column())},Vi,y,y,Io),insertRowAfter:zi(function(e,t,n,r){var o=t.row(),i=t.row()+t.rowspan(),u=fu(e,i,o,n,r.getOrInit);return Zu(u,i,t.column())},Ui,y,y,Io),insertRowsAfter:zi(function(e,t,n,r){var o=ea(t),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),a=B(o,function(e,t){return fu(e,u,i,n,r.getOrInit)},e);return Zu(a,u,t[0].column())},Vi,y,y,Io),insertColumnBefore:zi(function(e,t,n,r){var o=t.column(),i=t.column(),u=su(e,i,o,n,r.getOrInit);return Zu(u,t.row(),i)},Ui,ra,y,Io),insertColumnsBefore:zi(function(e,t,n,r){var o=ta(t),i=o[0].column(),u=o[0].column(),a=B(o,function(e,t){return su(e,u,i,n,r.getOrInit)},e);return Zu(a,t[0].row(),u)},Vi,ra,y,Io),insertColumnAfter:zi(function(e,t,n,r){var o=t.column(),i=t.column()+t.colspan(),u=su(e,i,o,n,r.getOrInit);return Zu(u,t.row(),i)},Ui,ra,y,Io),insertColumnsAfter:zi(function(e,t,n,r){var o=t[t.length-1].column(),i=t[t.length-1].column()+t[t.length-1].colspan(),u=ta(t),a=B(u,function(e,t){return su(e,i,o,n,r.getOrInit)},e);return Zu(a,t[0].row(),i)},Vi,ra,y,Io),splitCellIntoColumns:zi(function(e,t,n,r){var o=du(e,t.row(),t.column(),n,r.getOrInit);return Zu(o,t.row(),t.column())},Ui,ra,y,Io),splitCellIntoRows:zi(function(e,t,n,r){var o=mu(e,t.row(),t.column(),n,r.getOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Io),eraseColumns:zi(function(e,t,n,r){var o=ta(t),i=hu(e,o[0].column(),o[o.length-1].column()),u=$u(i,t[0].row(),t[0].column());return Ju(i,u)},Vi,ra,Ku,Io),eraseRows:zi(function(e,t,n,r){var o=ea(t),i=gu(e,o[0].row(),o[o.length-1].row()),u=$u(i,t[0].row(),t[0].column());return Ju(i,u)},Vi,y,Ku,Io),makeColumnHeader:zi(function(e,t,n,r){var o=wu(e,t.column(),n,r.replaceOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Bo("row","th")),unmakeColumnHeader:zi(function(e,t,n,r){var o=wu(e,t.column(),n,r.replaceOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Bo(null,"td")),makeRowHeader:zi(function(e,t,n,r){var o=yu(e,t.row(),n,r.replaceOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Bo("col","th")),unmakeRowHeader:zi(function(e,t,n,r){var o=yu(e,t.row(),n,r.replaceOrInit);return Zu(o,t.row(),t.column())},Ui,y,y,Bo(null,"td")),mergeCells:zi(function(e,t,n,r){var o=t.cells();Go(o);var i=iu(e,t.bounds(),n,C(o[0]));return Ju(i,S.from(o[0]))},Xi,y,y,Mo),unmergeCells:zi(function(e,t,n,r){var o=I(t,function(e,t){return uu(e,t,n,r.combine(t))},e);return Ju(o,S.from(t[0]))},Ki,ra,y,Mo),pasteCells:zi(function(e,n,t,r){var o,i,u,a,c=(o=n.clipboard(),i=n.generators(),u=Ht(o),a=Yt.generate(u),ri(a,i,!0)),l=ae.address(n.row(),n.column());return cu(l,e,c,n.generators(),t).fold(function(){return Ju(e,S.some(n.element()))},function(e){var t=$u(e,n.row(),n.column());return Ju(e,t)})},Gi,ra,y,Io),pasteRowsBefore:zi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[0].row(),u=na(t.clipboard(),t.generators(),o),a=lu(i,e,u,t.generators(),n),c=$u(a,t.cells[0].row(),t.cells[0].column());return Ju(a,c)},Yi,y,y,Io),pasteRowsAfter:zi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),u=na(t.clipboard(),t.generators(),o),a=lu(i,e,u,t.generators(),n),c=$u(a,t.cells[0].row(),t.cells[0].column());return Ju(a,c)},Yi,y,y,Io)},ia=function(e){return le.fromDom(e.getBody())},ua=function(e){return e.getBoundingClientRect().width},aa=function(e){return e.getBoundingClientRect().height},ca=function(t){return function(e){return $e.eq(e,ia(t))}},la=function(e){return/^[0-9]+$/.test(e)&&(e+="px"),e},fa=function(e){var t=St.descendants(e,"td[data-mce-style],th[data-mce-style]");bt.remove(e,"data-mce-style"),k(t,function(e){bt.remove(e,"data-mce-style")})},sa=function(e){return"rtl"===en.get(e,"direction")?"rtl":"ltr"},da={onDirection:function(t,n){return function(e){return"rtl"===sa(e)?n:t}},getDirection:sa},ma={isRtl:C(!1)},ga={isRtl:C(!0)},ha={directionAt:function(e){return"rtl"===da.getDirection(e)?ga:ma}},pa=["tableprops","tabledelete","|","tableinsertrowbefore","tableinsertrowafter","tabledeleterow","|","tableinsertcolbefore","tableinsertcolafter","tabledeletecol"],va={"border-collapse":"collapse",width:"100%"},ba={border:"1"},wa=function(e){return e.getParam("table_cell_advtab",!0,"boolean")},ya=function(e){return e.getParam("table_row_advtab",!0,"boolean")},xa=function(e){return e.getParam("table_advtab",!0,"boolean")},Ca=function(e){return e.getParam("table_style_by_css",!1,"boolean")},Ra=function(e){return e.getParam("table_cell_class_list",[],"array")},Sa=function(e){return e.getParam("table_row_class_list",[],"array")},Ta=function(e){return e.getParam("table_class_list",[],"array")},Na=function(e){return!1===e.getParam("table_responsive_width")},Da=function(e,t){return e.fire("newrow",{node:t})},Ea=function(e,t){return e.fire("newcell",{node:t})},Oa=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},Aa=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},ka=function(f,e){var t,n=function(e){return"table"===mt.name(ia(e))},s=(t=f.getParam("table_clone_elements"),v(t)?S.some(t.split(/[ ,]/)):Array.isArray(t)?S.some(t):S.none()),r=function(u,a,c,l){return function(e,t){fa(e);var n=l(),r=le.fromDom(f.getDoc()),o=So(ha.directionAt),i=En(c,r,s);return a(e)?u(n,e,t,i,o).bind(function(e){return k(e.newRows(),function(e){Da(f,e.dom())}),k(e.newCells(),function(e){Ea(f,e.dom())}),e.cursor().map(function(e){var t=f.dom.createRng();return t.setStart(e.dom(),0),t.setEnd(e.dom(),0),t})}):S.none()}};return{deleteRow:r(oa.eraseRows,function(e){var t=No(e);return!1===n(f)||1<t.rows()},y,e),deleteColumn:r(oa.eraseColumns,function(e){var t=No(e);return!1===n(f)||1<t.columns()},y,e),insertRowsBefore:r(oa.insertRowsBefore,l,y,e),insertRowsAfter:r(oa.insertRowsAfter,l,y,e),insertColumnsBefore:r(oa.insertColumnsBefore,l,ro,e),insertColumnsAfter:r(oa.insertColumnsAfter,l,ro,e),mergeCells:r(oa.mergeCells,l,y,e),unmergeCells:r(oa.unmergeCells,l,y,e),pasteRowsBefore:r(oa.pasteRowsBefore,l,y,e),pasteRowsAfter:r(oa.pasteRowsAfter,l,y,e),pasteCells:r(oa.pasteCells,l,y,e)}},Pa=function(e,t,r){var n=Ht(e),o=Yt.generate(n);return Vi(o,t).map(function(e){var t=ri(o,r,!1).slice(e[0].row(),e[e.length-1].row()+e[e.length-1].rowspan()),n=Hi(t,r);return ui(n)})},Ia=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ba=function(e,t,n){n&&e.formatter.apply("align"+n,{},t)},Ma=function(e,t,n){n&&e.formatter.apply("valign"+n,{},t)},Wa=function(t,n){Ia.each("left center right".split(" "),function(e){t.formatter.remove("align"+e,{},n)})},_a=function(t,n){Ia.each("top middle bottom".split(" "),function(e){t.formatter.remove("valign"+e,{},n)})},La=function(o,e,i){var t;return t=function(e,t){for(var n=0;n<t.length;n++){var r=o.getStyle(t[n],i);if(void 0===e&&(e=r),e!==r)return""}return e}(t,o.select("td,th",e))},qa=function(e,t){var n=e.dom,r=t.control.rootControl,o=r.toJSON(),i=n.parseStyle(o.style);i["border-style"]=o.borderStyle,i["border-color"]=o.borderColor,i["background-color"]=o.backgroundColor,i.width=o.width?la(o.width):"",i.height=o.height?la(o.height):"",r.find("#style").value(n.serializeStyle(n.parseStyle(n.serializeStyle(i))))},Fa=function(e,t){var n=e.dom,r=t.control.rootControl,o=r.toJSON(),i=n.parseStyle(o.style);r.find("#borderStyle").value(i["border-style"]||""),r.find("#borderColor").value(i["border-color"]||""),r.find("#backgroundColor").value(i["background-color"]||""),r.find("#width").value(i.width||""),r.find("#height").value(i.height||"")},ja={createStyleForm:function(n){var e=function(){var e=n.getParam("color_picker_callback");if(e)return function(t){return e.call(n,function(e){t.control.value(e).fire("change")},t.control.value())}};return{title:"Advanced",type:"form",defaults:{onchange:R(qa,n)},items:[{label:"Style",name:"style",type:"textbox",onchange:R(Fa,n)},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border style",type:"listbox",name:"borderStyle",width:90,onselect:R(qa,n),values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}},buildListItems:function(e,r,t){var o=function(e,n){return n=n||[],Ia.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=o(e.menu):(t.value=e.value,r&&r(t)),n.push(t)}),n};return o(e,t||[])},updateStyleField:qa,extractAdvancedStyles:function(e,t){var n=e.parseStyle(e.getAttrib(t,"style")),r={};return n["border-style"]&&(r.borderStyle=n["border-style"]),n["border-color"]&&(r.borderColor=n["border-color"]),n["background-color"]&&(r.backgroundColor=n["background-color"]),r.style=e.serializeStyle(n),r},updateAdvancedFields:Fa,syncAdvancedStyleFields:function(e,t){t.control.rootControl.find("#style")[0].getEl().isEqualNode(document.activeElement)?Fa(e,t):qa(e,t)}},za=function(r,o,e){var i,u=r.dom;function a(e,t,n){(1===o.length||n)&&u.setAttrib(e,t,n)}function c(e,t,n){(1===o.length||n)&&u.setStyle(e,t,n)}wa(r)&&ja.syncAdvancedStyleFields(r,e),i=e.control.rootControl.toJSON(),r.undoManager.transact(function(){Ia.each(o,function(e){var t,n;a(e,"scope",i.scope),1===o.length?a(e,"style",i.style):(t=e,n=i.style,delete t.dataset.mceStyle,t.style.cssText+=";"+n),a(e,"class",i["class"]),c(e,"width",la(i.width)),c(e,"height",la(i.height)),i.type&&e.nodeName.toLowerCase()!==i.type&&(e=u.rename(e,i.type)),1===o.length&&(Wa(r,e),_a(r,e)),i.align&&Ba(r,e,i.align),i.valign&&Ma(r,e,i.valign)}),r.focus()})},Ha=function(t){var e,n,r,o=[];if(o=t.dom.select("td[data-mce-selected],th[data-mce-selected]"),e=t.dom.getParent(t.selection.getStart(),"td,th"),!o.length&&e&&o.push(e),e=e||o[0]){var i,u,a,c;1<o.length?n={width:"",height:"",scope:"","class":"",align:"",valign:"",style:"",type:e.nodeName.toLowerCase()}:(u=e,a=(i=t).dom,c={width:a.getStyle(u,"width")||a.getAttrib(u,"width"),height:a.getStyle(u,"height")||a.getAttrib(u,"height"),scope:a.getAttrib(u,"scope"),"class":a.getAttrib(u,"class"),type:u.nodeName.toLowerCase(),style:"",align:"",valign:""},Ia.each("left center right".split(" "),function(e){i.formatter.matchNode(u,"align"+e)&&(c.align=e)}),Ia.each("top middle bottom".split(" "),function(e){i.formatter.matchNode(u,"valign"+e)&&(c.valign=e)}),wa(i)&&Ia.extend(c,ja.extractAdvancedStyles(a,u)),n=c),0<Ra(t).length&&(r={name:"class",type:"listbox",label:"Class",values:ja.buildListItems(Ra(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"td",classes:[e.value]})})})});var l={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width",onchange:R(ja.updateStyleField,t)},{label:"Height",name:"height",onchange:R(ja.updateStyleField,t)},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},r]};wa(t)?t.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:n,body:[{title:"General",type:"form",items:l},ja.createStyleForm(t)],onsubmit:R(za,t,o)}):t.windowManager.open({title:"Cell properties",data:n,body:l,onsubmit:R(za,t,o)})}};function Ua(f,s,d,e){var m=f.dom;function g(e,t,n){(1===s.length||n)&&m.setAttrib(e,t,n)}ya(f)&&ja.syncAdvancedStyleFields(f,e);var h=e.control.rootControl.toJSON();f.undoManager.transact(function(){Ia.each(s,function(e){var t,n,r,o,i,u,a,c,l;g(e,"scope",h.scope),g(e,"style",h.style),g(e,"class",h["class"]),t=e,n="height",r=la(h.height),(1===s.length||r)&&m.setStyle(t,n,r),h.type!==e.parentNode.nodeName.toLowerCase()&&(o=f.dom,i=e,u=h.type,a=o.getParent(i,"table"),c=i.parentNode,(l=o.select(u,a)[0])||(l=o.create(u),a.firstChild?"CAPTION"===a.firstChild.nodeName?o.insertAfter(l,a.firstChild):a.insertBefore(l,a.firstChild):a.appendChild(l)),l.appendChild(i),c.hasChildNodes()||o.remove(c)),h.align!==d.align&&(Wa(f,e),Ba(f,e,h.align))}),f.focus()})}var Va=function(t){var e,n,r,o,i,u,a,c,l,f,s=t.dom,d=[];e=s.getParent(t.selection.getStart(),"table"),n=s.getParent(t.selection.getStart(),"td,th"),Ia.each(e.rows,function(t){Ia.each(t.cells,function(e){if(s.getAttrib(e,"data-mce-selected")||e===n)return d.push(t),!1})}),(r=d[0])&&(1<d.length?i={height:"",scope:"",style:"","class":"",align:"",type:r.parentNode.nodeName.toLowerCase()}:(c=r,l=(a=t).dom,f={height:l.getStyle(c,"height")||l.getAttrib(c,"height"),scope:l.getAttrib(c,"scope"),"class":l.getAttrib(c,"class"),align:"",style:"",type:c.parentNode.nodeName.toLowerCase()},Ia.each("left center right".split(" "),function(e){a.formatter.matchNode(c,"align"+e)&&(f.align=e)}),ya(a)&&Ia.extend(f,ja.extractAdvancedStyles(l,c)),i=f),0<Sa(t).length&&(o={name:"class",type:"listbox",label:"Class",values:ja.buildListItems(Sa(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})})}),u={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"Header",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},ya(t)?t.windowManager.open({title:"Row properties",data:i,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},ja.createStyleForm(t)],onsubmit:R(Ua,t,d,i)}):t.windowManager.open({title:"Row properties",data:i,body:u,onsubmit:R(Ua,t,d,i)}))},Ga=tinymce.util.Tools.resolve("tinymce.Env"),Ya={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},Xa=function(e,t,n,r,o){void 0===o&&(o=Ya);var i=le.fromTag("table");en.setAll(i,o.styles),bt.setAll(i,o.attributes);var u=le.fromTag("tbody");rn.append(i,u);for(var a=[],c=0;c<e;c++){for(var l=le.fromTag("tr"),f=0;f<t;f++){var s=c<n||f<r?le.fromTag("th"):le.fromTag("td");f<r&&bt.set(s,"scope","row"),c<n&&bt.set(s,"scope","col"),rn.append(s,le.fromTag("br")),o.percentages&&en.set(s,"width",100/t+"%"),rn.append(l,s)}a.push(l)}return on.append(u,a),i},Ka=function(e){return e.dom().innerHTML},Ja=function(e){var t=le.fromTag("div"),n=le.fromDom(e.dom().cloneNode(!0));return rn.append(t,n),Ka(t)},$a=function(e,t){e.selection.select(t.dom(),!0),e.selection.collapse(!0)},Qa=function(o,e,t){var n,r,i=o.getParam("table_default_styles",va,"object"),u={styles:i,attributes:(r=o,r.getParam("table_default_attributes",ba,"object")),percentages:(n=i.width,v(n)&&-1!==n.indexOf("%")&&!Na(o))},a=Xa(t,e,0,0,u);bt.set(a,"data-mce-id","__mce");var c=Ja(a);return o.insertContent(c),Wt.descendant(ia(o),'table[data-mce-id="__mce"]').map(function(e){var t,n,r;return Na(o)&&en.set(e,"width",en.get(e,"width")),bt.remove(e,"data-mce-id"),t=o,k(St.descendants(e,"tr"),function(e){Da(t,e.dom()),k(St.descendants(e,"th,td"),function(e){Ea(t,e.dom())})}),n=o,r=e,Wt.descendant(r,"td,th").each(R($a,n)),e.dom()}).getOr(null)};function Za(e,t,n,r){if("TD"===t.tagName||"TH"===t.tagName)e.setStyle(t,n,r);else if(t.children)for(var o=0;o<t.children.length;o++)Za(e,t.children[o],n,r)}var ec=function(e,t,n){var r,o,i=e.dom;xa(e)&&ja.syncAdvancedStyleFields(e,n),!1===(o=n.control.rootControl.toJSON())["class"]&&delete o["class"],e.undoManager.transact(function(){t||(t=Qa(e,o.cols||1,o.rows||1)),function(e,t,n){var r,o=e.dom,i={},u={};if(i["class"]=n["class"],u.height=la(n.height),o.getAttrib(t,"width")&&!Ca(e)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=la(n.width),Ca(e)?(u["border-width"]=la(n.border),u["border-spacing"]=la(n.cellspacing),Ia.extend(i,{"data-mce-border-color":n.borderColor,"data-mce-cell-padding":n.cellpadding,"data-mce-border":n.border})):Ia.extend(i,{border:n.border,cellpadding:n.cellpadding,cellspacing:n.cellspacing}),Ca(e)&&t.children)for(var a=0;a<t.children.length;a++)Za(o,t.children[a],{"border-width":la(n.border),"border-color":n.borderColor,padding:la(n.cellpadding)});n.style?Ia.extend(u,o.parseStyle(n.style)):u=Ia.extend({},o.parseStyle(o.getAttrib(t,"style")),u),i.style=o.serializeStyle(u),o.setAttribs(t,i)}(e,t,o),(r=i.select("caption",t)[0])&&!o.caption&&i.remove(r),!r&&o.caption&&((r=i.create("caption")).innerHTML=Ga.ie?"\xa0":'<br data-mce-bogus="1"/>',t.insertBefore(r,t.firstChild)),Wa(e,t),o.align&&Ba(e,t,o.align),e.focus(),e.addVisual()})},tc=function(t,e){var n,r,o,i,u,a,c,l,f,s,d=t.dom,m={};!0===e?(n=d.getParent(t.selection.getStart(),"table"))&&(c=n,l=(a=t).dom,f={width:l.getStyle(c,"width")||l.getAttrib(c,"width"),height:l.getStyle(c,"height")||l.getAttrib(c,"height"),cellspacing:l.getStyle(c,"border-spacing")||l.getAttrib(c,"cellspacing"),cellpadding:l.getAttrib(c,"data-mce-cell-padding")||l.getAttrib(c,"cellpadding")||La(a.dom,c,"padding"),border:l.getAttrib(c,"data-mce-border")||l.getAttrib(c,"border")||La(a.dom,c,"border"),borderColor:l.getAttrib(c,"data-mce-border-color"),caption:!!l.select("caption",c)[0],"class":l.getAttrib(c,"class")},Ia.each("left center right".split(" "),function(e){a.formatter.matchNode(c,"align"+e)&&(f.align=e)}),xa(a)&&Ia.extend(f,ja.extractAdvancedStyles(l,c)),m=f):(r={label:"Cols",name:"cols"},o={label:"Rows",name:"rows"}),0<Ta(t).length&&(m["class"]&&(m["class"]=m["class"].replace(/\s*mce\-item\-table\s*/g,"")),i={name:"class",type:"listbox",label:"Class",values:ja.buildListItems(Ta(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"table",classes:[e.value]})})})}),u={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:(s=t,s.getParam("table_appearance_options",!0,"boolean")?[r,o,{label:"Width",name:"width",onchange:R(ja.updateStyleField,t)},{label:"Height",name:"height",onchange:R(ja.updateStyleField,t)},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[r,o,{label:"Width",name:"width",onchange:R(ja.updateStyleField,t)},{label:"Height",name:"height",onchange:R(ja.updateStyleField,t)}])},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},i]},xa(t)?t.windowManager.open({title:"Table properties",data:m,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},ja.createStyleForm(t)],onsubmit:R(ec,t,n)}):t.windowManager.open({title:"Table properties",data:m,body:u,onsubmit:R(ec,t,n)})},nc=Ia.each,rc=function(a,t,c,l,n){var r=ca(a),f=function(){return le.fromDom(a.dom.getParent(a.selection.getStart(),"th,td"))},s=function(e){return zt.table(e,r)},d=function(e){return{width:ua(e.dom()),height:ua(e.dom())}},o=function(t){var n=f();s(n).each(function(i){var e=Mr.forMenu(l,i,n),u=d(i);t(i,e).each(function(e){var t,n,r,o;t=a,n=u,o=d(r=i),n.width===o.width&&n.height===o.height||(Oa(t,r.dom(),n.width,n.height),Aa(t,r.dom(),o.width,o.height)),a.selection.setRng(e),a.focus(),c.clear(i),fa(i)})})},i=function(e){var o=f();return s(o).bind(function(e){var t=le.fromDom(a.getDoc()),n=Mr.forMenu(l,e,o),r=En(y,t,S.none());return Pa(e,n,r)})},u=function(u){n.get().each(function(e){var o=A(e,function(e){return gn(e)}),i=f();s(i).bind(function(t){var e=le.fromDom(a.getDoc()),n=On(e),r=Mr.pasteRows(l,t,i,o,n);u(t,r).each(function(e){a.selection.setRng(e),a.focus(),c.clear(t)})})})};nc({mceTableSplitCells:function(){o(t.unmergeCells)},mceTableMergeCells:function(){o(t.mergeCells)},mceTableInsertRowBefore:function(){o(t.insertRowsBefore)},mceTableInsertRowAfter:function(){o(t.insertRowsAfter)},mceTableInsertColBefore:function(){o(t.insertColumnsBefore)},mceTableInsertColAfter:function(){o(t.insertColumnsAfter)},mceTableDeleteCol:function(){o(t.deleteColumn)},mceTableDeleteRow:function(){o(t.deleteRow)},mceTableCutRow:function(e){n.set(i()),o(t.deleteRow)},mceTableCopyRow:function(e){n.set(i())},mceTablePasteRowBefore:function(e){u(t.pasteRowsBefore)},mceTablePasteRowAfter:function(e){u(t.pasteRowsAfter)},mceTableDelete:function(){var e=le.fromDom(a.dom.getParent(a.selection.getStart(),"th,td"));zt.table(e,r).filter(m(r)).each(function(e){var t=le.fromText("");rn.after(e,t),an.remove(e);var n=a.dom.createRng();n.setStart(t.dom(),0),n.setEnd(t.dom(),0),a.selection.setRng(n)})}},function(e,t){a.addCommand(t,e)}),nc({mceInsertTable:R(tc,a),mceTableProps:R(tc,a,!0),mceTableRowProps:R(Va,a),mceTableCellProps:R(Ha,a)},function(n,e){a.addCommand(e,function(e,t){n(t)})})},oc=function(e){var t=S.from(e.dom().documentElement).map(le.fromDom).getOr(e);return{parent:C(t),view:C(e),origin:C(ao(0,0))}},ic=function(e,t){return{parent:C(t),view:C(e),origin:C(ao(0,0))}};function uc(e){var n=X.apply(null,e),r=[];return{bind:function(e){if(e===undefined)throw"Event bind error: undefined handler";r.push(e)},unbind:function(t){r=P(r,function(e){return e!==t})},trigger:function(){var t=n.apply(null,arguments);k(r,function(e){e(t)})}}}var ac={create:function(e){return{registry:G(e,function(e){return{bind:e.bind,unbind:e.unbind}}),trigger:G(e,function(e){return e.trigger})}}},cc={mode:Ao(["compare","extract","mutate","sink"]),sink:Ao(["element","start","stop","destroy"]),api:Ao(["forceDrop","drop","move","delayDrop"])},lc={resolve:hi("ephox-dragster").resolve},fc=function(m,g){return function(e){if(m(e)){var t,n,r,o,i,u,a,c=le.fromDom(e.target),l=function(){e.stopPropagation()},f=function(){e.preventDefault()},s=x(f,l),d=(t=c,n=e.clientX,r=e.clientY,o=l,i=f,u=s,a=e,{target:C(t),x:C(n),y:C(r),stop:o,prevent:i,kill:u,raw:C(a)});g(d)}}},sc=function(e,t,n,r,o){var i=fc(n,r);return e.dom().addEventListener(t,i,o),{unbind:R(dc,e,t,i,o)}},dc=function(e,t,n,r){e.dom().removeEventListener(t,n,r)},mc=function(e,t,n,r){return sc(e,t,n,r,!1)},gc=function(e,t,n,r){return sc(e,t,n,r,!0)},hc=C(!0),pc={bind:function(e,t,n){return mc(e,t,hc,n)},capture:function(e,t,n){return gc(e,t,hc,n)}},vc=cc.mode({compare:function(e,t){return ao(t.left()-e.left(),t.top()-e.top())},extract:function(e){return S.some(ao(e.x(),e.y()))},sink:function(e,t){var n,r,o,i=(n=t,r=Xo({layerClass:lc.resolve("blocker")},n),o=le.fromTag("div"),bt.set(o,"role","presentation"),en.setAll(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Ai.add(o,lc.resolve("blocker")),Ai.add(o,r.layerClass),{element:function(){return o},destroy:function(){an.remove(o)}}),u=pc.bind(i.element(),"mousedown",e.forceDrop),a=pc.bind(i.element(),"mouseup",e.drop),c=pc.bind(i.element(),"mousemove",e.move),l=pc.bind(i.element(),"mouseout",e.delayDrop);return cc.sink({element:i.element,start:function(e){rn.append(e,i.element())},stop:function(){an.remove(i.element())},destroy:function(){i.destroy(),a.unbind(),c.unbind(),l.unbind(),u.unbind()}})},mutate:function(e,t){e.mutate(t.left(),t.top())}});function bc(){var i=S.none(),u=ac.create({move:uc(["info"])});return{onEvent:function(e,o){o.extract(e).each(function(e){var t,n,r;(t=o,n=e,r=i.map(function(e){return t.compare(e,n)}),i=S.some(n),r).each(function(e){u.trigger.move(e)})})},reset:function(){i=S.none()},events:u.registry}}function wc(){var e={onEvent:function(e,t){},reset:y},t=bc(),n=e;return{on:function(){n.reset(),n=t},off:function(){n.reset(),n=e},isOn:function(){return n===t},onEvent:function(e,t){n.onEvent(e,t)},events:t.events}}var yc=function(t,n,e){var r,o,i,u=!1,a=ac.create({start:uc([]),stop:uc([])}),c=wc(),l=function(){d.stop(),c.isOn()&&(c.off(),a.trigger.stop())},f=(r=l,o=200,i=null,{cancel:function(){null!==i&&(clearTimeout(i),i=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==i&&clearTimeout(i),i=setTimeout(function(){r.apply(null,e),i=null},o)}});c.events.move.bind(function(e){n.mutate(t,e.info())});var s=function(t){return function(){var e=Array.prototype.slice.call(arguments,0);if(u)return t.apply(null,e)}},d=n.sink(cc.api({forceDrop:l,drop:s(l),move:s(function(e,t){f.cancel(),c.onEvent(e,n)}),delayDrop:s(f.throttle)}),e);return{element:d.element,go:function(e){d.start(e),c.on(),a.trigger.start()},on:function(){u=!0},off:function(){u=!1},destroy:function(){d.destroy()},events:a.registry}},xc={transform:function(e,t){var n=t!==undefined?t:{},r=n.mode!==undefined?n.mode:vc;return yc(e,r,t)}};function Cc(){var n,r=ac.create({drag:uc(["xDelta","yDelta","target"])}),o=S.none(),e={mutate:function(e,t){n.trigger.drag(e,t)},events:(n=ac.create({drag:uc(["xDelta","yDelta"])})).registry};return e.events.drag.bind(function(t){o.each(function(e){r.trigger.drag(t.xDelta(),t.yDelta(),e)})}),{assign:function(e){o=S.some(e)},get:function(){return o},mutate:e.mutate,events:r.registry}}var Rc={any:function(e){return Wt.first(e).isSome()},ancestor:function(e,t,n){return Wt.ancestor(e,t,n).isSome()},sibling:function(e,t){return Wt.sibling(e,t).isSome()},child:function(e,t){return Wt.child(e,t).isSome()},descendant:function(e,t){return Wt.descendant(e,t).isSome()},closest:function(e,t,n){return Wt.closest(e,t,n).isSome()}},Sc=pi.resolve("resizer-bar-dragging");function Tc(e,n){var r=Co.height,t=function(o,t,i){var n=Cc(),r=xc.transform(n,{}),u=S.none(),e=function(e,t){return S.from(bt.get(e,t))};n.events.drag.bind(function(n){e(n.target(),"data-row").each(function(e){var t=Ou.getInt(n.target(),"top");en.set(n.target(),"top",t+n.yDelta()+"px")}),e(n.target(),"data-column").each(function(e){var t=Ou.getInt(n.target(),"left");en.set(n.target(),"left",t+n.xDelta()+"px")})});var a=function(e,t){return Ou.getInt(e,t)-parseInt(bt.get(e,"data-initial-"+t),10)};r.events.stop.bind(function(){n.get().each(function(r){u.each(function(n){e(r,"data-row").each(function(e){var t=a(r,"top");bt.remove(r,"data-initial-top"),d.trigger.adjustHeight(n,t,parseInt(e,10))}),e(r,"data-column").each(function(e){var t=a(r,"left");bt.remove(r,"data-initial-left"),d.trigger.adjustWidth(n,t,parseInt(e,10))}),Li.refresh(o,n,i,t)})})});var c=function(e,t){d.trigger.startAdjust(),n.assign(e),bt.set(e,"data-initial-"+t,parseInt(en.get(e,t),10)),Ai.add(e,Sc),en.set(e,"opacity","0.2"),r.go(o.parent())},l=pc.bind(o.parent(),"mousedown",function(e){Li.isRowBar(e.target())&&c(e.target(),"top"),Li.isColBar(e.target())&&c(e.target(),"left")}),f=function(e){return $e.eq(e,o.view())},s=pc.bind(o.view(),"mouseover",function(e){"table"===mt.name(e.target())||Rc.closest(e.target(),"table",f)?(u="table"===mt.name(e.target())?S.some(e.target()):Wt.ancestor(e.target(),"table",f)).each(function(e){Li.refresh(o,e,i,t)}):xt.inBody(e.target())&&Li.destroy(o)}),d=ac.create({adjustHeight:uc(["table","delta","row"]),adjustWidth:uc(["table","delta","column"]),startAdjust:uc([])});return{destroy:function(){l.unbind(),s.unbind(),r.destroy(),Li.destroy(o)},refresh:function(e){Li.refresh(o,e,i,t)},on:r.on,off:r.off,hideBars:R(Li.hide,o),showBars:R(Li.show,o),events:d.registry}}(e,n,r),o=ac.create({beforeResize:uc(["table"]),afterResize:uc(["table"]),startDrag:uc([])});return t.events.adjustHeight.bind(function(e){o.trigger.beforeResize(e.table());var t=r.delta(e.delta(),e.table());Yu(e.table(),t,e.row(),r),o.trigger.afterResize(e.table())}),t.events.startAdjust.bind(function(e){o.trigger.startDrag()}),t.events.adjustWidth.bind(function(e){o.trigger.beforeResize(e.table());var t=n.delta(e.delta(),e.table());Gu(e.table(),t,e.column(),n),o.trigger.afterResize(e.table())}),{on:t.on,off:t.off,hideBars:t.hideBars,showBars:t.showBars,destroy:t.destroy,events:o.registry}}var Nc=function(e,t){return e.inline?ic(ia(e),(n=le.fromTag("div"),en.setAll(n,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),rn.append(xt.body(),n),n)):oc(le.fromDom(e.getDoc()));var n},Dc=function(e,t){e.inline&&an.remove(t.parent())},Ec=function(u){var a,c,o=S.none(),i=S.none(),l=S.none(),f=/(\d+(\.\d+)?)%/,s=function(e){return"TABLE"===e.nodeName};return u.on("init",function(){var e,t=So(ha.directionAt),n=Nc(u);if(l=S.some(n),("table"===(e=u.getParam("object_resizing",!0))||e)&&u.getParam("table_resize_bars",!0,"boolean")){var r=Tc(n,t);r.on(),r.events.startDrag.bind(function(e){o=S.some(u.selection.getRng())}),r.events.beforeResize.bind(function(e){var t=e.table().dom();Oa(u,t,ua(t),aa(t))}),r.events.afterResize.bind(function(e){var t=e.table(),n=t.dom();fa(t),o.each(function(e){u.selection.setRng(e),u.focus()}),Aa(u,n,ua(n),aa(n)),u.undoManager.add()}),i=S.some(r)}}),u.on("ObjectResizeStart",function(e){var t,n=e.target;s(n)&&(a=e.width,t=n,c=u.dom.getStyle(t,"width")||u.dom.getAttrib(t,"width"))}),u.on("ObjectResized",function(e){var t=e.target;if(s(t)){var n=t;if(f.test(c)){var r=parseFloat(f.exec(c)[1]),o=e.width*r/a;u.dom.setStyle(n,"width",o+"%")}else{var i=[];Ia.each(n.rows,function(e){Ia.each(e.cells,function(e){var t=u.dom.getStyle(e,"width",!0);i.push({cell:e,width:t})})}),Ia.each(i,function(e){u.dom.setStyle(e.cell,"width",e.width),u.dom.setAttrib(e.cell,"width",null)})}}}),{lazyResize:function(){return i},lazyWire:function(){return l.getOr(oc(le.fromDom(u.getBody())))},destroy:function(){i.each(function(e){e.destroy()}),l.each(function(e){Dc(u,e)})}}},Oc=function(e){return{fold:e}},Ac=function(o){return Oc(function(e,t,n,r){return e(o)})},kc=function(o){return Oc(function(e,t,n,r){return t(o)})},Pc=function(o,i){return Oc(function(e,t,n,r){return n(o,i)})},Ic=function(o){return Oc(function(e,t,n,r){return r(o)})},Bc=function(n,e){return zt.table(n,e).bind(function(e){var t=zt.cells(e);return W(t,function(e){return $e.eq(n,e)}).map(function(e){return{index:C(e),all:C(t)}})})},Mc=function(t,e){return Bc(t,e).fold(function(){return Ac(t)},function(e){return e.index()+1<e.all().length?Pc(t,e.all()[e.index()+1]):Ic(t)})},Wc=function(t,e){return Bc(t,e).fold(function(){return Ac()},function(e){return 0<=e.index()-1?Pc(t,e.all()[e.index()-1]):kc(t)})},_c=Nr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Lc={before:_c.before,on:_c.on,after:_c.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(u,u,u)}},qc=Nr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Fc=X("start","soffset","finish","foffset"),jc={domRange:qc.domRange,relative:qc.relative,exact:qc.exact,exactFromRange:function(e){return qc.exact(e.start(),e.soffset(),e.finish(),e.foffset())},range:Fc,getWin:function(e){var t=e.match({domRange:function(e){return le.fromDom(e.startContainer)},relative:function(e,t){return Lc.getStart(e)},exact:function(e,t,n,r){return e}});return ot.defaultView(t)}},zc=function(e,t,n,r){var o=ot.owner(e).dom().createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o},Hc=function(e,t,n,r){var o=zc(e,t,n,r),i=$e.eq(e,n)&&t===r;return o.collapsed&&!i},Uc=function(e,t){e.selectNodeContents(t.dom())},Vc=function(e){e.deleteContents()},Gc=function(e){return{left:C(e.left),top:C(e.top),right:C(e.right),bottom:C(e.bottom),width:C(e.width),height:C(e.height)}},Yc={create:function(e){return e.document.createRange()},replaceWith:function(e,t){Vc(e),e.insertNode(t.dom())},selectNodeContents:function(e,t){var n=e.document.createRange();return Uc(n,t),n},selectNodeContentsUsing:Uc,relativeToNative:function(e,t,n){var r,o,i=e.document.createRange();return r=i,t.fold(function(e){r.setStartBefore(e.dom())},function(e,t){r.setStart(e.dom(),t)},function(e){r.setStartAfter(e.dom())}),o=i,n.fold(function(e){o.setEndBefore(e.dom())},function(e,t){o.setEnd(e.dom(),t)},function(e){o.setEndAfter(e.dom())}),i},exactToNative:function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(r.dom(),o),i},deleteContents:Vc,cloneFragment:function(e){var t=e.cloneContents();return le.fromDom(t)},getFirstRect:function(e){var t=e.getClientRects(),n=0<t.length?t[0]:e.getBoundingClientRect();return 0<n.width||0<n.height?S.some(n).map(Gc):S.none()},getBounds:function(e){var t=e.getBoundingClientRect();return 0<t.width||0<t.height?S.some(t).map(Gc):S.none()},isWithin:function(e,t){return t.compareBoundaryPoints(e.END_TO_START,e)<1&&-1<t.compareBoundaryPoints(e.START_TO_END,e)},toString:function(e){return e.toString()}},Xc=Nr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Kc=function(e,t,n){return t(le.fromDom(n.startContainer),n.startOffset,le.fromDom(n.endContainer),n.endOffset)},Jc=function(e,t){var o,n,r,i=(o=e,t.match({domRange:function(e){return{ltr:C(e),rtl:S.none}},relative:function(e,t){return{ltr:Ce(function(){return Yc.relativeToNative(o,e,t)}),rtl:Ce(function(){return S.some(Yc.relativeToNative(o,t,e))})}},exact:function(e,t,n,r){return{ltr:Ce(function(){return Yc.exactToNative(o,e,t,n,r)}),rtl:Ce(function(){return S.some(Yc.exactToNative(o,n,r,e,t))})}}}));return(r=(n=i).ltr()).collapsed?n.rtl().filter(function(e){return!1===e.collapsed}).map(function(e){return Xc.rtl(le.fromDom(e.endContainer),e.endOffset,le.fromDom(e.startContainer),e.startOffset)}).getOrThunk(function(){return Kc(0,Xc.ltr,r)}):Kc(0,Xc.ltr,r)},$c={ltr:Xc.ltr,rtl:Xc.rtl,diagnose:Jc,asLtrRange:function(i,e){return Jc(i,e).match({ltr:function(e,t,n,r){var o=i.document.createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o},rtl:function(e,t,n,r){var o=i.document.createRange();return o.setStart(n.dom(),r),o.setEnd(e.dom(),t),o}})}},Qc=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Zc=function(e,t,n,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,u=1;u<o;u++){var a=e(u),c=Math.abs(t-a.left);if(n<=a.bottom){if(n<a.top||i<c)return u-1;i=c}}return 0},el={locate:function(l,f,s,d){var e=l.dom().createRange();e.selectNode(f.dom());var t=e.getClientRects();return Jo(t,function(e){return Qc(e,s,d)?S.some(e):S.none()}).map(function(e){return n=l,t=s,o=d,i=e,u=function(e){var t=n.dom().createRange();return t.setStart(r.dom(),e),t.collapse(!0),t},a=vn.get(r=f).length,c=Zc(function(e){return u(e).getBoundingClientRect()},t,o,i.right,a),u(c);var n,r,t,o,i,u,a,c})}},tl=function(t,e,n,r){var o=t.dom().createRange(),i=ot.children(e);return Jo(i,function(e){return o.selectNode(e.dom()),Qc(o.getBoundingClientRect(),n,r)?nl(t,e,n,r):S.none()})},nl=function(e,t,n,r){return(mt.isText(t)?el.locate:tl)(e,t,n,r)},rl=function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return nl(e,t,u,a)},ol=function(e,t){return t-e.left<e.right-t},il=function(e,t,n){var r=e.dom().createRange();return r.selectNode(t.dom()),r.collapse(n),r},ul=function(t,e,n){var r=t.dom().createRange();r.selectNode(e.dom());var o=r.getBoundingClientRect(),i=ol(o,n);return(!0===i?Rn.first:Rn.last)(e).map(function(e){return il(t,e,i)})},al=function(e,t,n){var r=t.dom().getBoundingClientRect(),o=ol(r,n);return S.some(il(e,t,o))},cl=function(e,t,n){return(0===ot.children(t).length?al:ul)(e,t,n)},ll=document.caretPositionFromPoint?function(n,e,t){return S.from(n.dom().caretPositionFromPoint(e,t)).bind(function(e){if(null===e.offsetNode)return S.none();var t=n.dom().createRange();return t.setStart(e.offsetNode,e.offset),t.collapse(),S.some(t)})}:document.caretRangeFromPoint?function(e,t,n){return S.from(e.dom().caretRangeFromPoint(t,n))}:function(n,r,o){return le.fromPoint(n,r,o).bind(function(e){var t=function(){return cl(n,e,r)};return 0===ot.children(e).length?t():function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return rl(e,t,u,a)}(n,e,r,o).orThunk(t)})},fl=function(e,t,n){var r=le.fromDom(e.document);return ll(r,t,n).map(function(e){return jc.range(le.fromDom(e.startContainer),e.startOffset,le.fromDom(e.endContainer),e.endOffset)})},sl=function(e,t){var n=mt.name(e);return"input"===n?Lc.after(e):E(["br","img"],n)?0===t?Lc.before(e):Lc.after(e):Lc.on(e,t)},dl=function(e,t){var n=e.fold(Lc.before,sl,Lc.after),r=t.fold(Lc.before,sl,Lc.after);return jc.relative(n,r)},ml=function(e,t,n,r){var o=sl(e,t),i=sl(n,r);return jc.relative(o,i)},gl=function(e){return e.match({domRange:function(e){var t=le.fromDom(e.startContainer),n=le.fromDom(e.endContainer);return ml(t,e.startOffset,n,e.endOffset)},relative:dl,exact:ml})},hl=dl,pl=ml,vl=function(e,t){S.from(e.getSelection()).each(function(e){e.removeAllRanges(),e.addRange(t)})},bl=function(e,t,n,r,o){var i=Yc.exactToNative(e,t,n,r,o);vl(e,i)},wl=function(s,e){return $c.diagnose(s,e).match({ltr:function(e,t,n,r){bl(s,e,t,n,r)},rtl:function(e,t,n,r){var o,i,u,a,c,l=s.getSelection();if(l.setBaseAndExtent)l.setBaseAndExtent(e.dom(),t,n.dom(),r);else if(l.extend)try{i=e,u=t,a=n,c=r,(o=l).collapse(i.dom(),u),o.extend(a.dom(),c)}catch(f){bl(s,n,r,e,t)}else bl(s,n,r,e,t)}})},yl=function(e){var t=le.fromDom(e.anchorNode),n=le.fromDom(e.focusNode);return Hc(t,e.anchorOffset,n,e.focusOffset)?S.some(jc.range(le.fromDom(e.anchorNode),e.anchorOffset,le.fromDom(e.focusNode),e.focusOffset)):function(e){if(0<e.rangeCount){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return S.some(jc.range(le.fromDom(t.startContainer),t.startOffset,le.fromDom(n.endContainer),n.endOffset))}return S.none()}(e)},xl=function(e){return S.from(e.getSelection()).filter(function(e){return 0<e.rangeCount}).bind(yl)},Cl=function(e,t,n,r,o){var i=pl(t,n,r,o);wl(e,i)},Rl=function(e){return xl(e).map(function(e){return jc.exact(e.start(),e.soffset(),e.finish(),e.foffset())})},Sl=function(e,t,n){var r=hl(t,n);wl(e,r)},Tl=function(e){var o=jc.getWin(e).dom(),t=function(e,t,n,r){return Yc.exactToNative(o,e,t,n,r)},n=gl(e);return $c.diagnose(o,n).match({ltr:t,rtl:t})},Nl=function(e,t){var n=Yc.selectNodeContents(e,t);vl(e,n)},Dl=function(e){e.getSelection().removeAllRanges()},El=function(e,t){var n=$c.asLtrRange(e,t);return Yc.getFirstRect(n)},Ol=function(e,t,n){return fl(e,t,n)},Al=tinymce.util.Tools.resolve("tinymce.util.VK"),kl=function(e,t,n,r){return Ml(e,t,Mc(n),r)},Pl=function(e,t,n,r){return Ml(e,t,Wc(n),r)},Il=function(e,t){var n=jc.exact(t,0,t,0);return Tl(n)},Bl=function(e,t){var n,r=St.descendants(t,"tr");return(n=r,0===n.length?S.none():S.some(n[n.length-1])).bind(function(e){return Wt.descendant(e,"td,th").map(function(e){return Il(0,e)})})},Ml=function(r,e,t,o,n){return t.fold(S.none,S.none,function(e,t){return Rn.first(t).map(function(e){return Il(0,e)})},function(n){return zt.table(n,e).bind(function(e){var t=Mr.noMenu(n);return r.undoManager.transact(function(){o.insertRowsAfter(e,t)}),Bl(0,e)})})},Wl=["table","li","dl"],_l=function(t,n,r,o){if(t.keyCode===Al.TAB){var i=ia(n),u=function(e){var t=mt.name(e);return $e.eq(e,i)||E(Wl,t)},e=n.selection.getRng();if(e.collapsed){var a=le.fromDom(e.startContainer);zt.cell(a,u).each(function(e){t.preventDefault(),(t.shiftKey?Pl:kl)(n,u,e,r,o).each(function(e){n.selection.setRng(e)})})}}},Ll={response:X("selection","kill")},ql=function(t){return function(e){return e===t}},Fl=ql(38),jl=ql(40),zl={ltr:{isBackward:ql(37),isForward:ql(39)},rtl:{isBackward:ql(39),isForward:ql(37)},isUp:Fl,isDown:jl,isNavigation:function(e){return 37<=e&&e<=40}},Hl=function(e,t){var n=$c.asLtrRange(e,t);return{start:C(le.fromDom(n.startContainer)),soffset:C(n.startOffset),finish:C(le.fromDom(n.endContainer)),foffset:C(n.endOffset)}},Ul=function(e,t,n,r){return{start:C(Lc.on(e,t)),finish:C(Lc.on(n,r))}},Vl=(Xe.detect().browser.isSafari(),function(e){var t=e!==undefined?e.dom():document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return ao(n,r)}),Gl=Vl,Yl=function(e,t,n){(n!==undefined?n.dom():document).defaultView.scrollBy(e,t)};function Xl(i){return{elementFromPoint:function(e,t){return le.fromPoint(le.fromDom(i.document),e,t)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,t,n,r){var o=jc.exact(e,t,n,r);return El(i,o).map(function(e){return G(e,a)})},getSelection:function(){return Rl(i).map(function(e){return Hl(i,e)})},fromSitus:function(e){var t=jc.relative(e.start(),e.finish());return Hl(i,t)},situsFromPoint:function(e,t){return Ol(i,e,t).map(function(e){return{start:C(Lc.on(e.start(),e.soffset())),finish:C(Lc.on(e.finish(),e.foffset()))}})},clearSelection:function(){Dl(i)},setSelection:function(e){Cl(i,e.start(),e.soffset(),e.finish(),e.foffset())},setRelativeSelection:function(e,t){Sl(i,e,t)},selectContents:function(e){Nl(i,e)},getInnerHeight:function(){return i.innerHeight},getScrollY:function(){return Gl(le.fromDom(i.document)).top()},scrollBy:function(e,t){Yl(e,t,le.fromDom(i.document))}}}var Kl=function(n,e,r,t,o){return $e.eq(r,t)?S.none():pr(r,t,e).bind(function(e){var t=e.boxes().getOr([]);return 0<t.length?(o(n,t,e.start(),e.finish()),S.some(Ll.response(S.some(Ul(r,0,r,yn(r))),!0))):S.none()})},Jl={sync:function(n,r,e,t,o,i,u){return $e.eq(e,o)&&t===i?S.none():Wt.closest(e,"td,th",r).bind(function(t){return Wt.closest(o,"td,th",r).bind(function(e){return Kl(n,r,t,e,u)})})},detect:Kl,update:function(e,t,n,r,o){return br(r,e,t,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(e){return o.clear(n),o.selectRange(n,e.boxes(),e.start(),e.finish()),e.boxes()})}},$l=ee(["left","top","right","bottom"],[]),Ql={nu:$l,moveUp:function(e,t){return $l({left:e.left(),top:e.top()-t,right:e.right(),bottom:e.bottom()-t})},moveDown:function(e,t){return $l({left:e.left(),top:e.top()+t,right:e.right(),bottom:e.bottom()+t})},moveBottomTo:function(e,t){var n=e.bottom()-e.top();return $l({left:e.left(),top:t-n,right:e.right(),bottom:t})},moveTopTo:function(e,t){var n=e.bottom()-e.top();return $l({left:e.left(),top:t,right:e.right(),bottom:t+n})},getTop:function(e){return e.top()},getBottom:function(e){return e.bottom()},translate:function(e,t,n){return $l({left:e.left()+t,top:e.top()+n,right:e.right()+t,bottom:e.bottom()+n})},toString:function(e){return"("+e.left()+", "+e.top()+") -> ("+e.right()+", "+e.bottom()+")"}},Zl=function(e){return Ql.nu({left:e.left,top:e.top,right:e.right,bottom:e.bottom})},ef=function(e,t){return S.some(e.getRect(t))},tf=function(e,t,n){return mt.isElement(t)?ef(e,t).map(Zl):mt.isText(t)?(r=e,o=t,i=n,0<=i&&i<yn(o)?r.getRangedRect(o,i,o,i+1):0<i?r.getRangedRect(o,i-1,o,i):S.none()).map(Zl):S.none();var r,o,i},nf=function(e,t){return mt.isElement(t)?ef(e,t).map(Zl):mt.isText(t)?e.getRangedRect(t,0,t,yn(t)).map(Zl):S.none()},rf=X("item","mode"),of=function(e,t,n,r){var o=r!==undefined?r:uf;return e.property().parent(t).map(function(e){return rf(e,o)})},uf=function(e,t,n,r){var o=r!==undefined?r:af;return n.sibling(e,t).map(function(e){return rf(e,o)})},af=function(e,t,n,r){var o=r!==undefined?r:af,i=e.property().children(t);return n.first(i).map(function(e){return rf(e,o)})},cf=[{current:of,next:uf,fallback:S.none()},{current:uf,next:af,fallback:S.some(of)},{current:af,next:af,fallback:S.some(uf)}],lf=function(t,n,r,o,e){return e=e!==undefined?e:cf,M(e,function(e){return e.current===r}).bind(function(e){return e.current(t,n,o,e.next).orThunk(function(){return e.fallback.bind(function(e){return lf(t,n,e,o)})})})},ff={backtrack:of,sidestep:uf,advance:af,go:lf},sf={left:function(){return{sibling:function(e,t){return e.query().prevSibling(t)},first:function(e){return 0<e.length?S.some(e[e.length-1]):S.none()}}},right:function(){return{sibling:function(e,t){return e.query().nextSibling(t)},first:function(e){return 0<e.length?S.some(e[0]):S.none()}}}},df=function(t,e,n,r,o,i){return ff.go(t,e,r,o).bind(function(e){return i(e.item())?S.none():n(e.item())?S.some(e.item()):df(t,e.item(),n,e.mode(),o,i)})},mf=function(e,t,n,r){return df(e,t,n,ff.sidestep,sf.left(),r)},gf=function(e,t,n,r){return df(e,t,n,ff.sidestep,sf.right(),r)},hf=function(e,t){return 0===e.property().children(t).length},pf=function(e,t,n,r){return mf(e,t,n,r)},vf=function(e,t,n,r){return gf(e,t,n,r)},bf={before:function(e,t,n){return pf(e,t,R(hf,e),n)},after:function(e,t,n){return vf(e,t,R(hf,e),n)},seekLeft:pf,seekRight:vf,walkers:function(){return{left:sf.left,right:sf.right}},walk:function(e,t,n,r,o){return ff.go(e,t,n,r,o)},backtrack:ff.backtrack,sidestep:ff.sidestep,advance:ff.advance},wf=Pn(),yf={gather:function(e,t,n){return bf.gather(wf,e,t,n)},before:function(e,t){return bf.before(wf,e,t)},after:function(e,t){return bf.after(wf,e,t)},seekLeft:function(e,t,n){return bf.seekLeft(wf,e,t,n)},seekRight:function(e,t,n){return bf.seekRight(wf,e,t,n)},walkers:function(){return bf.walkers()},walk:function(e,t,n,r){return bf.walk(wf,e,t,n,r)}},xf=Nr([{none:[]},{retry:["caret"]}]),Cf=function(t,e,r){return Bt.closest(e,Ho).fold(C(!1),function(e){return nf(t,e).exists(function(e){return n=e,(t=r).left()<n.left()||Math.abs(n.right()-t.left())<1||t.left()>n.right();var t,n})})},Rf={point:Ql.getTop,adjuster:function(e,t,n,r,o){var i=Ql.moveUp(o,5);return Math.abs(n.top()-r.top())<1?xf.retry(i):n.bottom()<o.top()?xf.retry(i):n.bottom()===o.top()?xf.retry(Ql.moveUp(o,1)):Cf(e,t,o)?xf.retry(Ql.translate(i,5,0)):xf.none()},move:Ql.moveUp,gather:yf.before},Sf={point:Ql.getBottom,adjuster:function(e,t,n,r,o){var i=Ql.moveDown(o,5);return Math.abs(n.bottom()-r.bottom())<1?xf.retry(i):n.top()>o.bottom()?xf.retry(i):n.top()===o.bottom()?xf.retry(Ql.moveDown(o,1)):Cf(e,t,o)?xf.retry(Ql.translate(i,5,0)):xf.none()},move:Ql.moveDown,gather:yf.after},Tf=function(n,r,o,i,u){return 0===u?S.some(i):(c=n,l=i.left(),f=r.point(i),c.elementFromPoint(l,f).filter(function(e){return"table"===mt.name(e)}).isSome()?(t=i,a=u-1,Tf(n,e=r,o,e.move(t,5),a)):n.situsFromPoint(i.left(),r.point(i)).bind(function(e){return e.start().fold(S.none,function(t,e){return nf(n,t,e).bind(function(e){return r.adjuster(n,t,e,o,i).fold(S.none,function(e){return Tf(n,r,o,e,u-1)})}).orThunk(function(){return S.some(i)})},S.none)}));var e,t,a,c,l,f},Nf=function(t,n,e){var r,o,i,u=t.move(e,5),a=Tf(n,t,e,u,100).getOr(u);return(r=t,o=a,i=n,r.point(o)>i.getInnerHeight()?S.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?S.some(-r.point(o)):S.none()).fold(function(){return n.situsFromPoint(a.left(),t.point(a))},function(e){return n.scrollBy(0,e),n.situsFromPoint(a.left(),t.point(a)-e)})},Df={tryUp:R(Nf,Rf),tryDown:R(Nf,Sf),ieTryUp:function(e,t){return e.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(e,t){return e.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:C(5)},Ef=Nr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Of=function(e){return Wt.closest(e,"tr")},Af={verify:function(a,e,t,n,r,c,o){return Wt.closest(n,"td,th",o).bind(function(u){return Wt.closest(e,"td,th",o).map(function(i){return $e.eq(u,i)?$e.eq(n,u)&&yn(u)===r?c(i):Ef.none("in same cell"):Qn.sharedOne(Of,[u,i]).fold(function(){return t=i,n=u,r=(e=a).getRect(t),(o=e.getRect(n)).right>r.left&&o.left<r.right?Ef.success():c(i);var e,t,n,r,o},function(e){return c(i)})})}).getOr(Ef.none("default"))},cata:function(e,t,n,r,o){return e.fold(t,n,r,o)},adt:Ef},kf={point:X("element","offset"),delta:X("element","deltaOffset"),range:X("element","start","finish"),points:X("begin","end"),text:X("element","text")},Pf=(X("ancestor","descendants","element","index"),X("parent","children","element","index")),If=function(e,t){return W(e,R($e.eq,t))},Bf=function(r){return ot.parent(r).bind(function(t){var n=ot.children(t);return If(n,r).map(function(e){return Pf(t,n,r,e)})})},Mf=function(e){return"br"===mt.name(e)},Wf=function(e,t,n){return t(e,n).bind(function(e){return mt.isText(e)&&0===vn.get(e).trim().length?Wf(e,t,n):S.some(e)})},_f=function(t,e,n,r){return(o=e,i=n,ot.child(o,i).filter(Mf).orThunk(function(){return ot.child(o,i-1).filter(Mf)})).bind(function(e){return r.traverse(e).fold(function(){return Wf(e,r.gather,t).map(r.relative)},function(e){return Bf(e).map(function(e){return Lc.on(e.parent(),e.index())})})});var o,i},Lf=function(e,t,n,r){var o,i,u;return(Mf(t)?(o=e,i=t,(u=r).traverse(i).orThunk(function(){return Wf(i,u.gather,o)}).map(u.relative)):_f(e,t,n,r)).map(function(e){return{start:C(e),finish:C(e)}})},qf=function(e){return Af.cata(e,function(e){return S.none()},function(){return S.none()},function(e){return S.some(kf.point(e,0))},function(e){return S.some(kf.point(e,yn(e)))})},Ff=Xe.detect(),jf=function(r,o,i,u,a,c){return 0===c?S.none():Uf(r,o,i,u,a).bind(function(e){var t=r.fromSitus(e),n=Af.verify(r,i,u,t.finish(),t.foffset(),a.failure,o);return Af.cata(n,function(){return S.none()},function(){return S.some(e)},function(e){return $e.eq(i,e)&&0===u?zf(r,i,u,Ql.moveUp,a):jf(r,o,e,0,a,c-1)},function(e){return $e.eq(i,e)&&u===yn(e)?zf(r,i,u,Ql.moveDown,a):jf(r,o,e,yn(e),a,c-1)})})},zf=function(t,e,n,r,o){return tf(t,e,n).bind(function(e){return Hf(t,o,r(e,Df.getJumpSize()))})},Hf=function(e,t,n){return Ff.browser.isChrome()||Ff.browser.isSafari()||Ff.browser.isFirefox()||Ff.browser.isEdge()?t.otherRetry(e,n):Ff.browser.isIE()?t.ieRetry(e,n):S.none()},Uf=function(t,e,n,r,o){return tf(t,n,r).bind(function(e){return Hf(t,o,e)})},Vf=function(t,n,r){return(o=t,i=n,u=r,o.getSelection().bind(function(r){return Lf(i,r.finish(),r.foffset(),u).fold(function(){return S.some(kf.point(r.finish(),r.foffset()))},function(e){var t=o.fromSitus(e),n=Af.verify(o,r.finish(),r.foffset(),t.finish(),t.foffset(),u.failure,i);return qf(n)})})).bind(function(e){return jf(t,n,e.element(),e.offset(),r,20).map(t.fromSitus)});var o,i,u},Gf=function(e,t,n){return Bt.ancestor(e,t,n).isSome()},Yf=Xe.detect(),Xf=function(r,o,i,e,u){return Wt.closest(e,"td,th",o).bind(function(n){return Wt.closest(n,"table",o).bind(function(e){return t=e,Gf(u,function(e){return ot.parent(e).exists(function(e){return $e.eq(e,t)})})?Vf(r,o,i).bind(function(t){return Wt.closest(t.finish(),"td,th",o).map(function(e){return{start:C(n),finish:C(e),range:C(t)}})}):S.none();var t})})},Kf=function(e,t,n,r,o,i){return Yf.browser.isIE()?S.none():i(r,t).orThunk(function(){return Xf(e,t,n,r,o).map(function(e){var t=e.range();return Ll.response(S.some(Ul(t.start(),t.soffset(),t.finish(),t.foffset())),!0)})})},Jf=function(e,t,n,r,o,i,u){return Xf(e,n,r,o,i).bind(function(e){return Jl.detect(t,n,e.start(),e.finish(),u)})},$f=function(e,r){return Wt.closest(e,"tr",r).bind(function(n){return Wt.closest(n,"table",r).bind(function(e){var t=St.descendants(e,"tr");return $e.eq(n,t[0])?yf.seekLeft(e,function(e){return Rn.last(e).isSome()},r).map(function(e){var t=yn(e);return Ll.response(S.some(Ul(e,t,e,t)),!0)}):S.none()})})},Qf=function(e,r){return Wt.closest(e,"tr",r).bind(function(n){return Wt.closest(n,"table",r).bind(function(e){var t=St.descendants(e,"tr");return $e.eq(n,t[t.length-1])?yf.seekRight(e,function(e){return Rn.first(e).isSome()},r).map(function(e){return Ll.response(S.some(Ul(e,0,e,0)),!0)}):S.none()})})},Zf=function(e,t){return Wt.closest(e,"td,th",t)},es={down:{traverse:ot.nextSibling,gather:yf.after,relative:Lc.before,otherRetry:Df.tryDown,ieRetry:Df.ieTryDown,failure:Af.adt.failedDown},up:{traverse:ot.prevSibling,gather:yf.before,relative:Lc.before,otherRetry:Df.tryUp,ieRetry:Df.ieTryUp,failure:Af.adt.failedUp}},ts=X("rows","cols"),ns={mouse:function(e,t,n,r){var o,i,u,a,c,l,f=Xl(e),s=(o=f,i=t,u=n,a=r,c=S.none(),l=function(){c=S.none()},{mousedown:function(e){a.clear(i),c=Zf(e.target(),u)},mouseover:function(e){c.each(function(r){a.clear(i),Zf(e.target(),u).each(function(n){pr(r,n,u).each(function(e){var t=e.boxes().getOr([]);(1<t.length||1===t.length&&!$e.eq(r,n))&&(a.selectRange(i,t,e.start(),e.finish()),o.selectContents(n))})})})},mouseup:function(){c.each(l)}});return{mousedown:s.mousedown,mouseover:s.mouseover,mouseup:s.mouseup}},keyboard:function(e,c,l,f){var s=Xl(e),d=function(){return f.clear(c),S.none()};return{keydown:function(e,t,n,r,o,i){var u=e.raw().which,a=!0===e.raw().shiftKey;return vr(c,f.selectedSelector()).fold(function(){return zl.isDown(u)&&a?R(Jf,s,c,l,es.down,r,t,f.selectRange):zl.isUp(u)&&a?R(Jf,s,c,l,es.up,r,t,f.selectRange):zl.isDown(u)?R(Kf,s,l,es.down,r,t,Qf):zl.isUp(u)?R(Kf,s,l,es.up,r,t,$f):S.none},function(t){var e=function(e){return function(){return Jo(e,function(e){return Jl.update(e.rows(),e.cols(),c,t,f)}).fold(function(){return wr(c,f.firstSelectedSelector(),f.lastSelectedSelector()).map(function(e){var t=zl.isDown(u)||i.isForward(u)?Lc.after:Lc.before;return s.setRelativeSelection(Lc.on(e.first(),0),t(e.table())),f.clear(c),Ll.response(S.none(),!0)})},function(e){return S.some(Ll.response(S.none(),!0))})}};return zl.isDown(u)&&a?e([ts(1,0)]):zl.isUp(u)&&a?e([ts(-1,0)]):i.isBackward(u)&&a?e([ts(0,-1),ts(-1,0)]):i.isForward(u)&&a?e([ts(0,1),ts(1,0)]):zl.isNavigation(u)&&!1===a?d:S.none})()},keyup:function(t,n,r,o,i){return vr(c,f.selectedSelector()).fold(function(){var e=t.raw().which;return 0==(!0===t.raw().shiftKey)?S.none():zl.isNavigation(e)?Jl.sync(c,l,n,r,o,i,f.selectRange):S.none()},S.none)}}}},rs=function(t,e){k(e,function(e){Ai.remove(t,e)})},os=function(t){return function(e){Ai.add(e,t)}},is=function(t){return function(e){rs(e,t)}},us={byClass:function(o){var i=os(o.selected()),n=is([o.selected(),o.lastSelected(),o.firstSelected()]),u=function(e){var t=St.descendants(e,o.selectedSelector());k(t,n)};return{clear:u,selectRange:function(e,t,n,r){u(e),k(t,i),Ai.add(n,o.firstSelected()),Ai.add(r,o.lastSelected())},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}},byAttr:function(o){var n=function(e){bt.remove(e,o.selected()),bt.remove(e,o.firstSelected()),bt.remove(e,o.lastSelected())},i=function(e){bt.set(e,o.selected(),"1")},u=function(e){var t=St.descendants(e,o.selectedSelector());k(t,n)};return{clear:u,selectRange:function(e,t,n,r){u(e),k(t,i),bt.set(n,o.firstSelected(),"1"),bt.set(r,o.lastSelected(),"1")},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}},as=function(e){return!1===Ai.has(le.fromDom(e.target),"ephox-snooker-resizer-bar")};function cs(h,p){var v=ee(["mousedown","mouseover","mouseup","keyup","keydown"],[]),b=S.none(),w=us.byAttr(Tr);return h.on("init",function(e){var r=h.getWin(),o=ia(h),t=ca(h),n=ns.mouse(r,o,t,w),a=ns.keyboard(r,o,t,w),c=function(e,t){!0===e.raw().shiftKey&&(t.kill()&&e.kill(),t.selection().each(function(e){var t=jc.relative(e.start(),e.finish()),n=$c.asLtrRange(r,t);h.selection.setRng(n)}))},i=function(e){var t=f(e);if(t.raw().shiftKey&&zl.isNavigation(t.raw().which)){var n=h.selection.getRng(),r=le.fromDom(n.startContainer),o=le.fromDom(n.endContainer);a.keyup(t,r,n.startOffset,o,n.endOffset).each(function(e){c(t,e)})}},u=function(e){var t=f(e);p().each(function(e){e.hideBars()});var n=h.selection.getRng(),r=le.fromDom(h.selection.getStart()),o=le.fromDom(n.startContainer),i=le.fromDom(n.endContainer),u=ha.directionAt(r).isRtl()?zl.rtl:zl.ltr;a.keydown(t,o,n.startOffset,i,n.endOffset,u).each(function(e){c(t,e)}),p().each(function(e){e.showBars()})},l=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},f=function(e){var t=le.fromDom(e.target),n=function(){e.stopPropagation()},r=function(){e.preventDefault()},o=x(r,n);return{target:C(t),x:C(l(e)?e.x:null),y:C(l(e)?e.y:null),stop:n,prevent:r,kill:o,raw:C(e)}},s=function(e){return 0===e.button},d=function(e){s(e)&&as(e)&&n.mousedown(f(e))},m=function(e){var t;(t=e).buttons!==undefined&&0==(1&t.buttons)||!as(e)||n.mouseover(f(e))},g=function(e){s(e)&&as(e)&&n.mouseup(f(e))};h.on("mousedown",d),h.on("mouseover",m),h.on("mouseup",g),h.on("keyup",i),h.on("keydown",u),h.on("nodechange",function(){var e=h.selection,t=le.fromDom(e.getStart()),n=le.fromDom(e.getEnd());Qn.sharedOne(zt.table,[t,n]).fold(function(){w.clear(o)},y)}),b=S.some(v({mousedown:d,mouseover:m,mouseup:g,keyup:i,keydown:u}))}),{clear:w.clear,destroy:function(){b.each(function(e){})}}}var ls=Ia.each,fs=function(t){var n=[];function e(e){return function(){t.execCommand(e)}}ls("inserttable tableprops deletetable | cell row column".split(" "),function(e){"|"===e?n.push({text:"-"}):n.push(t.menuItems[e])}),t.addButton("table",{type:"menubutton",title:"Table",menu:n}),t.addButton("tableprops",{title:"Table properties",onclick:e("mceTableProps"),icon:"table"}),t.addButton("tabledelete",{title:"Delete table",onclick:e("mceTableDelete")}),t.addButton("tablecellprops",{title:"Cell properties",onclick:e("mceTableCellProps")}),t.addButton("tablemergecells",{title:"Merge cells",onclick:e("mceTableMergeCells")}),t.addButton("tablesplitcells",{title:"Split cell",onclick:e("mceTableSplitCells")}),t.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:e("mceTableInsertRowBefore")}),t.addButton("tableinsertrowafter",{title:"Insert row after",onclick:e("mceTableInsertRowAfter")}),t.addButton("tabledeleterow",{title:"Delete row",onclick:e("mceTableDeleteRow")}),t.addButton("tablerowprops",{title:"Row properties",onclick:e("mceTableRowProps")}),t.addButton("tablecutrow",{title:"Cut row",onclick:e("mceTableCutRow")}),t.addButton("tablecopyrow",{title:"Copy row",onclick:e("mceTableCopyRow")}),t.addButton("tablepasterowbefore",{title:"Paste row before",onclick:e("mceTablePasteRowBefore")}),t.addButton("tablepasterowafter",{title:"Paste row after",onclick:e("mceTablePasteRowAfter")}),t.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:e("mceTableInsertColBefore")}),t.addButton("tableinsertcolafter",{title:"Insert column after",onclick:e("mceTableInsertColAfter")}),t.addButton("tabledeletecol",{title:"Delete column",onclick:e("mceTableDeleteCol")})},ss=function(t){var e,n=""===(e=t.getParam("table_toolbar",pa))||!1===e?[]:v(e)?e.split(/[ ,]/):b(e)?e:[];0<n.length&&t.addContextToolbar(function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},n.join(" "))},ds=function(o,n){var r=S.none(),i=[],u=[],a=[],c=[],l=function(e){e.disabled(!0)},f=function(e){e.disabled(!1)},e=function(){var t=this;i.push(t),r.fold(function(){l(t)},function(e){f(t)})},t=function(){var t=this;u.push(t),r.fold(function(){l(t)},function(e){f(t)})};o.on("init",function(){o.on("nodechange",function(e){var t=S.from(o.dom.getParent(o.selection.getStart(),"th,td"));(r=t.bind(function(e){var t=le.fromDom(e);return zt.table(t).map(function(e){return Mr.forMenu(n,e,t)})})).fold(function(){k(i,l),k(u,l),k(a,l),k(c,l)},function(t){k(i,f),k(u,f),k(a,function(e){e.disabled(t.mergable().isNone())}),k(c,function(e){e.disabled(t.unmergable().isNone())})})})});var s=function(e,t,n,r){var o,i,u,a,c,l=r.getEl().getElementsByTagName("table")[0],f=r.isRtl()||"tl-tr"===r.parent().rel;for(l.nextSibling.innerHTML=t+1+" x "+(n+1),f&&(t=9-t),i=0;i<10;i++)for(o=0;o<10;o++)a=l.rows[i].childNodes[o].firstChild,c=(f?t<=o:o<=t)&&i<=n,e.dom.toggleClass(a,"mce-active",c),c&&(u=a);return u.parentNode},d=!1===o.getParam("table_grid",!0,"boolean")?{text:"Table",icon:"table",context:"table",onclick:m("mceInsertTable")}:{text:"Table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(e){e.aria&&(this.parent().hideAll(),e.stopImmediatePropagation(),o.execCommand("mceInsertTable"))},onshow:function(){s(o,0,0,this.menu.items()[0])},onhide:function(){var e=this.menu.items()[0].getEl().getElementsByTagName("a");o.dom.removeClass(e,"mce-active"),o.dom.addClass(e[0],"mce-active")},menu:[{type:"container",html:function(){var e="";e='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var t=0;t<10;t++){e+="<tr>";for(var n=0;n<10;n++)e+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*t+n)+'" href="#" data-mce-x="'+n+'" data-mce-y="'+t+'"></a></td>';e+="</tr>"}return e+="</table>",e+='<div class="mce-text-center" role="presentation">1 x 1</div>'}(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(e){var t,n,r=e.target;"A"===r.tagName.toUpperCase()&&(t=parseInt(r.getAttribute("data-mce-x"),10),n=parseInt(r.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"===this.parent().rel)&&(t=9-t),t===this.lastX&&n===this.lastY||(s(o,t,n,e.control),this.lastX=t,this.lastY=n))},onclick:function(e){var t=this;"A"===e.target.tagName.toUpperCase()&&(e.preventDefault(),e.stopPropagation(),t.parent().cancel(),o.undoManager.transact(function(){Qa(o,t.lastX+1,t.lastY+1)}),o.addVisual())}}]};function m(e){return function(){o.execCommand(e)}}var g={text:"Table properties",context:"table",onPostRender:e,onclick:m("mceTableProps")},h={text:"Delete table",context:"table",onPostRender:e,cmd:"mceTableDelete"},p={text:"Row",context:"table",menu:[{text:"Insert row before",onclick:m("mceTableInsertRowBefore"),onPostRender:t},{text:"Insert row after",onclick:m("mceTableInsertRowAfter"),onPostRender:t},{text:"Delete row",onclick:m("mceTableDeleteRow"),onPostRender:t},{text:"Row properties",onclick:m("mceTableRowProps"),onPostRender:t},{text:"-"},{text:"Cut row",onclick:m("mceTableCutRow"),onPostRender:t},{text:"Copy row",onclick:m("mceTableCopyRow"),onPostRender:t},{text:"Paste row before",onclick:m("mceTablePasteRowBefore"),onPostRender:t},{text:"Paste row after",onclick:m("mceTablePasteRowAfter"),onPostRender:t}]},v={text:"Column",context:"table",menu:[{text:"Insert column before",onclick:m("mceTableInsertColBefore"),onPostRender:t},{text:"Insert column after",onclick:m("mceTableInsertColAfter"),onPostRender:t},{text:"Delete column",onclick:m("mceTableDeleteCol"),onPostRender:t}]},b={separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:m("mceTableCellProps"),onPostRender:t},{text:"Merge cells",onclick:m("mceTableMergeCells"),onPostRender:function(){var t=this;a.push(t),r.fold(function(){l(t)},function(e){t.disabled(e.mergable().isNone())})}},{text:"Split cell",onclick:m("mceTableSplitCells"),onPostRender:function(){var t=this;c.push(t),r.fold(function(){l(t)},function(e){t.disabled(e.unmergable().isNone())})}}]};o.addMenuItem("inserttable",d),o.addMenuItem("tableprops",g),o.addMenuItem("deletetable",h),o.addMenuItem("row",p),o.addMenuItem("column",v),o.addMenuItem("cell",b)},ms=function(n,r){return{insertTable:function(e,t){return Qa(n,e,t)},setClipboardRows:function(e){return t=r,n=A(e,le.fromDom),void t.set(S.from(n));var t,n},getClipboardRows:function(){return r.get().fold(function(){},function(e){return A(e,function(e){return e.dom()})})}}};i.add("table",function(t){var n,r=Ec(t),e=cs(t,r.lazyResize),o=ka(t,r.lazyWire),i=(n=t,{get:function(){var e=ia(n);return yr(e,Tr.selectedSelector()).fold(function(){return n.selection.getStart()===undefined?Er.none():Er.single(n.selection)},function(e){return Er.multiple(e)})}}),u=Do(S.none());return rc(t,o,e,i,u),Wr(t,i,o,e),ds(t,i),fs(t),ss(t),t.on("PreInit",function(){t.serializer.addTempAttr(Tr.firstSelected()),t.serializer.addTempAttr(Tr.lastSelected())}),t.getParam("table_tab_navigation",!0,"boolean")&&t.on("keydown",function(e){_l(e,t,o,r.lazyWire)}),t.on("remove",function(){r.destroy(),e.destroy()}),ms(t,u)})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.EditorManager"),s=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),d=function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))},m=t.DOM,n=function(e){e.keyCode!==f.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==f.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=y.explode(d(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):m.get(e[0]):":next"===e[1]?u(1):m.get(e[1]))){var t=c.get(o.id||o.name);o.id&&t?t.focus():a.setTimeout(function(){s.webkit||window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(t){return/INPUT|TEXTAREA|BUTTON/.test(t.tagName)&&c.get(n.id)&&-1!==t.tabIndex&&function e(t){return"BODY"===t.nodeName||"hidden"!==t.type&&"none"!==t.style.display&&"hidden"!==t.style.visibility&&e(t.parentNode)}(t)}if(o=m.select(":input:enabled,*[tabindex]:not(iframe)"),y.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0<e){for(l=i+1;l<o.length;l++)if(t(o[l]))return o[l]}else for(l=i-1;0<=l;l--)if(t(o[l]))return o[l];return null}}r.on("init",function(){r.inline&&m.setAttrib(r.getBody(),"tabIndex",null),r.on("keyup",n),s.gecko?r.on("keypress keydown",e):r.on("keydown",e)})};e.add("tabfocus",function(e){i(e)})}();!function(){"use strict";var u=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return u(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(e){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(e.settings.plugins)||!t.get("powerpaste")||("undefined"!=typeof window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},s=function(e,t){return{clipboard:e,quirks:t}},f=function(e,t,n,r){return e.fire("PastePreProcess",{content:t,internal:n,wordContent:r})},d=function(e,t,n,r){return e.fire("PastePostProcess",{node:t,internal:n,wordContent:r})},l=function(e,t){return e.fire("PastePlainTextToggle",{state:t})},n=function(e,t){return e.fire("paste",{ieFake:t})},m={shouldPlainTextInform:function(e){return e.getParam("paste_plaintext_inform",!0)},shouldBlockDrop:function(e){return e.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(e){return e.getParam("paste_data_images",!1)},shouldFilterDrop:function(e){return e.getParam("paste_filter_drop",!0)},getPreProcess:function(e){return e.getParam("paste_preprocess")},getPostProcess:function(e){return e.getParam("paste_postprocess")},getWebkitStyles:function(e){return e.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(e){return e.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(e){return e.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(e){return e.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(e){return e.getParam("paste_as_text",!1)},getRetainStyleProps:function(e){return e.getParam("paste_retain_style_properties")},getWordValidElements:function(e){return e.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")},shouldConvertWordFakeLists:function(e){return e.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(e){return e.getParam("paste_enable_default_filters",!0)}},r=function(e,t,n){var r,a,i;"text"===t.pasteFormat.get()?(t.pasteFormat.set("html"),l(e,!1)):(t.pasteFormat.set("text"),l(e,!0),i=e,!1===n.get()&&m.shouldPlainTextInform(i)&&(a="Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",(r=e).notificationManager.open({text:r.translate(a),type:"info"}),n.set(!0))),e.focus()},c=function(e,n,t){e.addCommand("mceTogglePlainTextPaste",function(){r(e,n,t)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&n.pasteHtml(t.content,t.internal),t.text&&n.pasteText(t.text)})},v=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Delay"),b=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=tinymce.util.Tools.resolve("tinymce.util.VK"),e="x-tinymce/html",i="\x3c!-- "+e+" --\x3e",p=function(e){return i+e},g=function(e){return e.replace(i,"")},y=function(e){return-1!==e.indexOf(i)},x=function(){return e},P=tinymce.util.Tools.resolve("tinymce.html.Entities"),w=function(e){return e.replace(/\r?\n/g,"<br>")},_=function(e,t,n){var r=e.split(/\n\n/),a=function(e,t){var n,r=[],a="<"+e;if("object"==typeof t){for(n in t)t.hasOwnProperty(n)&&r.push(n+'="'+P.encodeAllRaw(t[n])+'"');r.length&&(a+=" "+r.join(" "))}return a+">"}(t,n),i="</"+t+">",o=b.map(r,function(e){return e.split(/\n/).join("<br />")});return 1===o.length?o[0]:b.map(o,function(e){return a+e+i}).join("")},D=function(e){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e)},T=function(e,t,n){return t?_(e,t,n):w(e)},C=tinymce.util.Tools.resolve("tinymce.html.DomParser"),k=tinymce.util.Tools.resolve("tinymce.html.Node"),R=tinymce.util.Tools.resolve("tinymce.html.Schema"),F=tinymce.util.Tools.resolve("tinymce.html.Serializer");function E(t,e){return b.each(e,function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}var S={filter:E,innerText:function(t){var n=R(),r=C({},n),a="",i=n.getShortEndedElements(),o=b.makeMap("script noscript style textarea video audio iframe object"," "),s=n.getBlockElements();return t=E(t,[/<!\[[^\]]+\]>/g]),function e(t){var n=t.name,r=t;if("br"!==n)if(i[n]&&(a+=" "),o[n])a+=" ";else{if(3===t.type&&(a+=t.value),!t.shortEnded&&(t=t.firstChild))for(;e(t),t=t.next;);s[n]&&r.next&&(a+="\n","p"===n&&(a+="\n"))}else a+="\n"}(r.parse(t)),a},trimHtml:function(e){return e=E(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function(e){var t=0;return function(){return e+t++}},isMsEdge:function(){return-1!==navigator.userAgent.indexOf(" Edge/")}};function I(t){var n,e;return e=[/^[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]/],t=t.replace(/^[\u00a0 ]+/,""),b.each(e,function(e){if(e.test(t))return!(n=!0)}),n}function M(e){var i,o,s=1;function n(e){var t="";if(3===e.type)return e.value;if(e=e.firstChild)for(;t+=n(e),e=e.next;);return t}function l(e,t){if(3===e.type&&t.test(e.value))return e.value=e.value.replace(t,""),!1;if(e=e.firstChild)do{if(!l(e,t))return!1}while(e=e.next);return!0}function t(t,n,r){var a=t._listLevel||s;a!==s&&(a<s?i&&(i=i.parent.parent):(o=i,i=null)),i&&i.name===n?i.append(t):(o=o||i,i=new k(n,1),1<r&&i.attr("start",""+r),t.wrap(i)),t.name="li",s<a&&o&&o.lastChild.append(i),s=a,function e(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)for(;e(t),t=t.next;);}(t),l(t,/^\u00a0+/),l(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),l(t,/^\u00a0+/)}for(var r=[],a=e.firstChild;null!=a;)if(r.push(a),null!==(a=a.walk()))for(;void 0!==a&&a.parent!==e;)a=a.walk();for(var u=0;u<r.length;u++)if("p"===(e=r[u]).name&&e.firstChild){var c=n(e);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(c)){t(e,"ul");continue}if(I(c)){var f=/([0-9]+)\./.exec(c),d=1;f&&(d=parseInt(f[1],10)),t(e,"ol",d);continue}if(e._listLevel){t(e,"ul",1);continue}i=null}else o=i,i=null}function O(n,r,a,i){var o,s={},e=n.dom.parseStyle(i);return b.each(e,function(e,t){switch(t){case"mso-list":(o=/\w+ \w+([0-9]+)/i.exec(i))&&(a._listLevel=parseInt(o[1],10)),/Ignore/i.test(e)&&a.firstChild&&(a._listIgnore=!0,a.firstChild._listIgnore=!0);break;case"horiz-align":t="text-align";break;case"vert-align":t="vertical-align";break;case"font-color":case"mso-foreground":t="color";break;case"mso-background":case"mso-highlight":t="background";break;case"font-weight":case"font-style":return void("normal"!==e&&(s[t]=e));case"mso-element":if(/^(comment|comment-list)$/i.test(e))return void a.remove()}0!==t.indexOf("mso-comment")?0!==t.indexOf("mso-")&&("all"===m.getRetainStyleProps(n)||r&&r[t])&&(s[t]=e):a.remove()}),/(bold)/i.test(s["font-weight"])&&(delete s["font-weight"],a.wrap(new k("b",1))),/(italic)/i.test(s["font-style"])&&(delete s["font-style"],a.wrap(new k("i",1))),(s=n.dom.serializeStyle(s,a.name))||null}var A={preProcess:function(e,t){return m.shouldUseDefaultFilters(e)?function(r,e){var t,a;(t=m.getRetainStyleProps(r))&&(a=b.makeMap(t.split(/[, ]/))),e=S.filter(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>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return 0<t.length?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var n=m.getWordValidElements(r),i=R({valid_elements:n,valid_children:"-li[p]"});b.each(i.elements,function(e){e.attributes["class"]||(e.attributes["class"]={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))});var o=C({},i);o.addAttributeFilter("style",function(e){for(var t,n=e.length;n--;)(t=e[n]).attr("style",O(r,a,t,t.attr("style"))),"span"===t.name&&t.parent&&!t.attributes.length&&t.unwrap()}),o.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)n=(t=e[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&t.remove(),t.attr("class",null)}),o.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),o.addNodeFilter("a",function(e){for(var t,n,r,a=e.length;a--;)if(n=(t=e[a]).attr("href"),r=t.attr("name"),n&&-1!==n.indexOf("#_msocom_"))t.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){t.unwrap();continue}t.attr({href:n,name:r})}else t.unwrap()});var s=o.parse(e);return m.shouldConvertWordFakeLists(r)&&M(s),e=F({validate:r.settings.validate},i).serialize(s)}(e,t):t},isWordContent:function(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e)||/class="OutlineElement/.test(e)||/id="?docs\-internal\-guid\-/.test(e)}},H=function(e,t){return{content:e,cancelled:t}},B=function(e,t,n,r){var a,i,o,s,l,u,c=f(e,t,n,r);return e.hasEventListeners("PastePostProcess")&&!c.isDefaultPrevented()?(a=e,i=c.content,o=n,s=r,l=a.dom.create("div",{style:"display:none"},i),u=d(a,l,o,s),H(u.node.innerHTML,u.isDefaultPrevented())):H(c.content,c.isDefaultPrevented())},L=function(e,t,n){var r=A.isWordContent(t),a=r?A.preProcess(e,t):t;return B(e,a,n,r)},$=function(e,t){return e.insertContent(t,{merge:m.shouldMergeFormats(e),paste:!0}),!0},j=function(e){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(e)},W=function(e){return j(e)&&/.(gif|jpe?g|png)$/.test(e)},N=function(e,t,n){return!(!1!==e.selection.isCollapsed()||!j(t)||(a=t,i=n,(r=e).undoManager.extra(function(){i(r,a)},function(){r.execCommand("mceInsertLink",!1,a)}),0));var r,a,i},V=function(e,t,n){return!!W(t)&&(a=t,i=n,(r=e).undoManager.extra(function(){i(r,a)},function(){r.insertContent('<img src="'+a+'">')}),!0);var r,a,i},z=function(e,t){var n,r;!1===m.isSmartPasteEnabled(e)?$(e,t):(n=e,r=t,b.each([N,V,$],function(e){return!0!==e(n,r,$)}))},K=function(e,t,n){var r=n||y(t),a=L(e,g(t),r);!1===a.cancelled&&z(e,a.content)},U=function(e,t){t=e.dom.encode(t).replace(/\r\n/g,"\n"),t=T(t,e.settings.forced_root_block,e.settings.forced_root_block_attrs),K(e,t,!1)},G=function(e){var t={};if(e){if(e.getData){var n=e.getData("Text");n&&0<n.length&&-1===n.indexOf("data:text/mce-internal,")&&(t["text/plain"]=n)}if(e.types)for(var r=0;r<e.types.length;r++){var a=e.types[r];try{t[a]=e.getData(a)}catch(i){t[a]=""}}}return t},X=function(e,t){return t in e&&0<e[t].length},q=function(e){return X(e,"text/html")||X(e,"text/plain")},Y=S.createIdGenerator("mceclip"),Z=function(e,t,n,r){t&&(e.selection.setRng(t),t=null);var a,i,o,s,l,u,c,f=n.result,d=-1!==(i=(a=f).indexOf(","))?a.substr(i+1):null,m=Y(),p=e.settings.images_reuse_filename&&r.name?(o=e,s=r.name,(l=s.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i))?o.dom.encode(l[1]):null):m,g=new Image;if(g.src=f,u=e.settings,c=g,!u.images_dataimg_filter||u.images_dataimg_filter(c)){var v,h=e.editorUpload.blobCache,b=void 0;(v=h.findFirst(function(e){return e.base64()===d}))?b=v:(b=h.create(m,r,d,p),h.add(b)),K(e,'<img src="'+b.blobUri()+'">',!1)}else K(e,'<img src="'+f+'">',!1)},J=function(o,s,l){var e="paste"===s.type?s.clipboardData:s.dataTransfer;function t(e){var t,n,r,a=!1;if(e)for(t=0;t<e.length;t++)if(n=e[t],/^image\/(jpeg|png|gif|bmp)$/.test(n.type)){var i=n.getAsFile?n.getAsFile():n;(r=new window.FileReader).onload=Z.bind(null,o,l,r,i),r.readAsDataURL(i),s.preventDefault(),a=!0}return a}if(o.settings.paste_data_images&&e)return t(e.items)||t(e.files)},Q=function(e){return a.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode},ee=function(c,f,d){var m,p=0;function g(e,t,n,r){var a,i;X(e,"text/html")?a=e["text/html"]:(a=f.getHtml(),r=r||y(a),f.isDefaultContent(a)&&(n=!0)),a=S.trimHtml(a),f.remove(),i=!1===r&&D(a),a.length&&!i||(n=!0),n&&(a=X(e,"text/plain")&&i?e["text/plain"]:S.innerText(a)),f.isDefaultContent(a)?t||c.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?U(c,a):K(c,a,r)}c.on("keydown",function(e){function t(e){Q(e)&&!e.isDefaultPrevented()&&f.remove()}if(Q(e)&&!e.isDefaultPrevented()){if((m=e.shiftKey&&86===e.keyCode)&&v.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(e.stopImmediatePropagation(),p=(new Date).getTime(),v.ie&&m)return e.preventDefault(),void n(c,!0);f.remove(),f.create(),c.once("keyup",t),c.once("paste",function(){c.off("keyup",t)})}}),c.on("paste",function(e){var t,n,r,a=(new Date).getTime(),i=(t=c,n=G(e.clipboardData||t.getDoc().dataTransfer),S.isMsEdge()?b.extend(n,{"text/html":""}):n),o=(new Date).getTime()-a,s=(new Date).getTime()-p-o<1e3,l="text"===d.get()||m,u=X(i,x());m=!1,e.isDefaultPrevented()||(r=e.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length)?f.remove():q(i)||!J(c,e,f.getLastRng()||c.selection.getRng())?(s||e.preventDefault(),!v.ie||s&&!e.ieFake||X(i,"text/html")||(f.create(),c.dom.bind(f.getEl(),"paste",function(e){e.stopPropagation()}),c.getDoc().execCommand("Paste",!1,null),i["text/html"]=f.getHtml()),X(i,"text/html")?(e.preventDefault(),u||(u=y(i["text/html"])),g(i,s,l,u)):h.setEditorTimeout(c,function(){g(i,s,l,u)},0)):f.remove()})},te=function(e){return v.ie&&e.inline?document.body:e.getBody()},ne=function(t,e,n){var r;te(r=t)!==r.getBody()&&t.dom.bind(e,"paste keyup",function(e){ie(t,n)||t.fire("paste")})},re=function(e){return e.dom.get("mcepastebin")},ae=function(e,t){return t===e},ie=function(e,t){var n,r=re(e);return(n=r)&&"mcepastebin"===n.id&&ae(t,r.innerHTML)},oe=function(o){var s=u(null),l="%MCEPASTEBIN%";return{create:function(){return t=s,n=l,a=(e=o).dom,i=e.getBody(),t.set(e.selection.getRng()),r=e.dom.add(te(e),"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),(v.ie||v.gecko)&&a.setStyle(r,"left","rtl"===a.getStyle(i,"direction",!0)?65535:-65535),a.bind(r,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),ne(e,r,n),r.focus(),void e.selection.select(r,!0);var e,t,n,r,a,i},remove:function(){return function(e,t){if(re(e)){for(var n=void 0,r=t.get();n=e.dom.get("mcepastebin");)e.dom.remove(n),e.dom.unbind(n);r&&e.selection.setRng(r)}t.set(null)}(o,s)},getEl:function(){return re(o)},getHtml:function(){return function(n){var t,e,r,a,i,o=function(e,t){e.appendChild(t),n.dom.remove(t,!0)};for(e=b.grep(te(n).childNodes,function(e){return"mcepastebin"===e.id}),t=e.shift(),b.each(e,function(e){o(t,e)}),r=(a=n.dom.select("div[id=mcepastebin]",t)).length-1;0<=r;r--)i=n.dom.create("div"),t.insertBefore(i,a[r]),o(i,a[r]);return t?t.innerHTML:""}(o)},getLastRng:function(){return s.get()},isDefault:function(){return ie(o,l)},isDefaultContent:function(e){return ae(l,e)}}},se=function(n,e){var t=oe(n);return n.on("preInit",function(){return ee(o=n,t,e),void o.parser.addNodeFilter("img",function(e,t,n){var r,a=function(e){e.attr("data-mce-object")||s===v.transparentSrc||e.remove()};if(!o.settings.paste_data_images&&(r=n).data&&!0===r.data.paste)for(var i=e.length;i--;)(s=e[i].attributes.map.src)&&(0===s.indexOf("webkit-fake-url")?a(e[i]):o.settings.allow_html_data_urls||0!==s.indexOf("data:")||a(e[i]))});var o,s}),{pasteFormat:e,pasteHtml:function(e,t){return K(n,e,t)},pasteText:function(e){return U(n,e)},pasteImageData:function(e,t){return J(n,e,t)},getDataTransferItems:G,hasHtmlOrText:q,hasContentType:X}},le=function(){},ue=function(e,t,n){if(r=e,!1!==v.iOS||r===undefined||"function"!=typeof r.setData||!0===S.isMsEdge())return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(x(),t),!0}catch(a){return!1}var r},ce=function(e,t,n,r){ue(e.clipboardData,t.html,t.text)?(e.preventDefault(),r()):n(t.html,r)},fe=function(s){return function(e,t){var n=p(e),r=s.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),a=s.dom.create("div",{contenteditable:"true"},n);s.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(a),s.dom.add(s.getBody(),r);var i=s.selection.getRng();a.focus();var o=s.dom.createRng();o.selectNodeContents(a),s.selection.setRng(o),setTimeout(function(){s.selection.setRng(i),r.parentNode.removeChild(r),t()},0)}},de=function(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}},me=function(e){var t,n;e.on("cut",(t=e,function(e){!1===t.selection.isCollapsed()&&ce(e,de(t),fe(t),function(){setTimeout(function(){t.execCommand("Delete")},0)})})),e.on("copy",(n=e,function(e){!1===n.selection.isCollapsed()&&ce(e,de(n),fe(n),le)}))},pe=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),ge=function(e,t){return pe.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())},ve=function(e,t){e.focus(),e.selection.setRng(t)},he=function(o,s,l){m.shouldBlockDrop(o)&&o.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),m.shouldPasteDataImages(o)||o.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&0<t.files.length&&e.preventDefault()}),o.on("drop",function(e){var t,n;if(n=ge(o,e),!e.isDefaultPrevented()&&!l.get()){t=s.getDataTransferItems(e.dataTransfer);var r,a=s.hasContentType(t,x());if((s.hasHtmlOrText(t)&&(!(r=t["text/plain"])||0!==r.indexOf("file://"))||!s.pasteImageData(e,n))&&n&&m.shouldFilterDrop(o)){var i=t["mce-internal"]||t["text/html"]||t["text/plain"];i&&(e.preventDefault(),h.setEditorTimeout(o,function(){o.undoManager.transact(function(){t["mce-internal"]&&o.execCommand("Delete"),ve(o,n),i=S.trimHtml(i),t["text/html"]?s.pasteHtml(i,a):s.pasteText(i)})}))}}}),o.on("dragstart",function(e){l.set(!0)}),o.on("dragover dragend",function(e){m.shouldPasteDataImages(o)&&!1===l.get()&&(e.preventDefault(),ve(o,ge(o,e))),"dragend"===e.type&&l.set(!1)})},be=function(e){var t=e.plugins.paste,n=m.getPreProcess(e);n&&e.on("PastePreProcess",function(e){n.call(t,t,e)});var r=m.getPostProcess(e);r&&e.on("PastePostProcess",function(e){r.call(t,t,e)})};function ye(t,n){t.on("PastePreProcess",function(e){e.content=n(t,e.content,e.internal,e.wordContent)})}function xe(e,t){if(!A.isWordContent(t))return t;var n=[];b.each(e.schema.getBlockElements(),function(e,t){n.push(t)});var r=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return t=S.filter(t,[[r,"$1"]]),t=S.filter(t,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function Pe(e,t,n,r){if(r||n)return t;var u,a=m.getWebkitStyles(e);if(!1===m.shouldRemoveWebKitStyles(e)||"all"===a)return t;if(a&&(u=a.split(/[, ]/)),u){var c=e.dom,f=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,t,n,r){var a=c.parseStyle(c.decode(n)),i={};if("none"===u)return t+r;for(var o=0;o<u.length;o++){var s=a[u[o]],l=c.getStyle(f,u[o],!0);/color/.test(u[o])&&(s=c.toHex(s),l=c.toHex(l)),l!==s&&(i[u[o]]=s)}return(i=c.serializeStyle(i,"span"))?t+' style="'+i+'"'+r:t+r})}else t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r})}function we(n,e){n.$("a",e).find("font,u").each(function(e,t){n.dom.remove(t,!0)})}var _e=function(e){var t,n;v.webkit&&ye(e,Pe),v.ie&&(ye(e,xe),n=we,(t=e).on("PastePostProcess",function(e){n(t,e.node)}))},De=function(e,t,n){var r=n.control;r.active("text"===t.pasteFormat.get()),e.on("PastePlainTextToggle",function(e){r.active(e.state)})},Te=function(e,t){var n=function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var o=new Array(arguments.length-1),n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var a=o.concat(n);return i.apply(null,a)}}(De,e,t);e.addButton("pastetext",{active:!1,icon:"pastetext",tooltip:"Paste as text",cmd:"mceTogglePlainTextPaste",onPostRender:n}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:t.pasteFormat,cmd:"mceTogglePlainTextPaste",onPostRender:n})};t.add("paste",function(e){if(!1===o(e)){var t=u(!1),n=u(!1),r=u(m.isPasteAsTextEnabled(e)?"text":"html"),a=se(e,r),i=_e(e);return Te(e,a),c(e,a,t),be(e),me(e),he(e,a,n),s(a,i)}})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),l=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),p=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(e){return e&&"BR"===e.nodeName},r=function(e){return e&&3===e.nodeType},h=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},i=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},a=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},C=o,s=function(e){return e.parentNode.firstChild===e},c=function(e){return e.parentNode.lastChild===e},y=function(e,t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]},f=function(e,t){return e&&e.nodeName in t},u=function(e,t){return!!o(t)&&!(!e.isBlock(t.nextSibling)||o(t.previousSibling))},m=function(e,t,n){var o=e.isEmpty(t);return!(n&&0<e.select("span[data-mce-type=bookmark]",t).length)&&o},g=function(e,t){return e.isChildOf(t,e.getRoot())},N=function(e,t){var n=d.getNode(e,t);return i(e)&&r(n)?{container:n,offset:t>=e.childNodes.length?n.data.length:0}:{container:e,offset:t}},L=function(e){var t=e.cloneRange(),n=N(e.startContainer,e.startOffset);t.setStart(n.container,n.offset);var o=N(e.endContainer,e.endOffset);return t.setEnd(o.container,o.offset),t},S=t.DOM,b=function(r){var i={},e=function(e){var t,n,o;n=r[e?"startContainer":"endContainer"],o=r[e?"startOffset":"endOffset"],1===n.nodeType&&(t=S.create("span",{"data-mce-type":"bookmark"}),n.hasChildNodes()?(o=Math.min(o,n.childNodes.length-1),e?n.insertBefore(t,n.childNodes[o]):S.insertAfter(t,n.childNodes[o])):n.appendChild(t),n=t,o=0),i[e?"startContainer":"endContainer"]=n,i[e?"startOffset":"endOffset"]=o};return e(!0),r.collapsed||e(),i},D=function(r){function e(e){var t,n,o;t=o=r[e?"startContainer":"endContainer"],n=r[e?"startOffset":"endOffset"],t&&(1===t.nodeType&&(n=function(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t===e)return n;1===t.nodeType&&"bookmark"===t.getAttribute("data-mce-type")||n++,t=t.nextSibling}return-1}(t),t=t.parentNode,S.remove(o),!t.hasChildNodes()&&S.isBlock(t)&&t.appendChild(S.create("br"))),r[e?"startContainer":"endContainer"]=t,r[e?"startOffset":"endOffset"]=n)}e(!0),e();var t=S.createRng();return t.setStart(r.startContainer,r.startOffset),r.endContainer&&t.setEnd(r.endContainer,r.endOffset),L(t)},k=t.DOM,T=function(e,t){var n,o=t.parentNode;"LI"===o.nodeName&&o.firstChild===t&&((n=o.previousSibling)&&"LI"===n.nodeName?(n.appendChild(t),m(e,o)&&k.remove(o)):k.setStyle(o,"listStyleType","none")),h(o)&&(n=o.previousSibling)&&"LI"===n.nodeName&&n.appendChild(t)},I=function(t,e){v.each(v.grep(t.select("ol,ul",e)),function(e){T(t,e)})},B=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),R=function(e){var t=e.selection.getStart(!0);return e.dom.getParent(t,"OL,UL,DL",O(e,t))},O=function(e,t){var n=e.dom.getParents(t,"TD,TH");return 0<n.length?n[0]:e.getBody()},E={getParentList:R,getSelectedSubLists:function(e){var t,n,o,r=R(e),i=e.selection.getSelectedBlocks();return o=i,(n=r)&&1===o.length&&o[0]===n?(t=r,v.grep(t.querySelectorAll("ol,ul,dl"),function(e){return h(e)})):v.grep(i,function(e){return h(e)&&r!==e})},getSelectedListItems:function(e){var n,t,o,r=e.selection.getSelectedBlocks();return v.grep((n=e,t=r,o=v.map(t,function(e){var t=n.dom.getParent(e,"li,dd,dt",O(n,e));return t||e}),B.unique(o)),function(e){return i(e)})},getClosestListRootElm:O},A=tinymce.util.Tools.resolve("tinymce.Env"),P=t.DOM,x=function(e,t,n){var o,r,i,a=P.createFragment(),s=e.schema.getBlockElements();if(e.settings.forced_root_block&&(n=n||e.settings.forced_root_block),n&&((r=P.create(n)).tagName===e.settings.forced_root_block&&P.setAttribs(r,e.settings.forced_root_block_attrs),f(t.firstChild,s)||a.appendChild(r)),t)for(;o=t.firstChild;){var d=o.nodeName;i||"SPAN"===d&&"bookmark"===o.getAttribute("data-mce-type")||(i=!0),f(o,s)?(a.appendChild(o),r=null):n?(r||(r=P.create(n),a.appendChild(r)),r.appendChild(o)):a.appendChild(o)}return e.settings.forced_root_block?i||A.ie&&!(10<A.ie)||r.appendChild(P.create("br",{"data-mce-bogus":"1"})):a.appendChild(P.create("br")),a},_=t.DOM,M=function(e,t,n,o){var r,i,a,s,d;for(a=_.select('span[data-mce-type="bookmark"]',t),o=o||x(e,n),(r=_.createRng()).setStartAfter(n),r.setEndAfter(t),s=(i=r.extractContents()).firstChild;s;s=s.firstChild)if("LI"===s.nodeName&&e.dom.isEmpty(s)){_.remove(s);break}e.dom.isEmpty(i)||_.insertAfter(i,t),_.insertAfter(o,t),m(e.dom,n.parentNode)&&(d=n.parentNode,v.each(a,function(e){d.parentNode.insertBefore(e,n.parentNode)}),_.remove(d)),_.remove(n),m(e.dom,t)&&_.remove(t)},U=t.DOM,H=function(e,t){m(e,t)&&U.remove(t)},$=function(e,t){var n,o,r=t.parentNode;return r?(n=r.parentNode,r===e.getBody()||("DD"===t.nodeName?U.rename(t,"DT"):s(t)&&c(t)?"LI"===n.nodeName?(U.insertAfter(t,n),H(e.dom,n),U.remove(r)):h(n)?U.remove(r,!0):(n.insertBefore(x(e,t),r),U.remove(r)):s(t)?"LI"===n.nodeName?(U.insertAfter(t,n),t.appendChild(r),H(e.dom,n)):h(n)?n.insertBefore(t,r):(n.insertBefore(x(e,t),r),U.remove(t)):c(t)?"LI"===n.nodeName?U.insertAfter(t,n):h(n)?U.insertAfter(t,r):(U.insertAfter(x(e,t),r),U.remove(t)):("LI"===n.nodeName?(r=n,o=x(e,t,"LI")):o=h(n)?x(e,t,"LI"):x(e,t),M(e,r,t,o),I(e.dom,r.parentNode)))):H(e.dom,t),!0},w=$,K=function(e){var t=E.getSelectedListItems(e);if(t.length){var n=b(e.selection.getRng()),o=void 0,r=void 0,i=E.getClosestListRootElm(e,e.selection.getStart(!0));for(o=t.length;o--;)for(var a=t[o].parentNode;a&&a!==i;){for(r=t.length;r--;)if(t[r]===a){t.splice(o,1);break}a=a.parentNode}for(o=0;o<t.length&&($(e,t[o])||0!==o);o++);return e.selection.setRng(D(n)),e.nodeChanged(),!0}},Q=function(n,e){v.each(e,function(e,t){n.setAttribute(t,e)})},W=function(e,t,n){var o,r,i,a,s,d,l;o=e,r=t,a=(i=n)["list-style-type"]?i["list-style-type"]:null,o.setStyle(r,"list-style-type",a),s=e,Q(d=t,(l=n)["list-attributes"]),v.each(s.select("li",d),function(e){Q(e,l["list-item-attributes"])})},j=function(e,t,n,o){var r,i;for(r=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===r.nodeType&&(r=r.childNodes[Math.min(i,r.childNodes.length-1)]||r),!n&&C(r.nextSibling)&&(r=r.nextSibling);r.parentNode!==o;){if(y(e,r))return r;if(/^(TD|TH)$/.test(r.parentNode.nodeName))return r;r=r.parentNode}return r},q=function(c,f,u){void 0===u&&(u={});var e,t=c.selection.getRng(!0),m="LI",n=E.getClosestListRootElm(c,c.selection.getStart(!0)),g=c.dom;"false"!==g.getContentEditable(c.selection.getNode())&&("DL"===(f=f.toUpperCase())&&(m="DT"),e=b(t),v.each(function(n,e,o){for(var r,i=[],a=n.dom,t=j(n,e,!0,o),s=j(n,e,!1,o),d=[],l=t;l&&(d.push(l),l!==s);l=l.nextSibling);return v.each(d,function(e){if(y(n,e))return i.push(e),void(r=null);if(a.isBlock(e)||C(e))return C(e)&&a.remove(e),void(r=null);var t=e.nextSibling;p.isBookmarkNode(e)&&(y(n,t)||!t&&e.parentNode===o)?r=null:(r||(r=a.create("p"),e.parentNode.insertBefore(r,e),i.push(r)),r.appendChild(e))}),i}(c,t,n),function(e){var t,n,o,r,i,a,s,d,l;(n=e.previousSibling)&&h(n)&&n.nodeName===f&&(o=n,r=u,i=g.getStyle(o,"list-style-type"),a=r?r["list-style-type"]:"",i===(a=null===a?"":a))?(t=n,e=g.rename(e,m),n.appendChild(e)):(t=g.create(f),e.parentNode.insertBefore(t,e),t.appendChild(e),e=g.rename(e,m)),s=g,d=e,l=["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],v.each(l,function(e){var t;return s.setStyle(d,((t={})[e]="",t))}),W(g,t,u),z(c.dom,t)}),c.selection.setRng(D(e)))},F=function(o){var e=b(o.selection.getRng(!0)),r=E.getClosestListRootElm(o,o.selection.getStart(!0)),t=E.getSelectedListItems(o),n=v.grep(t,function(e){return o.dom.isEmpty(e)});t=v.grep(t,function(e){return!o.dom.isEmpty(e)}),v.each(n,function(e){m(o.dom,e)&&w(o,e)}),v.each(t,function(e){var t,n;if(e.parentNode!==o.getBody()){for(t=e;t&&t!==r;t=t.parentNode)h(t)&&(n=t);M(o,n,e),I(o.dom,n.parentNode)}}),o.selection.setRng(D(e))},V=function(e,t,n){return d=n,(s=t)&&d&&h(s)&&s.nodeName===d.nodeName&&(i=t,a=n,(r=e).getStyle(i,"list-style-type",!0)===r.getStyle(a,"list-style-type",!0))&&(o=n,t.className===o.className);var o,r,i,a,s,d},z=function(e,t){var n,o;if(n=t.nextSibling,V(e,t,n)){for(;o=n.firstChild;)t.appendChild(o);e.remove(n)}if(n=t.previousSibling,V(e,t,n)){for(;o=n.lastChild;)t.insertBefore(o,t.firstChild);e.remove(n)}},G=function(t,e,n,o,r){if(e.nodeName!==o||J(r)){var i=b(t.selection.getRng(!0));v.each([e].concat(n),function(e){!function(e,t,n,o){if(t.nodeName!==n){var r=e.rename(t,n);W(e,r,o)}else W(e,t,o)}(t.dom,e,o,r)}),t.selection.setRng(D(i))}else F(t)},J=function(e){return"list-style-type"in e},X={toggleList:function(e,t,n){var o=E.getParentList(e),r=E.getSelectedSubLists(e);n=n||{},o&&0<r.length?G(e,o,r,t,n):function(e,t,n,o){if(t!==e.getBody())if(t)if(t.nodeName!==n||J(o)){var r=b(e.selection.getRng(!0));W(e.dom,t,o),z(e.dom,e.dom.rename(t,n)),e.selection.setRng(D(r))}else F(e);else q(e,n,o)}(e,o,t,n)},removeList:F,mergeWithAdjacentLists:z},Y=function(e,t,n,o){var r,i,a=t.startContainer,s=t.startOffset;if(3===a.nodeType&&(n?s<a.data.length:0<s))return a;for(r=e.schema.getNonEmptyElements(),1===a.nodeType&&(a=d.getNode(a,s)),i=new l(a,o),n&&u(e.dom,a)&&i.next();a=i[n?"next":"prev2"]();){if("LI"===a.nodeName&&!a.hasChildNodes())return a;if(r[a.nodeName])return a;if(3===a.nodeType&&0<a.data.length)return a}},Z=function(e,t){var n=t.childNodes;return 1===n.length&&!h(n[0])&&e.isBlock(n[0])},ee=function(e,t,n){var o,r,i,a;if(r=Z(e,n)?n.firstChild:n,Z(i=e,a=t)&&i.remove(a.firstChild,!0),!m(e,t,!0))for(;o=t.firstChild;)r.appendChild(o)},te=function(e,t,n){var o,r,i=t.parentNode;g(e,t)&&g(e,n)&&(h(n.lastChild)&&(r=n.lastChild),i===n.lastChild&&C(i.previousSibling)&&e.remove(i.previousSibling),(o=n.lastChild)&&C(o)&&t.hasChildNodes()&&e.remove(o),m(e,n,!0)&&e.$(n).empty(),ee(e,t,n),r&&n.appendChild(r),e.remove(t),m(e,i)&&i!==e.getRoot()&&e.remove(i))},ne=function(e,t,n,o){var r,i,a,s=e.dom;if(s.isEmpty(o))i=n,a=o,(r=e).dom.$(a).empty(),te(r.dom,i,a),r.selection.setCursorLocation(a);else{var d=b(t);te(s,n,o),e.selection.setRng(D(d))}},oe=function(e,t){var n,o,r,i=e.dom,a=e.selection,s=a.getStart(),d=E.getClosestListRootElm(e,s),l=i.getParent(a.getStart(),"LI",d);if(l){if((n=l.parentNode)===e.getBody()&&m(i,n))return!0;if(o=L(a.getRng(!0)),(r=i.getParent(Y(e,o,t,d),"LI",d))&&r!==l)return t?ne(e,o,r,l):function(e,t,n,o){var r=b(t);te(e.dom,n,o);var i=D(r);e.selection.setRng(i)}(e,o,l,r),!0;if(!r&&!t)return X.removeList(e),!0}return!1},re=function(e,t){return oe(e,t)||function(r,i){var a=r.dom,e=r.selection.getStart(),s=E.getClosestListRootElm(r,e),d=a.getParent(e,a.isBlock,s);if(d&&a.isEmpty(d)){var t=L(r.selection.getRng(!0)),l=a.getParent(Y(r,t,i,s),"LI",s);if(l)return r.undoManager.transact(function(){var e,t,n,o;t=d,n=s,o=(e=a).getParent(t.parentNode,e.isBlock,n),e.remove(t),o&&e.isEmpty(o)&&e.remove(o),X.mergeWithAdjacentLists(a,l.parentNode),r.selection.select(l,!0),r.selection.collapse(i)}),!0}return!1}(e,t)},ie=function(e,t){return e.selection.isCollapsed()?re(e,t):(o=(n=e).selection.getStart(),r=E.getClosestListRootElm(n,o),!!(n.dom.getParent(o,"LI,DT,DD",r)||0<E.getSelectedListItems(n).length)&&(n.undoManager.transact(function(){n.execCommand("Delete"),I(n.dom,n.getBody())}),!0));var n,o,r},ae=function(t){t.on("keydown",function(e){e.keyCode===n.BACKSPACE?ie(t,!1)&&e.preventDefault():e.keyCode===n.DELETE&&ie(t,!0)&&e.preventDefault()})},se=ie,de=function(t){return{backspaceDelete:function(e){se(t,e)}}},le=t.DOM,ce=function(e,t){var n;if(h(e)){for(;n=e.firstChild;)t.appendChild(n);le.remove(e)}},fe=function(e){var t,n,o,r,i=E.getSelectedListItems(e);if(i.length){for(var a=b(e.selection.getRng(!0)),s=0;s<i.length&&(t=i[s],r=o=n=void 0,("DT"===t.nodeName?(le.rename(t,"DD"),1):(n=t.previousSibling)&&h(n)?(n.appendChild(t),1):n&&"LI"===n.nodeName&&h(n.lastChild)?(n.lastChild.appendChild(t),ce(t.lastChild,n.lastChild),1):(n=t.nextSibling)&&h(n)?(n.insertBefore(t,n.firstChild),1):(n=t.previousSibling)&&"LI"===n.nodeName&&(o=le.create(t.parentNode.nodeName),(r=le.getStyle(t.parentNode,"listStyleType"))&&le.setStyle(o,"listStyleType",r),n.appendChild(o),o.appendChild(t),ce(t.lastChild,o),1))||0!==s);s++);return e.selection.setRng(D(a)),e.nodeChanged(),!0}},ue=function(t,n){return function(){var e=t.dom.getParent(t.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===n}},me=function(o){o.on("BeforeExecCommand",function(e){var t,n=e.command.toLowerCase();if("indent"===n?fe(o)&&(t=!0):"outdent"===n&&K(o)&&(t=!0),t)return o.fire("ExecCommand",{command:e.command}),e.preventDefault(),!0}),o.addCommand("InsertUnorderedList",function(e,t){X.toggleList(o,"UL",t)}),o.addCommand("InsertOrderedList",function(e,t){X.toggleList(o,"OL",t)}),o.addCommand("InsertDefinitionList",function(e,t){X.toggleList(o,"DL",t)}),o.addQueryStateHandler("InsertUnorderedList",ue(o,"UL")),o.addQueryStateHandler("InsertOrderedList",ue(o,"OL")),o.addQueryStateHandler("InsertDefinitionList",ue(o,"DL"))},ge=function(e){return e.getParam("lists_indent_on_tab",!0)},pe=function(e){var t;ge(e)&&(t=e).on("keydown",function(e){e.keyCode!==n.TAB||n.metaKeyPressed(e)||t.dom.getParent(t.selection.getStart(),"LI,DT,DD")&&(e.preventDefault(),e.shiftKey?K(t):fe(t))}),ae(e)},ve=function(t,i){return function(e){var r=e.control;t.on("NodeChange",function(e){var t=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}(e.parents,a),n=-1!==t?e.parents.slice(0,t):e.parents,o=v.grep(n,h);r.active(0<o.length&&o[0].nodeName===i)})}},he=function(e){var t,n,o,r;n="advlist",o=(t=e).settings.plugins?t.settings.plugins:"",-1===v.inArray(o.split(/[ ,]/),n)&&(e.addButton("numlist",{active:!1,title:"Numbered list",cmd:"InsertOrderedList",onPostRender:ve(e,"OL")}),e.addButton("bullist",{active:!1,title:"Bullet list",cmd:"InsertUnorderedList",onPostRender:ve(e,"UL")})),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:(r=e,function(e){var n=e.control;r.on("nodechange",function(){var e=E.getSelectedListItems(r),t=0<e.length&&s(e[0]);n.disabled(t)})})})};e.add("lists",function(e){return pe(e),he(e),me(e),de(e)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),e=function(t){return t.target_list},o=function(t){return t.rel_list},i=function(t){return t.link_class_list},p=function(t){return"boolean"==typeof t.link_assume_external_targets&&t.link_assume_external_targets},a=function(t){return"boolean"==typeof t.link_context_toolbar&&t.link_context_toolbar},r=function(t){return t.link_list},k=function(t){return"string"==typeof t.default_link_target},y=function(t){return t.default_link_target},b=e,_=function(t,e){t.settings.target_list=e},w=function(t){return!1!==e(t)},T=o,C=function(t){return o(t)!==undefined},M=i,O=function(t){return i(t)!==undefined},R=function(t){return!1!==t.link_title},N=function(t){return"boolean"==typeof t.allow_unsafe_link_target&&t.allow_unsafe_link_target},l=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),u=tinymce.util.Tools.resolve("tinymce.Env"),c=function(t){if(!u.ie||10<u.ie){var e=document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),r=e,a=n,document.body.appendChild(r),r.dispatchEvent(a),document.body.removeChild(r)}else{var o=window.open("","_blank");if(o){o.opener=null;var i=o.document;i.open(),i.write('<meta http-equiv="refresh" content="0; url='+l.DOM.encode(t)+'">'),i.close()}}var r,a},A=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(t,e){var n,o,i=["noopener"],r=t?t.split(/\s+/):[],a=function(t){return t.filter(function(t){return-1===A.inArray(i,t)})};return(r=e?(n=a(n=r)).length?n.concat(i):i:a(r)).length?(o=r,A.trim(o.sort().join(" "))):null},f=function(t,e){return e=e||t.selection.getNode(),m(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},d=function(t){return t&&"A"===t.nodeName&&t.href},m=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},v=function(t,e){var n,o;(o=t.dom.select("img",e)[0])&&(n=t.dom.getParents(o,"a[href]",e)[0])&&(n.parentNode.insertBefore(o,n),t.dom.remove(n))},g=function(t,e,n){var o,i;(i=t.dom.select("img",e)[0])&&(o=t.dom.create("a",n),i.parentNode.insertBefore(o,i),o.appendChild(i))},L=function(i,r){return function(o){i.undoManager.transact(function(){var t=i.selection.getNode(),e=f(i,t),n={href:o.href,target:o.target?o.target:null,rel:o.rel?o.rel:null,"class":o["class"]?o["class"]:null,title:o.title?o.title:null};C(i.settings)||!1!==N(i.settings)||(n.rel=s(n.rel,"_blank"===n.target)),o.href===r.href&&(r.attach(),r={}),e?(i.focus(),o.hasOwnProperty("text")&&("innerText"in e?e.innerText=o.text:e.textContent=o.text),i.dom.setAttribs(e,n),i.selection.select(e),i.undoManager.add()):m(t)?g(i,t,n):o.hasOwnProperty("text")?i.insertContent(i.dom.createHTML("a",n,i.dom.encode(o.text))):i.execCommand("mceInsertLink",!1,n)})}},P=function(e){return function(){e.undoManager.transact(function(){var t=e.selection.getNode();m(t)?v(e,t):e.execCommand("unlink")})}},h=d,x=function(t){return 0<A.grep(t,d).length},E=function(t){return!(/</.test(t)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(t)||-1===t.indexOf("href=")))},S=f,I=function(t,e){var n=e?e.innerText||e.textContent:t.getContent({format:"text"});return n.replace(/\uFEFF/g,"")},K=s,U=tinymce.util.Tools.resolve("tinymce.util.Delay"),D=tinymce.util.Tools.resolve("tinymce.util.XHR"),B={},F=function(t,o,e){var i=function(t,n){return n=n||[],A.each(t,function(t){var e={text:t.text||t.title};t.menu?e.menu=i(t.menu):(e.value=t.value,o&&o(e)),n.push(e)}),n};return i(t,e||[])},q=function(e,t,n){var o=e.selection.getRng();U.setEditorTimeout(e,function(){e.windowManager.confirm(t,function(t){e.selection.setRng(o),n(t)})})},V=function(a,t){var e,l,o,u,n,i,r,c,s,f,d,m={},v=a.selection,g=a.dom,h=function(t){var e=o.find("#text");(!e.value()||t.lastControl&&e.value()===t.lastControl.text())&&e.value(t.control.text()),o.find("#href").value(t.control.value())},x=function(){l||!u||m.text||this.parent().parent().find("#text")[0].value(this.value())};u=E(v.getContent()),e=S(a),m.text=l=I(a.selection,e),m.href=e?g.getAttrib(e,"href"):"",e?m.target=g.getAttrib(e,"target"):k(a.settings)&&(m.target=y(a.settings)),(d=g.getAttrib(e,"rel"))&&(m.rel=d),(d=g.getAttrib(e,"class"))&&(m["class"]=d),(d=g.getAttrib(e,"title"))&&(m.title=d),u&&(n={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){m.text=this.value()}}),t&&(i={type:"listbox",label:"Link list",values:F(t,function(t){t.value=a.convertURL(t.value||t.url,"href")},[{text:"None",value:""}]),onselect:h,value:a.convertURL(m.href,"href"),onPostRender:function(){i=this}}),w(a.settings)&&(b(a.settings)===undefined&&_(a,[{text:"None",value:""},{text:"New window",value:"_blank"}]),c={name:"target",type:"listbox",label:"Target",values:F(b(a.settings))}),C(a.settings)&&(r={name:"rel",type:"listbox",label:"Rel",values:F(T(a.settings),function(t){!1===N(a.settings)&&(t.value=K(t.value,"_blank"===m.target))})}),O(a.settings)&&(s={name:"class",type:"listbox",label:"Class",values:F(M(a.settings),function(t){t.value&&(t.textStyle=function(){return a.formatter.getCssText({inline:"a",classes:[t.value]})})})}),R(a.settings)&&(f={name:"title",type:"textbox",label:"Title",value:m.title}),o=a.windowManager.open({title:"Insert link",data:m,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:function(t){var e=t.meta||{};i&&i.value(a.convertURL(this.value(),"href")),A.each(t.meta,function(t,e){var n=o.find("#"+e);"text"===e?0===l.length&&(n.value(t),m.text=t):n.value(t)}),e.attach&&(B={href:this.value(),attach:e.attach}),e.text||x.call(this)},onkeyup:x,onpaste:x,onbeforecall:function(t){t.meta=o.toJSON()}},n,f,function(n){var o=[];if(A.each(a.dom.select("a:not([href])"),function(t){var e=t.name||t.id;e&&o.push({text:e,value:"#"+e,selected:-1!==n.indexOf("#"+e)})}),o.length)return o.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:o,onselect:h}}(m.href),i,r,c,s],onSubmit:function(t){var e=p(a.settings),n=L(a,B),o=P(a),i=A.extend({},m,t.data),r=i.href;r?(u&&i.text!==l||delete i.text,0<r.indexOf("@")&&-1===r.indexOf("//")&&-1===r.indexOf("mailto:")?q(a,"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(t){t&&(i.href="mailto:"+r),n(i)}):!0===e&&!/^\w+:/i.test(r)||!1===e&&/^\s*www[\.|\d\.]/i.test(r)?q(a,"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(t){t&&(i.href="http://"+r),n(i)}):n(i)):o()}})},z=function(t){var e,n,o;n=V,"string"==typeof(o=r((e=t).settings))?D.send({url:o,success:function(t){n(e,JSON.parse(t))}}):"function"==typeof o?o(function(t){n(e,t)}):n(e,o)},H=function(t,e){return t.dom.getParent(e,"a[href]")},J=function(t){return H(t,t.selection.getStart())},$=function(t,e){if(e){var n=(i=e).getAttribute("data-mce-href")||i.getAttribute("href");if(/^#/.test(n)){var o=t.$(n);o.length&&t.selection.scrollIntoView(o[0],!0)}else c(e.href)}var i},j=function(t){return function(){z(t)}},G=function(t){return function(){$(t,J(t))}},X=function(r){return function(t){var e,n,o,i;return!!(a(r.settings)&&(!(i=r.plugins.contextmenu)||!i.isContextMenuVisible())&&h(t)&&3===(o=(n=(e=r.selection).getRng()).startContainer).nodeType&&e.isCollapsed()&&0<n.startOffset&&n.startOffset<o.data.length)}},Q=function(o){o.on("click",function(t){var e=H(o,t.target);e&&n.metaKeyPressed(t)&&(t.preventDefault(),$(o,e))}),o.on("keydown",function(t){var e,n=J(o);n&&13===t.keyCode&&!0===(e=t).altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey&&(t.preventDefault(),$(o,n))})},W=function(n){return function(){var e=this;n.on("nodechange",function(t){e.active(!n.readonly&&!!S(n,t.element))})}},Y=function(n){return function(){var e=this,t=function(t){x(t.parents)?e.show():e.hide()};x(n.dom.getParents(n.selection.getStart()))||e.hide(),n.on("nodechange",t),e.on("remove",function(){n.off("nodechange",t)})}},Z=function(t){t.addCommand("mceLink",j(t))},tt=function(t){t.addShortcut("Meta+K","",j(t))},et=function(t){t.addButton("link",{active:!1,icon:"link",tooltip:"Insert/edit link",onclick:j(t),onpostrender:W(t)}),t.addButton("unlink",{active:!1,icon:"unlink",tooltip:"Remove link",onclick:P(t),onpostrender:W(t)}),t.addContextToolbar&&t.addButton("openlink",{icon:"newtab",tooltip:"Open link",onclick:G(t)})},nt=function(t){t.addMenuItem("openlink",{text:"Open link",icon:"newtab",onclick:G(t),onPostRender:Y(t),prependToContext:!0}),t.addMenuItem("link",{icon:"link",text:"Link",shortcut:"Meta+K",onclick:j(t),stateSelector:"a[href]",context:"insert",prependToContext:!0}),t.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onclick:P(t),stateSelector:"a[href]"})},ot=function(t){t.addContextToolbar&&t.addContextToolbar(X(t),"openlink | link unlink")};t.add("link",function(t){et(t),nt(t),ot(t),Q(t),Z(t),tt(t)})}();!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},o=function(n){n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})};n.add("hr",function(n){t(n),o(n)})}();!function(){"use strict";var i=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return i(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return{isFullscreen:function(){return null!==e.get()}}},n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=function(e,n){e.fire("FullscreenStateChanged",{state:n})},g=n.DOM,r=function(e,n){var t,r,l,i,o,c,s=document.body,u=document.documentElement,d=n.get(),a=function(){var e,n,t,i;g.setStyle(l,"height",(t=window,i=document.body,i.offsetWidth&&(e=i.offsetWidth,n=i.offsetHeight),t.innerWidth&&t.innerHeight&&(e=t.innerWidth,n=t.innerHeight),{w:e,h:n}).h-(r.clientHeight-l.clientHeight))},h=function(){g.unbind(window,"resize",a)};if(t=(r=e.getContainer()).style,i=(l=e.getContentAreaContainer().firstChild).style,d)i.width=d.iframeWidth,i.height=d.iframeHeight,d.containerWidth&&(t.width=d.containerWidth),d.containerHeight&&(t.height=d.containerHeight),g.removeClass(s,"mce-fullscreen"),g.removeClass(u,"mce-fullscreen"),g.removeClass(r,"mce-fullscreen"),o=d.scrollPos,window.scrollTo(o.x,o.y),g.unbind(window,"resize",d.resizeHandler),e.off("remove",d.removeHandler),n.set(null),m(e,!1);else{var f={scrollPos:(c=g.getViewPort(),{x:c.x,y:c.y}),containerWidth:t.width,containerHeight:t.height,iframeWidth:i.width,iframeHeight:i.height,resizeHandler:a,removeHandler:h};i.width=i.height="100%",t.width=t.height="",g.addClass(s,"mce-fullscreen"),g.addClass(u,"mce-fullscreen"),g.addClass(r,"mce-fullscreen"),g.bind(window,"resize",a),e.on("remove",h),a(),n.set(f),m(e,!0)}},l=function(e,n){e.addCommand("mceFullScreen",function(){r(e,n)})},o=function(t){return function(e){var n=e.control;t.on("FullscreenStateChanged",function(e){n.active(e.state)})}},c=function(e){e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,cmd:"mceFullScreen",onPostRender:o(e),context:"view"}),e.addButton("fullscreen",{active:!1,tooltip:"Fullscreen",cmd:"mceFullScreen",onPostRender:o(e)})};e.add("fullscreen",function(e){var n=i(null);return e.settings.inline||(l(e,n),c(e),e.addShortcut("Ctrl+Shift+F","","mceFullScreen")),t(n)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=function(t,e){var i,n=t.dom,o=t.selection.getSelectedBlocks();o.length&&(i=n.getAttrib(o[0],"dir"),c.each(o,function(t){n.getParent(t.parentNode,'*[dir="'+e+'"]',n.getRoot())||n.setAttrib(t,"dir",i!==e?e:null)}),t.nodeChanged())},i=function(t){t.addCommand("mceDirectionLTR",function(){e(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){e(t,"rtl")})},n=function(e){var i=[];return c.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(t){i.push(t+"[dir="+e+"]")}),i.join(",")},o=function(t){t.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),t.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})};t.add("directionality",function(t){i(t),o(t)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(t){return t.getParam("code_dialog_width",600)},i=function(t){return t.getParam("code_dialog_height",Math.min(n.DOM.getViewPort().h-200,500))},c=function(t,n){t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged()},d=function(t){return t.getContent({source_view:!0})},e=function(n){var t=o(n),e=i(n);n.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:t,minHeight:e,spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(t){c(n,t.data.code)}}).find("#code").value(d(n))},u=function(t){t.addCommand("mceCodeEditor",function(){e(t)})},a=function(t){t.addButton("code",{icon:"code",tooltip:"Source code",onclick:function(){e(t)}}),t.addMenuItem("code",{icon:"code",text:"Source code",onclick:function(){e(t)}})};t.add("code",function(t){return u(t),a(t),{}})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){return e.fire("insertCustomChar",{chr:t})},l=function(e,t){var a=i(e,t).chr;e.execCommand("mceInsertContent",!1,a)},a=tinymce.util.Tools.resolve("tinymce.util.Tools"),r=function(e){return e.settings.charmap},n=function(e){return e.settings.charmap_append},o=a.isArray,c=function(e){return o(e)?[].concat((t=e,a.grep(t,function(e){return o(e)&&2===e.length}))):"function"==typeof e?e():[];var t},s=function(e){return function(e,t){var a=r(e);a&&(t=c(a));var i=n(e);return i?[].concat(t).concat(c(i)):t}(e,[["160","no-break space"],["173","soft hyphen"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["256","A - macron"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["274","E - macron"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["298","I - macron"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["332","O - macron"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["362","U - macron"],["221","Y - acute"],["376","Y - diaeresis"],["562","Y - macron"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["257","a - macron"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["275","e - macron"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["299","i - macron"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["333","o macron"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["363","u - macron"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["563","y - macron"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"]])},t=function(t){return{getCharMap:function(){return s(t)},insertChar:function(e){l(t,e)}}},u=function(e){var t,a,i,r=Math.min(e.length,25),n=Math.ceil(e.length/r);for(t='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>',i=0;i<n;i++){for(t+="<tr>",a=0;a<r;a++){var o=i*r+a;if(o<e.length){var l=e[o],c=parseInt(l[0],10),s=l?String.fromCharCode(c):" ";t+='<td title="'+l[1]+'"><div tabindex="-1" title="'+l[1]+'" role="button" data-chr="'+c+'">'+s+"</div></td>"}else t+="<td />"}t+="</tr>"}return t+="</tbody></table>"},d=function(e){for(;e;){if("TD"===e.nodeName)return e;e=e.parentNode}},m=function(n){var o,e={type:"container",html:u(s(n)),onclick:function(e){var t=e.target;if(/^(TD|DIV)$/.test(t.nodeName)){var a=d(t).firstChild;if(a&&a.hasAttribute("data-chr")){var i=a.getAttribute("data-chr"),r=parseInt(i,10);isNaN(r)||l(n,String.fromCharCode(r)),e.ctrlKey||o.close()}}},onmouseover:function(e){var t=d(e.target);t&&t.firstChild?(o.find("#preview").text(t.firstChild.firstChild.data),o.find("#previewTitle").text(t.title)):(o.find("#preview").text(" "),o.find("#previewTitle").text(" "))}};o=n.windowManager.open({title:"Special character",spacing:10,padding:10,items:[e,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"spacer",minHeight:20},{type:"label",name:"previewTitle",text:" ",style:"white-space: pre-wrap;",border:1,minWidth:140}]}],buttons:[{text:"Close",onclick:function(){o.close()}}]})},g=function(e){e.addCommand("mceShowCharmap",function(){m(e)})},p=function(e){e.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"mceShowCharmap"}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"})};e.add("charmap",function(e){return g(e),p(e),t(e)})}();!function(){"use strict";var i=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return i(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),h=function(t){return parseInt(t.getParam("autoresize_min_height",t.getElement().offsetHeight),10)},v=function(t){return parseInt(t.getParam("autoresize_max_height",0),10)},o=function(t){return t.getParam("autoresize_overflow_padding",1)},a=function(t){return t.getParam("autoresize_bottom_margin",50)},n=function(t){return t.getParam("autoresize_on_init",!0)},u=function(t,e,n,i,o){r.setEditorTimeout(t,function(){_(t,e),n--?u(t,e,n,i,o):o&&o()},i)},S=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},_=function(t,e){var n,i,o,r,a,u,s,l,g,c,f,d=t.dom;if(i=t.getDoc())if((m=t).plugins.fullscreen&&m.plugins.fullscreen.isFullscreen())S(t,!0);else{var m;o=i.body,r=h(t),u=d.getStyle(o,"margin-top",!0),s=d.getStyle(o,"margin-bottom",!0),l=d.getStyle(o,"padding-top",!0),g=d.getStyle(o,"padding-bottom",!0),c=d.getStyle(o,"border-top-width",!0),f=d.getStyle(o,"border-bottom-width",!0),a=o.offsetHeight+parseInt(u,10)+parseInt(s,10)+parseInt(l,10)+parseInt(g,10)+parseInt(c,10)+parseInt(f,10),(isNaN(a)||a<=0)&&(a=y.ie?o.scrollHeight:y.webkit&&0===o.clientHeight?0:o.offsetHeight),a>h(t)&&(r=a);var p=v(t);p&&p<a?(r=p,S(t,!0)):S(t,!1),r!==e.get()&&(n=r-e.get(),d.setStyle(t.iframeElement,"height",r+"px"),e.set(r),y.webkit&&n<0&&_(t,e))}},s={setup:function(i,e){i.on("init",function(){var t,e,n=i.dom;t=o(i),e=a(i),!1!==t&&n.setStyles(i.getBody(),{paddingLeft:t,paddingRight:t}),!1!==e&&n.setStyles(i.getBody(),{paddingBottom:e})}),i.on("nodechange setcontent keyup FullscreenStateChanged",function(t){_(i,e)}),n(i)&&i.on("init",function(){u(i,e,20,100,function(){u(i,e,5,1e3)})})},resize:_},l=function(t,e){t.addCommand("mceAutoResize",function(){s.resize(t,e)})};t.add("autoresize",function(t){if(!t.inline){var e=i(0);l(t,e),s.setup(t,e)}})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},e=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.id||e.name:""},i=function(t,e){var n=t.selection.getNode();"A"===n.tagName&&""===t.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=e,t.undoManager.add()):(t.focus(),t.selection.collapse(!0),t.execCommand("mceInsertContent",!1,t.dom.createHTML("a",{id:e})))},n=function(r){var t=e(r);r.windowManager.open({title:"Anchor",body:{type:"textbox",name:"id",size:40,label:"Id",value:t},onsubmit:function(t){var e,n,o=t.data.id;e=r,(a(n=o)?(i(e,n),0):(e.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))&&t.preventDefault()}})},o=function(t){t.addCommand("mceAnchor",function(){n(t)})},r=function(o){return function(t){for(var e=0;e<t.length;e++)(n=t[e]).attr("href")||!n.attr("id")&&!n.attr("name")||n.firstChild||t[e].attr("contenteditable",o);var n}},c=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("a",r("false")),t.serializer.addNodeFilter("a",r(null))})},d=function(t){t.addButton("anchor",{icon:"anchor",tooltip:"Anchor",cmd:"mceAnchor",stateSelector:"a:not([href])"}),t.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",cmd:"mceAnchor"})};t.add("anchor",function(t){c(t),o(t),d(t)})}();!function(){"use strict";var e,t,n,i,r,o=tinymce.util.Tools.resolve("tinymce.ThemeManager"),h=tinymce.util.Tools.resolve("tinymce.EditorManager"),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(e){return!1!==c(e)},c=function(e){return e.getParam("menubar")},f=function(e){return e.getParam("toolbar_items_size")},m=function(e){return e.getParam("menu")},g=function(e){return!1===e.settings.skin},p=function(e){var t=e.getParam("resize","vertical");return!1===t?"none":"both"===t?"both":"vertical"},v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),b=tinymce.util.Tools.resolve("tinymce.ui.Factory"),y=tinymce.util.Tools.resolve("tinymce.util.I18n"),s=function(e){return e.fire("SkinLoaded")},x=function(e){return e.fire("ResizeEditor")},_=function(e){return e.fire("BeforeRenderUI")},a=function(t,n){return function(){var e=t.find(n)[0];e&&e.focus(!0)}},C=function(e,t){e.shortcuts.add("Alt+F9","",a(t,"menubar")),e.shortcuts.add("Alt+F10,F10","",a(t,"toolbar")),e.shortcuts.add("Alt+F11","",a(t,"elementpath")),t.on("cancel",function(){e.focus()})},R=tinymce.util.Tools.resolve("tinymce.geom.Rect"),u=tinymce.util.Tools.resolve("tinymce.util.Delay"),E=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},k=function(e){return function(){return e}},l=k(!1),T=k(!0),H=l,S=T,M=function(){return N},N=(i={fold:function(e,t){return e()},is:H,isSome:H,isNone:S,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:M,ap:M,each:function(){},bind:M,flatten:M,exists:H,forall:S,filter:M,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:k("none()")},Object.freeze&&Object.freeze(i),i),P=function(n){var e=function(){return n},t=function(){return r},i=function(e){return e(n)},r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:S,isNone:H,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return P(e(n))},ap:function(e){return e.fold(M,function(e){return P(e(n))})},each:function(e){e(n)},bind:i,flatten:e,exists:i,forall:i,filter:function(e){return e(n)?r:N},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(H,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},D={some:P,none:M,from:function(e){return null===e||e===undefined?N:P(e)}},W=function(e){return e?e.getRoot().uiContainer:null},O={getUiContainerDelta:function(e){var t=W(e);if(t&&"static"!==v.DOM.getStyle(t,"position",!0)){var n=v.DOM.getPos(t),i=t.scrollLeft-n.x,r=t.scrollTop-n.y;return D.some({x:i,y:r})}return D.none()},setUiContainer:function(e,t){var n=v.DOM.select(e.settings.ui_container)[0];t.getRoot().uiContainer=n},getUiContainer:W,inheritUiContainer:function(e,t){return t.uiContainer=W(e)}},A=function(i,e,r){var o,s=[];if(e)return w.each(e.split(/[ ,]/),function(t){var e,n=function(){var e=i.selection;t.settings.stateSelector&&e.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&e.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})};"|"===t?o=null:(o||(o={type:"buttongroup",items:[]},s.push(o)),i.buttons[t]&&(e=t,"function"==typeof(t=i.buttons[e])&&(t=t()),t.type=t.type||"button",t.size=r,t=b.create(t),o.items.push(t),i.initialized?n():i.on("init",n)))}),{type:"toolbar",layout:"flow",items:s}},B=A,L=function(n,i){var e,t,r=[];if(w.each(!1===(t=(e=n).getParam("toolbar"))?[]:w.isArray(t)?w.grep(t,function(e){return 0<e.length}):function(e,t){for(var n=[],i=1;i<10;i++){var r=e["toolbar"+i];if(!r)break;n.push(r)}var o=e.toolbar?[e.toolbar]:[t];return 0<n.length?n:o}(e.settings,"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"),function(e){var t;(t=e)&&r.push(A(n,t,i))}),r.length)return{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:r}},I=v.DOM,z=function(e){return{left:e.x,top:e.y,width:e.w,height:e.h,right:e.x+e.w,bottom:e.y+e.h}},F=function(e,t){e.moveTo(t.left,t.top)},U=function(e,t,n,i,r,o){return o=z({x:t,y:n,w:o.w,h:o.h}),e&&(o=e({elementRect:z(i),contentAreaRect:z(r),panelRect:o})),o},V=function(x){var i,o=function(){return x.contextToolbars||[]},n=function(e,t){var n,i,r,o,s,a,l,u=x.getParam("inline_toolbar_position_handler");if(!x.removed){if(!e||!e.toolbar.panel)return c=x,void w.each(c.contextToolbars,function(e){e.panel&&e.panel.hide()});var c,d,f,h,m;l=["bc-tc","tc-bc","tl-bl","bl-tl","tr-br","br-tr"],s=e.toolbar.panel,t&&s.show(),d=e.element,f=I.getPos(x.getContentAreaContainer()),h=x.dom.getRect(d),"BODY"===(m=x.dom.getRoot()).nodeName&&(h.x-=m.ownerDocument.documentElement.scrollLeft||m.scrollLeft,h.y-=m.ownerDocument.documentElement.scrollTop||m.scrollTop),h.x+=f.x,h.y+=f.y,r=h,i=I.getRect(s.getEl()),o=I.getRect(x.getContentAreaContainer()||x.getBody());var g,p,v,b=O.getUiContainerDelta(s).getOr({x:0,y:0});if(r.x+=b.x,r.y+=b.y,i.x+=b.x,i.y+=b.y,o.x+=b.x,o.y+=b.y,"inline"!==I.getStyle(e.element,"display",!0)){var y=e.element.getBoundingClientRect();r.w=y.width,r.h=y.height}x.inline||(o.w=x.getDoc().documentElement.offsetWidth),x.selection.controlSelection.isResizable(e.element)&&r.w<25&&(r=R.inflate(r,0,8)),n=R.findBestRelativePosition(i,r,o,l),r=R.clamp(r,o),n?(a=R.relativePosition(i,r,n),F(s,U(u,a.x,a.y,r,o,i))):(o.h+=i.h,(r=R.intersect(o,r))?(n=R.findBestRelativePosition(i,r,o,["bc-tc","bl-tl","br-tr"]))?(a=R.relativePosition(i,r,n),F(s,U(u,a.x,a.y,r,o,i))):F(s,U(u,r.x,r.y,r,o,i)):s.hide()),g=s,v=function(e,t){return e===t},p=(p=n)?p.substr(0,2):"",w.each({t:"down",b:"up"},function(e,t){g.classes.toggle("arrow-"+e,v(t,p.substr(0,1)))}),w.each({l:"left",r:"right"},function(e,t){g.classes.toggle("arrow-"+e,v(t,p.substr(1,1)))})}},r=function(e){return function(){u.requestAnimationFrame(function(){x.selection&&n(a(x.selection.getNode()),e)})}},t=function(e){var t;if(e.toolbar.panel)return e.toolbar.panel.show(),void n(e);t=b.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:B(x,e.toolbar.items),oncancel:function(){x.focus()}}),O.setUiContainer(x,t),function(e){if(!i){var t=r(!0),n=O.getUiContainer(e);i=x.selection.getScrollContainer()||x.getWin(),I.bind(i,"scroll",t),I.bind(n,"scroll",t),x.on("remove",function(){I.unbind(i,"scroll",t),I.unbind(n,"scroll",t)})}}(t),(e.toolbar.panel=t).renderTo().reflow(),n(e)},s=function(){w.each(o(),function(e){e.panel&&e.panel.hide()})},a=function(e){var t,n,i,r=o();for(t=(i=x.$(e).parents().add(e)).length-1;0<=t;t--)for(n=r.length-1;0<=n;n--)if(r[n].predicate(i[t]))return{toolbar:r[n],element:i[t]};return null};x.on("click keyup setContent ObjectResized",function(e){("setcontent"!==e.type||e.selection)&&u.setEditorTimeout(x,function(){var e;(e=a(x.selection.getNode()))?(s(),t(e)):s()})}),x.on("blur hide contextmenu",s),x.on("ObjectResizeStart",function(){var e=a(x.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.hide()}),x.on("ResizeEditor ResizeWindow",r(!0)),x.on("nodeChange",r(!1)),x.on("remove",function(){w.each(o(),function(e){e.panel&&e.panel.remove()}),x.contextToolbars={}}),x.shortcuts.add("ctrl+shift+e > ctrl+shift+p","",function(){var e=a(x.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.items()[0].focus()})},Y=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},$=Y("function"),X=Y("number"),q=(r=Array.prototype.indexOf)===undefined?function(e,t){return ee(e,t)}:function(e,t){return r.call(e,t)},j=function(e,t){return Q(e,t).isSome()},J=function(e,t){for(var n=e.length,i=new Array(n),r=0;r<n;r++){var o=e[r];i[r]=t(o,r,e)}return i},G=function(e,t){for(var n=0,i=e.length;n<i;n++)t(e[n],n,e)},K=function(e,t){for(var n=[],i=0,r=e.length;i<r;i++){var o=e[i];t(o,i,e)&&n.push(o)}return n},Z=function(e,t){for(var n=0,i=e.length;n<i;n++){var r=e[n];if(t(r,n,e))return D.some(r)}return D.none()},Q=function(e,t){for(var n=0,i=e.length;n<i;n++)if(t(e[n],n,e))return D.some(n);return D.none()},ee=function(e,t){for(var n=0,i=e.length;n<i;++n)if(e[n]===t)return n;return-1},te=Array.prototype.push,ne=(Array.prototype.slice,$(Array.from)&&Array.from,{file:{title:"File",items:"newdocument restoredraft | preview | print"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen"},insert:{title:"Insert",items:"image link media template codesample inserttable | charmap hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | blockformats align | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code"},table:{title:"Table"},help:{title:"Help"}}),ie=function(e,t){return"|"===e?{name:"|",item:{text:"|"}}:t?{name:e,item:t}:null},re=function(e){return e&&"|"===e.item.text},oe=function(n,e,t,i){var r,o,s,a,l,u,c;return e?(o=e[i],a=!0):o=ne[i],o&&(r={text:o.title},s=[],w.each((o.items||"").split(/[ ,]/),function(e){var t=ie(e,n[e]);t&&s.push(t)}),a||w.each(n,function(e,t){var n;e.context!==i||(n=t,Q(s,function(e){return e.name===n}).isSome())||("before"===e.separator&&s.push({name:"|",item:{text:"|"}}),e.prependToContext?s.unshift(ie(t,e)):s.push(ie(t,e)),"after"===e.separator&&s.push({name:"|",item:{text:"|"}}))}),r.menu=J((l=t,u=K(s,function(e){return!1===l.hasOwnProperty(e.name)}),c=K(u,function(e,t,n){return!re(e)||!re(n[t-1])}),K(c,function(e,t,n){return!re(e)||0<t&&t<n.length-1})),function(e){return e.item}),!r.menu.length)?null:r},se=function(e){for(var t,n=[],i=function(e){var t,n=[],i=m(e);if(i)for(t in i)n.push(t);else for(t in ne)n.push(t);return n}(e),r=w.makeMap((t=e,t.getParam("removed_menuitems","")).split(/[ ,]/)),o=c(e),s="string"==typeof o?o.split(/[ ,]/):i,a=0;a<s.length;a++){var l=s[a],u=oe(e.menuItems,m(e),r,l);u&&n.push(u)}return n},ae=v.DOM,le=function(e){return{width:e.clientWidth,height:e.clientHeight}},ue=function(e,t,n){var i,r,o,s;i=e.getContainer(),r=e.getContentAreaContainer().firstChild,o=le(i),s=le(r),null!==t&&(t=Math.max(e.getParam("min_width",100,"number"),t),t=Math.min(e.getParam("max_width",65535,"number"),t),ae.setStyle(i,"width",t+(o.width-s.width)),ae.setStyle(r,"width",t)),n=Math.max(e.getParam("min_height",100,"number"),n),n=Math.min(e.getParam("max_height",65535,"number"),n),ae.setStyle(r,"height",n),x(e)},ce=ue,de=function(e,t,n){var i=e.getContentAreaContainer();ue(e,i.clientWidth+t,i.clientHeight+n)},fe=tinymce.util.Tools.resolve("tinymce.Env"),he=function(e,t,n){var i,r=e.settings[n];r&&r((i=t.getEl("body"),{element:function(){return i}}))},me=function(c,d,f){return function(e){var t,n,i,r,o,s=e.control,a=s.parents().filter("panel")[0],l=a.find("#"+d)[0],u=(t=f,n=d,w.grep(t,function(e){return e.name===n})[0]);i=d,r=a,o=f,w.each(o,function(e){var t=r.items().filter("#"+e.name)[0];t&&t.visible()&&e.name!==i&&(he(e,t,"onhide"),t.visible(!1))}),s.parent().items().each(function(e){e.active(!1)}),l&&l.visible()?(he(u,l,"onhide"),l.hide(),s.active(!1)):(l?l.show():(l=b.create({type:"container",name:d,layout:"stack",classes:"sidebar-panel",html:""}),a.prepend(l),he(u,l,"onrender")),he(u,l,"onshow"),s.active(!0)),x(c)}},ge=function(e){return!(fe.ie&&!(11<=fe.ie)||!e.sidebars)&&0<e.sidebars.length},pe=function(n){return{type:"panel",name:"sidebar",layout:"stack",classes:"sidebar",items:[{type:"toolbar",layout:"stack",classes:"sidebar-toolbar",items:w.map(n.sidebars,function(e){var t=e.settings;return{type:"button",icon:t.icon,image:t.image,tooltip:t.tooltip,onclick:me(n,e.name,n.sidebars)}})}]}},ve=function(e){var t=function(){e._skinLoaded=!0,s(e)};return function(){e.initialized?t():e.on("init",t)}},be=v.DOM,ye=function(e){return{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",border:e,html:""}},xe=function(t,e,n){var i,r,o,s,a;if(!1===g(t)&&n.skinUiCss?be.styleSheetLoader.load(n.skinUiCss,ve(t)):ve(t)(),i=e.panel=b.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[{type:"container",classes:"top-part",items:[!1===d(t)?null:{type:"menubar",border:"0 0 1 0",items:se(t)},L(t,f(t))]},ge(t)?(s=t,{type:"panel",layout:"stack",classes:"edit-aria-container",border:"1 0 0 0",items:[ye("0"),pe(s)]}):ye("1 0 0 0")]}),O.setUiContainer(t,i),"none"!==p(t)&&(r={type:"resizehandle",direction:p(t),onResizeStart:function(){var e=t.getContentAreaContainer().firstChild;o={width:e.clientWidth,height:e.clientHeight}},onResize:function(e){"both"===p(t)?ce(t,o.width+e.deltaX,o.height+e.deltaY):ce(t,null,o.height+e.deltaY)}}),t.getParam("statusbar",!0,"boolean")){var l=y.translate(["Powered by {0}",'<a href="https://www.tinymce.com/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce" rel="noopener" target="_blank" role="presentation" tabindex="-1">tinymce</a>']),u=t.getParam("branding",!0,"boolean")?{type:"label",classes:"branding",html:" "+l}:null;i.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath",editor:t},r,u]})}return _(t),t.on("SwitchMode",(a=i,function(e){a.find("*").disabled("readonly"===e.mode)})),i.renderBefore(n.targetNode).reflow(),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly"),n.width&&be.setStyle(i.getEl(),"width",n.width),t.on("remove",function(){i.remove(),i=null}),C(t,i),V(t),{iframeContainer:i.find("#iframe")[0].getEl(),editorContainer:i.getEl()}},we=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),_e=0,Ce={id:function(){return"mceu_"+_e++},create:function(e,t,n){var i=document.createElement(e);return v.DOM.setAttribs(i,t),"string"==typeof n?i.innerHTML=n:w.each(n,function(e){e.nodeType&&i.appendChild(e)}),i},createFragment:function(e){return v.DOM.createFragment(e)},getWindowSize:function(){return v.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var i=e.getBoundingClientRect();t=Math.max(i.width||i.right-i.left,e.offsetWidth),n=Math.max(i.height||i.bottom-i.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return v.DOM.getPos(e,t||Ce.getContainer())},getContainer:function(){return fe.container?fe.container:document.body},getViewPort:function(e){return v.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return v.DOM.addClass(e,t)},removeClass:function(e,t){return v.DOM.removeClass(e,t)},hasClass:function(e,t){return v.DOM.hasClass(e,t)},toggleClass:function(e,t,n){return v.DOM.toggleClass(e,t,n)},css:function(e,t,n){return v.DOM.setStyle(e,t,n)},getRuntimeStyle:function(e,t){return v.DOM.getStyle(e,t,!0)},on:function(e,t,n,i){return v.DOM.bind(e,t,n,i)},off:function(e,t,n){return v.DOM.unbind(e,t,n)},fire:function(e,t,n){return v.DOM.fire(e,t,n)},innerHtml:function(e,t){v.DOM.setHTML(e,t)}},Re=function(e){return"static"===Ce.getRuntimeStyle(e,"position")},Ee=function(e){return e.state.get("fixed")};function ke(e,t,n){var i,r,o,s,a,l,u,c,d,f;return d=Te(),o=(r=Ce.getPos(t,O.getUiContainer(e))).x,s=r.y,Ee(e)&&Re(document.body)&&(o-=d.x,s-=d.y),i=e.getEl(),a=(f=Ce.getSize(i)).width,l=f.height,u=(f=Ce.getSize(t)).width,c=f.height,"b"===(n=(n||"").split(""))[0]&&(s+=c),"r"===n[1]&&(o+=u),"c"===n[0]&&(s+=Math.round(c/2)),"c"===n[1]&&(o+=Math.round(u/2)),"b"===n[3]&&(s-=l),"r"===n[4]&&(o-=a),"c"===n[3]&&(s-=Math.round(l/2)),"c"===n[4]&&(o-=Math.round(a/2)),{x:o,y:s,w:a,h:l}}var Te=function(){var e=window,t=Math.max(e.pageXOffset,document.body.scrollLeft,document.documentElement.scrollLeft),n=Math.max(e.pageYOffset,document.body.scrollTop,document.documentElement.scrollTop);return{x:t,y:n,w:t+(e.innerWidth||document.documentElement.clientWidth),h:n+(e.innerHeight||document.documentElement.clientHeight)}},He=function(e){var t,n=O.getUiContainer(e);return n&&!Ee(e)?{x:0,y:0,w:(t=n).scrollWidth-1,h:t.scrollHeight-1}:Te()},Se={testMoveRel:function(e,t){for(var n=He(this),i=0;i<t.length;i++){var r=ke(this,e,t[i]);if(Ee(this)){if(0<r.x&&r.x+r.w<n.w&&0<r.y&&r.y+r.h<n.h)return t[i]}else if(r.x>n.x&&r.x+r.w<n.w&&r.y>n.y&&r.y+r.h<n.h)return t[i]}return t[0]},moveRel:function(e,t){"string"!=typeof t&&(t=this.testMoveRel(e,t));var n=ke(this,e,t);return this.moveTo(n.x,n.y)},moveBy:function(e,t){var n=this.layoutRect();return this.moveTo(n.x+e,n.y+t),this},moveTo:function(e,t){var n=this;function i(e,t,n){return e<0?0:t<e+n&&(e=t-n)<0?0:e}if(n.settings.constrainToViewport){var r=He(this),o=n.layoutRect();e=i(e,r.w,o.w),t=i(t,r.h,o.h)}var s=O.getUiContainer(n);return s&&Re(s)&&!Ee(n)&&(e-=s.scrollLeft,t-=s.scrollTop),s&&(e+=1,t+=1),n.state.get("rendered")?n.layoutRect({x:e,y:t}).repaint():(n.settings.x=e,n.settings.y=t),n.fire("move",{x:e,y:t}),n}},Me=tinymce.util.Tools.resolve("tinymce.util.Class"),Ne=tinymce.util.Tools.resolve("tinymce.util.EventDispatcher"),Pe=function(e){var t;if(e)return"number"==typeof e?{top:e=e||0,left:e,bottom:e,right:e}:(1===(t=(e=e.split(" ")).length)?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],10)||0,right:parseInt(e[1],10)||0,bottom:parseInt(e[2],10)||0,left:parseInt(e[3],10)||0})},De=function(i,e){function t(e){var t=parseFloat(function(e){var t=i.ownerDocument.defaultView;if(t){var n=t.getComputedStyle(i,null);return n?(e=e.replace(/[A-Z]/g,function(e){return"-"+e}),n.getPropertyValue(e)):null}return i.currentStyle[e]}(e));return isNaN(t)?0:t}return{top:t(e+"TopWidth"),right:t(e+"RightWidth"),bottom:t(e+"BottomWidth"),left:t(e+"LeftWidth")}};function We(){}function Oe(e){this.cls=[],this.cls._map={},this.onchange=e||We,this.prefix=""}w.extend(Oe.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){var t=void 0;for(t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),Oe.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)0<t&&(e+=" "),e+=this.prefix+this.cls[t];return e};var Ae,Be,Le,Ie=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,ze=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,Fe=/^\s*|\s*$/g,Ue=Me.extend({init:function(e){var o=this.match;function s(e,t,n){var i;function r(e){e&&t.push(e)}return r(function(t){if(t)return t=t.toLowerCase(),function(e){return"*"===t||e.type===t}}((i=Ie.exec(e.replace(Fe,"")))[1])),r(function(t){if(t)return function(e){return e._name===t}}(i[2])),r(function(n){if(n)return n=n.split("."),function(e){for(var t=n.length;t--;)if(!e.classes.contains(n[t]))return!1;return!0}}(i[3])),r(function(n,i,r){if(n)return function(e){var t=e[n]?e[n]():"";return i?"="===i?t===r:"*="===i?0<=t.indexOf(r):"~="===i?0<=(" "+t+" ").indexOf(" "+r+" "):"!="===i?t!==r:"^="===i?0===t.indexOf(r):"$="===i&&t.substr(t.length-r.length)===r:!!r}}(i[4],i[5],i[6])),r(function(i){var t;if(i)return(i=/(?:not\((.+)\))|(.+)/i.exec(i))[1]?(t=a(i[1],[]),function(e){return!o(e,t)}):(i=i[2],function(e,t,n){return"first"===i?0===t:"last"===i?t===n-1:"even"===i?t%2==0:"odd"===i?t%2==1:!!e[i]&&e[i]()})}(i[7])),t.pseudo=!!i[7],t.direct=n,t}function a(e,t){var n,i,r,o=[];do{if(ze.exec(""),(i=ze.exec(e))&&(e=i[3],o.push(i[1]),i[2])){n=i[3];break}}while(i);for(n&&a(n,t),e=[],r=0;r<o.length;r++)">"!==o[r]&&e.push(s(o[r],[],">"===o[r-1]));return t.push(e),t}this._selectors=a(e,[])},match:function(e,t){var n,i,r,o,s,a,l,u,c,d,f,h,m;for(n=0,i=(t=t||this._selectors).length;n<i;n++){for(m=e,h=0,r=(o=(s=t[n]).length)-1;0<=r;r--)for(u=s[r];m;){if(u.pseudo)for(c=d=(f=m.parent().items()).length;c--&&f[c]!==m;);for(a=0,l=u.length;a<l;a++)if(!u[a](m,c,d)){a=l+1;break}if(a===l){h++;break}if(r===o-1)break;m=m.parent()}if(h===o)return!0}return!1},find:function(e){var t,n,u=[],i=this._selectors;function c(e,t,n){var i,r,o,s,a,l=t[n];for(i=0,r=e.length;i<r;i++){for(a=e[i],o=0,s=l.length;o<s;o++)if(!l[o](a,i,r)){o=s+1;break}if(o===s)n===t.length-1?u.push(a):a.items&&c(a.items(),t,n+1);else if(l.direct)return;a.items&&c(a.items(),t,n)}}if(e.items){for(t=0,n=i.length;t<n;t++)c(e.items(),i[t],0);1<n&&(u=function(e){for(var t,n=[],i=e.length;i--;)(t=e[i]).__checked||(n.push(t),t.__checked=1);for(i=n.length;i--;)delete n[i].__checked;return n}(u))}return Ae||(Ae=Ue.Collection),new Ae(u)}}),Ve=Array.prototype.push,Ye=Array.prototype.slice;Le={length:0,init:function(e){e&&this.add(e)},add:function(e){return w.isArray(e)?Ve.apply(this,e):e instanceof Be?this.add(e.toArray()):Ve.call(this,e),this},set:function(e){var t,n=this,i=n.length;for(n.length=0,n.add(e),t=n.length;t<i;t++)delete n[t];return n},filter:function(t){var e,n,i,r,o=[];for("string"==typeof t?(t=new Ue(t),r=function(e){return t.match(e)}):r=t,e=0,n=this.length;e<n;e++)r(i=this[e])&&o.push(i);return new Be(o)},slice:function(){return new Be(Ye.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(e){return w.each(this,e),this},toArray:function(){return w.toArray(this)},indexOf:function(e){for(var t=this.length;t--&&this[t]!==e;);return t},reverse:function(){return new Be(w.toArray(this).reverse())},hasClass:function(e){return!!this[0]&&this[0].classes.contains(e)},prop:function(t,n){var e;return n!==undefined?(this.each(function(e){e[t]&&e[t](n)}),this):(e=this[0])&&e[t]?e[t]():void 0},exec:function(t){var n=w.toArray(arguments).slice(1);return this.each(function(e){e[t]&&e[t].apply(e,n)}),this},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(t){return this.each(function(e){e.classes.add(t)})},removeClass:function(t){return this.each(function(e){e.classes.remove(t)})}},w.each("fire on off show hide append prepend before after reflow".split(" "),function(n){Le[n]=function(){var t=w.toArray(arguments);return this.each(function(e){n in e&&e[n].apply(e,t)}),this}}),w.each("text name disabled active selected checked visible parent value data".split(" "),function(t){Le[t]=function(e){return this.prop(t,e)}}),Be=Me.extend(Le);var $e=Ue.Collection=Be,Xe=function(e){this.create=e.create};Xe.create=function(r,o){return new Xe({create:function(t,n){var i,e=function(e){t.set(n,e.value)};return t.on("change:"+n,function(e){r.set(o,e.value)}),r.on("change:"+o,e),(i=t._bindings)||(i=t._bindings=[],t.on("destroy",function(){for(var e=i.length;e--;)i[e]()})),i.push(function(){r.off("change:"+o,e)}),r.get(o)}})};var qe=tinymce.util.Tools.resolve("tinymce.util.Observable");function je(e){return 0<e.nodeType}var Je,Ge,Ke=Me.extend({Mixins:[qe],init:function(e){var t,n;for(t in e=e||{})(n=e[t])instanceof Xe&&(e[t]=n.create(this,t));this.data=e},set:function(t,n){var i,r,o=this.data[t];if(n instanceof Xe&&(n=n.create(this,t)),"object"==typeof t){for(i in t)this.set(i,t[i]);return this}return function e(t,n){var i,r;if(t===n)return!0;if(null===t||null===n)return t===n;if("object"!=typeof t||"object"!=typeof n)return t===n;if(w.isArray(n)){if(t.length!==n.length)return!1;for(i=t.length;i--;)if(!e(t[i],n[i]))return!1}if(je(t)||je(n))return t===n;for(i in r={},n){if(!e(t[i],n[i]))return!1;r[i]=!0}for(i in t)if(!r[i]&&!e(t[i],n[i]))return!1;return!0}(o,n)||(this.data[t]=n,r={target:this,name:t,value:n,oldValue:o},this.fire("change:"+t,r),this.fire("change",r)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(e){return Xe.create(this,e)},destroy:function(){this.fire("destroy")}}),Ze={},Qe={add:function(e){var t=e.parent();if(t){if(!t._layout||t._layout.isNative())return;Ze[t._id]||(Ze[t._id]=t),Je||(Je=!0,u.requestAnimationFrame(function(){var e,t;for(e in Je=!1,Ze)(t=Ze[e]).state.get("rendered")&&t.reflow();Ze={}},document.body))}},remove:function(e){Ze[e._id]&&delete Ze[e._id]}},et="onmousewheel"in document,tt=!1,nt=0,it={Statics:{classPrefix:"mce-"},isRtl:function(){return Ge.rtl},classPrefix:"mce-",init:function(t){var e,n,i=this;function r(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}i.settings=t=w.extend({},i.Defaults,t),i._id=t.id||"mceu_"+nt++,i._aria={role:t.role},i._elmCache={},i.$=we,i.state=new Ke({visible:!0,active:!1,disabled:!1,value:""}),i.data=new Ke(t.data),i.classes=new Oe(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,(e=t.classes)&&(i.Defaults&&(n=i.Defaults.classes)&&e!==n&&r(n),r(e)),w.each("title text name visible disabled active value".split(" "),function(e){e in t&&i[e](t[e])}),i.on("click",function(){if(i.disabled())return!1}),i.settings=t,i.borderBox=Pe(t.border),i.paddingBox=Pe(t.padding),i.marginBox=Pe(t.margin),t.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){var e=O.getUiContainer(this);return e||Ce.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e,t,n,i,r,o,s,a,l,u,c=this,d=c.settings,f=c.getEl();e=c.borderBox=c.borderBox||De(f,"border"),c.paddingBox=c.paddingBox||De(f,"padding"),c.marginBox=c.marginBox||De(f,"margin"),u=Ce.getSize(f),a=d.minWidth,l=d.minHeight,r=a||u.width,o=l||u.height,n=d.width,i=d.height,s=void 0!==(s=d.autoResize)?s:!n&&!i,n=n||r,i=i||o;var h=e.left+e.right,m=e.top+e.bottom,g=d.maxWidth||65535,p=d.maxHeight||65535;return c._layoutRect=t={x:d.x||0,y:d.y||0,w:n,h:i,deltaW:h,deltaH:m,contentW:n-h,contentH:i-m,innerW:n-h,innerH:i-m,startMinWidth:a||0,startMinHeight:l||0,minW:Math.min(r,g),minH:Math.min(o,p),maxW:g,maxH:p,autoResize:s,scrollW:0},c._lastLayoutRect={},t},layoutRect:function(e){var t,n,i,r,o,s=this,a=s._layoutRect;return a||(a=s.initLayoutRect()),e?(i=a.deltaW,r=a.deltaH,e.x!==undefined&&(a.x=e.x),e.y!==undefined&&(a.y=e.y),e.minW!==undefined&&(a.minW=e.minW),e.minH!==undefined&&(a.minH=e.minH),(n=e.w)!==undefined&&(n=(n=n<a.minW?a.minW:n)>a.maxW?a.maxW:n,a.w=n,a.innerW=n-i),(n=e.h)!==undefined&&(n=(n=n<a.minH?a.minH:n)>a.maxH?a.maxH:n,a.h=n,a.innerH=n-r),(n=e.innerW)!==undefined&&(n=(n=n<a.minW-i?a.minW-i:n)>a.maxW-i?a.maxW-i:n,a.innerW=n,a.w=n+i),(n=e.innerH)!==undefined&&(n=(n=n<a.minH-r?a.minH-r:n)>a.maxH-r?a.maxH-r:n,a.innerH=n,a.h=n+r),e.contentW!==undefined&&(a.contentW=e.contentW),e.contentH!==undefined&&(a.contentH=e.contentH),(t=s._lastLayoutRect).x===a.x&&t.y===a.y&&t.w===a.w&&t.h===a.h||((o=Ge.repaintControls)&&o.map&&!o.map[s._id]&&(o.push(s),o.map[s._id]=!0),t.x=a.x,t.y=a.y,t.w=a.w,t.h=a.h),s):a},repaint:function(){var e,t,n,i,r,o,s,a,l,u,c=this;l=document.createRange?function(e){return e}:Math.round,e=c.getEl().style,i=c._layoutRect,a=c._lastRepaintRect||{},o=(r=c.borderBox).left+r.right,s=r.top+r.bottom,i.x!==a.x&&(e.left=l(i.x)+"px",a.x=i.x),i.y!==a.y&&(e.top=l(i.y)+"px",a.y=i.y),i.w!==a.w&&(u=l(i.w-o),e.width=(0<=u?u:0)+"px",a.w=i.w),i.h!==a.h&&(u=l(i.h-s),e.height=(0<=u?u:0)+"px",a.h=i.h),c._hasBody&&i.innerW!==a.innerW&&(u=l(i.innerW),(n=c.getEl("body"))&&((t=n.style).width=(0<=u?u:0)+"px"),a.innerW=i.innerW),c._hasBody&&i.innerH!==a.innerH&&(u=l(i.innerH),(n=n||c.getEl("body"))&&((t=t||n.style).height=(0<=u?u:0)+"px"),a.innerH=i.innerH),c._lastRepaintRect=a,c.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,Ce.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){var n,i,r,o=this;return rt(o).on(e,"string"!=typeof(n=t)?n:function(e){return i||o.parentsAndSelf().each(function(e){var t=e.settings.callbacks;if(t&&(i=t[n]))return r=e,!1}),i?i.call(r,e):(e.action=n,void this.fire("execute",e))}),o},off:function(e,t){return rt(this).off(e,t),this},fire:function(e,t,n){if((t=t||{}).control||(t.control=this),t=rt(this).fire(e,t),!1!==n&&this.parent)for(var i=this.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return rt(this).has(e)},parents:function(e){var t,n=new $e;for(t=this.parent();t;t=t.parent())n.add(t);return e&&(n=n.filter(e)),n},parentsAndSelf:function(e){return new $e(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=we("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,i=n.getEl(n.ariaTarget);return void 0===t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&i.setAttribute("role"===e?e:"aria-"+e,t),n)},encode:function(e,t){return!1!==t&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return Ge.translate?Ge.translate(e):e},before:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this),!0),this},after:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this)),this},remove:function(){var t,e,n=this,i=n.getEl(),r=n.parent();if(n.items){var o=n.items().toArray();for(e=o.length;e--;)o[e].remove()}r&&r.items&&(t=[],r.items().each(function(e){e!==n&&t.push(e)}),r.items().set(t),r._lastRect=null),n._eventsRoot&&n._eventsRoot===n&&we(i).off();var s=n.getRoot().controlIdLookup;return s&&delete s[n._id],i&&i.parentNode&&i.parentNode.removeChild(i),n.state.set("rendered",!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(e){return we(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return we(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e,t,n,i,r,o=this,s=o.settings;for(i in o.$el=we(o.getEl()),o.state.set("rendered",!0),s)0===i.indexOf("on")&&o.on(i.substr(2),s[i]);if(o._eventsRoot){for(n=o.parent();!r&&n;n=n.parent())r=n._eventsRoot;if(r)for(i in r._nativeEvents)o._nativeEvents[i]=!0}ot(o),s.style&&(e=o.getEl())&&(e.setAttribute("style",s.style),e.style.cssText=s.style),o.settings.border&&(t=o.borderBox,o.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left}));var a=o.getRoot();for(var l in a.controlIdLookup||(a.controlIdLookup={}),(a.controlIdLookup[o._id]=o)._aria)o.aria(l,o._aria[l]);!1===o.state.get("visible")&&(o.getEl().style.display="none"),o.bindStates(),o.state.on("change:visible",function(e){var t,n=e.value;o.state.get("rendered")&&(o.getEl().style.display=!1===n?"none":"",o.getEl().getBoundingClientRect()),(t=o.parent())&&(t._lastRect=null),o.fire(n?"show":"hide"),Qe.add(o)}),o.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){var t,n,i,r,o,s,a=this.getEl(),l=a.parentNode,u=function(e,t){var n,i,r=e;for(n=i=0;r&&r!==t&&r.nodeType;)n+=r.offsetLeft||0,i+=r.offsetTop||0,r=r.offsetParent;return{x:n,y:i}}(a,l);return t=u.x,n=u.y,i=a.offsetWidth,r=a.offsetHeight,o=l.clientWidth,s=l.clientHeight,"end"===e?(t-=o-i,n-=s-r):"center"===e&&(t-=o/2-i/2,n-=s/2-r/2),l.scrollLeft=t,l.scrollTop=n,this},getRoot:function(){for(var e,t=this,n=[];t;){if(t.rootControl){e=t.rootControl;break}n.push(t),t=(e=t).parent()}e||(e=this);for(var i=n.length;i--;)n[i].rootControl=e;return e},reflow:function(){Qe.remove(this);var e=this.parent();return e&&e._layout&&!e._layout.isNative()&&e.reflow(),this}};function rt(n){return n._eventDispatcher||(n._eventDispatcher=new Ne({scope:n,toggleEvent:function(e,t){t&&Ne.isNative(e)&&(n._nativeEvents||(n._nativeEvents={}),n._nativeEvents[e]=!0,n.state.get("rendered")&&ot(n))}})),n._eventDispatcher}function ot(a){var e,t,n,l,i,r;function o(e){var t=a.getParentCtrl(e.target);t&&t.fire(e.type,e)}function s(){var e=l._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),l._lastHoverCtrl=null)}function u(e){var t,n,i,r=a.getParentCtrl(e.target),o=l._lastHoverCtrl,s=0;if(r!==o){if((n=(l._lastHoverCtrl=r).parents().toArray().reverse()).push(r),o){for((i=o.parents().toArray().reverse()).push(o),s=0;s<i.length&&n[s]===i[s];s++);for(t=i.length-1;s<=t;t--)(o=i[t]).fire("mouseleave",{target:o.getEl()})}for(t=s;t<n.length;t++)(r=n[t]).fire("mouseenter",{target:r.getEl()})}}function c(e){e.preventDefault(),"mousewheel"===e.type?(e.deltaY=-.025*e.wheelDelta,e.wheelDeltaX&&(e.deltaX=-.025*e.wheelDeltaX)):(e.deltaX=0,e.deltaY=e.detail),e=a.fire("wheel",e)}if(i=a._nativeEvents){for((n=a.parents().toArray()).unshift(a),e=0,t=n.length;!l&&e<t;e++)l=n[e]._eventsRoot;for(l||(l=n[n.length-1]||a),a._eventsRoot=l,t=e,e=0;e<t;e++)n[e]._eventsRoot=l;var d=l._delegates;for(r in d||(d=l._delegates={}),i){if(!i)return!1;"wheel"!==r||tt?("mouseenter"===r||"mouseleave"===r?l._hasMouseEnter||(we(l.getEl()).on("mouseleave",s).on("mouseover",u),l._hasMouseEnter=1):d[r]||(we(l.getEl()).on(r,o),d[r]=!0),i[r]=!1):et?we(a.getEl()).on("mousewheel",c):we(a.getEl()).on("DOMMouseScroll",c)}}}w.each("text title visible disabled active value".split(" "),function(t){it[t]=function(e){return 0===arguments.length?this.state.get(t):(void 0!==e&&this.state.set(t,e),this)}});var st=Ge=Me.extend(it),at=function(e){return!!e.getAttribute("data-mce-tabstop")};function lt(e){var o,r,n=e.root;function i(e){return e&&1===e.nodeType}try{o=document.activeElement}catch(t){o=document.body}function s(e){return i(e=e||o)?e.getAttribute("role"):null}function a(e){for(var t,n=e||o;n=n.parentNode;)if(t=s(n))return t}function l(e){var t=o;if(i(t))return t.getAttribute("aria-"+e)}function u(e){var t=e.tagName.toUpperCase();return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}function c(t){var r=[];return function e(t){if(1===t.nodeType&&"none"!==t.style.display&&!t.disabled){var n;(u(n=t)&&!n.hidden||at(n)||/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(s(n)))&&r.push(t);for(var i=0;i<t.childNodes.length;i++)e(t.childNodes[i])}}(t||n.getEl()),r}function d(e){var t,n;(n=(e=e||r).parents().toArray()).unshift(e);for(var i=0;i<n.length&&!(t=n[i]).settings.ariaRoot;i++);return t}function f(e,t){return e<0?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function h(e,t){var n=-1,i=d();t=t||c(i.getEl());for(var r=0;r<t.length;r++)t[r]===o&&(n=r);n+=e,i.lastAriaIndex=f(n,t)}function m(){"tablist"===a()?h(-1,c(o.parentNode)):r.parent().submenu?b():h(-1)}function g(){var e=s(),t=a();"tablist"===t?h(1,c(o.parentNode)):"menuitem"===e&&"menu"===t&&l("haspopup")?y():h(1)}function p(){h(-1)}function v(){var e=s(),t=a();"menuitem"===e&&"menubar"===t?y():"button"===e&&l("haspopup")?y({key:"down"}):h(1)}function b(){r.fire("cancel")}function y(e){e=e||{},r.fire("click",{target:o,aria:e})}return r=n.getParentCtrl(o),n.on("keydown",function(e){function t(e,t){u(o)||at(o)||"slider"!==s(o)&&!1!==t(e)&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,m);break;case 39:t(e,g);break;case 38:t(e,p);break;case 40:t(e,v);break;case 27:b();break;case 14:case 13:case 32:t(e,y);break;case 9:!function(e){if("tablist"===a()){var t=c(r.getEl("body"))[0];t&&t.focus()}else h(e.shiftKey?-1:1)}(e),e.preventDefault()}}),n.on("focusin",function(e){o=e.target,r=e.control}),{focusFirst:function(e){var t=d(e),n=c(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?f(t.lastAriaIndex,n):f(0,n)}}}var ut={},ct=st.extend({init:function(e){var t=this;t._super(e),(e=t.settings).fixed&&t.state.set("fixed",!0),t._items=new $e,t.isRtl()&&t.classes.add("rtl"),t.bodyClasses=new Oe(function(){t.state.get("rendered")&&(t.getEl("body").className=this.toString())}),t.bodyClasses.prefix=t.classPrefix,t.classes.add("container"),t.bodyClasses.add("container-body"),e.containerCls&&t.classes.add(e.containerCls),t._layout=b.create((e.layout||"")+"layout"),t.settings.items?t.add(t.settings.items):t.add(t.render()),t._hasBody=!0},items:function(){return this._items},find:function(e){return(e=ut[e]=ut[e]||new Ue(e)).find(this)},add:function(e){return this.items().add(this.create(e)).parent(this),this},focus:function(e){var t,n,i,r=this;if(!e||!(n=r.keyboardNav||r.parents().eq(-1)[0].keyboardNav))return i=r.find("*"),r.statusbar&&i.add(r.statusbar.items()),i.each(function(e){if(e.settings.autofocus)return t=null,!1;e.canFocus&&(t=t||e)}),t&&t.focus(),r;n.focusFirst(r)},replace:function(e,t){for(var n,i=this.items(),r=i.length;r--;)if(i[r]===e){i[r]=t;break}0<=r&&((n=t.getEl())&&n.parentNode.removeChild(n),(n=e.getEl())&&n.parentNode.removeChild(n)),t.parent(this)},create:function(e){var t,n=this,i=[];return w.isArray(e)||(e=[e]),w.each(e,function(e){e&&(e instanceof st||("string"==typeof e&&(e={type:e}),t=w.extend({},n.settings.defaults,e),e.type=t.type=t.type||e.type||n.settings.defaultType||(t.defaults?t.defaults.type:null),e=b.create(t)),i.push(e))}),i},renderNew:function(){var i=this;return i.items().each(function(e,t){var n;e.parent(i),e.state.get("rendered")||((n=i.getEl("body")).hasChildNodes()&&t<=n.childNodes.length-1?we(n.childNodes[t]).before(e.renderHtml()):we(n).append(e.renderHtml()),e.postRender(),Qe.add(e))}),i._layout.applyClasses(i.items().filter(":visible")),i._lastRect=null,i},append:function(e){return this.add(e).renderNew()},prepend:function(e){return this.items().set(this.create(e).concat(this.items().toArray())),this.renderNew()},insert:function(e,t,n){var i,r,o;return e=this.create(e),i=this.items(),!n&&t<i.length-1&&(t+=1),0<=t&&t<i.length&&(r=i.slice(0,t).toArray(),o=i.slice(t).toArray(),i.set(r.concat(e,o))),this.renderNew()},fromJSON:function(e){for(var t in e)this.find("#"+t).value(e[t]);return this},toJSON:function(){var i={};return this.find("*").each(function(e){var t=e.name(),n=e.value();t&&void 0!==n&&(i[t]=n)}),i},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e,t=this;return t.items().exec("postRender"),t._super(),t._layout.postRender(t),t.state.set("rendered",!0),t.settings.style&&t.$el.css(t.settings.style),t.settings.border&&(e=t.borderBox,t.$el.css({"border-top-width":e.top,"border-right-width":e.right,"border-bottom-width":e.bottom,"border-left-width":e.left})),t.parent()||(t.keyboardNav=lt({root:t})),t},initLayoutRect:function(){var e=this._super();return this._layout.recalc(this),e},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;if(!n||n.w!==t.w||n.h!==t.h)return e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0},reflow:function(){var e;if(Qe.remove(this),this.visible()){for(st.repaintControls=[],st.repaintControls.map={},this.recalc(),e=st.repaintControls.length;e--;)st.repaintControls[e].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),st.repaintControls=[]}return this}});function dt(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}function ft(e,h){var m,g,t,p,v,b,y,x=h.document||document;h=h||{};var w=x.getElementById(h.handle||e);t=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=(t=x,u=Math.max,n=t.documentElement,i=t.body,r=u(n.scrollWidth,i.scrollWidth),o=u(n.clientWidth,i.clientWidth),s=u(n.offsetWidth,i.offsetWidth),a=u(n.scrollHeight,i.scrollHeight),l=u(n.clientHeight,i.clientHeight),{width:r<s?o:r,height:a<u(n.offsetHeight,i.offsetHeight)?l:a});dt(e),e.preventDefault(),g=e.button,c=w,b=e.screenX,y=e.screenY,d=window.getComputedStyle?window.getComputedStyle(c,null).getPropertyValue("cursor"):c.runtimeStyle.cursor,m=we("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:d}).appendTo(x.body),we(x).on("mousemove touchmove",v).on("mouseup touchend",p),h.start(e)},v=function(e){if(dt(e),e.button!==g)return p(e);e.deltaX=e.screenX-b,e.deltaY=e.screenY-y,e.preventDefault(),h.drag(e)},p=function(e){dt(e),we(x).off("mousemove touchmove",v).off("mouseup touchend",p),m.remove(),h.stop&&h.stop(e)},this.destroy=function(){we(w).off()},we(w).on("mousedown touchstart",t)}var ht,mt,gt,pt,vt={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var p=this,v=2;function n(){var m,g,e;function t(e,t,n,i,r,o){var s,a,l,u,c,d,f,h;if(a=p.getEl("scroll"+e)){if(f=t.toLowerCase(),h=n.toLowerCase(),we(p.getEl("absend")).css(f,p.layoutRect()[i]-1),!r)return void we(a).css("display","none");we(a).css("display","block"),s=p.getEl("body"),l=p.getEl("scroll"+e+"t"),u=s["client"+n]-2*v,c=(u-=m&&g?a["client"+o]:0)/s["scroll"+n],(d={})[f]=s["offset"+t]+v,d[h]=u,we(a).css(d),(d={})[f]=s["scroll"+t]*c,d[h]=u*c,we(l).css(d)}}e=p.getEl("body"),m=e.scrollWidth>e.clientWidth,g=e.scrollHeight>e.clientHeight,t("h","Left","Width","contentW",m,"Height"),t("v","Top","Height","contentH",g,"Width")}p.settings.autoScroll&&(p._hasScroll||(p._hasScroll=!0,function(){function e(s,a,l,u,c){var d,e=p._id+"-scroll"+s,t=p.classPrefix;we(p.getEl()).append('<div id="'+e+'" class="'+t+"scrollbar "+t+"scrollbar-"+s+'"><div id="'+e+'t" class="'+t+'scrollbar-thumb"></div></div>'),p.draghelper=new ft(e+"t",{start:function(){d=p.getEl("body")["scroll"+a],we("#"+e).addClass(t+"active")},drag:function(e){var t,n,i,r,o=p.layoutRect();n=o.contentW>o.innerW,i=o.contentH>o.innerH,r=p.getEl("body")["client"+l]-2*v,t=(r-=n&&i?p.getEl("scroll"+s)["client"+c]:0)/p.getEl("body")["scroll"+l],p.getEl("body")["scroll"+a]=d+e["delta"+u]/t},stop:function(){we("#"+e).removeClass(t+"active")}})}p.classes.add("scroll"),e("v","Top","Height","Y","Width"),e("h","Left","Width","X","Height")}(),p.on("wheel",function(e){var t=p.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),we(p.getEl("body")).on("scroll",n)),n())}},bt=ct.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[vt],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),void 0===n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}}),yt={resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(e,t){if(e<=1||t<=1){var n=Ce.getWindowSize();e=e<=1?e*n.w:e,t=t<=1?t*n.h:t}return this._layoutRect.autoResize=!1,this.layoutRect({minW:e,minH:t,w:e,h:t}).reflow()},resizeBy:function(e,t){var n=this.layoutRect();return this.resizeTo(n.w+e,n.h+t)}},xt=[],wt=[];function _t(e,t){for(;e;){if(e===t)return!0;e=e.parent()}}function Ct(){ht||(ht=function(e){2!==e.button&&function(e){for(var t=xt.length;t--;){var n=xt[t],i=n.getParentCtrl(e.target);if(n.settings.autohide){if(i&&(_t(i,n)||n.parent()===i))continue;(e=n.fire("autohide",{target:e.target})).isDefaultPrevented()||n.hide()}}}(e)},we(document).on("click touchstart",ht))}function Rt(r){var e=Ce.getViewPort().y;function t(e,t){for(var n,i=0;i<xt.length;i++)if(xt[i]!==r)for(n=xt[i].parent();n&&(n=n.parent());)n===r&&xt[i].fixed(e).moveBy(0,t).repaint()}r.settings.autofix&&(r.state.get("fixed")?r._autoFixY>e&&(r.fixed(!1).layoutRect({y:r._autoFixY}).repaint(),t(!1,r._autoFixY-e)):(r._autoFixY=r.layoutRect().y,r._autoFixY<e&&(r.fixed(!0).layoutRect({y:0}).repaint(),t(!0,e-r._autoFixY))))}function Et(e,t){var n,i,r=kt.zIndex||65535;if(e)wt.push(t);else for(n=wt.length;n--;)wt[n]===t&&wt.splice(n,1);if(wt.length)for(n=0;n<wt.length;n++)wt[n].modal&&(r++,i=wt[n]),wt[n].getEl().style.zIndex=r,wt[n].zIndex=r,r++;var o=we("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];i?we(o).css("z-index",i.zIndex-1):o&&(o.parentNode.removeChild(o),pt=!1),kt.currentZIndex=r}var kt=bt.extend({Mixins:[Se,yt],init:function(e){var i=this;i._super(e),(i._eventsRoot=i).classes.add("floatpanel"),e.autohide&&(Ct(),function(){if(!gt){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;gt=function(){document.all&&t===e.clientWidth&&n===e.clientHeight||(t=e.clientWidth,n=e.clientHeight,kt.hideAll())},we(window).on("resize",gt)}}(),xt.push(i)),e.autofix&&(mt||(mt=function(){var e;for(e=xt.length;e--;)Rt(xt[e])},we(window).on("scroll",mt)),i.on("move",function(){Rt(this)})),i.on("postrender show",function(e){if(e.control===i){var t,n=i.classPrefix;i.modal&&!pt&&((t=we("#"+n+"modal-block",i.getContainerElm()))[0]||(t=we('<div id="'+n+'modal-block" class="'+n+"reset "+n+'fade"></div>').appendTo(i.getContainerElm())),u.setTimeout(function(){t.addClass(n+"in"),we(i.getEl()).addClass(n+"in")}),pt=!0),Et(!0,i)}}),i.on("show",function(){i.parents().each(function(e){if(e.state.get("fixed"))return i.fixed(!0),!1})}),e.popover&&(i._preBodyHtml='<div class="'+i.classPrefix+'arrow"></div>',i.classes.add("popover").add("bottom").add(i.isRtl()?"end":"start")),i.aria("label",e.ariaLabel),i.aria("labelledby",i._id),i.aria("describedby",i.describedBy||i._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!==e){if(t.state.get("rendered")){var n=Ce.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e,t=this._super();for(e=xt.length;e--&&xt[e]!==this;);return-1===e&&xt.push(this),t},hide:function(){return Tt(this),Et(!1,this),this._super()},hideAll:function(){kt.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),Et(!1,this)),this},remove:function(){Tt(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function Tt(e){var t;for(t=xt.length;t--;)xt[t]===e&&xt.splice(t,1);for(t=wt.length;t--;)wt[t]===e&&wt.splice(t,1)}kt.hideAll=function(){for(var e=xt.length;e--;){var t=xt[e];t&&t.settings.autohide&&(t.hide(),xt.splice(e,1))}};var Ht=function(e,t){return!(!e||t.settings.ui_container)},St=function(s,e,t){var a,n,l=v.DOM,i=s.getParam("fixed_toolbar_container");i&&(n=l.select(i)[0]);var r=function(){if(a&&a.moveRel&&a.visible()&&!a._fixed){var e=s.selection.getScrollContainer(),t=s.getBody(),n=0,i=0;if(e){var r=l.getPos(t),o=l.getPos(e);n=Math.max(0,o.x-r.x),i=Math.max(0,o.y-r.y)}a.fixed(!1).moveRel(t,s.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(n,i)}},o=function(){a&&(a.show(),r(),l.addClass(s.getBody(),"mce-edit-focus"))},u=function(){a&&(a.hide(),kt.hideAll(),l.removeClass(s.getBody(),"mce-edit-focus"))},c=function(){a?a.visible()||o():(a=e.panel=b.create({type:n?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:Ht(n,s),fixed:Ht(n,s),border:1,items:[!1===d(s)?null:{type:"menubar",border:"0 0 1 0",items:se(s)},L(s,f(s))]}),O.setUiContainer(s,a),_(s),n?a.renderTo(n).reflow():a.renderTo().reflow(),C(s,a),o(),V(s),s.on("nodeChange",r),s.on("ResizeWindow",r),s.on("activate",o),s.on("deactivate",u),s.nodeChanged())};return s.settings.content_editable=!0,s.on("focus",function(){!1===g(s)&&t.skinUiCss?l.styleSheetLoader.load(t.skinUiCss,c,c):c()}),s.on("blur hide",u),s.on("remove",function(){a&&(a.remove(),a=null)}),!1===g(s)&&t.skinUiCss?l.styleSheetLoader.load(t.skinUiCss,ve(s)):ve(s)(),{}};function Mt(i,r){var o,s,a=this,l=st.classPrefix;a.show=function(e,t){function n(){o&&(we(i).append('<div class="'+l+"throbber"+(r?" "+l+"throbber-inline":"")+'"></div>'),t&&t())}return a.hide(),o=!0,e?s=u.setTimeout(n,e):n(),a},a.hide=function(){var e=i.lastChild;return u.clearTimeout(s),e&&-1!==e.className.indexOf("throbber")&&e.parentNode.removeChild(e),o=!1,a}}var Nt=function(e,t){var n;e.on("ProgressState",function(e){n=n||new Mt(t.panel.getEl("body")),e.state?n.show(e.time):n.hide()})},Pt=function(e,t,n){var i=function(e){var t=e.settings,n=t.skin,i=t.skin_url;if(!1!==n){var r=n||"lightgray";i=i?e.documentBaseURI.toAbsolute(i):h.baseURL+"/skins/"+r}return i}(e);return i&&(n.skinUiCss=i+"/skin.min.css",e.contentCSS.push(i+"/content"+(e.inline?".inline":"")+".min.css")),Nt(e,t),e.getParam("inline",!1,"boolean")?St(e,t,n):xe(e,t,n)},Dt=st.extend({Mixins:[Se],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().lastChild.innerHTML=t.encode(e.value)}),t._super()},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=131070}}),Wt=st.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.canFocus=!0,i.tooltip&&!1!==Wt.tooltips&&(r.on("mouseenter",function(e){var t=r.tooltip().moveTo(-65535);if(e.control===r){var n=t.text(i.tooltip).show().testMoveRel(r.getEl(),["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===n),t.classes.toggle("tooltip-nw","bc-tl"===n),t.classes.toggle("tooltip-ne","bc-tr"===n),t.moveRel(r.getEl(),n)}else t.hide()}),r.on("mouseleave mousedown click",function(){r.tooltip().remove(),r._tooltip=null})),r.aria("label",i.ariaLabel||i.tooltip)},tooltip:function(){return this._tooltip||(this._tooltip=new Dt({type:"tooltip"}),O.inheritUiContainer(this,this._tooltip),this._tooltip.renderTo()),this._tooltip},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){var t=this;function n(e){t.aria("disabled",e),t.classes.toggle("disabled",e)}function i(e){t.aria("pressed",e),t.classes.toggle("active",e)}return t.state.on("change:disabled",function(e){n(e.value)}),t.state.on("change:active",function(e){i(e.value)}),t.state.get("disabled")&&n(!0),t.state.get("active")&&i(!0),t._super()},remove:function(){this._super(),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}}),Ot=Wt.extend({Defaults:{value:0},init:function(e){this._super(e),this.classes.add("progress"),this.settings.filter||(this.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div class="'+t+'bar-container"><div class="'+t+'bar"></div></div><div class="'+t+'text">0%</div></div>'},postRender:function(){return this._super(),this.value(this.settings.value),this},bindStates:function(){var t=this;function n(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}return t.state.on("change:value",function(e){n(e.value)}),n(t.state.get("value")),t._super()}}),At=function(e,t){e.getEl().lastChild.textContent=t+(e.progressBar?" "+e.progressBar.value()+"%":"")},Bt=st.extend({Mixins:[Se],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),t.maxWidth=e.maxWidth,e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||0<e.timeout)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new Ot),t.on("click",function(e){-1!==e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e,t=this,n=t.classPrefix,i="",r="",o="";return t.icon&&(i='<i class="'+n+"ico "+n+"i-"+t.icon+'"></i>'),e=' style="max-width: '+t.maxWidth+"px;"+(t.color?"background-color: "+t.color+';"':'"'),t.closeButton&&(r='<button type="button" class="'+n+'close" aria-hidden="true">\xd7</button>'),t.progressBar&&(o=t.progressBar.renderHtml()),'<div id="'+t._id+'" class="'+t.classes+'"'+e+' role="presentation">'+i+'<div class="'+n+'notification-inner">'+t.state.get("text")+"</div>"+o+r+'<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;" aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div></div>'},postRender:function(){var e=this;return u.setTimeout(function(){e.$el.addClass(e.classPrefix+"in"),At(e,e.state.get("text"))},100),e._super()},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().firstChild.innerHTML=e.value,At(t,e.value)}),t.progressBar&&(t.progressBar.bindStates(),t.progressBar.state.on("change:value",function(e){At(t,t.state.get("text"))})),t._super()},close:function(){return this.fire("close").isDefaultPrevented()||this.remove(),this},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=65534}});function Lt(o){var s=function(e){return e.inline?e.getElement():e.getContentAreaContainer()};return{open:function(e,t){var n,i=w.extend(e,{maxWidth:(n=s(o),Ce.getSize(n).width)}),r=new Bt(i);return 0<(r.args=i).timeout&&(r.timer=setTimeout(function(){r.close(),t()},i.timeout)),r.on("close",function(){t()}),r.renderTo(),r},close:function(e){e.close()},reposition:function(e){G(e,function(e){e.moveTo(0,0)}),function(n){if(0<n.length){var e=n.slice(0,1)[0],t=s(o);e.moveRel(t,"tc-tc"),G(n,function(e,t){0<t&&e.moveRel(n[t-1].getEl(),"bc-tc")})}}(e)},getArgs:function(e){return e.args}}}var It=[],zt="";function Ft(e){var t,n=we("meta[name=viewport]")[0];!1!==fe.overrideViewPort&&(n||((n=document.createElement("meta")).setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),(t=n.getAttribute("content"))&&void 0!==zt&&(zt=t),n.setAttribute("content",e?"width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0":zt))}function Ut(e,t){(function(){for(var e=0;e<It.length;e++)if(It[e]._fullscreen)return!0;return!1})()&&!1===t&&we([document.documentElement,document.body]).removeClass(e+"fullscreen")}var Vt=kt.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.classes.add("rtl"),n.classes.add("window"),n.bodyClasses.add("window-body"),n.state.set("fixed",!0),e.buttons&&(n.statusbar=new bt({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.classes.add("foot"),n.statusbar.parent(n)),n.on("click",function(e){var t=n.classPrefix+"close";(Ce.hasClass(e.target,t)||Ce.hasClass(e.target.parentNode,t))&&n.close()}),n.on("cancel",function(){n.close()}),n.on("move",function(e){e.control===n&&kt.hideAll()}),n.aria("describedby",n.describedBy||n._id+"-none"),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e,t,n,i,r=this,o=r.statusbar;r._fullscreen&&(r.layoutRect(Ce.getWindowSize()),r.layoutRect().contentH=r.layoutRect().innerH),r._super(),e=r.layoutRect(),r.settings.title&&!r._fullscreen&&(t=e.headerW)>e.w&&(n=e.x-Math.max(0,t/2),r.layoutRect({w:t,x:n}),i=!0),o&&(o.layoutRect({w:r.layoutRect().innerW}).recalc(),(t=o.layoutRect().minW+e.deltaW)>e.w&&(n=e.x-Math.max(0,t-e.w),r.layoutRect({w:t,x:n}),i=!0)),i&&r.recalc()},initLayoutRect:function(){var e,t=this,n=t._super(),i=0;if(t.settings.title&&!t._fullscreen){e=t.getEl("head");var r=Ce.getSize(e);n.headerW=r.width,n.headerH=r.height,i+=n.headerH}t.statusbar&&(i+=t.statusbar.layoutRect().h),n.deltaH+=i,n.minH+=i,n.h+=i;var o=Ce.getWindowSize();return n.x=t.settings.x||Math.max(0,o.w/2-n.w/2),n.y=t.settings.y||Math.max(0,o.h/2-n.h/2),n},renderHtml:function(){var e=this,t=e._layout,n=e._id,i=e.classPrefix,r=e.settings,o="",s="",a=r.html;return e.preRender(),t.preRender(e),r.title&&(o='<div id="'+n+'-head" class="'+i+'window-head"><div id="'+n+'-title" class="'+i+'title">'+e.encode(r.title)+'</div><div id="'+n+'-dragh" class="'+i+'dragh"></div><button type="button" class="'+i+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),r.url&&(a='<iframe src="'+r.url+'" tabindex="-1"></iframe>'),void 0===a&&(a=t.renderHtml(e)),e.statusbar&&(s=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+a+"</div>"+s+"</div></div>"},fullscreen:function(e){var n,t,i=this,r=document.documentElement,o=i.classPrefix;if(e!==i._fullscreen)if(we(window).on("resize",function(){var e;if(i._fullscreen)if(n)i._timer||(i._timer=u.setTimeout(function(){var e=Ce.getWindowSize();i.moveTo(0,0).resizeTo(e.w,e.h),i._timer=0},50));else{e=(new Date).getTime();var t=Ce.getWindowSize();i.moveTo(0,0).resizeTo(t.w,t.h),50<(new Date).getTime()-e&&(n=!0)}}),t=i.layoutRect(),i._fullscreen=e){i._initial={x:t.x,y:t.y,w:t.w,h:t.h},i.borderBox=Pe("0"),i.getEl("head").style.display="none",t.deltaH-=t.headerH+2,we([r,document.body]).addClass(o+"fullscreen"),i.classes.add("fullscreen");var s=Ce.getWindowSize();i.moveTo(0,0).resizeTo(s.w,s.h)}else i.borderBox=Pe(i.settings.border),i.getEl("head").style.display="",t.deltaH+=t.headerH,we([r,document.body]).removeClass(o+"fullscreen"),i.classes.remove("fullscreen"),i.moveTo(i._initial.x,i._initial.y).resizeTo(i._initial.w,i._initial.h);return i.reflow()},postRender:function(){var t,n=this;setTimeout(function(){n.classes.add("in"),n.fire("open")},0),n._super(),n.statusbar&&n.statusbar.postRender(),n.focus(),this.dragHelper=new ft(n._id+"-dragh",{start:function(){t={x:n.layoutRect().x,y:n.layoutRect().y}},drag:function(e){n.moveTo(t.x+e.deltaX,t.y+e.deltaY)}}),n.on("submit",function(e){e.isDefaultPrevented()||n.close()}),It.push(n),Ft(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e,t=this;for(t.dragHelper.destroy(),t._super(),t.statusbar&&this.statusbar.remove(),Ut(t.classPrefix,!1),e=It.length;e--;)It[e]===t&&It.splice(e,1);Ft(0<It.length)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});!function(){if(!fe.desktop){var n={w:window.innerWidth,h:window.innerHeight};u.setInterval(function(){var e=window.innerWidth,t=window.innerHeight;n.w===e&&n.h===t||(n={w:e,h:t},we(window).trigger("resize"))},100)}we(window).on("resize",function(){var e,t,n=Ce.getWindowSize();for(e=0;e<It.length;e++)t=It[e].layoutRect(),It[e].moveTo(It[e].settings.x||Math.max(0,n.w/2-t.w/2),It[e].settings.y||Math.max(0,n.h/2-t.h/2))})}();var Yt=Vt.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(e){var t,i=e.callback||function(){};function n(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),i(t)}}}switch(e.buttons){case Yt.OK_CANCEL:t=[n("Ok",!0,!0),n("Cancel",!1)];break;case Yt.YES_NO:case Yt.YES_NO_CANCEL:t=[n("Yes",1,!0),n("No",0)],e.buttons===Yt.YES_NO_CANCEL&&t.push(n("Cancel",-1));break;default:t=[n("Ok",!0,!0)]}return new Vt({padding:20,x:e.x,y:e.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:t,title:e.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:e.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:e.onClose,onCancel:function(){i(!1)}}).renderTo(document.body).reflow()},alert:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,Yt.msgBox(e)},confirm:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,e.buttons=Yt.OK_CANCEL,Yt.msgBox(e)}}}),$t=function(n){return{renderUI:function(e){return Pt(n,this,e)},resizeTo:function(e,t){return ce(n,e,t)},resizeBy:function(e,t){return de(n,e,t)},getNotificationManagerImpl:function(){return Lt(n)},getWindowManagerImpl:function(){return{open:function(n,e,t){var i;return n.title=n.title||" ",n.url=n.url||n.file,n.url&&(n.width=parseInt(n.width||320,10),n.height=parseInt(n.height||240,10)),n.body&&(n.items={defaults:n.defaults,type:n.bodyType||"form",items:n.body,data:n.data,callbacks:n.commands}),n.url||n.buttons||(n.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),(i=new Vt(n)).on("close",function(){t(i)}),n.data&&i.on("postRender",function(){this.find("*").each(function(e){var t=e.name();t in n.data&&e.value(n.data[t])})}),i.features=n||{},i.params=e||{},i=i.renderTo(document.body).reflow()},alert:function(e,t,n){var i;return(i=Yt.alert(e,function(){t()})).on("close",function(){n(i)}),i},confirm:function(e,t,n){var i;return(i=Yt.confirm(e,function(e){t(e)})).on("close",function(){n(i)}),i},close:function(e){e.close()},getParams:function(e){return e.params},setParams:function(e,t){e.params=t}}}}},Xt=Me.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=w.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t,n,i,r,o=this.settings;t=o.firstControlClass,n=o.lastControlClass,e.each(function(e){e.classes.remove(t).remove(n).add(o.controlClass),e.visible()&&(i||(i=e),r=e)}),i&&i.classes.add(t),r&&r.classes.add(n)},renderHtml:function(e){var t="";return this.applyClasses(e.items()),e.items().each(function(e){t+=e.renderHtml()}),t},recalc:function(){},postRender:function(){},isNative:function(){return!1}}),qt=Xt.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}}),jt=Wt.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t,n=this;n._super(e),e=n.settings,t=n.settings.size,n.on("click mousedown",function(e){e.preventDefault()}),n.on("touchstart",function(e){n.fire("click",e),e.preventDefault()}),e.subtype&&n.classes.add(e.subtype),t&&n.classes.add("btn-"+t),e.icon&&n.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e,t=this.getEl().firstChild;t&&((e=t.style).width=e.height="100%"),this._super()},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a="",l=n.settings;return(e=l.image)?(o="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",s&&(n.classes.add("btn-has-text"),a='<span class="'+r+'txt">'+n.encode(s)+"</span>"),o=o?r+"ico "+r+"i-"+o:"",t="boolean"==typeof l.active?' aria-pressed="'+l.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" tabindex="-1"'+t+'><button id="'+i+'-button" role="presentation" type="button" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+a+"</button></div>"},bindStates:function(){var o=this,n=o.$,i=o.classPrefix+"txt";function s(e){var t=n("span."+i,o.getEl());e?(t[0]||(n("button:first",o.getEl()).append('<span class="'+i+'"></span>'),t=n("span."+i,o.getEl())),t.html(o.encode(e))):t.remove(),o.classes.toggle("btn-has-text",!!e)}return o.state.on("change:text",function(e){s(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r),s(o.state.get("text"))}),o._super()}}),Jt=jt.extend({init:function(e){e=w.extend({text:"Browse...",multiple:!1,accept:null},e),this._super(e),this.classes.add("browsebutton"),e.multiple&&this.classes.add("multiple")},postRender:function(){var n=this,t=Ce.create("input",{type:"file",id:n._id+"-browse",accept:n.settings.accept});n._super(),we(t).on("change",function(e){var t=e.target.files;n.value=function(){return t.length?n.settings.multiple?t:t[0]:null},e.preventDefault(),t.length&&n.fire("change",e)}),we(t).on("click",function(e){e.stopPropagation()}),we(n.getEl("button")).on("click",function(e){e.stopPropagation(),t.click()}),n.getEl().appendChild(t)},remove:function(){we(this.getEl("button")).off(),we(this.getEl("input")).off(),this._super()}}),Gt=ct.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}}),Kt=Wt.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div>"},bindStates:function(){var o=this;function t(e){o.classes.toggle("checked",e),o.aria("checked",e)}return o.state.on("change:text",function(e){o.getEl("al").firstChild.data=o.translate(e.value)}),o.state.on("change:checked change:value",function(e){o.fire("change"),t(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;if(void 0===t)return o.settings.icon;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r)}),o.state.get("checked")&&t(!0),o._super()}}),Zt=tinymce.util.Tools.resolve("tinymce.util.VK"),Qt=Wt.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.classes.add("combobox"),r.subinput=!0,r.ariaTarget="inp",i.menu=i.menu||i.values,i.menu&&(i.icon="caret"),r.on("click",function(e){var t=e.target,n=r.getEl();if(we.contains(n,t)||t===n)for(;t&&t!==n;)t.id&&-1!==t.id.indexOf("-open")&&(r.fire("action"),i.menu&&(r.showMenu(),e.aria&&r.menu.items()[0].focus())),t=t.parentNode}),r.on("keydown",function(e){var t;13===e.keyCode&&"INPUT"===e.target.nodeName&&(e.preventDefault(),r.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),r.fire("submit",{data:t.toJSON()}))}),r.on("keyup",function(e){if("INPUT"===e.target.nodeName){var t=r.state.get("value"),n=e.target.value;n!==t&&(r.state.set("value",n),r.fire("autocomplete",e))}}),r.on("mouseover",function(e){var t=r.tooltip().moveTo(-65535);if(r.statusLevel()&&-1!==e.target.className.indexOf(r.classPrefix+"status")){var n=r.statusMessage()||"Ok",i=t.text(n).show().testMoveRel(e.target,["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===i),t.classes.toggle("tooltip-nw","bc-tl"===i),t.classes.toggle("tooltip-ne","bc-tr"===i),t.moveRel(e.target,i)}})},statusLevel:function(e){return 0<arguments.length&&this.state.set("statusLevel",e),this.state.get("statusLevel")},statusMessage:function(e){return 0<arguments.length&&this.state.set("statusMessage",e),this.state.get("statusMessage")},showMenu:function(){var e,t=this,n=t.settings;t.menu||((e=n.menu||[]).length?e={type:"menu",items:e}:e.type=e.type||"menu",t.menu=b.create(e).parent(t).renderTo(t.getContainerElm()),t.fire("createmenu"),t.menu.reflow(),t.menu.on("cancel",function(e){e.control===t.menu&&t.focus()}),t.menu.on("show hide",function(e){e.control.items().each(function(e){e.active(e.value()===t.value())})}).fire("show"),t.menu.on("select",function(e){t.value(e.control.value())}),t.on("focusin",function(e){"INPUT"===e.target.tagName.toUpperCase()&&t.menu.hide()}),t.aria("expanded",!0)),t.menu.show(),t.menu.layoutRect({w:t.layoutRect().w}),t.menu.moveRel(t.getEl(),t.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e,t,n=this,i=n.getEl(),r=n.getEl("open"),o=n.layoutRect(),s=0,a=i.firstChild;n.statusLevel()&&"none"!==n.statusLevel()&&(s=parseInt(Ce.getRuntimeStyle(a,"padding-right"),10)-parseInt(Ce.getRuntimeStyle(a,"padding-left"),10)),e=r?o.w-Ce.getSize(r).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(t=n.layoutRect().h-2+"px"),we(a).css({width:e-s,lineHeight:t}),n._super(),n},postRender:function(){var t=this;return we(this.getEl("inp")).on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)}),t._super()},renderHtml:function(){var e,t,n,i=this,r=i._id,o=i.settings,s=i.classPrefix,a=i.state.get("value")||"",l="",u="";return"spellcheck"in o&&(u+=' spellcheck="'+o.spellcheck+'"'),o.maxLength&&(u+=' maxlength="'+o.maxLength+'"'),o.size&&(u+=' size="'+o.size+'"'),o.subtype&&(u+=' type="'+o.subtype+'"'),n='<i id="'+r+'-status" class="mce-status mce-ico" style="display: none"></i>',i.disabled()&&(u+=' disabled="disabled"'),(e=o.icon)&&"caret"!==e&&(e=s+"ico "+s+"i-"+o.icon),t=i.state.get("text"),(e||t)&&(l='<div id="'+r+'-open" class="'+s+"btn "+s+'open" tabIndex="-1" role="button"><button id="'+r+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!==e?'<i class="'+e+'"></i>':'<i class="'+s+'caret"></i>')+(t?(e?" ":"")+t:"")+"</button></div>",i.classes.add("has-open")),'<div id="'+r+'" class="'+i.classes+'"><input id="'+r+'-inp" class="'+s+'textbox" value="'+i.encode(a,!1)+'" hidefocus="1"'+u+' placeholder="'+i.encode(o.placeholder)+'" />'+n+l+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},showAutoComplete:function(e,i){var r=this;if(0!==e.length){r.menu?r.menu.items().remove():r.menu=b.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(r).renderTo(),w.each(e,function(e){var t,n;r.menu.add({text:e.title,url:e.previewUrl,match:i,classes:"menu-item-ellipsis",onclick:(t=e.value,n=e.title,function(){r.fire("selectitem",{title:n,value:t})})})}),r.menu.renderNew(),r.hideMenu(),r.menu.on("cancel",function(e){e.control.parent()===r.menu&&(e.stopPropagation(),r.focus(),r.hideMenu())}),r.menu.on("select",function(){r.focus()});var t=r.layoutRect().w;r.menu.layoutRect({w:t,minW:0,maxW:t}),r.menu.repaint(),r.menu.reflow(),r.menu.show(),r.menu.moveRel(r.getEl(),r.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])}else r.hideMenu()},hideMenu:function(){this.menu&&this.menu.hide()},bindStates:function(){var r=this;r.state.on("change:value",function(e){r.getEl("inp").value!==e.value&&(r.getEl("inp").value=e.value)}),r.state.on("change:disabled",function(e){r.getEl("inp").disabled=e.value}),r.state.on("change:statusLevel",function(e){var t=r.getEl("status"),n=r.classPrefix,i=e.value;Ce.css(t,"display","none"===i?"none":""),Ce.toggleClass(t,n+"i-checkmark","ok"===i),Ce.toggleClass(t,n+"i-warning","warn"===i),Ce.toggleClass(t,n+"i-error","error"===i),r.classes.toggle("has-status","none"!==i),r.repaint()}),Ce.on(r.getEl("status"),"mouseleave",function(){r.tooltip().hide()}),r.on("cancel",function(e){r.menu&&r.menu.visible()&&(e.stopPropagation(),r.hideMenu())});var n=function(e,t){t&&0<t.items().length&&t.items().eq(e)[0].focus()};return r.on("keydown",function(e){var t=e.keyCode;"INPUT"===e.target.nodeName&&(t===Zt.DOWN?(e.preventDefault(),r.fire("autocomplete"),n(0,r.menu)):t===Zt.UP&&(e.preventDefault(),n(-1,r.menu)))}),r._super()},remove:function(){we(this.getEl("inp")).off(),this.menu&&this.menu.remove(),this._super()}}),en=Qt.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl("open"),n=t?t.getElementsByTagName("i")[0]:null;if(n)try{n.style.background=e}catch(i){}},bindStates:function(){var t=this;return t.state.on("change:value",function(e){t.state.get("rendered")&&t.repaintColor(e.value)}),t._super()}}),tn=jt.extend({showPanel:function(){var t=this,e=t.settings;if(t.classes.add("opened"),t.panel)t.panel.show();else{var n=e.panel;n.type&&(n={layout:"grid",items:n}),n.role=n.role||"dialog",n.popover=!0,n.autohide=!0,n.ariaRoot=!0,t.panel=new kt(n).on("hide",function(){t.classes.remove("opened")}).on("cancel",function(e){e.stopPropagation(),t.focus(),t.hidePanel()}).parent(t).renderTo(t.getContainerElm()),t.panel.fire("show"),t.panel.reflow()}var i=t.panel.testMoveRel(t.getEl(),e.popoverAlign||(t.isRtl()?["bc-tc","bc-tl","bc-tr"]:["bc-tc","bc-tr","bc-tl","tc-bc","tc-br","tc-bl"]));t.panel.classes.toggle("start","l"===i.substr(-1)),t.panel.classes.toggle("end","r"===i.substr(-1));var r="t"===i.substr(0,1);t.panel.classes.toggle("bottom",!r),t.panel.classes.toggle("top",r),t.panel.moveRel(t.getEl(),i)},hidePanel:function(){this.panel&&this.panel.hide()},postRender:function(){var t=this;return t.aria("haspopup",!0),t.on("click",function(e){e.control===t&&(t.panel&&t.panel.visible()?t.hidePanel():(t.showPanel(),t.panel.focus(!!e.aria)))}),t._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}}),nn=v.DOM,rn=tn.extend({init:function(e){this._super(e),this.classes.add("splitbtn"),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,i=e.state.get("text"),r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",s="";return i&&(e.classes.add("btn-has-text"),s='<span class="'+n+'txt">'+e.encode(i)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+s+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var t=this,n=t.settings.onclick;return t.on("click",function(e){e.aria&&"down"===e.aria.key||e.control!==t||nn.getParent(e.target,"."+t.classPrefix+"open")||(e.stopImmediatePropagation(),n.call(t,e))}),delete t.settings.onclick,t._super()}}),on=tinymce.util.Tools.resolve("tinymce.util.Color"),sn=Wt.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){var n,i,r,o,s,a=this,l=a.color();function u(e,t){var n,i,r=Ce.getPos(e);return n=t.pageX-r.x,i=t.pageY-r.y,{x:n=Math.max(0,Math.min(n/e.clientWidth,1)),y:i=Math.max(0,Math.min(i/e.clientHeight,1))}}function c(e,t){var n=(360-e.h)/360;Ce.css(r,{top:100*n+"%"}),t||Ce.css(s,{left:e.s+"%",top:100-e.v+"%"}),o.style.background=on({s:100,v:100,h:e.h}).toHex(),a.color().parse({s:e.s,v:e.v,h:e.h})}function e(e){var t;t=u(o,e),n.s=100*t.x,n.v=100*(1-t.y),c(n),a.fire("change")}function t(e){var t;t=u(i,e),(n=l.toHsv()).h=360*(1-t.y),c(n,!0),a.fire("change")}i=a.getEl("h"),r=a.getEl("hp"),o=a.getEl("sv"),s=a.getEl("svp"),a._repaint=function(){c(n=l.toHsv())},a._super(),a._svdraghelper=new ft(a._id+"-sv",{start:e,drag:e}),a._hdraghelper=new ft(a._id+"-h",{start:t,drag:t}),a._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){if(!arguments.length)return this.color().toHex();this.color().parse(e),this._rendered&&this._repaint()},color:function(){return this._color||(this._color=on()),this._color},renderHtml:function(){var e,t=this._id,o=this.classPrefix,s="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000";return e='<div id="'+t+'-h" class="'+o+'colorpicker-h" style="background: -ms-linear-gradient(top,'+s+");background: linear-gradient(to bottom,"+s+');">'+function(){var e,t,n,i,r="";for(n="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",e=0,t=(i=s.split(",")).length-1;e<t;e++)r+='<div class="'+o+'colorpicker-h-chunk" style="height:'+100/t+"%;"+n+i[e]+",endColorstr="+i[e+1]+");-ms-"+n+i[e]+",endColorstr="+i[e+1]+')"></div>';return r}()+'<div id="'+t+'-hp" class="'+o+'colorpicker-h-marker"></div></div>','<div id="'+t+'" class="'+this.classes+'"><div id="'+t+'-sv" class="'+o+'colorpicker-sv"><div class="'+o+'colorpicker-overlay1"><div class="'+o+'colorpicker-overlay2"><div id="'+t+'-svp" class="'+o+'colorpicker-selector1"><div class="'+o+'colorpicker-selector2"></div></div></div></div></div>'+e+"</div>"}}),an=Wt.extend({init:function(e){e=w.extend({height:100,text:"Drop an image here",multiple:!1,accept:null},e),this._super(e),this.classes.add("dropzone"),e.multiple&&this.classes.add("multiple")},renderHtml:function(){var e,t,n=this.settings;return e={id:this._id,hidefocus:"1"},t=Ce.create("div",e,"<span>"+this.translate(n.text)+"</span>"),n.height&&Ce.css(t,"height",n.height+"px"),n.width&&Ce.css(t,"width",n.width+"px"),t.className=this.classes,t.outerHTML},postRender:function(){var i=this,e=function(e){e.preventDefault(),i.classes.toggle("dragenter"),i.getEl().className=i.classes};i._super(),i.$el.on("dragover",function(e){e.preventDefault()}),i.$el.on("dragenter",e),i.$el.on("dragleave",e),i.$el.on("drop",function(e){if(e.preventDefault(),!i.state.get("disabled")){var t=function(e){var t=i.settings.accept;if("string"!=typeof t)return e;var n=new RegExp("("+t.split(/\s*,\s*/).join("|")+")$","i");return w.grep(e,function(e){return n.test(e.name)})}(e.dataTransfer.files);i.value=function(){return t.length?i.settings.multiple?t:t[0]:null},t.length&&i.fire("change",e)}})},remove:function(){this.$el.off(),this._super()}}),ln=Wt.extend({init:function(e){var n=this;e.delimiter||(e.delimiter="\xbb"),n._super(e),n.classes.add("path"),n.canFocus=!0,n.on("click",function(e){var t;(t=e.target.getAttribute("data-index"))&&n.fire("select",{value:n.row()[t],index:t})}),n.row(n.settings.row)},focus:function(){return this.getEl().firstChild.focus(),this},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'">'+this._getDataPathHtml(this.state.get("row"))+"</div>"},bindStates:function(){var t=this;return t.state.on("change:row",function(e){t.innerHtml(t._getDataPathHtml(e.value))}),t._super()},_getDataPathHtml:function(e){var t,n,i=e||[],r="",o=this.classPrefix;for(t=0,n=i.length;t<n;t++)r+=(0<t?'<div class="'+o+'divider" aria-hidden="true"> '+this.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(t===n-1?" "+o+"last":"")+'" data-index="'+t+'" tabindex="-1" id="'+this._id+"-"+t+'" aria-level="'+(t+1)+'">'+i[t].name+"</div>";return r||(r='<div class="'+o+'path-item">\xa0</div>'),r}}),un=ln.extend({postRender:function(){var o=this,s=o.settings.editor;function a(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}return!1!==s.settings.elementpath&&(o.on("select",function(e){s.focus(),s.selection.select(this.row()[e.index].element),s.nodeChanged()}),s.on("nodeChange",function(e){for(var t=[],n=e.parents,i=n.length;i--;)if(1===n[i].nodeType&&!a(n[i])){var r=s.fire("ResolveName",{name:n[i].nodeName.toLowerCase(),target:n[i]});if(r.isDefaultPrevented()||t.push({name:r.name,element:n[i]}),r.isPropagationStopped())break}o.row(t)})),o._super()}}),cn=ct.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}}),dn=ct.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:15,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var i=this,e=i.items();i.settings.formItemDefaults||(i.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),e.each(function(e){var t,n=e.settings.label;n&&((t=new cn(w.extend({items:{type:"label",id:e._id+"-l",text:n,flex:0,forId:e._id,disabled:e.disabled()}},i.settings.formItemDefaults))).type="formitem",e.aria("labelledby",e._id+"-l"),"undefined"==typeof e.settings.flex&&(e.settings.flex=1),i.replace(e,t),t.add(e))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){this._super(),this.fromJSON(this.settings.data)},bindStates:function(){var n=this;function e(){var e,t,i=0,r=[];if(!1!==n.settings.labelGapCalc)for(("children"===n.settings.labelGapCalc?n.find("formitem"):n.items()).filter("formitem").each(function(e){var t=e.items()[0],n=t.getEl().clientWidth;i=i<n?n:i,r.push(t)}),t=n.settings.labelGap||0,e=r.length;e--;)r[e].settings.minWidth=i+t}n._super(),n.on("show",e),e()}}),fn=dn.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}}),hn=0,mn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:k(e)}},gn={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return mn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return mn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return mn(n)},fromDom:mn,fromPoint:function(e,t,n){var i=e.dom();return D.from(i.elementFromPoint(t,n)).map(mn)}},pn=function(n){var i,r=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r||(r=!0,i=n.apply(null,e)),i}},vn={ATTRIBUTE:Node.ATTRIBUTE_NODE,CDATA_SECTION:Node.CDATA_SECTION_NODE,COMMENT:Node.COMMENT_NODE,DOCUMENT:Node.DOCUMENT_NODE,DOCUMENT_TYPE:Node.DOCUMENT_TYPE_NODE,DOCUMENT_FRAGMENT:Node.DOCUMENT_FRAGMENT_NODE,ELEMENT:Node.ELEMENT_NODE,TEXT:Node.TEXT_NODE,PROCESSING_INSTRUCTION:Node.PROCESSING_INSTRUCTION_NODE,ENTITY_REFERENCE:Node.ENTITY_REFERENCE_NODE,ENTITY:Node.ENTITY_NODE,NOTATION:Node.NOTATION_NODE},bn=function(e){return e.dom().nodeType},yn=function(t){return function(e){return bn(e)===t}},xn=(yn(vn.ELEMENT),yn(vn.TEXT),yn(vn.DOCUMENT),pn(function(){return xn(gn.fromDom(document))}),function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return gn.fromDom(t)}),wn=("undefined"!=typeof window?window:Function("return this;")(),function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.test(t))return i}return undefined}(e,t);if(!n)return{major:0,minor:0};var i=function(e){return Number(t.replace(n,"$"+e))};return Cn(i(1),i(2))}),_n=function(){return Cn(0,0)},Cn=function(e,t){return{major:e,minor:t}},Rn={nu:Cn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?_n():wn(e,n)},unknown:_n},En="Firefox",kn=function(e,t){return function(){return t===e}},Tn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:kn("Edge",t),isChrome:kn("Chrome",t),isIE:kn("IE",t),isOpera:kn("Opera",t),isFirefox:kn(En,t),isSafari:kn("Safari",t)}},Hn={unknown:function(){return Tn({current:undefined,version:Rn.unknown()})},nu:Tn,edge:k("Edge"),chrome:k("Chrome"),ie:k("IE"),opera:k("Opera"),firefox:k(En),safari:k("Safari")},Sn="Windows",Mn="Android",Nn="Solaris",Pn="FreeBSD",Dn=function(e,t){return function(){return t===e}},Wn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Dn(Sn,t),isiOS:Dn("iOS",t),isAndroid:Dn(Mn,t),isOSX:Dn("OSX",t),isLinux:Dn("Linux",t),isSolaris:Dn(Nn,t),isFreeBSD:Dn(Pn,t)}},On={unknown:function(){return Wn({current:undefined,version:Rn.unknown()})},nu:Wn,windows:k(Sn),ios:k("iOS"),android:k(Mn),linux:k("Linux"),osx:k("OSX"),solaris:k(Nn),freebsd:k(Pn)},An=function(e,t){var n=String(t).toLowerCase();return Z(e,function(e){return e.search(n)})},Bn=function(e,n){return An(e,n).map(function(e){var t=Rn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Ln=function(e,n){return An(e,n).map(function(e){var t=Rn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},In=function(e,t){return-1!==e.indexOf(t)},zn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Fn=function(t){return function(e){return In(e,t)}},Un=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return In(e,"edge/")&&In(e,"chrome")&&In(e,"safari")&&In(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,zn],search:function(e){return In(e,"chrome")&&!In(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return In(e,"msie")||In(e,"trident")}},{name:"Opera",versionRegexes:[zn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Fn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Fn("firefox")},{name:"Safari",versionRegexes:[zn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(In(e,"safari")||In(e,"mobile/"))&&In(e,"applewebkit")}}],Vn=[{name:"Windows",search:Fn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return In(e,"iphone")||In(e,"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("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Fn("linux"),versionRegexes:[]},{name:"Solaris",search:Fn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Fn("freebsd"),versionRegexes:[]}],Yn={browsers:k(Un),oses:k(Vn)},$n=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=Yn.browsers(),h=Yn.oses(),m=Bn(f,e).fold(Hn.unknown,Hn.nu),g=Ln(h,e).fold(On.unknown,On.nu);return{browser:m,os:g,deviceType:(n=m,i=e,r=(t=g).isiOS()&&!0===/ipad/i.test(i),o=t.isiOS()&&!r,s=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,l=r||s||a&&!0===/mobile/i.test(i),u=t.isiOS()||t.isAndroid(),c=u&&!l,d=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(i),{isiPad:k(r),isiPhone:k(o),isTablet:k(l),isPhone:k(c),isTouch:k(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:k(d)})}},Xn=pn(function(){var e=navigator.userAgent;return $n(e)}),qn=vn.ELEMENT,jn=vn.DOCUMENT,Jn=function(e){return e.nodeType!==qn&&e.nodeType!==jn||0===e.childElementCount},Gn={all:function(e,t){var n=t===undefined?document:t.dom();return Jn(n)?[]:J(n.querySelectorAll(e),gn.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==qn)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return Jn(n)?D.none():D.from(n.querySelector(e)).map(gn.fromDom)}},Kn=(Xn().browser.isIE(),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}("element","offset"),function(e,t){return Gn.all(t,e)}),Zn=w.trim,Qn=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}},ei=Qn("true"),ti=Qn("false"),ni=function(e,t,n,i,r){return{type:e,title:t,url:n,level:i,attach:r}},ii=function(e){return e.innerText||e.textContent},ri=function(e){return e.id?e.id:(t="h",n=(new Date).getTime(),t+"_"+Math.floor(1e9*Math.random())+ ++hn+String(n));var t,n},oi=function(e){return(t=e)&&"A"===t.nodeName&&(t.id||t.name)&&ai(e);var t},si=function(e){return e&&/^(H[1-6])$/.test(e.nodeName)},ai=function(e){return function(e){for(;e=e.parentNode;){var t=e.contentEditable;if(t&&"inherit"!==t)return ei(e)}return!1}(e)&&!ti(e)},li=function(e){return si(e)&&ai(e)},ui=function(e){var t,n=ri(e);return ni("header",ii(e),"#"+n,si(t=e)?parseInt(t.nodeName.substr(1),10):0,function(){e.id=n})},ci=function(e){var t=e.id||e.name,n=ii(e);return ni("anchor",n||"#"+t,"#"+t,0,E)},di=function(e){var t,n;return t="h1,h2,h3,h4,h5,h6,a:not([href])",n=e,J(Kn(gn.fromDom(n),t),function(e){return e.dom()})},fi=function(e){return 0<Zn(e.title).length},hi=function(e){var t,n=di(e);return K((t=n,J(K(t,li),ui)).concat(J(K(n,oi),ci)),fi)},mi={},gi=function(e){return{title:e.title,value:{title:{raw:e.title},url:e.url,attach:e.attach}}},pi=function(e,t){return{title:e,value:{title:e,url:t,attach:E}}},vi=function(e,t,n){var i=t in e?e[t]:n;return!1===i?null:i},bi=function(e,i,r,t){var n,o,s,a,l,u,c={title:"-"},d=function(e){var t=e.hasOwnProperty(r)?e[r]:[],n=K(t,function(e){return t=e,!j(i,function(e){return e.url===t});var t});return w.map(n,function(e){return{title:e,value:{title:e,url:e,attach:E}}})},f=function(t){var e,n=K(i,function(e){return e.type===t});return e=n,w.map(e,gi)};return!1===t.typeahead_urls?[]:"file"===r?(n=[xi(e,d(mi)),xi(e,f("header")),xi(e,(a=f("anchor"),l=vi(t,"anchor_top","#top"),u=vi(t,"anchor_bottom","#bottom"),null!==l&&a.unshift(pi("<top>",l)),null!==u&&a.push(pi("<bottom>",u)),a))],o=function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(c,t)},s=[],G(n,function(e){s=o(s,e)}),s):xi(e,d(mi))},yi=function(e,t){var n,i,r,o=mi[t];/^https?/.test(e)&&(o?(n=o,i=e,r=q(n,i),-1===r?D.none():D.some(r)).isNone()&&(mi[t]=o.slice(0,5).concat(e)):mi[t]=[e])},xi=function(e,t){var n=e.toLowerCase(),i=w.grep(t,function(e){return-1!==e.title.toLowerCase().indexOf(n)});return 1===i.length&&i[0].title===e?[]:i},wi=function(o,e,n){var i=e.filepicker_validator_handler;i&&o.state.on("change:value",function(e){var t;0!==(t=e.value).length?i({url:t,type:n},function(e){var t,n,i,r=(n=(t=e).status,i=t.message,"valid"===n?{status:"ok",message:i}:"unknown"===n?{status:"warn",message:i}:"invalid"===n?{status:"warn",message:i}:{status:"none",message:""});o.statusMessage(r.message),o.statusLevel(r.status)}):o.statusLevel("none")})},_i=Qt.extend({Statics:{clearHistory:function(){mi={}}},init:function(e){var t,n,i,r,o,s,a,l,u=this,c=window.tinymce?window.tinymce.activeEditor:h.activeEditor,d=c.settings,f=e.filetype;e.spellcheck=!1,(i=d.file_picker_types||d.file_browser_callback_types)&&(i=w.makeMap(i,/[, ]/)),i&&!i[f]||(!(n=d.file_picker_callback)||i&&!i[f]?!(n=d.file_browser_callback)||i&&!i[f]||(t=function(){n(u.getEl("inp").id,u.value(),f,window)}):t=function(){var e=u.fire("beforecall").meta;e=w.extend({filetype:f},e),n.call(c,function(e,t){u.value(e).fire("change",{meta:t})},u.value(),e)}),t&&(e.icon="browse",e.onaction=t),u._super(e),u.classes.add("filepicker"),r=u,o=d,s=c.getBody(),a=f,l=function(e){var t=hi(s),n=bi(e,t,a,o);r.showAutoComplete(n,e)},r.on("autocomplete",function(){l(r.value())}),r.on("selectitem",function(e){var t=e.value;r.value(t.url);var n,i=(n=t.title).raw?n.raw:n;"image"===a?r.fire("change",{meta:{alt:i,attach:t.attach}}):r.fire("change",{meta:{text:i,attach:t.attach}}),r.focus()}),r.on("click",function(e){0===r.value().length&&"INPUT"===e.target.nodeName&&l("")}),r.on("PostRender",function(){r.getRoot().on("submit",function(e){e.isDefaultPrevented()||yi(r.value(),a)})}),wi(u,d,f)}}),Ci=qt.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}}),Ri=qt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,C,R,E,k,T,H,S,M,N,P,D,W,O,A,B,L=[],I=Math.max,z=Math.min;for(i=e.items().filter(":visible"),r=e.layoutRect(),o=e.paddingBox,s=e.settings,f=e.isRtl()?s.direction||"row-reversed":s.direction,a=s.align,l=e.isRtl()?s.pack||"end":s.pack,u=s.spacing||0,"row-reversed"!==f&&"column-reverse"!==f||(i=i.set(i.toArray().reverse()),f=f.split("-")[0]),"column"===f?(R="y",_="h",C="minH",E="maxH",T="innerH",k="top",H="deltaH",S="contentH",W="left",P="w",M="x",N="innerW",D="minW",O="right",A="deltaW",B="contentW"):(R="x",_="w",C="minW",E="maxW",T="innerW",k="left",H="deltaW",S="contentW",W="top",P="h",M="y",N="innerH",D="minH",O="bottom",A="deltaH",B="contentH"),d=r[T]-o[k]-o[k],w=c=0,t=0,n=i.length;t<n;t++)m=(h=i[t]).layoutRect(),d-=t<n-1?u:0,0<(g=h.settings.flex)&&(c+=g,m[E]&&L.push(h),m.flex=g),d-=m[C],w<(p=o[W]+m[D]+o[O])&&(w=p);if((y={})[C]=d<0?r[C]-d+r[H]:r[T]-d+r[H],y[D]=w+r[A],y[S]=r[T]-d,y[B]=w,y.minW=z(y.minW,r.maxW),y.minH=z(y.minH,r.maxH),y.minW=I(y.minW,r.startMinWidth),y.minH=I(y.minH,r.startMinHeight),!r.autoResize||y.minW===r.minW&&y.minH===r.minH){for(b=d/c,t=0,n=L.length;t<n;t++)(v=(m=(h=L[t]).layoutRect())[E])<(p=m[C]+m.flex*b)?(d-=m[E]-m[C],c-=m.flex,m.flex=0,m.maxFlexSize=v):m.maxFlexSize=0;for(b=d/c,x=o[k],y={},0===c&&("end"===l?x=d+o[k]:"center"===l?(x=Math.round(r[T]/2-(r[T]-d)/2)+o[k])<0&&(x=o[k]):"justify"===l&&(x=o[k],u=Math.floor(d/(i.length-1)))),y[M]=o[W],t=0,n=i.length;t<n;t++)p=(m=(h=i[t]).layoutRect()).maxFlexSize||m[C],"center"===a?y[M]=Math.round(r[N]/2-m[P]/2):"stretch"===a?(y[P]=I(m[D]||0,r[N]-o[W]-o[O]),y[M]=o[W]):"end"===a&&(y[M]=r[N]-m[P]-o.top),0<m.flex&&(p+=m.flex*b),y[_]=p,y[R]=x,h.layoutRect(y),h.recalc&&h.recalc(),x+=p+u}else if(y.w=y.minW,y.h=y.minH,e.layoutRect(y),this.recalc(e),null===e._lastRect){var F=e.parent();F&&(F._lastRect=null,F.recalc())}}}),Ei=Xt.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}}),ki=function(e,t){return Gn.one(t,e)},Ti=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},Hi=function(e,t,n){var i=function(e){n(e,t)};e.formatter?e.formatter.formatChanged(t,i):e.on("init",function(){e.formatter.formatChanged(t,i)})},Si=function(e,n){return function(t){Hi(e,n,function(e){t.control.active(e)})}},Mi=function(i){var t=["alignleft","aligncenter","alignright","alignjustify"],r="alignleft",e=[{text:"Left",icon:"alignleft",onclick:Ti(i,"alignleft")},{text:"Center",icon:"aligncenter",onclick:Ti(i,"aligncenter")},{text:"Right",icon:"alignright",onclick:Ti(i,"alignright")},{text:"Justify",icon:"alignjustify",onclick:Ti(i,"alignjustify")}];i.addMenuItem("align",{text:"Align",menu:e}),i.addButton("align",{type:"menubutton",icon:r,menu:e,onShowMenu:function(e){var n=e.control.menu;w.each(t,function(t,e){n.items().eq(e).each(function(e){return e.active(i.formatter.match(t))})})},onPostRender:function(e){var n=e.control;w.each(t,function(t,e){Hi(i,t,function(e){n.icon(r),e&&n.icon(t)})})}}),w.each({alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(e,t){i.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Si(i,t)})})},Ni=function(e){return e?e.split(",")[0]:""},Pi=function(l,u){return function(){var a=this;a.state.set("value",null),l.on("init nodeChange",function(e){var t,n,i,r,o=l.queryCommandValue("FontName"),s=(t=u,r=(n=o)?n.toLowerCase():"",w.each(t,function(e){e.value.toLowerCase()===r&&(i=e.value)}),w.each(t,function(e){i||Ni(e.value).toLowerCase()!==Ni(r).toLowerCase()||(i=e.value)}),i);a.value(s||null),!s&&o&&a.text(Ni(o))})}},Di=function(n){n.addButton("fontselect",function(){var e,t=(e=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(n.settings.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"),w.map(e,function(e){return{text:{raw:e[0]},value:e[1],textStyle:-1===e[1].indexOf("dings")?"font-family:"+e[1]:""}}));return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:t,fixedWidth:!0,onPostRender:Pi(n,t),onselect:function(e){e.control.settings.value&&n.execCommand("FontName",!1,e.control.settings.value)}}})},Wi=function(e){Di(e)},Oi=function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,i=t||0,r=Math.pow(10,i),Math.round(n*r)/r+"pt"):e;var n,i,r},Ai=function(e,t,n){var i;return w.each(e,function(e){e.value===n?i=n:e.value===t&&(i=t)}),i},Bi=function(n){n.addButton("fontsizeselect",function(){var e,s,a,t=(e=n.settings.fontsize_formats||"8pt 10pt 12pt 14pt 18pt 24pt 36pt",w.map(e.split(" "),function(e){var t=e,n=e,i=e.split("=");return 1<i.length&&(t=i[0],n=i[1]),{text:t,value:n}}));return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:(s=n,a=t,function(){var o=this;s.on("init nodeChange",function(e){var t,n,i,r;if(t=s.queryCommandValue("FontSize"))for(i=3;!r&&0<=i;i--)n=Oi(t,i),r=Ai(a,n,t);o.value(r||null),r||o.text(n)})}),onclick:function(e){e.control.settings.value&&n.execCommand("FontSize",!1,e.control.settings.value)}}})},Li=function(e){Bi(e)},Ii=function(n,e){var i=e.length;return w.each(e,function(e){e.menu&&(e.hidden=0===Ii(n,e.menu));var t=e.format;t&&(e.hidden=!n.formatter.canApply(t)),e.hidden&&i--}),i},zi=function(n,e){var i=e.items().length;return e.items().each(function(e){e.menu&&e.visible(0<zi(n,e.menu)),!e.menu&&e.settings.menu&&e.visible(0<Ii(n,e.settings.menu));var t=e.settings.format;t&&e.visible(n.formatter.canApply(t)),e.visible()||i--}),i},Fi=function(e){var i,r,o,t,s,n,a,l,u=(r=0,o=[],t=[{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",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],s=function(e){var i=[];if(e)return w.each(e,function(e){var t={text:e.title,icon:e.icon};if(e.items)t.menu=s(e.items);else{var n=e.format||"custom"+r++;e.format||(e.name=n,o.push(e)),t.format=n,t.cmd=e.cmd}i.push(t)}),i},(i=e).on("init",function(){w.each(o,function(e){i.formatter.register(e.name,e)})}),{type:"menu",items:i.settings.style_formats_merge?i.settings.style_formats?s(t.concat(i.settings.style_formats)):s(t):s(i.settings.style_formats||t),onPostRender:function(e){i.fire("renderFormatsMenu",{control:e.control})},itemDefaults:{preview:!0,textStyle:function(){if(this.settings.format)return i.formatter.getCssText(this.settings.format)},onPostRender:function(){var n=this;n.parent().on("show",function(){var e,t;(e=n.settings.format)&&(n.disabled(!i.formatter.canApply(e)),n.active(i.formatter.match(e))),(t=n.settings.cmd)&&n.active(i.queryCommandState(t))})},onclick:function(){this.settings.format&&Ti(i,this.settings.format)(),this.settings.cmd&&i.execCommand(this.settings.cmd)}}});n=u,e.addMenuItem("formats",{text:"Formats",menu:n}),l=u,(a=e).addButton("styleselect",{type:"menubutton",text:"Formats",menu:l,onShowMenu:function(){a.settings.style_formats_autohide&&zi(a,this.menu)}})},Ui=function(n,e){return function(){var r,o,s,t=[];return w.each(e,function(e){t.push({text:e[0],value:e[1],textStyle:function(){return n.formatter.getCssText(e[1])}})}),{type:"listbox",text:e[0][0],values:t,fixedWidth:!0,onselect:function(e){if(e.control){var t=e.control.value();Ti(n,t)()}},onPostRender:(r=n,o=t,function(){var t=this;r.on("nodeChange",function(e){var n=r.formatter,i=null;w.each(e.parents,function(t){if(w.each(o,function(e){if(s?n.matchNode(t,s,{value:e.value})&&(i=e.value):n.matchNode(t,e.value)&&(i=e.value),i)return!1}),i)return!1}),t.value(i)})})}}},Vi=function(e){var t,n,i=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");e.addMenuItem("blockformats",{text:"Blocks",menu:(t=e,n=i,w.map(n,function(e){return{text:e[0],onclick:Ti(t,e[1]),textStyle:function(){return t.formatter.getCssText(e[1])}}}))}),e.addButton("formatselect",Ui(e,i))},Yi=function(t,e){var n,i;if("string"==typeof e)i=e.split(" ");else if(w.isArray(e))return function(e){for(var t=[],n=0,i=e.length;n<i;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);te.apply(t,e[n])}return t}(w.map(e,function(e){return Yi(t,e)}));return n=w.grep(i,function(e){return"|"===e||e in t.menuItems}),w.map(n,function(e){return"|"===e?{text:"-"}:t.menuItems[e]})},$i=function(e){return e&&"-"===e.text},Xi=function(e){var t=K(e,function(e,t,n){return!$i(e)||!$i(n[t-1])});return K(t,function(e,t,n){return!$i(e)||0<t&&t<n.length-1})},qi=function(e){var t,n,i,r,o=e.settings.insert_button_items;return Xi(o?Yi(e,o):(t=e,n="insert",i=[{text:"-"}],r=w.grep(t.menuItems,function(e){return e.context===n}),w.each(r,function(e){"before"===e.separator&&i.push({text:"|"}),e.prependToContext?i.unshift(e):i.push(e),"after"===e.separator&&i.push({text:"|"})}),i))},ji=function(e){var t;(t=e).addButton("insert",{type:"menubutton",icon:"insert",menu:[],oncreatemenu:function(){this.menu.add(qi(t)),this.menu.renderNew()}})},Ji=function(e){var n,i,r;n=e,w.each({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(e,t){n.addButton(t,{active:!1,tooltip:e,onPostRender:Si(n,t),onclick:Ti(n,t)})}),i=e,w.each({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"],removeformat:["Clear formatting","RemoveFormat"],remove:["Remove","Delete"]},function(e,t){i.addButton(t,{tooltip:e[0],cmd:e[1]})}),r=e,w.each({blockquote:["Blockquote","mceBlockQuote"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"]},function(e,t){r.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Si(r,t)})})},Gi=function(e){var n;Ji(e),n=e,w.each({bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline","Meta+U"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"],newdocument:["New document","mceNewDocument"],cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"]},function(e,t){n.addMenuItem(t,{text:e[0],icon:t,shortcut:e[2],cmd:e[1]})}),n.addMenuItem("codeformat",{text:"Code",icon:"code",onclick:Ti(n,"code")})},Ki=function(n,i){return function(){var e=this,t=function(){var e="redo"===i?"hasRedo":"hasUndo";return!!n.undoManager&&n.undoManager[e]()};e.disabled(!t()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){e.disabled(n.readonly||!t())})}},Zi=function(e){var t,n;(t=e).addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:Ki(t,"undo"),cmd:"undo"}),t.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:Ki(t,"redo"),cmd:"redo"}),(n=e).addButton("undo",{tooltip:"Undo",onPostRender:Ki(n,"undo"),cmd:"undo"}),n.addButton("redo",{tooltip:"Redo",onPostRender:Ki(n,"redo"),cmd:"redo"})},Qi=function(e){var t,n;(t=e).addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:(n=t,function(){var t=this;n.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(n.hasVisual)}),cmd:"mceToggleVisualAid"})},er={setup:function(e){var t;e.rtl&&(st.rtl=!0),e.on("mousedown",function(){kt.hideAll()}),(t=e).settings.ui_container&&(fe.container=ki(gn.fromDom(document.body),t.settings.ui_container).fold(k(null),function(e){return e.dom()})),Wt.tooltips=!fe.iOS,st.translate=function(e){return h.translate(e)},Vi(e),Mi(e),Gi(e),Zi(e),Li(e),Wi(e),Fi(e),Qi(e),ji(e)}},tr=qt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,C,R,E,k,T,H,S=[],M=[];t=e.settings,r=e.items().filter(":visible"),o=e.layoutRect(),i=t.columns||Math.ceil(Math.sqrt(r.length)),n=Math.ceil(r.length/i),b=t.spacingH||t.spacing||0,y=t.spacingV||t.spacing||0,x=t.alignH||t.align,w=t.alignV||t.align,p=e.paddingBox,H="reverseRows"in t?t.reverseRows:e.isRtl(),x&&"string"==typeof x&&(x=[x]),w&&"string"==typeof w&&(w=[w]);for(d=0;d<i;d++)S.push(0);for(f=0;f<n;f++)M.push(0);for(f=0;f<n;f++)for(d=0;d<i&&(c=r[f*i+d]);d++)R=(u=c.layoutRect()).minW,E=u.minH,S[d]=R>S[d]?R:S[d],M[f]=E>M[f]?E:M[f];for(k=o.innerW-p.left-p.right,d=_=0;d<i;d++)_+=S[d]+(0<d?b:0),k-=(0<d?b:0)+S[d];for(T=o.innerH-p.top-p.bottom,f=C=0;f<n;f++)C+=M[f]+(0<f?y:0),T-=(0<f?y:0)+M[f];if(_+=p.left+p.right,C+=p.top+p.bottom,(l={}).minW=_+(o.w-o.innerW),l.minH=C+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW===o.minW&&l.minH===o.minH){var N;o.autoResize&&((l=e.layoutRect(l)).contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH),N="start"===t.packV?0:0<T?Math.floor(T/n):0;var P=0,D=t.flexWidths;if(D)for(d=0;d<D.length;d++)P+=D[d];else P=i;var W=k/P;for(d=0;d<i;d++)S[d]+=D?D[d]*W:W;for(m=p.top,f=0;f<n;f++){for(h=p.left,a=M[f]+N,d=0;d<i&&(c=r[H?f*i+i-1-d:f*i+d]);d++)g=c.settings,u=c.layoutRect(),s=Math.max(S[d],u.startMinWidth),u.x=h,u.y=m,"center"===(v=g.alignH||(x?x[d]||x[0]:null))?u.x=h+s/2-u.w/2:"right"===v?u.x=h+s-u.w:"stretch"===v&&(u.w=s),"center"===(v=g.alignV||(w?w[d]||w[0]:null))?u.y=m+a/2-u.h/2:"bottom"===v?u.y=m+a-u.h:"stretch"===v&&(u.h=a),c.layoutRect(u),h+=s+b,c.recalc&&c.recalc();m+=a+y}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}}),nr=Wt.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,t&&t()):u.setTimeout(function(){n.html(e)}),this}}),ir=Wt.extend({init:function(e){this._super(e),this.classes.add("widget").add("infobox"),this.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl("body").firstChild.data=t.encode(e.value),t.state.get("rendered")&&t.updateLayoutRect()}),t.state.on("change:help",function(e){t.classes.toggle("has-help",e.value),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),rr=Wt.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,t=e._super();return e.settings.multiline&&(Ce.getSize(e.getEl()).width>t.maxW&&(t.minW=t.maxW,e.classes.add("multiline")),e.getEl().style.width=t.minW+"px",t.startMinH=t.h=t.minH=Math.min(t.maxH,Ce.getSize(e.getEl()).height)),t},repaint:function(){return this.settings.multiline||(this.getEl().style.lineHeight=this.layoutRect().h+"px"),this._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e,t,n=this,i=n.settings.forId,r=n.settings.html?n.settings.html:n.encode(n.state.get("text"));return!i&&(t=n.settings.forName)&&(e=n.getRoot().find("#"+t)[0])&&(i=e._id),i?'<label id="'+n._id+'" class="'+n.classes+'"'+(i?' for="'+i+'"':"")+">"+r+"</label>":'<span id="'+n._id+'" class="'+n.classes+'">'+r+"</span>"},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.innerHtml(t.encode(e.value)),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),or=ct.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){this._super(e),this.classes.add("toolbar")},postRender:function(){return this.items().each(function(e){e.classes.add("toolbar-item")}),this._super()}}),sr=or.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}}),ar=jt.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(e){var t,n=this;if(n.menu&&n.menu.visible()&&!1!==e)return n.hideMenu();n.menu||(t=n.state.get("menu")||[],n.classes.add("opened"),t.length?t={type:"menu",animate:!0,items:t}:(t.type=t.type||"menu",t.animate=!0),t.renderTo?n.menu=t.parent(n).show().renderTo():n.menu=b.create(t).parent(n).renderTo(),n.fire("createmenu"),n.menu.reflow(),n.menu.on("cancel",function(e){e.control.parent()===n.menu&&(e.stopPropagation(),n.focus(),n.hideMenu())}),n.menu.on("select",function(){n.focus()}),n.menu.on("show hide",function(e){e.control===n.menu&&(n.activeMenu("show"===e.type),n.classes.toggle("opened","show"===e.type)),n.aria("expanded","show"===e.type)}).fire("show")),n.menu.show(),n.menu.layoutRect({w:n.layoutRect().w}),n.menu.repaint(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]),n.fire("showmenu")},hideMenu:function(){this.menu&&(this.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),this.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e,t=this,n=t._id,i=t.classPrefix,r=t.settings.icon,o=t.state.get("text"),s="";return(e=t.settings.image)?(r="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o&&(t.classes.add("btn-has-text"),s='<span class="'+i+'txt">'+t.encode(o)+"</span>"),r=t.settings.icon?i+"ico "+i+"i-"+r:"",t.aria("role",t.parent()instanceof sr?"menuitem":"button"),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1" aria-labelledby="'+n+'"><button id="'+n+'-open" role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+e+"></i>":"")+s+' <i class="'+i+'caret"></i></button></div>'},postRender:function(){var r=this;return r.on("click",function(e){e.control===r&&function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}(e.target,r.getEl())&&(r.focus(),r.showMenu(!e.aria),e.aria&&r.menu.items().filter(":visible")[0].focus())}),r.on("mouseenter",function(e){var t,n=e.control,i=r.parent();n&&i&&n instanceof ar&&n.parent()===i&&(i.items().filter("MenuButton").each(function(e){e.hideMenu&&e!==n&&(e.menu&&e.menu.visible()&&(t=!0),e.hideMenu())}),t&&(n.focus(),n.showMenu()))}),r._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}}),lr=kt.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var t=e.items,n=t.length;n--;)t[n]=w.extend({},e.itemDefaults,t[n]);this._super(e),this.classes.add("menu"),e.animate&&11!==fe.ie&&this.classes.add("animate")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){this.hideAll(),this.fire("select")},load:function(){var t,n=this;function i(){n.throbber&&(n.throbber.hide(),n.throbber=null)}n.settings.itemsFactory&&(n.throbber||(n.throbber=new Mt(n.getEl("body"),!0),0===n.items().length?(n.throbber.show(),n.fire("loading")):n.throbber.show(100,function(){n.items().remove(),n.fire("loading")}),n.on("hide close",i)),n.requestTime=t=(new Date).getTime(),n.settings.itemsFactory(function(e){0!==e.length?n.requestTime===t&&(n.getEl().style.width="",n.getEl("body").style.width="",i(),n.items().remove(),n.getEl("body").innerHTML="",n.add(e),n.renderNew(),n.fire("loaded")):n.hide()}))},hideAll:function(){return this.find("menuitem").exec("hideMenu"),this._super()},preRender:function(){var n=this;return n.items().each(function(e){var t=e.settings;if(t.icon||t.image||t.selectable)return!(n._hasIcons=!0)}),n.settings.itemsFactory&&n.on("postrender",function(){n.settings.itemsFactory&&n.load()}),n.on("show hide",function(e){e.control===n&&("show"===e.type?u.setTimeout(function(){n.classes.add("in")},0):n.classes.remove("in"))}),n._super()}}),ur=ar.extend({init:function(i){var t,r,o,n,s=this;s._super(i),i=s.settings,s._values=t=i.values,t&&("undefined"!=typeof i.value&&function e(t){for(var n=0;n<t.length;n++){if(r=t[n].selected||i.value===t[n].value)return o=o||t[n].text,s.state.set("value",t[n].value),!0;if(t[n].menu&&e(t[n].menu))return!0}}(t),!r&&0<t.length&&(o=t[0].text,s.state.set("value",t[0].value)),s.state.set("menu",t)),s.state.set("text",i.text||o),s.classes.add("listbox"),s.on("select",function(e){var t=e.control;n&&(e.lastControl=n),i.multiple?t.active(!t.active()):s.value(e.control.value()),n=t})},value:function(t){return 0===arguments.length?this.state.get("value"):(void 0===t||(this.settings.values?0<w.grep(this.settings.values,function(e){return e.value===t}).length?this.state.set("value",t):null===t&&this.state.set("value",null):this.state.set("value",t)),this)},bindStates:function(){var i=this;return i.on("show",function(e){var t,n;t=e.control,n=i.value(),t instanceof lr&&t.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}),i.state.on("change:value",function(t){var n=function e(t,n){var i;if(t)for(var r=0;r<t.length;r++){if(t[r].value===n)return t[r];if(t[r].menu&&(i=e(t[r].menu,n)))return i}}(i.state.get("menu"),t.value);n?i.text(n.text):i.text(i.settings.text)}),i._super()}}),cr=Wt.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t,n=this;n._super(e),e=n.settings,n.classes.add("menu-item"),e.menu&&n.classes.add("menu-item-expand"),e.preview&&n.classes.add("menu-item-preview"),"-"!==(t=n.state.get("text"))&&"|"!==t||(n.classes.add("menu-item-sep"),n.aria("role","separator"),n.state.set("text","-")),e.selectable&&(n.aria("role","menuitemcheckbox"),n.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||n.classes.add("menu-item-normal"),n.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&n.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var t,n=this,e=n.settings,i=n.parent();if(i.items().each(function(e){e!==n&&e.hideMenu()}),e.menu){(t=n.menu)?t.show():((t=e.menu).length?t={type:"menu",items:t}:t.type=t.type||"menu",i.settings.itemDefaults&&(t.itemDefaults=i.settings.itemDefaults),(t=n.menu=b.create(t).parent(n).renderTo()).reflow(),t.on("cancel",function(e){e.stopPropagation(),n.focus(),t.hide()}),t.on("show hide",function(e){e.control.items&&e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),t.on("hide",function(e){e.control===t&&n.classes.remove("selected")}),t.submenu=!0),t._parentMenu=i,t.classes.add("menu-sub");var r=t.testMoveRel(n.getEl(),n.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);t.moveRel(n.getEl(),r),r="menu-sub-"+(t.rel=r),t.classes.remove(t._lastRel).add(r),t._lastRel=r,n.classes.add("selected"),n.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){var e,t=this,n=t._id,i=t.settings,r=t.classPrefix,o=t.state.get("text"),s=t.settings.icon,a="",l=i.shortcut,u=t.encode(i.url);function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(e){var t=i.match||"";return t?e.replace(new RegExp(c(t),"gi"),function(e){return"!mce~match["+e+"]mce~match!"}):e}function f(e){return e.replace(new RegExp(c("!mce~match["),"g"),"<b>").replace(new RegExp(c("]mce~match!"),"g"),"</b>")}return s&&t.parent().classes.add("menu-has-icons"),i.image&&(a=" style=\"background-image: url('"+i.image+"')\""),l&&(l=function(e){var t,n,i={};for(i=fe.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)(n=i[e[t].toLowerCase()])&&(e[t]=n);return e.join("+")}(l)),s=r+"ico "+r+"i-"+(t.settings.icon||"none"),e="-"!==o?'<i class="'+s+'"'+a+"></i>\xa0":"",o=f(t.encode(d(o))),u=f(t.encode(d(u))),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1">'+e+("-"!==o?'<span id="'+n+'-text" class="'+r+'text">'+o+"</span>":"")+(l?'<div id="'+n+'-shortcut" class="'+r+'menu-shortcut">'+l+"</div>":"")+(i.menu?'<div class="'+r+'caret"></div>':"")+(u?'<div class="'+r+'menu-item-link">'+u+"</div>":"")+"</div>"},postRender:function(){var t=this,n=t.settings,e=n.textStyle;if("function"==typeof e&&(e=e.call(this)),e){var i=t.getEl("text");i&&(i.setAttribute("style",e),t._textStyle=e)}return t.on("mouseenter click",function(e){e.control===t&&(n.menu||"click"!==e.type?(t.showMenu(),e.aria&&t.menu.focus(!0)):(t.fire("select"),u.requestAnimationFrame(function(){t.parent().hideAll()})))}),t._super(),t},hover:function(){return this.parent().items().each(function(e){e.classes.remove("selected")}),this.classes.toggle("selected",!0),this},active:function(e){return function(e,t){var n=e._textStyle;if(n){var i=e.getEl("text");i.setAttribute("style",n),t&&(i.style.color="",i.style.backgroundColor="")}}(this,e),void 0!==e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}}),dr=Kt.extend({Defaults:{classes:"radio",role:"radio"}}),fr=Wt.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"===e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var t=this;t._super(),t.resizeDragHelper=new ft(this._id,{start:function(){t.fire("ResizeStart")},drag:function(e){"both"!==t.settings.direction&&(e.deltaX=0),t.fire("Resize",e)},stop:function(){t.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}});function hr(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}var mr=Wt.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var n=this;n._super(e),n.settings.size&&(n.size=n.settings.size),n.settings.options&&(n._options=n.settings.options),n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e,t=this,n="";return e=hr(t._options),t.size&&(n=' size = "'+t.size+'"'),'<select id="'+t._id+'" class="'+t.classes+'"'+n+">"+e+"</select>"},bindStates:function(){var t=this;return t.state.on("change:options",function(e){t.getEl().innerHTML=hr(e.value)}),t._super()}});function gr(e,t,n){return e<t&&(e=t),n<e&&(e=n),e}function pr(e,t,n){e.setAttribute("aria-"+t,n)}function vr(e,t){var n,i,r,o,s;"v"===e.settings.orientation?(r="top",i="height",n="h"):(r="left",i="width",n="w"),s=e.getEl("handle"),o=((e.layoutRect()[n]||100)-Ce.getSize(s)[i])*((t-e._minValue)/(e._maxValue-e._minValue))+"px",s.style[r]=o,s.style.height=e.layoutRect().h+"px",pr(s,"valuenow",t),pr(s,"valuetext",""+e.settings.previewFilter(t)),pr(s,"valuemin",e._minValue),pr(s,"valuemax",e._maxValue)}var br=Wt.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"===e.orientation&&t.classes.add("vertical"),t._minValue=X(e.minValue)?e.minValue:0,t._maxValue=X(e.maxValue)?e.maxValue:100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div id="'+e+'-handle" class="'+t+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var e,t,n,i,r,o,s,a,l,u,c,d,f,h,m=this;e=m._minValue,t=m._maxValue,"v"===m.settings.orientation?(n="screenY",i="top",r="height",o="h"):(n="screenX",i="left",r="width",o="w"),m._super(),function(o,s){function t(e){var t,n,i,r;t=gr(t=(((t=m.value())+(r=n=o))/((i=s)-r)+.05*e)*(i-n)-n,o,s),m.value(t),m.fire("dragstart",{value:t}),m.fire("drag",{value:t}),m.fire("dragend",{value:t})}m.on("keydown",function(e){switch(e.keyCode){case 37:case 38:t(-1);break;case 39:case 40:t(1)}})}(e,t),s=e,a=t,l=m.getEl("handle"),m._dragHelper=new ft(m._id,{handle:m._id+"-handle",start:function(e){u=e[n],c=parseInt(m.getEl("handle").style[i],10),d=(m.layoutRect()[o]||100)-Ce.getSize(l)[r],m.fire("dragstart",{value:h})},drag:function(e){var t=e[n]-u;f=gr(c+t,0,d),l.style[i]=f+"px",h=s+f/d*(a-s),m.value(h),m.tooltip().text(""+m.settings.previewFilter(h)).show().moveRel(l,"bc tc"),m.fire("drag",{value:h})},stop:function(){m.tooltip().hide(),m.fire("dragend",{value:h})}})},repaint:function(){this._super(),vr(this,this.value())},bindStates:function(){var t=this;return t.state.on("change:value",function(e){vr(t,e.value)}),t._super()}}),yr=Wt.extend({renderHtml:function(){return this.classes.add("spacer"),this.canFocus=!1,'<div id="'+this._id+'" class="'+this.classes+'"></div>'}}),xr=ar.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e,t,n=this.getEl(),i=this.layoutRect();return this._super(),e=n.firstChild,t=n.lastChild,we(e).css({width:i.w-Ce.getSize(t).width,height:i.h-2}),we(t).css({height:i.h-2}),this},activeMenu:function(e){we(this.getEl().lastChild).toggleClass(this.classPrefix+"active",e)},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a=n.settings,l="";return(e=a.image)?(o="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o=a.icon?r+"ico "+r+"i-"+o:"",s&&(n.classes.add("btn-has-text"),l='<span class="'+r+'txt">'+n.encode(s)+"</span>"),t="boolean"==typeof a.active?' aria-pressed="'+a.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" role="button"'+t+' tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+l+'</button><button type="button" class="'+r+'open" hidefocus="1" tabindex="-1">'+(n._menuBtnText?(o?"\xa0":"")+n._menuBtnText:"")+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var n=this.settings.onclick;return this.on("click",function(e){var t=e.target;if(e.control===this)for(;t;){if(e.aria&&"down"!==e.aria.key||"BUTTON"===t.nodeName&&-1===t.className.indexOf("open"))return e.stopImmediatePropagation(),void(n&&n.call(this,e));t=t.parentNode}}),delete this.settings.onclick,this._super()}}),wr=Ei.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}}),_r=bt.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(n){var e;this.activeTabId&&(e=this.getEl(this.activeTabId),we(e).removeClass(this.classPrefix+"active"),e.setAttribute("aria-selected","false")),this.activeTabId="t"+n,(e=this.getEl("t"+n)).setAttribute("aria-selected","true"),we(e).addClass(this.classPrefix+"active"),this.items()[n].show().fire("showtab"),this.reflow(),this.items().each(function(e,t){n!==t&&e.hide()})},renderHtml:function(){var i=this,e=i._layout,r="",o=i.classPrefix;return i.preRender(),e.preRender(i),i.items().each(function(e,t){var n=i._id+"-t"+t;e.aria("role","tabpanel"),e.aria("labelledby",n),r+='<div id="'+n+'" class="'+o+'tab" unselectable="on" role="tab" aria-controls="'+e._id+'" aria-selected="false" tabIndex="-1">'+i.encode(e.settings.title)+"</div>"}),'<div id="'+i._id+'" class="'+i.classes+'" hidefocus="1" tabindex="-1"><div id="'+i._id+'-head" class="'+o+'tabs" role="tablist">'+r+'</div><div id="'+i._id+'-body" class="'+i.bodyClasses+'">'+e.renderHtml(i)+"</div></div>"},postRender:function(){var i=this;i._super(),i.settings.activeTab=i.settings.activeTab||0,i.activateTab(i.settings.activeTab),this.on("click",function(e){var t=e.target.parentNode;if(t&&t.id===i._id+"-head")for(var n=t.childNodes.length;n--;)t.childNodes[n]===e.target&&i.activateTab(n)})},initLayoutRect:function(){var e,t,n,i=this;t=(t=Ce.getSize(i.getEl("head")).width)<0?0:t,n=0,i.items().each(function(e){t=Math.max(t,e.layoutRect().minW),n=Math.max(n,e.layoutRect().minH)}),i.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=t,e.settings.h=n,e.layoutRect({x:0,y:0,w:t,h:n})});var r=Ce.getSize(i.getEl("head")).height;return i.settings.minWidth=t,i.settings.minHeight=n+r,(e=i._super()).deltaH+=r,e.innerH=e.h-e.deltaH,e}}),Cr=Wt.extend({init:function(e){var n=this;n._super(e),n.classes.add("textbox"),e.multiline?n.classes.add("multiline"):(n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))}),n.on("keyup",function(e){n.state.set("value",e.target.value)}))},repaint:function(){var e,t,n,i,r,o=this,s=0;e=o.getEl().style,t=o._layoutRect,r=o._lastRepaintRect||{};var a=document;return!o.settings.multiline&&a.all&&(!a.documentMode||a.documentMode<=8)&&(e.lineHeight=t.h-s+"px"),i=(n=o.borderBox).left+n.right+8,s=n.top+n.bottom+(o.settings.multiline?8:0),t.x!==r.x&&(e.left=t.x+"px",r.x=t.x),t.y!==r.y&&(e.top=t.y+"px",r.y=t.y),t.w!==r.w&&(e.width=t.w-i+"px",r.w=t.w),t.h!==r.h&&(e.height=t.h-s+"px",r.h=t.h),o._lastRepaintRect=r,o.fire("repaint",{},!1),o},renderHtml:function(){var t,e,n=this,i=n.settings;return t={id:n._id,hidefocus:"1"},w.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){t[e]=i[e]}),n.disabled()&&(t.disabled="disabled"),i.subtype&&(t.type=i.subtype),(e=Ce.create(i.multiline?"textarea":"input",t)).value=n.state.get("value"),e.className=n.classes.toString(),e.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var t=this;t.getEl().value=t.state.get("value"),t._super(),t.$el.on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)})},bindStates:function(){var t=this;return t.state.on("change:value",function(e){t.getEl().value!==e.value&&(t.getEl().value=e.value)}),t.state.on("change:disabled",function(e){t.getEl().disabled=e.value}),t._super()},remove:function(){this.$el.off(),this._super()}}),Rr=function(){return{Selector:Ue,Collection:$e,ReflowQueue:Qe,Control:st,Factory:b,KeyboardNavigation:lt,Container:ct,DragHelper:ft,Scrollable:vt,Panel:bt,Movable:Se,Resizable:yt,FloatPanel:kt,Window:Vt,MessageBox:Yt,Tooltip:Dt,Widget:Wt,Progress:Ot,Notification:Bt,Layout:Xt,AbsoluteLayout:qt,Button:jt,ButtonGroup:Gt,Checkbox:Kt,ComboBox:Qt,ColorBox:en,PanelButton:tn,ColorButton:rn,ColorPicker:sn,Path:ln,ElementPath:un,FormItem:cn,Form:dn,FieldSet:fn,FilePicker:_i,FitLayout:Ci,FlexLayout:Ri,FlowLayout:Ei,FormatControls:er,GridLayout:tr,Iframe:nr,InfoBox:ir,Label:rr,Toolbar:or,MenuBar:sr,MenuButton:ar,MenuItem:cr,Throbber:Mt,Menu:lr,ListBox:ur,Radio:dr,ResizeHandle:fr,SelectBox:mr,Slider:br,Spacer:yr,SplitButton:xr,StackLayout:wr,TabPanel:_r,TextBox:Cr,DropZone:an,BrowseButton:Jt}},Er=function(n){n.ui?w.each(Rr(),function(e,t){n.ui[t]=e}):n.ui=Rr()};w.each(Rr(),function(e,t){b.add(t,e)}),Er(window.tinymce?window.tinymce:{}),o.add("modern",function(e){return er.setup(e),$t(e)})}();
|
1
|
+
// 4.9.11 (2020-07-13)
|
2
|
+
!function(V){"use strict";var o=function(){},H=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}},q=function(e){return function(){return e}},$=function(e){return e};function d(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var e,t,n,r,i,a,u,s,c,l,f,m,g,p,h,v,y=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},b=q(!1),C=q(!0),x=function(){return w},w=(e=function(e){return e.isNone()},r={fold:function(e,t){return e()},is:b,isSome:b,isNone:C,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:q(null),getOrUndefined:q(undefined),or:n,orThunk:t,map:x,each:o,bind:x,exists:b,forall:C,filter:x,equals:e,equals_:e,toArray:function(){return[]},toString:q("none()")},Object.freeze&&Object.freeze(r),r),N=function(n){var e=q(n),t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:C,isNone:b,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return N(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?o:w},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(b,function(e){return t(n,e)})}};return o},_={some:N,none:x,from:function(e){return null===e||e===undefined?w:N(e)}},E=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===t}},S=E("string"),T=E("object"),k=E("array"),A=E("null"),R=E("boolean"),D=E("function"),O=E("number"),B=Array.prototype.slice,P=Array.prototype.indexOf,I=Array.prototype.push,L=function(e,t){return P.call(e,t)},F=function(e,t){return-1<L(e,t)},M=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1},W=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},z=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)},K=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a)}return{pass:n,fail:r}},U=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},j=function(e,t,n){return z(e,function(e){n=t(n,e)}),n},X=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n))return _.some(o)}return _.none()},Y=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return _.some(n);return _.none()},G=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!k(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);I.apply(t,e[n])}return t}(W(e,t))},J=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n))return!1;return!0},Q=function(e,t){return U(e,function(e){return!F(t,e)})},Z=function(e){return 0===e.length?_.none():_.some(e[0])},ee=function(e){return 0===e.length?_.none():_.some(e[e.length-1])},te=D(Array.from)?Array.from:function(e){return B.call(e)},ne="undefined"!=typeof V.window?V.window:Function("return this;")(),re=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:ne,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},oe={getOrDie:function(e,t){var n=re(e,t);if(n===undefined||null===n)throw new Error(e+" not available on this browser");return n}},ie=function(){return oe.getOrDie("URL")},ae={createObjectURL:function(e){return ie().createObjectURL(e)},revokeObjectURL:function(e){ie().revokeObjectURL(e)}},ue=V.navigator,se=ue.userAgent,ce=function(e){return"matchMedia"in V.window&&V.matchMedia(e).matches};m=/Android/.test(se),a=(a=!(i=/WebKit/.test(se))&&/MSIE/gi.test(se)&&/Explorer/gi.test(ue.appName))&&/MSIE (\w+)\./.exec(se)[1],u=-1!==se.indexOf("Trident/")&&(-1!==se.indexOf("rv:")||-1!==ue.appName.indexOf("Netscape"))&&11,s=-1!==se.indexOf("Edge/")&&!a&&!u&&12,a=a||u||s,c=!i&&!u&&/Gecko/.test(se),l=-1!==se.indexOf("Mac"),f=/(iPad|iPhone)/.test(se),g="FormData"in V.window&&"FileReader"in V.window&&"URL"in V.window&&!!ae.createObjectURL,p=ce("only screen and (max-device-width: 480px)")&&(m||f),h=ce("only screen and (min-width: 800px)")&&(m||f),v=-1!==se.indexOf("Windows Phone"),s&&(i=!1);var le,fe={opera:!1,webkit:i,ie:a,gecko:c,mac:l,iOS:f,android:m,contentEditable:!f||g||534<=parseInt(se.match(/AppleWebKit\/(\d*)/)[1],10),transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==a,range:V.window.getSelection&&"Range"in V.window,documentMode:a&&!s?V.document.documentMode||7:10,fileApi:g,ceFalse:!1===a||8<a,cacheSuffix:null,container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===a||11<a,desktop:!p&&!h,windowsPhone:v},de=window.Promise?window.Promise:function(){function r(e,t){return function(){e.apply(t,arguments)}}var e=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=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,r(o,this),r(u,this))},t=i.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};function a(r){var o=this;null!==this._state?t(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void l(r(t,e),r(o,this),r(u,this))}this._state=!0,this._value=e,s.call(this)}catch(n){u.call(this,n)}}function u(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;e<t;e++)a.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function l(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}return i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(n,r){var o=this;return new i(function(e,t){a.call(o,new c(n,r,e,t))})},i.all=function(){var s=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i}(),me=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},ge=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},pe=function(t,n){var r,e;return(e=function(){var e=arguments;clearTimeout(r),r=me(function(){t.apply(this,e)},n)}).stop=function(){clearTimeout(r)},e},he={requestAnimationFrame:function(e,t){le?le.then(e):le=new de(function(e){t||(t=V.document.body),function(e,t){var n,r=V.window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=V.window[o[n]+"RequestAnimationFrame"];r||(r=function(e){V.window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:me,setInterval:ge,setEditorTimeout:function(e,t,n){return me(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=ge(function(){e.removed?clearInterval(r):t()},n)},debounce:pe,throttle:pe,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},ve=/^(?:mouse|contextmenu)|click/,ye={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},be=function(){return!1},Ce=function(){return!0},xe=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},we=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},Ne=function(e,t){var n,r,o=t||{};for(n in e)ye[n]||(o[n]=e[n]);if(o.target||(o.target=o.srcElement||V.document),fe.experimentalShadowDom&&(o.target=function(e,t){if(e.composedPath){var n=e.composedPath();if(n&&0<n.length)return n[0]}return t}(e,o.target)),e&&ve.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var i=o.target.ownerDocument||V.document,a=i.documentElement,u=i.body;o.pageX=e.clientX+(a&&a.scrollLeft||u&&u.scrollLeft||0)-(a&&a.clientLeft||u&&u.clientLeft||0),o.pageY=e.clientY+(a&&a.scrollTop||u&&u.scrollTop||0)-(a&&a.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=Ce,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=Ce,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},!(o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=Ce,o.stopPropagation()})==((r=o).isDefaultPrevented===Ce||r.isDefaultPrevented===be)&&(o.isDefaultPrevented=be,o.isPropagationStopped=be,o.isImmediatePropagationStopped=be),"undefined"==typeof o.metaKey&&(o.metaKey=!1),o},Ee=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){n.domLoaded||(n.domLoaded=!0,t(o))},u=function(){i()&&(we(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void he.setTimeout(s)}a()};!r.addEventListener||fe.ie&&fe.ie<11?(xe(r,"readystatechange",u),r.documentElement.doScroll&&e.self===e.top&&s()):i()?a():xe(e,"DOMContentLoaded",a),xe(e,"load",a)}},Se=function(){var m,g,p,h,v,y=this,b={};g="mce-data-"+(+new Date).toString(32),h="onmouseenter"in V.document.documentElement,p="onfocusin"in V.document.documentElement,v={mouseenter:"mouseover",mouseleave:"mouseout"},m=1,y.domLoaded=!1,y.events=b;var C=function(e,t){var n,r,o,i,a=b[t];if(n=a&&a[e.type])for(r=0,o=n.length;r<o;r++)if((i=n[r])&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return};y.bind=function(e,t,n,r){var o,i,a,u,s,c,l,f=V.window,d=function(e){C(Ne(e||f.event),o)};if(e&&3!==e.nodeType&&8!==e.nodeType){for(e[g]?o=e[g]:(o=m++,e[g]=o,b[o]={}),r=r||e,a=(t=t.split(" ")).length;a--;)c=d,s=l=!1,"DOMContentLoaded"===(u=t[a])&&(u="ready"),y.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,Ne({type:u})):(h||(s=v[u])&&(c=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=Ne(e||f.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,C(e,o))}),p||"focusin"!==u&&"focusout"!==u||(l=!0,s="focusin"===u?"focus":"blur",c=function(e){(e=Ne(e||f.event)).type="focus"===e.type?"focusin":"focusout",C(e,o)}),(i=b[o][u])?"ready"===u&&y.domLoaded?n({type:u}):i.push({func:n,scope:r}):(b[o][u]=i=[{func:n,scope:r}],i.fakeName=s,i.capture=l,i.nativeHandler=c,"ready"===u?Ee(e,c,y):xe(e,s||u,c,l)));return e=i=0,n}},y.unbind=function(e,t,n){var r,o,i,a,u,s;if(!e||3===e.nodeType||8===e.nodeType)return y;if(r=e[g]){if(s=b[r],t){for(i=(t=t.split(" ")).length;i--;)if(o=s[u=t[i]]){if(n)for(a=o.length;a--;)if(o[a].func===n){var c=o.nativeHandler,l=o.fakeName,f=o.capture;(o=o.slice(0,a).concat(o.slice(a+1))).nativeHandler=c,o.fakeName=l,o.capture=f,s[u]=o}n&&0!==o.length||(delete s[u],we(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in s)o=s[u],we(e,o.fakeName||u,o.nativeHandler,o.capture);s={}}for(u in s)return y;delete b[r];try{delete e[g]}catch(d){e[g]=null}}return y},y.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return y;for((n=Ne(null,n)).type=t,n.target=e;(r=e[g])&&C(n,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!n.isPropagationStopped(););return y},y.clean=function(e){var t,n,r=y.unbind;if(!e||3===e.nodeType||8===e.nodeType)return y;if(e[g]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[g]&&r(e);return y},y.destroy=function(){b={}},y.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};Se.Event=new Se,Se.Event.bind(V.window,"ready",function(){});var Te,ke,_e,Ae,Re,De,Oe,Be,Pe,Ie,Le,Fe,Me,ze,Ue,je,Ve,He,qe="sizzle"+-new Date,$e=V.window.document,We=0,Ke=0,Xe=Tt(),Ye=Tt(),Ge=Tt(),Je=function(e,t){return e===t&&(Le=!0),0},Qe=typeof undefined,Ze={}.hasOwnProperty,et=[],tt=et.pop,nt=et.push,rt=et.push,ot=et.slice,it=et.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},at="[\\x20\\t\\r\\n\\f]",ut="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",st="\\["+at+"*("+ut+")(?:"+at+"*([*^$|!~]?=)"+at+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ut+"))|)"+at+"*\\]",ct=":("+ut+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+st+")*)|.*)\\)|)",lt=new RegExp("^"+at+"+|((?:^|[^\\\\])(?:\\\\.)*)"+at+"+$","g"),ft=new RegExp("^"+at+"*,"+at+"*"),dt=new RegExp("^"+at+"*([>+~]|"+at+")"+at+"*"),mt=new RegExp("="+at+"*([^\\]'\"]*?)"+at+"*\\]","g"),gt=new RegExp(ct),pt=new RegExp("^"+ut+"$"),ht={ID:new RegExp("^#("+ut+")"),CLASS:new RegExp("^\\.("+ut+")"),TAG:new RegExp("^("+ut+"|[*])"),ATTR:new RegExp("^"+st),PSEUDO:new RegExp("^"+ct),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+at+"*(even|odd|(([+-]|)(\\d*)n|)"+at+"*(?:([+-]|)"+at+"*(\\d+)|))"+at+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+at+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+at+"*((?:-\\d)?\\d*)"+at+"*\\)|)(?=[^-]|$)","i")},vt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,bt=/^[^{]+\{\s*\[native \w/,Ct=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xt=/[+~]/,wt=/'|\\/g,Nt=new RegExp("\\\\([\\da-f]{1,6}"+at+"?|("+at+")|.)","ig"),Et=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{rt.apply(et=ot.call($e.childNodes),$e.childNodes),et[$e.childNodes.length].nodeType}catch(iE){rt={apply:et.length?function(e,t){nt.apply(e,ot.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var St=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:$e)!==Me&&Fe(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Me).nodeType)&&9!==u)return[];if(Ue&&!r){if(o=Ct.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&He(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return rt.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&ke.getElementsByClassName)return rt.apply(n,t.getElementsByClassName(a)),n}if(ke.qsa&&(!je||!je.test(e))){if(f=l=qe,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=De(e),(l=t.getAttribute("id"))?f=l.replace(wt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Pt(c[s]);d=xt.test(e)&&Ot(t.parentNode)||t,m=c.join(",")}if(m)try{return rt.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||t.removeAttribute("id")}}}return Be(e.replace(lt,"$1"),t,n,r)};function Tt(){var r=[];return function e(t,n){return r.push(t+" ")>_e.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function kt(e){return e[qe]=!0,e}function _t(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function At(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Rt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function Dt(a){return kt(function(i){return i=+i,kt(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function Ot(e){return e&&typeof e.getElementsByTagName!==Qe&&e}for(Te in ke=St.support={},Re=St.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Fe=St.setDocument=function(e){var t,s=e?e.ownerDocument||e:$e,n=s.defaultView;return s!==Me&&9===s.nodeType&&s.documentElement?(ze=(Me=s).documentElement,Ue=!Re(s),n&&n!==function(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){Fe()},!1):n.attachEvent&&n.attachEvent("onunload",function(){Fe()})),ke.attributes=!0,ke.getElementsByTagName=!0,ke.getElementsByClassName=bt.test(s.getElementsByClassName),ke.getById=!0,_e.find.ID=function(e,t){if(typeof t.getElementById!==Qe&&Ue){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},_e.filter.ID=function(e){var t=e.replace(Nt,Et);return function(e){return e.getAttribute("id")===t}},_e.find.TAG=ke.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Qe)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},_e.find.CLASS=ke.getElementsByClassName&&function(e,t){if(Ue)return t.getElementsByClassName(e)},Ve=[],je=[],ke.disconnectedMatch=!0,je=je.length&&new RegExp(je.join("|")),Ve=Ve.length&&new RegExp(Ve.join("|")),t=bt.test(ze.compareDocumentPosition),He=t||bt.test(ze.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Je=t?function(e,t){if(e===t)return Le=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!ke.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===$e&&He($e,e)?-1:t===s||t.ownerDocument===$e&&He($e,t)?1:Ie?it.call(Ie,e)-it.call(Ie,t):0:4&n?-1:1)}:function(e,t){if(e===t)return Le=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:Ie?it.call(Ie,e)-it.call(Ie,t):0;if(o===i)return _t(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?_t(a[r],u[r]):a[r]===$e?-1:u[r]===$e?1:0},s):Me},St.matches=function(e,t){return St(e,null,null,t)},St.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Me&&Fe(e),t=t.replace(mt,"='$1']"),ke.matchesSelector&&Ue&&(!Ve||!Ve.test(t))&&(!je||!je.test(t)))try{var n=(void 0).call(e,t);if(n||ke.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(iE){}return 0<St(t,Me,null,[e]).length},St.contains=function(e,t){return(e.ownerDocument||e)!==Me&&Fe(e),He(e,t)},St.attr=function(e,t){(e.ownerDocument||e)!==Me&&Fe(e);var n=_e.attrHandle[t.toLowerCase()],r=n&&Ze.call(_e.attrHandle,t.toLowerCase())?n(e,t,!Ue):undefined;return r!==undefined?r:ke.attributes||!Ue?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},St.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},St.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Le=!ke.detectDuplicates,Ie=!ke.sortStable&&e.slice(0),e.sort(Je),Le){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return Ie=null,e},Ae=St.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=Ae(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=Ae(t);return n},(_e=St.selectors={cacheLength:50,createPseudo:kt,match:ht,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Nt,Et),e[3]=(e[3]||e[4]||e[5]||"").replace(Nt,Et),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||St.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&St.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ht.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&>.test(n)&&(t=De(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Nt,Et).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Xe[e+" "];return t||(t=new RegExp("(^|"+at+")"+e+"("+at+"|$)"))&&Xe(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Qe&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=St.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1<t.indexOf(o):"$="===r?o&&t.slice(-o.length)===o:"~="===r?-1<(" "+t+" ").indexOf(o):"|="===r&&(t===o||t.slice(0,o.length+1)===o+"-"))}},CHILD:function(m,e,t,g,p){var h="nth"!==m.slice(0,3),v="last"!==m.slice(-4),y="of-type"===e;return 1===g&&0===p?function(e){return!!e.parentNode}:function(e,t,n){var r,o,i,a,u,s,c=h!==v?"nextSibling":"previousSibling",l=e.parentNode,f=y&&e.nodeName.toLowerCase(),d=!n&&!y;if(l){if(h){for(;c;){for(i=e;i=i[c];)if(y?i.nodeName.toLowerCase()===f:1===i.nodeType)return!1;s=c="only"===m&&!s&&"nextSibling"}return!0}if(s=[v?l.firstChild:l.lastChild],v&&d){for(u=(r=(o=l[qe]||(l[qe]={}))[m]||[])[0]===We&&r[1],a=r[0]===We&&r[2],i=u&&l.childNodes[u];i=++u&&i&&i[c]||(a=u=0)||s.pop();)if(1===i.nodeType&&++a&&i===e){o[m]=[We,u,a];break}}else if(d&&(r=(e[qe]||(e[qe]={}))[m])&&r[0]===We)a=r[1];else for(;(i=++u&&i&&i[c]||(a=u=0)||s.pop())&&((y?i.nodeName.toLowerCase()!==f:1!==i.nodeType)||!++a||(d&&((i[qe]||(i[qe]={}))[m]=[We,a]),i!==e)););return(a-=p)===g||a%g==0&&0<=a/g}}},PSEUDO:function(e,i){var t,a=_e.pseudos[e]||_e.setFilters[e.toLowerCase()]||St.error("unsupported pseudo: "+e);return a[qe]?a(i):1<a.length?(t=[e,e,"",i],_e.setFilters.hasOwnProperty(e.toLowerCase())?kt(function(e,t){for(var n,r=a(e,i),o=r.length;o--;)e[n=it.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:kt(function(e){var r=[],o=[],u=Oe(e.replace(lt,"$1"));return u[qe]?kt(function(e,t,n,r){for(var o,i=u(e,null,r,[]),a=e.length;a--;)(o=i[a])&&(e[a]=!(t[a]=o))}):function(e,t,n){return r[0]=e,u(r,null,n,o),!o.pop()}}),has:kt(function(t){return function(e){return 0<St(t,e).length}}),contains:kt(function(t){return t=t.replace(Nt,Et),function(e){return-1<(e.textContent||e.innerText||Ae(e)).indexOf(t)}}),lang:kt(function(n){return pt.test(n||"")||St.error("unsupported lang: "+n),n=n.replace(Nt,Et).toLowerCase(),function(e){var t;do{if(t=Ue?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=V.window.location&&V.window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===ze},focus:function(e){return e===Me.activeElement&&(!Me.hasFocus||Me.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!_e.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return vt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:Dt(function(){return[0]}),last:Dt(function(e,t){return[t-1]}),eq:Dt(function(e,t,n){return[n<0?n+t:n]}),even:Dt(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:Dt(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:Dt(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:Dt(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=_e.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})_e.pseudos[Te]=At(Te);for(Te in{submit:!0,reset:!0})_e.pseudos[Te]=Rt(Te);function Bt(){}function Pt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function It(a,e,t){var u=e.dir,s=t&&"parentNode"===u,c=Ke++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||s)return a(e,t,n)}:function(e,t,n){var r,o,i=[We,c];if(n){for(;e=e[u];)if((1===e.nodeType||s)&&a(e,t,n))return!0}else for(;e=e[u];)if(1===e.nodeType||s){if((r=(o=e[qe]||(e[qe]={}))[u])&&r[0]===We&&r[1]===c)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function Lt(o){return 1<o.length?function(e,t,n){for(var r=o.length;r--;)if(!o[r](e,t,n))return!1;return!0}:o[0]}function Ft(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function Mt(m,g,p,h,v,e){return h&&!h[qe]&&(h=Mt(h)),v&&!v[qe]&&(v=Mt(v,e)),kt(function(e,t,n,r){var o,i,a,u=[],s=[],c=t.length,l=e||function(e,t,n){for(var r=0,o=t.length;r<o;r++)St(e,t[r],n);return n}(g||"*",n.nodeType?[n]:n,[]),f=!m||!e&&g?l:Ft(l,u,m,n,r),d=p?v||(e?m:c||h)?[]:t:f;if(p&&p(f,d,n,r),h)for(o=Ft(d,s),h(o,[],n,r),i=o.length;i--;)(a=o[i])&&(d[s[i]]=!(f[s[i]]=a));if(e){if(v||m){if(v){for(o=[],i=d.length;i--;)(a=d[i])&&o.push(f[i]=a);v(null,d=[],o,r)}for(i=d.length;i--;)(a=d[i])&&-1<(o=v?it.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=Ft(d===t?d.splice(c,d.length):d),v?v(null,t,d,r):rt.apply(t,d)})}function zt(e){for(var r,t,n,o=e.length,i=_e.relative[e[0].type],a=i||_e.relative[" "],u=i?1:0,s=It(function(e){return e===r},a,!0),c=It(function(e){return-1<it.call(r,e)},a,!0),l=[function(e,t,n){return!i&&(n||t!==Pe)||((r=t).nodeType?s(e,t,n):c(e,t,n))}];u<o;u++)if(t=_e.relative[e[u].type])l=[It(Lt(l),t)];else{if((t=_e.filter[e[u].type].apply(null,e[u].matches))[qe]){for(n=++u;n<o&&!_e.relative[e[n].type];n++);return Mt(1<u&&Lt(l),1<u&&Pt(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(lt,"$1"),t,u<n&&zt(e.slice(u,n)),n<o&&zt(e=e.slice(n)),n<o&&Pt(e))}l.push(t)}return Lt(l)}Bt.prototype=_e.filters=_e.pseudos,_e.setFilters=new Bt,De=St.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Ye[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=_e.preFilter;a;){for(i in n&&!(r=ft.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=dt.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(lt," ")}),a=a.slice(n.length)),_e.filter)!(r=ht[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 t?a.length:a?St.error(e):Ye(e,u).slice(0)},Oe=St.compile=function(e,t){var n,h,v,y,b,r,o=[],i=[],a=Ge[e+" "];if(!a){for(t||(t=De(e)),n=t.length;n--;)(a=zt(t[n]))[qe]?o.push(a):i.push(a);(a=Ge(e,(h=i,y=0<(v=o).length,b=0<h.length,r=function(e,t,n,r,o){var i,a,u,s=0,c="0",l=e&&[],f=[],d=Pe,m=e||b&&_e.find.TAG("*",o),g=We+=null==d?1:Math.random()||.1,p=m.length;for(o&&(Pe=t!==Me&&t);c!==p&&null!=(i=m[c]);c++){if(b&&i){for(a=0;u=h[a++];)if(u(i,t,n)){r.push(i);break}o&&(We=g)}y&&((i=!u&&i)&&s--,e&&l.push(i))}if(s+=c,y&&c!==s){for(a=0;u=v[a++];)u(l,f,t,n);if(e){if(0<s)for(;c--;)l[c]||f[c]||(f[c]=tt.call(r));f=Ft(f)}rt.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&St.uniqueSort(r)}return o&&(We=g,Pe=d),l},y?kt(r):r))).selector=e}return a},Be=St.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&De(e=c.selector||e);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&ke.getById&&9===t.nodeType&&Ue&&_e.relative[i[1].type]){if(!(t=(_e.find.ID(a.matches[0].replace(Nt,Et),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=ht.needsContext.test(e)?0:i.length;o--&&(a=i[o],!_e.relative[u=a.type]);)if((s=_e.find[u])&&(r=s(a.matches[0].replace(Nt,Et),xt.test(i[0].type)&&Ot(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&Pt(i)))return rt.apply(n,r),n;break}}return(c||Oe(e,l))(r,t,!Ue,n,xt.test(e)&&Ot(t.parentNode)||t),n},ke.sortStable=qe.split("").sort(Je).join("")===qe,ke.detectDuplicates=!!Le,Fe(),ke.sortDetached=!0;var Ut=Array.isArray,jt=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,e.length!==undefined){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},Vt=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},Ht={isArray:Ut,toArray:function(e){var t,n,r=e;if(!Ut(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:jt,map:function(n,r){var o=[];return jt(n,function(e,t){o.push(r(e,t,n))}),o},filter:function(n,r){var o=[];return jt(n,function(e,t){r&&!r(e,t,n)||o.push(e)}),o},indexOf:function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},findIndex:Vt,find:function(e,t,n){var r=Vt(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},qt=/^\s*|\s*$/g,$t=function(e){return null===e||e===undefined?"":(""+e).replace(qt,"")},Wt=function(e,t){return t?!("array"!==t||!Ht.isArray(e))||typeof e===t:e!==undefined},Kt=function(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),Ht.each(e,function(e,t){if(!1===n.call(o,e,t,r))return!1;Kt(e,n,r,o)}))},Xt={trim:$t,isArray:Ht.isArray,is:Wt,toArray:Ht.toArray,makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:Ht.each,map:Ht.map,grep:Ht.filter,inArray:Ht.indexOf,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n,r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var u,s=arguments;for(n=1,r=s.length;n<r;n++)for(o in t=s[n])t.hasOwnProperty(o)&&(u=t[o])!==undefined&&(e[o]=u);return e},create:function(e,t,n){var r,o,i,a,u,s=this,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],!(o=s.createNS(e[3].replace(/\.\w+$/,""),n))[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},c=1),o[i]=t[i],s.extend(o[i].prototype,t),e[5]&&(r=s.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],u=o[i],o[i]=c?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],u.apply(this,arguments)},o[i].prototype[i]=o[i],s.each(r,function(e,t){o[i].prototype[t]=r[t]}),s.each(t,function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==i&&(o[i].prototype[t]=e)})),s.each(t["static"],function(e,t){o[i][t]=e})}},walk:Kt,createNS:function(e,t){var n,r;for(t=t||V.window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||V.window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Wt(e,"array")?e:Ht.map(e.split(t||","),$t)},_addCacheSuffix:function(e){var t=fe.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Yt=V.document,Gt=Array.prototype.push,Jt=Array.prototype.slice,Qt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Zt=Se.Event,en=Xt.makeMap("children,contents,next,prev"),tn=function(e){return void 0!==e},nn=function(e){return"string"==typeof e},rn=function(e,t){var n,r,o;for(o=(t=t||Yt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},on=function(e,t,n,r){var o;if(nn(t))t=rn(t,bn(e[0]));else if(t.length&&!t.nodeType){if(t=gn.makeArray(t),r)for(o=t.length-1;0<=o;o--)on(e,t[o],n,r);else for(o=0;o<t.length;o++)on(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},an=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},un=function(e,t,n){var r,o;return t=gn(t)[0],e.each(function(){var e=this;n&&r===e.parentNode||(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e)),o.appendChild(e)}),e},sn=Xt.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),cn=Xt.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),ln={"for":"htmlFor","class":"className",readonly:"readOnly"},fn={"float":"cssFloat"},dn={},mn={},gn=function(e,t){return new gn.fn.init(e,t)},pn=/^\s*|\s*$/g,hn=function(e){return null===e||e===undefined?"":(""+e).replace(pn,"")},vn=function(e,t){var n,r,o,i;if(e)if((n=e.length)===undefined){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},yn=function(e,n){var r=[];return vn(e,function(e,t){n(t,e)&&r.push(t)}),r},bn=function(e){return e?9===e.nodeType?e:e.ownerDocument:Yt};gn.fn=gn.prototype={constructor:gn,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return gn(e).attr(t);o.context=t=V.document}if(nn(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Qt.exec(e)))return gn(t).find(e);if(n[1])for(r=rn(e,bn(t)).firstChild;r;)Gt.call(o,r),r=r.nextSibling;else{if(!(r=bn(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Xt.toArray(this)},add:function(e,t){var n,r,o=this;if(nn(e))return o.add(gn(e));if(!1!==t)for(n=gn.unique(o.toArray().concat(gn.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Gt.apply(o,gn.makeArray(e));return o},attr:function(t,n){var e,r=this;if("object"==typeof t)vn(t,function(e,t){r.attr(e,t)});else{if(!tn(n)){if(r[0]&&1===r[0].nodeType){if((e=dn[t])&&e.get)return e.get(r[0],t);if(cn[t])return r.prop(t)?t:undefined;null===(n=r[0].getAttribute(t,2))&&(n=undefined)}return n}this.each(function(){var e;if(1===this.nodeType){if((e=dn[t])&&e.set)return void e.set(this,n);null===n?this.removeAttribute(t,2):this.setAttribute(t,n,2)}})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=ln[e]||e))vn(e,function(e,t){n.prop(e,t)});else{if(!tn(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(n,r){var e,o,i=this,t=function(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})},a=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})};if("object"==typeof n)vn(n,function(e,t){i.css(e,t)});else if(tn(r))n=t(n),"number"!=typeof r||sn[n]||(r=r.toString()+"px"),i.each(function(){var e=this.style;if((o=mn[n])&&o.set)o.set(this,r);else{try{this.style[fn[n]||n]=r}catch(t){}null!==r&&""!==r||(e.removeProperty?e.removeProperty(a(n)):e.removeAttribute(n))}});else{if(e=i[0],(o=mn[n])&&o.get)return o.get(e);if(!e.ownerDocument.defaultView)return e.currentStyle?e.currentStyle[t(n)]:"";try{return e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(a(n))}catch(u){return undefined}}return i},remove:function(){for(var e,t=this.length;t--;)e=this[t],Zt.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(tn(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){gn(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(tn(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return on(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return on(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?on(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?on(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return gn(e).append(this),this},prependTo:function(e){return gn(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return un(this,e)},wrapAll:function(e){return un(this,e,!0)},wrapInner:function(e){return this.each(function(){gn(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){gn(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),gn(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(o,i){var e=this;return"string"!=typeof o||(-1!==o.indexOf(" ")?vn(o.split(" "),function(){e.toggleClass(this,i)}):e.each(function(e,t){var n,r;(r=an(t,o))!==i&&(n=t.className,r?t.className=hn((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return an(this[0],e)},each:function(e){return vn(this,e)},on:function(e,t){return this.each(function(){Zt.bind(this,e,t)})},off:function(e,t){return this.each(function(){Zt.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?Zt.fire(this,e.type,e):Zt.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new gn(Jt.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)gn.find(e,this[t],r);return gn(r)},filter:function(n){return gn("function"==typeof n?yn(this.toArray(),function(e,t){return n(t,e)}):gn.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof gn&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&gn(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),gn(r)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Gt,sort:[].sort,splice:[].splice},Xt.extend(gn,{extend:Xt.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:Xt.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:Xt.isArray,each:vn,trim:hn,grep:yn,find:St,expr:St.selectors,unique:St.uniqueSort,text:St.getText,contains:St.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?gn.find.matchesSelector(t[0],e)?[t[0]]:[]:gn.find.matches(e,t)}});var Cn=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof gn&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&gn(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},xn=function(e,t,n,r){var o=[];for(r instanceof gn&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&gn(e).is(r))break}o.push(e)}return o},wn=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};vn({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Cn(e,"parentNode")},next:function(e){return wn(e,"nextSibling",1)},prev:function(e){return wn(e,"previousSibling",1)},children:function(e){return xn(e.firstChild,"nextSibling",1)},contents:function(e){return Xt.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,r){gn.fn[e]=function(t){var n=[];return this.each(function(){var e=r.call(n,this,t,n);e&&(gn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(en[e]||(n=gn.unique(n)),0===e.indexOf("parents")&&(n=n.reverse())),n=gn(n),t?n.filter(t):n}}),vn({parentsUntil:function(e,t){return Cn(e,"parentNode",t)},nextUntil:function(e,t){return xn(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return xn(e,"previousSibling",1,t).slice(1)}},function(r,o){gn.fn[r]=function(t,e){var n=[];return this.each(function(){var e=o.call(n,this,t,n);e&&(gn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(n=gn.unique(n),0!==r.indexOf("parents")&&"prevUntil"!==r||(n=n.reverse())),n=gn(n),e?n.filter(e):n}}),gn.fn.is=function(e){return!!e&&0<this.filter(e).length},gn.fn.init.prototype=gn.fn,gn.overrideDefaults=function(n){var r,o=function(e,t){return r=r||n(),0===arguments.length&&(e=r.element),t||(t=r.context),new o.fn.init(e,t)};return gn.extend(o,this),o};var Nn=function(n,r,e){vn(e,function(e,t){n[e]=n[e]||{},n[e][r]=t})};fe.ie&&fe.ie<8&&(Nn(dn,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?undefined:t},size:function(e){var t=e.size;return 20===t?undefined:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?undefined:t}}),Nn(dn,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),fe.ie&&fe.ie<9&&(fn["float"]="styleFloat",Nn(mn,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),gn.attrHooks=dn,gn.cssHooks=mn;var En,Sn,Tn,kn,_n,An,Rn,Dn=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Bn(r(1),r(2))},On=function(){return Bn(0,0)},Bn=function(e,t){return{major:e,minor:t}},Pn={nu:Bn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?On():Dn(e,n)},unknown:On},In="Firefox",Ln=function(e,t){return function(){return t===e}},Fn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Ln("Edge",t),isChrome:Ln("Chrome",t),isIE:Ln("IE",t),isOpera:Ln("Opera",t),isFirefox:Ln(In,t),isSafari:Ln("Safari",t)}},Mn={unknown:function(){return Fn({current:undefined,version:Pn.unknown()})},nu:Fn,edge:q("Edge"),chrome:q("Chrome"),ie:q("IE"),opera:q("Opera"),firefox:q(In),safari:q("Safari")},zn="Windows",Un="Android",jn="Solaris",Vn="FreeBSD",Hn=function(e,t){return function(){return t===e}},qn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Hn(zn,t),isiOS:Hn("iOS",t),isAndroid:Hn(Un,t),isOSX:Hn("OSX",t),isLinux:Hn("Linux",t),isSolaris:Hn(jn,t),isFreeBSD:Hn(Vn,t)}},$n={unknown:function(){return qn({current:undefined,version:Pn.unknown()})},nu:qn,windows:q(zn),ios:q("iOS"),android:q(Un),linux:q("Linux"),osx:q("OSX"),solaris:q(jn),freebsd:q(Vn)},Wn=function(e,t){var n=String(t).toLowerCase();return X(e,function(e){return e.search(n)})},Kn=function(e,n){return Wn(e,n).map(function(e){var t=Pn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Xn=function(e,n){return Wn(e,n).map(function(e){var t=Pn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Yn=function(e,t){return-1!==e.indexOf(t)},Gn=function(e){return e.replace(/^\s+|\s+$/g,"")},Jn=function(e){return e.replace(/\s+$/g,"")},Qn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Zn=function(t){return function(e){return Yn(e,t)}},er=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Yn(e,"edge/")&&Yn(e,"chrome")&&Yn(e,"safari")&&Yn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Qn],search:function(e){return Yn(e,"chrome")&&!Yn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Yn(e,"msie")||Yn(e,"trident")}},{name:"Opera",versionRegexes:[Qn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Zn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Zn("firefox")},{name:"Safari",versionRegexes:[Qn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Yn(e,"safari")||Yn(e,"mobile/"))&&Yn(e,"applewebkit")}}],tr=[{name:"Windows",search:Zn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Yn(e,"iphone")||Yn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Zn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Zn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Zn("linux"),versionRegexes:[]},{name:"Solaris",search:Zn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Zn("freebsd"),versionRegexes:[]}],nr={browsers:q(er),oses:q(tr)},rr=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=nr.browsers(),m=nr.oses(),g=Kn(d,e).fold(Mn.unknown,Mn.nu),p=Xn(m,e).fold($n.unknown,$n.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,a=t.isAndroid()&&3===t.version.major,u=t.isAndroid()&&4===t.version.major,s=o||a||u&&!0===/mobile/i.test(r),c=t.isiOS()||t.isAndroid(),l=c&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:q(o),isiPhone:q(i),isTablet:q(s),isPhone:q(l),isTouch:q(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:q(f)})}},or={detect:(En=function(){var e=V.navigator.userAgent;return rr(e)},Tn=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Tn||(Tn=!0,Sn=En.apply(null,e)),Sn})},ir=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:q(e)}},ar={fromHtml:function(e,t){var n=(t||V.document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw V.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return ir(n.childNodes[0])},fromTag:function(e,t){var n=(t||V.document).createElement(e);return ir(n)},fromText:function(e,t){var n=(t||V.document).createTextNode(e);return ir(n)},fromDom:ir,fromPoint:function(e,t,n){var r=e.dom();return _.from(r.elementFromPoint(t,n)).map(ir)}},ur=(V.Node.ATTRIBUTE_NODE,V.Node.CDATA_SECTION_NODE,V.Node.COMMENT_NODE,V.Node.DOCUMENT_NODE),sr=(V.Node.DOCUMENT_TYPE_NODE,V.Node.DOCUMENT_FRAGMENT_NODE,V.Node.ELEMENT_NODE),cr=V.Node.TEXT_NODE,lr=(V.Node.PROCESSING_INSTRUCTION_NODE,V.Node.ENTITY_REFERENCE_NODE,V.Node.ENTITY_NODE,V.Node.NOTATION_NODE,function(e){return e.dom().nodeName.toLowerCase()}),fr=function(t){return function(e){return e.dom().nodeType===t}},dr=fr(sr),mr=fr(cr),gr=Object.keys,pr=Object.hasOwnProperty,hr=function(e,t){for(var n=gr(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},vr=function(e,r){var o={};return hr(e,function(e,t){var n=r(e,t);o[n.k]=n.v}),o},yr=function(e,n){var r={},o={};return hr(e,function(e,t){(n(e,t)?r:o)[t]=e}),{t:r,f:o}},br=function(e,t){return pr.call(e,t)},Cr=function(e){return e.style!==undefined&&D(e.style.getPropertyValue)},xr=function(e,t,n){if(!(S(n)||R(n)||O(n)))throw V.console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},wr=function(e,t,n){xr(e.dom(),t,n)},Nr=function(e,t){var n=e.dom();hr(t,function(e,t){xr(n,t,e)})},Er=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},Sr=function(e,t){e.dom().removeAttribute(t)},Tr=function(e,t){var n=e.dom();hr(t,function(e,t){!function(e,t,n){if(!S(n))throw V.console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Cr(e)&&e.style.setProperty(t,n)}(n,t,e)})},kr=function(e,t){var n,r,o=e.dom(),i=V.window.getComputedStyle(o).getPropertyValue(t),a=""!==i||(r=mr(n=e)?n.dom().parentNode:n.dom())!==undefined&&null!==r&&r.ownerDocument.body.contains(r)?i:_r(o,t);return null===a?undefined:a},_r=function(e,t){return Cr(e)?e.style.getPropertyValue(t):""},Ar=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return z(t,function(e,t){r[e]=q(n[t])}),r}},Rr=function(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n},Dr=function(){return oe.getOrDie("Node")},Or=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},Br=function(e,t){return Or(e,t,Dr().DOCUMENT_POSITION_CONTAINED_BY)},Pr=sr,Ir=ur,Lr=function(e,t){var n=e.dom();if(n.nodeType!==Pr)return!1;var r=n;if(r.matches!==undefined)return r.matches(t);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(t);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(t);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},Fr=function(e){return e.nodeType!==Pr&&e.nodeType!==Ir||0===e.childElementCount},Mr=function(e,t){return e.dom()===t.dom()},zr=or.detect().browser.isIE()?function(e,t){return Br(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Ur=function(e){return ar.fromDom(e.dom().ownerDocument)},jr=function(e){return ar.fromDom(e.dom().ownerDocument.defaultView)},Vr=function(e){return _.from(e.dom().parentNode).map(ar.fromDom)},Hr=function(e){return _.from(e.dom().previousSibling).map(ar.fromDom)},qr=function(e){return _.from(e.dom().nextSibling).map(ar.fromDom)},$r=function(e){return t=Rr(e,Hr),(n=B.call(t,0)).reverse(),n;var t,n},Wr=function(e){return Rr(e,qr)},Kr=function(e){return W(e.dom().childNodes,ar.fromDom)},Xr=function(e,t){var n=e.dom().childNodes;return _.from(n[t]).map(ar.fromDom)},Yr=function(e){return Xr(e,0)},Gr=function(e){return Xr(e,e.dom().childNodes.length-1)},Jr=(Ar("element","offset"),or.detect().browser),Qr=function(e){return X(e,dr)},Zr={getPos:function(e,t,n){var r,o,i,a=0,u=0,s=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===kr(ar.fromDom(e),"position"))return{x:a=(o=t.getBoundingClientRect()).left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,y:u=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType;)a+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType;)a-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=(i=ar.fromDom(t),Jr.isFirefox()&&"table"===lr(i)?Qr(Kr(i)).filter(function(e){return"caption"===lr(e)}).bind(function(o){return Qr(Wr(o)).map(function(e){var t=e.dom().offsetTop,n=o.dom().offsetTop,r=o.dom().offsetHeight;return t<=n?-r:0})}).getOr(0):0)}return{x:a,y:u}}},eo={},to={exports:eo};kn=undefined,_n=eo,An=to,Rn=undefined,function(e){"object"==typeof _n&&void 0!==An?An.exports=e():"function"==typeof kn&&kn.amd?kn([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=e()}(function(){return function i(a,u,s){function c(t,e){if(!u[t]){if(!a[t]){var n="function"==typeof Rn&&Rn;if(!e&&n)return n(t,!0);if(l)return l(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[t]={exports:{}};a[t][0].call(o.exports,function(e){return c(a[t][1][e]||e)},o,o.exports,i,a,u,s)}return u[t].exports}for(var l="function"==typeof Rn&&Rn,e=0;e<s.length;e++)c(s[e]);return c}({1:[function(e,t,n){var r,o,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(iE){try{return r.call(null,e,0)}catch(iE){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(iE){r=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(iE){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&&g())}function g(){if(!f){var e=s(m);f=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,f=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(iE){try{return o.call(null,e)}catch(iE){return o.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||f||s(g)},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=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(e,f,t){(function(n){!function(e){var t=setTimeout;function r(){}function i(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=0,this._handled=!1,this._value=undefined,this._deferreds=[],l(e,this)}function o(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,i._immediateFn(function(){var e=1===n._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(n._value)}catch(iE){return void u(r.promise,iE)}a(r.promise,t)}else(1===n._state?a:u)(r.promise,n._value)})):n._deferreds.push(r)}function a(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void s(e);if("function"==typeof n)return void l((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,s(e)}catch(iE){u(e,iE)}var r,o}function u(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)o(e,e._deferreds[t]);e._deferreds=null}function c(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e(function(e){n||(n=!0,a(t,e))},function(e){n||(n=!0,u(t,e))})}catch(r){if(n)return;n=!0,u(t,r)}}i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(r);return o(this,new c(e,t,n)),n},i.all=function(e){var s=Array.prototype.slice.call(e);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i._immediateFn="function"==typeof n?function(e){n(e)}:function(e){t(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},void 0!==f&&f.exports?f.exports=i:e.Promise||(e.Promise=i)}(this)}).call(this,e("timers").setImmediate)},{timers:3}],3:[function(s,e,c){(function(e,t){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,i={},a=0;function u(e,t){this._id=e,this._clearFn=t}c.setTimeout=function(){return new u(n.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new u(n.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(e){e.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},c.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},c._unrefActive=c.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},c.setImmediate="function"==typeof e?e:function(e){var t=a++,n=!(arguments.length<2)&&o.call(arguments,1);return i[t]=!0,r(function(){i[t]&&(n?e.apply(null,n):e.call(null),c.clearImmediate(t))}),t},c.clearImmediate="function"==typeof t?t:function(e){delete i[e]}}).call(this,s("timers").setImmediate,s("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(e,t,n){var r=e("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();t.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var no=to.exports.boltExport,ro=function(e){var n=_.none(),t=[],r=function(e){o()?a(e):t.push(e)},o=function(){return n.isSome()},i=function(e){z(e,a)},a=function(t){n.each(function(e){V.setTimeout(function(){t(e)},0)})};return e(function(e){n=_.some(e),i(t),t=[]}),{get:r,map:function(n){return ro(function(t){r(function(e){t(n(e))})})},isReady:o}},oo={nu:ro,pure:function(t){return ro(function(e){e(t)})}},io=function(e){V.setTimeout(function(){throw e},0)},ao=function(n){var e=function(e){n().then(e,io)};return{map:function(e){return ao(function(){return n().then(e)})},bind:function(t){return ao(function(){return n().then(function(e){return t(e).toPromise()})})},anonBind:function(e){return ao(function(){return n().then(function(){return e.toPromise()})})},toLazy:function(){return oo.nu(e)},toCached:function(){var e=null;return ao(function(){return null===e&&(e=n()),e})},toPromise:n,get:e}},uo={nu:function(e){return ao(function(){return new no(e)})},pure:function(e){return ao(function(){return no.resolve(e)})}},so=function(a,e){return e(function(r){var o=[],i=0;0===a.length?r([]):z(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})})},co=function(e){return so(e,uo.nu)},lo=function(n){return{is:function(e){return n===e},isValue:C,isError:b,getOr:q(n),getOrThunk:q(n),getOrDie:q(n),or:function(e){return lo(n)},orThunk:function(e){return lo(n)},fold:function(e,t){return t(n)},map:function(e){return lo(e(n))},mapError:function(e){return lo(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return _.some(n)}}},fo=function(n){return{is:b,isValue:b,isError:C,getOr:$,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return fo(n)},mapError:function(e){return fo(e(n))},each:o,bind:function(e){return fo(n)},exists:b,forall:C,toOption:_.none}},mo={value:lo,error:fo,fromOption:function(e,t){return e.fold(function(){return fo(t)},lo)}};function go(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"lastChild","previousSibling",e)}}var po,ho,vo,yo=function(t){var n;return function(e){return(n=n||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(t,q(!0))).hasOwnProperty(lr(e))}},bo=yo(["h1","h2","h3","h4","h5","h6"]),Co=yo(["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"]),xo=function(e){return dr(e)&&!Co(e)},wo=function(e){return dr(e)&&"br"===lr(e)},No=yo(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),Eo=yo(["ul","ol","dl"]),So=yo(["li","dd","dt"]),To=yo(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),ko=yo(["thead","tbody","tfoot"]),_o=yo(["td","th"]),Ao=yo(["pre","script","textarea","style"]),Ro=function(t){return function(e){return!!e&&e.nodeType===t}},Do=Ro(1),Oo=function(e){var r=e.toLowerCase().split(" ");return function(e){var t,n;if(e&&e.nodeType)for(n=e.nodeName.toLowerCase(),t=0;t<r.length;t++)if(n===r[t])return!0;return!1}},Bo=function(t){return function(e){if(Do(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Po=Ro(3),Io=Ro(8),Lo=Ro(9),Fo=Ro(11),Mo=Oo("br"),zo=Bo("true"),Uo=Bo("false"),jo={isText:Po,isElement:Do,isComment:Io,isDocument:Lo,isDocumentFragment:Fo,isBr:Mo,isContentEditableTrue:zo,isContentEditableFalse:Uo,isRestrictedNode:function(e){return!!e&&!Object.getPrototypeOf(e)},matchNodeNames:Oo,hasPropValue:function(t,n){return function(e){return Do(e)&&e[t]===n}},hasAttribute:function(t,e){return function(e){return Do(e)&&e.hasAttribute(t)}},hasAttributeValue:function(t,n){return function(e){return Do(e)&&e.getAttribute(t)===n}},matchStyleValues:function(r,e){var o=e.toLowerCase().split(" ");return function(e){var t;if(Do(e))for(t=0;t<o.length;t++){var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if((n?n.getPropertyValue(r):null)===o[t])return!0}return!1}},isBogus:function(e){return Do(e)&&e.hasAttribute("data-mce-bogus")},isBogusAll:function(e){return Do(e)&&"all"===e.getAttribute("data-mce-bogus")},isTable:function(e){return Do(e)&&"TABLE"===e.tagName}},Vo=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Ho=function(e,t){var n,r=t.childNodes;if(!jo.isElement(t)||!Vo(t)){for(n=r.length-1;0<=n;n--)Ho(e,r[n]);if(!1===jo.isDocument(t)){if(jo.isText(t)&&0<t.nodeValue.length){var o=Xt.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||0<o)return;if(0===o&&(a=(i=t).previousSibling&&"SPAN"===i.previousSibling.nodeName,u=i.nextSibling&&"SPAN"===i.nextSibling.nodeName,a&&u))return}else if(jo.isElement(t)&&(1===(r=t.childNodes).length&&Vo(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||To(ar.fromDom(t))))return;e.remove(t)}var i,a,u;return t}},qo={trimNode:Ho},$o=Xt.makeMap,Wo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ko=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Xo=/[<>&\"\']/g,Yo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Go={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};ho={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},vo={"<":"<",">":">","&":"&",""":'"',"'":"'"};var Jo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),ho[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};po=Jo("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);var Qo=function(e,t){return e.replace(t?Wo:Ko,function(e){return ho[e]||e})},Zo=function(e,t){return e.replace(t?Wo:Ko,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":ho[e]||"&#"+e.charCodeAt(0)+";"})},ei=function(e,t,n){return n=n||po,e.replace(t?Wo:Ko,function(e){return ho[e]||n[e]||e})},ti={encodeRaw:Qo,encodeAllRaw:function(e){return(""+e).replace(Xo,function(e){return ho[e]||e})},encodeNumeric:Zo,encodeNamed:ei,getEncodeFunc:function(e,t){var n=Jo(t)||po,r=$o(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?Wo:Ko,function(e){return ho[e]!==undefined?ho[e]:n[e]!==undefined?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return ei(e,t,n)}:ei:r.numeric?Zo:Qo},decode:function(e){return e.replace(Yo,function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Go[t]||String.fromCharCode(t):vo[e]||po[e]||(n=e,(r=ar.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},ni={},ri={},oi=Xt.makeMap,ii=Xt.each,ai=Xt.extend,ui=Xt.explode,si=Xt.inArray,ci=function(e,t){return(e=Xt.trim(e))?e.split(t||" "):[]},li=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};for(t=t||"","string"==typeof(n=n||[])&&(n=ci(n)),r=(e=ci(e)).length;r--;)i={attributes:a(o=ci([u,t].join(" "))),attributesOrder:o,children:a(n,ri)},s[e[r]]=i},c=function(e,t){var n,r,o,i;for(n=(e=ci(e)).length,t=ci(t);n--;)for(r=s[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])};return ni[e]?ni[e]:(u="id accesskey class dir lang style tabindex title role",t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",n="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(u+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",t+=" article aside details dialog figure main header footer hgroup section nav",n+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(u+=" xml:lang",n=[n,i="acronym applet basefont big font strike tt"].join(" "),ii(ci(i),function(e){a(e,"",n)}),t=[t,o="center dir isindex noframes"].join(" "),r=[t,n].join(" "),ii(ci(o),function(e){a(e,"",r)})),r=r||[t,n].join(" "),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",r),a("address dt dd div caption","",r),a("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","",n),a("blockquote","cite",r),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",r),a("dl","","dt dd"),a("a","href target rel media hreflang type",n),a("q","cite",n),a("ins del","cite datetime",r),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",r),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width height",[r,"param"].join(" ")),a("param","name value"),a("map","name",[r,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",r),a("th","colspan rowspan headers scope abbr",r),a("form","accept-charset action autocomplete enctype method name novalidate target",r),a("fieldset","disabled form name",[r,"legend"].join(" ")),a("label","form for",n),a("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"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?r:n),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[r,"li"].join(" ")),a("noscript","",r),"html4"!==e&&(a("wbr"),a("ruby","",[n,"rt rp"].join(" ")),a("figcaption","",r),a("mark rt rp summary bdi","",n),a("canvas","width height",r),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[r,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[r,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[n,"option"].join(" ")),a("article section nav aside main header footer","",r),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[r,"figcaption"].join(" ")),a("time","datetime",n),a("dialog","open",r),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",n),a("progress","value max",n),a("meter","value min max low high optimum",n),a("details","open",[r,"summary"].join(" ")),a("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(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","onchange"),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"!==e&&(c("input button select textarea","autofocus"),c("input textarea","placeholder"),c("a","download"),c("link script img","crossorigin"),c("iframe","sandbox seamless allowfullscreen")),ii(ci("a form meter progress dfn"),function(e){s[e]&&delete s[e].children[e]}),delete s.caption.children.table,delete s.script,ni[e]=s)},fi=function(e,n){var r;return e&&(r={},"string"==typeof e&&(e={"*":e}),ii(e,function(e,t){r[t]=r[t.toUpperCase()]="map"===n?oi(e,/[, ]/):ui(e,/[, ]/)})),r};function di(i){var e,t,n,r,o,a,u,s,c,l,f,d,m,N={},g={},E=[],p={},h={},v=function(e,t,n){var r=i[e];return r?r=oi(r,/[, ]/,oi(r.toUpperCase(),/[, ]/)):(r=ni[e])||(r=oi(t," ",oi(t.toUpperCase()," ")),r=ai(r,n),ni[e]=r),r};n=li((i=i||{}).schema),!1===i.verify_html&&(i.valid_elements="*[*]"),e=fi(i.valid_styles),t=fi(i.invalid_styles,"map"),s=fi(i.valid_classes,"map"),r=v("whitespace_elements","pre script noscript style textarea video audio iframe object code"),o=v("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=v("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=v("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=v("non_empty_elements","td th iframe video audio object script pre code",a),f=v("move_caret_before_on_enter_elements","table",l),d=v("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"),c=v("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",d),m=v("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),ii((i.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),function(e){h[e]=new RegExp("</"+e+"[^>]*>","gi")});var S=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},y=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,y,b,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,x=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,w=/[*?+]/;if(e)for(e=ci(e,","),N["@"]&&(h=N["@"].attributes,v=N["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=C.exec(e[t])){if(g=i[1],c=i[2],p=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===g&&(a.paddEmpty=!0),"-"===g&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),h){for(y in h)d[y]=h[y];m.push.apply(m,v)}if(s)for(r=0,o=(s=ci(s,"|")).length;r<o;r++)if(i=x.exec(s[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),g=i[3],b=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){delete d[l],m.splice(si(m,l),1);continue}g&&("="===g&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:b}),u.defaultValue=b),":"===g&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:b}),u.forcedValue=b),"<"===g&&(u.validValues=oi(b,"?"))),w.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=S(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)}h||"@"!==c||(h=d,v=m),p&&(a.outputName=c,N[p]=a),w.test(c)?(a.pattern=S(c),E.push(a)):N[c]=a}},b=function(e){N={},E=[],y(e),ii(n,function(e,t){g[t]=e.children})},C=function(e){var a=/^(~)?(.+)$/;e&&(ni.text_block_elements=ni.block_elements=null,ii(ci(e,","),function(e){var t=a.exec(e),n="~"===t[1],r=n?"span":"div",o=t[2];if(g[o]=g[r],p[o]=r,n||(c[o.toUpperCase()]={},c[o]={}),!N[o]){var i=N[r];delete(i=ai({},i)).removeEmptyAttrs,delete i.removeEmpty,N[o]=i}ii(g,function(e,t){e[r]&&(g[t]=e=ai({},g[t]),e[o]=e[r])})}))},x=function(e){var o=/^([+\-]?)(\w+)\[([^\]]+)\]$/;ni[i.schema]=null,e&&ii(ci(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?g[r[2]]:g[r[2]]={"#comment":{}},t=g[r[2]],ii(ci(r[3],"|"),function(e){"-"===n?delete t[e]:t[e]={}}))})},w=function(e){var t,n=N[e];if(n)return n;for(t=E.length;t--;)if((n=E[t]).pattern.test(e))return n};return i.valid_elements?b(i.valid_elements):(ii(n,function(e,t){N[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},g[t]=e.children}),"html5"!==i.schema&&ii(ci("strong/b em/i"),function(e){e=ci(e,"/"),N[e[1]].outputName=e[0]}),ii(ci("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){N[e]&&(N[e].removeEmpty=!0)}),ii(ci("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){N[e].paddEmpty=!0}),ii(ci("span"),function(e){N[e].removeEmptyAttrs=!0})),C(i.custom_elements),x(i.valid_children),y(i.extended_valid_elements),x("+ol[ul|ol],+ul[ul|ol]"),ii({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},function(e,t){N[t]&&(N[t].parentsRequired=ci(e))}),i.invalid_elements&&ii(ui(i.invalid_elements),function(e){N[e]&&delete N[e]}),w("span")||y("span[!data-mce-type|*]"),{children:g,elements:N,getValidStyles:function(){return e},getValidClasses:function(){return s},getBlockElements:function(){return c},getInvalidStyles:function(){return t},getShortEndedElements:function(){return a},getTextBlockElements:function(){return d},getTextInlineElements:function(){return m},getBoolAttrs:function(){return u},getElementRule:w,getSelfClosingElements:function(){return o},getNonEmptyElements:function(){return l},getMoveCaretBeforeOnEnterElements:function(){return f},getWhiteSpaceElements:function(){return r},getSpecialElements:function(){return h},isValidChild:function(e,t){var n=g[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=w(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return p},addValidElements:y,setValidElements:b,addCustomElements:C,addValidChildren:x}}var mi=function(e,t,n,r){var o=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+o(t)+o(n)+o(r)};function gi(b,e){var C,t,c,l,x=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,w=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,N=/\s*([^:]+):\s*([^;]+);?/g,E=/\s+$/,S={},T="\ufeff";for(b=b||{},e&&(c=e.getValidStyles(),l=e.getInvalidStyles()),t=("\\\" \\' \\; \\: ; : "+T).split(" "),C=0;C<t.length;C++)S[t[C]]=T+C,S[T+C]=t[C];return{toHex:function(e){return e.replace(x,mi)},parse:function(e){var t,n,r,o,i,a,u,s,c={},l=b.url_converter,f=b.url_converter_scope||this,d=function(e,t,n){var r,o,i,a;if((r=c[e+"-top"+t])&&(o=c[e+"-right"+t])&&(i=c[e+"-bottom"+t])&&(a=c[e+"-left"+t])){var u=[r,o,i,a];for(C=u.length-1;C--&&u[C]===u[C+1];);-1<C&&n||(c[e+t]=-1===C?u[0]:u.join(" "),delete c[e+"-top"+t],delete c[e+"-right"+t],delete c[e+"-bottom"+t],delete c[e+"-left"+t])}},m=function(e){var t,n=c[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return c[e]=n[0],!0}},g=function(e){return o=!0,S[e]},p=function(e,t){return o&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return S[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},h=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},v=function(e){return e.replace(/\\[0-9a-f]+/gi,h)},y=function(e,t,n,r,o,i){if(o=o||i)return"'"+(o=p(o)).replace(/\'/g,"\\'")+"'";if(t=p(t||n||r),!b.allow_script_urls){var a=t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!b.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return l&&(t=l.call(f,t,"style")),"url('"+t.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,g).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,g)});t=N.exec(e);)if(N.lastIndex=t.index+t[0].length,n=t[1].replace(E,"").toLowerCase(),r=t[2].replace(E,""),n&&r){if(n=v(n),r=v(r),-1!==n.indexOf(T)||-1!==n.indexOf('"'))continue;if(!b.allow_script_urls&&("behavior"===n||/expression\s*\(|\/\*|\*\//.test(r)))continue;"font-weight"===n&&"700"===r?r="bold":"color"!==n&&"background-color"!==n||(r=r.toLowerCase()),r=(r=r.replace(x,mi)).replace(w,y),c[n]=o?p(r,!0):r}d("border","",!0),d("border","-width"),d("border","-color"),d("border","-style"),d("padding",""),d("margin",""),i="border",u="border-style",s="border-color",m(a="border-width")&&m(u)&&m(s)&&(c[i]=c[a]+" "+c[u]+" "+c[s],delete c[a],delete c[u],delete c[s]),"medium none"===c.border&&delete c.border,"none"===c["border-image"]&&delete c["border-image"]}return c},serialize:function(i,e){var t,n,r,o,a,u="",s=function(e){var t,n,r,o;if(t=c[e])for(n=0,r=t.length;n<r;n++)e=t[n],(o=i[e])&&(u+=(0<u.length?" ":"")+e+": "+o+";")};if(e&&c)s("*"),s(e);else for(t in i)!(n=i[t])||l&&(r=t,o=e,a=void 0,(a=l["*"])&&a[r]||(a=l[o])&&a[r])||(u+=(0<u.length?" ":"")+t+": "+n+";");return u}}}var pi,hi=Xt.each,vi=Xt.grep,yi=fe.ie,bi=/^([a-z0-9],?)+$/i,Ci=/^[ \t\r\n]*$/,xi=function(n,r,o){var e={},i=r.keep_values,t={set:function(e,t,n){r.url_converter&&(t=r.url_converter.call(r.url_converter_scope||o(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}};return e={style:{set:function(e,t){null===t||"object"!=typeof t?(i&&e.attr("data-mce-style",t),e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return t=n.serialize(n.parse(t),e[0].nodeName)}}},i&&(e.href=e.src=t),e},wi=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},Ni=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};function Ei(a,u){var s,c=this;void 0===u&&(u={});var r={},i=V.window,o={},t=0,e=function(m,g){void 0===g&&(g={});var p,h=0,v={};p=g.maxLoadTime||5e3;var y=function(e){m.getElementsByTagName("head")[0].appendChild(e)},n=function(e,t,n){var o,r,i,a,u=function(){for(var e=a.passed,t=e.length;t--;)e[t]();a.status=2,a.passed=[],a.failed=[]},s=function(){for(var e=a.failed,t=e.length;t--;)e[t]();a.status=3,a.passed=[],a.failed=[]},c=function(e,t){e()||((new Date).getTime()-i<p?he.setTimeout(t):s())},l=function(){c(function(){for(var e,t,n=m.styleSheets,r=n.length;r--;)if((t=(e=n[r]).ownerNode?e.ownerNode:e.owningElement)&&t.id===o.id)return u(),!0},l)},f=function(){c(function(){try{var e=r.sheet.cssRules;return u(),!!e}catch(t){}},f)};if(e=Xt._addCacheSuffix(e),v[e]?a=v[e]:(a={passed:[],failed:[]},v[e]=a),t&&a.passed.push(t),n&&a.failed.push(n),1!==a.status)if(2!==a.status)if(3!==a.status){if(a.status=1,(o=m.createElement("link")).rel="stylesheet",o.type="text/css",o.id="u"+h++,o.async=!1,o.defer=!1,i=(new Date).getTime(),g.contentCssCors&&(o.crossOrigin="anonymous"),"onload"in o&&!((d=V.navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(d[1],10)<536))o.onload=l,o.onerror=s;else{if(0<V.navigator.userAgent.indexOf("Firefox"))return(r=m.createElement("style")).textContent='@import "'+e+'"',f(),void y(r);l()}var d;y(o),o.href=e}else s();else u()},t=function(t){return uo.nu(function(e){n(t,H(e,q(mo.value(t))),H(e,q(mo.error(t))))})},o=function(e){return e.fold($,$)};return{load:n,loadAll:function(e,n,r){co(W(e,t)).get(function(e){var t=K(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(o)):n(t.pass.map(o))})}}}(a,{contentCssCors:u.contentCssCors}),l=[],f=u.schema?u.schema:di({}),d=gi({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema),m=u.ownEvents?new Se(u.proxy):Se.Event,n=f.getBlockElements(),g=gn.overrideDefaults(function(){return{context:a,element:j.getRoot()}}),p=function(e){if(e&&a&&"string"==typeof e){var t=a.getElementById(e);return t&&t.id!==e?a.getElementsByName(e)[1]:t}return e},h=function(e){return"string"==typeof e&&(e=p(e)),g(e)},v=function(e,t,n){var r,o,i=h(e);return i.length&&(o=(r=s[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},y=function(e){var t=p(e);return t?t.attributes:[]},b=function(e,t,n){var r,o;""===n&&(n=null);var i=h(e);r=i.attr(t),i.length&&((o=s[t])&&o.set?o.set(i,n,t):i.attr(t,n),r!==n&&u.onSetAttrib&&u.onSetAttrib({attrElm:i,attrName:t,attrValue:n}))},C=function(){return u.root_element||a.body},x=function(e,t){return Zr.getPos(a.body,p(e),t)},w=function(e,t,n){var r=h(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=fe.ie&&fe.ie<12?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:undefined)},N=function(e){var t,n;return e=p(e),t=w(e,"width"),n=w(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},E=function(e,t){var n;if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(bi.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;0<=n;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<St(t,i[0].ownerDocument||i[0],null,i).length},S=function(e,t,n,r){var o,i=[],a=p(e);for(r=r===undefined,n=n||("BODY"!==C().nodeName?C().parentNode:null),Xt.is(t,"string")&&(t="*"===(o=t)?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},T=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return E(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},k=function(e,n,r){var o,t="string"==typeof e?p(e):e;if(!t)return!1;if(Xt.isArray(t)&&(t.length||0===t.length))return o=[],hi(t,function(e,t){e&&("string"==typeof e&&(e=p(e)),o.push(n.call(r,e,t)))}),o;var i=r||c;return n.call(i,t)},_=function(e,t){h(e).each(function(e,n){hi(t,function(e,t){b(n,t,e)})})},A=function(e,r){var t=h(e);yi?t.each(function(e,t){if(!1!==t.canHaveHTML){for(;t.firstChild;)t.removeChild(t.firstChild);try{t.innerHTML="<br>"+r,t.removeChild(t.firstChild)}catch(n){gn("<div></div>").html("<br>"+r).contents().slice(1).appendTo(t)}return r}}):t.html(r)},R=function(e,n,r,o,i){return k(e,function(e){var t="string"==typeof n?a.createElement(n):n;return _(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&A(t,o)),i?t:e.appendChild(t)})},D=function(e,t,n){return R(a.createElement(e),e,t,n,!0)},O=ti.decode,B=ti.encodeAllRaw,P=function(e,t){var n=h(e);return t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():n.remove(),1<n.length?n.toArray():n[0]},I=function(e,t,n){h(e).toggleClass(t,n).each(function(){""===this.className&&gn(this).attr("class",null)})},L=function(t,e,n){return k(e,function(e){return Xt.is(e,"array")&&(t=t.cloneNode(!0)),n&&hi(vi(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},F=function(){return a.createRange()},M=function(e,t,n,r){if(Xt.isArray(e)){for(var o=e.length;o--;)e[o]=M(e[o],t,n,r);return e}return!u.collect||e!==a&&e!==i||l.push([e,t,n,r]),m.bind(e,t,n,r||j)},z=function(e,t,n){var r;if(Xt.isArray(e)){for(r=e.length;r--;)e[r]=z(e[r],t,n);return e}if(l&&(e===a||e===i))for(r=l.length;r--;){var o=l[r];e!==o[0]||t&&t!==o[1]||n&&n!==o[2]||m.unbind(o[0],o[1],o[2])}return m.unbind(e,t,n)},U=function(e){if(e&&jo.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},j={doc:a,settings:u,win:i,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:e,boundEvents:l,styles:d,schema:f,events:m,isBlock:function(e){if("string"==typeof e)return!!n[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!n[e.nodeName])}return!1},$:g,$$:h,root:null,clone:function(t,e){if(!yi||1!==t.nodeType||e)return t.cloneNode(e);if(!e){var n=a.createElement(t.nodeName);return hi(y(t),function(e){b(n,e.nodeName,v(t,e.nodeName))}),n}return null},getRoot:C,getViewPort:function(e){var t=e||i,n=t.document.documentElement;return{x:t.pageXOffset||n.scrollLeft,y:t.pageYOffset||n.scrollTop,w:t.innerWidth||n.clientWidth,h:t.innerHeight||n.clientHeight}},getRect:function(e){var t,n;return e=p(e),t=x(e),n=N(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:function(e,t,n){var r=S(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:S,get:p,getNext:function(e,t){return T(e,t,"nextSibling")},getPrev:function(e,t){return T(e,t,"previousSibling")},select:function(e,t){return St(e,p(t)||u.root_element||a,[])},is:E,add:R,create:D,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+=" "+r+'="'+B(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n=a.createElement("div"),r=a.createDocumentFragment();for(r.appendChild(n),e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r.removeChild(n),r},remove:P,setStyle:function(e,t,n){var r=h(e).css(t,n);u.update_styles&&wi(d,r)},getStyle:w,setStyles:function(e,t){var n=h(e).css(t);u.update_styles&&wi(d,n)},removeAllAttribs:function(e){return k(e,function(e){var t,n=e.attributes;for(t=n.length-1;0<=t;t--)e.removeAttributeNode(n.item(t))})},setAttrib:b,setAttribs:_,getAttrib:v,getPos:x,parseStyle:function(e){return d.parse(e)},serializeStyle:function(e,t){return d.serialize(e,t)},addStyle:function(e){var t,n;if(j!==Ei.DOM&&a===V.document){if(r[e])return;r[e]=!0}(n=a.getElementById("mceDefaultStyles"))||((n=a.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=a.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(a.createTextNode(e))},loadCSS:function(e){var n;j===Ei.DOM||a!==V.document?(e||(e=""),n=a.getElementsByTagName("head")[0],hi(e.split(","),function(e){var t;e=Xt._addCacheSuffix(e),o[e]||(o[e]=!0,t=D("link",{rel:"stylesheet",href:e}),n.appendChild(t))})):Ei.DOM.loadCSS(e)},addClass:function(e,t){h(e).addClass(t)},removeClass:function(e,t){I(e,t,!1)},hasClass:function(e,t){return h(e).hasClass(t)},toggleClass:I,show:function(e){h(e).show()},hide:function(e){h(e).hide()},isHidden:function(e){return"none"===h(e).css("display")},uniqueId:function(e){return(e||"mce_")+t++},setHTML:A,getOuterHTML:function(e){var t="string"==typeof e?p(e):e;return jo.isElement(t)?t.outerHTML:gn("<div></div>").append(gn(t).clone()).html()},setOuterHTML:function(e,t){h(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}P(gn(this).html(t),!0)})},decode:O,encode:B,insertAfter:function(e,t){var r=p(t);return k(e,function(e){var t,n;return t=r.parentNode,(n=r.nextSibling)?t.insertBefore(e,n):t.appendChild(e),e})},replace:L,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=D(e),hi(y(t),function(e){b(n,e.nodeName,v(t,e.nodeName))}),L(n,t,!0)),n||t},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return d.toHex(Xt.trim(e))},run:k,getAttribs:y,isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new go(e,e.parentNode),t=t||(f?f.getNonEmptyElements():null),i=f?f.getWhiteSpaceElements():{};do{if(o=e.nodeType,jo.isElement(e)){var c=e.getAttribute("data-mce-bogus");if(c){e=a.next("all"===c);continue}if(u=e.nodeName.toLowerCase(),t&&t[u]){if("br"===u){s++,e=a.next();continue}return!1}for(n=(r=y(e)).length;n--;)if("name"===(u=r[n].nodeName)||"data-mce-bookmark"===u)return!1}if(8===o)return!1;if(3===o&&!Ci.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&Ci.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:F,nodeIndex:Ni,split:function(e,t,n){var r,o,i,a=F();if(e&&t)return a.setStart(e.parentNode,Ni(e)),a.setEnd(t.parentNode,Ni(t)),r=a.extractContents(),(a=F()).setStart(t.parentNode,Ni(t)+1),a.setEnd(e.parentNode,Ni(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(qo.trimNode(j,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(qo.trimNode(j,o),e),P(e),n||t},bind:M,unbind:z,fire:function(e,t,n){return m.fire(e,t,n)},getContentEditable:U,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=U(e));e=e.parentNode);return n},destroy:function(){if(l)for(var e=l.length;e--;){var t=l[e];m.unbind(t[0],t[1],t[2])}St.setDocument&&St.setDocument()},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}};return s=xi(d,u,function(){return j}),j}(pi=Ei||(Ei={})).DOM=pi(V.document),pi.nodeIndex=Ni;var Si=Ei,Ti=Si.DOM,ki=Xt.each,_i=Xt.grep,Ai=function(e){return"function"==typeof e},Ri=function(){var l={},o=[],i={},a=[],f=0;this.isDone=function(e){return 2===l[e]},this.markDone=function(e){l[e]=2},this.add=this.load=function(e,t,n,r){l[e]===undefined&&(o.push(e),l[e]=0),t&&(i[e]||(i[e]=[]),i[e].push({success:t,failure:r,scope:n||this}))},this.remove=function(e){delete l[e],delete i[e]},this.loadQueue=function(e,t,n){this.loadScripts(o,e,t,n)},this.loadScripts=function(n,e,t,r){var u,s=[],c=function(t,e){ki(i[e],function(e){Ai(e[t])&&e[t].call(e.scope)}),i[e]=undefined};a.push({success:e,failure:r,scope:t||this}),(u=function(){var e=_i(n);if(n.length=0,ki(e,function(e){var t,n,r,o,i,a;2!==l[e]?3!==l[e]?1!==l[e]&&(l[e]=1,f++,t=e,n=function(){l[e]=2,f--,c("success",e),u()},r=function(){l[e]=3,f--,s.push(e),c("failure",e),u()},i=(a=Ti).uniqueId(),(o=V.document.createElement("script")).id=i,o.type="text/javascript",o.src=Xt._addCacheSuffix(t),o.onload=function(){a.remove(i),o&&(o.onreadystatechange=o.onload=o=null),n()},o.onerror=function(){Ai(r)?r():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(V.document.getElementsByTagName("head")[0]||V.document.body).appendChild(o)):c("failure",e):c("success",e)}),!f){var t=a.slice(0);a.length=0,ki(t,function(e){0===s.length?Ai(e.success)&&e.success.call(e.scope):Ai(e.failure)&&e.failure.call(e.scope,s)})}})()}};Ri.ScriptLoader=new Ri;var Di,Oi=Xt.each;function Bi(){var r=this,o=[],a={},u={},i=[],s=function(e){var t;return u[e]&&(t=u[e].dependencies),t||[]},c=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},l=function(e,n,t,r){var o=s(e);Oi(o,function(e){var t=c(n,e);f(t.resource,t,undefined,undefined)}),t&&(r?t.call(r):t.call(Ri))},f=function(e,t,n,r,o){if(!a[e]){var i="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==i.indexOf("/")&&-1===i.indexOf("://")&&(i=Bi.baseURL+"/"+i),a[e]=i.substring(0,i.lastIndexOf("/")),u[e]?l(e,t,n,r):Ri.ScriptLoader.add(i,function(){return l(e,t,n,r)},r,o)}};return{items:o,urls:a,lookup:u,_listeners:i,get:function(e){return u[e]?u[e].instance:undefined},dependencies:s,requireLangPack:function(e,t){var n=Bi.language;if(n&&!1!==Bi.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;Ri.ScriptLoader.add(a[e]+"/langs/"+n+".js")}},add:function(t,e,n){o.push(e),u[t]={instance:e,dependencies:n};var r=K(i,function(e){return e.name===t});return i=r.fail,Oi(r.pass,function(e){e.callback()}),e},remove:function(e){delete a[e],delete u[e]},createUrl:c,addComponents:function(e,t){var n=r.urls[e];Oi(t,function(e){Ri.ScriptLoader.add(n+"/"+e)})},load:f,waitFor:function(e,t){u.hasOwnProperty(e)?t():i.push({name:e,callback:t})}}}(Di=Bi||(Bi={})).PluginManager=Di(),Di.ThemeManager=Di();var Pi=function(t,n){Vr(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},Ii=function(e,t){qr(e).fold(function(){Vr(e).each(function(e){Fi(e,t)})},function(e){Pi(e,t)})},Li=function(t,n){Yr(t).fold(function(){Fi(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},Fi=function(e,t){e.dom().appendChild(t.dom())},Mi=function(t,e){z(e,function(e){Fi(t,e)})},zi=function(e){e.dom().textContent="",z(Kr(e),function(e){Ui(e)})},Ui=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},ji=function(e){var t,n=Kr(e);0<n.length&&(t=e,z(n,function(e){Pi(t,e)})),Ui(e)},Vi=function(n,r){var o=null;return{cancel:function(){null!==o&&(V.clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null===o&&(o=V.setTimeout(function(){n.apply(null,e),o=null},r))}}},Hi=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Hi(n())}}},qi=function(e,t){var n=Er(e,t);return n===undefined||""===n?[]:n.split(" ")},$i=function(e){return e.dom().classList!==undefined},Wi=function(e,t){return o=t,i=qi(n=e,r="class").concat([o]),wr(n,r,i.join(" ")),!0;var n,r,o,i},Ki=function(e,t){return o=t,0<(i=U(qi(n=e,r="class"),function(e){return e!==o})).length?wr(n,r,i.join(" ")):Sr(n,r),!1;var n,r,o,i},Xi=function(e,t){$i(e)?e.dom().classList.add(t):Wi(e,t)},Yi=function(e){0===($i(e)?e.dom().classList:qi(e,"class")).length&&Sr(e,"class")},Gi=function(e,t){return $i(e)&&e.dom().classList.contains(t)},Ji=function(e,t){var n=[];return z(Kr(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(Ji(e,t))}),n},Qi=function(e,t){return n=t,o=(r=e)===undefined?V.document:r.dom(),Fr(o)?[]:W(o.querySelectorAll(n),ar.fromDom);var n,r,o};function Zi(e,t,n,r,o){return e(n,r)?_.some(n):D(o)&&o(n)?_.none():t(n,r,o)}var ea,ta=function(e,t,n){for(var r=e.dom(),o=D(n)?n:q(!1);r.parentNode;){r=r.parentNode;var i=ar.fromDom(r);if(t(i))return _.some(i);if(o(i))break}return _.none()},na=function(e,t,n){return Zi(function(e,t){return t(e)},ta,e,t,n)},ra=function(e,t,n){return ta(e,function(e){return Lr(e,t)},n)},oa=function(e,t){return n=t,o=(r=e)===undefined?V.document:r.dom(),Fr(o)?_.none():_.from(o.querySelector(n)).map(ar.fromDom);var n,r,o},ia=function(e,t,n){return Zi(Lr,ra,e,t,n)},aa=q("mce-annotation"),ua=q("data-mce-annotation"),sa=q("data-mce-annotation-uid"),ca=function(r,e){var t=r.selection.getRng(),n=ar.fromDom(t.startContainer),o=ar.fromDom(r.getBody()),i=e.fold(function(){return"."+aa()},function(e){return"["+ua()+'="'+e+'"]'}),a=Xr(n,t.startOffset).getOr(n),u=ia(a,i,function(e){return Mr(e,o)}),s=function(e,t){return n=t,(r=e.dom())&&r.hasAttribute&&r.hasAttribute(n)?_.some(Er(e,t)):_.none();var n,r};return u.bind(function(e){return s(e,""+sa()).bind(function(n){return s(e,""+ua()).map(function(e){var t=la(r,n);return{uid:n,name:e,elements:t}})})})},la=function(e,t){var n=ar.fromDom(e.getBody());return Qi(n,"["+sa()+'="'+t+'"]')},fa=function(i,e){var n,r,o,a=Hi({}),c=function(e,t){u(e,function(e){return t(e),e})},u=function(e,t){var n=a.get(),r=t(n.hasOwnProperty(e)?n[e]:{listeners:[],previous:Hi(_.none())});n[e]=r,a.set(n)},t=(n=function(){var e,t,n,r=a.get(),o=(e=gr(r),(n=B.call(e,0)).sort(t),n);z(o,function(e){u(e,function(u){var s=u.previous.get();return ca(i,_.some(e)).fold(function(){var t;s.isSome()&&(c(t=e,function(e){z(e.listeners,function(e){return e(!1,t)})}),u.previous.set(_.none()))},function(e){var t,n,r,o=e.uid,i=e.name,a=e.elements;s.is(o)||(n=o,r=a,c(t=i,function(e){z(e.listeners,function(e){return e(!0,t,{uid:n,nodes:W(r,function(e){return e.dom()})})})}),u.previous.set(_.some(o)))}),{previous:u.previous,listeners:u.listeners}})})},r=30,o=null,{cancel:function(){null!==o&&(V.clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==o&&V.clearTimeout(o),o=V.setTimeout(function(){n.apply(null,e),o=null},r)}});return i.on("remove",function(){t.cancel()}),i.on("nodeChange",function(){t.throttle()}),{addListener:function(e,t){u(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})}}},da=function(e,n){e.on("init",function(){e.serializer.addNodeFilter("span",function(e){z(e,function(t){var e;(e=t,_.from(e.attributes.map[ua()]).bind(n.lookup)).each(function(e){!1===e.persistent&&t.unwrap()})})})})},ma=function(){return(ma=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ga=0,pa=function(e,t){return ar.fromDom(e.dom().cloneNode(t))},ha=function(e){return pa(e,!1)},va=function(e){return pa(e,!0)},ya=function(e,t){var n,r,o=Ur(e).dom(),i=ar.fromDom(o.createDocumentFragment()),a=(n=t,(r=(o||V.document).createElement("div")).innerHTML=n,Kr(ar.fromDom(r)));Mi(i,a),zi(e),Fi(e,i)},ba="\ufeff",Ca=function(e){return e===ba},xa=ba,wa=function(e){return e.replace(new RegExp(ba,"g"),"")},Na=jo.isElement,Ea=jo.isText,Sa=function(e){return Ea(e)&&(e=e.parentNode),Na(e)&&e.hasAttribute("data-mce-caret")},Ta=function(e){return Ea(e)&&Ca(e.data)},ka=function(e){return Sa(e)||Ta(e)},_a=function(e){return e.firstChild!==e.lastChild||!jo.isBr(e.firstChild)},Aa=function(e){var t=e.container();return!(!e||!jo.isText(t))&&(t.data.charAt(e.offset())===xa||e.isAtStart()&&Ta(t.previousSibling))},Ra=function(e){var t=e.container();return!(!e||!jo.isText(t))&&(t.data.charAt(e.offset()-1)===xa||e.isAtEnd()&&Ta(t.nextSibling))},Da=function(e,t,n){var r,o,i;return(r=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(((i=V.document.createElement("br")).setAttribute("data-mce-bogus","1"),i)),o=t.parentNode,n?o.insertBefore(r,t):t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r),r},Oa=function(e){return Ea(e)&&e.data[0]===xa},Ba=function(e){return Ea(e)&&e.data[e.data.length-1]===xa},Pa=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],jo.isBogus(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},Ia=jo.isContentEditableTrue,La=jo.isContentEditableFalse,Fa=jo.isBr,Ma=jo.isText,za=jo.matchNodeNames("script style textarea"),Ua=jo.matchNodeNames("img input textarea hr iframe video audio object"),ja=jo.matchNodeNames("table"),Va=ka,Ha=function(e){return!Va(e)&&(Ma(e)?!za(e.parentNode):Ua(e)||Fa(e)||ja(e)||qa(e))},qa=function(e){return!1===(t=e,jo.isElement(t)&&"true"===t.getAttribute("unselectable"))&&La(e);var t},$a=function(e,t){return Ha(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(qa(e))return!1;if(Ia(e))return!0}return!0}(e,t)},Wa=Math.round,Ka=function(e){return e?{left:Wa(e.left),top:Wa(e.top),bottom:Wa(e.bottom),right:Wa(e.right),width:Wa(e.width),height:Wa(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Xa=function(e,t){return e=Ka(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e},Ya=function(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2},Ga=function(e,t){var n=Math.min(t.height/2,e.height/2);return e.bottom-n<t.top||!(e.top>t.bottom)&&Ya(t.top-e.bottom,e,t)},Ja=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&Ya(t.bottom-e.top,e,t)},Qa=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Za=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},eu=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},tu=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),nu=function(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&tu.test(e)},ru=function(e,t,n){return e.isSome()&&t.isSome()?_.some(n(e.getOrDie(),t.getOrDie())):_.none()},ou=[].slice,iu=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=ou.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},au=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=ou.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},uu=jo.isElement,su=Ha,cu=jo.matchStyleValues("display","block table"),lu=jo.matchStyleValues("float","left right"),fu=iu(uu,su,y(lu)),du=y(jo.matchStyleValues("white-space","pre pre-line pre-wrap")),mu=jo.isText,gu=jo.isBr,pu=Si.nodeIndex,hu=eu,vu=function(e){return"createRange"in e?e.createRange():Si.DOM.createRng()},yu=function(e){return e&&/[\r\n\t ]/.test(e)},bu=function(e){return!!e.setStart&&!!e.setEnd},Cu=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(yu(e.toString())&&du(n.parentNode)&&jo.isText(n)&&(t=n.data,yu(t[r-1])||yu(t[r+1])))},xu=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},wu=function(e){var t,n,r,o,i,a,u,s;return t=0<(n=e.getClientRects()).length?Ka(n[0]):Ka(e.getBoundingClientRect()),!bu(e)&&gu(e)&&xu(t)?(i=(r=e).ownerDocument,a=vu(i),u=i.createTextNode("\xa0"),(s=r.parentNode).insertBefore(u,r),a.setStart(u,0),a.setEnd(u,1),o=Ka(a.getBoundingClientRect()),s.removeChild(u),o):xu(t)&&bu(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&jo.isText(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),wu(i)}return null}(e):t},Nu=function(e,t){var n=Xa(e,t);return n.width=1,n.right=n.left+1,n},Eu=function(e){var t,n,r=[],o=function(e){var t,n;0!==e.height&&(0<r.length&&(t=e,n=r[r.length-1],t.left===n.left&&t.top===n.top&&t.bottom===n.bottom&&t.right===n.right)||r.push(e))},i=function(e,t){var n=vu(e.ownerDocument);if(t<e.data.length){if(nu(e.data[t]))return r;if(nu(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!Cu(n)))return o(Nu(wu(n),!1)),r}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),Cu(n)||o(Nu(wu(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),Cu(n)||o(Nu(wu(n),!0)))};if(mu(e.container()))return i(e.container(),e.offset()),r;if(uu(e.container()))if(e.isAtEnd())n=hu(e.container(),e.offset()),mu(n)&&i(n,n.data.length),fu(n)&&!gu(n)&&o(Nu(wu(n),!1));else{if(n=hu(e.container(),e.offset()),mu(n)&&i(n,0),fu(n)&&e.isAtEnd())return o(Nu(wu(n),!1)),r;t=hu(e.container(),e.offset()-1),fu(t)&&!gu(t)&&(cu(t)||cu(n)||!fu(n))&&o(Nu(wu(t),!1)),fu(n)&&o(Nu(wu(n),!0))}return r};function Su(t,n,e){var r=function(){return e||(e=Eu(Su(t,n))),e};return{container:q(t),offset:q(n),toRange:function(){var e;return(e=vu(t.ownerDocument)).setStart(t,n),e.setEnd(t,n),e},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return mu(t),0===n},isAtEnd:function(){return mu(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return hu(t,e?n-1:n)}}}(ea=Su||(Su={})).fromRangeStart=function(e){return ea(e.startContainer,e.startOffset)},ea.fromRangeEnd=function(e){return ea(e.endContainer,e.endOffset)},ea.after=function(e){return ea(e.parentNode,pu(e)+1)},ea.before=function(e){return ea(e.parentNode,pu(e))},ea.isAbove=function(e,t){return ru(Z(t.getClientRects()),ee(e.getClientRects()),Ga).getOr(!1)},ea.isBelow=function(e,t){return ru(ee(t.getClientRects()),Z(e.getClientRects()),Ja).getOr(!1)},ea.isAtStart=function(e){return!!e&&e.isAtStart()},ea.isAtEnd=function(e){return!!e&&e.isAtEnd()},ea.isTextPosition=function(e){return!!e&&jo.isText(e.container())},ea.isElementPosition=function(e){return!1===ea.isTextPosition(e)};var Tu,ku,_u=Su,Au=jo.isText,Ru=jo.isBogus,Du=Si.nodeIndex,Ou=function(e){var t=e.parentNode;return Ru(t)?Ou(t):t},Bu=function(e){return e?Ht.reduce(e.childNodes,function(e,t){return Ru(t)&&"BR"!==t.nodeName?e=e.concat(Bu(t)):e.push(t),e},[]):[]},Pu=function(t){return function(e){return t===e}},Iu=function(e){var t,r,n,o;return(Au(e)?"text()":e.nodeName.toLowerCase())+"["+(r=Bu(Ou(t=e)),n=Ht.findIndex(r,Pu(t),t),r=r.slice(0,n+1),o=Ht.reduce(r,function(e,t,n){return Au(t)&&Au(r[n-1])&&e++,e},0),r=Ht.filter(r,jo.matchNodeNames(t.nodeName)),(n=Ht.findIndex(r,Pu(t),t))-o)+"]"},Lu=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),Au(n)?o=function(e,t){for(;(e=e.previousSibling)&&Au(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Iu(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=Ht.filter(a,y(jo.isBogus)),(u=u.concat(Ht.map(a,function(e){return Iu(e)}))).reverse().join("/")+","+o},Fu=function(e,t){var n,r,o;return t?(t=(n=t.split(","))[0].split("/"),o=1<n.length?n[1]:"before",(r=Ht.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),n=e,r=t[1],o=parseInt(t[2],10),i=Bu(n),i=Ht.filter(i,function(e,t){return!Au(e)||!Au(i[t-1])}),(i=Ht.filter(i,jo.matchNodeNames(r)))[o]):null;var n,r,o,i},e))?Au(r)?function(e,t){for(var n,r=e,o=0;Au(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!Au(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return Au(e)&&t>e.data.length&&(t=e.data.length),_u(e,t)}(r,parseInt(o,10)):(o="after"===o?Du(r)+1:Du(r),_u(r.parentNode,o)):null):null},Mu=function(e,t){jo.isText(t)&&0===t.data.length&&e.remove(t)},zu=function(e,t,n){var r,o,i,a,u,s,c;jo.isDocumentFragment(n)?(i=e,a=t,u=n,s=_.from(u.firstChild),c=_.from(u.lastChild),a.insertNode(u),s.each(function(e){return Mu(i,e.previousSibling)}),c.each(function(e){return Mu(i,e.nextSibling)})):(r=e,o=n,t.insertNode(o),Mu(r,o.previousSibling),Mu(r,o.nextSibling))},Uu=jo.isContentEditableFalse,ju=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=e.getRoot();for(jo.isText(a)?s.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&jo.isText(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(e.nodeIndex(a,n));return s},Vu=function(e,t,n){var r=0;return Xt.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},Hu=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],jo.isElement(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},qu=function(e){return Hu(e,!0),Hu(e,!1),e},$u=function(e,t){var n;if(jo.isElement(e)&&(e=eu(e,t),Uu(e)))return e;if(ka(e)){if(jo.isText(e)&&Sa(e)&&(e=e.parentNode),n=e.previousSibling,Uu(n))return n;if(n=e.nextSibling,Uu(n))return n}},Wu=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Uu(r)||"IMG"===o)return{name:o,index:Vu(n.dom,o,r)};var a,u,s,c,l,f,d,m=$u((a=i).startContainer,a.startOffset)||$u(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:Vu(n.dom,o,m)}:(u=e,c=t,l=i,f=(s=n).dom,(d={}).start=ju(f,u,c,l,!0),s.isCollapsed()||(d.end=ju(f,u,c,l,!1)),d)},Ku=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,""):e.create("span",r)},Xu=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:Vu(n,u,a)};var s=qu(r.cloneRange());if(!i){s.collapse(!1);var c=Ku(n,o+"_end",t);zu(n,s,c)}(r=qu(r)).collapse(!0);var l=Ku(n,o+"_start",t);return zu(n,r,l),e.moveToBookmark({id:o,keep:1}),{id:o}},Yu={getBookmark:function(e,t,n){return 2===t?Wu(wa,n,e):3===t?(o=(r=e).getRng(),{start:Lu(r.dom.getRoot(),_u.fromRangeStart(o)),end:Lu(r.dom.getRoot(),_u.fromRangeEnd(o))}):t?{rng:e.getRng()}:Xu(e,!1);var r,o},getUndoBookmark:d(Wu,$,!0),getPersistentBookmark:Xu},Gu="_mce_caret",Ju=function(e){return jo.isElement(e)&&e.id===Gu},Qu=function(e,t){for(;t&&t!==e;){if(t.id===Gu)return t;t=t.parentNode}return null},Zu=jo.isElement,es=jo.isText,ts=function(e){var t=e.parentNode;t&&t.removeChild(e)},ns=function(e,t){0===t.length?ts(e):e.nodeValue=t},rs=function(e){var t=wa(e);return{count:e.length-t.length,text:t}},os=function(e,t){return us(e),t},is=function(e,t){var n,r,o,i=t.container(),a=(n=te(i.childNodes),r=e,o=L(n,r),-1===o?_.none():_.some(o)).map(function(e){return e<t.offset()?_u(i,t.offset()-1):t}).getOr(t);return us(e),a},as=function(e,t){return es(e)&&t.container()===e?(r=t,o=rs((n=e).data.substr(0,r.offset())),i=rs(n.data.substr(r.offset())),0<(a=o.text+i.text).length?(ns(n,a),_u(n,r.offset()-o.count)):r):os(e,t);var n,r,o,i,a},us=function(e){if(Zu(e)&&ka(e)&&(_a(e)?e.removeAttribute("data-mce-caret"):ts(e)),es(e)){var t=wa(function(e){try{return e.nodeValue}catch(t){return""}}(e));ns(e,t)}},ss={removeAndReposition:function(e,t){return _u.isTextPosition(t)?as(e,t):(n=e,(r=t).container()===n.parentNode?is(n,r):os(n,r));var n,r},remove:us},cs=or.detect().browser,ls=jo.isContentEditableFalse,fs=function(e,t,n){var r,o,i,a,u,s=Xa(t.getBoundingClientRect(),n);return"BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,i=e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,i=e.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,0<(a=t.offsetWidth-t.clientWidth)&&(n&&(a*=-1),s.left+=a,s.right+=a),s},ds=function(a,u,e){var t,s,c=Hi(_.none()),l=function(){!function(e){var t,n,r,o,i;for(t=gn("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,Ba(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,Oa(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(a),s&&(ss.remove(s),s=null),c.get().each(function(e){gn(e.caret).remove(),c.set(_.none())}),clearInterval(t)},f=function(){t=he.setInterval(function(){e()?gn("div.mce-visual-caret",a).toggleClass("mce-visual-caret-hidden"):gn("div.mce-visual-caret",a).addClass("mce-visual-caret-hidden")},500)};return{show:function(t,e){var n,r,o;if(l(),o=e,jo.isElement(o)&&/^(TD|TH)$/i.test(o.tagName))return null;if(!u(e))return s=function(e,t){var n,r,o;if(r=e.ownerDocument.createTextNode(xa),o=e.parentNode,t){if(n=e.previousSibling,Ea(n)){if(ka(n))return n;if(Ba(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,Ea(n)){if(ka(n))return n;if(Oa(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(e,t),r=e.ownerDocument.createRange(),ls(s.nextSibling)?(r.setStart(s,0),r.setEnd(s,0)):(r.setStart(s,1),r.setEnd(s,1)),r;s=Da("p",e,t),n=fs(a,e,t),gn(s).css("top",n.top);var i=gn('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(n).appendTo(a)[0];return c.set(_.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&gn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:l,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(){c.get().each(function(e){var t=fs(a,e.element,e.before);gn(e.caret).css(t)})},destroy:function(){return he.clearInterval(t)}}},ms=function(){return cs.isIE()||cs.isEdge()||cs.isFirefox()},gs=function(e){return ls(e)||jo.isTable(e)&&ms()},ps=jo.isContentEditableFalse,hs=jo.matchStyleValues("display","block table table-cell table-caption list-item"),vs=ka,ys=Sa,bs=jo.isElement,Cs=Ha,xs=function(e){return 0<e},ws=function(e){return e<0},Ns=function(e,t){for(var n;n=e(t);)if(!ys(n))return n;return null},Es=function(e,t,n,r,o){var i=new go(e,r);if(ws(t)){if((ps(e)||ys(e))&&n(e=Ns(i.prev,!0)))return e;for(;e=Ns(i.prev,o);)if(n(e))return e}if(xs(t)){if((ps(e)||ys(e))&&n(e=Ns(i.next,!0)))return e;for(;e=Ns(i.next,o);)if(n(e))return e}return null},Ss=function(e,t){for(;e&&e!==t;){if(hs(e))return e;e=e.parentNode}return null},Ts=function(e,t,n){return Ss(e.container(),n)===Ss(t.container(),n)},ks=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),bs(n)?n.childNodes[r+e]:null):null},_s=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},As=function(e,t,n){var r,o,i,a;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],vs(r)&&(r=r[o]),ps(r)){if(a=n,Ss(r,i=t)===Ss(a,i))return r;break}if(Cs(r))break;n=n.parentNode}return null},Rs=d(_s,!0),Ds=d(_s,!1),Os=function(e,t,n){var r,o,i,a,u=d(As,!0,t),s=d(As,!1,t);if(o=n.startContainer,i=n.startOffset,Sa(o)){if(bs(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,gs(r)))return Rs(r);if("after"===a&&(r=o.previousSibling,gs(r)))return Ds(r)}if(!n.collapsed)return n;if(jo.isText(o)){if(vs(o)){if(1===e){if(r=s(o))return Rs(r);if(r=u(o))return Ds(r)}if(-1===e){if(r=u(o))return Ds(r);if(r=s(o))return Rs(r)}return n}if(Ba(o)&&i>=o.data.length-1)return 1===e&&(r=s(o))?Rs(r):n;if(Oa(o)&&i<=1)return-1===e&&(r=u(o))?Ds(r):n;if(i===o.data.length)return(r=s(o))?Rs(r):n;if(0===i)return(r=u(o))?Ds(r):n}return n},Bs=function(e,t){return _.from(ks(e?0:-1,t)).filter(ps)},Ps=function(e,t,n){var r=Os(e,t,n);return-1===e?Su.fromRangeStart(r):Su.fromRangeEnd(r)},Is=function(e){return _.from(e.getNode()).map(ar.fromDom)},Ls=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Fs=function(e,t){var n=Ts(e,t);return!(n||!jo.isBr(e.getNode()))||n};(ku=Tu||(Tu={}))[ku.Backwards=-1]="Backwards",ku[ku.Forwards=1]="Forwards";var Ms,zs,Us,js=jo.isContentEditableFalse,Vs=jo.isText,Hs=jo.isElement,qs=jo.isBr,$s=Ha,Ws=function(e){return Ua(e)||!!qa(t=e)&&!0!==j(te(t.getElementsByTagName("*")),function(e,t){return e||Ia(t)},!1);var t},Ks=$a,Xs=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},Ys=function(e,t){if(xs(e)){if($s(t.previousSibling)&&!Vs(t.previousSibling))return _u.before(t);if(Vs(t))return _u(t,0)}if(ws(e)){if($s(t.nextSibling)&&!Vs(t.nextSibling))return _u.after(t);if(Vs(t))return _u(t,t.data.length)}return ws(e)?qs(t)?_u.before(t):_u.after(t):_u.before(t)},Gs=function(e,t,n){var r,o,i,a,u;if(!Hs(n)||!t)return null;if(t.isEqual(_u.after(n))&&n.lastChild){if(u=_u.after(n.lastChild),ws(e)&&$s(n.lastChild)&&Hs(n.lastChild))return qs(n.lastChild)?_u.before(n.lastChild):u}else u=t;var s,c,l,f=u.container(),d=u.offset();if(Vs(f)){if(ws(e)&&0<d)return _u(f,--d);if(xs(e)&&d<f.length)return _u(f,++d);r=f}else{if(ws(e)&&0<d&&(o=Xs(f,d-1),$s(o)))return!Ws(o)&&(i=Es(o,e,Ks,o))?Vs(i)?_u(i,i.data.length):_u.after(i):Vs(o)?_u(o,o.data.length):_u.before(o);if(xs(e)&&d<f.childNodes.length&&(o=Xs(f,d),$s(o)))return qs(o)?(s=n,(l=(c=o).nextSibling)&&$s(l)?Vs(l)?_u(l,0):_u.before(l):Gs(Tu.Forwards,_u.after(c),s)):!Ws(o)&&(i=Es(o,e,Ks,o))?Vs(i)?_u(i,0):_u.before(i):Vs(o)?_u(o,0):_u.after(o);r=o||u.getNode()}return(xs(e)&&u.isAtEnd()||ws(e)&&u.isAtStart())&&(r=Es(r,e,q(!0),n,!0),Ks(r,n))?Ys(e,r):(o=Es(r,e,Ks,n),!(a=Ht.last(U(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(f,n),js)))||o&&a.contains(o)?o?Ys(e,o):null:u=xs(e)?_u.after(a):_u.before(a))},Js=function(t){return{next:function(e){return Gs(Tu.Forwards,e,t)},prev:function(e){return Gs(Tu.Backwards,e,t)}}},Qs=function(e){return _u.isTextPosition(e)?0===e.offset():Ha(e.getNode())},Zs=function(e){if(_u.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return Ha(e.getNode(!0))},ec=function(e,t){return!_u.isTextPosition(e)&&!_u.isTextPosition(t)&&e.getNode()===t.getNode(!0)},tc=function(e,t,n){return e?!ec(t,n)&&(r=t,!(!_u.isTextPosition(r)&&jo.isBr(r.getNode())))&&Zs(t)&&Qs(n):!ec(n,t)&&Qs(t)&&Zs(n);var r},nc=function(e,t,n){var r=Js(t);return _.from(e?r.next(n):r.prev(n))},rc=function(t,n,r){return nc(t,n,r).bind(function(e){return Ts(r,e,n)&&tc(t,r,e)?nc(t,n,e):_.some(e)})},oc=function(t,n,e,r){return rc(t,n,e).bind(function(e){return r(e)?oc(t,n,e,r):_.some(e)})},ic=function(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return jo.isText(u)?_.some(_u(u,e?0:u.data.length)):u?Ha(u)?_.some(e?_u.before(u):(a=u,jo.isBr(a)?_u.before(a):_u.after(a))):(r=t,o=u,i=(n=e)?_u.before(o):_u.after(o),nc(n,r,i)):_.none()},ac=d(nc,!0),uc=d(nc,!1),sc={fromPosition:nc,nextPosition:ac,prevPosition:uc,navigate:rc,navigateIgnore:oc,positionIn:ic,firstPositionIn:d(ic,!0),lastPositionIn:d(ic,!1)},cc=function(e,t){return jo.isElement(t)&&e.isBlock(t)&&!t.innerHTML&&!fe.ie&&(t.innerHTML='<br data-mce-bogus="1" />'),t},lc=function(e,t){return sc.lastPositionIn(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},fc=function(e,t,n){return!(!1!==t.hasChildNodes()||!Qu(e,t)||(o=n,i=(r=t).ownerDocument.createTextNode(xa),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},dc=function(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,fc(c,i,r))return!0;if(s[o]>u.length-1)return!!fc(c,i,r)||lc(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)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},mc=function(e){return jo.isText(e)&&0<e.data.length},gc=function(e,t,n){var r,o,i,a,u,s,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,"start"===t?l?c.hasChildNodes()?(r=c.firstChild,o=1):mc(c.nextSibling)?(r=c.nextSibling,o=0):mc(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)+1):o=e.nodeIndex(c):l?c.hasChildNodes()?(r=c.firstChild,o=1):mc(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)):o=e.nodeIndex(c),u=r,s=o,!l){for(a=c.previousSibling,i=c.nextSibling,Xt.each(Xt.grep(c.childNodes),function(e){jo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&jo.isText(a)&&!fe.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return _.some(_u(u,s))}return _.none()},pc=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,y=e.dom;if(t){if(v=t,Xt.isArray(v.start))return p=t,h=(g=y).createRng(),dc(g,!0,p,h)&&dc(g,!1,p,h)?_.some(h):_.none();if("string"==typeof t.start)return _.some((f=t,d=(l=y).createRng(),m=Fu(l.getRoot(),f.start),d.setStart(m.container(),m.offset()),m=Fu(l.getRoot(),f.end),d.setEnd(m.container(),m.offset()),d));if(t.hasOwnProperty("id"))return s=gc(o=y,"start",i=t),c=gc(o,"end",i),ru(s,(u=s,(a=c).isSome()?a:u),function(e,t){var n=o.createRng();return n.setStart(cc(o,e.container()),e.offset()),n.setEnd(cc(o,t.container()),t.offset()),n});if(t.hasOwnProperty("name"))return n=y,r=t,_.from(n.select(r.name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.hasOwnProperty("rng"))return _.some(t.rng)}return _.none()},hc=function(e,t,n){return Yu.getBookmark(e,t,n)},vc=function(t,e){pc(t,e).each(function(e){t.setRng(e)})},yc=function(e){return jo.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},bc=function(e){return e&&/^(IMG)$/.test(e.nodeName)},Cc=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},xc=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},wc={isInlineBlock:bc,moveStart:function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!bc(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?r=new go(u=i[a],e.getParent(u,e.isBlock)):(r=new go(u=i[i.length-1],e.getParent(u,e.isBlock))).next(!0),o=r.current();o;o=r.next())if(3===o.nodeType&&!Cc(o))return n.setStart(o,0),void t.setRng(n)},getNonWhiteSpaceSibling:function(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1===e.nodeType||!Cc(e))return e},isTextBlock:function(e,t){return t.nodeType&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},isValid:function(e,t,n){return e.schema.isValidChild(t,n)},isWhiteSpaceNode:Cc,replaceVars:function(e,n){return"string"!=typeof e?e=e(n):n&&(e=e.replace(/%(\w+)/g,function(e,t){return n[t]||e})),e},isEq:function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},normalizeStyleValue:xc,getStyle:function(e,t,n){return xc(e,e.getStyle(t,n),n)},getTextDecoration:function(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n},getParents:function(e,t,n){return e.getParents(t,n,e.getRoot())}},Nc=yc,Ec=wc.getParents,Sc=wc.isWhiteSpaceNode,Tc=wc.isTextBlock,kc=function(e,t){for(void 0===t&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)(e=e.childNodes[t])&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}},_c=function(e,t){for(var n=t;n;){if(1===n.nodeType&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},Ac=function(e,t,n,r){var o,i,a=n.nodeValue;return void 0===r&&(r=e?a.length:0),e?(o=a.lastIndexOf(" ",r),-1!==(o=(i=a.lastIndexOf("\xa0",r))<o?o:i)&&!t&&(o<r||!e)&&o<=a.length&&o++):(o=a.indexOf(" ",r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},Rc=function(e,t,n,r,o,i){var a,u,s,c;if(3===n.nodeType){if(-1!==(s=Ac(o,i,n,r)))return{container:n,offset:s};c=n}for(a=new go(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3!==u.nodeType||Nc(u.parentNode)){if(e.isBlock(u)||wc.isEq(u,"BR"))break}else if(-1!==(s=Ac(o,i,c=u)))return{container:u,offset:s};if(c)return{container:c,offset:r=o?0:c.length}},Dc=function(e,t,n,r,o){var i,a,u,s;for(3===r.nodeType&&0===r.nodeValue.length&&r[o]&&(r=r[o]),i=Ec(e,r),a=0;a<i.length;a++)for(u=0;u<t.length;u++)if(!("collapsed"in(s=t[u])&&s.collapsed!==n.collapsed)&&e.is(i[a],s.selector))return i[a];return r},Oc=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(3===n.nodeType?n.parentNode:n,function(e){return e!==a&&Tc(t,e)},u)}if(o&&e[0].wrapper&&(o=Ec(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!wc.isEq(o,"br")););return o||n},Bc=function(e,t,n,r,o,i,a){var u,s,c,l,f,d;if(u=s=a?n:o,l=a?"previousSibling":"nextSibling",f=e.getRoot(),3===u.nodeType&&!Sc(u)&&(a?0<r:i<u.nodeValue.length))return u;for(;;){if(!t[0].block_expand&&e.isBlock(s))return s;for(c=s[l];c;c=c[l])if(!Nc(c)&&!Sc(c)&&("BR"!==(d=c).nodeName||!d.getAttribute("data-mce-bogus")||d.nextSibling))return s;if(s===f||s.parentNode===f){u=s;break}s=s.parentNode}return u},Pc=function(e,t,n,r){var o,i=t.startContainer,a=t.startOffset,u=t.endContainer,s=t.endOffset,c=e.dom;return 1===i.nodeType&&i.hasChildNodes()&&3===(i=eu(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=eu(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=_c(c,i),u=_c(c,u),(Nc(i.parentNode)||Nc(i))&&(i=Nc(i)?i:i.parentNode,3===(i=t.collapsed?i.previousSibling||i:i.nextSibling||i).nodeType&&(a=t.collapsed?i.length:0)),(Nc(u.parentNode)||Nc(u))&&(u=Nc(u)?u:u.parentNode,3===(u=t.collapsed?u.nextSibling||u:u.previousSibling||u).nodeType&&(s=t.collapsed?0:u.length)),t.collapsed&&((o=Rc(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=Rc(c,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),n[0].inline&&(u=r?u:function(e,t){var n=kc(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=kc(n.node.previousSibling);n.node&&0<n.offset&&3===n.node.nodeType&&" "===n.node.nodeValue.charAt(n.offset-1)&&1<n.offset&&(e=n.node).splitText(n.offset-1)}return e}(u,s)),(n[0].inline||n[0].block_expand)&&(n[0].inline&&3===i.nodeType&&0!==a||(i=Bc(c,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=Bc(c,n,i,a,u,s,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(i=Dc(c,n,t,i,"previousSibling"),u=Dc(c,n,t,u,"nextSibling")),(n[0].block||n[0].selector)&&(i=Oc(e,n,i,"previousSibling"),u=Oc(e,n,u,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=Bc(c,n,i,a,u,s,!0)),c.isBlock(u)||(u=Bc(c,n,i,a,u,s,!1)))),1===i.nodeType&&(a=c.nodeIndex(i),i=i.parentNode),1===u.nodeType&&(s=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:i,startOffset:a,endContainer:u,endOffset:s}},Ic=Xt.each,Lc=function(e,t,o){var n,r,i,a,u,s,c,l=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset;if(0<(c=e.select("td[data-mce-selected],th[data-mce-selected]")).length)Ic(c,function(e){o([e])});else{var g,p,h,v=function(e){var t;return 3===(t=e[0]).nodeType&&t===l&&f>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0<e.length&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e},y=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},b=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},C=function(e,t,n){var r=n?"nextSibling":"previousSibling";for(u=(a=e).parentNode;a&&a!==t;a=u)u=a.parentNode,(s=y(a===e?a:a[r],r)).length&&(n||s.reverse(),o(v(s)))};if(1===l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(p=m,h=(g=d).childNodes,--p>h.length-1?p=h.length-1:p<0&&(p=0),d=h[p]||g),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=b(l,n)||l,i=b(d,n)||d,C(l,r,!0),(s=y(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},Fc=(Ms=mr,zs="text",{get:function(e){if(!Ms(e))throw new Error("Can only get "+zs+" value of a "+zs+" node");return Us(e).getOr("")},getOption:Us=function(e){return Ms(e)?_.from(e.dom().nodeValue):_.none()},set:function(e,t){if(!Ms(e))throw new Error("Can only set raw "+zs+" value of a "+zs+" node");e.dom().nodeValue=t}}),Mc=function(e){return Fc.get(e)},zc=function(r,o,i,a){return Vr(o).fold(function(){return"skipping"},function(e){return"br"===a||mr(n=o)&&"\ufeff"===Mc(n)?"valid":dr(t=o)&&Gi(t,aa())?"existing":Ju(o)?"caret":wc.isValid(r,i,a)&&wc.isValid(r,lr(e),i)?"valid":"invalid-child";var t,n})},Uc=function(e,t,n,r){var o,i,a=t.uid,u=void 0===a?(o="mce-annotation",i=(new Date).getTime(),o+"_"+Math.floor(1e9*Math.random())+ ++ga+String(i)):a,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["uid"]),c=ar.fromTag("span",e);Xi(c,aa()),wr(c,""+sa(),u),wr(c,""+ua(),n);var l,f=r(u,s),d=f.attributes,m=void 0===d?{}:d,g=f.classes,p=void 0===g?[]:g;return Nr(c,m),l=c,z(p,function(e){Xi(l,e)}),c},jc=function(i,e,t,n,r){var a=[],u=Uc(i.getDoc(),r,t,n),s=Hi(_.none()),c=function(){s.set(_.none())},l=function(e){z(e,o)},o=function(e){var t,n;switch(zc(i,e,"span",lr(e))){case"invalid-child":c();var r=Kr(e);l(r),c();break;case"valid":var o=s.get().getOrThunk(function(){var e=ha(u);return a.push(e),s.set(_.some(e)),e});Pi(t=e,n=o),Fi(n,t)}};return Lc(i.dom,e,function(e){var t;c(),t=W(e,ar.fromDom),l(t)}),a},Vc=function(s,c,l,f){s.undoManager.transact(function(){var e,t,n,r,o=s.selection.getRng();if(o.collapsed&&(r=Pc(e=s,t=o,[{inline:!0}],3===(n=t).startContainer.nodeType&&n.startContainer.nodeValue.length>=n.startOffset&&"\xa0"===n.startContainer.nodeValue[n.startOffset]),t.setStart(r.startContainer,r.startOffset),t.setEnd(r.endContainer,r.endOffset),e.selection.setRng(t)),s.selection.getRng().collapsed){var i=Uc(s.getDoc(),f,c,l.decorate);ya(i,"\xa0"),s.selection.getRng().insertNode(i.dom()),s.selection.select(i.dom())}else{var a=Yu.getPersistentBookmark(s.selection,!1),u=s.selection.getRng();jc(s,u,c,l.decorate,f),s.selection.moveToBookmark(a)}})};function Hc(s){var n,r=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return n.hasOwnProperty(e)?_.from(n[e]).map(function(e){return e.settings}):_.none()}});da(s,r);var o=fa(s);return{register:function(e,t){r.register(e,t)},annotate:function(t,n){r.lookup(t).each(function(e){Vc(s,t,e,n)})},annotationChanged:function(e,t){o.addListener(e,t)},remove:function(e){ca(s,_.some(e)).each(function(e){var t=e.elements;z(t,ji)})},getAll:function(e){var t,n,r,o,i,a,u=(t=s,n=e,r=ar.fromDom(t.getBody()),o=Qi(r,"["+ua()+'="'+n+'"]'),i={},z(o,function(e){var t=Er(e,sa()),n=i.hasOwnProperty(t)?i[t]:[];i[t]=n.concat([e])}),i);return a=function(e){return W(e,function(e){return e.dom()})},vr(u,function(e,t){return{k:t,v:a(e,t)}})}}}var qc=function(e){return Xt.grep(e.childNodes,function(e){return"LI"===e.nodeName})},$c=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||jo.isBr(t));var t},Wc=function(e){return 0<e.length&&(!(t=e[e.length-1]).firstChild||$c(t))?e.slice(0,-1):e;var t},Kc=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Xc=function(e,t){var n=_u.after(e),r=Js(t).prev(n);return r?r.toRange():null},Yc=function(t,e,n){var r,o,i,a,u=t.parentNode;return Xt.each(e,function(e){u.insertBefore(e,t)}),r=t,o=n,i=_u.before(r),(a=Js(o).next(i))?a.toRange():null},Gc=function(e,t){var n,r,o,i,a,u,s=t.firstChild,c=t.lastChild;return s&&"meta"===s.name&&(s=s.next),c&&"mce_marker"===c.attr("id")&&(c=c.prev),r=c,u=(n=e).getNonEmptyElements(),r&&(r.isEmpty(u)||(o=r,n.getBlockElements()[o.name]&&(a=o).firstChild&&a.firstChild===a.lastChild&&("br"===(i=o.firstChild).name||"\xa0"===i.value)))&&(c=c.prev),!(!s||s!==c||"ul"!==s.name&&"ol"!==s.name)},Jc=function(e,o,i,t){var n,r,a,u,s,c,l,f,d,m,g,p,h,v,y,b,C,x,w,N=(n=o,r=t,c=e.serialize(r),l=n.createFragment(c),u=(a=l).firstChild,s=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),s&&"mce_marker"===s.id&&s.parentNode.removeChild(s),a),E=Kc(o,i.startContainer),S=Wc(qc(N.firstChild)),T=o.getRoot(),k=function(e){var t=_u.fromRangeStart(i),n=Js(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||Kc(o,r.getNode())!==E};return k(1)?Yc(E,S,T):k(2)?(f=E,d=S,m=T,o.insertAfter(d.reverse(),f),Xc(d[0],m)):(p=S,h=T,v=g=E,b=(y=i).cloneRange(),C=y.cloneRange(),b.setStartBefore(v),C.setEndAfter(v),x=[b.cloneContents(),C.cloneContents()],(w=g.parentNode).insertBefore(x[0],g),Xt.each(p,function(e){w.insertBefore(e,g)}),w.insertBefore(x[1],g),w.removeChild(g),Xc(p[p.length-1],h))},Qc=function(e,t){return!!Kc(e,t)},Zc=Xt.each,el=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return Zc(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!(!r(n(e),n(t))||!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))||yc(e)||yc(t))}},tl=function(e){var t=Qi(e,"br"),n=U(function(e){for(var t=[],n=e.dom();n;)t.push(ar.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),wo);t.length===n.length&&z(n,Ui)},nl=function(e){zi(e),Fi(e,ar.fromHtml('<br data-mce-bogus="1">'))},rl=function(n){Gr(n).each(function(t){Hr(t).each(function(e){Co(n)&&wo(t)&&Co(e)&&Ui(t)})})},ol=Xt.makeMap;function il(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=ol(e.indent_before||""),c=ol(e.indent_after||""),l=ti.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n"),d.push("<",e),t)for(r=0,o=t.length;r<o;r++)i=t[r],d.push(" ",i.name,'="',l(i.value,!0),'"');d[d.length]=!n||f?">":" />",n&&u&&c[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n")},end:function(e){var t;d.push("</",e,">"),u&&c[e]&&0<d.length&&0<(t=d[d.length-1]).length&&"\n"!==t&&d.push("\n")},text:function(e,t){0<e.length&&(d[d.length]=t?e:l(e))},cdata:function(e){d.push("<![CDATA[",e,"]]>")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push("<?",e," ",l(t),"?>"):d.push("<?",e,"?>"),u&&d.push("\n")},doctype:function(e){d.push("<!DOCTYPE",e,">",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function al(t,g){void 0===g&&(g=di());var p=il(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1<r.length&&((a=[]).map={},c=g.getElementRule(e.name))){for(u=0,s=c.attributesOrder.length;u<s;u++)(o=c.attributesOrder[u])in r.map&&(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));for(u=0,s=r.length;u<s;u++)(o=r[u].name)in a.map||(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));r=a}if(p.start(e.name,r,n),!n){if(e=e.firstChild)for(;m(e),e=e.next;);p.end(t)}}};return 1!==e.type||t.inner?f[11](e):m(e),p.getContent()}}}var ul,sl=function(a){var u=_u.fromRangeStart(a),s=_u.fromRangeEnd(a),c=a.commonAncestorContainer;return sc.fromPosition(!1,c,s).map(function(e){return!Ts(u,s,c)&&Ts(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=V.document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},cl=function(e){return e.collapsed?e:sl(e)},ll=jo.matchNodeNames("td th"),fl=function(e,t){var n,r,o=e.selection.getRng(),i=o.startContainer,a=o.startOffset;o.collapsed&&(n=i,r=a,jo.isText(n)&&"\xa0"===n.nodeValue[r-1])&&jo.isText(i)&&(i.insertData(a-1," "),i.deleteData(a,1),o.setStart(i,a),o.setEnd(i,a),e.selection.setRng(o)),e.selection.setContent(t)},dl=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=e.selection,p=e.dom;if(/^ | $/.test(t)&&(t=function(e,t){var n,r;n=e.startContainer,r=e.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(0<r?t=t.replace(/^ /," "):o("previousSibling")||(t=t.replace(/^ /," ")),r<n.length?t=t.replace(/ (<br>|)$/," "):o("nextSibling")||(t=t.replace(/( | )(<br>|)$/," "))),t}(g.getRng(),t)),r=e.parser,m=n.merge,o=al({validate:e.settings.validate},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">​</span>',s={content:t,format:"html",selection:!0,paste:n.paste},(s=e.fire("BeforeSetContent",s)).isDefaultPrevented())e.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=s.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var h,v,y,b,C,x,w=(l=g.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=e.getBody();w===N&&g.isCollapsed()&&p.isBlock(N.firstChild)&&(h=e,(v=N.firstChild)&&!h.schema.getShortEndedElements()[v.nodeName])&&p.isEmpty(N.firstChild)&&((l=p.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),g.setRng(l)),g.isCollapsed()||(e.selection.setRng(cl(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),y=e.selection.getRng(),b=t,C=y.startContainer,x=y.startOffset,3===C.nodeType&&y.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(b)||(b+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(b)||(b=" "+b))),t=b);var E,S,T,k={context:(i=g.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,k),!0===n.paste&&Gc(e.schema,u)&&Qc(p,i))return l=Jc(o,p,e.selection.getRng(),u),e.selection.setRng(l),void e.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!p.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),k.invalid){for(fl(e,d),i=g.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;t=i===a?a.innerHTML:p.getOuterHTML(i),t=o.serialize(r.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return o.serialize(u)}))),i===a?p.setHTML(a,t):p.setOuterHTML(i,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):fl(e,t)}}(e,t=o.serialize(u),i);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new el(r);Xt.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,m),function(n,e){var t,r,o,i,a,u=n.dom,s=n.selection;if(e){if(n.selection.scrollIntoView(e),t=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===n.dom.getContentEditable(e))return e;return null}(e))return u.remove(e),s.select(t);var c=u.createRng();(i=e.previousSibling)&&3===i.nodeType?(c.setStart(i,i.nodeValue.length),fe.ie||(a=e.nextSibling)&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a))):(c.setStartBefore(e),c.setEndBefore(e)),r=u.getParent(e,u.isBlock),u.remove(e),r&&u.isEmpty(r)&&(n.$(r).empty(),c.setStart(r,0),c.setEnd(r,0),ll(r)||r.getAttribute("data-mce-fragment")||!(o=function(e){var t=_u.fromRangeStart(e);if(t=Js(n.getBody()).next(t))return t.toRange()}(c))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(c=o,u.remove(r))),s.setRng(c)}}(e,p.get("mce_marker")),E=e.getBody(),Xt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=e.dom,T=e.selection.getStart(),_.from(S.getParent(T,"td,th")).map(ar.fromDom).each(rl),e.fire("SetContent",s),e.addVisual()}},ml=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Xt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};dl(e,o.content,o.details)},gl=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,pl=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},hl=function(e){return e.getParam("iframe_attrs",{})},vl=function(e){return e.getParam("doctype","<!DOCTYPE html>")},yl=function(e){return e.getParam("document_base_url","")},bl=function(e){return pl(e,"body_id","tinymce")},Cl=function(e){return pl(e,"body_class","")},xl=function(e){return e.getParam("content_security_policy","")},wl=function(e){return e.getParam("br_in_pre",!0)},Nl=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},El=function(e){return e.getParam("forced_root_block_attrs",{})},Sl=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},Tl=function(e){return e.getParam("no_newline_selector","")},kl=function(e){return e.getParam("keep_styles",!0)},_l=function(e){return e.getParam("end_container_on_empty_block",!1)},Al=function(e){return Xt.explode(e.getParam("font_size_style_values",""))},Rl=function(e){return Xt.explode(e.getParam("font_size_classes",""))},Dl=function(e){return e.getParam("images_dataimg_filter",q(!0),"function")},Ol=function(e){return e.getParam("automatic_uploads",!0,"boolean")},Bl=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},Pl=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},Il=function(e){return e.getParam("images_upload_url","","string")},Ll=function(e){return e.getParam("images_upload_base_path","","string")},Fl=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},Ml=function(e){return e.getParam("images_upload_handler",null,"function")},zl=function(e){return e.getParam("content_css_cors",!1,"boolean")},Ul=function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")},jl=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Ta(n)?jo.isText(n.nextSibling)?_u(n.nextSibling,0):_u.after(n):Aa(t)?_u(n,r+1):t:Ta(n)?jo.isText(n.previousSibling)?_u(n.previousSibling,n.previousSibling.data.length):_u.before(n):Ra(t)?_u(n,r-1):t},Vl={isInlineTarget:function(e,t){return Lr(ar.fromDom(t),Ul(e))},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,U(Si.DOM.getParents(i.container(),"*",o),r));return _.from(a[a.length-1])},isRtl:function(e){return"rtl"===Si.DOM.getStyle(e,"direction",!0)||(t=e.textContent,gl.test(t));var t},isAtZwsp:function(e){return Aa(e)||Ra(e)},normalizePosition:jl,normalizeForwards:d(jl,!0),normalizeBackwards:d(jl,!1),hasSameParentBlock:function(e,t,n){var r=Ss(t,e),o=Ss(n,e);return r&&r===o}},Hl=function(e,t){return zr(e,t)?na(t,function(e){return No(e)||So(e)},(n=e,function(e){return Mr(n,ar.fromDom(e.dom().parentNode))})):_.none();var n},ql=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},$l=function(i,a,u){return ru(sc.firstPositionIn(u),sc.lastPositionIn(u),function(e,t){var n=Vl.normalizePosition(!0,e),r=Vl.normalizePosition(!1,t),o=Vl.normalizePosition(!1,a);return i?sc.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):sc.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Wl=function(e,t){var n,r,o,i=ar.fromDom(e),a=ar.fromDom(t);return n=a,r="pre,code",o=d(Mr,i),ra(n,r,o).isSome()},Kl=function(e,t){return Ha(t)&&!1===(r=e,o=t,jo.isText(o)&&/^[ \t\r\n]*$/.test(o.data)&&!1===Wl(r,o))||(n=t,jo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||Xl(t);var n,r,o},Xl=jo.hasAttribute("data-mce-bookmark"),Yl=jo.hasAttribute("data-mce-bogus"),Gl=jo.hasAttributeValue("data-mce-bogus","all"),Jl=function(e){return function(e){var t,n,r=0;if(Kl(e,e))return!1;if(!(n=e.firstChild))return!0;t=new go(n,e);do{if(Gl(n))n=t.next(!0);else if(Yl(n))n=t.next();else if(jo.isBr(n))r++,n=t.next();else{if(Kl(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Ql=Ar("block","position"),Zl=Ar("from","to"),ef=function(e,t){var n=ar.fromDom(e),r=ar.fromDom(t.container());return Hl(n,r).map(function(e){return Ql(e,t)})},tf=function(o,i,e){var t=ef(o,_u.fromRangeStart(e)),n=t.bind(function(e){return sc.fromPosition(i,o,e.position()).bind(function(e){return ef(o,e).map(function(e){return t=o,n=i,r=e,jo.isBr(r.position().getNode())&&!1===Jl(r.block())?sc.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?sc.fromPosition(n,t,e).bind(function(e){return ef(t,e)}):_.some(r)}).getOr(r):r;var t,n,r})})});return ru(t,n,Zl).filter(function(e){return!1===Mr((r=e).from().block(),r.to().block())&&Vr((n=e).from().block()).bind(function(t){return Vr(n.to().block()).filter(function(e){return Mr(t,e)})}).isSome()&&(t=e,!1===jo.isContentEditableFalse(t.from().block().dom())&&!1===jo.isContentEditableFalse(t.to().block().dom()));var t,n,r})},nf=function(e,t,n){return n.collapsed?tf(e,t,n):_.none()},rf=function(e,t,n){return zr(t,e)?function(e,t){for(var n=D(t)?t:b,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=ar.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Mr(e,t)}).slice(0,-1):[]},of=function(e,t){return rf(e,t,q(!1))},af=of,uf=function(e,t){return[e].concat(of(e,t))},sf=function(e){var t,n=(t=Kr(e),Y(t,Co).fold(function(){return t},function(e){return t.slice(0,e)}));return z(n,Ui),n},cf=function(e,t){var n=uf(t,e);return X(n.reverse(),Jl).each(Ui)},lf=function(e,t,n,r){if(Jl(n))return nl(n),sc.firstPositionIn(n.dom());0===U($r(r),function(e){return!Jl(e)}).length&&Jl(t)&&Pi(r,ar.fromTag("br"));var o=sc.prevPosition(n.dom(),_u.before(r.dom()));return z(sf(t),function(e){Pi(r,e)}),cf(e,t),o},ff=function(e,t,n){if(Jl(n))return Ui(n),Jl(t)&&nl(t),sc.firstPositionIn(t.dom());var r=sc.lastPositionIn(n.dom());return z(sf(t),function(e){Fi(n,e)}),cf(e,t),r},df=function(e,t){return zr(t,e)?(n=uf(e,t),_.from(n[n.length-1])):_.none();var n},mf=function(e,t){sc.positionIn(e,t.dom()).map(function(e){return e.getNode()}).map(ar.fromDom).filter(wo).each(Ui)},gf=function(e,t,n){return mf(!0,t),mf(!1,n),df(t,n).fold(d(ff,e,t,n),d(lf,e,t,n))},pf=function(e,t,n,r){return t?gf(e,r,n):gf(e,n,r)},hf=function(t,n){var e,r=ar.fromDom(t.getBody());return(e=nf(r.dom(),n,t.selection.getRng()).bind(function(e){return pf(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},vf=function(e,t){var n=ar.fromDom(t),r=d(Mr,e);return ta(n,_o,r).isSome()},yf=function(e,t){var n,r,o=sc.prevPosition(e.dom(),_u.fromRangeStart(t)).isNone(),i=sc.nextPosition(e.dom(),_u.fromRangeEnd(t)).isNone();return!(vf(n=e,(r=t).startContainer)||vf(n,r.endContainer))&&o&&i},bf=function(e){var n,r,o,t,i=ar.fromDom(e.getBody()),a=e.selection.getRng();return yf(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),ru(Hl(n,ar.fromDom(o.startContainer)),Hl(n,ar.fromDom(o.endContainer)),function(e,t){return!1===Mr(e,t)&&(o.deleteContents(),pf(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},Cf=function(e,t){return!e.selection.isCollapsed()&&bf(e)},xf=function(a){if(!k(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return z(a,function(e,r){var t=gr(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!k(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=gr(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!J(u,function(e){return F(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[o].apply(null,n)},log:function(e){V.console.log(e,{constructors:u,constructor:o,params:n})}}}}),n},wf=function(e){return Is(e).exists(wo)},Nf=function(e,t,n){var r=U(uf(ar.fromDom(n.container()),t),Co),o=Z(r).getOr(t);return sc.fromPosition(e,o.dom(),n).filter(wf)},Ef=function(e,t){return Is(t).exists(wo)||Nf(!0,e,t).isSome()},Sf=function(e,t){return(n=t,_.from(n.getNode(!0)).map(ar.fromDom)).exists(wo)||Nf(!1,e,t).isSome();var n},Tf=d(Nf,!1),kf=d(Nf,!0),_f=(ul="\xa0",function(e){return ul===e}),Af=function(e){return/^[\r\n\t ]$/.test(e)},Rf=function(e){return!Af(e)&&!_f(e)},Df=function(n,r,o){return _.from(o.container()).filter(jo.isText).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})},Of=d(Df,!0,Af),Bf=d(Df,!1,Af),Pf=function(e){var t=e.container();return jo.isText(t)&&0===t.data.length},If=function(e,t){var n=ks(e,t);return jo.isContentEditableFalse(n)&&!jo.isBogusAll(n)},Lf=d(If,0),Ff=d(If,-1),Mf=function(e,t){return jo.isTable(ks(e,t))},zf=d(Mf,0),Uf=d(Mf,-1),jf=xf([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Vf=function(e,t,n,r){var o=r.getNode(!1===t);return Hl(ar.fromDom(e),ar.fromDom(n.getNode())).map(function(e){return Jl(e)?jf.remove(e.dom()):jf.moveToElement(o)}).orThunk(function(){return _.some(jf.moveToElement(o))})},Hf=function(u,s,c){return sc.fromPosition(s,u,c).bind(function(e){return a=e.getNode(),_o(ar.fromDom(a))||So(ar.fromDom(a))?_.none():(t=u,o=e,i=function(e){return xo(ar.fromDom(e))&&!Ts(r,o,t)},Bs(!(n=s),r=c).fold(function(){return Bs(n,o).fold(q(!1),i)},i)?_.none():s&&jo.isContentEditableFalse(e.getNode())?Vf(u,s,c,e):!1===s&&jo.isContentEditableFalse(e.getNode(!0))?Vf(u,s,c,e):s&&Ff(c)?_.some(jf.moveToPosition(e)):!1===s&&Lf(c)?_.some(jf.moveToPosition(e)):_.none());var t,n,r,o,i,a})},qf=function(r,e,o){return i=e,a=o.getNode(!1===i),u=i?"after":"before",jo.isElement(a)&&a.getAttribute("data-mce-caret")===u?(t=e,n=o.getNode(!1===e),t&&jo.isContentEditableFalse(n.nextSibling)?_.some(jf.moveToElement(n.nextSibling)):!1===t&&jo.isContentEditableFalse(n.previousSibling)?_.some(jf.moveToElement(n.previousSibling)):_.none()).fold(function(){return Hf(r,e,o)},_.some):Hf(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return _.some(jf.remove(e))},function(e){return _.some(jf.moveToElement(e))},function(e){return Ts(n,e,t)?_.none():_.some(jf.moveToPosition(e))});var t,n});var t,n,i,a,u},$f=function(e,t,n){if(0!==n){var r,o,i,a=e.data.slice(t,t+n),u=t+n>=e.data.length,s=0===t;e.replaceData(t,n,(o=s,i=u,j((r=a).split(""),function(e,t){return-1!==" \f\n\r\t\x0B".indexOf(t)||"\xa0"===t?e.previousCharIsSpace||""===e.str&&o||e.str.length===r.length-1&&i?{previousCharIsSpace:!1,str:e.str+"\xa0"}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str))}},Wf=function(e,t){var n,r=e.data.slice(t),o=r.length-(n=r,n.replace(/^\s+/g,"")).length;return $f(e,t,o)},Kf=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===_u.isTextPosition(n)&&o===r.parentNode&&i>_u.before(r).offset()?_u(t.container(),t.offset()-1):t;var n,r,o,i},Xf=function(e){return Ha(e.previousSibling)?_.some((t=e.previousSibling,jo.isText(t)?_u(t,t.data.length):_u.after(t))):e.previousSibling?sc.lastPositionIn(e.previousSibling):_.none();var t},Yf=function(e){return Ha(e.nextSibling)?_.some((t=e.nextSibling,jo.isText(t)?_u(t,0):_u.before(t))):e.nextSibling?sc.firstPositionIn(e.nextSibling):_.none();var t},Gf=function(r,o){return Xf(o).orThunk(function(){return Yf(o)}).orThunk(function(){return e=r,t=o,n=_u.before(t.previousSibling?t.previousSibling:t.parentNode),sc.prevPosition(e,n).fold(function(){return sc.nextPosition(e,_u.after(t))},_.some);var e,t,n})},Jf=function(n,r){return Yf(r).orThunk(function(){return Xf(r)}).orThunk(function(){return e=n,t=r,sc.nextPosition(e,_u.after(t)).fold(function(){return sc.prevPosition(e,_u.before(t))},_.some);var e,t})},Qf=function(e,t,n){return(r=e,o=t,i=n,r?Jf(o,i):Gf(o,i)).map(d(Kf,n));var r,o,i},Zf=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},ed=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(lr(t))},td=function(e){if(Jl(e)){var t=ar.fromHtml('<br data-mce-bogus="1">');return zi(e),Fi(e,t),_.some(_u.before(t.dom()))}return _.none()},nd=function(e,t,l){var n,r,o,i,a=Hr(e).filter(mr),u=qr(e).filter(mr);return Ui(e),(n=a,r=u,o=t,i=function(e,t,n){var r,o,i,a,u=e.dom(),s=t.dom(),c=u.data.length;return o=s,i=l,a=Jn((r=u).data).length,r.appendData(o.data),Ui(ar.fromDom(o)),i&&Wf(r,a),n.container()===s?_u(u,c):n},n.isSome()&&r.isSome()&&o.isSome()?_.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):_.none()).orThunk(function(){return l&&(a.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Jn(r).length,$f(t,n-o,o);var t,n,r,o}),u.each(function(e){return Wf(e.dom(),0)})),t})},rd=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=Qf(n,t.getBody(),e.dom()),u=ta(e,d(ed,t),(o=t.getBody(),function(e){return e.dom()===o})),s=nd(e,a,(i=e,br(t.schema.getTextInlineElements(),lr(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(td).fold(function(){r&&Zf(t,n,s)},function(e){r&&Zf(t,n,_.some(e))})},od=function(a,u){var e,t,n,r,o,i;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=Os(t?1:-1,e,n),o=_u.fromRangeStart(r),i=ar.fromDom(e),!1===t&&Ff(o)?_.some(jf.remove(o.getNode(!0))):t&&Lf(o)?_.some(jf.remove(o.getNode())):!1===t&&Lf(o)&&Sf(i,o)?Tf(i,o).map(function(e){return jf.remove(e.getNode())}):t&&Ff(o)&&Ef(i,o)?kf(i,o).map(function(e){return jf.remove(e.getNode())}):qf(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),rd(o,i,ar.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?_u.before(e):_u.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},id=function(e,t){var n,r=e.selection.getNode();return!!jo.isContentEditableFalse(r)&&(n=ar.fromDom(e.getBody()),z(Qi(n,".mce-offscreen-selection"),Ui),rd(e,t,ar.fromDom(e.selection.getNode())),ql(e),!0)},ad=function(e,t){return e.selection.isCollapsed()?od(e,t):id(e,t)},ud=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(jo.isContentEditableTrue(t)||jo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return jo.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(_u.before(t).toRange())),!0},sd=jo.isText,cd=function(e){return sd(e)&&e.data[0]===xa},ld=function(e){return sd(e)&&e.data[e.data.length-1]===xa},fd=function(e){return e.ownerDocument.createTextNode(xa)},dd=function(e,t){return e?function(e){if(sd(e.previousSibling))return ld(e.previousSibling)||e.previousSibling.appendData(xa),e.previousSibling;if(sd(e))return cd(e)||e.insertData(0,xa),e;var t=fd(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(sd(e.nextSibling))return cd(e.nextSibling)||e.nextSibling.insertData(0,xa),e.nextSibling;if(sd(e))return ld(e)||e.appendData(xa),e;var t=fd(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},md=d(dd,!0),gd=d(dd,!1),pd=function(e,t){return jo.isText(e.container())?dd(t,e.container()):dd(t,e.getNode())},hd=function(e,t){var n=t.get();return n&&e.container()===n&&Ta(n)},vd=function(n,e){return e.fold(function(e){ss.remove(n.get());var t=md(e);return n.set(t),_.some(_u(t,t.length-1))},function(e){return sc.firstPositionIn(e).map(function(e){if(hd(e,n))return _u(n.get(),1);ss.remove(n.get());var t=pd(e,!0);return n.set(t),_u(t,1)})},function(e){return sc.lastPositionIn(e).map(function(e){if(hd(e,n))return _u(n.get(),n.get().length-1);ss.remove(n.get());var t=pd(e,!1);return n.set(t),_u(t,t.length-1)})},function(e){ss.remove(n.get());var t=gd(e);return n.set(t),_.some(_u(t,1))})},yd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return _.none()},bd=xf([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Cd=function(e,t){var n=Ss(t,e);return n||e},xd=function(e,t,n){var r=Vl.normalizeForwards(n),o=Cd(t,r.container());return Vl.findRootInline(e,o,r).fold(function(){return sc.nextPosition(o,r).bind(d(Vl.findRootInline,e,o)).map(function(e){return bd.before(e)})},_.none)},wd=function(e,t){return null===Qu(e,t)},Nd=function(e,t,n){return Vl.findRootInline(e,t,n).filter(d(wd,t))},Ed=function(e,t,n){var r=Vl.normalizeBackwards(n);return Nd(e,t,r).bind(function(e){return sc.prevPosition(e,r).isNone()?_.some(bd.start(e)):_.none()})},Sd=function(e,t,n){var r=Vl.normalizeForwards(n);return Nd(e,t,r).bind(function(e){return sc.nextPosition(e,r).isNone()?_.some(bd.end(e)):_.none()})},Td=function(e,t,n){var r=Vl.normalizeBackwards(n),o=Cd(t,r.container());return Vl.findRootInline(e,o,r).fold(function(){return sc.prevPosition(o,r).bind(d(Vl.findRootInline,e,o)).map(function(e){return bd.after(e)})},_.none)},kd=function(e){return!1===Vl.isRtl(Ad(e))},_d=function(e,t,n){return yd([xd,Ed,Sd,Td],[e,t,n]).filter(kd)},Ad=function(e){return e.fold($,$,$,$)},Rd=function(e){return e.fold(q("before"),q("start"),q("end"),q("after"))},Dd=function(e){return e.fold(bd.before,bd.before,bd.after,bd.after)},Od=function(n,e,r,t,o,i){return ru(Vl.findRootInline(e,r,t),Vl.findRootInline(e,r,o),function(e,t){return e!==t&&Vl.hasSameParentBlock(r,e,t)?bd.after(n?e:t):i}).getOr(i)},Bd=function(e,r){return e.fold(q(!0),function(e){return n=r,!(Rd(t=e)===Rd(n)&&Ad(t)===Ad(n));var t,n})},Pd=function(e,t){return e?t.fold(H(_.some,bd.start),_.none,H(_.some,bd.after),_.none):t.fold(_.none,H(_.some,bd.before),_.none,H(_.some,bd.end))},Id=function(a,u,s,c){var e=Vl.normalizePosition(a,c),l=_d(u,s,e);return _d(u,s,e).bind(d(Pd,a)).orThunk(function(){return t=a,n=u,r=s,o=l,e=c,i=Vl.normalizePosition(t,e),sc.fromPosition(t,r,i).map(d(Vl.normalizePosition,t)).fold(function(){return o.map(Dd)},function(e){return _d(n,r,e).map(d(Od,t,n,r,i,e)).filter(d(Bd,o))}).filter(kd);var t,n,r,o,e,i})},Ld=_d,Fd=Id,Md=(d(Id,!1),d(Id,!0),Dd),zd=function(e){return e.fold(bd.start,bd.start,bd.end,bd.end)},Ud=function(e){return D(e.selection.getSel().modify)},jd=function(e,t,n){var r=e?1:-1;return t.setRng(_u(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},Vd=function(e,t){var n=t.selection.getRng(),r=e?_u.fromRangeEnd(n):_u.fromRangeStart(n);return!!Ud(t)&&(e&&Aa(r)?jd(!0,t.selection,r):!(e||!Ra(r))&&jd(!1,t.selection,r))},Hd=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},qd=function(e){return!1!==e.settings.inline_boundaries},$d=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},Wd=function(t,e,n){return vd(e,n).map(function(e){return Hd(t,e),n})},Kd=function(e,t,n){return function(){return!!qd(t)&&Vd(e,t)}},Xd={move:function(a,u,s){return function(){return!!qd(a)&&(t=a,n=u,e=s,r=t.getBody(),o=_u.fromRangeStart(t.selection.getRng()),i=d(Vl.isInlineTarget,t),Fd(e,i,r,o).bind(function(e){return Wd(t,n,e)})).isSome();var t,n,e,r,o,i}},moveNextWord:d(Kd,!0),movePrevWord:d(Kd,!1),setupSelectedState:function(a){var u=Hi(null),s=d(Vl.isInlineTarget,a);return a.on("NodeChange",function(e){var t,n,r,o,i;qd(a)&&(t=s,n=a.dom,r=e.parents,o=U(n.select('*[data-mce-selected="inline-boundary"]'),t),i=U(r,t),z(Q(o,i),d($d,!1)),z(Q(i,o),d($d,!0)),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=_u.fromRangeStart(e.selection.getRng());_u.isTextPosition(n)&&!1===Vl.isAtZwsp(n)&&(Hd(e,ss.removeAndReposition(t.get(),n)),t.set(null))}}(a,u),function(n,r,o,e){if(r.selection.isCollapsed()){var t=U(e,n);z(t,function(e){var t=_u.fromRangeStart(r.selection.getRng());Ld(n,r.getBody(),t).bind(function(e){return Wd(r,o,e)})})}}(s,a,u,e.parents))}),u},setCaretPosition:Hd},Yd=function(t,n){return function(e){return vd(n,e).map(function(e){return Xd.setCaretPosition(t,e),!0}).getOr(!1)}},Gd=function(r,o,i,a){var u=r.getBody(),s=d(Vl.isInlineTarget,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=V.document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),Ld(s,u,_u.fromRangeStart(r.selection.getRng())).map(zd).map(Yd(r,o))}),r.nodeChanged()},Jd=function(n,r,i,o){var e,t,a=(e=n.getBody(),t=o.container(),Ss(t,e)||e),u=d(Vl.isInlineTarget,n),s=Ld(u,a,o);return s.bind(function(e){return i?e.fold(q(_.some(zd(e))),_.none,q(_.some(Md(e))),_.none):e.fold(_.none,q(_.some(Md(e))),_.none,q(_.some(zd(e))))}).map(Yd(n,r)).getOrThunk(function(){var t=sc.navigate(i,a,o),e=t.bind(function(e){return Ld(u,a,e)});return s.isSome()&&e.isSome()?Vl.findRootInline(u,a,o).map(function(e){return o=e,!!ru(sc.firstPositionIn(o),sc.lastPositionIn(o),function(e,t){var n=Vl.normalizePosition(!0,e),r=Vl.normalizePosition(!1,t);return sc.nextPosition(o,n).map(function(e){return e.isEqual(r)}).getOr(!0)}).getOr(!0)&&(rd(n,i,ar.fromDom(e)),!0);var o}).getOr(!1):e.bind(function(e){return t.map(function(e){return i?Gd(n,r,o,e):Gd(n,r,e,o),!0})}).getOr(!1)})},Qd=function(e,t,n){if(e.selection.isCollapsed()&&!1!==e.settings.inline_boundaries){var r=_u.fromRangeStart(e.selection.getRng());return Jd(e,t,n,r)}return!1},Zd=Ar("start","end"),em=Ar("rng","table","cells"),tm=xf([{removeTable:["element"]},{emptyCells:["cells"]}]),nm=function(e,t){return ia(ar.fromDom(e),"td,th",t)},rm=function(e,t){return ra(e,"table",t)},om=function(e){return!1===Mr(e.start(),e.end())},im=function(e,n){return rm(e.start(),n).bind(function(t){return rm(e.end(),n).bind(function(e){return Mr(t,e)?_.some(t):_.none()})})},am=function(e){return Qi(e,"td,th")},um=function(r,e){var t=nm(e.startContainer,r),n=nm(e.endContainer,r);return e.collapsed?_.none():ru(t,n,Zd).fold(function(){return t.fold(function(){return n.bind(function(t){return rm(t,r).bind(function(e){return Z(am(e)).map(function(e){return Zd(e,t)})})})},function(t){return rm(t,r).bind(function(e){return ee(am(e)).map(function(e){return Zd(t,e)})})})},function(e){return sm(r,e)?_.none():(n=r,rm((t=e).start(),n).bind(function(e){return ee(am(e)).map(function(e){return Zd(t.start(),e)})}));var t,n})},sm=function(e,t){return im(t,e).isSome()},cm=function(e,t){var n,r,o,i,a=d(Mr,e);return(n=t,r=a,o=nm(n.startContainer,r),i=nm(n.endContainer,r),ru(o,i,Zd).filter(om).filter(function(e){return sm(r,e)}).orThunk(function(){return um(r,n)})).bind(function(e){return im(t=e,a).map(function(e){return em(t,e,am(e))});var t})},lm=function(e,t){return Y(e,function(e){return Mr(e,t)})},fm=function(n){return(r=n,ru(lm(r.cells(),r.rng().start()),lm(r.cells(),r.rng().end()),function(e,t){return r.cells().slice(e,t+1)})).map(function(e){var t=n.cells();return e.length===t.length?tm.removeTable(n.table()):tm.emptyCells(e)});var r},dm=function(e,t){return cm(e,t).bind(fm)},mm=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},gm=mm,pm=function(e){return G(e,function(e){var t=Za(e);return t?[ar.fromDom(t)]:[]})},hm=function(e){return 1<mm(e).length},vm=function(e){return U(pm(e),_o)},ym=function(e){return Qi(e,"td[data-mce-selected],th[data-mce-selected]")},bm=function(e,t){var n=ym(t),r=vm(e);return 0<n.length?n:r},Cm=bm,xm=function(e){return bm(gm(e.selection.getSel()),ar.fromDom(e.getBody()))},wm=function(e,t){return z(t,nl),e.selection.setCursorLocation(t[0].dom(),0),!0},Nm=function(e,t){return rd(e,!1,t),!0},Em=function(n,e,r,t){return Tm(e,t).fold(function(){return t=n,dm(e,r).map(function(e){return e.fold(d(Nm,t),d(wm,t))});var t},function(e){return km(n,e)}).getOr(!1)},Sm=function(e,t){return X(uf(t,e),_o)},Tm=function(e,t){return X(uf(t,e),function(e){return"caption"===lr(e)})},km=function(e,t){return nl(t),e.selection.setCursorLocation(t.dom(),0),_.some(!0)},_m=function(u,s,c,l,f){return sc.navigate(c,u.getBody(),f).bind(function(e){return r=l,o=c,i=f,a=e,sc.firstPositionIn(r.dom()).bind(function(t){return sc.lastPositionIn(r.dom()).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?km(u,l):(t=l,n=e,Tm(s,ar.fromDom(n.getNode())).map(function(e){return!1===Mr(e,t)}));var t,n,r,o,i,a}).or(_.some(!0))},Am=function(a,u,s,e){var c=_u.fromRangeStart(a.selection.getRng());return Sm(s,e).bind(function(e){return Jl(e)?km(a,e):(t=a,n=s,r=u,o=e,i=c,sc.navigate(r,t.getBody(),i).bind(function(e){return Sm(n,ar.fromDom(e.getNode())).map(function(e){return!1===Mr(e,o)})}));var t,n,r,o,i})},Rm=function(a,u,e){var s=ar.fromDom(a.getBody());return Tm(s,e).fold(function(){return Am(a,u,s,e)},function(e){return t=a,n=u,r=s,o=e,i=_u.fromRangeStart(t.selection.getRng()),Jl(o)?km(t,o):_m(t,r,n,o,i);var t,n,r,o,i}).getOr(!1)},Dm=function(e,t){var n,r,o,i,a,u=ar.fromDom(e.selection.getStart(!0)),s=xm(e);return e.selection.isCollapsed()&&0===s.length?Rm(e,t,u):(n=e,r=u,o=ar.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=xm(n)).length?wm(n,a):Em(n,o,i,r))},Om=wc.isEq,Bm=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},Pm=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,function(e){return!!Bm(t,e,n)||e.parentNode===o||!!Fm(t,e,n,r,!0)}),Fm(t,e,n,r))},Im=function(e,t,n){return!!Om(t,n.inline)||!!Om(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},Lm=function(e,t,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(c)if("undefined"==typeof c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):wc.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!Om(u,wc.normalizeStyleValue(e,wc.replaceVars(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?e.getAttrib(t,c[s]):wc.getStyle(e,t,c[s]))return n;return n},Fm=function(e,t,n,r,o){var i,a,u,s,c=e.formatter.get(n),l=e.dom;if(c&&t)for(a=0;a<c.length;a++)if(i=c[a],Im(e.dom,t,i)&&Lm(l,t,i,"attributes",o,r)&&Lm(l,t,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!e.dom.hasClass(t,s[u]))return;return i}},Mm={matchNode:Fm,matchName:Im,match:function(e,t,n,r){var o;return r?Pm(e,r,t,n):(r=e.selection.getNode(),!!Pm(e,r,t,n)||!((o=e.selection.getStart())===r||!Pm(e,o,t,n)))},matchAll:function(r,o,i){var e,a=[],u={};return e=r.selection.getStart(),r.dom.getParent(e,function(e){var t,n;for(t=0;t<o.length;t++)n=o[t],!u[n]&&Fm(r,e,n,i)&&(u[n]=!0,a.push(n))},r.dom.getRoot()),a},canApply:function(e,t){var n,r,o,i,a,u=e.formatter.get(t),s=e.dom;if(u)for(n=e.selection.getStart(),r=wc.getParents(s,n),i=u.length-1;0<=i;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;0<=o;o--)if(s.is(r[o],a))return!0}return!1},matchesUnInheritedFormatSelector:Bm},zm=function(e,t){return e.splitText(t)},Um=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&jo.isText(t)?0<n&&n<t.nodeValue.length&&(t=(r=zm(t,n)).previousSibling,n<o?(t=r=zm(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(jo.isText(t)&&0<n&&n<t.nodeValue.length&&(t=zm(t,n),n=0),jo.isText(r)&&0<o&&o<r.nodeValue.length&&(o=(r=zm(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},jm=xa,Vm="_mce_caret",Hm=function(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==jm||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length},qm=function(e){var t;if(e)for(e=(t=new go(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},$m=function(e){var t=ar.fromTag("span");return Nr(t,{id:Vm,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Fi(t,ar.fromText(jm)),t},Wm=function(e,t,n){void 0===n&&(n=!0);var r,o=e.dom,i=e.selection;if(Hm(t))rd(e,!1,ar.fromDom(t),n);else{var a=i.getRng(),u=o.getParent(t,o.isBlock),s=((r=qm(t))&&r.nodeValue.charAt(0)===jm&&r.deleteData(0,1),r);a.startContainer===s&&0<a.startOffset&&a.setStart(s,a.startOffset-1),a.endContainer===s&&0<a.endOffset&&a.setEnd(s,a.endOffset-1),o.remove(t,!0),u&&o.isEmpty(u)&&nl(ar.fromDom(u)),i.setRng(a)}},Km=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)Wm(e,t,n);else if(!(t=Qu(e.getBody(),o.getStart())))for(;t=r.get(Vm);)Wm(e,t,!1)},Xm=function(e,t,n){var r=e.dom,o=r.getParent(n,d(wc.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(tl(ar.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},Ym=function(e,t){return e.appendChild(t),t},Gm=function(e,t){var n,r,o=(n=function(e,t){return Ym(e,t.cloneNode(!1))},r=t,function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n)}(e,function(e){r=n(r,e)}),r);return Ym(o,o.ownerDocument.createTextNode(jm))},Jm=function(i){i.on("mouseup keydown",function(e){var t,n,r,o;t=i,n=e.keyCode,r=t.selection,o=t.getBody(),Km(t,null,!1),8!==n&&46!==n||!r.isCollapsed()||r.getStart().innerHTML!==jm||Km(t,Qu(o,r.getStart())),37!==n&&39!==n||Km(t,Qu(o,r.getStart()))})},Qm=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(lr(t))&&!Ju(t.dom())&&!jo.isBogus(t.dom())},Zm=function(e){return 1===Kr(e).length},eg=function(e,t,n,r){var o,i,a,u,s=d(Qm,t),c=W(U(r,s),function(e){return e.dom()});if(0===c.length)rd(t,e,n);else{var l=(o=n.dom(),i=c,a=$m(!1),u=Gm(i,a.dom()),Pi(ar.fromDom(o),a),Ui(ar.fromDom(o)),_u(u,0));t.selection.setRng(l.toRange())}},tg=function(r,o){var t,e=ar.fromDom(r.getBody()),n=ar.fromDom(r.selection.getStart()),i=U((t=uf(n,e),Y(t,Co).fold(q(t),function(e){return t.slice(0,e)})),Zm);return ee(i).map(function(e){var t,n=_u.fromRangeStart(r.selection.getRng());return!(!$l(o,n,e.dom())||Ju((t=e).dom())&&Hm(t.dom())||(eg(o,r,e,i),0))}).getOr(!1)},ng=function(e,t){return!!e.selection.isCollapsed()&&tg(e,t)},rg=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},og=function(e,t,n){var r,o,i,a,u,s=e.dom,c=s.getRoot(),l=0;if(u={elm:t,alignToTop:n},e.fire("scrollIntoView",u),!u.isDefaultPrevented()&&jo.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==c.nodeName){var f=e.selection.getScrollContainer();if(f)return r=rg(t).y-rg(f).y+l,a=f.clientHeight,void((r<(i=f.scrollTop)||i+a<r+25)&&(f.scrollTop=r<i?r:r-a+25))}o=s.getViewPort(e.getWin()),r=s.getPos(t).y+l,i=o.y,a=o.h,(r<o.y||i+a<r+25)&&e.getWin().scrollTo(0,r<i?r:r-a+25)}},ig=function(d,e){Z(Su.fromRangeStart(e).getClientRects()).each(function(e){var t,n,r,o,i,a,u,s,c,l=function(e){if(e.inline)return e.getBody().getBoundingClientRect();var t=e.getWin();return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight}}(d),f={x:(i=t=l,a=n=e,a.left>i.left&&a.right<i.right?0:a.left<i.left?a.left-i.left:a.right-i.right),y:(r=t,o=n,o.top>r.top&&o.bottom<r.bottom?0:o.top<r.top?o.top-r.top:o.bottom-r.bottom)};s=0!==f.x?0<f.x?f.x+4:f.x-4:0,c=0!==f.y?0<f.y?f.y+4:f.y-4:0,(u=d).inline?(u.getBody().scrollLeft+=s,u.getBody().scrollTop+=c):u.getWin().scrollBy(s,c)})},ag=jo.isContentEditableTrue,ug=jo.isContentEditableFalse,sg=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},cg=function(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:((r=(n=t).ownerDocument.createRange()).selectNode(n),r)},lg=function(e,t,n){var r=Os(1,e.getBody(),t),o=_u.fromRangeStart(r),i=o.getNode();if(ug(i))return sg(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(ug(a))return sg(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return ug(e)||ag(e)});return ug(u)?sg(1,e,u,!1,n):null},fg=function(e,t,n){if(!t||!t.collapsed)return t;var r=lg(e,t,n);return r||t},dg=function(e,t){e.selection.setRng(t),ig(e,e.selection.getRng())},mg=function(e,t,n,r,o,i){var a,u,s=sg(r,e,i.getNode(!o),o,!0);if(t.collapsed){var c=t.cloneRange();o?c.setEnd(s.startContainer,s.startOffset):c.setStart(s.endContainer,s.endOffset),c.deleteContents()}else t.deleteContents();return e.selection.setRng(s),a=e.dom,u=n,jo.isText(u)&&0===u.data.length&&a.remove(u),!0},gg=function(e,t){return function(e,t){var n=e.selection.getRng();if(!jo.isText(n.commonAncestorContainer))return!1;var r=t?Tu.Forwards:Tu.Backwards,o=Js(e.getBody()),i=d(Ls,o.next),a=d(Ls,o.prev),u=t?i:a,s=t?Lf:Ff,c=Ps(r,e.getBody(),n),l=Vl.normalizePosition(t,u(c));if(!l)return!1;if(s(l))return mg(e,n,c.getNode(),r,t,l);var f=u(l);return!!(f&&s(f)&&Fs(l,f))&&mg(e,n,c.getNode(),r,t,f)}(e,t)},pg=function(e,t){e.getDoc().execCommand(t,!1,null)},hg=function(e){ad(e,!1)||gg(e,!1)||Qd(e,!1)||hf(e,!1)||Dm(e)||Cf(e,!1)||ng(e,!1)||(pg(e,"Delete"),ql(e))},vg=function(e){ad(e,!0)||gg(e,!0)||Qd(e,!0)||hf(e,!0)||Dm(e)||Cf(e,!0)||ng(e,!0)||pg(e,"ForwardDelete")},yg=function(o,t,e){var n=function(e){return t=o,n=e.dom(),r=_r(n,t),_.from(r).filter(function(e){return 0<e.length});var t,n,r};return na(ar.fromDom(e),function(e){return n(e).isSome()},function(e){return Mr(ar.fromDom(t),e)}).bind(n)},bg=function(o){return function(r,e){return _.from(e).map(ar.fromDom).filter(dr).bind(function(e){return yg(o,r,e.dom()).or((t=o,n=e.dom(),_.from(Si.DOM.getStyle(n,t,!0))));var t,n}).getOr("")}},Cg={getFontSize:bg("font-size"),getFontFamily:H(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},bg("font-family")),toPt:function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,r=t||0,o=Math.pow(10,r),Math.round(n*o)/o+"pt"):e;var n,r,o}},xg=function(e){return sc.firstPositionIn(e.getBody()).map(function(e){var t=e.container();return jo.isText(t)?t.parentNode:t})},wg=function(o){return _.from(o.selection.getRng()).bind(function(e){var t,n,r=o.getBody();return n=r,(t=e).startContainer===n&&0===t.startOffset?_.none():_.from(o.selection.getStart(!0))})},Ng=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=Al(e),o=Rl(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},Eg=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},Sg=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},Tg=function(e,t,n){return Sg(e,t,function(e){return e.nodeName===n})},kg=function(e){return e&&"TABLE"===e.nodeName},_g=function(e,t,n){for(var r=new go(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(jo.isBr(t))return!0},Ag=function(e,t,n,r,o){var i,a,u,s,c,l,f=e.getRoot(),d=e.schema.getNonEmptyElements();if(u=e.getParent(o.parentNode,e.isBlock)||f,r&&jo.isBr(o)&&t&&e.isEmpty(u))return _.some(Su(o.parentNode,e.nodeIndex(o)));for(i=new go(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||(l=f,ka(c=s)&&!1===Sg(c,l,Ju)))return _.none();if(jo.isText(s)&&0<s.nodeValue.length)return!1===Tg(s,f,"A")?_.some(Su(s,r?s.nodeValue.length:0)):_.none();if(e.isBlock(s)||d[s.nodeName.toLowerCase()])return _.none();a=s}return n&&a?_.some(Su(a,0)):_.none()},Rg=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=e.getRoot(),p=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],l=jo.isElement(o)&&i===o.childNodes.length,s=e.schema.getNonEmptyElements(),c=n,ka(o))return _.none();if(jo.isElement(o)&&i>o.childNodes.length-1&&(c=!1),jo.isDocument(o)&&(o=g,i=0),o===g){if(c&&(u=o.childNodes[0<i?i-1:0])){if(ka(u))return _.none();if(s[u.nodeName]||kg(u))return _.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&0<i?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=jo.isText(o)&&l?o.data.length:0,!t&&o===g.lastChild&&kg(o))return _.none();if(function(e,t){for(;t&&t!==e;){if(jo.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(g,o)||ka(o))return _.none();if(o.hasChildNodes()&&!1===kg(o)){a=new go(u=o,g);do{if(jo.isContentEditableFalse(u)||ka(u)){p=!1;break}if(jo.isText(u)&&0<u.nodeValue.length){i=c?0:u.nodeValue.length,o=u,p=!0;break}if(s[u.nodeName.toLowerCase()]&&(!(f=u)||!/^(TD|TH|CAPTION)$/.test(f.nodeName))){i=e.nodeIndex(u),o=u.parentNode,c||i++,p=!0;break}}while(u=c?a.next():a.prev())}}}return t&&(jo.isText(o)&&0===i&&Ag(e,l,t,!0,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),jo.isElement(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!jo.isBr(u)||(m="A",(d=u).previousSibling&&d.previousSibling.nodeName===m)||_g(e,u,!1)||_g(e,u,!0)||Ag(e,l,t,!0,u).each(function(e){o=e.container(),i=e.offset(),p=!0}))),c&&!t&&jo.isText(o)&&i===o.nodeValue.length&&Ag(e,l,t,!1,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),p?_.some(Su(o,i)):_.none()},Dg=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=Su.fromRangeStart(t);return Rg(e,n,!0,r).each(function(e){n&&Su.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||Rg(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),Eg(t,r)?_.none():_.some(r)},Og=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},Bg=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},Pg=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Dg(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.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=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new go(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0<r.length)return!0}(e.schema,s,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),zu(i,a,n),Og(i,o,n),Bg(i,o,n,r),e.undoManager.add()},Ig=function(e,t){var n=ar.fromTag("br");Pi(ar.fromDom(t),n),e.undoManager.add()},Lg=function(e,t){Fg(e.getBody(),t)||Ii(ar.fromDom(t),ar.fromTag("br"));var n=ar.fromTag("br");Ii(ar.fromDom(t),n),Og(e.dom,e.selection,n.dom()),Bg(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},Fg=function(e,t){return n=_u.after(t),!!jo.isBr(n.getNode())||sc.nextPosition(e,_u.after(t)).map(function(e){return jo.isBr(e.getNode())}).getOr(!1);var n},Mg=function(e){return e&&"A"===e.nodeName&&"href"in e},zg=function(e){return e.fold(q(!1),Mg,Mg,q(!1))},Ug=function(e,t){t.fold(o,d(Ig,e),d(Lg,e),o)},jg=function(e,t){var n,r,o,i=(n=e,r=d(Vl.isInlineTarget,n),o=_u.fromRangeStart(n.selection.getRng()),Ld(r,n.getBody(),o).filter(zg));i.isSome()?i.each(d(Ug,e)):Pg(e,t)},Vg={create:Ar("start","soffset","finish","foffset")},Hg=xf([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),qg=(Hg.before,Hg.on,Hg.after,function(e){return e.fold($,$,$)}),$g=xf([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Wg={domRange:$g.domRange,relative:$g.relative,exact:$g.exact,exactFromRange:function(e){return $g.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t=e.match({domRange:function(e){return ar.fromDom(e.startContainer)},relative:function(e,t){return qg(e)},exact:function(e,t,n,r){return e}});return jr(t)},range:Vg.create},Kg=or.detect().browser,Xg=function(e,t){var n=mr(t)?Mc(t).length:Kr(t).length+1;return n<e?n:e<0?0:e},Yg=function(e){return Wg.range(e.start(),Xg(e.soffset(),e.start()),e.finish(),Xg(e.foffset(),e.finish()))},Gg=function(e,t){return!jo.isRestrictedNode(t.dom())&&(zr(e,t)||Mr(e,t))},Jg=function(t){return function(e){return Gg(t,e.start())&&Gg(t,e.finish())}},Qg=function(e){return!0===e.inline||Kg.isIE()},Zg=function(e){return Wg.range(ar.fromDom(e.startContainer),e.startOffset,ar.fromDom(e.endContainer),e.endOffset)},ep=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?_.from(t.getRangeAt(0)):_.none()).map(Zg)},tp=function(e){var t=jr(e);return ep(t.dom()).filter(Jg(e))},np=function(e,t){return _.from(t).filter(Jg(e)).map(Yg)},rp=function(e){var t=V.document.createRange();try{return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),_.some(t)}catch(n){return _.none()}},op=function(e){return(e.bookmark?e.bookmark:_.none()).bind(d(np,ar.fromDom(e.getBody()))).bind(rp)},ip=function(e){var t=Qg(e)?tp(ar.fromDom(e.getBody())):_.none();e.bookmark=t.isSome()?t:e.bookmark},ap=function(t){op(t).each(function(e){t.selection.setRng(e)})},up=op,sp=function(e){return Eo(e)||So(e)},cp=function(e){return U(W(e.selection.getSelectedBlocks(),ar.fromDom),function(e){return!sp(e)&&!Vr(e).map(sp).getOr(!1)})},lp=function(e,t){var n=e.settings,r=e.dom,o=e.selection,i=e.formatter,a=/[a-z%]+$/i.exec(n.indentation)[0],u=parseInt(n.indentation,10),s=e.getParam("indent_use_margin",!1);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||n.forced_root_block||r.getParent(o.getNode(),r.isBlock)||i.apply("div"),z(cp(e),function(e){!function(e,t,n,r,o,i){if("false"!==e.getContentEditable(i)){var a=n?"margin":"padding";if(a="TABLE"===i.nodeName?"margin":a,a+="rtl"===e.getStyle(i,"direction",!0)?"Right":"Left","outdent"===t){var u=Math.max(0,parseInt(i.style[a]||0,10)-r);e.setStyle(i,a,u?u+o:"")}else u=parseInt(i.style[a]||0,10)+r+o,e.setStyle(i,a,u)}}(r,t,s,u,a,e.dom())})},fp=Xt.each,dp=Xt.extend,mp=Xt.map,gp=Xt.inArray;function pp(s){var o,i,a,t,c={state:{},exec:{},value:{}},n=s.settings;s.on("PreInit",function(){o=s.dom,i=s.selection,n=s.settings,a=s.formatter});var r=function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.state[e])return t(e);try{return s.getDoc().queryCommandState(e)}catch(n){}return!1}},e=function(e,n){n=n||"exec",fp(e,function(t,e){fp(e.toLowerCase().split(","),function(e){c[n][e]=t})})},u=function(e,t,n){e=e.toLowerCase(),c.value[e]=function(){return t.call(n||s)}};dp(this,{execCommand:function(t,n,r,e){var o,i,a=!1;if(!s.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||e&&e.skip_focus?ap(s):s.focus(),(e=s.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;if(i=t.toLowerCase(),o=c.exec[i])return o(i,n,r),s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if(fp(s.plugins,function(e){if(e.execCommand&&e.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!(a=!0)}),a)return a;if(s.theme&&s.theme.execCommand&&s.theme.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{a=s.getDoc().execCommand(t,n,r)}catch(u){}return!!a&&(s.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},queryCommandState:r,queryCommandValue:function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.value[e])return t(e);try{return s.getDoc().queryCommandValue(e)}catch(n){}}},queryCommandSupported:function(e){if(e=e.toLowerCase(),c.exec[e])return!0;try{return s.getDoc().queryCommandSupported(e)}catch(t){}return!1},addCommands:e,addCommand:function(e,o,i){e=e.toLowerCase(),c.exec[e]=function(e,t,n,r){return o.call(i||s,t,n,r)}},addQueryStateHandler:function(e,t,n){e=e.toLowerCase(),c.state[e]=function(){return t.call(n||s)}},addQueryValueHandler:u,hasCustomCommand:function(e){return e=e.toLowerCase(),!!c.exec[e]}});var l=function(e,t,n){return t===undefined&&(t=!1),n===undefined&&(n=null),s.getDoc().execCommand(e,t,n)},f=function(e){return a.match(e)},d=function(e,t){a.toggle(e,t?{value:t}:undefined),s.nodeChanged()},m=function(e){t=i.getBookmark(e)},g=function(){i.moveToBookmark(t)};e({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){s.undoManager.add()},"Cut,Copy,Paste":function(e){var t,n=s.getDoc();try{l(e)}catch(o){t=!0}if("paste"!==e||n.queryCommandEnabled(e)||(t=!0),t||!n.queryCommandSupported(e)){var r=s.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");fe.mac&&(r=r.replace(/Ctrl\+/g,"\u2318+")),s.notificationManager.open({text:r,type:"error"})}},unlink:function(){if(i.isCollapsed()){var e=s.dom.getParent(s.selection.getStart(),"a");e&&s.dom.remove(e,!0)}else a.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),fp("left,center,right,justify".split(","),function(e){t!==e&&a.remove("align"+e)}),"none"!==t&&d("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;l(e),(t=o.getParent(i.getNode(),"ol,ul"))&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(m(),o.split(n,t),g()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){d(e)},"ForeColor,HiliteColor":function(e,t,n){d(e,n)},FontName:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontname",{value:Ng(r,o)}),r.nodeChanged()},FontSize:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontsize",{value:Ng(r,o)}),r.nodeChanged()},RemoveFormat:function(e){a.remove(e)},mceBlockQuote:function(){d("blockquote")},FormatBlock:function(e,t,n){return d(n||"p")},mceCleanup:function(){var e=i.getBookmark();s.setContent(s.getContent()),i.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var r=n||i.getNode();r!==s.getBody()&&(m(),s.dom.remove(r,!0),g())},mceSelectNodeDepth:function(e,t,n){var r=0;o.getParent(i.getNode(),function(e){if(1===e.nodeType&&r++===n)return i.select(e),!1},s.getBody())},mceSelectNode:function(e,t,n){i.select(n)},mceInsertContent:function(e,t,n){ml(s,n)},mceInsertRawHTML:function(e,t,n){i.setContent("tiny_mce_marker");var r=s.getContent();s.setContent(r.replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){d(n)},mceSetContent:function(e,t,n){s.setContent(n)},"Indent,Outdent":function(e){lp(s,e)},mceRepaint:function(){},InsertHorizontalRule:function(){s.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),jo.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){hg(s)},forwardDelete:function(){vg(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return jg(s,n),!0}});var p=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=mp(e,function(e){return!!a.matchNode(e,n)});return-1!==gp(t,!0)}};e({JustifyLeft:p("alignleft"),JustifyCenter:p("aligncenter"),JustifyRight:p("alignright"),JustifyFull:p("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(n.inline_styles){if((e=o.getParent(i.getStart(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0;if((e=o.getParent(i.getEnd(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0}return r("InsertUnorderedList")||r("InsertOrderedList")||!n.inline_styles&&!!o.getParent(i.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=o.getParent(i.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),e({Undo:function(){s.undoManager.undo()},Redo:function(){s.undoManager.redo()}}),u("FontName",function(){return wg(t=s).fold(function(){return xg(t).map(function(e){return Cg.getFontFamily(t.getBody(),e)}).getOr("")},function(e){return Cg.getFontFamily(t.getBody(),e)});var t},this),u("FontSize",function(){return wg(t=s).fold(function(){return xg(t).map(function(e){return Cg.getFontSize(t.getBody(),e)}).getOr("")},function(e){return Cg.getFontSize(t.getBody(),e)});var t},this)}var hp=Xt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," "),vp=function(a){var u,s,c=this,l={},f=function(){return!1},d=function(){return!0};u=(a=a||{}).scope||c,s=a.toggleEvent||f;var r=function(e,t,n,r){var o,i,a;if(!1===t&&(t=f),t)for(t={func:t},r&&Xt.extend(t,r),a=(i=e.toLowerCase().split(" ")).length;a--;)e=i[a],(o=l[e])||(o=l[e]=[],s(e,!0)),n?o.unshift(t):o.push(t);return c},m=function(e,t){var n,r,o,i,a;if(e)for(n=(i=e.toLowerCase().split(" ")).length;n--;){if(e=i[n],r=l[e],!e){for(o in l)s(o,!1),delete l[o];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),l[e]=r);else r.length=0;r.length||(s(e,!1),delete l[e])}}else{for(e in l)s(e,!1);l={}}return c};c.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=u),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=d},t.stopPropagation=function(){t.isPropagationStopped=d},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=d},t.isDefaultPrevented=f,t.isPropagationStopped=f,t.isImmediatePropagationStopped=f),a.beforeFire&&a.beforeFire(t),n=l[e])for(r=0,o=n.length;r<o;r++){if((i=n[r]).once&&m(e,i.func),t.isImmediatePropagationStopped())return t.stopPropagation(),t;if(!1===i.func.call(u,t))return t.preventDefault(),t}return t},c.on=r,c.off=m,c.once=function(e,t,n){return r(e,t,n,{once:!0})},c.has=function(e){return e=e.toLowerCase(),!(!l[e]||0===l[e].length)}};vp.isNative=function(e){return!!hp[e.toLowerCase()]};var yp,bp=function(n){return n._eventDispatcher||(n._eventDispatcher=new vp({scope:n,toggleEvent:function(e,t){vp.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher},Cp={fire:function(e,t,n){if(this.removed&&"remove"!==e&&"detach"!==e)return t;if(t=bp(this).fire(e,t,n),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},on:function(e,t,n){return bp(this).on(e,t,n)},off:function(e,t){return bp(this).off(e,t)},once:function(e,t){return bp(this).once(e,t)},hasEventListeners:function(e){return bp(this).has(e)}},xp=function(e,t){return e.fire("PreProcess",t)},wp=function(e,t){return e.fire("PostProcess",t)},Np=function(e){return e.fire("remove")},Ep=function(e){return e.fire("detach")},Sp=function(e,t){return e.fire("SwitchMode",{mode:t})},Tp=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},kp=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},_p=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},Ap=function(e,t,n){var r,o;Gi(e,t)&&!1===n?(o=t,$i(r=e)?r.dom().classList.remove(o):Ki(r,o),Yi(r)):n&&Xi(e,t)},Rp=function(e,t){Ap(ar.fromDom(e.getBody()),"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable="false"):(e.readonly=!1,e.getBody().contentEditable="true",_p(e,"StyleWithCSS",!1),_p(e,"enableInlineTableEditing",!1),_p(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},Dp=function(e){return e.readonly?"readonly":"design"},Op=Si.DOM,Bp=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=Op.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},Pp=function(e,t,n){var r;(r=e).hidden||r.readonly?!0===e.readonly&&n.preventDefault():e.fire(t,n)},Ip=function(i,a){var e,t;if(i.delegates||(i.delegates={}),!i.delegates[a]&&!i.removed)if(e=Bp(i,a),i.settings.event_root){if(yp||(yp={},i.editorManager.on("removeEditor",function(){var e;if(!i.editorManager.activeEditor&&yp){for(e in yp)i.dom.unbind(Bp(i,e));yp=null}})),yp[a])return;t=function(e){for(var t=e.target,n=i.editorManager.get(),r=n.length;r--;){var o=n[r].getBody();(o===t||Op.isChildOf(t,o))&&Pp(n[r],a,e)}},yp[a]=t,Op.bind(e,a,t)}else t=function(e){Pp(i,a,e)},Op.bind(e,a,t),i.delegates[a]=t},Lp={bindPendingEventDelegates:function(){var t=this;Xt.each(t._pendingNativeEvents,function(e){Ip(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(t?n.initialized?Ip(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(Bp(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e,t=this,n=t.getBody(),r=t.dom;if(t.delegates){for(e in t.delegates)t.dom.unbind(Bp(t,e),e,t.delegates[e]);delete t.delegates}!t.inline&&n&&r&&(n.onload=null,r.unbind(t.getWin()),r.unbind(t.getDoc())),r&&(r.unbind(n),r.unbind(t.getContainer()))}},Fp=Lp=Xt.extend({},Cp,Lp),Mp=Ar("sections","settings"),zp=or.detect().deviceType.isTouch(),Up=["lists","autolink","autosave"],jp={theme:"mobile"},Vp=function(e){var t=k(e)?e.join(" "):e,n=W(S(t)?t.split(" "):[],Gn);return U(n,function(e){return 0<e.length})},Hp=function(e,t){return e.sections().hasOwnProperty(t)},qp=function(e,t,n,r){var o,i=Vp(n.forced_plugins),a=Vp(r.plugins),u=e&&Hp(t,"mobile")?U(a,d(F,Up)):a,s=(o=u,[].concat(Vp(i)).concat(Vp(o)));return Xt.extend(r,{plugins:s.join(" ")})},$p=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g,p,h=(o=["mobile"],i=yr(r,function(e,t){return F(o,t)}),Mp(i.t,i.f)),v=Xt.extend(t,n,h.settings(),(m=e,p=(g=h).settings().inline,m&&Hp(g,"mobile")&&!p?(c="mobile",l=jp,f=h.sections(),d=f.hasOwnProperty(c)?f[c]:{},Xt.extend({},l,d)):{}),{validate:!0,content_editable:h.settings().inline,external_plugins:(a=n,u=h.settings(),s=u.external_plugins?u.external_plugins:{},a&&a.external_plugins?Xt.extend({},a.external_plugins,s):s)});return qp(e,h,n,v)},Wp=function(e,t,n){return _.from(t.settings[n]).filter(e)},Kp=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?z(0<i.indexOf("=")?i.split(/[;,](?![^=;,]*(?:[;,]|$))/):i.split(","),function(e){var t=e.split("=");1<t.length?a[Xt.trim(t[0])]=Xt.trim(t[1]):a[Xt.trim(t[0])]=Xt.trim(t)}):a=i,a):"string"===r?Wp(S,e,t).getOr(n):"number"===r?Wp(O,e,t).getOr(n):"boolean"===r?Wp(R,e,t).getOr(n):"object"===r?Wp(T,e,t).getOr(n):"array"===r?Wp(k,e,t).getOr(n):"string[]"===r?Wp((o=S,function(e){return k(e)&&J(e,o)}),e,t).getOr(n):"function"===r?Wp(D,e,t).getOr(n):u},Xp=Xt.each,Yp=Xt.explode,Gp={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},Jp=Xt.makeMap("alt,ctrl,shift,meta,access");function Qp(i){var a={},r=[],u=function(e){var t,n,r={};for(n in Xp(Yp(e,"+"),function(e){e in Jp?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=Gp[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],Jp)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,fe.mac?r.ctrl=!0:r.shift=!0),r.meta&&(fe.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},s=function(e,t,n,r){var o;return(o=Xt.map(Yp(e,">"),u))[o.length-1]=Xt.extend(o[o.length-1],{func:n,scope:r||i}),Xt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(Xp(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Xt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),Xp(Yp(Xt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var Zp=function(e){var t=Ur(e).dom();return e.dom()===t.activeElement},eh=function(t){return(e=Ur(t),n=e!==undefined?e.dom():V.document,_.from(n.activeElement).map(ar.fromDom)).filter(function(e){return t.dom().contains(e.dom())});var e,n},th=function(t,e){return(n=e,n.collapsed?_.from(eu(n.startContainer,n.startOffset)).map(ar.fromDom):_.none()).bind(function(e){return ko(e)?_.some(e):!1===zr(t,e)?_.some(t):_.none()});var n},nh=function(t,e){th(ar.fromDom(t.getBody()),e).bind(function(e){return sc.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},rh=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},oh=function(e){var t,n=e.getBody();return n&&(t=ar.fromDom(n),Zp(t)||eh(t).isSome())},ih=function(e){return e.inline?oh(e):(t=e).iframeElement&&Zp(ar.fromDom(t.iframeElement));var t},ah=function(e){return e.editorManager.setActive(e)},uh=function(e,t){e.removed||(t?ah(e):function(t){var e=t.selection,n=t.settings.content_editable,r=t.getBody(),o=e.getRng();t.quirks.refreshContentEditable();var i,a,u=(i=t,a=e.getNode(),i.dom.getParent(a,function(e){return"true"===i.dom.getContentEditable(e)}));if(t.$.contains(r,u))return rh(u),nh(t,o),ah(t);t.bookmark!==undefined&&!1===ih(t)&&up(t).each(function(e){t.selection.setRng(e),o=e}),n||(fe.opera||rh(r),t.getWin().focus()),(fe.gecko||n)&&(rh(r),nh(t,o)),ah(t)}(e))},sh=ih,ch=function(e,t){return t.dom()[e]},lh=function(e,t){return parseInt(kr(t,e),10)},fh=d(ch,"clientWidth"),dh=d(ch,"clientHeight"),mh=d(lh,"margin-top"),gh=d(lh,"margin-left"),ph=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=ar.fromDom(e.getBody()),p=e.inline?g:(r=g,ar.fromDom(r.dom().ownerDocument.documentElement)),h=(o=e.inline,a=t,u=n,s=(i=p).dom().getBoundingClientRect(),{x:a-(o?s.left+i.dom().clientLeft+gh(i):0),y:u-(o?s.top+i.dom().clientTop+mh(i):0)});return l=h.x,f=h.y,d=fh(c=p),m=dh(c),0<=l&&0<=f&&l<=d&&f<=m},hh=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,_.from(t).map(ar.fromDom)).map(function(e){return zr(Ur(e),e)}).getOr(!1)};function vh(n){var t,o=[],i=function(){var e,t=n.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},a=function(){0<o.length&&i().reposition(o)},u=function(t){Y(o,function(e){return e===t}).each(function(e){o.splice(e,1)})},r=function(r){if(!n.removed&&hh(n))return X(o,function(e){return t=i().getArgs(e),n=r,!(t.type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t,n}).getOrThunk(function(){n.editorManager.setActive(n);var e,t=i().open(r,function(){u(t),a()});return e=t,o.push(e),a(),t})};return(t=n).on("SkinLoaded",function(){var e=t.settings.service_message;e&&r({text:e,type:"warning",timeout:0,icon:""})}),t.on("ResizeEditor ResizeWindow",function(){he.requestAnimationFrame(a)}),t.on("remove",function(){z(o.slice(),function(e){i().close(e)})}),{open:r,close:function(){_.from(o[0]).each(function(e){i().close(e),u(e),a()})},getNotifications:function(){return o}}}function yh(r){var o=[],i=function(){var e,t=r.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},alert:e,confirm:e,close:e,getParams:e,setParams:e}},a=function(e,t){return function(){return t?t.apply(e,arguments):undefined}},u=function(e){var t;o.push(e),t=e,r.fire("OpenWindow",{win:t})},s=function(n){Y(o,function(e){return e===n}).each(function(e){var t;o.splice(e,1),t=n,r.fire("CloseWindow",{win:t}),0===o.length&&r.focus()})},e=function(){return _.from(o[o.length-1])};return r.on("remove",function(){z(o.slice(0),function(e){i().close(e)})}),{windows:o,open:function(e,t){r.editorManager.setActive(r),ip(r);var n=i().open(e,t,s);return u(n),n},alert:function(e,t,n){var r=i().alert(e,a(n||this,t),s);u(r)},confirm:function(e,t,n){var r=i().confirm(e,a(n||this,t),s);u(r)},close:function(){e().each(function(e){i().close(e),s(e)})},getParams:function(){return e().map(i().getParams).getOr(null)},setParams:function(t){e().each(function(e){i().setParams(e,t)})},getWindows:function(){return o}}}var bh={},Ch="en",xh={setCode:function(e){e&&(Ch=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return Ch},rtl:!1,add:function(e,t){var n=bh[e];for(var r in n||(bh[e]=n={}),t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=bh[Ch]||{},n=function(e){return Xt.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||Xt.is(e,"undefined")},o=function(e){return e=n(e),Xt.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if(Xt.is(e,"object")&&Xt.hasOwn(e,"raw"))return n(e.raw);if(Xt.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return Xt.hasOwn(i,t)?n(i[t]):e})}return o(e).replace(/{context:\w+}$/,"")},data:bh},wh=Bi.PluginManager,Nh=function(e,t){var n=function(e,t){for(var n in wh.urls)if(wh.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?xh.translate(["Failed to load plugin: {0} from url {1}",n,t]):xh.translate(["Failed to load plugin url: {0}",t])},Eh=function(e,t){e.notificationManager.open({type:"error",text:t})},Sh=function(e,t){e._skinLoaded?Eh(e,t):e.on("SkinLoaded",function(){Eh(e,t)})},Th=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=V.window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},kh={pluginLoadError:function(e,t){Sh(e,Nh(e,t))},pluginInitError:function(e,t,n){var r=xh.translate(["Failed to initialize plugin: {0}",t]);Th(r,n),Sh(e,r)},uploadError:function(e,t){Sh(e,xh.translate(["Failed to upload image: {0}",t]))},displayError:Sh,initError:Th},_h=Bi.PluginManager,Ah=Bi.ThemeManager;function Rh(){return new(oe.getOrDie("XMLHttpRequest"))}function Dh(u,s){var r={},n=function(e,r,o,t){var i,n;(i=Rh()).open("POST",s.url),i.withCredentials=s.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?o("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?r((t=s.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+i.responseText)},(n=new V.FormData).append("file",e.blob(),e.filename()),i.send(n)},c=function(e,t){return{url:t,blobInfo:e,status:!0}},l=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},f=function(e,t){Xt.each(r[e],function(e){e(t)}),delete r[e]},o=function(e,n){return e=Xt.grep(e,function(e){return!u.isUploaded(e.blobUri())}),de.all(Xt.map(e,function(e){return u.isPending(e.blobUri())?(t=e.blobUri(),new de(function(e){r[t]=r[t]||[],r[t].push(e)})):(o=e,i=s.handler,a=n,u.markPending(o.blobUri()),new de(function(t){var n;try{var r=function(){n&&n.close()};i(o,function(e){r(),u.markUploaded(o.blobUri(),e),f(o.blobUri(),c(o,e)),t(c(o,e))},function(e){r(),u.removeFailed(o.blobUri()),f(o.blobUri(),l(o,e)),t(l(o,e))},function(e){e<0||100<e||(n||(n=a()),n.progressBar.value(e))})}catch(e){t(l(o,e.message))}}));var o,i,a,t}))};return!1===D(s.handler)&&(s.handler=n),{upload:function(e,t){return s.url||s.handler!==n?o(e,t):new de(function(e){e([])})}}}var Oh=function(e){return oe.getOrDie("atob")(e)},Bh=function(e){var t,n,r=decodeURIComponent(e).split(",");return(n=/data:([^;]+)/.exec(r[0]))&&(t=n[1]),{type:t,data:r[1]}},Ph=function(a){return new de(function(e){var t,n,r,o,i=Bh(a);try{t=Oh(i.data)}catch(iE){return void e(new V.Blob([]))}for(o=t.length,n=new(oe.getOrDie("Uint8Array"))(o),r=0;r<n.length;r++)n[r]=t.charCodeAt(r);e(new V.Blob([n],{type:i.type}))})},Ih=function(e){return 0===e.indexOf("blob:")?(i=e,new de(function(e,t){var n=function(){t("Cannot convert "+i+" to Blob. Resource might not exist or is inaccessible.")};try{var r=Rh();r.open("GET",i,!0),r.responseType="blob",r.onload=function(){200===this.status?e(this.response):n()},r.onerror=n,r.send()}catch(o){n()}})):0===e.indexOf("data:")?Ph(e):null;var i},Lh=function(n){return new de(function(e){var t=new(oe.getOrDie("FileReader"));t.onloadend=function(){e(t.result)},t.readAsDataURL(n)})},Fh=Bh,Mh=0,zh=function(e){return(e||"blobid")+Mh++},Uh=function(n,r,o,t){var i,a;0!==r.src.indexOf("blob:")?(i=Fh(r.src).data,(a=n.findFirst(function(e){return e.base64()===i}))?o({image:r,blobInfo:a}):Ih(r.src).then(function(e){a=n.create(zh(),e,i),n.add(a),o({image:r,blobInfo:a})},function(e){t(e)})):(a=n.getByUri(r.src))?o({image:r,blobInfo:a}):Ih(r.src).then(function(t){Lh(t).then(function(e){i=Fh(e).data,a=n.create(zh(),t,i),n.add(a),o({image:r,blobInfo:a})})},function(e){t(e)})},jh=function(e){return e?te(e.getElementsByTagName("img")):[]},Vh=0,Hh={uuid:function(e){return e+Vh+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t}};function qh(u){var n,o,t,e,i,r,a,s,c,l=(n=[],o=function(e){var t,n,r;if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");return t=e.id||Hh.uuid("blobid"),n=e.name||t,{id:q(t),name:q(n),filename:q(n+"."+(r=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[r.toLowerCase()]||"dat")),blob:q(e.blob),base64:q(e.base64),blobUri:q(e.blobUri||ae.createObjectURL(e.blob)),uri:q(e.uri)}},{create:function(e,t,n,r){if(S(e))return o({id:e,name:r,blob:t,base64:n});if(T(e))return o(e);throw new Error("Unknown input type")},add:function(e){t(e.id())||n.push(e)},get:t=function(t){return e(function(e){return e.id()===t})},getByUri:function(t){return e(function(e){return e.blobUri()===t})},findFirst:e=function(e){return U(n,e)[0]},removeByUri:function(t){n=U(n,function(e){return e.blobUri()!==t||(ae.revokeObjectURL(e.blobUri()),!1)})},destroy:function(){z(n,function(e){ae.revokeObjectURL(e.blobUri())}),n=[]}}),f=(a={},s=function(e,t){return{status:e,resultUri:t}},{hasBlobUri:c=function(e){return e in a},getResultUri:function(e){var t=a[e];return t?t.resultUri:null},isPending:function(e){return!!c(e)&&1===a[e].status},isUploaded:function(e){return!!c(e)&&2===a[e].status},markPending:function(e){a[e]=s(1,null)},markUploaded:function(e,t){a[e]=s(2,t)},removeFailed:function(e){delete a[e]},destroy:function(){a={}}}),d=[],m=function(t){return function(e){return u.selection?t(e):[]}},g=function(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e},p=function(e,t,n){return e=g(e,'src="'+t+'"','src="'+n+'"'),e=g(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},h=function(t,n){z(u.undoManager.data,function(e){"fragmented"===e.type?e.fragments=W(e.fragments,function(e){return p(e,t,n)}):e.content=p(e.content,t,n)})},v=function(){return u.notificationManager.open({text:u.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},y=function(e,t){l.removeByUri(e.src),h(e.src,t),u.$(e).attr({src:Bl(u)?t+"?"+(new Date).getTime():t,"data-mce-src":u.convertURL(t,"src")})},b=function(n){return i||(i=Dh(f,{url:Il(u),basePath:Ll(u),credentials:Fl(u),handler:Ml(u)})),w().then(m(function(r){var e;return e=W(r,function(e){return e.blobInfo}),i.upload(e,v).then(m(function(e){var t=W(e,function(e,t){var n=r[t].image;return e.status&&Pl(u)?y(n,e.url):e.error&&kh.uploadError(u,e.error),{element:n,status:e.status}});return n&&n(t),t}))}))},C=function(e){if(Ol(u))return b(e)},x=function(t){return!1!==J(d,function(e){return e(t)})&&(0!==t.getAttribute("src").indexOf("data:")||Dl(u)(t))},w=function(){var o,i,a;return r||(o=f,i=l,a={},r={findAll:function(e,n){var t;n||(n=q(!0)),t=U(jh(e),function(e){var t=e.src;return!!fe.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!t||t===fe.transparentSrc)&&(0===t.indexOf("blob:")?!o.isUploaded(t)&&n(e):0===t.indexOf("data:")&&n(e))});var r=W(t,function(n){if(a[n.src])return new de(function(t){a[n.src].then(function(e){if("string"==typeof e)return e;t({image:n,blobInfo:e.blobInfo})})});var e=new de(function(e,t){Uh(i,n,e,t)}).then(function(e){return delete a[e.image.src],e})["catch"](function(e){return delete a[n.src],e});return a[n.src]=e});return de.all(r)}}),r.findAll(u.getBody(),x).then(m(function(e){return e=U(e,function(e){return"string"!=typeof e||(kh.displayError(u,e),!1)}),z(e,function(e){h(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))},N=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=f.getResultUri(n);if(t)return'src="'+t+'"';var r=l.getByUri(n);return r||(r=j(u.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),r?'src="data:'+r.blob().type+";base64,"+r.base64()+'"':e})};return u.on("setContent",function(){Ol(u)?C():w()}),u.on("RawSaveContent",function(e){e.content=N(e.content)}),u.on("getContent",function(e){e.source_view||"raw"===e.format||(e.content=N(e.content))}),u.on("PostRender",function(){u.parser.addNodeFilter("img",function(e){z(e,function(e){var t=e.attr("src");if(!l.getByUri(t)){var n=f.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:l,addFilter:function(e){d.push(e)},uploadImages:b,uploadImagesAuto:C,scanForImages:w,destroy:function(){l.destroy(),f.destroy(),r=i=null}}}var $h=function(e,t){return e.hasOwnProperty(t.nodeName)},Wh=function(e,t){if(jo.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||$h(e,t.nextSibling)))return!0}return!1},Kh=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.dom,g=e.selection,p=e.schema,h=p.getBlockElements(),v=g.getStart(),y=e.getBody();if(f=d.forced_root_block,v&&jo.isElement(v)&&f&&(l=y.nodeName.toLowerCase(),p.isValidChild(l,f.toLowerCase())&&(b=h,C=y,x=v,!M(af(ar.fromDom(x),ar.fromDom(C)),function(e){return $h(b,e.dom())})))){var b,C,x,w,N;for(n=(t=g.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=sh(e),v=y.firstChild;v;)if(w=h,N=v,jo.isText(N)||jo.isElement(N)&&!$h(w,N)&&!yc(N)){if(Wh(h,v)){v=(u=v).nextSibling,m.remove(u);continue}a||(a=m.create(f,e.settings.forced_root_block_attrs),v.parentNode.insertBefore(a,v),s=!0),v=(u=v).nextSibling,a.appendChild(u)}else a=null,v=v.nextSibling;s&&c&&(t.setStart(n,r),t.setEnd(o,i),g.setRng(t),e.nodeChanged())}},Xh=function(e){e.settings.forced_root_block&&e.on("NodeChange",d(Kh,e))},Yh=function(t){return Yr(t).fold(q([t]),function(e){return[t].concat(Yh(e))})},Gh=function(t){return Gr(t).fold(q([t]),function(e){return"br"===lr(e)?Hr(e).map(function(e){return[t].concat(Gh(e))}).getOr([]):[t].concat(Gh(e))})},Jh=function(o,e){return ru((i=e,a=i.startContainer,u=i.startOffset,jo.isText(a)?0===u?_.some(ar.fromDom(a)):_.none():_.from(a.childNodes[u]).map(ar.fromDom)),(t=e,n=t.endContainer,r=t.endOffset,jo.isText(n)?r===n.data.length?_.some(ar.fromDom(n)):_.none():_.from(n.childNodes[r-1]).map(ar.fromDom)),function(e,t){var n=X(Yh(o),d(Mr,e)),r=X(Gh(o),d(Mr,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i,a,u},Qh=function(e,t,n,r){var o=n,i=new go(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==Xt.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(fe.ie&&fe.ie<11&&e.isBlock(n)&&e.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},Zh=function(e){var t=e.selection.getSel();return t&&0<t.rangeCount};function ev(i){var r,o=[];"onselectionchange"in i.getDoc()||i.on("NodeChange Click MouseUp KeyUp Focus",function(e){var t,n;n={startContainer:(t=i.selection.getRng()).startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset},"nodechange"!==e.type&&Eg(n,r)||i.fire("SelectionChange"),r=n}),i.on("contextmenu",function(){i.fire("SelectionChange")}),i.on("SelectionChange",function(){var e=i.selection.getStart(!0);!e||!fe.range&&i.selection.isCollapsed()||Zh(i)&&!function(e){var t,n;if((n=i.$(e).parentsUntil(i.getBody()).add(e)).length===o.length){for(t=n.length;0<=t&&n[t]===o[t];t--);if(-1===t)return o=n,!0}return o=n,!1}(e)&&i.dom.isChildOf(e,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("MouseUp",function(e){!e.isDefaultPrevented()&&Zh(i)&&("IMG"===i.selection.getNode().nodeName?he.setEditorTimeout(i,function(){i.nodeChanged()}):i.nodeChanged())}),this.nodeChanged=function(e){var t,n,r,o=i.selection;i.initialized&&o&&!i.settings.disable_nodechange&&!i.readonly&&(r=i.getBody(),(t=o.getStart(!0)||r).ownerDocument===i.getDoc()&&i.dom.isChildOf(t,r)||(t=r),n=[],i.dom.getParent(t,function(e){if(e===r)return!0;n.push(e)}),(e=e||{}).element=t,e.parents=n,i.fire("NodeChange",e))}}var tv,nv,rv={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return fe.mac?e.metaKey:e.ctrlKey&&!e.altKey}},ov=function(e){return j(e,function(e,t){return e.concat(function(t){var e=function(e){return W(e,function(e){return(e=Ka(e)).node=t,e})};if(jo.isElement(t))return e(t.getClientRects());if(jo.isText(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}(t))},[])};(nv=tv||(tv={}))[nv.Up=-1]="Up",nv[nv.Down=1]="Down";var iv=function(o,i,a,e,u,t){var n,s,c=0,l=[],r=function(e){var t,n,r;for(r=ov([e]),-1===o&&(r=r.reverse()),t=0;t<r.length;t++)if(n=r[t],!a(n,s)){if(0<l.length&&i(n,Ht.last(l))&&c++,n.line=c,u(n))return!0;l.push(n)}};return(s=Ht.last(t.getClientRects()))&&(r(n=t.getNode()),function(e,t,n,r){for(;r=Es(r,e,$a,t);)if(n(r))return}(o,e,r,n)),l},av=d(iv,tv.Up,Ga,Ja),uv=d(iv,tv.Down,Ja,Ga),sv=function(n){return function(e){return t=n,e.line>t;var t}},cv=function(n){return function(e){return t=n,e.line===t;var t}},lv=jo.isContentEditableFalse,fv=Es,dv=function(e,t){return Math.abs(e.left-t)},mv=function(e,t){return Math.abs(e.right-t)},gv=function(e,t){return e>=t.left&&e<=t.right},pv=function(e,o){return Ht.reduce(e,function(e,t){var n,r;return n=Math.min(dv(e,o),mv(e,o)),r=Math.min(dv(t,o),mv(t,o)),gv(o,t)?t:gv(o,e)?e:r===n&&lv(t.node)?t:r<n?t:e})},hv=function(e,t,n,r){for(;r=fv(r,e,$a,t);)if(n(r))return},vv=function(e,t,n){var r,o,i,a,u,s,c,l=ov(U(te(e.getElementsByTagName("*")),gs)),f=U(l,function(e){return n>=e.top&&n<=e.bottom});return(r=pv(f,t))&&(r=pv((a=e,c=function(t,e){var n;return n=U(ov([e]),function(e){return!t(e,u)}),s=s.concat(n),0===n.length},(s=[]).push(u=r),hv(tv.Up,a,d(c,Ga),u.node),hv(tv.Down,a,d(c,Ja),u.node),s),t))&&gs(r.node)?(i=t,{node:(o=r).node,before:dv(o,i)<mv(o,i)}):null},yv=function(t,n,e){if(e.collapsed)return!1;if(fe.ie&&fe.ie<=11&&e.startOffset===e.endOffset-1&&e.startContainer===e.endContainer){var r=e.startContainer.childNodes[e.startOffset];if(jo.isElement(r))return M(r.getClientRects(),function(e){return Qa(e,t,n)})}return M(e.getClientRects(),function(e){return Qa(e,t,n)})},bv=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),n=(t=e.ownerDocument).documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},Cv=function(e,t){return n=(u=e).inline?bv(u.getBody()):{left:0,top:0},a=(i=e).getBody(),r=i.inline?{left:a.scrollLeft,top:a.scrollTop}:{left:0,top:0},{pageX:(o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=bv(e.getContentAreaContainer()),r=(i=(o=e).getBody(),a=o.getDoc().documentElement,u={left:i.scrollLeft,top:i.scrollTop},s={left:i.scrollLeft||a.scrollLeft,top:i.scrollTop||a.scrollTop},o.inline?u:s);return{left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}var o,i,a,u,s;return{left:t.pageX,top:t.pageY}}(e,t)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o,i,a,u},xv=jo.isContentEditableFalse,wv=jo.isContentEditableTrue,Nv=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},Ev=function(u,s){return function(e){if(0===e.button){var t=X(s.dom.getParents(e.target),au(xv,wv)).getOr(null);if(i=s.getBody(),xv(a=t)&&a!==i){var n=s.dom.getPos(t),r=s.getBody(),o=s.getDoc().documentElement;u.element=t,u.screenX=e.screenX,u.screenY=e.screenY,u.maxX=(s.inline?r.scrollWidth:o.offsetWidth)-2,u.maxY=(s.inline?r.scrollHeight:o.offsetHeight)-2,u.relX=e.pageX-n.x,u.relY=e.pageY-n.y,u.width=t.offsetWidth,u.height=t.offsetHeight,u.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(s,t,u.width,u.height)}}var i,a}},Sv=function(l,f){return function(e){if(l.dragging&&(s=(i=f).selection,c=s.getSel().getRangeAt(0).startContainer,a=3===c.nodeType?c.parentNode:c,u=l.element,a!==u&&!i.dom.isChildOf(a,u)&&!xv(a))){var t=(r=l.element,(o=r.cloneNode(!0)).removeAttribute("data-mce-selected"),o),n=f.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){Nv(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;Tv(l)}},Tv=function(e){e.dragging=!1,e.element=null,Nv(e.ghost)},kv=function(e){var t,n,r,o,i,a,p,h,v,u,s,c={};t=Si.DOM,a=V.document,n=Ev(c,e),p=c,h=e,v=he.throttle(function(e,t){h._selectionOverrides.hideFakeCaret(),h.selection.placeCaretAt(e,t)},0),r=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m=Math.max(Math.abs(e.screenX-p.screenX),Math.abs(e.screenY-p.screenY));if(p.element&&!p.dragging&&10<m){if(h.fire("dragstart",{target:p.element}).isDefaultPrevented())return;p.dragging=!0,h.focus()}if(p.dragging){var g=(f=p,{pageX:(d=Cv(h,e)).pageX-f.relX,pageY:d.pageY+5});c=p.ghost,l=h.getBody(),c.parentNode!==l&&l.appendChild(c),t=p.ghost,n=g,r=p.width,o=p.height,i=p.maxX,a=p.maxY,s=u=0,t.style.left=n.pageX+"px",t.style.top=n.pageY+"px",n.pageX+r>i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=Sv(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),Tv(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},_v=function(e){var n;kv(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(xv(t)||xv(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},Av=function(t){var e=Vi(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=fg(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},Rv=jo.isContentEditableTrue,Dv=jo.isContentEditableFalse,Ov=function(e,t){for(var n=e.getBody();t&&t!==n;){if(Rv(t)||Dv(t))return t;t=t.parentNode}return null},Bv=function(g){var p,e,t,a=g.getBody(),o=ds(g.getBody(),function(e){return g.dom.isBlock(e)},function(){return sh(g)}),h="sel-"+g.dom.uniqueId(),u=function(e){e&&g.selection.setRng(e)},s=function(){return g.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},y=function(e,t){return t=Os(e,a,t),-1===e?_u.fromRangeStart(t):_u.fromRangeEnd(t)},n=function(e){return ka(e)||Oa(e)||Ba(e)},b=function(e){return n(e.startContainer)||n(e.endContainer)},c=function(e){var t=g.schema.getShortEndedElements(),n=g.dom.createRng(),r=e.startContainer,o=e.startOffset,i=e.endContainer,a=e.endOffset;return br(t,r.nodeName.toLowerCase())?0===o?n.setStartBefore(r):n.setStartAfter(r):n.setStart(r,o),br(t,i.nodeName.toLowerCase())?0===a?n.setEndBefore(i):n.setEndAfter(i):n.setEnd(i,a),n},l=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!b(e))if(!1===t){if(c=y(-1,e),gs(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(gs(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=y(1,e),gs(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(gs(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&Dv(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&i===e.endContainer&&(n=i.childNodes[a]),Dv(n)?(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=oa(ar.fromDom(g.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",h)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&fe.ie?(r.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e),z(Qi(ar.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){Sr(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},f=function(){p&&(p.removeAttribute("data-mce-selected"),oa(ar.fromDom(g.getBody()),"#"+h).each(Ui),p=null),oa(ar.fromDom(g.getBody()),"#"+h).each(Ui),p=null},C=function(){o.hide()};return fe.ceFalse&&(function(){g.on("mouseup",function(e){var t=s();t.collapsed&&ph(g,e.clientX,e.clientY)&&u(lg(g,t,!1))}),g.on("click",function(e){var t;(t=Ov(g,e.target))&&(Dv(t)&&(e.preventDefault(),g.focus()),Rv(t)&&g.dom.isChildOf(t,g.selection.getNode())&&f())}),g.on("blur NewBlock",function(){f()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==Dv(Ov(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Js(e);if(!e.firstChild)return!1;var n=_u.before(e.firstChild),r=t.next(n);return r&&!Lf(r)&&!Ff(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=Ov(n,e.target);Dv(t)&&(r||(e.preventDefault(),l(cg(n,t))))}),g.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==ph(g,e.clientX,e.clientY))if(t=Ov(g,n))Dv(t)?(e.preventDefault(),l(cg(g,t))):(f(),Rv(t)&&e.shiftKey||yv(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===gs(n)){f(),C();var r=vv(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);g.getBody().focus(),u(o)}}}),g.on("keypress",function(e){rv.modifierPressed(e)||(e.keyCode,Dv(g.selection.getNode())&&e.preventDefault())}),g.on("getSelectionRange",function(e){var t=e.range;if(p){if(!p.parentNode)return void(p=null);(t=t.cloneRange()).selectNode(p),e.range=t}}),g.on("setSelectionRange",function(e){e.range=c(e.range);var t=l(e.range,e.forward);t&&(e.range=t)}),g.on("AfterSetSelectionRange",function(e){var t,n=e.range;b(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||f()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!fe.ie){var r=(t=g.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),_v(g),Av(g)}(),e=g.contentStyles,t=".mce-content-body",e.push(o.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Pa(e),u(s()),g.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},Pv=function(e){for(var t=e;/<!--|--!?>/g.test(t);)t=t.replace(/<!--|--!?>/g,"");return t},Iv=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r},Lv=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function Fv(z,U){void 0===U&&(U=di());var e=function(){};!1!==(z=z||{}).fix_self_closing&&(z.fix_self_closing=!0);var j=z.comment?z.comment:e,V=z.cdata?z.cdata:e,H=z.text?z.text:e,q=z.start?z.start:e,$=z.end?z.end:e,W=z.pi?z.pi:e,K=z.doctype?z.doctype:e;return{parse:function(e){var t,n,r,d,o,i,a,m,u,s,g,c,p,l,f,h,v,y,b,C,x,w,N,E,S,T,k,_,A,R=0,D=[],O=0,B=ti.decode,P=Xt.makeMap("src,href,data,background,formaction,poster,xlink:href"),I=/((java|vb)script|mhtml):/i,L=function(e){var t,n;for(t=D.length;t--&&D[t].name!==e;);if(0<=t){for(n=D.length-1;t<=n;n--)(e=D[n]).valid&&$(e.name);D.length=t}},F=function(e,t,n,r,o){var i,a,u,s,c;if(n=(t=t.toLowerCase())in g?t:B(n||r||o||""),p&&!m&&0==(0===(u=t).indexOf("data-")||0===u.indexOf("aria-"))){if(!(i=y[t])&&b){for(a=b.length;a--&&!(i=b[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(P[t]&&!z.allow_script_urls){var l=n.replace(/[\s\u0000-\u001F]+/g,"");try{l=decodeURIComponent(l)}catch(f){l=unescape(l)}if(I.test(l))return;if(c=l,!(s=z).allow_html_data_urls&&(/^data:image\//i.test(c)?!1===s.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(c):/^data:/i.test(c)))return}m&&(t in P||0===t.indexOf("on"))||(d.map[t]=n,d.push({name:t,value:n}))};for(S=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),T=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=U.getShortEndedElements(),E=z.self_closing_elements||U.getSelfClosingElements(),g=U.getBoolAttrs(),p=z.validate,u=z.remove_internals,A=z.fix_self_closing,k=U.getSpecialElements(),N=e+">";t=S.exec(N);){if(R<t.index&&H(B(e.substr(R,t.index-R))),n=t[6])":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),L(n);else if(n=t[7]){if(t.index+t[0].length>e.length){H(B(e.substr(t.index))),R=t.index+t[0].length;continue}":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,A&&E[n]&&0<D.length&&D[D.length-1].name===n&&L(n);var M=Lv(T,t[8]);if(null!==M){if("all"===M){R=Iv(U,e,S.lastIndex),S.lastIndex=R;continue}f=!1}if(!p||(l=U.getElementRule(n))){if(f=!0,p&&(y=l.attributes,b=l.attributePatterns),(v=t[8])?((m=-1!==v.indexOf("data-mce-type"))&&u&&(f=!1),(d=[]).map={},v.replace(T,F)):(d=[]).map={},p&&!m){if(C=l.attributesRequired,x=l.attributesDefault,w=l.attributesForced,l.removeEmptyAttrs&&!d.length&&(f=!1),w)for(o=w.length;o--;)a=(h=w[o]).name,"{$uid}"===(_=h.value)&&(_="mce_"+O++),d.map[a]=_,d.push({name:a,value:_});if(x)for(o=x.length;o--;)(a=(h=x[o]).name)in d.map||("{$uid}"===(_=h.value)&&(_="mce_"+O++),d.map[a]=_,d.push({name:a,value:_}));if(C){for(o=C.length;o--&&!(C[o]in d.map););-1===o&&(f=!1)}if(h=d.map["data-mce-bogus"]){if("all"===h){R=Iv(U,e,S.lastIndex),S.lastIndex=R;continue}f=!1}}f&&q(n,d,c)}else f=!1;if(r=k[n]){r.lastIndex=R=t.index+t[0].length,(t=r.exec(e))?(f&&(i=e.substr(R,t.index-R)),R=t.index+t[0].length):(i=e.substr(R),R=e.length),f&&(0<i.length&&H(i,!0),$(n)),S.lastIndex=R;continue}c||(v&&v.indexOf("/")===v.length-1?f&&$(n):D.push({name:n,valid:f}))}else(n=t[1])?(">"===n.charAt(0)&&(n=" "+n),z.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),j(n)):(n=t[2])?V(Pv(n)):(n=t[3])?K(n):(n=t[4])&&W(n,t[5]);R=t.index+t[0].length}for(R<e.length&&H(B(e.substr(R))),o=D.length-1;0<=o;o--)(n=D[o]).valid&&$(n.name)}}}(Fv||(Fv={})).findEndTag=Iv;var Mv=Fv,zv=function(e,t){var n,r,o,i,a,u,s,c,l=t,f=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=l,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),l=s.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:Mv.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return wa(l)},Uv={trimExternal:zv,trimInternal:zv},jv=0,Vv=2,Hv=1,qv=function(g,p){var e=g.length+p.length+2,h=new Array(e),v=new Array(e),c=function(e,t,n,r,o){var i=l(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a<t||u<r;)a<t&&u<r&&g[a]===p[u]?(o.push([0,g[a]]),++a,++u):r-n<t-e?(o.push([2,g[a]]),++a):(o.push([1,p[u]]),++u);else{c(e,i.start,n,i.start-i.diag,o);for(var s=i.start;s<i.end;++s)o.push([0,g[s]]);c(i.end,t,i.end-i.diag,r,o)}},y=function(e,t,n,r){for(var o=e;o-t<r&&o<n&&g[o]===p[o-t];)++o;return{start:e,end:o,diag:t}},l=function(e,t,n,r){var o=t-e,i=r-n;if(0===o||0===i)return null;var a,u,s,c,l,f=o-i,d=i+o,m=(d%2==0?d:d+1)/2;for(h[1+m]=e,v[1+m]=t+1,a=0;a<=m;++a){for(u=-a;u<=a;u+=2){for(s=u+m,u===-a||u!==a&&h[s-1]<h[s+1]?h[s]=h[s+1]:h[s]=h[s-1]+1,l=(c=h[s])-e+n-u;c<t&&l<r&&g[c]===p[l];)h[s]=++c,++l;if(f%2!=0&&f-a<=u&&u<=f+a&&v[s-f]<=h[s])return y(v[s-f],u+e-n,t,r)}for(u=f-a;u<=f+a;u+=2){for(s=u+m-f,u===f-a||u!==f+a&&v[s+1]<=v[s-1]?v[s]=v[s+1]-1:v[s]=v[s-1],l=(c=v[s]-1)-e+n-u;e<=c&&n<=l&&g[c]===p[l];)v[s]=c--,l--;if(f%2==0&&-a<=u&&u<=a&&v[s]<=h[s+f])return y(v[s],u+e-n,t,r)}}},t=[];return c(0,g.length,0,p.length,t),t},$v=function(e){return jo.isElement(e)?e.outerHTML:jo.isText(e)?ti.encodeRaw(e.data,!1):jo.isComment(e)?"\x3c!--"+e.data+"--\x3e":""},Wv=function(e,t,n){var r=function(e){var t,n,r;for(r=V.document.createElement("div"),t=V.document.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o)}else e.appendChild(r)},Kv=function(e){return U(W(te(e.childNodes),$v),function(e){return 0<e.length})},Xv=function(e,t){var n,r,o,i=W(te(t.childNodes),$v);return n=qv(i,e),r=t,o=0,z(n,function(e){e[0]===jv?o++:e[0]===Hv?(Wv(r,e[1],o),o++):e[0]===Vv&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(r,o)}),t},Yv=Hi(_.none()),Gv=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},Jv=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},Qv=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},Zv=function(e){var t=ar.fromTag("body",Yv.get().getOrThunk(function(){var e=V.document.implementation.createHTMLDocument("undo");return Yv.set(_.some(e)),e}));return ya(t,Qv(e)),z(Qi(t,"*[data-mce-bogus]"),ji),t.dom().innerHTML},ey=function(n){var e,t,r;return e=Kv(n.getBody()),-1!==(t=(r=G(e,function(e){var t=Uv.trimInternal(n.serializer,e);return 0<t.length?[t]:[]})).join("")).indexOf("</iframe>")?Gv(r):Jv(t)},ty=function(e,t,n){"fragmented"===t.type?Xv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},ny=function(e,t){return!(!e||!t)&&(r=t,Qv(e)===Qv(r)||(n=t,Zv(e)===Zv(n)));var n,r};function ry(u){var s,r,o=this,c=0,l=[],t=0,f=function(){return 0===t},i=function(e){f()&&(o.typing=e)},d=function(e){u.setDirty(e)},a=function(e){i(!1),o.add({},e)},n=function(){o.typing&&(i(!1),o.add())};return u.on("init",function(){o.add()}),u.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(n(),o.beforeChange())}),u.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),u.on("ObjectResizeStart Cut",function(){o.beforeChange()}),u.on("SaveContent ObjectResized blur",a),u.on("DragEnd",a),u.on("KeyUp",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),u.nodeChanged()),46!==t&&8!==t||u.nodeChanged(),r&&o.typing&&!1===ny(ey(u),l[0])&&(!1===u.isDirty()&&(d(!0),u.fire("change",{level:l[0],lastLevel:null})),u.fire("TypingUndo"),r=!1,u.nodeChanged()))}),u.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)o.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20<t)||224===t||91===t||o.typing||n||(o.beforeChange(),i(!0),o.add({},e),r=!0)}}),u.on("MouseDown",function(e){o.typing&&a(e)}),u.on("input",function(e){var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data)&&a(e)}),u.addShortcut("meta+z","","Undo"),u.addShortcut("meta+y,meta+shift+z","","Redo"),u.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||u.nodeChanged()}),o={data:l,typing:!1,beforeChange:function(){f()&&(s=Yu.getUndoBookmark(u.selection))},add:function(e,t){var n,r,o,i=u.settings;if(o=ey(u),e=e||{},e=Xt.extend(e,o),!1===f()||u.removed)return null;if(r=l[c],u.fire("BeforeAddUndo",{level:e,lastLevel:r,originalEvent:t}).isDefaultPrevented())return null;if(r&&ny(r,e))return null;if(l[c]&&(l[c].beforeBookmark=s),i.custom_undo_redo_levels&&l.length>i.custom_undo_redo_levels){for(n=0;n<l.length-1;n++)l[n]=l[n+1];l.length--,c=l.length}e.bookmark=Yu.getUndoBookmark(u.selection),c<l.length-1&&(l.length=c+1),l.push(e),c=l.length-1;var a={level:e,lastLevel:r,originalEvent:t};return u.fire("AddUndo",a),0<c&&(d(!0),u.fire("change",a)),e},undo:function(){var e;return o.typing&&(o.add(),o.typing=!1,i(!1)),0<c&&(e=l[--c],ty(u,e,!0),d(!0),u.fire("undo",{level:e})),e},redo:function(){var e;return c<l.length-1&&(e=l[++c],ty(u,e,!1),d(!0),u.fire("redo",{level:e})),e},clear:function(){l=[],c=0,o.typing=!1,o.data=l,u.fire("ClearUndos")},hasUndo:function(){return 0<c||o.typing&&l[0]&&!ny(ey(u),l[0])},hasRedo:function(){return c<l.length-1&&!o.typing},transact:function(e){return n(),o.beforeChange(),o.ignore(e),o.add()},ignore:function(e){try{t++,e()}finally{t--}},extra:function(e,t){var n,r;o.transact(e)&&(r=l[c].bookmark,n=l[c-1],ty(u,n,!0),o.transact(t)&&(l[c-1].beforeBookmark=r))}}}var oy,iy,ay={},uy=Ht.filter,sy=Ht.each;iy=function(e){var t,n,r=e.selection.getRng();t=jo.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),sy(uy(uy(n,t),function(e){return t(e.previousSibling)&&-1!==Ht.indexOf(n,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,gn(n=e).remove(),gn(t).append("<br><br>").append(n.childNodes)}))},ay[oy="pre"]||(ay[oy]=[]),ay[oy].push(iy);var cy=function(e,t){sy(ay[e],function(e){e(t)})},ly=/^(src|href|style)$/,fy=Xt.each,dy=wc.isEq,my=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},gy=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],jo.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[i<o?i:o]),jo.isText(r)&&n&&o>=r.nodeValue.length&&(r=new go(r,e.getBody()).next()||r),jo.isText(r)&&!n&&0===o&&(r=new go(r,e.getBody()).prev()||r),r},py=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},hy=function(e,t,n,r,o){var i=ar.fromDom(t),a=ar.fromDom(e.create(r,o)),u=n?Wr(i):$r(i);return Mi(a,u),n?(Pi(i,a),Li(a,i)):(Ii(i,a),Fi(a,i)),a.dom()},vy=function(e,t,n,r){return!(t=wc.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},yy=function(e,n,r,o,i){var t,a,u,s,c,l,f,d,m,g,p,h,v,y,b=e.dom;if(c=b,!(dy(l=o,(f=n).inline)||dy(l,f.block)||(f.selector?jo.isElement(l)&&c.is(l,f.selector):void 0)||(s=o,n.links&&"A"===s.tagName)))return!1;if("all"!==n.remove)for(fy(n.styles,function(e,t){e=wc.normalizeStyleValue(b,wc.replaceVars(e,r),t),"number"==typeof t&&(t=e,i=0),(n.remove_similar||!i||dy(wc.getStyle(b,i,t),e))&&b.setStyle(o,t,""),u=1}),u&&""===b.getAttrib(o,"style")&&(o.removeAttribute("style"),o.removeAttribute("data-mce-style")),fy(n.attributes,function(e,t){var n;if(e=wc.replaceVars(e,r),"number"==typeof t&&(t=e,i=0),!i||dy(b.getAttrib(i,t),e)){if("class"===t&&(e=b.getAttrib(o,t))&&(n="",fy(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))return void b.setAttrib(o,t,n);"class"===t&&o.removeAttribute("className"),ly.test(t)&&o.removeAttribute("data-mce-"+t),o.removeAttribute(t)}}),fy(n.classes,function(e){e=wc.replaceVars(e,r),i&&!b.hasClass(i,e)||b.removeClass(o,e)}),a=b.getAttribs(o),t=0;t<a.length;t++){var C=a[t].nodeName;if(0!==C.indexOf("_")&&0!==C.indexOf("data-"))return!1}return"none"!==n.remove?(d=e,g=n,h=(m=o).parentNode,v=d.dom,y=d.settings.forced_root_block,g.block&&(y?h===v.getRoot()&&(g.list_block&&dy(m,g.list_block)||fy(Xt.grep(m.childNodes),function(e){wc.isValid(d,y,e.nodeName.toLowerCase())?p?p.appendChild(e):(p=py(v,e,y),v.setAttribs(p,d.settings.forced_root_block_attrs)):p=0})):v.isBlock(m)&&!v.isBlock(h)&&(vy(v,m,!1)||vy(v,m.firstChild,!0,1)||m.insertBefore(v.create("br"),m.firstChild),vy(v,m,!0)||vy(v,m.lastChild,!1,1)||m.appendChild(v.create("br")))),g.selector&&g.inline&&!dy(g.inline,m)||v.remove(m,1),!0):void 0},by=yy,Cy=function(s,c,l,e,f){var t,n,d=s.formatter.get(c),m=d[0],a=!0,u=s.dom,r=s.selection,i=function(e){var n,t,r,o,i,a,u=(n=s,t=e,r=c,o=l,i=f,fy(wc.getParents(n.dom,t.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=Mm.matchNode(n,e,r,o,i))&&!1!==t.split&&(a=e)}),a);return function(e,t,n,r,o,i,a,u){var s,c,l,f,d,m,g=e.dom;if(n){for(m=n.parentNode,s=r.parentNode;s&&s!==m;s=s.parentNode){for(c=g.clone(s,!1),d=0;d<t.length;d++)if(yy(e,t[d],u,c,c)){c=0;break}c&&(l&&c.appendChild(l),f||(f=c),l=c)}!i||a.mixed&&g.isBlock(n)||(r=g.split(n,r)),l&&(o.parentNode.insertBefore(l,o),f.appendChild(o))}return r}(s,d,u,e,e,!0,m,l)},g=function(e){var t,n,r,o,i;if(jo.isElement(e)&&u.getContentEditable(e)&&(o=a,a="true"===u.getContentEditable(e),i=!0),t=Xt.grep(e.childNodes),a&&!i)for(n=0,r=d.length;n<r&&!yy(s,d[n],l,e,e);n++);if(m.deep&&t.length){for(n=0,r=t.length;n<r;n++)g(t[n]);i&&(a=o)}},p=function(e){var t,n=u.get(e?"_start":"_end"),r=n[e?"firstChild":"lastChild"];return yc(t=r)&&jo.isElement(t)&&("_start"===t.id||"_end"===t.id)&&(r=r[e?"firstChild":"lastChild"]),jo.isText(r)&&0===r.data.length&&(r=e?n.previousSibling||n.nextSibling:n.nextSibling||n.previousSibling),u.remove(n,!0),r},o=function(e){var t,n,r=e.commonAncestorContainer;if(e=Pc(s,e,d,!0),m.split){if(e=Um(e),(t=gy(s,e,!0))!==(n=gy(s,e))){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"===t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&/^(TH|TD)$/.test(n.nodeName)&&n.firstChild&&(n=n.firstChild||n),my(u,t,n)){var o=_.from(t.firstChild).getOr(t);return i(hy(u,o,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void p(!0)}if(my(u,n,t))return o=_.from(n.lastChild).getOr(n),i(hy(u,o,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void p(!1);t=py(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),n=py(u,n,"span",{id:"_end","data-mce-type":"bookmark"}),i(t),i(n),t=p(!0),n=p()}else t=n=i(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=u.nodeIndex(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=u.nodeIndex(n)+1}Lc(u,e,function(e){fy(e,function(e){g(e),jo.isElement(e)&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===wc.getTextDecoration(u,e.parentNode)&&yy(s,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})};if(e)e.nodeType?((n=u.createRng()).setStartBefore(e),n.setEndAfter(e),o(n)):o(e);else if("false"!==u.getContentEditable(r.getNode()))r.isCollapsed()&&m.inline&&!u.select("td[data-mce-selected],th[data-mce-selected]").length?function(e,t,n,r){var o,i,a,u,s,c,l,f=e.dom,d=e.selection,m=[],g=d.getRng();for(o=g.startContainer,i=g.startOffset,3===(s=o).nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(Mm.matchNode(e,s,t,n,r)){c=s;break}s.nextSibling&&(u=!0),m.push(s),s=s.parentNode}if(c)if(u){a=d.getBookmark(),g.collapse(!0);var p=Pc(e,g,e.formatter.get(t),!0);p=Um(p),e.formatter.remove(t,n,p),d.moveToBookmark(a)}else{l=Qu(e.getBody(),c);var h=$m(!1).dom(),v=Gm(m,h);Xm(e,h,l||c),Wm(e,l,!1),d.setCursorLocation(v,1),f.isEmpty(c)&&f.remove(c)}}(s,c,l,f):(t=Yu.getPersistentBookmark(s.selection,!0),o(r.getRng()),r.moveToBookmark(t),m.inline&&Mm.match(s,c,l,r.getStart())&&wc.moveStart(u,r,r.getRng()),s.nodeChanged());else{e=r.getNode();for(var h=0,v=d.length;h<v&&(!d[h].ceFalseOverride||!yy(s,d[h],l,e,e));h++);}},xy=Xt.each,wy=function(e){return e&&1===e.nodeType&&!yc(e)&&!Ju(e)&&!jo.isBogus(e)},Ny=function(e,t){var n;for(n=e;n;n=n[t]){if(3===n.nodeType&&0!==n.nodeValue.length)return e;if(1===n.nodeType&&!yc(n))return n}return e},Ey=function(e,t,n){var r,o,i=new el(e);if(t&&n&&(t=Ny(t,"previousSibling"),n=Ny(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),Xt.each(Xt.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},Sy=function(e,t,n){xy(e.childNodes,function(e){wy(e)&&(t(e)&&n(e),e.hasChildNodes()&&Sy(e,t,n))})},Ty=function(n,e){return d(function(e,t){return!(!t||!wc.getStyle(n,t,e))},e)},ky=function(r,e,t){return d(function(e,t,n){r.setStyle(n,e,t),""===n.getAttribute("style")&&n.removeAttribute("style"),_y(r,n)},e,t)},_y=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},Ay=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=wc.getTextDecoration(e,t.parentNode),e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null))},Ry=function(n,e,r,o){xy(e,function(t){xy(n.dom.select(t.inline,o),function(e){wy(e)&&by(n,t,r,e,t.exact?e:null)}),function(r,e,t){if(e.clear_child_styles){var n=e.links?"*:not(a)":"*";xy(r.select(n,t),function(n){wy(n)&&xy(e.styles,function(e,t){r.setStyle(n,t,"")})})}}(n.dom,t,o)})},Dy=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(Xt.walk(r,d(Ay,e),"childNodes"),Ay(e,r))},Oy=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&Sy(r,Ty(e,"fontSize"),ky(e,"backgroundColor",wc.replaceVars(t.styles.backgroundColor,n)))},By=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(Sy(r,Ty(e,"fontSize"),ky(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},Py=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=Ey(e,wc.getNonWhiteSpaceSibling(r),r),r=Ey(e,r,wc.getNonWhiteSpaceSibling(r,!0)))},Iy=function(t,n,r,o,i){Mm.matchNode(t,i.parentNode,r,o)&&by(t,n,o,i)||n.merge_with_parents&&t.dom.getParent(i.parentNode,function(e){if(Mm.matchNode(t,e,r,o))return by(t,n,o,i),!0})},Ly=Xt.each,Fy=function(g,p,h,r){var e,t,v=g.formatter.get(p),y=v[0],o=!r&&g.selection.isCollapsed(),i=g.dom,n=g.selection,b=function(n,e){if(e=e||y,n){if(e.onformat&&e.onformat(n,e,h,r),Ly(e.styles,function(e,t){i.setStyle(n,t,wc.replaceVars(e,h))}),e.styles){var t=i.getAttrib(n,"style");t&&n.setAttribute("data-mce-style",t)}Ly(e.attributes,function(e,t){i.setAttrib(n,t,wc.replaceVars(e,h))}),Ly(e.classes,function(e){e=wc.replaceVars(e,h),i.hasClass(n,e)||i.addClass(n,e)})}},C=function(e,t){var n=!1;return!!y.selector&&(Ly(e,function(e){if(!("collapsed"in e&&e.collapsed!==o))return i.is(t,e.selector)&&!Ju(t)?(b(t,e),!(n=!0)):void 0}),n)},a=function(s,e,t,c){var l,f,d=[],m=!0;l=y.inline||y.block,f=s.create(l),b(f),Lc(s,e,function(e){var a,u=function(e){var t,n,r,o;if(o=m,t=e.nodeName.toLowerCase(),n=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&s.getContentEditable(e)&&(o=m,m="true"===s.getContentEditable(e),r=!0),wc.isEq(t,"br"))return a=0,void(y.block&&s.remove(e));if(y.wrapper&&Mm.matchNode(g,e,p,h))a=0;else{if(m&&!r&&y.block&&!y.wrapper&&wc.isTextBlock(g,t)&&wc.isValid(g,n,l))return e=s.rename(e,l),b(e),d.push(e),void(a=0);if(y.selector){var i=C(v,e);if(!y.inline||i)return void(a=0)}!m||r||!wc.isValid(g,l,t)||!wc.isValid(g,n,l)||!c&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||Ju(e)||y.inline&&s.isBlock(e)?(a=0,Ly(Xt.grep(e.childNodes),u),r&&(m=o),a=0):(a||(a=s.clone(f,!1),e.parentNode.insertBefore(a,e),d.push(a)),a.appendChild(e))}};Ly(e,u)}),!0===y.links&&Ly(d,function(e){var t=function(e){"A"===e.nodeName&&b(e,y),Ly(Xt.grep(e.childNodes),t)};t(e)}),Ly(d,function(e){var t,n,r,o,i,a=function(e){var n=!1;return Ly(e.childNodes,function(e){if((t=e)&&1===t.nodeType&&!yc(t)&&!Ju(t)&&!jo.isBogus(t))return n=e,!1;var t}),n};n=0,Ly(e.childNodes,function(e){wc.isWhiteSpaceNode(e)||yc(e)||n++}),t=n,!(1<d.length)&&s.isBlock(e)||0!==t?(y.inline||y.wrapper)&&(y.exact||1!==t||((o=a(r=e))&&!yc(o)&&Mm.matchName(s,o,y)&&(i=s.clone(o,!1),b(i),s.replace(i,r,!0),s.remove(o,1)),e=i||r),Ry(g,v,h,e),Iy(g,y,p,h,e),Oy(s,y,h,e),By(s,y,h,e),Py(s,y,h,e)):s.remove(e,1)})};if("false"!==i.getContentEditable(n.getNode())){if(y){if(r)r.nodeType?C(v,r)||((t=i.createRng()).setStartBefore(r),t.setEndAfter(r),a(i,Pc(g,t,v),0,!0)):a(i,r,0,!0);else if(o&&y.inline&&!i.select("td[data-mce-selected],th[data-mce-selected]").length)!function(e,t,n){var r,o,i,a,u,s,c=e.selection;a=(r=c.getRng(!0)).startOffset,s=r.startContainer.nodeValue,(o=Qu(e.getBody(),c.getStart()))&&(i=qm(o));var l,f,d=/[^\s\u00a0\u00ad\u200b\ufeff]/;s&&0<a&&a<s.length&&d.test(s.charAt(a))&&d.test(s.charAt(a-1))?(u=c.getBookmark(),r.collapse(!0),r=Pc(e,r,e.formatter.get(t)),r=Um(r),e.formatter.apply(t,n,r),c.moveToBookmark(u)):(o&&i.nodeValue===jm||(l=e.getDoc(),f=$m(!0).dom(),i=(o=l.importNode(f,!0)).firstChild,r.insertNode(o),a=1),e.formatter.apply(t,n,o),c.setCursorLocation(i,a))}(g,p,h);else{var u=g.selection.getNode();g.settings.forced_root_block||!v[0].defaultBlock||i.getParent(u,i.isBlock)||Fy(g,v[0].defaultBlock),g.selection.setRng(cl(g.selection.getRng())),e=Yu.getPersistentBookmark(g.selection,!0),a(i,Pc(g,n.getRng(),v)),y.styles&&Dy(i,y,h,u),n.moveToBookmark(e),wc.moveStart(i,n,n.getRng()),g.nodeChanged()}cy(p,g)}}else{r=n.getNode();for(var s=0,c=v.length;s<c;s++)if(v[s].ceFalseOverride&&i.is(r,v[s].selector))return void b(r,v[s])}},My={applyFormat:Fy},zy=Xt.each,Uy=function(e,t,n,r,o){var i,a,u,s,c,l,f,d;null===t.get()&&(a=e,u={},(i=t).set({}),a.on("NodeChange",function(n){var r=wc.getParents(a.dom,n.element),o={};r=Xt.grep(r,function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")}),zy(i.get(),function(e,n){zy(r,function(t){return a.formatter.matchNode(t,n,{},e.similar)?(u[n]||(zy(e,function(e){e(!0,{node:t,format:n,parents:r})}),u[n]=e),o[n]=e,!1):!Mm.matchesUnInheritedFormatSelector(a,t,n)&&void 0})}),zy(u,function(e,t){o[t]||(delete u[t],zy(e,function(e){e(!1,{node:n.element,format:t,parents:r})}))})})),c=n,l=r,f=o,d=(s=t).get(),zy(c.split(","),function(e){d[e]||(d[e]=[],d[e].similar=f),d[e].push(l)}),s.set(d)},jy={get:function(r){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,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(n,e,t){Xt.each(t,function(e,t){r.setAttrib(n,t,e)})}},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 Xt.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t}},Vy=Xt.each,Hy=Si.DOM,qy=function(e,t){var n,o,r,m=t&&t.schema||di({}),g=function(e){var t,n,r;return o="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=Hy.create(o.name),n=t,(r=o).classes.length&&Hy.addClass(n,r.classes.join(" ")),Hy.setAttribs(n,r.attrs),t},p=function(n,e,t){var r,o,i,a,u,s,c,l,f=0<e.length&&e[0],d=f&&f.name;if(u=d,s="string"!=typeof(a=n)?a.nodeName.toLowerCase():a,c=m.getElementRule(s),i=!(!(l=c&&c.parentsRequired)||!l.length)&&(u&&-1!==Xt.inArray(l,u)?u:l[0]))d===i?(o=e[0],e=e.slice(1)):o=i;else if(f)o=e[0],e=e.slice(1);else if(!t)return n;return o&&(r=g(o)).appendChild(n),t&&(r||(r=Hy.create("div")).appendChild(n),Xt.each(t,function(e){var t=g(e);r.insertBefore(t,n)})),p(r,e,o&&o.siblings)};return e&&e.length?(o=e[0],n=g(o),(r=Hy.create("div")).appendChild(p(n,e.slice(1),o.siblings)),r):""},$y=function(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=Xt.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,o){switch(t){case"#":a.attrs.id=n;break;case".":a.classes.push(n);break;case":":-1!==Xt.inArray("checked disabled enabled read-only required".split(" "),n)&&(a.attrs[n]=n)}if("["===r){var i=o.match(/([\w\-]+)(?:\=\"([^\"]+))?/);i&&(a.attrs[i[1]]=i[2])}return""})),a.name=t||"div",a},Wy=function(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Xt.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Xt.map(e.split(/(?:~\+|~|\+)/),$y),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},Ky=function(n,e){var t,r,o,i,a,u,s="";if(!1===(u=n.settings.preview_styles))return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var c=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}return"preview"in e&&!1===(u=e.preview)?"":(t=e.block||e.inline||"span",(i=Wy(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,r=qy(i,n)):r=qy([t],n),o=Hy.select(t,r)[0]||r.firstChild,Vy(e.styles,function(e,t){(e=c(e))&&Hy.setStyle(o,t,e)}),Vy(e.attributes,function(e,t){(e=c(e))&&Hy.setAttrib(o,t,e)}),Vy(e.classes,function(e){e=c(e),Hy.hasClass(o,e)||Hy.addClass(o,e)}),n.fire("PreviewFormats"),Hy.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=Hy.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,Vy(u.split(" "),function(e){var t=Hy.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=Hy.getStyle(n.getBody(),e,!0),"#ffffff"===Hy.toHex(t).toLowerCase())||"color"===e&&"#000000"===Hy.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),Hy.remove(r),s)},Xy=function(e,t,n,r,o){var i=t.get(n);!Mm.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?My.applyFormat(e,n,r,o):Cy(e,n,r,o)},Yy=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])};function Gy(e){var t,n,r,o=(t=e,n={},(r=function(e,t){e&&("string"!=typeof e?Xt.each(e,function(e,t){r(t,e)}):(t=t.length?t:[t],Xt.each(t,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),n[e]=t))})(jy.get(t.dom)),r(t.settings.formats),{get:function(e){return e?n[e]:n},register:r,unregister:function(e){return e&&n[e]&&delete n[e],n}}),i=Hi(null);return Yy(e),Jm(e),{get:o.get,register:o.register,unregister:o.unregister,apply:d(My.applyFormat,e),remove:d(Cy,e),toggle:d(Xy,e,o),match:d(Mm.match,e),matchAll:d(Mm.matchAll,e),matchNode:d(Mm.matchNode,e),canApply:d(Mm.canApply,e),formatChanged:d(Uy,e,i),getCssText:d(Ky,e)}}var Jy,Qy=Object.prototype.hasOwnProperty,Zy=(Jy=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Qy.call(o,i)&&(n[i]=Jy(n[i],o[i]))}return n}),eb={register:function(t,s,c){t.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)(n=e[r]).attr("tabindex",n.attributes.map["data-mce-tabindex"]),n.attr(t,null)}),t.addAttributeFilter("src,href,style",function(e,t){for(var n,r,o=e.length,i="data-mce-"+t,a=s.url_converter,u=s.url_converter_scope;o--;)(r=(n=e[o]).attributes.map[i])!==undefined?(n.attr(t,0<r.length?r:null),n.attr(i,null)):(r=n.attributes.map[t],"style"===t?r=c.serializeStyle(c.parseStyle(r),n.name):a&&(r=a.call(u,r,t,n.name)),n.attr(t,0<r.length?r:null))}),t.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",0<n.length?n:null))}),t.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attributes.map["data-mce-type"]||n.cleanup||(_.from(r.firstChild).exists(function(e){return!Ca(e.value)})?r.unwrap():r.remove())}),t.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=ti.decode(t.value))}),t.addNodeFilter("script,style",function(e,t){for(var n,r,o,i=e.length,a=function(e){return e.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,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="// <![CDATA[\n"+a(r)+"\n// ]]>")):"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="\x3c!--\n"+a(r)+"\n--\x3e")}),t.addNodeFilter("#comment",function(e){for(var t,n=e.length;n--;)0===(t=e[n]).value.indexOf("[CDATA[")?(t.name="#cdata",t.type=4,t.value=t.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===t.value.indexOf("mce:protected ")&&(t.name="#text",t.type=3,t.raw=!0,t.value=unescape(t.value).substr(14))}),t.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||"type"in n.attributes.map||n.attr("type","text"))}),t.addAttributeFilter("data-mce-type",function(e){z(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",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})},trimTrailingBr:function(e){var t,n,r=function(e){return e&&"br"===e.name};r(t=e.lastChild)&&r(n=t.prev)&&(t.remove(),n.remove())}},tb={process:function(e,t,n){return f=n,(l=e)&&l.hasEventListeners("PreProcess")&&!f.no_events?(o=t,i=n,c=(r=e).dom,o=o.cloneNode(!0),(a=V.document.implementation).createHTMLDocument&&(u=a.createHTMLDocument(""),Xt.each("BODY"===o.nodeName?o.childNodes:[o],function(e){u.body.appendChild(u.importNode(e,!0))}),o="BODY"!==o.nodeName?u.body.firstChild:u.body,s=c.doc,c.doc=u),xp(r,Zy(i,{node:o})),s&&(c.doc=s),o):t;var r,o,i,a,u,s,c,l,f}},nb=function(e,a,u){e.addNodeFilter("font",function(e){z(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,z(["color","face","size"],function(e){t.attr(e,null)})})})},rb=function(e,t){var n,r=gi();t.convert_fonts_to_spans&&nb(e,r,Xt.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){z(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},ob={register:function(e,t){t.inline_styles&&rb(e,t)}},ib=/^[ \t\r\n]*$/,ab={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},ub=function(e,t,n){var r,o,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i])return e[i];if(e!==t){if(r=e[a])return r;for(o=e.parent;o&&o!==t;o=o.parent)if(r=o[a])return r}},sb=function(){function a(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}return a.create=function(e,t){var n,r;if(n=new a(e,ab[e]||1),t)for(r in t)n.attr(r,t[r]);return n},a.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},a.prototype.attr=function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(t!==undefined){if(null===t){if(e in n.map)for(delete n.map[e],r=n.length;r--;)if(n[r].name===e)return n=n.splice(r,1),this;return this}if(e in n.map){for(r=n.length;r--;)if(n[r].name===e){n[r].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,this}return n.map[e]}},a.prototype.clone=function(){var e,t,n,r,o,i=new a(this.name,this.type);if(n=this.attributes){for((o=[]).map={},e=0,t=n.length;e<t;e++)"id"!==(r=n[e]).name&&(o[o.length]={name:r.name,value:r.value},o.map[r.name]=r.value);i.attributes=o}return i.value=this.value,i.shortEnded=this.shortEnded,i},a.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},a.prototype.unwrap=function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},a.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},a.prototype.append=function(e){var t;return e.parent&&e.remove(),(t=this.lastChild)?((t.next=e).prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},a.prototype.insert=function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},a.prototype.getAll=function(e){var t,n=[];for(t=this.firstChild;t;t=ub(t,this))t.name===e&&n.push(t);return n},a.prototype.empty=function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=ub(n,this))e.push(n);for(t=e.length;t--;)(n=e[t]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return this.firstChild=this.lastChild=null,this},a.prototype.isEmpty=function(e,t,n){var r,o,i=this.firstChild;if(t=t||{},i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(e[i.name])return!1;for(r=i.attributes.length;r--;)if("name"===(o=i.attributes[r].name)||0===o.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!ib.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&ib.test(i.value))return!1;if(n&&n(i))return!1}while(i=ub(i,this));return!0},a.prototype.walk=function(e){return ub(this,null,e)},a}(),cb=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new sb("br",1)).shortEnded=!0:r.empty().append(new sb("#text",3)).value="\xa0"},lb=function(e){return fb(e,"#text")&&"\xa0"===e.firstChild.value},fb=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},db=function(r,e,t,n){return n.isEmpty(e,t,function(e){return t=e,(n=r.getElementRule(t.name))&&n.paddEmpty;var t,n})},mb=function(e,t){return e&&(t[e.name]||"br"===e.name)},gb=function(e,p){var h=e.schema;p.remove_trailing_brs&&e.addNodeFilter("br",function(e,t,n){var r,o,i,a,u,s,c,l,f=e.length,d=Xt.extend({},h.getBlockElements()),m=h.getNonEmptyElements(),g=h.getWhiteSpaceElements();for(d.body=1,r=0;r<f;r++)if(i=(o=e[r]).parent,d[o.parent.name]&&o===i.lastChild){for(u=o.prev;u;){if("span"!==(s=u.name)||"bookmark"!==u.attr("data-mce-type")){if("br"!==s)break;if("br"===s){o=null;break}}u=u.prev}o&&(o.remove(),db(h,m,g,i)&&(c=h.getElementRule(i.name))&&(c.removeEmpty?i.remove():c.paddEmpty&&cb(p,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==p.padd_empty_with_br&&((l=new sb("#text",3)).value="\xa0",o.replace(l))}}),e.addAttributeFilter("href",function(e){var t,n,r,o=e.length;if(!p.allow_unsafe_link_target)for(;o--;)"a"===(t=e[o]).name&&"_blank"===t.attr("target")&&t.attr("rel",(n=t.attr("rel"),r=n?Xt.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}),p.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);}),p.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new sb("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),p.validate&&h.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t,n,r,o,i,a,u,s=e.length,c=h.getValidClasses();s--;){for(n=(t=e[s]).attr("class").split(" "),i="",r=0;r<n.length;r++)o=n[r],u=!1,(a=c["*"])&&a[o]&&(u=!0),a=c[t.name],!u&&a&&a[o]&&(u=!0),u&&(i&&(i+=" "),i+=o);i.length||(i=null),t.attr("class",i)}})},pb=Xt.makeMap,hb=Xt.each,vb=Xt.explode,yb=Xt.extend;function bb(T,k){void 0===k&&(k=di());var _={},A=[],R={},D={};(T=T||{}).validate=!("validate"in T)||T.validate,T.root_name=T.root_name||"body";var O=function(e){var t,n,r;(n=e.name)in _&&((r=R[n])?r.push(e):R[n]=[e]),t=A.length;for(;t--;)(n=A[t].name)in e.attributes.map&&((r=D[n])?r.push(e):D[n]=[e]);return e},e={schema:k,addAttributeFilter:function(e,n){hb(vb(e),function(e){var t;for(t=0;t<A.length;t++)if(A[t].name===e)return void A[t].callbacks.push(n);A.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(A)},addNodeFilter:function(e,n){hb(vb(e),function(e){var t=_[e];t||(_[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e=[];for(var t in _)_.hasOwnProperty(t)&&e.push({name:t,callbacks:_[t]});return e},filterNode:O,parse:function(e,a){var t,n,r,o,i,u,s,c,l,f,d,m=[];a=a||{},R={},D={},l=yb(pb("script,style,head,html,body,title,meta,param"),k.getBlockElements());var g=k.getNonEmptyElements(),p=k.children,h=T.validate,v="forced_root_block"in a?a.forced_root_block:T.forced_root_block,y=k.getWhiteSpaceElements(),b=/^[ \t\r\n]+/,C=/[ \t\r\n]+$/,x=/[ \t\r\n]+/g,w=/^[ \t\r\n]+$/;f=y.hasOwnProperty(a.context)||y.hasOwnProperty(T.root_name);var N=function(e,t){var n,r=new sb(e,t);return e in _&&((n=R[e])?n.push(r):R[e]=[r]),r},E=function(e){var t,n,r,o,i=k.getBlockElements();for(t=e.prev;t&&3===t.type;){if(0<(r=t.value.replace(C,"")).length)return void(t.value=r);if(n=t.next){if(3===n.type&&n.value.length){t=t.prev;continue}if(!i[n.name]&&"script"!==n.name&&"style"!==n.name){t=t.prev;continue}}o=t.prev,t.remove(),t=o}};t=Mv({validate:h,allow_script_urls:T.allow_script_urls,allow_conditional_comments:T.allow_conditional_comments,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(k.getSelfClosingElements()),cdata:function(e){d.append(N("#cdata",4)).value=e},text:function(e,t){var n;f||(e=e.replace(x," "),mb(d.lastChild,l)&&(e=e.replace(b,""))),0!==e.length&&((n=N("#text",3)).raw=!!t,d.append(n).value=e)},comment:function(e){d.append(N("#comment",8)).value=e},pi:function(e,t){d.append(N(e,7)).value=t,E(d)},doctype:function(e){d.append(N("#doctype",10)).value=e,E(d)},start:function(e,t,n){var r,o,i,a,u;if(i=h?k.getElementRule(e):{}){for((r=N(i.outputName||e,1)).attributes=t,r.shortEnded=n,d.append(r),(u=p[d.name])&&p[r.name]&&!u[r.name]&&m.push(r),o=A.length;o--;)(a=A[o].name)in t.map&&((s=D[a])?s.push(r):D[a]=[r]);l[e]&&E(r),n||(d=r),!f&&y[e]&&(f=!0)}},end:function(e){var t,n,r,o,i;if(n=h?k.getElementRule(e):{}){if(l[e]&&!f){if((t=d.firstChild)&&3===t.type)if(0<(r=t.value.replace(b,"")).length)t.value=r,t=t.next;else for(o=t.next,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.next,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o;if((t=d.lastChild)&&3===t.type)if(0<(r=t.value.replace(C,"")).length)t.value=r,t=t.prev;else for(o=t.prev,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.prev,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o}if(f&&y[e]&&(f=!1),n.removeEmpty&&db(k,g,y,d)&&!d.attributes.map.name&&!d.attr("id"))return i=d.parent,l[d.name]?d.empty().remove():d.unwrap(),void(d=i);n.paddEmpty&&(lb(d)||db(k,g,y,d))&&cb(T,a,l,d),d=d.parent}}},k);var S=d=new sb(a.context||T.root_name,11);if(t.parse(e),h&&m.length&&(a.context?a.invalid=!0:function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h;for(d=pb("tr,td,th,tbody,thead,tfoot,table"),l=k.getNonEmptyElements(),f=k.getWhiteSpaceElements(),m=k.getTextBlockElements(),g=k.getSpecialElements(),t=0;t<e.length;t++)if((n=e[t]).parent&&!n.fixed)if(m[n.name]&&"li"===n.parent.name){for(p=n.next;p&&m[p.name];)p.name="li",p.fixed=!0,n.parent.insert(p,n.parent),p=p.next;n.unwrap(n)}else{for(o=[n],r=n.parent;r&&!k.isValidChild(r.name,n.name)&&!d[r.name];r=r.parent)o.push(r);if(r&&1<o.length){for(o.reverse(),i=a=O(o[0].clone()),c=0;c<o.length-1;c++){for(k.isValidChild(a.name,o[c].name)?(u=O(o[c].clone()),a.append(u)):u=a,s=o[c].firstChild;s&&s!==o[c+1];)h=s.next,u.append(s),s=h;a=u}db(k,l,f,i)?r.insert(n,o[0],!0):(r.insert(i,o[0],!0),r.insert(n,i)),r=o[0],(db(k,l,f,r)||fb(r,"br"))&&r.empty().remove()}else if(n.parent){if("li"===n.name){if((p=n.prev)&&("ul"===p.name||"ul"===p.name)){p.append(n);continue}if((p=n.next)&&("ul"===p.name||"ul"===p.name)){p.insert(n,p.firstChild,!0);continue}n.wrap(O(new sb("ul",1)));continue}k.isValidChild(n.parent.name,"div")&&k.isValidChild("div",n.name)?n.wrap(O(new sb("div",1))):g[n.name]?n.empty().remove():n.unwrap()}}}(m)),v&&("body"===S.name||a.isRootContent)&&function(){var e,t,n=S.firstChild,r=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(b,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(C,"")))};if(k.isValidChild(S.name,v.toLowerCase())){for(;n;)e=n.next,3===n.type||1===n.type&&"p"!==n.name&&!l[n.name]&&!n.attr("data-mce-type")?(t||((t=N(v,1)).attr(T.forced_root_block_attrs),S.insert(t,n)),t.append(n)):(r(t),t=null),n=e;r(t)}}(),!a.invalid){for(c in R){for(s=_[c],i=(n=R[c]).length;i--;)n[i].parent||n.splice(i,1);for(r=0,o=s.length;r<o;r++)s[r](n,c,a)}for(r=0,o=A.length;r<o;r++)if((s=A[r]).name in D){for(i=(n=D[s.name]).length;i--;)n[i].parent||n.splice(i,1);for(i=0,u=s.callbacks.length;i<u;i++)s.callbacks[i](n,s.name,a)}}return S}};return gb(e,T),ob.register(e,T),e}var Cb=function(e,t,n){-1===Xt.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},xb=function(e,t,n){var r=wa(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||Ao(ar.fromDom(t))?r:Xt.trim(r)},wb=function(e,t,n){var r=n.selection?Zy({forced_root_block:!1},n):n,o=e.parse(t,r);return eb.trimTrailingBr(o),o},Nb=function(e,t,n,r,o){var i,a,u,s,c=(i=r,al(t,n).serialize(i));return a=e,s=c,!(u=o).no_events&&a?wp(a,Zy(u,{content:s})).content:s};function Eb(e,t){var a,u,s,c,l,n,r=(a=e,n=["data-mce-selected"],s=(u=t)&&u.dom?u.dom:Si.DOM,c=u&&u.schema?u.schema:di(a),a.entity_encoding=a.entity_encoding||"named",a.remove_trailing_brs=!("remove_trailing_brs"in a)||a.remove_trailing_brs,l=bb(a,c),eb.register(l,a,s),{schema:c,addNodeFilter:l.addNodeFilter,addAttributeFilter:l.addAttributeFilter,serialize:function(e,t){var n=Zy({format:"html"},t||{}),r=tb.process(u,e,n),o=xb(s,r,n),i=wb(l,o,n);return"tree"===n.format?i:Nb(u,a,c,i,n)},addRules:function(e){c.addValidElements(e)},setRules:function(e){c.setValidElements(e)},addTempAttr:d(Cb,l,n),getTempAttrs:function(){return n}});return{schema:r.schema,addNodeFilter:r.addNodeFilter,addAttributeFilter:r.addAttributeFilter,serialize:r.serialize,addRules:r.addRules,setRules:r.setRules,addTempAttr:r.addTempAttr,getTempAttrs:r.getTempAttrs}}function Sb(e){return{getBookmark:d(hc,e),moveToBookmark:d(vc,e)}}(Sb||(Sb={})).isBookmarkNode=yc;var Tb,kb,_b=Sb,Ab=jo.isContentEditableFalse,Rb=jo.isContentEditableTrue,Db=function(r,a){var u,s,c,l,f,d,m,g,p,h,v,y,i,b,C,x,w,N=a.dom,E=Xt.each,S=a.getDoc(),T=V.document,k=Math.abs,_=Math.round,A=a.getBody();l={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var e=".mce-content-body";a.contentStyles.push(e+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: content-box;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+e+" .mce-resizehandle:hover {background: #000}"+e+" img[data-mce-selected],"+e+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+e+" .mce-clonedresizable {position: absolute;"+(fe.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+e+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");var R=function(e){return e&&("IMG"===e.nodeName||a.dom.is(e,"figure.image"))},n=function(e){var t,n,r=e.target;t=e,n=a.selection.getRng(),!R(t.target)||yv(t.clientX,t.clientY,n)||e.isDefaultPrevented()||a.selection.select(r)},D=function(e){return a.dom.is(e,"figure.image")?e.querySelector("img"):e},O=function(e){var t=a.settings.object_resizing;return!1!==t&&!fe.iOS&&("string"!=typeof t&&(t="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==a.getBody()&&Lr(ar.fromDom(e),t))},B=function(e){var t,n,r,o;t=e.screenX-d,n=e.screenY-m,b=t*f[2]+h,C=n*f[3]+v,b=b<5?5:b,C=C<5?5:C,(R(u)&&!1!==a.settings.resize_img_proportional?!rv.modifierPressed(e):rv.modifierPressed(e)||R(u)&&f[2]*f[3]!=0)&&(k(t)>k(n)?(C=_(b*y),b=_(C/y)):(b=_(C/y),C=_(b*y))),N.setStyles(D(s),{width:b,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=b+" × "+C,f[2]<0&&s.clientWidth<=b&&N.setStyle(s,"left",g+(h-b)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",p+(v-C)),(t=A.scrollWidth-x)+(n=A.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(Tp(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(D(u),e,t):N.setAttrib(D(u),e,t))};e("width",b),e("height",C),N.unbind(S,"mousemove",B),N.unbind(S,"mouseup",P),T!==S&&(N.unbind(T,"mousemove",B),N.unbind(T,"mouseup",P)),N.remove(s),N.remove(c),o(u),kp(a,u,b,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;I(),M(),t=N.getPos(e,A),g=t.x,p=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,b=C=0),n=a.fire("ObjectSelected",{target:e}),O(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(A,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===fe.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=D(u).clientWidth,v=D(u).clientHeight,y=v/h,(f=n).startPos={x:r*n[0]+g,y:o*n[1]+p},x=A.scrollWidth,w=A.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:g,top:p,margin:0}),s.removeAttribute("data-mce-selected"),A.appendChild(s),N.bind(S,"mousemove",B),N.bind(S,"mouseup",P),T!==S&&(N.bind(T,"mousemove",B),N.bind(T,"mouseup",P)),c=N.add(A,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" × "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+p-t.offsetHeight/2})}):I(),u.setAttribute("data-mce-selected","1")},I=function(){var e,t;for(e in M(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},L=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],A)&&(z(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):I())},F=function(e){return Ab(function(e,t){for(;t&&t!==e;){if(Rb(t)||Ab(t))return t;t=t.parentNode}return null}(a.getBody(),e))},M=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},z=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){z(),fe.ie&&11<=fe.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||F(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(A,"mscontrolselect",function(e){var t=function(e){he.setEditorTimeout(a,function(){a.selection.select(e)})};if(F(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=he.throttle(function(e){a.composing||L(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",I),a.on("contextmenu",n)}),a.on("remove",M),{isResizable:O,showResizeRect:o,hideResizeRect:I,updateResizeRect:L,destroy:function(){u=s=null}}},Ob=function(e){return jo.isContentEditableTrue(e)||jo.isContentEditableFalse(e)},Bb=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=Xt.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,jo.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Ob))?null:i}return r},Pb=function(n,e){return W(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},Ib=function(e,t){var n=(t||V.document).createDocumentFragment();return z(e,function(e){n.appendChild(e.dom())}),ar.fromDom(n)},Lb=Ar("element","width","rows"),Fb=Ar("element","cells"),Mb=Ar("x","y"),zb=function(e,t){var n=parseInt(Er(e,t),10);return isNaN(n)?1:n},Ub=function(e){return j(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},jb=function(e,t){for(var n=e.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Mr(o[i],t))return _.some(Mb(i,r));return _.none()},Vb=function(e,t,n,r,o){for(var i=[],a=e.rows(),u=n;u<=o;u++){var s=a[u].cells(),c=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(Fb(a[u].element(),c))}return i},Hb=function(e){var o=Lb(ha(e),0,[]);return z(Qi(e,"tr"),function(n,r){z(Qi(n,"td,th"),function(e,t){!function(e,t,n,r,o){for(var i=zb(o,"rowspan"),a=zb(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=Fb(va(r),[]));for(var c=t;c<t+a;c++)u[s].cells()[c]=s===n&&c===t?o:ha(o)}}(o,function(e,t,n){for(;r=t,o=n,i=void 0,((i=e.rows())[o]?i[o].cells():[])[r];)t++;var r,o,i;return t}(o,t,r),r,n,e)})}),Lb(o.element(),Ub(o.rows()),o.rows())},qb=function(e){return n=W((t=e).rows(),function(e){var t=W(e.cells(),function(e){var t=va(e);return Sr(t,"colspan"),Sr(t,"rowspan"),t}),n=ha(e.element());return Mi(n,t),n}),r=ha(t.element()),o=ar.fromTag("tbody"),Mi(o,n),Fi(r,o),r;var t,n,r,o},$b=function(l,e,t){return jb(l,e).bind(function(c){return jb(l,t).map(function(e){return t=l,r=e,o=(n=c).x(),i=n.y(),a=r.x(),u=r.y(),s=i<u?Vb(t,o,i,a,u):Vb(t,o,u,a,i),Lb(t.element(),Ub(s),s);var t,n,r,o,i,a,u,s})})},Wb=function(n,t){return X(n,function(e){return"li"===lr(e)&&Jh(e,t)}).fold(q([]),function(e){return(t=n,X(t,function(e){return"ul"===lr(e)||"ol"===lr(e)})).map(function(e){return[ar.fromTag("li"),ar.fromTag(lr(e))]}).getOr([]);var t})},Kb=function(e,t){var n,r=ar.fromDom(t.commonAncestorContainer),o=uf(r,e),i=U(o,function(e){return xo(e)||bo(e)}),a=Wb(o,t),u=i.concat(a.length?a:So(n=r)?Vr(n).filter(Eo).fold(q([]),function(e){return[n,e]}):Eo(n)?[n]:[]);return W(u,ha)},Xb=function(){return Ib([])},Yb=function(e,t){return n=ar.fromDom(t.cloneContents()),r=Kb(e,t),o=j(r,function(e,t){return Fi(t,e),t},n),0<r.length?Ib([o]):o;var n,r,o},Gb=function(e,o){return(t=e,n=o[0],ra(n,"table",d(Mr,t))).bind(function(e){var t=o[0],n=o[o.length-1],r=Hb(e);return $b(r,t,n).map(function(e){return Ib([qb(e)])})}).getOrThunk(Xb);var t,n},Jb=function(e,t){var n,r,o=Cm(t,e);return 0<o.length?Gb(e,o):(n=e,0<(r=t).length&&r[0].collapsed?Xb():Yb(n,r[0]))},Qb=function(e,t){if(void 0===t&&(t={}),t.get=!0,t.format=t.format||"html",t.selection=!0,(t=e.fire("BeforeGetContent",t)).isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return c=e,_.from(c.selection.getRng()).map(function(e){var t=c.dom.add(c.getBody(),"div",{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},e.cloneContents()),n=wa(t.innerText);return c.dom.remove(t),n}).getOr("");t.getInner=!0;var n,r,o,i,a,u,s,c,l=(r=t,i=(n=e).selection.getRng(),a=n.dom.create("body"),u=n.selection.getSel(),s=Pb(n,gm(u)),(o=r.contextual?Jb(ar.fromDom(n.getBody()),s).dom():i.cloneContents())&&a.appendChild(o),n.selection.serializer.serialize(a,r));return"tree"===t.format?l:(t.content=e.selection.isCollapsed()?"":l,e.fire("GetContent",t),t.content)},Zb=function(e,t,n){var r,o,i,a,u=(r=t,ma(ma({format:"html"},n),{set:!0,selection:!0,content:r})),s=e.selection.getRng(),c=e.getDoc();if(u.no_events||!(u=e.fire("BeforeSetContent",u)).isDefaultPrevented()){if(t=function(e,t){if("raw"!==t.format){var n=e.parser.parse(t.content,ma({isRootContent:!0,forced_root_block:!1},t));return al({validate:e.validate},e.schema).serialize(n)}return t.content}(e,u),s.insertNode){t+='<span id="__caret">_</span>',s.startContainer===c&&s.endContainer===c?c.body.innerHTML=t:(s.deleteContents(),0===c.body.childNodes.length?c.body.innerHTML=t:s.createContextualFragment?s.insertNode(s.createContextualFragment(t)):(i=c.createDocumentFragment(),a=c.createElement("div"),i.appendChild(a),a.outerHTML=t,s.insertNode(i))),o=e.dom.get("__caret"),(s=c.createRange()).setStartBefore(o),s.setEndBefore(o),e.selection.setRng(s),e.dom.remove("__caret");try{e.selection.setRng(s)}catch(f){}}else{var l=s;l.item&&(c.execCommand("Delete",!1,null),l=e.selection.getRng()),/^\s+/.test(t)?(l.pasteHTML('<span id="__mce_tmp">_</span>'+t),e.dom.remove("__mce_tmp")):l.pasteHTML(t)}u.no_events||e.fire("SetContent",u)}else e.fire("SetContent",u)},eC=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return _.from(i).map(ar.fromDom).map(function(e){return r&&t.collapsed?e:Xr(e,o(e,a)).getOr(e)}).bind(function(e){return dr(e)?_.some(e):Vr(e)}).map(function(e){return e.dom()}).getOr(e)},tC=function(e,t,n){return eC(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},nC=function(e,t,n){return eC(e,t,!1,n,function(e,t){return 0<t?t-1:t})},rC=function(e,t){for(var n=e;e&&jo.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},oC=Xt.each,iC=function(e){return!!e.select},aC=function(e){return!(!e||!e.ownerDocument)&&zr(ar.fromDom(e.ownerDocument),ar.fromDom(e))},uC=function(u,s,e,c){var n,t,l,f,a,r=function(e,t){return Zb(c,e,t)},o=function(e){var t=m();t.collapse(!!e),i(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},m=function(){var e,t,n,r,o=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;if(null==(r=s.document))return null;if(c.bookmark!==undefined&&!1===sh(c)){var i=up(c);if(i.isSome())return i.map(function(e){return Pb(c,[e])[0]}).getOr(r.createRange())}try{(e=d())&&!jo.isRestrictedNode(e.anchorNode)&&(t=0<e.rangeCount?e.getRangeAt(0):e.createRange?e.createRange():r.createRange())}catch(a){}return(t=Pb(c,[t])[0])||(t=r.createRange?r.createRange():r.body.createTextRange()),t.setStart&&9===t.startContainer.nodeType&&t.collapsed&&(n=u.getRoot(),t.setStart(n,0),t.setEnd(n,0)),l&&f&&(0===o(t.START_TO_START,t,l)&&0===o(t.END_TO_END,t,l)?t=f:f=l=null),t},i=function(e,t){var n,r;if((o=e)&&(iC(o)||aC(o.startContainer)&&aC(o.endContainer))){var o,i=iC(e)?e:null;if(i){f=null;try{i.select()}catch(a){}}else{if(n=d(),e=c.fire("SetSelectionRange",{range:e,forward:t}).range,n){f=e;try{n.removeAllRanges(),n.addRange(e)}catch(a){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),l=0<n.rangeCount?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||fe.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(r=e.startContainer.childNodes[e.startOffset])&&"IMG"===r.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(r,0,r,1)),c.fire("AfterSetSelectionRange",{range:e,forward:t})}}},g=function(){var e,t,n=d();return!(n&&n.anchorNode&&n.focusNode)||((e=u.createRng()).setStart(n.anchorNode,n.anchorOffset),e.collapse(!0),(t=u.createRng()).setStart(n.focusNode,n.focusOffset),t.collapse(!0),e.compareBoundaryPoints(e.START_TO_START,t)<=0)},p={bookmarkManager:null,controlSelection:null,dom:u,win:s,serializer:e,editor:c,collapse:o,setCursorLocation:function(e,t){var n=u.createRng();e?(n.setStart(e,t),n.setEnd(e,t),i(n),o(!1)):(Qh(u,n,c.getBody(),!0),i(n))},getContent:function(e){return Qb(c,e)},setContent:r,getBookmark:function(e,t){return n.getBookmark(e,t)},moveToBookmark:function(e){return n.moveToBookmark(e)},select:function(e,t){var r,n,o;return(r=u,n=e,o=t,_.from(n).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(Qh(r,n,e,!0),Qh(r,n,e,!1)),n})).each(i),e},isCollapsed:function(){var e=m(),t=d();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:g,setNode:function(e){return r(u.getOuterHTML(e)),e},getNode:function(){return e=c.getBody(),(t=m())?(r=t.startContainer,o=t.endContainer,i=t.startOffset,a=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?rC(r.nextSibling,!0):r.parentNode,o=0===a?rC(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n):e;var e,t,n,r,o,i,a},getSel:d,setRng:i,getRng:m,getStart:function(e){return tC(c.getBody(),m(),e)},getEnd:function(e){return nC(c.getBody(),m(),e)},getSelectedBlocks:function(e,t){return function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||tC(i,t,t.collapsed),e.isBlock),r=e.getParent(r||nC(i,t,t.collapsed),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r)for(var u=new go(o=n,i);(o=u.next())&&o!==r;)e.isBlock(o)&&a.push(o);return r&&n!==r&&r!==i&&a.push(r),a}(u,m(),e,t)},normalize:function(){var e=m(),t=d();if(!hm(t)&&Zh(c)){var n=Dg(u,e);return n.each(function(e){i(e,g())}),n.getOr(e)}return e},selectorChanged:function(e,t){var i;return a||(a={},i={},c.on("NodeChange",function(e){var n=e.element,r=u.getParents(n,null,u.getRoot()),o={};oC(a,function(e,n){oC(r,function(t){if(u.is(t,n))return i[n]||(oC(e,function(e){e(!0,{node:t,selector:n,parents:r})}),i[n]=e),o[n]=e,!1})}),oC(i,function(e,t){o[t]||(delete i[t],oC(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),p},getScrollContainer:function(){for(var e,t=u.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return og(c,e,t)},placeCaretAt:function(e,t){return i(Bb(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?_u.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=_b(p),t=Db(p,c),p.bookmarkManager=n,p.controlSelection=t,p};(kb=Tb||(Tb={}))[kb.Br=0]="Br",kb[kb.Block=1]="Block",kb[kb.Wrap=2]="Wrap",kb[kb.Eol=3]="Eol";var sC=function(e,t){return e===Tu.Backwards?t.reverse():t},cC=function(e,t,n,r){for(var o,i,a,u,s,c,l=Js(n),f=r,d=[];f&&(s=l,c=f,o=t===Tu.Forwards?s.next(c):s.prev(c));){if(jo.isBr(o.getNode(!1)))return t===Tu.Forwards?{positions:sC(t,d).concat([o]),breakType:Tb.Br,breakAt:_.some(o)}:{positions:sC(t,d),breakType:Tb.Br,breakAt:_.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,jo.isBr(u.getNode(i===Tu.Forwards))?Tb.Br:!1===Ts(a,u)?Tb.Block:Tb.Wrap);return{positions:sC(t,d),breakType:m,breakAt:_.some(o)}}d.push(o),f=o}else f=o}return{positions:sC(t,d),breakType:Tb.Eol,breakAt:_.none()}},lC=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===Tu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},fC=function(e,i){return j(e,function(e,o){return e.fold(function(){return _.some(o)},function(r){return ru(Z(r.getClientRects()),Z(o.getClientRects()),function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},_.none())},dC=function(t,e){return Z(e.getClientRects()).bind(function(e){return fC(t,e.left)})},mC=d(cC,Su.isAbove,-1),gC=d(cC,Su.isBelow,1),pC=d(lC,-1,mC),hC=d(lC,1,gC),vC=jo.isContentEditableFalse,yC=Za,bC=function(e,t,n,r){var o=e===Tu.Forwards,i=o?Lf:Ff;if(!r.collapsed){var a=yC(r);if(vC(a))return sg(e,t,a,e===Tu.Backwards,!0)}var u=Sa(r.startContainer),s=Ps(e,t.getBody(),r);if(i(s))return cg(t,s.getNode(!o));var c=Vl.normalizePosition(o,n(s));if(!c)return u?r:null;if(i(c))return sg(e,t,c.getNode(!o),o,!0);var l=n(c);return l&&i(l)&&Fs(c,l)?sg(e,t,l.getNode(!o),o,!0):u?fg(t,c.toRange(),!0):null},CC=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=yC(r),o=Ps(e,t.getBody(),r),i=n(t.getBody(),sv(1),o),a=U(i,cv(1)),s=Ht.last(o.getClientRects()),(Lf(o)||zf(o))&&(d=o.getNode()),(Ff(o)||Uf(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=pv(a,c))&&vC(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),sg(e,t,u.node,l<f,!0);if(d){var m=function(e,t,n,r){var o,i,a,u,s,c,l=Js(t),f=[],d=0,m=function(e){return Ht.last(e.getClientRects())};1===e?(o=l.next,i=Ja,a=Ga,u=_u.after(r)):(o=l.prev,i=Ga,a=Ja,u=_u.before(r)),c=m(u);do{if(u.isVisible()&&!a(s=m(u),c)){if(0<f.length&&i(s,Ht.last(f))&&d++,(s=Ka(s)).position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f}(e,t.getBody(),sv(1),d);if(u=pv(U(m,cv(1)),c))return fg(t,u.position.toRange(),!0);if(u=Ht.last(U(m,cv(0))))return fg(t,u.position.toRange(),!0)}},xC=function(e,t,n){var r,o,i,a,u=Js(e.getBody()),s=d(Ls,u.next),c=d(Ls,u.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?s(_u.fromRangeStart(n)):c(_u.fromRangeStart(n)))||(a=(i=e).dom.create(Nl(i)),(!fe.ie||11<=fe.ie)&&(a.innerHTML='<br data-mce-bogus="1">'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},wC=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Js((e=l).getBody()),o=d(Ls,r.next),i=d(Ls,r.prev),a=t?Tu.Forwards:Tu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=bC(a,e,u,s))?n:(n=xC(e,a,s))||null);return!!c&&(dg(l,c),!0)}},NC=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?uv:av,i=(e=u).selection.getRng(),(n=CC(r,e,o,i))?n:(n=xC(e,r,i))||null);return!!a&&(dg(u,a),!0)}},EC=function(r,o){return function(){var t,e=o?_u.fromRangeEnd(r.selection.getRng()):_u.fromRangeStart(r.selection.getRng()),n=o?gC(r.getBody(),e):mC(r.getBody(),e);return(o?ee(n.positions):Z(n.positions)).filter((t=o,function(e){return t?Ff(e):Lf(e)})).fold(q(!1),function(e){return r.selection.setRng(e.toRange()),!0})}},SC=function(e,t,n,r,o){var i,a,u,s,c=Qi(ar.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),l=U((i=e,G(c,function(e){var t,n,r=(t=Ka(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(a=l,u=r,s=o,j(a,function(e,r){return e.fold(function(){return _.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-u)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-u)+Math.abs(r.y-s));return _.some(n<t?r:e)})},_.none())).map(function(e){return e.cell})},TC=d(SC,function(e){return e.bottom},function(e,t){return e.y<t}),kC=d(SC,function(e){return e.top},function(e,t){return e.y>t}),_C=function(t,n){return Z(n.getClientRects()).bind(function(e){return TC(t,e.left,e.top)}).bind(function(e){return dC((t=e,sc.lastPositionIn(t).map(function(e){return mC(t,e).positions.concat(e)}).getOr([])),n);var t})},AC=function(t,n){return ee(n.getClientRects()).bind(function(e){return kC(t,e.left,e.top)}).bind(function(e){return dC((t=e,sc.firstPositionIn(t).map(function(e){return[e].concat(gC(t,e).positions)}).getOr([])),n);var t})},RC=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===Tb.Wrap&&0===a.positions.length||!jo.isBr(n.getNode())&&(i=u).breakType===Tb.Br&&1===i.positions.length?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},DC=d(RC,mC),OC=d(RC,gC),BC=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(ms()&&(o=t,i=s,a=n,u=_u.fromRangeStart(i),sc.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=sg(c,e,n,!t,!0);return dg(e,l),!0}return!1},PC=function(e,t){var n=t.getNode(e);return jo.isElement(n)&&"TABLE"===n.nodeName?_.some(n):_.none()},IC=function(u,s,c){var e=PC(!!s,c),t=!1===s;e.fold(function(){return dg(u,c.toRange())},function(a){return sc.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return dg(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=Nl(r=u))?r.undoManager.transact(function(){var e=ar.fromTag(i);Nr(e,El(r)),Fi(e,ar.fromTag("br")),n?Ii(ar.fromDom(o),e):Pi(ar.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),dg(r,t)}):dg(r,t.toRange()));var n,r,o,t,i})})},LC=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=_u.fromRangeStart(l),d=e.getBody();if(!t&&DC(r,f)){var m=(u=d,_C(s=n,c=f).orThunk(function(){return Z(c.getClientRects()).bind(function(e){return fC(pC(u,_u.before(s)),e.left)})}).getOr(_u.before(s)));return IC(e,t,m),!0}return!(!t||!OC(r,f))&&(o=d,m=AC(i=n,a=f).orThunk(function(){return Z(a.getClientRects()).bind(function(e){return fC(hC(o,_u.after(i)),e.left)})}).getOr(_u.after(i)),IC(e,t,m),!0)},FC=function(t,n){return function(){return _.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return _.from(t.dom.getParent(e,"table")).map(function(e){return BC(t,n,e)})}).getOr(!1)}},MC=function(n,r){return function(){return _.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return _.from(n.dom.getParent(t,"table")).map(function(e){return LC(n,r,e,t)})}).getOr(!1)}},zC=function(e){return F(["figcaption"],lr(e))},UC=function(e){var t=V.document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},jC=function(e,t,n){n?Fi(e,t):Li(e,t)},VC=function(e,t,n,r){return""===t?(l=e,f=r,d=ar.fromTag("br"),jC(l,d,f),UC(d)):(o=e,i=r,a=t,u=n,s=ar.fromTag(a),c=ar.fromTag("br"),Nr(s,u),Fi(s,c),jC(o,s,i),UC(c));var o,i,a,u,s,c,l,f,d},HC=function(e,t,n){return t?(o=e.dom(),gC(o,n).breakAt.isNone()):(r=e.dom(),mC(r,n).breakAt.isNone());var r,o},qC=function(t,n){var e,r,o,i=ar.fromDom(t.getBody()),a=_u.fromRangeStart(t.selection.getRng()),u=Nl(t),s=El(t);return(e=a,r=i,o=d(Mr,r),na(ar.fromDom(e.container()),Co,o).filter(zC)).exists(function(){if(HC(i,n,a)){var e=VC(i,u,s,n);return t.selection.setRng(e),!0}return!1})},$C=function(e,t){return function(){return!!e.selection.isCollapsed()&&qC(e,t)}},WC=function(e,r){return G(W(e,function(e){return Zy({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:o},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},KC=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,r)}},XC=function(e,t){return X(WC(e,t),function(e){return e.action()})},YC=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=or.detect().os,XC([{keyCode:rv.RIGHT,action:wC(t,!0)},{keyCode:rv.LEFT,action:wC(t,!1)},{keyCode:rv.UP,action:NC(t,!1)},{keyCode:rv.DOWN,action:NC(t,!0)},{keyCode:rv.RIGHT,action:FC(t,!0)},{keyCode:rv.LEFT,action:FC(t,!1)},{keyCode:rv.UP,action:MC(t,!1)},{keyCode:rv.DOWN,action:MC(t,!0)},{keyCode:rv.RIGHT,action:Xd.move(t,n,!0)},{keyCode:rv.LEFT,action:Xd.move(t,n,!1)},{keyCode:rv.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:Xd.moveNextWord(t,n)},{keyCode:rv.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:Xd.movePrevWord(t,n)},{keyCode:rv.UP,action:$C(t,!1)},{keyCode:rv.DOWN,action:$C(t,!0)}],r).each(function(e){r.preventDefault()}))})},GC=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,XC([{keyCode:rv.BACKSPACE,action:KC(ad,t,!1)},{keyCode:rv.DELETE,action:KC(ad,t,!0)},{keyCode:rv.BACKSPACE,action:KC(gg,t,!1)},{keyCode:rv.DELETE,action:KC(gg,t,!0)},{keyCode:rv.BACKSPACE,action:KC(Qd,t,n,!1)},{keyCode:rv.DELETE,action:KC(Qd,t,n,!0)},{keyCode:rv.BACKSPACE,action:KC(Dm,t,!1)},{keyCode:rv.DELETE,action:KC(Dm,t,!0)},{keyCode:rv.BACKSPACE,action:KC(Cf,t,!1)},{keyCode:rv.DELETE,action:KC(Cf,t,!0)},{keyCode:rv.BACKSPACE,action:KC(hf,t,!1)},{keyCode:rv.DELETE,action:KC(hf,t,!0)},{keyCode:rv.BACKSPACE,action:KC(ng,t,!1)},{keyCode:rv.DELETE,action:KC(ng,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,XC([{keyCode:rv.BACKSPACE,action:KC(ud,t)},{keyCode:rv.DELETE,action:KC(ud,t)}],n))})},JC=function(e){return _.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},QC=function(e,t){var n,r,o,i=t,a=e.dom,u=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var s=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);s&&/^(UL|OL|DL)$/.test(s.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new go(t,t);r=n.current();){if(jo.isText(r)){o.setStart(r,0),o.setEnd(r,0);break}if(u[r.nodeName.toLowerCase()]){o.setStartBefore(r),o.setEndBefore(r);break}i=r,r=n.next()}r||(o.setStart(i,0),o.setEnd(i,0))}else jo.isBr(t)?t.nextSibling&&a.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),a.remove(void 0),e.selection.scrollIntoView(t)}},ZC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},ex=JC,tx=function(e){return JC(e).fold(q(""),function(e){return e.nodeName.toUpperCase()})},nx=function(e){return JC(e).filter(function(e){return So(ar.fromDom(e))}).isSome()},rx=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},ox=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},ix=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},ax=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!jo.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},ux=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;ox(u=n)&&ox(u.parentNode)&&(o="LI");var s,c,l=o?t(o):i.create("BR");if(ax(n,r,!0)&&ax(n,r,!1))rx(n,"LI")?i.insertAfter(l,ix(n)):i.replace(l,n);else if(ax(n,r,!0))rx(n,"LI")?(i.insertAfter(l,ix(n)),l.appendChild(i.doc.createTextNode(" ")),l.appendChild(n)):n.parentNode.insertBefore(l,n);else if(ax(n,r,!1))i.insertAfter(l,ix(n));else{n=ix(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var d=f.extractContents();"LI"===o&&(c="LI",(s=d).firstChild&&s.firstChild.nodeName===c)?(l=d.firstChild,i.insertAfter(d,n)):(i.insertAfter(d,n),i.insertAfter(l,n))}i.remove(r),QC(e,l)}},sx=function(e){e.innerHTML='<br data-mce-bogus="1">'},cx=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},lx=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},fx=function(e,t,n){return!1===jo.isText(t)?n:e?1===n&&t.data.charAt(n-1)===xa?0:n:n===t.data.length-1&&t.data.charAt(n)===xa?t.data.length:n},dx=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},mx=function(o,i,e){_.from(e.style).map(o.dom.parseStyle).each(function(e){var t=function(e){var t={},n=e.dom();if(Cr(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o]}return t}(ar.fromDom(i)),n=ma(ma({},t),e);o.dom.setStyles(i,n)});var t=_.from(e["class"]).map(function(e){return e.split(/\s+/)}),n=_.from(i.className).map(function(e){return U(e.split(/\s+/),function(e){return""!==e})});ru(t,n,function(t,e){var n=U(e,function(e){return!F(t,e)}),r=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}(t,n);o.dom.setAttrib(i,"class",r.join(" "))});var r=["style","class"],a=yr(e,function(e,t){return!F(r,t)}).t;o.dom.setAttribs(i,a)},gx=function(e,t){var n=Nl(e);if(n&&n.toLowerCase()===t.tagName.toLowerCase()){var r=El(e);mx(e,t,r)}},px=function(a,e){var t,u,s,i,c,n,r,o,l,f,d,m,g,p,h,v,y,b,C,x=a.dom,w=a.schema,N=w.getNonEmptyElements(),E=a.selection.getRng(),S=function(e){var t,n,r,o=s,i=w.getTextInlineElements();if(r=t=e||"TABLE"===f||"HR"===f?x.create(e||m):c.cloneNode(!1),!1===kl(a))x.setAttrib(t,"style",null),x.setAttrib(t,"class",null);else do{if(i[o.nodeName]){if(Ju(o)||yc(o))continue;n=o.cloneNode(!1),x.setAttrib(n,"id",""),t.hasChildNodes()?n.appendChild(t.firstChild):r=n,t.appendChild(n)}}while((o=o.parentNode)&&o!==u);return gx(a,t),sx(r),t},T=function(e){var t,n,r,o;if(o=fx(e,s,i),jo.isText(s)&&(e?0<o:o<s.nodeValue.length))return!1;if(s.parentNode===c&&g&&!e)return!0;if(e&&jo.isElement(s)&&s===c.firstChild)return!0;if(cx(s,"TABLE")||cx(s,"HR"))return g&&!e||!g&&e;for(t=new go(s,c),jo.isText(s)&&(e&&0===o?t.prev():e||o!==s.nodeValue.length||t.next());n=t.current();){if(jo.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),N[r]&&"br"!==r))return!1}else if(jo.isText(n)&&!/^[ \t\r\n]*$/.test(n.nodeValue))return!1;e?t.prev():t.next()}return!0},k=function(){r=/^(H[1-6]|PRE|FIGURE)$/.test(f)&&"HGROUP"!==d?S(m):S(),_l(a)&&lx(x,l)&&x.isEmpty(c)?r=x.split(l,c):x.insertAfter(r,c),QC(a,r)};Dg(x,E).each(function(e){E.setStart(e.startContainer,e.startOffset),E.setEnd(e.endContainer,e.endOffset)}),s=E.startContainer,i=E.startOffset,m=Nl(a),n=e.shiftKey,jo.isElement(s)&&s.hasChildNodes()&&(g=i>s.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=g&&jo.isText(s)?s.nodeValue.length:0),(u=dx(x,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,g=dx(m,r);if(!(a=m.getParent(r,m.isBlock))||!lx(m,a)){if(l=(a=a||g)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),gx(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),gx(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,E,s,i)),c=x.getParent(s,x.isBlock),l=c?x.getParent(c.parentNode,x.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||e.ctrlKey||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&x.isEmpty(c)?ux(a,S,l,c,m):m&&c===a.getBody()||(m=m||"P",Sa(c)?(r=Pa(c),x.isEmpty(c)&&sx(c),gx(a,r),QC(a,r)):T()?k():T(!0)?(r=c.parentNode.insertBefore(S(),c),QC(a,cx(c,"HR")?r:c)):((t=(b=E,C=b.cloneRange(),C.setStart(b.startContainer,fx(!0,b.startContainer,b.startOffset)),C.setEnd(b.endContainer,fx(!1,b.endContainer,b.endOffset)),C).cloneRange()).setEndAfter(c),o=t.extractContents(),y=o,z(Ji(ar.fromDom(y),mr),function(e){var t=e.dom();t.nodeValue=wa(t.nodeValue)}),function(e){for(;jo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o),r=o.firstChild,x.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;jo.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=e,(u=o)&&"A"===u.nodeName&&a.isEmpty(u)&&e.remove(o));var a,u}}(x,N,r),p=x,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(p.getStyle(v,"float",!0))||p.add(h,"br"),x.isEmpty(c)&&sx(c),r.normalize(),x.isEmpty(r)?(x.remove(r),k()):(gx(a,r),QC(a,r))),x.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},hx=function(e,t){return ex(e).filter(function(e){return 0<t.length&&Lr(ar.fromDom(e),t)}).isSome()},vx=function(e){return hx(e,Sl(e))},yx=function(e){return hx(e,Tl(e))},bx=xf([{br:[]},{block:[]},{none:[]}]),Cx=function(e,t){return yx(e)},xx=function(n){return function(e,t){return""===Nl(e)===n}},wx=function(n){return function(e,t){return nx(e)===n}},Nx=function(n,r){return function(e,t){return tx(e)===n.toUpperCase()===r}},Ex=function(e){return Nx("pre",e)},Sx=function(n){return function(e,t){return wl(e)===n}},Tx=function(e,t){return vx(e)},kx=function(e,t){return t},_x=function(e){var t=Nl(e),n=ZC(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},Ax=function(e,t){return function(n,r){return j(e,function(e,t){return e&&t(n,r)},!0)?_.some(t):_.none()}},Rx=function(e,t){return yd([Ax([Cx],bx.none()),Ax([Nx("summary",!0)],bx.br()),Ax([Ex(!0),Sx(!1),kx],bx.br()),Ax([Ex(!0),Sx(!1)],bx.block()),Ax([Ex(!0),Sx(!0),kx],bx.block()),Ax([Ex(!0),Sx(!0)],bx.br()),Ax([wx(!0),kx],bx.br()),Ax([wx(!0)],bx.block()),Ax([xx(!0),kx,_x],bx.block()),Ax([xx(!0)],bx.br()),Ax([Tx],bx.br()),Ax([xx(!1),kx],bx.br()),Ax([_x],bx.block())],[e,t.shiftKey]).getOr(bx.none())},Dx=function(e,t){Rx(e,t).fold(function(){jg(e,t)},function(){px(e,t)},o)},Ox=function(o){o.on("keydown",function(e){var t,n,r;e.keyCode===rv.ENTER&&(t=o,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),Dx(t,n)})))})},Bx=function(n,r){var e=r.container(),t=r.offset();return jo.isText(e)?(e.insertData(t,n),_.some(Su(e,t+n.length))):Is(r).map(function(e){var t=ar.fromText(n);return r.isAtEnd()?Ii(e,t):Pi(e,t),Su(t.dom(),n.length)})},Px=d(Bx,"\xa0"),Ix=d(Bx," "),Lx=function(e,t,n){return sc.navigateIgnore(e,t,n,Pf)},Fx=function(e,t){return X(uf(ar.fromDom(t.container()),e),Co)},Mx=function(e,n,r){return Lx(e,n.dom(),r).forall(function(t){return Fx(n,r).fold(function(){return!1===Ts(t,r,n.dom())},function(e){return!1===Ts(t,r,n.dom())&&zr(e,ar.fromDom(t.container()))})})},zx=function(t,n,r){return Fx(n,r).fold(function(){return Lx(t,n.dom(),r).forall(function(e){return!1===Ts(e,r,n.dom())})},function(e){return Lx(t,e.dom(),r).isNone()})},Ux=d(zx,!1),jx=d(zx,!0),Vx=d(Mx,!1),Hx=d(Mx,!0),qx=function(e){return Su.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},$x=function(e,t){var n=U(uf(ar.fromDom(t.container()),e),Co);return Z(n).getOr(e)},Wx=function(e,t){return qx(t)?Bf(t):Bf(t)||sc.prevPosition($x(e,t).dom(),t).exists(Bf)},Kx=function(e,t){return qx(t)?Of(t):Of(t)||sc.nextPosition($x(e,t).dom(),t).exists(Of)},Xx=function(e){return Is(e).bind(function(e){return na(e,dr)}).exists(function(e){return t=kr(e,"white-space"),F(["pre","pre-wrap"],t);var t})},Yx=function(e,t){return o=e,i=t,sc.prevPosition(o.dom(),i).isNone()||(n=e,r=t,sc.nextPosition(n.dom(),r).isNone())||Ux(e,t)||jx(e,t)||Sf(e,t)||Ef(e,t);var n,r,o,i},Gx=function(e,t){var n,r,o,i=(r=(n=t).container(),o=n.offset(),jo.isText(r)&&o<r.data.length?Su(r,o+1):n);return!Xx(i)&&(jx(e,i)||Hx(e,i)||Ef(e,i)||Kx(e,i))},Jx=function(e,t){return n=e,!Xx(r=t)&&(Ux(n,r)||Vx(n,r)||Sf(n,r)||Wx(n,r))||Gx(e,t);var n,r},Qx=function(e,t){return _f(e.charAt(t))},Zx=function(e){var t=e.container();return jo.isText(t)&&Yn(t.data,"\xa0")},ew=function(e){var n,t=e.data,r=(n=t.split(""),W(n,function(e,t){return _f(e)&&0<t&&t<n.length-1&&Rf(n[t-1])&&Rf(n[t+1])?" ":e}).join(""));return r!==t&&(e.data=r,!0)},tw=function(l,e){return _.some(e).filter(Zx).bind(function(e){var t,n,r,o,i,a,u,s,c=e.container();return i=l,u=(a=c).data,s=Su(a,0),Qx(u,0)&&!Jx(i,s)&&(a.data=" "+u.slice(1),1)||ew(c)||(t=l,r=(n=c).data,o=Su(n,r.length-1),Qx(r,r.length-1)&&!Jx(t,o)&&(n.data=r.slice(0,-1)+" ",1))?_.some(e):_.none()})},nw=function(t){var e=ar.fromDom(t.getBody());t.selection.isCollapsed()&&tw(e,Su.fromRangeStart(t.selection.getRng())).each(function(e){t.selection.setRng(e.toRange())})},rw=function(r,o){return function(e){return t=r,!Xx(n=e)&&(Yx(t,n)||Wx(t,n)||Kx(t,n))?Px(o):Ix(o);var t,n}},ow=function(e){var t,n,r=_u.fromRangeStart(e.selection.getRng()),o=ar.fromDom(e.getBody());if(e.selection.isCollapsed()){var i=d(Vl.isInlineTarget,e),a=_u.fromRangeStart(e.selection.getRng());return Ld(i,e.getBody(),a).bind((n=o,function(e){return e.fold(function(e){return sc.prevPosition(n.dom(),_u.before(e))},function(e){return sc.firstPositionIn(e)},function(e){return sc.lastPositionIn(e)},function(e){return sc.nextPosition(n.dom(),_u.after(e))})})).bind(rw(o,r)).exists((t=e,function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}))}return!1},iw=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,XC([{keyCode:rv.SPACEBAR,action:KC(ow,t)}],n).each(function(e){n.preventDefault()}))})},aw=function(e,t){var n;t.hasAttribute("data-mce-caret")&&(Pa(t),(n=e).selection.setRng(n.selection.getRng()),e.selection.scrollIntoView(t))},uw=function(e,t){var n,r=(n=e,oa(ar.fromDom(n.getBody()),"*[data-mce-caret]").fold(q(null),function(e){return e.dom()}));if(r)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void aw(e,r)):void(_a(r)&&(aw(e,r),e.undoManager.add()))},sw=function(e){e.on("keyup compositionstart",d(uw,e))},cw=or.detect().browser,lw=function(t){var e,n;e=t,n=Vi(function(){e.composing||nw(e)},0),cw.isIE()&&(e.on("keypress",function(e){n.throttle()}),e.on("remove",function(e){n.cancel()})),t.on("input",function(e){!1===e.isComposing&&nw(t)})},fw=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,XC([{keyCode:rv.END,action:EC(t,!0)},{keyCode:rv.HOME,action:EC(t,!1)}],n).each(function(e){n.preventDefault()}))})},dw=function(e){var t=Xd.setupSelectedState(e);sw(e),YC(e,t),GC(e,t),Ox(e),iw(e),lw(e),fw(e)};function mw(u){var s,n,r,o=Xt.each,c=rv.BACKSPACE,l=rv.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=fe.gecko,a=fe.ie,m=fe.webkit,g="data:text/mce-internal,",p=a?"Text":"URL",h=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},v=function(e){return e.isDefaultPrevented()},y=function(){u.shortcuts.add("meta+a",null,"SelectAll")},b=function(){u.on("keydown",function(e){if(!v(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11<fe.ie)return void u.getBody().focus();t=u.selection.getRng(),u.getBody().focus(),u.selection.setRng(t),u.selection.normalize(),u.nodeChanged()}}))};return u.on("keydown",function(e){var t,n,r,o,i;if(!v(e)&&e.keyCode===rv.BACKSPACE&&(n=(t=d.getRng()).startContainer,r=t.startOffset,o=f.getRoot(),i=n,t.collapsed&&0===r)){for(;i&&i.parentNode&&i.parentNode.firstChild===i&&i.parentNode!==o;)i=i.parentNode;"BLOCKQUOTE"===i.tagName&&(u.formatter.toggle("blockquote",null,i),(t=f.createRng()).setStart(n,0),t.setEnd(n,0),d.setRng(t))}}),s=function(e){var t=f.create("body"),n=e.cloneContents();return t.appendChild(n),d.serializer.serialize(t,{format:"html"})},u.on("keydown",function(e){var t,n,r,o,i,a=e.keyCode;if(!v(e)&&(a===l||a===c)){if(t=u.selection.isCollapsed(),n=u.getBody(),t&&!f.isEmpty(n))return;if(!t&&(r=u.selection.getRng(),o=s(r),(i=f.createRng()).selectNode(u.getBody()),o!==s(i)))return;e.preventDefault(),u.setContent(""),n.firstChild&&f.isBlock(n.firstChild)?u.selection.setCursorLocation(n.firstChild,0):u.selection.setCursorLocation(n,0),u.nodeChanged()}}),fe.windowsPhone||u.on("keyup focusin mouseup",function(e){rv.modifierPressed(e)||d.normalize()},!0),m&&(u.settings.content_editable||f.bind(u.getDoc(),"mousedown mouseup",function(e){var t;if(e.target===u.getDoc().documentElement)if(t=d.getRng(),u.getBody().focus(),"mousedown"===e.type){if(ka(t.startContainer))return;d.placeCaretAt(e.clientX,e.clientY)}else d.setRng(t)}),u.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==f.getContentEditableParent(t)&&(e.preventDefault(),u.selection.select(t),u.nodeChanged()),"A"===t.nodeName&&f.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),d.select(t))}),e.forced_root_block&&u.on("init",function(){h("DefaultParagraphSeparator",e.forced_root_block)}),u.on("init",function(){u.dom.bind(u.getBody(),"submit",function(e){e.preventDefault()})}),b(),t.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),fe.iOS?(u.inline||u.on("keydown",function(){V.document.activeElement===V.document.body&&u.getWin().focus()}),C(),u.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),u.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):y()),11<=fe.ie&&(C(),b()),fe.ie&&(y(),h("AutoUrlDetect",!1),u.on("dragstart",function(e){var t,n,r;(t=e).dataTransfer&&(u.selection.isCollapsed()&&"IMG"===t.target.tagName&&d.select(t.target),0<(n=u.selection.getContent()).length&&(r=g+escape(u.id)+","+escape(n),t.dataTransfer.setData(p,r)))}),u.on("drop",function(e){if(!v(e)){var t=(i=e).dataTransfer&&(a=i.dataTransfer.getData(p))&&0<=a.indexOf(g)?(a=a.substr(g.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null;if(t&&t.id!==u.id){e.preventDefault();var n=Bb(e.x,e.y,u.getDoc());d.setRng(n),r=t.html,o=!0,u.queryCommandSupported("mceInsertClipboardContent")?u.execCommand("mceInsertClipboardContent",!1,{content:r,internal:o}):u.execCommand("mceInsertContent",!1,r)}}var r,o,i,a})),i&&(u.on("keydown",function(e){if(!v(e)&&e.keyCode===c){if(!u.getBody().getElementsByTagName("hr").length)return;if(d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode(),n=t.previousSibling;if("HR"===t.nodeName)return f.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(f.remove(n),e.preventDefault())}}}),V.Range.prototype.getClientRects||u.on("mousedown",function(e){if(!v(e)&&"HTML"===e.target.nodeName){var t=u.getBody();t.blur(),he.setEditorTimeout(u,function(){t.focus()})}}),n=function(){var e=f.getAttribs(d.getStart().cloneNode(!1));return function(){var t=d.getStart();t!==u.getBody()&&(f.setAttrib(t,"style",null),o(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!d.isCollapsed()&&f.getParent(d.getStart(),f.isBlock)!==f.getParent(d.getEnd(),f.isBlock)},u.on("keypress",function(e){var t;if(!v(e)&&(8===e.keyCode||46===e.keyCode)&&r())return t=n(),u.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),f.bind(u.getDoc(),"cut",function(e){var t;!v(e)&&r()&&(t=n(),he.setEditorTimeout(u,function(){t()}))}),e.readonly||u.on("BeforeExecCommand MouseDown",function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),e.object_resizing||h("enableObjectResizing",!1)}),u.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(f.select("a"),function(e){var t=e.parentNode,n=f.getRoot();if(t.lastChild===e){for(;t&&!f.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}f.add(t,"br",{"data-mce-bogus":1})}})}),u.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),fe.mac&&u.on("keydown",function(e){!rv.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),u.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}),b()),{refreshContentEditable:function(){},isHidden:function(){var e;return!i||u.removed?0:!(e=u.selection.getSel())||!e.rangeCount||0===e.rangeCount}}}var gw=function(e){return jo.isElement(e)&&No(ar.fromDom(e))},pw=function(t){t.on("click",function(e){3<=e.detail&&function(e){var t=e.selection.getRng(),n=Su.fromRangeStart(t),r=Su.fromRangeEnd(t);if(Su.isElementPosition(n)){var o=n.container();gw(o)&&sc.firstPositionIn(o).each(function(e){return t.setStart(e.container(),e.offset())})}Su.isElementPosition(r)&&(o=n.container(),gw(o)&&sc.lastPositionIn(o).each(function(e){return t.setEnd(e.container(),e.offset())})),e.selection.setRng(cl(t))}(t)})},hw=function(e){var t,n;(t=e).on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}),(n=e).parser.addNodeFilter("details",function(e){z(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),n.serializer.addNodeFilter("details",function(e){z(e,function(e){var t=e.attr("data-mce-open");e.attr("open",S(t)?t:null),e.attr("data-mce-open",null)})})},vw=Si.DOM,yw=function(e){var t;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&he.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},bw=function(t,e){var n,r,u,o,i,a,s,c,l,f=t.settings,d=t.getElement(),m=t.getDoc();f.inline||(t.getElement().style.visibility=t.orgVisibility),e||f.content_editable||(m.open(),m.write(t.iframeHTML),m.close()),f.content_editable&&(t.on("remove",function(){var e=this.getBody();vw.removeClass(e,"mce-content-body"),vw.removeClass(e,"mce-edit-focus"),vw.setAttrib(e,"contentEditable",null)}),vw.addClass(d,"mce-content-body"),t.contentDocument=m=f.content_document||V.document,t.contentWindow=f.content_window||V.window,t.bodyElement=d,f.content_document=f.content_window=null,f.root_name=d.nodeName.toLowerCase()),(n=t.getBody()).disabled=!0,t.readonly=f.readonly,t.readonly||(t.inline&&"static"===vw.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=t.getParam("content_editable_state",!0)),n.disabled=!1,t.editorUpload=qh(t),t.schema=di(f),t.dom=Si(m,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:f.force_hex_style_colors,class_filter:f.class_filter,update_styles:!0,root_element:t.inline?t.getBody():null,collect:f.content_editable,schema:t.schema,contentCssCors:zl(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((o=bb((u=t).settings,u.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,o,i=e.length,a=u.dom;i--;)if(r=(n=e[i]).attr(t),o="data-mce-"+t,!n.attributes.map[o]){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===t?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(o,r),n.attr(t,r)):"tabindex"===t?(n.attr(o,r),n.attr(t,null)):n.attr(o,u.convertURL(r,t,n.name))}}),o.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)}),o.addNodeFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),o.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=u.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new sb("br",1)).shortEnded=!0)}),o),t.serializer=Eb(f,t),t.selection=uC(t.dom,t.getWin(),t.serializer,t),t.annotator=Hc(t),t.formatter=Gy(t),t.undoManager=ry(t),t._nodeChangeDispatcher=new ev(t),t._selectionOverrides=Bv(t),hw(t),pw(t),dw(t),Xh(t),t.fire("PreInit"),f.browser_spellcheck||f.gecko_spellcheck||(m.body.spellcheck=!1,vw.setAttrib(n,"spellcheck","false")),t.quirks=mw(t),t.fire("PostRender"),f.directionality&&(n.dir=f.directionality),f.nowrap&&(n.style.whiteSpace="nowrap"),f.protect&&t.on("BeforeSetContent",function(t){Xt.each(f.protect,function(e){t.content=t.content.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type}),0<t.contentStyles.length&&(r="",Xt.each(t.contentStyles,function(e){r+=e+"\r\n"}),t.dom.addStyle(r)),(i=t,i.inline?vw.styleSheetLoader:i.dom.styleSheetLoader).loadAll(t.contentCSS,function(e){yw(t)},function(e){yw(t)}),f.content_style&&(a=t,s=f.content_style,c=ar.fromDom(a.getDoc().head),l=ar.fromTag("style"),wr(l,"type","text/css"),Fi(l,ar.fromText(s)),Fi(c,l))},Cw=Si.DOM,xw=function(e,t){var n,r,o,i,a,u,s,c=e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),l=(n=e.id,r=c,o=t.height,i=hl(e),s=ar.fromTag("iframe"),Nr(s,i),Nr(s,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Tr(s,{width:"100%",height:(a=o,u="number"==typeof a?a+"px":a,u||""),display:"block"}),s).dom();l.onload=function(){l.onload=null,e.fire("load")};var f,d,m,g,p=function(e,t){if(V.document.domain!==V.window.location.hostname&&fe.ie&&fe.ie<12){var n=Hh.uuid("mce");e[n]=function(){bw(e)};var r='javascript:(function(){document.open();document.domain="'+V.document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return Cw.setAttrib(t,"src",r),!0}return!1}(e,l);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=l,e.iframeHTML=(g=vl(f=e)+"<html><head>",yl(f)!==f.documentBaseUrl&&(g+='<base href="'+f.documentBaseURI.getURI()+'" />'),g+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',d=bl(f),m=Cl(f),xl(f)&&(g+='<meta http-equiv="Content-Security-Policy" content="'+xl(f)+'" />'),g+='</head><body id="'+d+'" class="mce-content-body '+m+'" data-id="'+f.id+'"><br></body></html>'),Cw.add(t.iframeContainer,l),p},ww=function(e,t){var n=xw(e,t);t.editorContainer&&(Cw.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=Cw.isHidden(t.editorContainer)),e.getElement().style.display="none",Cw.setAttrib(e.id,"aria-hidden","true"),n||bw(e)},Nw=Si.DOM,Ew=function(t,n,e){var r=_h.get(e),o=_h.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=Xt.trim(e),r&&-1===Xt.inArray(n,e)){if(Xt.each(_h.dependencies(e),function(e){Ew(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(iE){kh.pluginInitError(t,e,iE)}}},Sw=function(e){return e.replace(/^\-/,"")},Tw=function(e){return{editorContainer:e,iframeContainer:e}},kw=function(e){var t,n,r=e.getElement();return e.inline?Tw(null):(t=r,n=Nw.create("div"),Nw.insertAfter(n,t),Tw(n))},_w=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,S(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||Nw.getStyle(f,"width")||"100%",a=l.height||Nw.getStyle(f,"height")||f.offsetHeight,u=l.min_height||100,(s=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),s.test(""+a)&&(a=Math.max(parseInt(a,10),u)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))<u&&(a=u),c.height=a,c):D(d.theme)?(r=(t=e).getElement(),(n=t.settings.theme(t,r)).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:r.offsetHeight,n):kw(e)},Aw=function(t){var e,n,r,o,i,a,u=t.settings,s=t.getElement();return t.rtl=u.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(u.language),u.aria_label=u.aria_label||Nw.getAttrib(s,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),o=(n=t).settings.theme,S(o)?(n.settings.theme=Sw(o),r=Ah.get(o),n.theme=new r(n,Ah.urls[o]),n.theme.init&&n.theme.init(n,Ah.urls[o]||n.documentBaseUrl.replace(/\/$/,""),n.$)):n.theme={},i=t,a=[],Xt.each(i.settings.plugins.split(/[ ,]/),function(e){Ew(i,a,Sw(e))}),e=_w(t),t.editorContainer=e.editorContainer?e.editorContainer:null,u.content_css&&Xt.each(Xt.explode(u.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),u.content_editable?bw(t):ww(t,e)},Rw=Si.DOM,Dw=function(e){return"-"===e.charAt(0)},Ow=function(i,a){var u=Ri.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(S(i)){if(!Dw(i)&&!Ah.urls.hasOwnProperty(i)){var a=o.theme_url;a?Ah.load(i,t.documentBaseURI.toAbsolute(a)):Ah.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){Ah.waitFor(i,r)})}else r()}(u,i,a,function(){var e,t,n,r,o;e=u,(n=(t=i).settings).language&&"en"!==n.language&&!n.language_url&&(n.language_url=t.editorManager.baseURL+"/langs/"+n.language+".js"),n.language_url&&!t.editorManager.i18n.data[n.language]&&e.add(n.language_url),r=i.settings,o=a,Xt.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),Xt.each(r.external_plugins,function(e,t){_h.load(t,e),r.plugins+=" "+t}),Xt.each(r.plugins.split(/[ ,]/),function(e){if((e=Xt.trim(e))&&!_h.urls[e])if(Dw(e)){e=e.substr(1,e.length);var t=_h.dependencies(e);Xt.each(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=_h.createUrl(t,e),_h.load(e.resource,e)})}else _h.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),u.loadQueue(function(){i.removed||Aw(i)},i,function(e){kh.pluginLoadError(i,e[0]),i.removed||Aw(i)})})},Bw=function(t){var e=t.settings,n=t.id,r=function(){Rw.unbind(V.window,"ready",r),t.render()};if(Se.Event.domLoaded){if(t.getElement()&&fe.contentEditable){e.inline?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var o=t.getElement().form||Rw.getParent(n,"form");o&&(t.formElement=o,e.hidden_input&&!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&(Rw.insertAfter(Rw.create("input",{type:"hidden",name:n}),n),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},Rw.bind(o,"submit reset",t.formEventDelegate),t.on("reset",function(){t.setContent(t.startContent,{format:"raw"})}),!e.submit_patch||o.submit.nodeType||o.submit.length||o._mceOldSubmit||(o._mceOldSubmit=o.submit,o.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),o._mceOldSubmit(o)})),t.windowManager=yh(t),t.notificationManager=vh(t),"xml"===e.encoding&&t.on("GetContent",function(e){e.save&&(e.content=Rw.encode(e.content))}),e.add_form_submit_trigger&&t.on("submit",function(){t.initialized&&t.save()}),e.add_unload_trigger&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),Ow(t,t.suffix)}}else Rw.bind(V.window,"ready",r)},Pw=function(e,t,n){var r=e.sidebars?e.sidebars:[];r.push({name:t,settings:n}),e.sidebars=r},Iw=Xt.each,Lw=Xt.trim,Fw="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Mw={ftp:21,http:80,https:443,mailto:25},zw=function(r,e){var t,n,o=this;if(r=Lw(r),t=(e=o.settings=e||{}).base_uri,/^([\w\-]+):([^\/]{2})/i.test(r)||/^\s*#/.test(r))o.source=r;else{var i=0===r.indexOf("//");0!==r.indexOf("/")||i||(r=(t&&t.protocol||"http")+"://mce_host"+r),/^[\w\-]*:?\/\//.test(r)||(n=e.base_uri?e.base_uri.path:new zw(V.document.location.href).directory,""==e.base_uri.protocol?r="//mce_host"+o.toAbsPath(n,r):(r=/([^#?]*)([#?]?.*)/.exec(r),r=(t&&t.protocol||"http")+"://mce_host"+o.toAbsPath(n,r[1])+r[2])),r=r.replace(/@@/g,"(mce_at)"),r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(r),Iw(Fw,function(e,t){var n=r[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n}),t&&(o.protocol||(o.protocol=t.protocol),o.userInfo||(o.userInfo=t.userInfo),o.port||"mce_host"!==o.host||(o.port=t.port),o.host&&"mce_host"!==o.host||(o.host=t.host),o.source=""),i&&(o.protocol="")}};zw.prototype={setPath:function(e){e=/^(.*?)\/?(\w+)?$/.exec(e),this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},toRelative:function(e){var t;if("./"===e)return e;if("mce_host"!==(e=new zw(e,{base_uri:this})).host&&this.host!==e.host&&e.host||this.port!==e.port||this.protocol!==e.protocol&&""!==e.protocol)return e.getURI();var n=this.getURI(),r=e.getURI();return n===r||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===r?n:(t=this.toRelPath(this.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return(e=new zw(e,{base_uri:this})).getURI(t&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=Mw[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r,o,i=0,a="";if(e=(e=e.substring(0,e.lastIndexOf("/"))).split("/"),n=t.split("/"),e.length>=n.length)for(r=0,o=e.length;r<o;r++)if(r>=n.length||e[r]!==n[r]){i=r+1;break}if(e.length<n.length)for(r=0,o=n.length;r<o;r++)if(r>=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r<o;r++)a+="../";for(r=i-1,o=n.length;r<o;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},toAbsPath:function(e,t){var n,r,o,i=0,a=[];for(r=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),Iw(e,function(e){e&&a.push(e)}),e=a,n=t.length-1,a=[];0<=n;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?0<i?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(n.protocol?t+=n.protocol+"://":t+="//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},zw.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},zw.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var Uw=function(e,t,n){var r,o,i,a,u;if(t.format=t.format?t.format:"html",t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)r=Xt.trim(Uv.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=wa(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);i=(o=e).serializer.serialize(n,t),a=Nl(o),u=new RegExp("^(<"+a+"[^>]*>( | |\\s|\xa0|<br \\/>|)<\\/"+a+">[\r\n]*|<br \\/>[\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||Ao(ar.fromDom(n))?t.content=r:t.content=Xt.trim(r),t.no_events||e.fire("GetContent",t),t.content},jw=function(e,t){t(e),e.firstChild&&jw(e.firstChild,t),e.next&&jw(e.next,t)},Vw=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&jw(t.firstChild,function(t){z(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),z(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);z(r,function(t){z(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Hw=function(e){return e instanceof sb},qw=function(e,t){var r;e.dom.setHTML(e.getBody(),t),sh(r=e)&&sc.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=jo.isTable(t)?sc.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},$w=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=Hw(s)?"":s,Hw(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),_.from(u.getBody()).fold(q(s),function(e){return Hw(s)?function(e,t,n,r){Vw(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=al({validate:e.validate},e.schema).serialize(n);return r.content=Ao(ar.fromDom(t))?o:Xt.trim(o),qw(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='<br data-mce-bogus="1">',"TABLE"===n.nodeName?r="<tr><td>"+a+"</td></tr>":/^(UL|OL)$/.test(n.nodeName)&&(r="<li>"+a+"</li>"),(i=Nl(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='<br data-mce-bogus="1">'),qw(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=al({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=Ao(ar.fromDom(n))?r:Xt.trim(r),qw(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Ww=Si.DOM,Kw=function(e){return _.from(e).each(function(e){return e.destroy()})},Xw=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&Ww.remove(o.nextSibling),Np(e),e.editorManager.remove(e),!e.inline&&r&&(i=e,Ww.setStyle(i.id,"display",i.orgDisplay)),Ep(e),Ww.remove(e.getContainer()),Kw(t),Kw(n),e.destroy()}var i},Yw=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Kw(i),Kw(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),Ww.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},Gw=Si.DOM,Jw=Xt.extend,Qw=Xt.each,Zw=Xt.resolve,eN=fe.ie,tN=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:i,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_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"40px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",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:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=$p(zp,c,a,u),l.settings=t,Bi.language=t.language||"en",Bi.languageLoad=t.language_load,Bi.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new zw(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new Qp(l),l.loadedCSS={},l.editorCommands=new pp(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(fe.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(fe.overrideViewPort=!1),n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=gn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};Jw(tN.prototype={render:function(){Bw(this)},focus:function(e){uh(this,e)},hasFocus:function(){return sh(this)},execCallback:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?Zw(r):0,o=Zw(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,Array.prototype.slice.call(arguments,1))},translate:function(e){if(e&&Xt.is(e,"string")){var n=this.settings.language||"en",r=this.editorManager.i18n;e=r.data[n+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,t){return r.data[n+"."+t]||"{#"+t+"}"})}return this.editorManager.translate(e)},getLang:function(e,t){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(t!==undefined?t:"{#"+e+"}")},getParam:function(e,t,n){return Kp(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.stateSelector&&"undefined"==typeof t.active&&(t.active=!1),t.text||t.icon||(t.icon=e),t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return Pw(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems[e]=t},addContextToolbar:function(e,t){var n,r=this;r.contextToolbars=r.contextToolbars||[],"string"==typeof e&&(n=e,e=function(e){return r.dom.is(e,n)}),r.contextToolbars.push({id:Hh.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(Gw.show(this.getContainer()),Gw.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(eN&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(Gw.hide(e.getContainer()),Gw.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=Gw.getParent(r.id,"form"))&&Qw(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){return $w(this,e,t)},getContent:function(e){return t=this,void 0===(n=e)&&(n={}),_.from(t.getBody()).fold(q("tree"===n.format?new sb("body",11):""),function(e){return Uw(t,n,e)});var t,n},insertContent:function(e,t){t&&(e=Jw({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){var t,n;(n=e)!==Dp(t=this)&&(t.initialized?Rp(t,"readonly"===n):t.on("init",function(){Rp(t,"readonly"===n)}),Sp(t,n))},getContainer:function(){return this.container||(this.container=Gw.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=Gw.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var n,r=this,o=r.settings,i=r.dom;e=e||r.getBody(),r.hasVisual===undefined&&(r.hasVisual=o.visual),Qw(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return n=o.visual_table_class||"mce-item-table",void((t=i.getAttrib(e,"border"))&&"0"!==t||!r.hasVisual?i.removeClass(e,n):i.addClass(e,n));case"A":return void(i.getAttrib(e,"href")||(t=i.getAttrib(e,"name")||e.id,n=o.visual_anchor_class||"mce-item-anchor",t&&r.hasVisual?i.addClass(e,n):i.removeClass(e,n)))}}),r.fire("VisualAid",{element:e,hasVisual:r.hasVisual})},remove:function(){Xw(this)},destroy:function(e){Yw(this,e)},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},Fp);var nN,rN,oN,iN={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},aN=function(n,e){var t,r;or.detect().browser.isIE()?(r=n).on("focusout",function(){ip(r)}):(t=e,n.on("mouseup touchend",function(e){t.throttle()})),n.on("keyup nodechange",function(e){var t;"nodechange"===(t=e).type&&t.selectionChange||ip(n)})},uN=function(e){var t,n,r,o=Vi(function(){ip(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},Si.DOM.bind(V.document,"mouseup",r),t.on("remove",function(){Si.DOM.unbind(V.document,"mouseup",r)})),e.on("init",function(){aN(e,o)}),e.on("remove",function(){o.cancel()})},sN=Si.DOM,cN=function(e){return iN.isEditorUIElement(e)},lN=function(t,e){var n=t?t.settings.custom_ui_selector:"";return null!==sN.getParent(e,function(e){return cN(e)||!!n&&t.dom.is(e,n)})},fN=function(r,e){var t=e.editor;uN(t),t.on("focusin",function(){var e=r.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),r.setActive(this),(r.focusedEditor=this).fire("focus",{blurredEditor:e}),this.focus(!0))}),t.on("focusout",function(){var t=this;he.setEditorTimeout(t,function(){var e=r.focusedEditor;lN(t,function(){try{return V.document.activeElement}catch(e){return V.document.body}}())||e!==t||(t.fire("blur",{focusedEditor:null}),r.focusedEditor=null)})}),nN||(nN=function(e){var t,n=r.activeEditor;t=e.target,n&&t.ownerDocument===V.document&&(t===V.document.body||lN(n,t)||r.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),r.focusedEditor=null))},sN.bind(V.document,"focusin",nN))},dN=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(sN.unbind(V.document,"focusin",nN),nN=null)},mN=function(e){e.on("AddEditor",d(fN,e)),e.on("RemoveEditor",d(dN,e))},gN=Si.DOM,pN=Xt.explode,hN=Xt.each,vN=Xt.extend,yN=0,bN=!1,CN=[],xN=[],wN=function(t){var n=t.type;hN(oN.get(),function(e){switch(n){case"scroll":e.fire("ScrollWindow",t);break;case"resize":e.fire("ResizeWindow",t)}})},NN=function(e){e!==bN&&(e?gn(window).on("resize scroll",wN):gn(window).off("resize scroll",wN),bN=e)},EN=function(t){var e=xN;delete CN[t.id];for(var n=0;n<CN.length;n++)if(CN[n]===t){CN.splice(n,1);break}return xN=U(xN,function(e){return t!==e}),oN.activeEditor===t&&(oN.activeEditor=0<xN.length?xN[0]:null),oN.focusedEditor===t&&(oN.focusedEditor=null),e.length!==xN.length};vN(oN={defaultSettings:{},$:gn,majorVersion:"4",minorVersion:"9.11",releaseDate:"2020-07-13",editors:CN,i18n:xh,activeEditor:null,settings:{},setup:function(){var e,t,n="";t=zw.getDocumentBaseUrl(V.document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/"));var r=window.tinymce||window.tinyMCEPreInit;if(r)e=r.base||r.baseURL,n=r.suffix;else{for(var o=V.document.getElementsByTagName("script"),i=0;i<o.length;i++){var a;if(""!==(a=o[i].src||"")){var u=a.substring(a.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(a)){-1!==u.indexOf(".min")&&(n=".min"),e=a.substring(0,a.lastIndexOf("/"));break}}}!e&&V.document.currentScript&&(-1!==(a=V.document.currentScript.src).indexOf(".min")&&(n=".min"),e=a.substring(0,a.lastIndexOf("/")))}this.baseURL=new zw(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new zw(this.baseURL),this.suffix=n,mN(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new zw(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new zw(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;for(var o in r)Bi.PluginManager.urls[o]=r[o]},init:function(r){var n,u,s=this;u=Xt.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var c=function(e){var t=e.id;return t||(t=(t=e.name)&&!gN.get(t)?e.name:gN.uniqueId(),e.setAttribute("id",t)),t},l=function(e,t){return t.constructor===RegExp?t.test(e.className):gN.hasClass(e,t)},f=function(e){n=e},e=function(){var o,i=0,a=[],n=function(e,t,n){var r=new tN(e,t,s);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetElm=r.targetElm||n,r.render()};gN.unbind(window,"ready",e),function(e){var t=r[e];t&&t.apply(s,Array.prototype.slice.call(arguments,2))}("onpageload"),o=gn.unique(function(t){var e,n=[];if(fe.ie&&fe.ie<11)return kh.initError("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(t.types)return hN(t.types,function(e){n=n.concat(gN.select(e.selector))}),n;if(t.selector)return gN.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":0<(e=t.elements||"").length&&hN(pN(e),function(t){var e;(e=gN.get(t))?n.push(e):hN(V.document.forms,function(e){hN(e.elements,function(e){e.name===t&&(t="mce_editor_"+yN++,gN.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":hN(gN.select("textarea"),function(e){t.editor_deselector&&l(e,t.editor_deselector)||t.editor_selector&&!l(e,t.editor_selector)||n.push(e)})}return n}(r)),r.types?hN(r.types,function(t){Xt.each(o,function(e){return!gN.is(e,t.selector)||(n(c(e),vN({},r,t),e),!1)})}):(Xt.each(o,function(e){var t;(t=s.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(EN(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(o=Xt.grep(o,function(e){return!s.get(e.id)})).length?f([]):hN(o,function(e){var t;t=e,r.inline&&t.tagName.toLowerCase()in u?kh.initError("Could not initialize inline editor on invalid inline target element",e):n(c(e),r,e)}))};return s.settings=r,gN.bind(window,"ready",e),new de(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?xN.slice(0):S(t)?X(xN,function(e){return e.id===t}).getOr(null):O(t)&&xN[t]?xN[t]:null},add:function(e){var t=this;return CN[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(CN[e.id]=e),CN.push(e),xN.push(e)),NN(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),rN||(rN=function(){t.fire("BeforeUnload")},gN.bind(window,"beforeunload",rN))),e},createEditor:function(e,t){return this.add(new tN(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!S(e))return n=e,A(r.get(n.id))?null:(EN(n)&&r.fire("RemoveEditor",{editor:n}),0===xN.length&&gN.unbind(window,"beforeunload",rN),n.remove(),NN(0<xN.length),n);hN(gN.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})}else for(t=xN.length-1;0<=t;t--)r.remove(xN[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new tN(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",0,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){hN(xN,function(e){e.save()})},addI18n:function(e,t){xh.add(e,t)},translate:function(e){return xh.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},Cp),oN.setup();var SN,TN=oN;function kN(n){return{walk:function(e,t){return Lc(n,e,t)},split:Um,normalize:function(t){return Dg(n,t).fold(q(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(SN=kN||(kN={})).compareRanges=Eg,SN.getCaretRangeFromPoint=Bb,SN.getSelectedNode=Za,SN.getNode=eu;var _N,AN,RN=kN,DN=Math.min,ON=Math.max,BN=Math.round,PN=function(e,t,n){var r,o,i,a,u,s;return r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=BN(s/2)),"c"===n[1]&&(r+=BN(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=BN(a/2)),"c"===n[4]&&(r-=BN(i/2)),IN(r,o,i,a)},IN=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},LN={inflate:function(e,t,n){return IN(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:PN,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=PN(e,t,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(e,t){var n,r,o,i;return n=ON(e.x,t.x),r=ON(e.y,t.y),o=DN(e.x+e.w,t.x+t.w),i=DN(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:IN(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=ON(0,t.x-u),o=ON(0,t.y-s),i=ON(0,c-f),a=ON(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),IN(u,s,(c-=i)-u,(l-=a)-s)},create:IN,fromClientRect:function(e){return IN(e.left,e.top,e.width,e.height)}},FN={},MN={add:function(e,t){FN[e.toLowerCase()]=t},has:function(e){return!!FN[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=FN.hasOwnProperty(t)?FN[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=FN[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},zN=Xt.each,UN=Xt.extend,jN=function(){};jN.extend=_N=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!AN&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in AN=!0,e=new this,AN=!1,n.Mixins&&(zN(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&zN(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&zN(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&zN(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=UN({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=_N,i};var VN=Math.min,HN=Math.max,qN=Math.round,$N=function(e,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"===t){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";r<e.length;r++)o+=(0<r?",":"")+$N(e[r],n);return o+"]"}for(i in o="{",e)e.hasOwnProperty(i)&&(o+="function"!=typeof e[i]?(1<o.length?","+n:n)+i+n+":"+$N(e[i],n):"");return o+"}"}return""+e},WN={serialize:$N,parse:function(e){try{return JSON.parse(e)}catch(t){}}},KN={callbacks:{},count:0,send:function(t){var n=this,r=Si.DOM,o=t.count!==undefined?t.count:n.count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},XN={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",XN.fire("beforeInitialize",{settings:e}),t=Rh()){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&Xt.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=XN.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};Xt.extend(XN,Cp);var YN,GN,JN,QN,ZN=Xt.extend,eE=function(e){this.settings=ZN({},e),this.count=0};eE.sendRPC=function(e){return(new eE).send(e)},eE.prototype={send:function(n){var r=n.error,o=n.success;(n=ZN(this.settings,n)).success=function(e,t){void 0===(e=WN.parse(e))&&(e={error:"JSON Parse error."}),e.error?r.call(n.error_scope||n.scope,e.error,t):o.call(n.success_scope||n.scope,e.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=WN.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",XN.send(n)}};try{YN=V.window.localStorage}catch(iE){GN={},JN=[],QN={getItem:function(e){var t=GN[e];return t||null},setItem:function(e,t){JN.push(e),GN[e]=String(t)},key:function(e){return JN[e]},removeItem:function(t){JN=JN.filter(function(e){return e===t}),delete GN[t]},clear:function(){JN=[],GN={}},length:0},Object.defineProperty(QN,"length",{get:function(){return JN.length},configurable:!1,enumerable:!1}),YN=QN}var tE,nE=TN,rE={geom:{Rect:LN},util:{Promise:de,Delay:he,Tools:Xt,VK:rv,URI:zw,Class:jN,EventDispatcher:vp,Observable:Cp,I18n:xh,XHR:XN,JSON:WN,JSONRequest:eE,JSONP:KN,LocalStorage:YN,Color:function(e){var n={},u=0,s=0,c=0,t=function(e){var t;return"object"==typeof e?"r"in e?(u=e.r,s=e.g,c=e.b):"v"in e&&function(e,t,n){var r,o,i,a;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=HN(0,VN(t,1)),n=HN(0,VN(n,1)),0!==t){switch(r=e/60,i=(o=n*t)*(1-Math.abs(r%2-1)),a=n-o,Math.floor(r)){case 0:u=o,s=i,c=0;break;case 1:u=i,s=o,c=0;break;case 2:u=0,s=o,c=i;break;case 3:u=0,s=i,c=o;break;case 4:u=i,s=0,c=o;break;case 5:u=o,s=0,c=i;break;default:u=s=c=0}u=qN(255*(u+a)),s=qN(255*(s+a)),c=qN(255*(c+a))}else u=s=c=qN(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(u=parseInt(t[1],10),s=parseInt(t[2],10),c=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(u=parseInt(t[1],16),s=parseInt(t[2],16),c=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(u=parseInt(t[1]+t[1],16),s=parseInt(t[2]+t[2],16),c=parseInt(t[3]+t[3],16)),u=u<0?0:255<u?255:u,s=s<0?0:255<s?255:s,c=c<0?0:255<c?255:c,n};return e&&t(e),n.toRgb=function(){return{r:u,g:s,b:c}},n.toHsv=function(){return e=u,t=s,n=c,o=0,(i=VN(e/=255,VN(t/=255,n/=255)))===(a=HN(e,HN(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:qN(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:qN(100*r),v:qN(100*o)});var e,t,n,r,o,i,a},n.toHex=function(){var e=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+e(u)+e(s)+e(c)},n.parse=t,n}},dom:{EventUtils:Se,Sizzle:St,DomQuery:gn,TreeWalker:go,DOMUtils:Si,ScriptLoader:Ri,RangeUtils:RN,Serializer:Eb,ControlSelection:Db,BookmarkManager:_b,Selection:uC,Event:Se.Event},html:{Styles:gi,Entities:ti,Node:sb,Schema:di,SaxParser:Mv,DomParser:bb,Writer:il,Serializer:al},ui:{Factory:MN},Env:fe,AddOnManager:Bi,Annotator:Hc,Formatter:Gy,UndoManager:ry,EditorCommands:pp,WindowManager:yh,NotificationManager:vh,EditorObservable:Fp,Shortcuts:Qp,Editor:tN,FocusManager:iN,EditorManager:TN,DOM:Si.DOM,ScriptLoader:Ri.ScriptLoader,PluginManager:Bi.PluginManager,ThemeManager:Bi.ThemeManager,trim:Xt.trim,isArray:Xt.isArray,is:Xt.is,toArray:Xt.toArray,makeMap:Xt.makeMap,each:Xt.each,map:Xt.map,grep:Xt.grep,inArray:Xt.inArray,extend:Xt.extend,create:Xt.create,walk:Xt.walk,createNS:Xt.createNS,resolve:Xt.resolve,explode:Xt.explode,_addCacheSuffix:Xt._addCacheSuffix,isOpera:fe.opera,isWebKit:fe.webkit,isIE:fe.ie,isGecko:fe.gecko,isMac:fe.mac},oE=nE=Xt.extend(nE,rE);tE=oE,window.tinymce=tE,window.tinyMCE=tE,function(e){if("object"==typeof module)try{module.exports=e}catch(t){}}(oE)}(window);!function(m){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=function(){},x=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}},C=function(e){return function(){return e}},o=function(e){return e};function b(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var t,n,r,i,g=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},f=C(!1),u=C(!0),a=function(){return c},c=(t=function(e){return e.isNone()},i={fold:function(e,t){return e()},is:f,isSome:f,isNone:u,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:C(null),getOrUndefined:C(undefined),or:r,orThunk:n,map:a,each:y,bind:a,exists:f,forall:u,filter:a,equals:t,equals_:t,toArray:function(){return[]},toString:C("none()")},Object.freeze&&Object.freeze(i),i),l=function(n){var e=C(n),t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:u,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return l(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?o:c},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(f,function(e){return t(n,e)})}};return o},R={some:l,none:a,from:function(e){return null===e||e===undefined?c:l(e)}},s=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===t}},d=s("string"),h=s("array"),p=s("boolean"),v=s("function"),w=s("number"),S=Array.prototype.slice,T=Array.prototype.indexOf,D=Array.prototype.push,O=function(e,t){return n=e,r=t,-1<T.call(n,r);var n,r},N=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1},E=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},k=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)},A=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},P=function(e,t,n){return function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n)}(e,function(e){n=t(n,e)}),n},I=function(e,t,n){return k(e,function(e){n=t(n,e)}),n},B=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n))return R.some(o)}return R.none()},W=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return R.some(n);return R.none()},M=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!h(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);D.apply(t,e[n])}return t},_=function(e,t){var n=E(e,t);return M(n)},L=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n))return!1;return!0},F=function(e){var t=S.call(e,0);return t.reverse(),t},j=(v(Array.from)&&Array.from,Object.keys),z=function(e,t){for(var n=j(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},H=function(e,n){return U(e,function(e,t){return{k:t,v:n(e,t)}})},U=function(e,r){var o={};return z(e,function(e,t){var n=r(e,t);o[n.k]=n.v}),o},q=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return k(t,function(e,t){r[e]=C(n[t])}),r}},V=function(e){return e.slice(0).sort()},G=function(e,t){throw new Error("All required keys ("+V(e).join(", ")+") were not specified. Specified keys were: "+V(t).join(", ")+".")},Y=function(e){throw new Error("Unsupported keys for object: "+V(e).join(", "))},X=function(t,e){if(!h(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");k(e,function(e){if(!d(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},K=function(e){var n=V(e);B(n,function(e,t){return t<n.length-1&&e===n[t+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})},J=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return X("required",o),X("optional",i),K(u),function(t){var n=j(t);L(o,function(e){return O(n,e)})||G(o,n);var e=A(n,function(e){return!O(u,e)});0<e.length&&Y(e);var r={};return k(o,function(e){r[e]=C(t[e])}),k(i,function(e){r[e]=C(Object.prototype.hasOwnProperty.call(t,e)?R.some(t[e]):R.none())}),r}},$=(m.Node.ATTRIBUTE_NODE,m.Node.CDATA_SECTION_NODE,m.Node.COMMENT_NODE),Q=m.Node.DOCUMENT_NODE,Z=(m.Node.DOCUMENT_TYPE_NODE,m.Node.DOCUMENT_FRAGMENT_NODE,m.Node.ELEMENT_NODE),ee=m.Node.TEXT_NODE,te=(m.Node.PROCESSING_INSTRUCTION_NODE,m.Node.ENTITY_REFERENCE_NODE,m.Node.ENTITY_NODE,m.Node.NOTATION_NODE,"undefined"!=typeof m.window?m.window:Function("return this;")()),ne=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:te,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},re=function(e,t){var n=ne(e,t);if(n===undefined||null===n)throw new Error(e+" not available on this browser");return n},oe=function(e){return e.dom().nodeName.toLowerCase()},ie=function(e){return e.dom().nodeType},ue=function(t){return function(e){return ie(e)===t}},ae=function(e){return ie(e)===$||"#comment"===oe(e)},ce=ue(Z),le=ue(ee),fe=function(e,t,n){if(!(d(n)||p(n)||w(n)))throw m.console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},se=function(e,t,n){fe(e.dom(),t,n)},de=function(e,t){var n=e.dom();z(t,function(e,t){fe(n,t,e)})},me=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},ge=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},he=function(e,t){e.dom().removeAttribute(t)},pe=function(e){return I(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},ve=function(e,t){return-1!==e.indexOf(t)},be=function(e){return e.style!==undefined&&v(e.style.getPropertyValue)},we=function(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}},ye=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:C(e)}},xe={fromHtml:function(e,t){var n=(t||m.document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw m.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return ye(n.childNodes[0])},fromTag:function(e,t){var n=(t||m.document).createElement(e);return ye(n)},fromText:function(e,t){var n=(t||m.document).createTextNode(e);return ye(n)},fromDom:ye,fromPoint:function(e,t,n){var r=e.dom();return R.from(r.elementFromPoint(t,n)).map(ye)}},Ce=function(e){var t=le(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)},Re=we(function(){return Se(xe.fromDom(m.document))}),Se=function(e){var t=e.dom().body;if(null===t||t===undefined)throw new Error("Body is not available yet");return xe.fromDom(t)},Te=function(e,t,n){if(!d(n))throw m.console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);be(e)&&e.style.setProperty(t,n)},De=function(e,t,n){var r=e.dom();Te(r,t,n)},Oe=function(e,t){var n=e.dom();z(t,function(e,t){Te(n,t,e)})},Ne=function(e,t){var n=e.dom(),r=m.window.getComputedStyle(n).getPropertyValue(t),o=""!==r||Ce(e)?r:Ee(n,t);return null===o?undefined:o},Ee=function(e,t){return be(e)?e.style.getPropertyValue(t):""},ke=function(e,t){var n=e.dom(),r=Ee(n,t);return R.from(r).filter(function(e){return 0<e.length})},Ae=function(e,t){var n,r,o=e.dom();r=t,be(n=o)&&n.style.removeProperty(r),ge(e,"style")&&""===me(e,"style").replace(/^\s+|\s+$/g,"")&&he(e,"style")},Pe=function(){return re("Node")},Ie=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},Be=function(e,t){return Ie(e,t,Pe().DOCUMENT_POSITION_CONTAINED_BY)},We=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return _e(r(1),r(2))},Me=function(){return _e(0,0)},_e=function(e,t){return{major:e,minor:t}},Le={nu:_e,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Me():We(e,n)},unknown:Me},Fe="Firefox",je=function(e,t){return function(){return t===e}},ze=function(e){var t=e.current;return{current:t,version:e.version,isEdge:je("Edge",t),isChrome:je("Chrome",t),isIE:je("IE",t),isOpera:je("Opera",t),isFirefox:je(Fe,t),isSafari:je("Safari",t)}},He={unknown:function(){return ze({current:undefined,version:Le.unknown()})},nu:ze,edge:C("Edge"),chrome:C("Chrome"),ie:C("IE"),opera:C("Opera"),firefox:C(Fe),safari:C("Safari")},Ue="Windows",qe="Android",Ve="Solaris",Ge="FreeBSD",Ye=function(e,t){return function(){return t===e}},Xe=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Ye(Ue,t),isiOS:Ye("iOS",t),isAndroid:Ye(qe,t),isOSX:Ye("OSX",t),isLinux:Ye("Linux",t),isSolaris:Ye(Ve,t),isFreeBSD:Ye(Ge,t)}},Ke={unknown:function(){return Xe({current:undefined,version:Le.unknown()})},nu:Xe,windows:C(Ue),ios:C("iOS"),android:C(qe),linux:C("Linux"),osx:C("OSX"),solaris:C(Ve),freebsd:C(Ge)},Je=function(e,t){var n=String(t).toLowerCase();return B(e,function(e){return e.search(n)})},$e=function(e,n){return Je(e,n).map(function(e){var t=Le.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Qe=function(e,n){return Je(e,n).map(function(e){var t=Le.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Ze=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,et=function(t){return function(e){return ve(e,t)}},tt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return ve(e,"edge/")&&ve(e,"chrome")&&ve(e,"safari")&&ve(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ze],search:function(e){return ve(e,"chrome")&&!ve(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return ve(e,"msie")||ve(e,"trident")}},{name:"Opera",versionRegexes:[Ze,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:et("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:et("firefox")},{name:"Safari",versionRegexes:[Ze,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(ve(e,"safari")||ve(e,"mobile/"))&&ve(e,"applewebkit")}}],nt=[{name:"Windows",search:et("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return ve(e,"iphone")||ve(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:et("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:et("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:et("linux"),versionRegexes:[]},{name:"Solaris",search:et("sunos"),versionRegexes:[]},{name:"FreeBSD",search:et("freebsd"),versionRegexes:[]}],rt={browsers:C(tt),oses:C(nt)},ot=function(e){var t,n,r,o,i,u,a,c,l,f,s,d=rt.browsers(),m=rt.oses(),g=$e(d,e).fold(He.unknown,He.nu),h=Qe(m,e).fold(Ke.unknown,Ke.nu);return{browser:g,os:h,deviceType:(n=g,r=e,o=(t=h).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,u=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,c=o||u||a&&!0===/mobile/i.test(r),l=t.isiOS()||t.isAndroid(),f=l&&!c,s=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:C(o),isiPhone:C(i),isTablet:C(c),isPhone:C(f),isTouch:C(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:C(s)})}},it={detect:we(function(){var e=m.navigator.userAgent;return ot(e)})},ut=Z,at=Q,ct=function(e,t){var n=e.dom();if(n.nodeType!==ut)return!1;var r=n;if(r.matches!==undefined)return r.matches(t);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(t);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(t);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},lt=function(e){return e.nodeType!==ut&&e.nodeType!==at||0===e.childElementCount},ft=function(e,t){return e.dom()===t.dom()},st=it.detect().browser.isIE()?function(e,t){return Be(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},dt=ct,mt=function(e){return xe.fromDom(e.dom().ownerDocument)},gt=function(e){return R.from(e.dom().parentNode).map(xe.fromDom)},ht=function(e,t){for(var n=v(t)?t:f,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=xe.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},pt=function(e){return R.from(e.dom().previousSibling).map(xe.fromDom)},vt=function(e){return R.from(e.dom().nextSibling).map(xe.fromDom)},bt=function(e){return E(e.dom().childNodes,xe.fromDom)},wt=function(e,t){var n=e.dom().childNodes;return R.from(n[t]).map(xe.fromDom)},yt=(q("element","offset"),function(t,n){gt(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})}),xt=function(e,t){vt(e).fold(function(){gt(e).each(function(e){Rt(e,t)})},function(e){yt(e,t)})},Ct=function(t,n){wt(t,0).fold(function(){Rt(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},Rt=function(e,t){e.dom().appendChild(t.dom())},St=function(e,t){yt(e,t),Rt(t,e)},Tt=function(r,o){k(o,function(e,t){var n=0===t?r:o[t-1];xt(n,e)})},Dt=function(t,e){k(e,function(e){Rt(t,e)})},Ot=function(e){e.dom().textContent="",k(bt(e),function(e){Nt(e)})},Nt=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Et=function(e){var t,n=bt(e);0<n.length&&(t=e,k(n,function(e){yt(t,e)})),Nt(e)},kt=(q("width","height"),q("width","height"),q("rows","columns")),At=q("row","column"),Pt=(q("x","y"),q("element","rowspan","colspan")),It=q("element","rowspan","colspan","isNew"),Bt=q("element","rowspan","colspan","row","column"),Wt=q("element","cells","section"),Mt=q("element","isNew"),_t=q("element","cells","section","isNew"),Lt=q("cells","section"),Ft=q("details","section"),jt=q("startRow","startCol","finishRow","finishCol"),zt=function(e,t){var n=[];return k(bt(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(zt(e,t))}),n},Ht=function(e,t,n){return r=function(e){return ct(e,t)},A(ht(e,n),r);var r},Ut=function(e,t){return n=function(e){return ct(e,t)},A(bt(e),n);var n},qt=function(e,t){return n=t,o=(r=e)===undefined?m.document:r.dom(),lt(o)?[]:E(o.querySelectorAll(n),xe.fromDom);var n,r,o};function Vt(e,t,n,r,o){return e(n,r)?R.some(n):v(o)&&o(n)?R.none():t(n,r,o)}var Gt,Yt,Xt,Kt=function(e,t,n){for(var r=e.dom(),o=v(n)?n:C(!1);r.parentNode;){r=r.parentNode;var i=xe.fromDom(r);if(t(i))return R.some(i);if(o(i))break}return R.none()},Jt=function(e,t,n){return Kt(e,function(e){return ct(e,t)},n)},$t=function(e,t){return n=function(e){return ct(e,t)},B(e.dom().childNodes,function(e){return n(xe.fromDom(e))}).map(xe.fromDom);var n},Qt=function(e,t){return n=t,o=(r=e)===undefined?m.document:r.dom(),lt(o)?R.none():R.from(o.querySelector(n)).map(xe.fromDom);var n,r,o},Zt=function(e,t,n){return Vt(ct,Jt,e,t,n)},en=function(e,t,n){return _(bt(e),function(e){return ct(e,t)?n(e)?[e]:[]:en(e,t,n)})},tn={firstLayer:function(e,t){return en(e,t,C(!0))},filterFirstLayer:en},nn=function(e,t,n){return void 0===n&&(n=f),n(t)?R.none():O(e,oe(t))?R.some(t):Jt(t,e.join(","),function(e){return ct(e,"table")||n(e)})},rn=function(t,e){return gt(e).map(function(e){return Ut(e,t)})},on=b(rn,"th,td"),un=b(rn,"tr"),an=function(e,t){return parseInt(me(e,t),10)},cn={cell:function(e,t){return nn(["td","th"],e,t)},firstCell:function(e){return Qt(e,"th,td")},cells:function(e){return tn.firstLayer(e,"th,td")},neighbourCells:on,table:function(e,t){return Zt(e,"table",t)},row:function(e,t){return nn(["tr"],e,t)},rows:function(e){return tn.firstLayer(e,"tr")},notCell:function(e,t){return nn(["caption","tr","tbody","tfoot","thead"],e,t)},neighbourRows:un,attr:an,grid:function(e,t,n){var r=an(e,t),o=an(e,n);return kt(r,o)}},ln=function(e){var t=cn.rows(e);return E(t,function(e){var t=e,n=gt(t).map(function(e){var t=oe(e);return"tfoot"===t||"thead"===t||"tbody"===t?t:"tbody"}).getOr("tbody"),r=E(cn.cells(e),function(e){var t=ge(e,"rowspan")?parseInt(me(e,"rowspan"),10):1,n=ge(e,"colspan")?parseInt(me(e,"colspan"),10):1;return Pt(e,t,n)});return Wt(t,r,n)})},fn=function(e,n){return E(e,function(e){var t=E(cn.cells(e),function(e){var t=ge(e,"rowspan")?parseInt(me(e,"rowspan"),10):1,n=ge(e,"colspan")?parseInt(me(e,"colspan"),10):1;return Pt(e,t,n)});return Wt(e,t,n.section())})},sn=function(e,t){return e+","+t},dn=function(e,t){var n=_(e.all(),function(e){return e.cells()});return A(n,t)},mn={generate:function(e){var l={},t=[],n=e.length,f=0;k(e,function(e,a){var c=[];k(e.cells(),function(e){for(var t=0;l[sn(a,t)]!==undefined;)t++;for(var n=Bt(e.element(),e.rowspan(),e.colspan(),a,t),r=0;r<e.colspan();r++)for(var o=0;o<e.rowspan();o++){var i=t+r,u=sn(a+o,i);l[u]=n,f=Math.max(f,i+1)}c.push(n)}),t.push(Wt(e.element(),c,e.section()))});var r=kt(n,f);return{grid:C(r),access:C(l),all:C(t)}},getAt:function(e,t,n){var r=e.access()[sn(t,n)];return r!==undefined?R.some(r):R.none()},findItem:function(e,t,n){var r=dn(e,function(e){return n(t,e.element())});return 0<r.length?R.some(r[0]):R.none()},filterItems:dn,justCells:function(e){var t=E(e.all(),function(e){return e.cells()});return M(t)}},gn=q("minRow","minCol","maxRow","maxCol"),hn=function(e,t){var n,i,r,u,a,c,l,o,f,s,d=function(e){return ct(e.element(),t)},m=ln(e),g=mn.generate(m),h=(i=d,r=(n=g).grid().columns(),u=n.grid().rows(),a=r,l=c=0,z(n.access(),function(e){if(i(e)){var t=e.row(),n=t+e.rowspan()-1,r=e.column(),o=r+e.colspan()-1;t<u?u=t:c<n&&(c=n),r<a?a=r:l<o&&(l=o)}}),gn(u,a,c,l)),p="th:not("+t+"),td:not("+t+")",v=tn.filterFirstLayer(e,"th,td",function(e){return ct(e,p)});return k(v,Nt),function(e,t,n,r){for(var o,i,u,a=t.grid().columns(),c=t.grid().rows(),l=0;l<c;l++)for(var f=!1,s=0;s<a;s++)l<n.minRow()||l>n.maxRow()||s<n.minCol()||s>n.maxCol()||(mn.getAt(t,l,s).filter(r).isNone()?(o=f,i=e[l].element(),u=xe.fromTag("td"),Rt(u,xe.fromTag("br")),(o?Rt:Ct)(i,u)):f=!0)}(m,g,h,d),o=e,f=h,s=A(tn.firstLayer(o,"tr"),function(e){return 0===e.dom().childElementCount}),k(s,Nt),f.minCol()!==f.maxCol()&&f.minRow()!==f.maxRow()||k(tn.firstLayer(o,"th,td"),function(e){he(e,"rowspan"),he(e,"colspan")}),he(o,"width"),he(o,"height"),Ae(o,"width"),Ae(o,"height"),e},pn=(Gt=le,Yt="text",{get:function(e){if(!Gt(e))throw new Error("Can only get "+Yt+" value of a "+Yt+" node");return Xt(e).getOr("")},getOption:Xt=function(e){return Gt(e)?R.from(e.dom().nodeValue):R.none()},set:function(e,t){if(!Gt(e))throw new Error("Can only set raw "+Yt+" value of a "+Yt+" node");e.dom().nodeValue=t}}),vn=function(e){return pn.get(e)},bn=function(e){return pn.getOption(e)},wn=function(e,t){pn.set(e,t)},yn=function(e){return"img"===oe(e)?1:bn(e).fold(function(){return bt(e).length},function(e){return e.length})},xn=["img","br"],Cn=function(e){return bn(e).filter(function(e){return 0!==e.trim().length||-1<e.indexOf("\xa0")}).isSome()||O(xn,oe(e))},Rn=function(e){return o=Cn,(i=function(e){for(var t=0;t<e.childNodes.length;t++){var n=xe.fromDom(e.childNodes[t]);if(o(n))return R.some(n);var r=i(e.childNodes[t]);if(r.isSome())return r}return R.none()})(e.dom());var o,i},Sn=function(e){return Tn(e,Cn)},Tn=function(e,i){var u=function(e){for(var t=bt(e),n=t.length-1;0<=n;n--){var r=t[n];if(i(r))return R.some(r);var o=u(r);if(o.isSome())return o}return R.none()};return u(e)},Dn=function(e,t){return xe.fromDom(e.dom().cloneNode(t))},On=function(e){return Dn(e,!1)},Nn=function(e){return Dn(e,!0)},En=function(e,t){var n,r,o,i,u=(n=e,r=t,o=xe.fromTag(r),i=pe(n),de(o,i),o),a=bt(Nn(e));return Dt(u,a),u},kn=function(){var e=xe.fromTag("td");return Rt(e,xe.fromTag("br")),e},An=function(e,t,n){var r=En(e,t);return z(n,function(e,t){null===e?he(r,t):se(r,t,e)}),r},Pn=function(e){return e},In=function(e){return function(){return xe.fromTag("tr",e.dom())}},Bn=function(d,e,m){return{row:In(e),cell:function(e){var r,o,i,t,n,u,a,c=mt(e.element()),l=xe.fromTag(oe(e.element()),c.dom()),f=m.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),s=0<f.length?(r=e.element(),o=l,i=f,Rn(r).map(function(e){var t=i.join(","),n=Ht(e,t,function(e){return ft(e,r)});return P(n,function(e,t){var n=On(t);return he(n,"contenteditable"),Rt(e,n),n},o)}).getOr(o)):l;return Rt(s,xe.fromTag("br")),t=e.element(),n=l,u=t.dom(),a=n.dom(),be(u)&&be(a)&&(a.style.cssText=u.style.cssText),Ae(l,"height"),1!==e.colspan()&&Ae(e.element(),"width"),d(e.element(),l),l},replace:An,gap:kn}},Wn=function(e){return{row:In(e),cell:kn,replace:Pn,gap:kn}},Mn=function(e,t){return t.column()>=e.startCol()&&t.column()+t.colspan()-1<=e.finishCol()&&t.row()>=e.startRow()&&t.row()+t.rowspan()-1<=e.finishRow()},_n=function(e,t){var n=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return n<=e.finishCol()&&r>=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},Ln=function(e,t){for(var n=!0,r=b(Mn,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)n=n&&mn.getAt(e,o,i).exists(r);return n?R.some(t):R.none()},Fn=function(e,t,n){var r=mn.findItem(e,t,ft),o=mn.findItem(e,n,ft);return r.bind(function(r){return o.map(function(e){return t=r,n=e,jt(Math.min(t.row(),n.row()),Math.min(t.column(),n.column()),Math.max(t.row()+t.rowspan()-1,n.row()+n.rowspan()-1),Math.max(t.column()+t.colspan()-1,n.column()+n.colspan()-1));var t,n})})},jn=Fn,zn=function(t,e,n){return Fn(t,e,n).bind(function(e){return Ln(t,e)})},Hn=function(r,e,o,i){return mn.findItem(r,e,ft).bind(function(e){var t=0<o?e.row()+e.rowspan()-1:e.row(),n=0<i?e.column()+e.colspan()-1:e.column();return mn.getAt(r,t+o,n+i).map(function(e){return e.element()})})},Un=function(n,e,t){return jn(n,e,t).map(function(e){var t=mn.filterItems(n,b(_n,e));return E(t,function(e){return e.element()})})},qn=function(e,t){return mn.findItem(e,t,function(e,t){return st(t,e)}).map(function(e){return e.element()})},Vn=function(e){var t=ln(e);return mn.generate(t)},Gn=function(n,r,o){return cn.table(n).bind(function(e){var t=Vn(e);return Hn(t,n,r,o)})},Yn=function(e,t,n){var r=Vn(e);return Un(r,t,n)},Xn=function(e,t,n,r,o){var i=Vn(e),u=ft(e,n)?R.some(t):qn(i,t),a=ft(e,o)?R.some(r):qn(i,r);return u.bind(function(t){return a.bind(function(e){return Un(i,t,e)})})},Kn=function(e,t,n){var r=Vn(e);return zn(r,t,n)},Jn=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function $n(){return{up:C({selector:Jt,closest:Zt,predicate:Kt,all:ht}),down:C({selector:qt,predicate:zt}),styles:C({get:Ne,getRaw:ke,set:De,remove:Ae}),attrs:C({get:me,set:se,remove:he,copyTo:function(e,t){var n=pe(e);de(t,n)}}),insert:C({before:yt,after:xt,afterAll:Tt,append:Rt,appendAll:Dt,prepend:Ct,wrap:St}),remove:C({unwrap:Et,remove:Nt}),create:C({nu:xe.fromTag,clone:function(e){return xe.fromDom(e.dom().cloneNode(!1))},text:xe.fromText}),query:C({comparePosition:function(e,t){return e.dom().compareDocumentPosition(t.dom())},prevSibling:pt,nextSibling:vt}),property:C({children:bt,name:oe,parent:gt,document:function(e){return e.dom().ownerDocument},isText:le,isComment:ae,isElement:ce,getText:vn,setText:wn,isBoundary:function(e){return!!ce(e)&&("body"===oe(e)||O(Jn,oe(e)))},isEmptyTag:function(e){return!!ce(e)&&O(["br","img","hr","input"],oe(e))}}),eq:ft,is:dt}}var Qn=q("left","right"),Zn=q("first","second","splits"),er=function(e,t,n){var r=e.property().children(t);return W(r,b(e.eq,n)).map(function(e){return{before:C(r.slice(0,e)),after:C(r.slice(e+1))}})},tr=function(r,o,e,t){var n=o(r,e);return P(t,function(e,t){var n=o(r,t);return nr(r,e,n)},n)},nr=function(t,e,n){return e.bind(function(e){return n.filter(b(t.eq,e))})},rr=function(e,t){return b(e.eq,t)},or=function(t,e,n,r){void 0===r&&(r=f);var o=[e].concat(t.up().all(e)),i=[n].concat(t.up().all(n)),u=function(t){return W(t,r).fold(function(){return t},function(e){return t.slice(0,e+1)})},a=u(o),c=u(i),l=B(a,function(e){return N(c,rr(t,e))});return{firstpath:C(a),secondpath:C(c),shared:C(l)}},ir={sharedOne:function(e,t,n){return 0<n.length?tr(e,t,(r=n)[0],r.slice(1)):R.none();var r},subset:function(t,e,n){var r=or(t,e,n);return r.shared().bind(function(e){return function(o,i,e,t){var u=o.property().children(i);if(o.eq(i,e[0]))return R.some([e[0]]);if(o.eq(i,t[0]))return R.some([t[0]]);var n=function(e){var t=F(e),n=W(t,rr(o,i)).getOr(-1),r=n<t.length-1?t[n+1]:t[n];return W(u,rr(o,r))},r=n(e),a=n(t);return r.bind(function(r){return a.map(function(e){var t=Math.min(r,e),n=Math.max(r,e);return u.slice(t,n+1)})})}(t,e,r.firstpath(),r.secondpath())})},ancestors:or,breakToLeft:function(n,r,o){return er(n,r,o).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.before().concat([o])),n.insert().appendAll(r,e.after()),n.insert().before(r,t),Qn(t,r)})},breakToRight:function(n,r,e){return er(n,r,e).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.after()),n.insert().after(r,t),Qn(r,t)})},breakPath:function(i,e,u,a){var c=function(e,t,o){var n=Zn(e,R.none(),o);return u(e)?Zn(e,t,o):i.property().parent(e).bind(function(r){return a(i,r,e).map(function(e){var t=[{first:e.left,second:e.right}],n=u(r)?r:e.left();return c(n,R.some(e.right()),o.concat(t))})}).getOr(n)};return c(e,R.none(),[])}},ur=$n(),ar={sharedOne:function(n,e){return ir.sharedOne(ur,function(e,t){return n(t)},e)},subset:function(e,t){return ir.subset(ur,e,t)},ancestors:function(e,t,n){return ir.ancestors(ur,e,t,n)},breakToLeft:function(e,t){return ir.breakToLeft(ur,e,t)},breakToRight:function(e,t){return ir.breakToRight(ur,e,t)},breakPath:function(e,t,r){return ir.breakPath(ur,e,t,function(e,t,n){return r(t,n)})}},cr={create:J(["boxes","start","finish"],[])},lr=function(e){return Jt(e,"table")},fr=function(a,c,r){var l=function(t){return function(e){return r!==undefined&&r(e)||ft(e,t)}};return ft(a,c)?R.some(cr.create({boxes:R.some([a]),start:a,finish:c})):lr(a).bind(function(u){return lr(c).bind(function(i){if(ft(u,i))return R.some(cr.create({boxes:Yn(u,a,c),start:a,finish:c}));if(st(u,i)){var e=0<(t=Ht(c,"td,th",l(u))).length?t[t.length-1]:c;return R.some(cr.create({boxes:Xn(u,a,u,c,i),start:a,finish:e}))}if(st(i,u)){var t,n=0<(t=Ht(a,"td,th",l(i))).length?t[t.length-1]:a;return R.some(cr.create({boxes:Xn(i,a,u,c,i),start:a,finish:n}))}return ar.ancestors(a,c).shared().bind(function(e){return Zt(e,"table",r).bind(function(e){var t=Ht(c,"td,th",l(e)),n=0<t.length?t[t.length-1]:c,r=Ht(a,"td,th",l(e)),o=0<r.length?r[r.length-1]:a;return R.some(cr.create({boxes:Xn(e,a,u,c,i),start:o,finish:n}))})})})})},sr=fr,dr=function(e,t){var n=qt(e,t);return 0<n.length?R.some(n):R.none()},mr=function(e,t,n,r,o){return(i=e,u=o,B(i,function(e){return ct(e,u)})).bind(function(e){return Gn(e,t,n).bind(function(e){return n=r,Jt(t=e,"table").bind(function(e){return Qt(e,n).bind(function(e){return fr(e,t).bind(function(t){return t.boxes().map(function(e){return{boxes:C(e),start:C(t.start()),finish:C(t.finish())}})})})});var t,n})});var i,u},gr=function(e,t,r){return Qt(e,t).bind(function(n){return Qt(e,r).bind(function(t){return ar.sharedOne(lr,[n,t]).map(function(e){return{first:C(n),last:C(t),table:C(e)}})})})},hr=function(e,t){return dr(e,t)},pr=function(o,e,t){return gr(o,e,t).bind(function(n){var e=function(e){return ft(o,e)},t=Jt(n.first(),"thead,tfoot,tbody,table",e),r=Jt(n.last(),"thead,tfoot,tbody,table",e);return t.bind(function(t){return r.bind(function(e){return ft(t,e)?Kn(n.table(),n.first(),n.last()):R.none()})})})},vr="data-mce-selected",br="data-mce-first-selected",wr="data-mce-last-selected",yr={selected:C(vr),selectedSelector:C("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:C("[data-mce-selected]"),firstSelected:C(br),firstSelectedSelector:C("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:C(wr),lastSelectedSelector:C("td[data-mce-last-selected],th[data-mce-last-selected]")},xr=function(u){if(!h(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],n={};return k(u,function(e,r){var t=j(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!h(i))throw new Error("case arguments must be an array");a.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=j(e);if(a.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+t.join(","));if(!L(a,function(e){return O(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+a.join(", "));return e[o].apply(null,n)},log:function(e){m.console.log(e,{constructors:a,constructor:o,params:n})}}}}),n},Cr=xr([{none:[]},{multiple:["elements"]},{single:["selection"]}]),Rr={cata:function(e,t,n,r){return e.fold(t,n,r)},none:Cr.none,multiple:Cr.multiple,single:Cr.single},Sr=function(e,t){return Rr.cata(t.get(),C([]),o,C([e]))},Tr=function(n,e){return Rr.cata(e.get(),R.none,function(t,e){return 0===t.length?R.none():pr(n,yr.firstSelectedSelector(),yr.lastSelectedSelector()).bind(function(e){return 1<t.length?R.some({bounds:C(e),cells:C(t)}):R.none()})},R.none)},Dr=function(e,t){var n=Sr(e,t);return 0<n.length&&L(n,function(e){return ge(e,"rowspan")&&1<parseInt(me(e,"rowspan"),10)||ge(e,"colspan")&&1<parseInt(me(e,"colspan"),10)})?R.some(n):R.none()},Or=Sr,Nr=function(e){return{element:C(e),mergable:R.none,unmergable:R.none,selection:C([e])}},Er=q("element","clipboard","generators"),kr={noMenu:Nr,forMenu:function(e,t,n){return{element:C(n),mergable:C(Tr(t,e)),unmergable:C(Dr(n,e)),selection:C(Or(n,e))}},notCell:function(e){return Nr(e)},paste:Er,pasteRows:function(e,t,n,r,o){return{element:C(n),mergable:R.none,unmergable:R.none,selection:C(Or(n,e)),clipboard:C(r),generators:C(o)}}},Ar=function(f,e,s,d){f.on("BeforeGetContent",function(n){!0===n.selection&&Rr.cata(e.get(),y,function(e){var t;n.preventDefault(),(t=e,cn.table(t[0]).map(Nn).map(function(e){return[hn(e,yr.attributeSelector())]})).each(function(e){var t;n.content="text"===n.format?E(e,function(e){return e.dom().innerText}).join(""):(t=f,E(e,function(e){return t.selection.serializer.serialize(e.dom(),{})}).join(""))})},y)}),f.on("BeforeSetContent",function(l){!0===l.selection&&!0===l.paste&&R.from(f.dom.getParent(f.selection.getStart(),"th,td")).each(function(e){var c=xe.fromDom(e);cn.table(c).each(function(t){var e,n,r,o=A((e=l.content,(r=(n||m.document).createElement("div")).innerHTML=e,bt(xe.fromDom(r))),function(e){return"meta"!==oe(e)});if(1===o.length&&"table"===oe(o[0])){l.preventDefault();var i=xe.fromDom(f.getDoc()),u=Wn(i),a=kr.paste(c,o[0],u);s.pasteCells(t,a).each(function(e){f.selection.setRng(e),f.focus(),d.clear(t)})}})})})};function Pr(r,o){var e=function(e){var t=o(e);if(t<=0||null===t){var n=Ne(e,r);return parseFloat(n)||0}return t},i=function(o,e){return I(e,function(e,t){var n=Ne(o,t),r=n===undefined?0:parseInt(n,10);return isNaN(r)?e:e+r},0)};return{set:function(e,t){if(!w(t)&&!t.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+t);var n=e.dom();be(n)&&(n.style[r]=t+"px")},get:e,getOuter:e,aggregate:i,max:function(e,t,n){var r=i(e,n);return r<t?t-r:0}}}var Ir=Pr("height",function(e){var t=e.dom();return Ce(e)?t.getBoundingClientRect().height:t.offsetHeight}),Br=function(e){return Ir.get(e)},Wr=function(e){return Ir.getOuter(e)},Mr=Pr("width",function(e){return e.dom().offsetWidth}),_r=function(e){return Mr.get(e)},Lr=function(e){return Mr.getOuter(e)},Fr=it.detect(),jr=function(e,t,n){return r=Ne(e,t),o=n,i=parseFloat(r),isNaN(i)?o:i;var r,o,i},zr=function(e){return Fr.browser.isIE()||Fr.browser.isEdge()?(n=jr(t=e,"padding-top",0),r=jr(t,"padding-bottom",0),o=jr(t,"border-top-width",0),i=jr(t,"border-bottom-width",0),u=t.dom().getBoundingClientRect().height,"border-box"===Ne(t,"box-sizing")?u:u-n-r-(o+i)):jr(e,"height",Br(e));var t,n,r,o,i,u},Hr=/(\d+(\.\d+)?)(\w|%)*/,Ur=/(\d+(\.\d+)?)%/,qr=/(\d+(\.\d+)?)px|em/,Vr=function(e,t){De(e,"height",t+"px")},Gr=function(e,t,n,r){var o,i,u,a,c,l,f,s,d,m=parseInt(e,10);return s=l="%",d=(f=e).length-l.length,""!==s&&(f.length<s.length||f.substr(d,d+s.length)!==s)||"table"===oe(t)?m:(o=t,i=m,u=n,a=r,c=cn.table(o).map(function(e){var t=u(e);return Math.floor(i/100*t)}).getOr(i),a(o,c),c)},Yr=function(e){var t,n=ke(t=e,"height").getOrThunk(function(){return zr(t)+"px"});return n?Gr(n,e,Br,Vr):Br(e)},Xr=function(e,t){return ge(e,t)?parseInt(me(e,t),10):1},Kr=function(e){return ke(e,"width").fold(function(){return R.from(me(e,"width"))},function(e){return R.some(e)})},Jr=function(e,t){return e/t.pixelWidth()*100},$r={percentageBasedSizeRegex:C(Ur),pixelBasedSizeRegex:C(qr),setPixelWidth:function(e,t){De(e,"width",t+"px")},setPercentageWidth:function(e,t){De(e,"width",t+"%")},setHeight:Vr,getPixelWidth:function(t,n){return Kr(t).fold(function(){return _r(t)},function(e){return function(e,t,n){var r=qr.exec(t);if(null!==r)return parseInt(r[1],10);var o=Ur.exec(t);if(null!==o){var i=parseFloat(o[1]);return i/100*n.pixelWidth()}return _r(e)}(t,e,n)})},getPercentageWidth:function(t,n){return Kr(t).fold(function(){var e=_r(t);return Jr(e,n)},function(e){return function(e,t,n){var r=Ur.exec(t);if(null!==r)return parseFloat(r[1]);var o=_r(e);return Jr(o,n)}(t,e,n)})},getGenericWidth:function(e){return Kr(e).bind(function(e){var t=Hr.exec(e);return null!==t?R.some({width:C(parseFloat(t[1])),unit:C(t[3])}):R.none()})},setGenericWidth:function(e,t,n){De(e,"width",t+n)},getHeight:function(e){return n="rowspan",Yr(t=e)/Xr(t,n);var t,n},getRawWidth:Kr},Qr=function(n,r){$r.getGenericWidth(n).each(function(e){var t=e.width()/2;$r.setGenericWidth(n,t,e.unit()),$r.setGenericWidth(r,t,e.unit())})},Zr=function(n,r){return{left:C(n),top:C(r),translate:function(e,t){return Zr(n+e,r+t)}}},eo=Zr,to=function(e,t){return e!==undefined?e:t!==undefined?t:0},no=function(e){var t=e.dom().ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement,i=to(r.pageYOffset,o.scrollTop),u=to(r.pageXOffset,o.scrollLeft),a=to(o.clientTop,n.clientTop),c=to(o.clientLeft,n.clientLeft);return ro(e).translate(u-c,i-a)},ro=function(e){var t,n=e.dom(),r=n.ownerDocument.body;return r===n?eo(r.offsetLeft,r.offsetTop):Ce(e)?(t=n.getBoundingClientRect(),eo(t.left,t.top)):eo(0,0)},oo=q("row","y"),io=q("col","x"),uo=function(e){return no(e).left()+Lr(e)},ao=function(e){return no(e).left()},co=function(e,t){return io(e,ao(t))},lo=function(e,t){return io(e,uo(t))},fo=function(e){return no(e).top()},so=function(e,t){return oo(e,fo(t))},mo=function(e,t){return oo(e,fo(t)+Wr(t))},go=function(n,t,r){if(0===r.length)return[];var e=E(r.slice(1),function(e,t){return e.map(function(e){return n(t,e)})}),o=r[r.length-1].map(function(e){return t(r.length-1,e)});return e.concat([o])},ho={height:{delta:o,positions:function(e){return go(so,mo,e)},edge:fo},rtl:{delta:function(e){return-e},edge:uo,positions:function(e){return go(lo,co,e)}},ltr:{delta:o,edge:ao,positions:function(e){return go(co,lo,e)}}},po={ltr:ho.ltr,rtl:ho.rtl};function vo(t){var n=function(e){return t(e).isRtl()?po.rtl:po.ltr};return{delta:function(e,t){return n(t).delta(e,t)},edge:function(e){return n(e).edge(e)},positions:function(e,t){return n(t).positions(e,t)}}}var bo=function(e){var t=ln(e);return mn.generate(t).grid()},wo=function(){return(wo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},yo=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},xo=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return R.none()},Co=function(e,t,n,r){n===r?he(e,t):se(e,t,n)},Ro=function(o,e){var i=[],u=[],t=function(e,t){0<e.length?function(e,t){var n=$t(o,t).getOrThunk(function(){var e=xe.fromTag(t,mt(o).dom());return Rt(o,e),e});Ot(n);var r=E(e,function(e){e.isNew()&&i.push(e.element());var t=e.element();return Ot(t),k(e.cells(),function(e){e.isNew()&&u.push(e.element()),Co(e.element(),"colspan",e.colspan(),1),Co(e.element(),"rowspan",e.rowspan(),1),Rt(t,e.element())}),t});Dt(n,r)}(e,t):$t(o,t).each(Nt)},n=[],r=[],a=[];return k(e,function(e){switch(e.section()){case"thead":n.push(e);break;case"tbody":r.push(e);break;case"tfoot":a.push(e)}}),t(n,"thead"),t(r,"tbody"),t(a,"tfoot"),{newRows:C(i),newCells:C(u)}},So=function(e){return E(e,function(e){var n=On(e.element());return k(e.cells(),function(e){var t=Nn(e.element());Co(t,"colspan",e.colspan(),1),Co(t,"rowspan",e.rowspan(),1),Rt(n,t)}),n})},To=function(e,t){var n=me(e,t);return n===undefined||""===n?[]:n.split(" ")},Do=function(e){return e.dom().classList!==undefined},Oo=function(e,t){return o=t,i=To(n=e,r="class").concat([o]),se(n,r,i.join(" ")),!0;var n,r,o,i},No=function(e,t){return o=t,0<(i=A(To(n=e,r="class"),function(e){return e!==o})).length?se(n,r,i.join(" ")):he(n,r),!1;var n,r,o,i},Eo=function(e,t){Do(e)?e.dom().classList.add(t):Oo(e,t)},ko=function(e){0===(Do(e)?e.dom().classList:To(e,"class")).length&&he(e,"class")},Ao=function(e,t){return Do(e)&&e.dom().classList.contains(t)},Po=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n},Io=function(t,n){if(n<0||n>=t.length-1)return R.none();var e=t[n].fold(function(){var e=F(t.slice(0,n));return xo(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return R.some({value:e,delta:0})}),r=t[n+1].fold(function(){var e=t.slice(n+1);return xo(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return R.some({value:e,delta:1})});return e.bind(function(n){return r.map(function(e){var t=e.delta+n.delta;return Math.abs(e.value-n.value)/t})})},Bo=function(e,t,n){var r=e();return B(r,t).orThunk(function(){return R.from(r[0]).orThunk(n)}).map(function(e){return e.element()})},Wo=function(n){var e=n.grid(),t=Po(0,e.columns()),r=Po(0,e.rows());return E(t,function(t){return Bo(function(){return _(r,function(e){return mn.getAt(n,e,t).filter(function(e){return e.column()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.colspan()},function(){return mn.getAt(n,0,t)})})},Mo=function(n){var e=n.grid(),t=Po(0,e.rows()),r=Po(0,e.columns());return E(t,function(t){return Bo(function(){return _(r,function(e){return mn.getAt(n,t,e).filter(function(e){return e.row()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.rowspan()},function(){return mn.getAt(n,t,0)})})},_o=function(e){var t=e.replace(/\./g,"-");return{resolve:function(e){return t+"-"+e}}},Lo={resolve:_o("ephox-snooker").resolve},Fo=function(e,t,n,r,o){var i=xe.fromTag("div");return Oe(i,{position:"absolute",left:t-r/2+"px",top:n+"px",height:o+"px",width:r+"px"}),de(i,{"data-column":e,role:"presentation"}),i},jo=function(e,t,n,r,o){var i=xe.fromTag("div");return Oe(i,{position:"absolute",left:t+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),de(i,{"data-row":e,role:"presentation"}),i},zo=Lo.resolve("resizer-bar"),Ho=Lo.resolve("resizer-rows"),Uo=Lo.resolve("resizer-cols"),qo=function(e){var t=qt(e.parent(),"."+zo);k(t,Nt)},Vo=function(n,e,r){var o=n.origin();k(e,function(e,t){e.each(function(e){var t=r(o,e);Eo(t,zo),Rt(n.parent(),t)})})},Go=function(e,t,n,r,o,i){var u,a,c,l,f=no(t),s=0<n.length?o.positions(n,t):[];u=e,a=s,c=f,l=Lr(t),Vo(u,a,function(e,t){var n=jo(t.row(),c.left()-e.left(),t.y()-e.top(),l,7);return Eo(n,Ho),n});var d,m,g,h,p=0<r.length?i.positions(r,t):[];d=e,m=p,g=f,h=Wr(t),Vo(d,m,function(e,t){var n=Fo(t.col(),t.x()-e.left(),g.top()-e.top(),7,h);return Eo(n,Uo),n})},Yo=function(e,t){var n=qt(e.parent(),"."+zo);k(n,t)},Xo=function(e,t,n,r){qo(e);var o=ln(t),i=mn.generate(o),u=Mo(i),a=Wo(i);Go(e,t,u,a,n,r)},Ko=function(e){Yo(e,function(e){De(e,"display","none")})},Jo=function(e){Yo(e,function(e){De(e,"display","block")})},$o=qo,Qo=function(e){return Ao(e,Ho)},Zo=function(e){return Ao(e,Uo)},ei=function(e,t){return Lt(t,e.section())},ti=function(e,t){return e.cells()[t]},ni={addCell:function(e,t,n){var r=e.cells(),o=r.slice(0,t),i=r.slice(t),u=o.concat([n]).concat(i);return ei(e,u)},setCells:ei,mutateCell:function(e,t,n){e.cells()[t]=n},getCell:ti,getCellElement:function(e,t){return ti(e,t).element()},mapCells:function(e,t){var n=e.cells(),r=E(n,t);return Lt(r,e.section())},cellLength:function(e){return e.cells().length}},ri=function(e,t){if(0===e.length)return 0;var n=e[0];return W(e,function(e){return!t(n.element(),e.element())}).fold(function(){return e.length},function(e){return e})},oi=function(e,t,n,r){var o,i,u,a,c=(o=e,i=t,o[i]).cells().slice(n),l=ri(c,r),f=(u=e,a=n,E(u,function(e){return ni.getCell(e,a)})).slice(t),s=ri(f,r);return{colspan:C(l),rowspan:C(s)}},ii=function(o,i){var u=E(o,function(e,t){return E(e.cells(),function(e,t){return!1})});return E(o,function(e,r){var t=_(e.cells(),function(e,t){if(!1===u[r][t]){var n=oi(o,r,t,i);return function(e,t,n,r){for(var o=e;o<e+n;o++)for(var i=t;i<t+r;i++)u[o][i]=!0}(r,t,n.rowspan(),n.colspan()),[It(e.element(),n.rowspan(),n.colspan(),e.isNew())]}return[]});return Ft(t,e.section())})},ui=function(e,t,n){for(var r=[],o=0;o<e.grid().rows();o++){for(var i=[],u=0;u<e.grid().columns();u++){var a=mn.getAt(e,o,u).map(function(e){return Mt(e.element(),n)}).getOrThunk(function(){return Mt(t.gap(),!0)});i.push(a)}var c=Lt(i,e.all()[o].section());r.push(c)}return r},ai=function(e,r){return E(e,function(e){var t,n=(t=e.details(),xo(t,function(e){return gt(e.element()).map(function(e){var t=gt(e).isNone();return Mt(e,t)})}).getOrThunk(function(){return Mt(r.row(),!0)}));return _t(n.element(),e.details(),e.section(),n.isNew())})},ci=function(e,t){var n=ii(e,ft);return ai(n,t)},li=function(e,t){var n=M(E(e.all(),function(e){return e.cells()}));return B(n,function(e){return ft(t,e.element())})},fi=function(a,c,l,f,s){return function(n,r,e,o,i){var t=ln(r),u=mn.generate(t);return c(u,e).map(function(e){var t=ui(u,o,!1),n=a(t,e,ft,s(o)),r=ci(n.grid(),o);return{grid:C(r),cursor:n.cursor}}).fold(function(){return R.none()},function(e){var t=Ro(r,e.grid());return l(r,e.grid(),i),f(r),Xo(n,r,ho.height,i),R.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})})}},si=function(t,e){return cn.cell(e.element()).bind(function(e){return li(t,e)})},di=function(t,e){var n=E(e.selection(),function(e){return cn.cell(e).bind(function(e){return li(t,e)})}),r=yo(n);return 0<r.length?R.some({cells:r,generators:e.generators,clipboard:e.clipboard}):R.none()},mi=function(t,e){var n=E(e.selection(),function(e){return cn.cell(e).bind(function(e){return li(t,e)})}),r=yo(n);return 0<r.length?R.some(r):R.none()},gi=function(n){return{is:function(e){return n===e},isValue:u,isError:f,getOr:C(n),getOrThunk:C(n),getOrDie:C(n),or:function(e){return gi(n)},orThunk:function(e){return gi(n)},fold:function(e,t){return t(n)},map:function(e){return gi(e(n))},mapError:function(e){return gi(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return R.some(n)}}},hi=function(n){return{is:f,isValue:f,isError:u,getOr:o,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return hi(n)},mapError:function(e){return hi(e(n))},each:y,bind:function(e){return hi(n)},exists:f,forall:u,toOption:R.none}},pi={value:gi,error:hi,fromOption:function(e,t){return e.fold(function(){return hi(t)},gi)}},vi=function(e,t){return E(e,function(){return Mt(t.cell(),!0)})},bi=function(t,e,n){return t.concat(function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n}(e,function(e){return ni.setCells(t[t.length-1],vi(t[t.length-1].cells(),n))}))},wi=function(e,t,n){return E(e,function(e){return ni.setCells(e,e.cells().concat(vi(Po(0,t),n)))})},yi=function(e,t,n){if(e.row()>=t.length||e.column()>ni.cellLength(t[0]))return pi.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=t.slice(e.row()),o=r[0].cells().slice(e.column()),i=ni.cellLength(n[0]),u=n.length;return pi.value({rowDelta:C(r.length-u),colDelta:C(o.length-i)})},xi=function(e,t){var n=ni.cellLength(e[0]),r=ni.cellLength(t[0]);return{rowDelta:C(0),colDelta:C(n-r)}},Ci=function(e,t,n){var r=t.colDelta()<0?wi:o;return(t.rowDelta()<0?bi:o)(r(e,Math.abs(t.colDelta()),n),Math.abs(t.rowDelta()),n)},Ri=function(e,t,n,r){if(0===e.length)return e;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)ni.mutateCell(e[o],i,Mt(r(),!1));return e},Si=function(e,t,n,r){for(var o=!0,i=0;i<e.length;i++)for(var u=0;u<ni.cellLength(e[0]);u++){var a=n(ni.getCellElement(e[i],u),t);!0===a&&!1===o?ni.mutateCell(e[i],u,Mt(r(),!0)):!0===a&&(o=!1)}return e},Ti=function(i,n,u,a){if(0<n&&n<i.length){var e=i[n-1].cells(),t=(r=u,I(e,function(e,t){return N(e,function(e){return r(e.element(),t.element())})?e:e.concat([t])},[]));k(t,function(r){for(var o=R.none(),e=function(n){for(var e=function(t){var e=i[n].cells()[t];u(e.element(),r.element())&&(o.isNone()&&(o=R.some(a())),o.each(function(e){ni.mutateCell(i[n],t,Mt(e,!0))}))},t=0;t<ni.cellLength(i[0]);t++)e(t)},t=n;t<i.length;t++)e(t)})}var r;return i},Di=function(n,r,o,i,u){return yi(n,r,o).map(function(e){var t=Ci(r,e,i);return function(e,t,n,r,o){for(var i,u,a,c,l,f=e.row(),s=e.column(),d=f+n.length,m=s+ni.cellLength(n[0]),g=f;g<d;g++)for(var h=s;h<m;h++){i=t,u=g,a=h,l=c=void 0,c=b(o,ni.getCell(i[u],a).element()),l=i[u],1<i.length&&1<ni.cellLength(l)&&(0<a&&c(ni.getCellElement(l,a-1))||a<l.cells().length-1&&c(ni.getCellElement(l,a+1))||0<u&&c(ni.getCellElement(i[u-1],a))||u<i.length-1&&c(ni.getCellElement(i[u+1],a)))&&Si(t,ni.getCellElement(t[g],h),o,r.cell);var p=ni.getCellElement(n[g-f],h-s),v=r.replace(p);ni.mutateCell(t[g],h,Mt(v,!0))}return t}(n,t,o,i,u)})},Oi=function(e,t,n,r,o){Ti(t,e,o,r.cell);var i=xi(n,t),u=Ci(n,i,r),a=xi(t,u),c=Ci(t,a,r);return c.slice(0,e).concat(u).concat(c.slice(e,c.length))},Ni=function(n,r,e,o,i){var t=n.slice(0,r),u=n.slice(r),a=ni.mapCells(n[e],function(e,t){return 0<r&&r<n.length&&o(ni.getCellElement(n[r-1],t),ni.getCellElement(n[r],t))?ni.getCell(n[r],t):Mt(i(e.element(),o),!0)});return t.concat([a]).concat(u)},Ei=function(e,n,r,o,i){return E(e,function(e){var t=0<n&&n<ni.cellLength(e)&&o(ni.getCellElement(e,n-1),ni.getCellElement(e,n))?ni.getCell(e,n):Mt(i(ni.getCellElement(e,r),o),!0);return ni.addCell(e,n,t)})},ki=function(e,r,o,i,u){var a=o+1;return E(e,function(e,t){var n=t===r?Mt(u(ni.getCellElement(e,o),i),!0):ni.getCell(e,o);return ni.addCell(e,a,n)})},Ai=function(e,t,n,r,o){var i=t+1,u=e.slice(0,i),a=e.slice(i),c=ni.mapCells(e[t],function(e,t){return t===n?Mt(o(e.element(),r),!0):e});return u.concat([c]).concat(a)},Pi=function(e,t,n){return e.slice(0,t).concat(e.slice(n+1))},Ii=function(e,n,r){var t=E(e,function(e){var t=e.cells().slice(0,n).concat(e.cells().slice(r+1));return Lt(t,e.section())});return A(t,function(e){return 0<e.cells().length})},Bi=function(e,n,r,o){return E(e,function(e){return ni.mapCells(e,function(e){return t=e,N(n,function(e){return r(t.element(),e.element())})?Mt(o(e.element(),r),!0):e;var t})})},Wi=function(e,t,n,r){return ni.getCellElement(e[t],n)!==undefined&&0<t&&r(ni.getCellElement(e[t-1],n),ni.getCellElement(e[t],n))},Mi=function(e,t,n){return 0<t&&n(ni.getCellElement(e,t-1),ni.getCellElement(e,t))},_i=function(n,r,o,e){var t=_(n,function(e,t){return Wi(n,t,r,o)||Mi(e,r,o)?[]:[ni.getCell(e,r)]});return Bi(n,t,o,e)},Li=function(n,r,o,e){var i=n[r],t=_(i.cells(),function(e,t){return Wi(n,r,t,o)||Mi(i,t,o)?[]:[e]});return Bi(n,t,o,e)},Fi=xr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),ji=wo({},Fi),zi=function(e,t,i,u){var n,r,a=e.slice(0),o=(r=t,0===(n=e).length?ji.none():1===n.length?ji.only(0):0===r?ji.left(0,1):r===n.length-1?ji.right(r-1,r):0<r&&r<n.length-1?ji.middle(r-1,r,r+1):ji.none()),c=function(e){return E(e,C(0))},l=C(c(a)),f=function(e,t){if(0<=i){var n=Math.max(u.minCellWidth(),a[t]-i);return c(a.slice(0,e)).concat([i,n-a[t]]).concat(c(a.slice(t+1)))}var r=Math.max(u.minCellWidth(),a[e]+i),o=a[e]-r;return c(a.slice(0,e)).concat([r-a[e],o]).concat(c(a.slice(t+1)))},s=f;return o.fold(l,function(e){return u.singleColumnWidth(a[e],i)},s,function(e,t,n){return f(t,n)},function(e,t){if(0<=i)return c(a.slice(0,t)).concat([i]);var n=Math.max(u.minCellWidth(),a[t]+i);return c(a.slice(0,t)).concat([n-a[t]])})},Hi=function(e,t){return ge(e,t)&&1<parseInt(me(e,t),10)},Ui={hasColspan:function(e){return Hi(e,"colspan")},hasRowspan:function(e){return Hi(e,"rowspan")},minWidth:C(10),minHeight:C(10),getInt:function(e,t){return parseInt(Ne(e,t),10)}},qi=function(e,t,n){return ke(e,t).fold(function(){return n(e)+"px"},function(e){return e})},Vi=function(e,t){return qi(e,"width",function(e){return $r.getPixelWidth(e,t)})},Gi=function(e){return qi(e,"height",$r.getHeight)},Yi=function(e,t,n,r,o){var i=Wo(e),u=E(i,function(e){return e.map(t.edge)});return E(i,function(e,t){return e.filter(g(Ui.hasColspan)).fold(function(){var e=Io(u,t);return r(e)},function(e){return n(e,o)})})},Xi=function(e){return e.map(function(e){return e+"px"}).getOr("")},Ki=function(e,t,n,r){var o=Mo(e),i=E(o,function(e){return e.map(t.edge)});return E(o,function(e,t){return e.filter(g(Ui.hasRowspan)).fold(function(){var e=Io(i,t);return r(e)},function(e){return n(e)})})},Ji={getRawWidths:function(e,t,n){return Yi(e,t,Vi,Xi,n)},getPixelWidths:function(e,t,n){return Yi(e,t,$r.getPixelWidth,function(e){return e.getOrThunk(n.minCellWidth)},n)},getPercentageWidths:function(e,t,n){return Yi(e,t,$r.getPercentageWidth,function(e){return e.fold(function(){return n.minCellWidth()},function(e){return e/n.pixelWidth()*100})},n)},getPixelHeights:function(e,t){return Ki(e,t,$r.getHeight,function(e){return e.getOrThunk(Ui.minHeight)})},getRawHeights:function(e,t){return Ki(e,t,Gi,Xi)}},$i=function(e,t,n){for(var r=0,o=e;o<t;o++)r+=n[o]!==undefined?n[o]:0;return r},Qi=function(e,n){var t=mn.justCells(e);return E(t,function(e){var t=$i(e.column(),e.column()+e.colspan(),n);return{element:e.element,width:C(t),colspan:e.colspan}})},Zi=function(e,n){var t=mn.justCells(e);return E(t,function(e){var t=$i(e.row(),e.row()+e.rowspan(),n);return{element:e.element,height:C(t),rowspan:e.rowspan}})},eu=function(e,n){return E(e.all(),function(e,t){return{element:e.element,height:C(n[t])}})},tu=function(e){var t=o;return{width:C(e),pixelWidth:C(e),getWidths:Ji.getPixelWidths,getCellDelta:t,singleColumnWidth:function(e,t){return[Math.max(Ui.minWidth(),e+t)-e]},minCellWidth:Ui.minWidth,setElementWidth:$r.setPixelWidth,setTableWidth:function(e,t,n){var r=P(t,function(e,t){return e+t},0);$r.setPixelWidth(e,r)}}},nu=function(e,t){var n,r,o,i,u=$r.percentageBasedSizeRegex().exec(t);if(null!==u)return n=u[1],r=e,o=parseFloat(n),i=_r(r),{width:C(o),pixelWidth:C(i),getWidths:Ji.getPercentageWidths,getCellDelta:function(e){return e/i*100},singleColumnWidth:function(e,t){return[100-e]},minCellWidth:function(){return Ui.minWidth()/i*100},setElementWidth:$r.setPercentageWidth,setTableWidth:function(e,t,n){var r=n/100*o;$r.setPercentageWidth(e,o+r)}};var a=$r.pixelBasedSizeRegex().exec(t);if(null!==a){var c=parseInt(a[1],10);return tu(c)}var l=_r(e);return tu(l)},ru=function(t){return $r.getRawWidth(t).fold(function(){var e=_r(t);return tu(e)},function(e){return nu(t,e)})},ou=function(e){return mn.generate(e)},iu=function(e){var t=ln(e);return ou(t)},uu=function(e,t,n,r){var o=ru(e),i=o.getCellDelta(t),u=iu(e),a=o.getWidths(u,r,o),c=zi(a,n,i,o),l=E(c,function(e,t){return e+a[t]}),f=Qi(u,l);k(f,function(e){o.setElementWidth(e.element(),e.width())}),n===u.grid().columns()-1&&o.setTableWidth(e,l,i)},au=function(e,n,r,t){var o=iu(e),i=Ji.getPixelHeights(o,t),u=E(i,function(e,t){return r===t?Math.max(n+e,Ui.minHeight()):e}),a=Zi(o,u),c=eu(o,u);k(c,function(e){$r.setHeight(e.element(),e.height())}),k(a,function(e){$r.setHeight(e.element(),e.height())});var l=P(u,function(e,t){return e+t},0);$r.setHeight(e,l)},cu=function(e,t,n){var r=ru(e),o=ou(t),i=r.getWidths(o,n,r),u=Qi(o,i);k(u,function(e){r.setElementWidth(e.element(),e.width())}),0<u.length&&r.setTableWidth(e,i,r.getCellDelta(0))},lu=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return lu(n())}}},fu=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return X("required",o),K(o),function(t){var n=j(t);L(o,function(e){return O(n,e)})||G(o,n),r(o,n);var e=A(o,function(e){return!i.validate(t[e],e)});return 0<e.length&&function(e,t){throw new Error("All values need to be of type: "+t+". Keys ("+V(e).join(", ")+") were not.")}(e,i.label),t}},su=function(t,e){var n=A(e,function(e){return!O(t,e)});0<n.length&&Y(n)},du=function(e){return fu(su,e,{validate:v,label:"function"})},mu=du(["cell","row","replace","gap"]),gu=function(e){var t=ge(e,"colspan")?parseInt(me(e,"colspan"),10):1,n=ge(e,"rowspan")?parseInt(me(e,"rowspan"),10):1;return{element:C(e),colspan:C(t),rowspan:C(n)}},hu=function(r,o){void 0===o&&(o=gu),mu(r);var n=lu(R.none()),i=function(e){var t,n=o(e);return t=n,r.cell(t)},u=function(e){var t=i(e);return n.get().isNone()&&n.set(R.some(t)),a=R.some({item:e,replacement:t}),t},a=R.none();return{getOrInit:function(t,n){return a.fold(function(){return u(t)},function(e){return n(t,e.item)?e.replacement:u(t)})},cursor:n.get}},pu=function(a,c){return function(r){var o=lu(R.none());mu(r);var i=[],u=function(e){var t={scope:a},n=r.replace(e,c,t);return i.push({item:e,sub:n}),o.get().isNone()&&o.set(R.some(n)),n};return{replaceOrInit:function(t,n){return(r=t,o=n,B(i,function(e){return o(e.item,r)})).fold(function(){return u(t)},function(e){return n(t,e.item)?e.sub:u(t)});var r,o},cursor:o.get}}},vu=function(n){mu(n);var e=lu(R.none());return{combine:function(t){return e.get().isNone()&&e.set(R.some(t)),function(){var e=n.cell({element:C(t),colspan:C(1),rowspan:C(1)});return Ae(e,"width"),Ae(t,"width"),e}},cursor:e.get}},bu=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],wu=function(e,t){var n=e.property().name(t);return O(bu,n)},yu=function(e,t){return O(["br","img","hr","input"],e.property().name(t))},xu=wu,Cu=function(e,t){var n=e.property().name(t);return O(["ol","ul"],n)},Ru=yu,Su=$n(),Tu=function(e){return xu(Su,e)},Du=function(e){return Cu(Su,e)},Ou=function(e){return Ru(Su,e)},Nu=function(e){var t,i=function(e){return"br"===oe(e)},n=function(o){return Sn(o).bind(function(n){var r=vt(n).map(function(e){return!!Tu(e)||!!Ou(e)&&"img"!==oe(e)}).getOr(!1);return gt(n).map(function(e){return!0===r||"li"===oe(t=e)||Kt(t,Du).isSome()||i(n)||Tu(e)&&!ft(o,e)?[]:[xe.fromTag("br")];var t})}).getOr([])},r=0===(t=_(e,function(e){var t=bt(e);return L(t,function(e){return i(e)||le(e)&&0===vn(e).trim().length})?[]:t.concat(n(e))})).length?[xe.fromTag("br")]:t;Ot(e[0]),Dt(e[0],r)},Eu=function(e){0===cn.cells(e).length&&Nt(e)},ku=q("grid","cursor"),Au=function(e,t,n){return Pu(e,t,n).orThunk(function(){return Pu(e,0,0)})},Pu=function(e,t,n){return R.from(e[t]).bind(function(e){return R.from(e.cells()[n]).bind(function(e){return R.from(e.element())})})},Iu=function(e,t,n){return ku(e,Pu(e,t,n))},Bu=function(e){return I(e,function(e,t){return N(e,function(e){return e.row()===t.row()})?e:e.concat([t])},[]).sort(function(e,t){return e.row()-t.row()})},Wu=function(e){return I(e,function(e,t){return N(e,function(e){return e.column()===t.column()})?e:e.concat([t])},[]).sort(function(e,t){return e.column()-t.column()})},Mu=function(e,t,n){var r=fn(e,n),o=mn.generate(r);return ui(o,t,!0)},_u=cu,Lu={insertRowBefore:fi(function(e,t,n,r){var o=t.row(),i=t.row(),u=Ni(e,i,o,n,r.getOrInit);return Iu(u,i,t.column())},si,y,y,hu),insertRowsBefore:fi(function(e,t,n,r){var o=t[0].row(),i=t[0].row(),u=Bu(t),a=I(u,function(e,t){return Ni(e,i,o,n,r.getOrInit)},e);return Iu(a,i,t[0].column())},mi,y,y,hu),insertRowAfter:fi(function(e,t,n,r){var o=t.row(),i=t.row()+t.rowspan(),u=Ni(e,i,o,n,r.getOrInit);return Iu(u,i,t.column())},si,y,y,hu),insertRowsAfter:fi(function(e,t,n,r){var o=Bu(t),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),a=I(o,function(e,t){return Ni(e,u,i,n,r.getOrInit)},e);return Iu(a,u,t[0].column())},mi,y,y,hu),insertColumnBefore:fi(function(e,t,n,r){var o=t.column(),i=t.column(),u=Ei(e,i,o,n,r.getOrInit);return Iu(u,t.row(),i)},si,_u,y,hu),insertColumnsBefore:fi(function(e,t,n,r){var o=Wu(t),i=o[0].column(),u=o[0].column(),a=I(o,function(e,t){return Ei(e,u,i,n,r.getOrInit)},e);return Iu(a,t[0].row(),u)},mi,_u,y,hu),insertColumnAfter:fi(function(e,t,n,r){var o=t.column(),i=t.column()+t.colspan(),u=Ei(e,i,o,n,r.getOrInit);return Iu(u,t.row(),i)},si,_u,y,hu),insertColumnsAfter:fi(function(e,t,n,r){var o=t[t.length-1].column(),i=t[t.length-1].column()+t[t.length-1].colspan(),u=Wu(t),a=I(u,function(e,t){return Ei(e,i,o,n,r.getOrInit)},e);return Iu(a,t[0].row(),i)},mi,_u,y,hu),splitCellIntoColumns:fi(function(e,t,n,r){var o=ki(e,t.row(),t.column(),n,r.getOrInit);return Iu(o,t.row(),t.column())},si,_u,y,hu),splitCellIntoRows:fi(function(e,t,n,r){var o=Ai(e,t.row(),t.column(),n,r.getOrInit);return Iu(o,t.row(),t.column())},si,y,y,hu),eraseColumns:fi(function(e,t,n,r){var o=Wu(t),i=Ii(e,o[0].column(),o[o.length-1].column()),u=Au(i,t[0].row(),t[0].column());return ku(i,u)},mi,_u,Eu,hu),eraseRows:fi(function(e,t,n,r){var o=Bu(t),i=Pi(e,o[0].row(),o[o.length-1].row()),u=Au(i,t[0].row(),t[0].column());return ku(i,u)},mi,y,Eu,hu),makeColumnHeader:fi(function(e,t,n,r){var o=_i(e,t.column(),n,r.replaceOrInit);return Iu(o,t.row(),t.column())},si,y,y,pu("row","th")),unmakeColumnHeader:fi(function(e,t,n,r){var o=_i(e,t.column(),n,r.replaceOrInit);return Iu(o,t.row(),t.column())},si,y,y,pu(null,"td")),makeRowHeader:fi(function(e,t,n,r){var o=Li(e,t.row(),n,r.replaceOrInit);return Iu(o,t.row(),t.column())},si,y,y,pu("col","th")),unmakeRowHeader:fi(function(e,t,n,r){var o=Li(e,t.row(),n,r.replaceOrInit);return Iu(o,t.row(),t.column())},si,y,y,pu(null,"td")),mergeCells:fi(function(e,t,n,r){var o=t.cells();Nu(o);var i=Ri(e,t.bounds(),n,C(o[0]));return ku(i,R.from(o[0]))},function(e,t){return t.mergable()},y,y,vu),unmergeCells:fi(function(e,t,n,r){var o=P(t,function(e,t){return Si(e,t,n,r.combine(t))},e);return ku(o,R.from(t[0]))},function(e,t){return t.unmergable()},_u,y,vu),pasteCells:fi(function(e,n,t,r){var o,i,u,a,c=(o=n.clipboard(),i=n.generators(),u=ln(o),a=mn.generate(u),ui(a,i,!0)),l=At(n.row(),n.column());return Di(l,e,c,n.generators(),t).fold(function(){return ku(e,R.some(n.element()))},function(e){var t=Au(e,n.row(),n.column());return ku(e,t)})},function(t,n){return cn.cell(n.element()).bind(function(e){return li(t,e).map(function(e){return wo(wo({},e),{generators:n.generators,clipboard:n.clipboard})})})},_u,y,hu),pasteRowsBefore:fi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[0].row(),u=Mu(t.clipboard(),t.generators(),o),a=Oi(i,e,u,t.generators(),n),c=Au(a,t.cells[0].row(),t.cells[0].column());return ku(a,c)},di,y,y,hu),pasteRowsAfter:fi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),u=Mu(t.clipboard(),t.generators(),o),a=Oi(i,e,u,t.generators(),n),c=Au(a,t.cells[0].row(),t.cells[0].column());return ku(a,c)},di,y,y,hu)},Fu=function(e){return xe.fromDom(e.getBody())},ju=function(e){return e.getBoundingClientRect().width},zu=function(e){return e.getBoundingClientRect().height},Hu=function(t){return function(e){return ft(e,Fu(t))}},Uu=function(e){return/^[0-9]+$/.test(e)&&(e+="px"),e},qu=function(e){var t=qt(e,"td[data-mce-style],th[data-mce-style]");he(e,"data-mce-style"),k(t,function(e){he(e,"data-mce-style")})},Vu={isRtl:C(!1)},Gu={isRtl:C(!0)},Yu={directionAt:function(e){return"rtl"==("rtl"===Ne(e,"direction")?"rtl":"ltr")?Gu:Vu}},Xu=["tableprops","tabledelete","|","tableinsertrowbefore","tableinsertrowafter","tabledeleterow","|","tableinsertcolbefore","tableinsertcolafter","tabledeletecol"],Ku={"border-collapse":"collapse",width:"100%"},Ju={border:"1"},$u=function(e){return e.getParam("table_cell_advtab",!0,"boolean")},Qu=function(e){return e.getParam("table_row_advtab",!0,"boolean")},Zu=function(e){return e.getParam("table_advtab",!0,"boolean")},ea=function(e){return e.getParam("table_style_by_css",!1,"boolean")},ta=function(e){return e.getParam("table_cell_class_list",[],"array")},na=function(e){return e.getParam("table_row_class_list",[],"array")},ra=function(e){return e.getParam("table_class_list",[],"array")},oa=function(e){return!1===e.getParam("table_responsive_width")},ia=function(e,t){return e.fire("newrow",{node:t})},ua=function(e,t){return e.fire("newcell",{node:t})},aa=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},ca=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},la=function(f,e){var t,n=function(e){return"table"===oe(Fu(e))},s=(t=f.getParam("table_clone_elements"),d(t)?R.some(t.split(/[ ,]/)):Array.isArray(t)?R.some(t):R.none()),r=function(u,a,c,l){return function(e,t){qu(e);var n=l(),r=xe.fromDom(f.getDoc()),o=vo(Yu.directionAt),i=Bn(c,r,s);return a(e)?u(n,e,t,i,o).bind(function(e){return k(e.newRows(),function(e){ia(f,e.dom())}),k(e.newCells(),function(e){ua(f,e.dom())}),e.cursor().map(function(e){var t=f.dom.createRng();return t.setStart(e.dom(),0),t.setEnd(e.dom(),0),t})}):R.none()}};return{deleteRow:r(Lu.eraseRows,function(e){var t=bo(e);return!1===n(f)||1<t.rows()},y,e),deleteColumn:r(Lu.eraseColumns,function(e){var t=bo(e);return!1===n(f)||1<t.columns()},y,e),insertRowsBefore:r(Lu.insertRowsBefore,u,y,e),insertRowsAfter:r(Lu.insertRowsAfter,u,y,e),insertColumnsBefore:r(Lu.insertColumnsBefore,u,Qr,e),insertColumnsAfter:r(Lu.insertColumnsAfter,u,Qr,e),mergeCells:r(Lu.mergeCells,u,y,e),unmergeCells:r(Lu.unmergeCells,u,y,e),pasteRowsBefore:r(Lu.pasteRowsBefore,u,y,e),pasteRowsAfter:r(Lu.pasteRowsAfter,u,y,e),pasteCells:r(Lu.pasteCells,u,y,e)}},fa=function(e,t,r){var n=ln(e),o=mn.generate(n);return mi(o,t).map(function(e){var t=ui(o,r,!1).slice(e[0].row(),e[e.length-1].row()+e[e.length-1].rowspan()),n=ci(t,r);return So(n)})},sa=tinymce.util.Tools.resolve("tinymce.util.Tools"),da=function(e,t,n){n&&e.formatter.apply("align"+n,{},t)},ma=function(e,t,n){n&&e.formatter.apply("valign"+n,{},t)},ga=function(t,n){sa.each("left center right".split(" "),function(e){t.formatter.remove("align"+e,{},n)})},ha=function(t,n){sa.each("top middle bottom".split(" "),function(e){t.formatter.remove("valign"+e,{},n)})},pa=function(o,e,i){var t;return t=function(e,t){for(var n=0;n<t.length;n++){var r=o.getStyle(t[n],i);if(void 0===e&&(e=r),e!==r)return""}return e}(t,o.select("td,th",e))},va=function(e,t){var n=e.dom,r=t.control.rootControl,o=r.toJSON(),i=n.parseStyle(o.style);i["border-style"]=o.borderStyle,i["border-color"]=o.borderColor,i["background-color"]=o.backgroundColor,i.width=o.width?Uu(o.width):"",i.height=o.height?Uu(o.height):"",r.find("#style").value(n.serializeStyle(n.parseStyle(n.serializeStyle(i))))},ba=function(e,t){var n=e.dom,r=t.control.rootControl,o=r.toJSON(),i=n.parseStyle(o.style);r.find("#borderStyle").value(i["border-style"]||""),r.find("#borderColor").value(i["border-color"]||""),r.find("#backgroundColor").value(i["background-color"]||""),r.find("#width").value(i.width||""),r.find("#height").value(i.height||"")},wa={createStyleForm:function(n){var e=function(){var e=n.getParam("color_picker_callback");if(e)return function(t){return e.call(n,function(e){t.control.value(e).fire("change")},t.control.value())}};return{title:"Advanced",type:"form",defaults:{onchange:b(va,n)},items:[{label:"Style",name:"style",type:"textbox",onchange:b(ba,n)},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border style",type:"listbox",name:"borderStyle",width:90,onselect:b(va,n),values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}},buildListItems:function(e,r,t){var o=function(e,n){return n=n||[],sa.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=o(e.menu):(t.value=e.value,r&&r(t)),n.push(t)}),n};return o(e,t||[])},updateStyleField:va,extractAdvancedStyles:function(e,t){var n=e.parseStyle(e.getAttrib(t,"style")),r={};return n["border-style"]&&(r.borderStyle=n["border-style"]),n["border-color"]&&(r.borderColor=n["border-color"]),n["background-color"]&&(r.backgroundColor=n["background-color"]),r.style=e.serializeStyle(n),r},updateAdvancedFields:ba,syncAdvancedStyleFields:function(e,t){t.control.rootControl.find("#style")[0].getEl().isEqualNode(m.document.activeElement)?ba(e,t):va(e,t)}},ya=function(r,o,e){var i,u=r.dom;function a(e,t,n){(1===o.length||n)&&u.setAttrib(e,t,n)}function c(e,t,n){(1===o.length||n)&&u.setStyle(e,t,n)}$u(r)&&wa.syncAdvancedStyleFields(r,e),i=e.control.rootControl.toJSON(),r.undoManager.transact(function(){sa.each(o,function(e){var t,n;a(e,"scope",i.scope),1===o.length?a(e,"style",i.style):(t=e,n=i.style,delete t.dataset.mceStyle,t.style.cssText+=";"+n),a(e,"class",i["class"]),c(e,"width",Uu(i.width)),c(e,"height",Uu(i.height)),i.type&&e.nodeName.toLowerCase()!==i.type&&(e=u.rename(e,i.type)),1===o.length&&(ga(r,e),ha(r,e)),i.align&&da(r,e,i.align),i.valign&&ma(r,e,i.valign)}),r.focus()})},xa=function(t){var e,n,r,o=[];if(o=t.dom.select("td[data-mce-selected],th[data-mce-selected]"),e=t.dom.getParent(t.selection.getStart(),"td,th"),!o.length&&e&&o.push(e),e=e||o[0]){var i,u,a,c;1<o.length?n={width:"",height:"",scope:"","class":"",align:"",valign:"",style:"",type:e.nodeName.toLowerCase()}:(u=e,a=(i=t).dom,c={width:a.getStyle(u,"width")||a.getAttrib(u,"width"),height:a.getStyle(u,"height")||a.getAttrib(u,"height"),scope:a.getAttrib(u,"scope"),"class":a.getAttrib(u,"class"),type:u.nodeName.toLowerCase(),style:"",align:"",valign:""},sa.each("left center right".split(" "),function(e){i.formatter.matchNode(u,"align"+e)&&(c.align=e)}),sa.each("top middle bottom".split(" "),function(e){i.formatter.matchNode(u,"valign"+e)&&(c.valign=e)}),$u(i)&&sa.extend(c,wa.extractAdvancedStyles(a,u)),n=c),0<ta(t).length&&(r={name:"class",type:"listbox",label:"Class",values:wa.buildListItems(ta(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"td",classes:[e.value]})})})});var l={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width",onchange:b(wa.updateStyleField,t)},{label:"Height",name:"height",onchange:b(wa.updateStyleField,t)},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},r]};$u(t)?t.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:n,body:[{title:"General",type:"form",items:l},wa.createStyleForm(t)],onsubmit:b(ya,t,o)}):t.windowManager.open({title:"Cell properties",data:n,body:l,onsubmit:b(ya,t,o)})}};function Ca(f,s,d,e){var m=f.dom;function g(e,t,n){(1===s.length||n)&&m.setAttrib(e,t,n)}Qu(f)&&wa.syncAdvancedStyleFields(f,e);var h=e.control.rootControl.toJSON();f.undoManager.transact(function(){sa.each(s,function(e){var t,n,r,o,i,u,a,c,l;g(e,"scope",h.scope),g(e,"style",h.style),g(e,"class",h["class"]),t=e,n="height",r=Uu(h.height),(1===s.length||r)&&m.setStyle(t,n,r),h.type!==e.parentNode.nodeName.toLowerCase()&&(o=f.dom,i=e,u=h.type,a=o.getParent(i,"table"),c=i.parentNode,(l=o.select(u,a)[0])||(l=o.create(u),a.firstChild?"CAPTION"===a.firstChild.nodeName?o.insertAfter(l,a.firstChild):a.insertBefore(l,a.firstChild):a.appendChild(l)),l.appendChild(i),c.hasChildNodes()||o.remove(c)),h.align!==d.align&&(ga(f,e),da(f,e,h.align))}),f.focus()})}var Ra=function(t){var e,n,r,o,i,u,a,c,l,f,s=t.dom,d=[];e=s.getParent(t.selection.getStart(),"table"),n=s.getParent(t.selection.getStart(),"td,th"),sa.each(e.rows,function(t){sa.each(t.cells,function(e){if(s.getAttrib(e,"data-mce-selected")||e===n)return d.push(t),!1})}),(r=d[0])&&(1<d.length?i={height:"",scope:"",style:"","class":"",align:"",type:r.parentNode.nodeName.toLowerCase()}:(c=r,l=(a=t).dom,f={height:l.getStyle(c,"height")||l.getAttrib(c,"height"),scope:l.getAttrib(c,"scope"),"class":l.getAttrib(c,"class"),align:"",style:"",type:c.parentNode.nodeName.toLowerCase()},sa.each("left center right".split(" "),function(e){a.formatter.matchNode(c,"align"+e)&&(f.align=e)}),Qu(a)&&sa.extend(f,wa.extractAdvancedStyles(l,c)),i=f),0<na(t).length&&(o={name:"class",type:"listbox",label:"Class",values:wa.buildListItems(na(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})})}),u={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"Header",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},Qu(t)?t.windowManager.open({title:"Row properties",data:i,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},wa.createStyleForm(t)],onsubmit:b(Ca,t,d,i)}):t.windowManager.open({title:"Row properties",data:i,body:u,onsubmit:b(Ca,t,d,i)}))},Sa=tinymce.util.Tools.resolve("tinymce.Env"),Ta={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},Da=function(e,t,n,r,o){void 0===o&&(o=Ta);var i=xe.fromTag("table");Oe(i,o.styles),de(i,o.attributes);var u=xe.fromTag("tbody");Rt(i,u);for(var a=[],c=0;c<e;c++){for(var l=xe.fromTag("tr"),f=0;f<t;f++){var s=c<n||f<r?xe.fromTag("th"):xe.fromTag("td");f<r&&se(s,"scope","row"),c<n&&se(s,"scope","col"),Rt(s,xe.fromTag("br")),o.percentages&&De(s,"width",100/t+"%"),Rt(l,s)}a.push(l)}return Dt(u,a),i},Oa=function(e,t){e.selection.select(t.dom(),!0),e.selection.collapse(!0)},Na=function(r,e,t){var n,o,i=r.getParam("table_default_styles",Ku,"object"),u={styles:i,attributes:(o=r,o.getParam("table_default_attributes",Ju,"object")),percentages:(n=i.width,d(n)&&-1!==n.indexOf("%")&&!oa(r))},a=Da(t,e,0,0,u);se(a,"data-mce-id","__mce");var c,l,f,s=(c=a,l=xe.fromTag("div"),f=xe.fromDom(c.dom().cloneNode(!0)),Rt(l,f),l.dom().innerHTML);return r.insertContent(s),Qt(Fu(r),'table[data-mce-id="__mce"]').map(function(e){var t,n;return oa(r)&&De(e,"width",Ne(e,"width")),he(e,"data-mce-id"),t=r,k(qt(e,"tr"),function(e){ia(t,e.dom()),k(qt(e,"th,td"),function(e){ua(t,e.dom())})}),n=r,Qt(e,"td,th").each(b(Oa,n)),e.dom()}).getOr(null)};function Ea(e,t,n,r){if("TD"===t.tagName||"TH"===t.tagName)e.setStyle(t,n,r);else if(t.children)for(var o=0;o<t.children.length;o++)Ea(e,t.children[o],n,r)}var ka,Aa=function(e,t,n){var r,o,i=e.dom;Zu(e)&&wa.syncAdvancedStyleFields(e,n),!1===(o=n.control.rootControl.toJSON())["class"]&&delete o["class"],e.undoManager.transact(function(){t||(t=Na(e,o.cols||1,o.rows||1)),function(e,t,n){var r,o=e.dom,i={},u={};if(i["class"]=n["class"],u.height=Uu(n.height),o.getAttrib(t,"width")&&!ea(e)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=Uu(n.width),ea(e)?(u["border-width"]=Uu(n.border),u["border-spacing"]=Uu(n.cellspacing),sa.extend(i,{"data-mce-border-color":n.borderColor,"data-mce-cell-padding":n.cellpadding,"data-mce-border":n.border})):sa.extend(i,{border:n.border,cellpadding:n.cellpadding,cellspacing:n.cellspacing}),ea(e)&&t.children)for(var a=0;a<t.children.length;a++)Ea(o,t.children[a],{"border-width":Uu(n.border),"border-color":n.borderColor,padding:Uu(n.cellpadding)});n.style?sa.extend(u,o.parseStyle(n.style)):u=sa.extend({},o.parseStyle(o.getAttrib(t,"style")),u),i.style=o.serializeStyle(u),o.setAttribs(t,i)}(e,t,o),(r=i.select("caption",t)[0])&&!o.caption&&i.remove(r),!r&&o.caption&&((r=i.create("caption")).innerHTML=Sa.ie?"\xa0":'<br data-mce-bogus="1"/>',t.insertBefore(r,t.firstChild)),ga(e,t),o.align&&da(e,t,o.align),e.focus(),e.addVisual()})},Pa=function(t,e){var n,r,o,i,u,a,c,l,f,s,d=t.dom,m={};!0===e?(n=d.getParent(t.selection.getStart(),"table"))&&(c=n,l=(a=t).dom,f={width:l.getStyle(c,"width")||l.getAttrib(c,"width"),height:l.getStyle(c,"height")||l.getAttrib(c,"height"),cellspacing:l.getStyle(c,"border-spacing")||l.getAttrib(c,"cellspacing"),cellpadding:l.getAttrib(c,"data-mce-cell-padding")||l.getAttrib(c,"cellpadding")||pa(a.dom,c,"padding"),border:l.getAttrib(c,"data-mce-border")||l.getAttrib(c,"border")||pa(a.dom,c,"border"),borderColor:l.getAttrib(c,"data-mce-border-color"),caption:!!l.select("caption",c)[0],"class":l.getAttrib(c,"class")},sa.each("left center right".split(" "),function(e){a.formatter.matchNode(c,"align"+e)&&(f.align=e)}),Zu(a)&&sa.extend(f,wa.extractAdvancedStyles(l,c)),m=f):(r={label:"Cols",name:"cols"},o={label:"Rows",name:"rows"}),0<ra(t).length&&(m["class"]&&(m["class"]=m["class"].replace(/\s*mce\-item\-table\s*/g,"")),i={name:"class",type:"listbox",label:"Class",values:wa.buildListItems(ra(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"table",classes:[e.value]})})})}),u={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:(s=t,s.getParam("table_appearance_options",!0,"boolean")?[r,o,{label:"Width",name:"width",onchange:b(wa.updateStyleField,t)},{label:"Height",name:"height",onchange:b(wa.updateStyleField,t)},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[r,o,{label:"Width",name:"width",onchange:b(wa.updateStyleField,t)},{label:"Height",name:"height",onchange:b(wa.updateStyleField,t)}])},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},i]},Zu(t)?t.windowManager.open({title:"Table properties",data:m,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},wa.createStyleForm(t)],onsubmit:b(Aa,t,n)}):t.windowManager.open({title:"Table properties",data:m,body:u,onsubmit:b(Aa,t,n)})},Ia=sa.each,Ba=function(a,t,c,l,n){var r=Hu(a),e=function(e){return function(){return R.from(a.dom.getParent(a.selection.getStart(),e)).map(xe.fromDom)}},o=e("caption"),f=e("th,td"),s=function(e){return cn.table(e,r)},d=function(e){return{width:ju(e.dom()),height:ju(e.dom())}},i=function(n){f().each(function(t){s(t).each(function(i){var e=kr.forMenu(l,i,t),u=d(i);n(i,e).each(function(e){var t,n,r,o;t=a,n=u,o=d(r=i),n.width===o.width&&n.height===o.height||(aa(t,r.dom(),n.width,n.height),ca(t,r.dom(),o.width,o.height)),a.selection.setRng(e),a.focus(),c.clear(i),qu(i)})})})},u=function(e){return f().bind(function(o){return s(o).bind(function(e){var t=xe.fromDom(a.getDoc()),n=kr.forMenu(l,e,o),r=Bn(y,t,R.none());return fa(e,n,r)})})},m=function(u){n.get().each(function(e){var i=E(e,function(e){return Nn(e)});f().each(function(o){s(o).each(function(t){var e=xe.fromDom(a.getDoc()),n=Wn(e),r=kr.pasteRows(l,t,o,i,n);u(t,r).each(function(e){a.selection.setRng(e),a.focus(),c.clear(t)})})})})};Ia({mceTableSplitCells:function(){i(t.unmergeCells)},mceTableMergeCells:function(){i(t.mergeCells)},mceTableInsertRowBefore:function(){i(t.insertRowsBefore)},mceTableInsertRowAfter:function(){i(t.insertRowsAfter)},mceTableInsertColBefore:function(){i(t.insertColumnsBefore)},mceTableInsertColAfter:function(){i(t.insertColumnsAfter)},mceTableDeleteCol:function(){i(t.deleteColumn)},mceTableDeleteRow:function(){i(t.deleteRow)},mceTableCutRow:function(e){n.set(u()),i(t.deleteRow)},mceTableCopyRow:function(e){n.set(u())},mceTablePasteRowBefore:function(e){m(t.pasteRowsBefore)},mceTablePasteRowAfter:function(e){m(t.pasteRowsAfter)},mceTableDelete:function(){f().orThunk(o).each(function(e){cn.table(e,r).filter(g(r)).each(function(e){var t=xe.fromText("");xt(e,t),Nt(e);var n=a.dom.createRng();n.setStart(t.dom(),0),n.setEnd(t.dom(),0),a.selection.setRng(n)})})}},function(e,t){a.addCommand(t,e)}),Ia({mceInsertTable:b(Pa,a),mceTableProps:b(Pa,a,!0),mceTableRowProps:b(Ra,a),mceTableCellProps:b(xa,a)},function(n,e){a.addCommand(e,function(e,t){n(t)})})},Wa=function(e){var t=R.from(e.dom().documentElement).map(xe.fromDom).getOr(e);return{parent:C(t),view:C(e),origin:C(eo(0,0))}},Ma=function(e,t){return{parent:C(t),view:C(e),origin:C(eo(0,0))}},_a=function(e){var r=q.apply(null,e),o=[];return{bind:function(e){if(e===undefined)throw new Error("Event bind error: undefined handler");o.push(e)},unbind:function(t){o=A(o,function(e){return e!==t})},trigger:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r.apply(null,e);k(o,function(e){e(n)})}}},La={create:function(e){return{registry:H(e,function(e){return{bind:e.bind,unbind:e.unbind}}),trigger:H(e,function(e){return e.trigger})}}},Fa=function(m,g){return function(e){if(m(e)){var t,n,r,o,i,u,a,c=xe.fromDom(e.target),l=function(){e.stopPropagation()},f=function(){e.preventDefault()},s=x(f,l),d=(t=c,n=e.clientX,r=e.clientY,o=l,i=f,u=s,a=e,{target:C(t),x:C(n),y:C(r),stop:o,prevent:i,kill:u,raw:C(a)});g(d)}}},ja=function(e,t,n,r){return o=e,i=t,u=!1,a=Fa(n,r),o.dom().addEventListener(i,a,u),{unbind:b(za,o,i,a,u)};var o,i,u,a},za=function(e,t,n,r){e.dom().removeEventListener(t,n,r)},Ha=C(!0),Ua=function(e,t,n){return ja(e,t,Ha,n)},qa=Object.prototype.hasOwnProperty,Va=(ka=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)qa.call(o,i)&&(n[i]=ka(n[i],o[i]))}return n}),Ga={resolve:_o("ephox-dragster").resolve},Ya=du(["compare","extract","mutate","sink"]),Xa=du(["element","start","stop","destroy"]),Ka=du(["forceDrop","drop","move","delayDrop"]),Ja=Ya({compare:function(e,t){return eo(t.left()-e.left(),t.top()-e.top())},extract:function(e){return R.some(eo(e.x(),e.y()))},sink:function(e,t){var n,r,o,i=(n=t,r=Va({layerClass:Ga.resolve("blocker")},n),o=xe.fromTag("div"),se(o,"role","presentation"),Oe(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Eo(o,Ga.resolve("blocker")),Eo(o,r.layerClass),{element:function(){return o},destroy:function(){Nt(o)}}),u=Ua(i.element(),"mousedown",e.forceDrop),a=Ua(i.element(),"mouseup",e.drop),c=Ua(i.element(),"mousemove",e.move),l=Ua(i.element(),"mouseout",e.delayDrop);return Xa({element:i.element,start:function(e){Rt(e,i.element())},stop:function(){Nt(i.element())},destroy:function(){i.destroy(),a.unbind(),c.unbind(),l.unbind(),u.unbind()}})},mutate:function(e,t){e.mutate(t.left(),t.top())}});function $a(){var i=R.none(),u=La.create({move:_a(["info"])});return{onEvent:function(e,o){o.extract(e).each(function(e){var t,n,r;(t=o,n=e,r=i.map(function(e){return t.compare(e,n)}),i=R.some(n),r).each(function(e){u.trigger.move(e)})})},reset:function(){i=R.none()},events:u.registry}}function Qa(){var e={onEvent:y,reset:y},t=$a(),n=e;return{on:function(){n.reset(),n=t},off:function(){n.reset(),n=e},isOn:function(){return n===t},onEvent:function(e,t){n.onEvent(e,t)},events:t.events}}var Za=function(t,n,e){var r,o,i,u=!1,a=La.create({start:_a([]),stop:_a([])}),c=Qa(),l=function(){d.stop(),c.isOn()&&(c.off(),a.trigger.stop())},f=(r=l,o=200,i=null,{cancel:function(){null!==i&&(m.clearTimeout(i),i=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==i&&m.clearTimeout(i),i=m.setTimeout(function(){r.apply(null,e),i=null},o)}});c.events.move.bind(function(e){n.mutate(t,e.info())});var s=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];u&&n.apply(null,e)}},d=n.sink(Ka({forceDrop:l,drop:s(l),move:s(function(e){f.cancel(),c.onEvent(e,n)}),delayDrop:s(f.throttle)}),e);return{element:d.element,go:function(e){d.start(e),c.on(),a.trigger.start()},on:function(){u=!0},off:function(){u=!1},destroy:function(){d.destroy()},events:a.registry}},ec=function(e,t){void 0===t&&(t={});var n=t.mode!==undefined?t.mode:Ja;return Za(e,n,t)},tc=function(){var n,r=La.create({drag:_a(["xDelta","yDelta","target"])}),o=R.none(),e={mutate:function(e,t){n.trigger.drag(e,t)},events:(n=La.create({drag:_a(["xDelta","yDelta"])})).registry};return e.events.drag.bind(function(t){o.each(function(e){r.trigger.drag(t.xDelta(),t.yDelta(),e)})}),{assign:function(e){o=R.some(e)},get:function(){return o},mutate:e.mutate,events:r.registry}},nc=function(e){return"true"===me(e,"contenteditable")},rc=Lo.resolve("resizer-bar-dragging"),oc=function(o,t,i){var n=tc(),r=ec(n,{}),u=R.none(),e=function(e,t){return R.from(me(e,t))};n.events.drag.bind(function(n){e(n.target(),"data-row").each(function(e){var t=Ui.getInt(n.target(),"top");De(n.target(),"top",t+n.yDelta()+"px")}),e(n.target(),"data-column").each(function(e){var t=Ui.getInt(n.target(),"left");De(n.target(),"left",t+n.xDelta()+"px")})});var a=function(e,t){return Ui.getInt(e,t)-parseInt(me(e,"data-initial-"+t),10)};r.events.stop.bind(function(){n.get().each(function(r){u.each(function(n){e(r,"data-row").each(function(e){var t=a(r,"top");he(r,"data-initial-top"),m.trigger.adjustHeight(n,t,parseInt(e,10))}),e(r,"data-column").each(function(e){var t=a(r,"left");he(r,"data-initial-left"),m.trigger.adjustWidth(n,t,parseInt(e,10))}),Xo(o,n,i,t)})})});var c=function(e,t){m.trigger.startAdjust(),n.assign(e),se(e,"data-initial-"+t,parseInt(Ne(e,t),10)),Eo(e,rc),De(e,"opacity","0.2"),r.go(o.parent())},l=Ua(o.parent(),"mousedown",function(e){Qo(e.target())&&c(e.target(),"top"),Zo(e.target())&&c(e.target(),"left")}),f=function(e){return ft(e,o.view())},s=function(e){return Zt(e,"table",f).filter(function(e){return(t=e,n=f,Zt(t,"[contenteditable]",n)).exists(nc);var t,n})},d=Ua(o.view(),"mouseover",function(e){s(e.target()).fold(function(){Ce(e.target())&&$o(o)},function(e){u=R.some(e),Xo(o,e,i,t)})}),m=La.create({adjustHeight:_a(["table","delta","row"]),adjustWidth:_a(["table","delta","column"]),startAdjust:_a([])});return{destroy:function(){l.unbind(),d.unbind(),r.destroy(),$o(o)},refresh:function(e){Xo(o,e,i,t)},on:r.on,off:r.off,hideBars:b(Ko,o),showBars:b(Jo,o),events:m.registry}},ic=function(e,n){var r=ho.height,t=oc(e,n,r),o=La.create({beforeResize:_a(["table"]),afterResize:_a(["table"]),startDrag:_a([])});return t.events.adjustHeight.bind(function(e){o.trigger.beforeResize(e.table());var t=r.delta(e.delta(),e.table());au(e.table(),t,e.row(),r),o.trigger.afterResize(e.table())}),t.events.startAdjust.bind(function(e){o.trigger.startDrag()}),t.events.adjustWidth.bind(function(e){o.trigger.beforeResize(e.table());var t=n.delta(e.delta(),e.table());uu(e.table(),t,e.column(),n),o.trigger.afterResize(e.table())}),{on:t.on,off:t.off,hideBars:t.hideBars,showBars:t.showBars,destroy:t.destroy,events:o.registry}},uc=function(e,t){return e.inline?Ma(Fu(e),(n=xe.fromTag("div"),Oe(n,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Rt(Re(),n),n)):Wa(xe.fromDom(e.getDoc()));var n},ac=function(e,t){e.inline&&Nt(t.parent())},cc=function(u){var a,c,o=R.none(),i=R.none(),l=R.none(),f=/(\d+(\.\d+)?)%/,s=function(e){return"TABLE"===e.nodeName};return u.on("init",function(){var e,t=vo(Yu.directionAt),n=uc(u);if(l=R.some(n),("table"===(e=u.getParam("object_resizing",!0))||e)&&u.getParam("table_resize_bars",!0,"boolean")){var r=ic(n,t);r.on(),r.events.startDrag.bind(function(e){o=R.some(u.selection.getRng())}),r.events.beforeResize.bind(function(e){var t=e.table().dom();aa(u,t,ju(t),zu(t))}),r.events.afterResize.bind(function(e){var t=e.table(),n=t.dom();qu(t),o.each(function(e){u.selection.setRng(e),u.focus()}),ca(u,n,ju(n),zu(n)),u.undoManager.add()}),i=R.some(r)}}),u.on("ObjectResizeStart",function(e){var t,n=e.target;s(n)&&(a=e.width,t=n,c=u.dom.getStyle(t,"width")||u.dom.getAttrib(t,"width"))}),u.on("ObjectResized",function(e){var t=e.target;if(s(t)){var n=t;if(f.test(c)){var r=parseFloat(f.exec(c)[1]),o=e.width*r/a;u.dom.setStyle(n,"width",o+"%")}else{var i=[];sa.each(n.rows,function(e){sa.each(e.cells,function(e){var t=u.dom.getStyle(e,"width",!0);i.push({cell:e,width:t})})}),sa.each(i,function(e){u.dom.setStyle(e.cell,"width",e.width),u.dom.setAttrib(e.cell,"width",null)})}}}),{lazyResize:function(){return i},lazyWire:function(){return l.getOr(Wa(xe.fromDom(u.getBody())))},destroy:function(){i.each(function(e){e.destroy()}),l.each(function(e){ac(u,e)})}}},lc=xr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),fc=wo(wo({},lc),{none:function(e){return void 0===e&&(e=undefined),lc.none(e)}}),sc=function(n,e){return cn.table(n,e).bind(function(e){var t=cn.cells(e);return W(t,function(e){return ft(n,e)}).map(function(e){return{index:C(e),all:C(t)}})})},dc=function(t,e){return sc(t,e).fold(function(){return fc.none(t)},function(e){return e.index()+1<e.all().length?fc.middle(t,e.all()[e.index()+1]):fc.last(t)})},mc=function(t,e){return sc(t,e).fold(function(){return fc.none()},function(e){return 0<=e.index()-1?fc.middle(t,e.all()[e.index()-1]):fc.first(t)})},gc={create:q("start","soffset","finish","foffset")},hc=xr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),pc={before:hc.before,on:hc.on,after:hc.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(o,o,o)}},vc=xr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),bc={domRange:vc.domRange,relative:vc.relative,exact:vc.exact,exactFromRange:function(e){return vc.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t,n=e.match({domRange:function(e){return xe.fromDom(e.startContainer)},relative:function(e,t){return pc.getStart(e)},exact:function(e,t,n,r){return e}});return t=n,xe.fromDom(t.dom().ownerDocument.defaultView)},range:gc.create},wc=function(e,t){e.selectNodeContents(t.dom())},yc=function(e,t,n){var r,o,i=e.document.createRange();return r=i,t.fold(function(e){r.setStartBefore(e.dom())},function(e,t){r.setStart(e.dom(),t)},function(e){r.setStartAfter(e.dom())}),o=i,n.fold(function(e){o.setEndBefore(e.dom())},function(e,t){o.setEnd(e.dom(),t)},function(e){o.setEndAfter(e.dom())}),i},xc=function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(r.dom(),o),i},Cc=function(e){return{left:C(e.left),top:C(e.top),right:C(e.right),bottom:C(e.bottom),width:C(e.width),height:C(e.height)}},Rc=xr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Sc=function(e,t,n){return t(xe.fromDom(n.startContainer),n.startOffset,xe.fromDom(n.endContainer),n.endOffset)},Tc=function(e,t){var o,n,r,i=(o=e,t.match({domRange:function(e){return{ltr:C(e),rtl:R.none}},relative:function(e,t){return{ltr:we(function(){return yc(o,e,t)}),rtl:we(function(){return R.some(yc(o,t,e))})}},exact:function(e,t,n,r){return{ltr:we(function(){return xc(o,e,t,n,r)}),rtl:we(function(){return R.some(xc(o,n,r,e,t))})}}}));return(r=(n=i).ltr()).collapsed?n.rtl().filter(function(e){return!1===e.collapsed}).map(function(e){return Rc.rtl(xe.fromDom(e.endContainer),e.endOffset,xe.fromDom(e.startContainer),e.startOffset)}).getOrThunk(function(){return Sc(0,Rc.ltr,r)}):Sc(0,Rc.ltr,r)},Dc=function(i,e){return Tc(i,e).match({ltr:function(e,t,n,r){var o=i.document.createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o},rtl:function(e,t,n,r){var o=i.document.createRange();return o.setStart(n.dom(),r),o.setEnd(e.dom(),t),o}})},Oc=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Nc=function(n,r,e,t,o){var i=function(e){var t=n.dom().createRange();return t.setStart(r.dom(),e),t.collapse(!0),t},u=vn(r).length,a=function(e,t,n,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,u=1;u<o;u++){var a=e(u),c=Math.abs(t-a.left);if(n<=a.bottom){if(n<a.top||i<c)return u-1;i=c}}return 0}(function(e){return i(e).getBoundingClientRect()},e,t,o.right,u);return i(a)},Ec=function(e,t,n,r){return le(t)?function(t,n,r,o){var e=t.dom().createRange();e.selectNode(n.dom());var i=e.getClientRects();return xo(i,function(e){return Oc(e,r,o)?R.some(e):R.none()}).map(function(e){return Nc(t,n,r,o,e)})}(e,t,n,r):(i=t,u=n,a=r,c=(o=e).dom().createRange(),l=bt(i),xo(l,function(e){return c.selectNode(e.dom()),Oc(c.getBoundingClientRect(),u,a)?Ec(o,e,u,a):R.none()}));var o,i,u,a,c,l},kc=function(e,t){return t-e.left<e.right-t},Ac=function(e,t,n){var r=e.dom().createRange();return r.selectNode(t.dom()),r.collapse(n),r},Pc=function(t,e,n){var r=t.dom().createRange();r.selectNode(e.dom());var o=r.getBoundingClientRect(),i=kc(o,n);return(!0===i?Rn:Sn)(e).map(function(e){return Ac(t,e,i)})},Ic=function(e,t,n){var r=t.dom().getBoundingClientRect(),o=kc(r,n);return R.some(Ac(e,t,o))},Bc=function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect();return function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return Ec(e,t,u,a)}(e,t,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},Wc=document.caretPositionFromPoint?function(n,e,t){return R.from(n.dom().caretPositionFromPoint(e,t)).bind(function(e){if(null===e.offsetNode)return R.none();var t=n.dom().createRange();return t.setStart(e.offsetNode,e.offset),t.collapse(),R.some(t)})}:document.caretRangeFromPoint?function(e,t,n){return R.from(e.dom().caretRangeFromPoint(t,n))}:function(o,i,t){return xe.fromPoint(o,i,t).bind(function(r){var e=function(){return e=o,n=i,(0===bt(t=r).length?Ic:Pc)(e,t,n);var e,t,n};return 0===bt(r).length?e():Bc(o,r,i,t).orThunk(e)})},Mc=function(e,t){var n=oe(e);return"input"===n?pc.after(e):O(["br","img"],n)?0===t?pc.before(e):pc.after(e):pc.on(e,t)},_c=function(e,t){var n=e.fold(pc.before,Mc,pc.after),r=t.fold(pc.before,Mc,pc.after);return bc.relative(n,r)},Lc=function(e,t,n,r){var o=Mc(e,t),i=Mc(n,r);return bc.relative(o,i)},Fc=function(e,t,n,r){var o,i,u,a,c,l=(i=t,u=n,a=r,(c=mt(o=e).dom().createRange()).setStart(o.dom(),i),c.setEnd(u.dom(),a),c),f=ft(e,n)&&t===r;return l.collapsed&&!f},jc=function(e,t){R.from(e.getSelection()).each(function(e){e.removeAllRanges(),e.addRange(t)})},zc=function(e,t,n,r,o){var i=xc(e,t,n,r,o);jc(e,i)},Hc=function(s,e){return Tc(s,e).match({ltr:function(e,t,n,r){zc(s,e,t,n,r)},rtl:function(e,t,n,r){var o,i,u,a,c,l=s.getSelection();if(l.setBaseAndExtent)l.setBaseAndExtent(e.dom(),t,n.dom(),r);else if(l.extend)try{i=e,u=t,a=n,c=r,(o=l).collapse(i.dom(),u),o.extend(a.dom(),c)}catch(f){zc(s,n,r,e,t)}else zc(s,n,r,e,t)}})},Uc=function(e){var o=bc.getWin(e).dom(),t=function(e,t,n,r){return xc(o,e,t,n,r)},n=e.match({domRange:function(e){var t=xe.fromDom(e.startContainer),n=xe.fromDom(e.endContainer);return Lc(t,e.startOffset,n,e.endOffset)},relative:_c,exact:Lc});return Tc(o,n).match({ltr:t,rtl:t})},qc=function(e){var t=xe.fromDom(e.anchorNode),n=xe.fromDom(e.focusNode);return Fc(t,e.anchorOffset,n,e.focusOffset)?R.some(gc.create(t,e.anchorOffset,n,e.focusOffset)):function(e){if(0<e.rangeCount){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return R.some(gc.create(xe.fromDom(t.startContainer),t.startOffset,xe.fromDom(n.endContainer),n.endOffset))}return R.none()}(e)},Vc=function(e,t){var n,r,o=(n=t,r=e.document.createRange(),wc(r,n),r);jc(e,o)},Gc=function(e){return(t=e,R.from(t.getSelection()).filter(function(e){return 0<e.rangeCount}).bind(qc)).map(function(e){return bc.exact(e.start(),e.soffset(),e.finish(),e.foffset())});var t},Yc=function(e,t){var n,r,o,i=Dc(e,t);return r=(n=i).getClientRects(),0<(o=0<r.length?r[0]:n.getBoundingClientRect()).width||0<o.height?R.some(o).map(Cc):R.none()},Xc=function(e,t,n){return r=e,o=t,i=n,u=xe.fromDom(r.document),Wc(u,o,i).map(function(e){return gc.create(xe.fromDom(e.startContainer),e.startOffset,xe.fromDom(e.endContainer),e.endOffset)});var r,o,i,u},Kc=tinymce.util.Tools.resolve("tinymce.util.VK"),Jc=function(e,t,n,r){return el(e,t,dc(n),r)},$c=function(e,t,n,r){return el(e,t,mc(n),r)},Qc=function(e,t){var n=bc.exact(t,0,t,0);return Uc(n)},Zc=function(e,t){var n,r=qt(t,"tr");return(n=r,0===n.length?R.none():R.some(n[n.length-1])).bind(function(e){return Qt(e,"td,th").map(function(e){return Qc(0,e)})})},el=function(r,e,t,o,n){return t.fold(R.none,R.none,function(e,t){return Rn(t).map(function(e){return Qc(0,e)})},function(n){return cn.table(n,e).bind(function(e){var t=kr.noMenu(n);return r.undoManager.transact(function(){o.insertRowsAfter(e,t)}),Zc(0,e)})})},tl=["table","li","dl"],nl=function(t,n,r,o){if(t.keyCode===Kc.TAB){var i=Fu(n),u=function(e){var t=oe(e);return ft(e,i)||O(tl,t)},e=n.selection.getRng();if(e.collapsed){var a=xe.fromDom(e.startContainer);cn.cell(a,u).each(function(e){t.preventDefault(),(t.shiftKey?$c:Jc)(n,u,e,r,o).each(function(e){n.selection.setRng(e)})})}}},rl={create:q("selection","kill")},ol=function(e,t,n,r){return{start:C(pc.on(e,t)),finish:C(pc.on(n,r))}},il={convertToRange:function(e,t){var n=Dc(e,t);return gc.create(xe.fromDom(n.startContainer),n.startOffset,xe.fromDom(n.endContainer),n.endOffset)},makeSitus:ol},ul=function(n,e,r,t,o){return ft(r,t)?R.none():sr(r,t,e).bind(function(e){var t=e.boxes().getOr([]);return 0<t.length?(o(n,t,e.start(),e.finish()),R.some(rl.create(R.some(il.makeSitus(r,0,r,yn(r))),!0))):R.none()})},al={sync:function(n,r,e,t,o,i,u){return ft(e,o)&&t===i?R.none():Zt(e,"td,th",r).bind(function(t){return Zt(o,"td,th",r).bind(function(e){return ul(n,r,t,e,u)})})},detect:ul,update:function(e,t,n,r,o){return mr(r,e,t,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(e){return o.clear(n),o.selectRange(n,e.boxes(),e.start(),e.finish()),e.boxes()})}},cl=q("item","mode"),ll=function(e,t,n,r){return void 0===r&&(r=fl),e.property().parent(t).map(function(e){return cl(e,r)})},fl=function(e,t,n,r){return void 0===r&&(r=sl),n.sibling(e,t).map(function(e){return cl(e,r)})},sl=function(e,t,n,r){void 0===r&&(r=sl);var o=e.property().children(t);return n.first(o).map(function(e){return cl(e,r)})},dl=[{current:ll,next:fl,fallback:R.none()},{current:fl,next:sl,fallback:R.some(ll)},{current:sl,next:sl,fallback:R.some(fl)}],ml=function(t,n,r,o,e){return void 0===e&&(e=dl),B(e,function(e){return e.current===r}).bind(function(e){return e.current(t,n,o,e.next).orThunk(function(){return e.fallback.bind(function(e){return ml(t,n,e,o)})})})},gl=function(){return{sibling:function(e,t){return e.query().prevSibling(t)},first:function(e){return 0<e.length?R.some(e[e.length-1]):R.none()}}},hl=function(){return{sibling:function(e,t){return e.query().nextSibling(t)},first:function(e){return 0<e.length?R.some(e[0]):R.none()}}},pl=function(t,e,n,r,o,i){return ml(t,e,r,o).bind(function(e){return i(e.item())?R.none():n(e.item())?R.some(e.item()):pl(t,e.item(),n,e.mode(),o,i)})},vl=function(t){return function(e){return 0===t.property().children(e).length}},bl=function(e,t,n,r){return pl(e,t,n,fl,gl(),r)},wl=function(e,t,n,r){return pl(e,t,n,fl,hl(),r)},yl=$n(),xl=function(e,t){return r=t,bl(n=yl,e,vl(n),r);var n,r},Cl=function(e,t){return r=t,wl(n=yl,e,vl(n),r);var n,r},Rl=q("element","offset"),Sl=(q("element","deltaOffset"),q("element","start","finish"),q("begin","end"),q("element","text"),xr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}])),Tl=function(e){return Zt(e,"tr")},Dl=wo(wo({},Sl),{verify:function(a,e,t,n,r,c,o){return Zt(n,"td,th",o).bind(function(u){return Zt(e,"td,th",o).map(function(i){return ft(u,i)?ft(n,u)&&yn(u)===r?c(i):Sl.none("in same cell"):ar.sharedOne(Tl,[u,i]).fold(function(){return t=i,n=u,r=(e=a).getRect(t),(o=e.getRect(n)).right>r.left&&o.left<r.right?Sl.success():c(i);var e,t,n,r,o},function(e){return c(i)})})}).getOr(Sl.none("default"))},cata:function(e,t,n,r,o){return e.fold(t,n,r,o)}}),Ol=(q("ancestor","descendants","element","index"),q("parent","children","element","index")),Nl=function(e,t){return W(e,b(ft,t))},El=function(e){return"br"===oe(e)},kl=function(e,t,n){return t(e,n).bind(function(e){return le(e)&&0===vn(e).trim().length?kl(e,t,n):R.some(e)})},Al=function(t,e,n,r){return(o=e,i=n,wt(o,i).filter(El).orThunk(function(){return wt(o,i-1).filter(El)})).bind(function(e){return r.traverse(e).fold(function(){return kl(e,r.gather,t).map(r.relative)},function(e){return(r=e,gt(r).bind(function(t){var n=bt(t);return Nl(n,r).map(function(e){return Ol(t,n,r,e)})})).map(function(e){return pc.on(e.parent(),e.index())});var r})});var o,i},Pl=function(e,t,n,r){var o,i,u;return(El(t)?(o=e,i=t,(u=r).traverse(i).orThunk(function(){return kl(i,u.gather,o)}).map(u.relative)):Al(e,t,n,r)).map(function(e){return{start:C(e),finish:C(e)}})},Il=function(e){return Dl.cata(e,function(e){return R.none()},function(){return R.none()},function(e){return R.some(Rl(e,0))},function(e){return R.some(Rl(e,yn(e)))})},Bl=J(["left","top","right","bottom"],[]),Wl={nu:Bl,moveUp:function(e,t){return Bl({left:e.left(),top:e.top()-t,right:e.right(),bottom:e.bottom()-t})},moveDown:function(e,t){return Bl({left:e.left(),top:e.top()+t,right:e.right(),bottom:e.bottom()+t})},moveBottomTo:function(e,t){var n=e.bottom()-e.top();return Bl({left:e.left(),top:t-n,right:e.right(),bottom:t})},moveTopTo:function(e,t){var n=e.bottom()-e.top();return Bl({left:e.left(),top:t,right:e.right(),bottom:t+n})},getTop:function(e){return e.top()},getBottom:function(e){return e.bottom()},translate:function(e,t,n){return Bl({left:e.left()+t,top:e.top()+n,right:e.right()+t,bottom:e.bottom()+n})},toString:function(e){return"("+e.left()+", "+e.top()+") -> ("+e.right()+", "+e.bottom()+")"}},Ml=function(e){return Wl.nu({left:e.left,top:e.top,right:e.right,bottom:e.bottom})},_l=function(e,t){return R.some(e.getRect(t))},Ll=function(e,t,n){return ce(t)?_l(e,t).map(Ml):le(t)?(r=e,o=t,i=n,0<=i&&i<yn(o)?r.getRangedRect(o,i,o,i+1):0<i?r.getRangedRect(o,i-1,o,i):R.none()).map(Ml):R.none();var r,o,i},Fl=function(e,t){return ce(t)?_l(e,t).map(Ml):le(t)?e.getRangedRect(t,0,t,yn(t)).map(Ml):R.none()},jl=xr([{none:[]},{retry:["caret"]}]),zl=function(t,e,r){return(n=e,o=Tu,Vt(function(e,t){return t(e)},Kt,n,o,i)).fold(C(!1),function(e){return Fl(t,e).exists(function(e){return n=e,(t=r).left()<n.left()||Math.abs(n.right()-t.left())<1||t.left()>n.right();var t,n})});var n,o,i},Hl={point:Wl.getTop,adjuster:function(e,t,n,r,o){var i=Wl.moveUp(o,5);return Math.abs(n.top()-r.top())<1?jl.retry(i):n.bottom()<o.top()?jl.retry(i):n.bottom()===o.top()?jl.retry(Wl.moveUp(o,1)):zl(e,t,o)?jl.retry(Wl.translate(i,5,0)):jl.none()},move:Wl.moveUp,gather:xl},Ul={point:Wl.getBottom,adjuster:function(e,t,n,r,o){var i=Wl.moveDown(o,5);return Math.abs(n.bottom()-r.bottom())<1?jl.retry(i):n.top()>o.bottom()?jl.retry(i):n.top()===o.bottom()?jl.retry(Wl.moveDown(o,1)):zl(e,t,o)?jl.retry(Wl.translate(i,5,0)):jl.none()},move:Wl.moveDown,gather:Cl},ql=function(n,r,o,i,u){return 0===u?R.some(i):(c=n,l=i.left(),f=r.point(i),c.elementFromPoint(l,f).filter(function(e){return"table"===oe(e)}).isSome()?(t=i,a=u-1,ql(n,e=r,o,e.move(t,5),a)):n.situsFromPoint(i.left(),r.point(i)).bind(function(e){return e.start().fold(R.none,function(t){return Fl(n,t).bind(function(e){return r.adjuster(n,t,e,o,i).fold(R.none,function(e){return ql(n,r,o,e,u-1)})}).orThunk(function(){return R.some(i)})},R.none)}));var e,t,a,c,l,f},Vl=function(t,n,e){var r,o,i,u=t.move(e,5),a=ql(n,t,e,u,100).getOr(u);return(r=t,o=a,i=n,r.point(o)>i.getInnerHeight()?R.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?R.some(-r.point(o)):R.none()).fold(function(){return n.situsFromPoint(a.left(),t.point(a))},function(e){return n.scrollBy(0,e),n.situsFromPoint(a.left(),t.point(a)-e)})},Gl={tryUp:b(Vl,Hl),tryDown:b(Vl,Ul),ieTryUp:function(e,t){return e.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(e,t){return e.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:C(5)},Yl=it.detect(),Xl=function(r,o,i,u,a,c){return 0===c?R.none():$l(r,o,i,u,a).bind(function(e){var t=r.fromSitus(e),n=Dl.verify(r,i,u,t.finish(),t.foffset(),a.failure,o);return Dl.cata(n,function(){return R.none()},function(){return R.some(e)},function(e){return ft(i,e)&&0===u?Kl(r,i,u,Wl.moveUp,a):Xl(r,o,e,0,a,c-1)},function(e){return ft(i,e)&&u===yn(e)?Kl(r,i,u,Wl.moveDown,a):Xl(r,o,e,yn(e),a,c-1)})})},Kl=function(t,e,n,r,o){return Ll(t,e,n).bind(function(e){return Jl(t,o,r(e,Gl.getJumpSize()))})},Jl=function(e,t,n){return Yl.browser.isChrome()||Yl.browser.isSafari()||Yl.browser.isFirefox()||Yl.browser.isEdge()?t.otherRetry(e,n):Yl.browser.isIE()?t.ieRetry(e,n):R.none()},$l=function(t,e,n,r,o){return Ll(t,n,r).bind(function(e){return Jl(t,o,e)})},Ql=function(t,n,r){return(o=t,i=n,u=r,o.getSelection().bind(function(r){return Pl(i,r.finish(),r.foffset(),u).fold(function(){return R.some(Rl(r.finish(),r.foffset()))},function(e){var t=o.fromSitus(e),n=Dl.verify(o,r.finish(),r.foffset(),t.finish(),t.foffset(),u.failure,i);return Il(n)})})).bind(function(e){return Xl(t,n,e.element(),e.offset(),r,20).map(t.fromSitus)});var o,i,u},Zl=it.detect(),ef=function(e,t){return Kt(e,function(e){return gt(e).exists(function(e){return ft(e,t)})},n).isSome();var n},tf=function(t,r,o,e,i){return Zt(e,"td,th",r).bind(function(n){return Zt(n,"table",r).bind(function(e){return ef(i,e)?Ql(t,r,o).bind(function(t){return Zt(t.finish(),"td,th",r).map(function(e){return{start:C(n),finish:C(e),range:C(t)}})}):R.none()})})},nf=function(e,t,n,r,o,i){return Zl.browser.isIE()?R.none():i(r,t).orThunk(function(){return tf(e,t,n,r,o).map(function(e){var t=e.range();return rl.create(R.some(il.makeSitus(t.start(),t.soffset(),t.finish(),t.foffset())),!0)})})},rf=function(e,t,n,r,o,i,u){return tf(e,n,r,o,i).bind(function(e){return al.detect(t,n,e.start(),e.finish(),u)})},of=function(e,u){return Zt(e,"tr",u).bind(function(i){return Zt(i,"table",u).bind(function(e){var t,n,r,o=qt(e,"tr");return ft(i,o[0])?(t=e,n=function(e){return Sn(e).isSome()},r=u,bl(yl,t,n,r)).map(function(e){var t=yn(e);return rl.create(R.some(il.makeSitus(e,t,e,t)),!0)}):R.none()})})},uf=function(e,u){return Zt(e,"tr",u).bind(function(i){return Zt(i,"table",u).bind(function(e){var t,n,r,o=qt(e,"tr");return ft(i,o[o.length-1])?(t=e,n=function(e){return Rn(e).isSome()},r=u,wl(yl,t,n,r)).map(function(e){return rl.create(R.some(il.makeSitus(e,0,e,0)),!0)}):R.none()})})},af=function(e,t){return Zt(e,"td,th",t)},cf={down:{traverse:vt,gather:Cl,relative:pc.before,otherRetry:Gl.tryDown,ieRetry:Gl.ieTryDown,failure:Dl.failedDown},up:{traverse:pt,gather:xl,relative:pc.before,otherRetry:Gl.tryUp,ieRetry:Gl.ieTryUp,failure:Dl.failedUp}},lf=function(t){return function(e){return e===t}},ff=lf(38),sf=lf(40),df={ltr:{isBackward:lf(37),isForward:lf(39)},rtl:{isBackward:lf(39),isForward:lf(37)},isUp:ff,isDown:sf,isNavigation:function(e){return 37<=e&&e<=40}},mf=function(e){return{left:e.left(),top:e.top(),right:e.right(),bottom:e.bottom(),width:e.width(),height:e.height()}},gf=(it.detect().browser.isSafari(),function(a){return{elementFromPoint:function(e,t){return xe.fromPoint(xe.fromDom(a.document),e,t)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,t,n,r){var o=bc.exact(e,t,n,r);return Yc(a,o).map(mf)},getSelection:function(){return Gc(a).map(function(e){return il.convertToRange(a,e)})},fromSitus:function(e){var t=bc.relative(e.start(),e.finish());return il.convertToRange(a,t)},situsFromPoint:function(e,t){return Xc(a,e,t).map(function(e){return ol(e.start(),e.soffset(),e.finish(),e.foffset())})},clearSelection:function(){a.getSelection().removeAllRanges()},setSelection:function(e){var t,n,r,o,i,u;t=a,n=e.start(),r=e.soffset(),o=e.finish(),i=e.foffset(),u=Lc(n,r,o,i),Hc(t,u)},setRelativeSelection:function(e,t){var n,r;n=a,r=_c(e,t),Hc(n,r)},selectContents:function(e){Vc(a,e)},getInnerHeight:function(){return a.innerHeight},getScrollY:function(){var e,t,n,r;return(e=xe.fromDom(a.document),t=e!==undefined?e.dom():m.document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop,eo(n,r)).top()},scrollBy:function(e,t){var n,r,o;n=e,r=t,((o=xe.fromDom(a.document))!==undefined?o.dom():m.document).defaultView.scrollBy(n,r)}}}),hf=q("rows","cols"),pf={mouse:function(e,t,n,r){var o,i,u,a,c,l,f=gf(e),s=(o=f,i=t,u=n,a=r,c=R.none(),l=function(){c=R.none()},{mousedown:function(e){a.clear(i),c=af(e.target(),u)},mouseover:function(e){c.each(function(r){a.clear(i),af(e.target(),u).each(function(n){sr(r,n,u).each(function(e){var t=e.boxes().getOr([]);(1<t.length||1===t.length&&!ft(r,n))&&(a.selectRange(i,t,e.start(),e.finish()),o.selectContents(n))})})})},mouseup:function(e){c.each(l)}});return{mousedown:s.mousedown,mouseover:s.mouseover,mouseup:s.mouseup}},keyboard:function(e,l,f,s){var d=gf(e),m=function(){return s.clear(l),R.none()};return{keydown:function(e,t,n,r,o,i){var u=e.raw(),a=u.which,c=!0===u.shiftKey;return dr(l,s.selectedSelector()).fold(function(){return df.isDown(a)&&c?b(rf,d,l,f,cf.down,r,t,s.selectRange):df.isUp(a)&&c?b(rf,d,l,f,cf.up,r,t,s.selectRange):df.isDown(a)?b(nf,d,f,cf.down,r,t,uf):df.isUp(a)?b(nf,d,f,cf.up,r,t,of):R.none},function(t){var e=function(e){return function(){return xo(e,function(e){return al.update(e.rows(),e.cols(),l,t,s)}).fold(function(){return gr(l,s.firstSelectedSelector(),s.lastSelectedSelector()).map(function(e){var t=df.isDown(a)||i.isForward(a)?pc.after:pc.before;return d.setRelativeSelection(pc.on(e.first(),0),t(e.table())),s.clear(l),rl.create(R.none(),!0)})},function(e){return R.some(rl.create(R.none(),!0))})}};return df.isDown(a)&&c?e([hf(1,0)]):df.isUp(a)&&c?e([hf(-1,0)]):i.isBackward(a)&&c?e([hf(0,-1),hf(-1,0)]):i.isForward(a)&&c?e([hf(0,1),hf(1,0)]):df.isNavigation(a)&&!1===c?m:R.none})()},keyup:function(n,r,o,i,u){return dr(l,s.selectedSelector()).fold(function(){var e=n.raw(),t=e.which;return 0==(!0===e.shiftKey)?R.none():df.isNavigation(t)?al.sync(l,f,r,o,i,u,s.selectRange):R.none()},R.none)}}}},vf=function(r,e){k(e,function(e){var t,n;n=e,Do(t=r)?t.dom().classList.remove(n):No(t,n),ko(t)})},bf={byClass:function(o){var t,n,i=(t=o.selected(),function(e){Eo(e,t)}),r=(n=[o.selected(),o.lastSelected(),o.firstSelected()],function(e){vf(e,n)}),u=function(e){var t=qt(e,o.selectedSelector());k(t,r)};return{clear:u,selectRange:function(e,t,n,r){u(e),k(t,i),Eo(n,o.firstSelected()),Eo(r,o.lastSelected())},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}},byAttr:function(o){var n=function(e){he(e,o.selected()),he(e,o.firstSelected()),he(e,o.lastSelected())},i=function(e){se(e,o.selected(),"1")},u=function(e){var t=qt(e,o.selectedSelector());k(t,n)};return{clear:u,selectRange:function(e,t,n,r){u(e),k(t,i),se(n,o.firstSelected(),"1"),se(r,o.lastSelected(),"1")},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}},wf=function(e){return!1===Ao(xe.fromDom(e.target),"ephox-snooker-resizer-bar")};function yf(h,p){var v=J(["mousedown","mouseover","mouseup","keyup","keydown"],[]),b=R.none(),w=bf.byAttr(yr);return h.on("init",function(e){var r=h.getWin(),o=Fu(h),t=Hu(h),n=pf.mouse(r,o,t,w),a=pf.keyboard(r,o,t,w),c=function(e,t){!0===e.raw().shiftKey&&(t.kill()&&e.kill(),t.selection().each(function(e){var t=bc.relative(e.start(),e.finish()),n=Dc(r,t);h.selection.setRng(n)}))},i=function(e){var t=f(e);if(t.raw().shiftKey&&df.isNavigation(t.raw().which)){var n=h.selection.getRng(),r=xe.fromDom(n.startContainer),o=xe.fromDom(n.endContainer);a.keyup(t,r,n.startOffset,o,n.endOffset).each(function(e){c(t,e)})}},u=function(e){var t=f(e);p().each(function(e){e.hideBars()});var n=h.selection.getRng(),r=xe.fromDom(h.selection.getStart()),o=xe.fromDom(n.startContainer),i=xe.fromDom(n.endContainer),u=Yu.directionAt(r).isRtl()?df.rtl:df.ltr;a.keydown(t,o,n.startOffset,i,n.endOffset,u).each(function(e){c(t,e)}),p().each(function(e){e.showBars()})},l=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},f=function(e){var t=xe.fromDom(e.target),n=function(){e.stopPropagation()},r=function(){e.preventDefault()},o=x(r,n);return{target:C(t),x:C(l(e)?e.x:null),y:C(l(e)?e.y:null),stop:n,prevent:r,kill:o,raw:C(e)}},s=function(e){return 0===e.button},d=function(e){s(e)&&wf(e)&&n.mousedown(f(e))},m=function(e){var t;((t=e).buttons===undefined||Sa.ie&&12<=Sa.ie&&0===t.buttons||0!=(1&t.buttons))&&wf(e)&&n.mouseover(f(e))},g=function(e){s(e)&&wf(e)&&n.mouseup(f(e))};h.on("mousedown",d),h.on("mouseover",m),h.on("mouseup",g),h.on("keyup",i),h.on("keydown",u),h.on("nodechange",function(){var e=h.selection,t=xe.fromDom(e.getStart()),n=xe.fromDom(e.getEnd());ar.sharedOne(cn.table,[t,n]).fold(function(){w.clear(o)},y)}),b=R.some(v({mousedown:d,mouseover:m,mouseup:g,keyup:i,keydown:u}))}),{clear:w.clear,destroy:function(){b.each(function(e){})}}}var xf=sa.each,Cf=function(t){var n=[];function e(e){return function(){t.execCommand(e)}}xf("inserttable tableprops deletetable | cell row column".split(" "),function(e){"|"===e?n.push({text:"-"}):n.push(t.menuItems[e])}),t.addButton("table",{type:"menubutton",title:"Table",menu:n}),t.addButton("tableprops",{title:"Table properties",onclick:e("mceTableProps"),icon:"table"}),t.addButton("tabledelete",{title:"Delete table",onclick:e("mceTableDelete")}),t.addButton("tablecellprops",{title:"Cell properties",onclick:e("mceTableCellProps")}),t.addButton("tablemergecells",{title:"Merge cells",onclick:e("mceTableMergeCells")}),t.addButton("tablesplitcells",{title:"Split cell",onclick:e("mceTableSplitCells")}),t.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:e("mceTableInsertRowBefore")}),t.addButton("tableinsertrowafter",{title:"Insert row after",onclick:e("mceTableInsertRowAfter")}),t.addButton("tabledeleterow",{title:"Delete row",onclick:e("mceTableDeleteRow")}),t.addButton("tablerowprops",{title:"Row properties",onclick:e("mceTableRowProps")}),t.addButton("tablecutrow",{title:"Cut row",onclick:e("mceTableCutRow")}),t.addButton("tablecopyrow",{title:"Copy row",onclick:e("mceTableCopyRow")}),t.addButton("tablepasterowbefore",{title:"Paste row before",onclick:e("mceTablePasteRowBefore")}),t.addButton("tablepasterowafter",{title:"Paste row after",onclick:e("mceTablePasteRowAfter")}),t.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:e("mceTableInsertColBefore")}),t.addButton("tableinsertcolafter",{title:"Insert column after",onclick:e("mceTableInsertColAfter")}),t.addButton("tabledeletecol",{title:"Delete column",onclick:e("mceTableDeleteCol")})},Rf=function(t){var e,n=""===(e=t.getParam("table_toolbar",Xu))||!1===e?[]:d(e)?e.split(/[ ,]/):h(e)?e:[];0<n.length&&t.addContextToolbar(function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},n.join(" "))},Sf=function(o,n){var r=R.none(),i=[],u=[],a=[],c=[],l=function(e){e.disabled(!0)},f=function(e){e.disabled(!1)},e=function(){var t=this;i.push(t),r.fold(function(){l(t)},function(e){f(t)})},t=function(){var t=this;u.push(t),r.fold(function(){l(t)},function(e){f(t)})};o.on("init",function(){o.on("nodechange",function(e){var t=R.from(o.dom.getParent(o.selection.getStart(),"th,td"));(r=t.bind(function(e){var t=xe.fromDom(e);return cn.table(t).map(function(e){return kr.forMenu(n,e,t)})})).fold(function(){k(i,l),k(u,l),k(a,l),k(c,l)},function(t){k(i,f),k(u,f),k(a,function(e){e.disabled(t.mergable().isNone())}),k(c,function(e){e.disabled(t.unmergable().isNone())})})})});var s=function(e,t,n,r){var o,i,u,a,c,l=r.getEl().getElementsByTagName("table")[0],f=r.isRtl()||"tl-tr"===r.parent().rel;for(l.nextSibling.innerHTML=t+1+" x "+(n+1),f&&(t=9-t),i=0;i<10;i++)for(o=0;o<10;o++)a=l.rows[i].childNodes[o].firstChild,c=(f?t<=o:o<=t)&&i<=n,e.dom.toggleClass(a,"mce-active",c),c&&(u=a);return u.parentNode},d=!1===o.getParam("table_grid",!0,"boolean")?{text:"Table",icon:"table",context:"table",onclick:m("mceInsertTable")}:{text:"Table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(e){e.aria&&(this.parent().hideAll(),e.stopImmediatePropagation(),o.execCommand("mceInsertTable"))},onshow:function(){s(o,0,0,this.menu.items()[0])},onhide:function(){var e=this.menu.items()[0].getEl().getElementsByTagName("a");o.dom.removeClass(e,"mce-active"),o.dom.addClass(e[0],"mce-active")},menu:[{type:"container",html:function(){var e="";e='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var t=0;t<10;t++){e+="<tr>";for(var n=0;n<10;n++)e+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*t+n)+'" href="#" data-mce-x="'+n+'" data-mce-y="'+t+'"></a></td>';e+="</tr>"}return e+="</table>",e+='<div class="mce-text-center" role="presentation">1 x 1</div>'}(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(e){var t,n,r=e.target;"A"===r.tagName.toUpperCase()&&(t=parseInt(r.getAttribute("data-mce-x"),10),n=parseInt(r.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"===this.parent().rel)&&(t=9-t),t===this.lastX&&n===this.lastY||(s(o,t,n,e.control),this.lastX=t,this.lastY=n))},onclick:function(e){var t=this;"A"===e.target.tagName.toUpperCase()&&(e.preventDefault(),e.stopPropagation(),t.parent().cancel(),o.undoManager.transact(function(){Na(o,t.lastX+1,t.lastY+1)}),o.addVisual())}}]};function m(e){return function(){o.execCommand(e)}}var g={text:"Table properties",context:"table",onPostRender:e,onclick:m("mceTableProps")},h={text:"Delete table",context:"table",onPostRender:e,cmd:"mceTableDelete"},p={text:"Row",context:"table",menu:[{text:"Insert row before",onclick:m("mceTableInsertRowBefore"),onPostRender:t},{text:"Insert row after",onclick:m("mceTableInsertRowAfter"),onPostRender:t},{text:"Delete row",onclick:m("mceTableDeleteRow"),onPostRender:t},{text:"Row properties",onclick:m("mceTableRowProps"),onPostRender:t},{text:"-"},{text:"Cut row",onclick:m("mceTableCutRow"),onPostRender:t},{text:"Copy row",onclick:m("mceTableCopyRow"),onPostRender:t},{text:"Paste row before",onclick:m("mceTablePasteRowBefore"),onPostRender:t},{text:"Paste row after",onclick:m("mceTablePasteRowAfter"),onPostRender:t}]},v={text:"Column",context:"table",menu:[{text:"Insert column before",onclick:m("mceTableInsertColBefore"),onPostRender:t},{text:"Insert column after",onclick:m("mceTableInsertColAfter"),onPostRender:t},{text:"Delete column",onclick:m("mceTableDeleteCol"),onPostRender:t}]},b={separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:m("mceTableCellProps"),onPostRender:t},{text:"Merge cells",onclick:m("mceTableMergeCells"),onPostRender:function(){var t=this;a.push(t),r.fold(function(){l(t)},function(e){t.disabled(e.mergable().isNone())})}},{text:"Split cell",onclick:m("mceTableSplitCells"),onPostRender:function(){var t=this;c.push(t),r.fold(function(){l(t)},function(e){t.disabled(e.unmergable().isNone())})}}]};o.addMenuItem("inserttable",d),o.addMenuItem("tableprops",g),o.addMenuItem("deletetable",h),o.addMenuItem("row",p),o.addMenuItem("column",v),o.addMenuItem("cell",b)},Tf=function(n,r){return{insertTable:function(e,t){return Na(n,e,t)},setClipboardRows:function(e){return t=r,n=E(e,xe.fromDom),void t.set(R.from(n));var t,n},getClipboardRows:function(){return r.get().fold(function(){},function(e){return E(e,function(e){return e.dom()})})}}};e.add("table",function(t){var n,r=cc(t),e=yf(t,r.lazyResize),o=la(t,r.lazyWire),i=(n=t,{get:function(){var e=Fu(n);return hr(e,yr.selectedSelector()).fold(function(){return n.selection.getStart()===undefined?Rr.none():Rr.single(n.selection)},function(e){return Rr.multiple(e)})}}),u=lu(R.none());return Ba(t,o,e,i,u),Ar(t,i,o,e),Sf(t,i),Cf(t),Rf(t),t.on("PreInit",function(){t.serializer.addTempAttr(yr.firstSelected()),t.serializer.addTempAttr(yr.lastSelected())}),t.getParam("table_tab_navigation",!0,"boolean")&&t.on("keydown",function(e){nl(e,t,o,r.lazyWire)}),t.on("remove",function(){r.destroy(),e.destroy()}),Tf(t,u)})}(window);!function(c){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.VK"),m=function(e){return e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))},v=t.DOM,n=function(e){e.keyCode!==d.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==d.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=f.explode(m(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):v.get(e[0]):":next"===e[1]?u(1):v.get(e[1]))){var t=s.get(o.id||o.name);o.id&&t?t.focus():y.setTimeout(function(){a.webkit||c.window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(t){return/INPUT|TEXTAREA|BUTTON/.test(t.tagName)&&s.get(n.id)&&-1!==t.tabIndex&&function e(t){return"BODY"===t.nodeName||"hidden"!==t.type&&"none"!==t.style.display&&"hidden"!==t.style.visibility&&e(t.parentNode)}(t)}if(o=v.select(":input:enabled,*[tabindex]:not(iframe)"),f.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0<e){for(l=i+1;l<o.length;l++)if(t(o[l]))return o[l]}else for(l=i-1;0<=l;l--)if(t(o[l]))return o[l];return null}}r.on("init",function(){r.inline&&v.setAttrib(r.getBody(),"tabIndex",null),r.on("keyup",n),a.gecko?r.on("keypress keydown",e):r.on("keydown",e)})};e.add("tabfocus",function(e){i(e)})}(window);!function(v){"use strict";var p=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return p(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(t.settings.plugins)||!e.get("powerpaste")||("undefined"!=typeof v.window.console&&v.window.console.log&&v.window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},u=function(t,e){return{clipboard:t,quirks:e}},d=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})},m=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})},s=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},n=function(t,e){return t.fire("paste",{ieFake:e})},g={shouldPlainTextInform:function(t){return t.getParam("paste_plaintext_inform",!0)},shouldBlockDrop:function(t){return t.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(t){return t.getParam("paste_data_images",!1)},shouldFilterDrop:function(t){return t.getParam("paste_filter_drop",!0)},getPreProcess:function(t){return t.getParam("paste_preprocess")},getPostProcess:function(t){return t.getParam("paste_postprocess")},getWebkitStyles:function(t){return t.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(t){return t.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(t){return t.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(t){return t.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(t){return t.getParam("paste_as_text",!1)},getRetainStyleProps:function(t){return t.getParam("paste_retain_style_properties")},getWordValidElements: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")},shouldConvertWordFakeLists:function(t){return t.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(t){return t.getParam("paste_enable_default_filters",!0)}},r=function(t,e,n){var r,o,i;"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),s(t,!1)):(e.pasteFormat.set("text"),s(t,!0),i=t,!1===n.get()&&g.shouldPlainTextInform(i)&&(o="Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",(r=t).notificationManager.open({text:r.translate(o),type:"info"}),n.set(!0))),t.focus()},c=function(t,n,e){t.addCommand("mceTogglePlainTextPaste",function(){r(t,n,e)}),t.addCommand("mceInsertClipboardContent",function(t,e){e.content&&n.pasteHtml(e.content,e.internal),e.text&&n.pasteText(e.text)})},h=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),b=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),t="x-tinymce/html",i="\x3c!-- "+t+" --\x3e",l=function(t){return i+t},f=function(t){return t.replace(i,"")},w=function(t){return-1!==t.indexOf(i)},x=function(){return t},_=tinymce.util.Tools.resolve("tinymce.html.Entities"),P=function(t){return t.replace(/\r?\n/g,"<br>")},T=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+'="'+_.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",a=b.map(r,function(t){return t.split(/\n/).join("<br />")});return 1===a.length?a[0]:b.map(a,function(t){return o+t+i}).join("")},D=function(t){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(t)},C=function(t,e,n){return e?T(t,e,n):P(t)},k=tinymce.util.Tools.resolve("tinymce.html.DomParser"),F=tinymce.util.Tools.resolve("tinymce.html.Serializer"),E=tinymce.util.Tools.resolve("tinymce.html.Node"),R=tinymce.util.Tools.resolve("tinymce.html.Schema");function I(e,t){return b.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var O={filter:I,innerText:function(e){var n=R(),r=k({},n),o="",i=n.getShortEndedElements(),a=b.makeMap("script noscript style textarea video audio iframe object"," "),u=n.getBlockElements();return e=I(e,[/<!\[[^\]]+\]>/g]),function t(e){var n=e.name,r=e;if("br"!==n){if("wbr"!==n)if(i[n]&&(o+=" "),a[n])o+=" ";else{if(3===e.type&&(o+=e.value),!e.shortEnded&&(e=e.firstChild))for(;t(e),e=e.next;);u[n]&&r.next&&(o+="\n","p"===n&&(o+="\n"))}}else o+="\n"}(r.parse(e)),o},trimHtml:function(t){return t=I(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?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function(t){var e=0;return function(){return t+e++}},isMsEdge:function(){return-1!==v.navigator.userAgent.indexOf(" Edge/")}};function S(e){var n,t;return t=[/^[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]/],e=e.replace(/^[\u00a0 ]+/,""),b.each(t,function(t){if(t.test(e))return!(n=!0)}),n}function A(t){var i,a,u=1;function n(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)for(;e+=n(t),t=t.next;);return e}function s(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!s(t,e))return!1}while(t=t.next);return!0}function e(e,n,r){var o=e._listLevel||u;o!==u&&(o<u?i&&(i=i.parent.parent):(a=i,i=null)),i&&i.name===n?i.append(e):(a=a||i,i=new E(n,1),1<r&&i.attr("start",""+r),e.wrap(i)),e.name="li",u<o&&a&&a.lastChild.append(i),u=o,function t(e){if(e._listIgnore)e.remove();else if(e=e.firstChild)for(;t(e),e=e.next;);}(e),s(e,/^\u00a0+/),s(e,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),s(e,/^\u00a0+/)}for(var r=[],o=t.firstChild;null!=o;)if(r.push(o),null!==(o=o.walk()))for(;void 0!==o&&o.parent!==t;)o=o.walk();for(var c=0;c<r.length;c++)if("p"===(t=r[c]).name&&t.firstChild){var l=n(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(l)){e(t,"ul");continue}if(S(l)){var f=/([0-9]+)\./.exec(l),d=1;f&&(d=parseInt(f[1],10)),e(t,"ol",d);continue}if(t._listLevel){e(t,"ul",1);continue}i=null}else a=i,i=null}function j(n,r,o,i){var a,u={},t=n.dom.parseStyle(i);return b.each(t,function(t,e){switch(e){case"mso-list":(a=/\w+ \w+([0-9]+)/i.exec(i))&&(o._listLevel=parseInt(a[1],10)),/Ignore/i.test(t)&&o.firstChild&&(o._listIgnore=!0,o.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!==t&&(u[e]=t));case"mso-element":if(/^(comment|comment-list)$/i.test(t))return void o.remove()}0!==e.indexOf("mso-comment")?0!==e.indexOf("mso-")&&("all"===g.getRetainStyleProps(n)||r&&r[e])&&(u[e]=t):o.remove()}),/(bold)/i.test(u["font-weight"])&&(delete u["font-weight"],o.wrap(new E("b",1))),/(italic)/i.test(u["font-style"])&&(delete u["font-style"],o.wrap(new E("i",1))),(u=n.dom.serializeStyle(u,o.name))||null}var M,L,N,B,H,$,W,U,z,V={preProcess:function(t,e){return g.shouldUseDefaultFilters(t)?function(r,t){var e,o;(e=g.getRetainStyleProps(r))&&(o=b.makeMap(e.split(/[, ]/))),t=O.filter(t,[/<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>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return 0<e.length?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join("\xa0"):""}]]);var n=g.getWordValidElements(r),i=R({valid_elements:n,valid_children:"-li[p]"});b.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=k({},i);a.addAttributeFilter("style",function(t){for(var e,n=t.length;n--;)(e=t[n]).attr("style",j(r,o,e,e.attr("style"))),"span"===e.name&&e.parent&&!e.attributes.length&&e.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(t);return g.shouldConvertWordFakeLists(r)&&A(u),t=F({validate:r.settings.validate},i).serialize(u)}(t,e):e},isWordContent:function(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)}},K=function(t,e){return{content:t,cancelled:e}},q=function(t,e,n,r){var o,i,a,u,s,c,l=d(t,e,n,r),f=function(t,e){var n=k({},t.schema);n.addNodeFilter("meta",function(t){b.each(t,function(t){return t.remove()})});var r=n.parse(e,{forced_root_block:!1,isRootContent:!0});return F({validate:t.settings.validate},t.schema).serialize(r)}(t,l.content);return t.hasEventListeners("PastePostProcess")&&!l.isDefaultPrevented()?(i=f,a=n,u=r,s=(o=t).dom.create("div",{style:"display:none"},i),c=m(o,s,a,u),K(c.node.innerHTML,c.isDefaultPrevented())):K(f,l.isDefaultPrevented())},G=function(t,e,n){var r=V.isWordContent(e),o=r?V.preProcess(t,e):e;return q(t,o,n,r)},X=function(t,e){return t.insertContent(e,{merge:g.shouldMergeFormats(t),paste:!0}),!0},Y=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},Z=function(t){return Y(t)&&/.(gif|jpe?g|png)$/.test(t)},J=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!Y(e)||(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.execCommand("mceInsertLink",!1,o)}),0));var r,o,i},Q=function(t,e,n){return!!Z(e)&&(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.insertContent('<img src="'+o+'">')}),!0);var r,o,i},tt=function(t,e){var n,r;!1===g.isSmartPasteEnabled(t)?X(t,e):(n=t,r=e,b.each([J,Q,X],function(t){return!0!==t(n,r,X)}))},et=function(){},nt=function(t){return function(){return t}},rt=nt(!1),ot=nt(!0),it=function(){return at},at=(M=function(t){return t.isNone()},B={fold:function(t,e){return t()},is:rt,isSome:rt,isNone:ot,getOr:N=function(t){return t},getOrThunk:L=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:nt(null),getOrUndefined:nt(undefined),or:N,orThunk:L,map:it,each:et,bind:it,exists:rt,forall:ot,filter:it,equals:M,equals_:M,toArray:function(){return[]},toString:nt("none()")},Object.freeze&&Object.freeze(B),B),ut=function(n){var t=nt(n),e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:ot,isNone:rt,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return ut(t(n))},each:function(t){t(n)},bind:r,exists:r,forall:r,filter:function(t){return t(n)?o:at},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(rt,function(t){return e(n,t)})}};return o},st={some:ut,none:it,from:function(t){return null===t||t===undefined?at:ut(t)}},ct=(H="function",function(t){return function(t){if(null===t)return"null";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}(t)===H}),lt=Array.prototype.slice,ft=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},dt=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)},mt=ct(Array.from)?Array.from:function(t){return lt.call(t)},pt={},gt={exports:pt};$=undefined,W=pt,U=gt,z=undefined,function(t){"object"==typeof W&&void 0!==U?U.exports=t():"function"==typeof $&&$.amd?$([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function i(a,u,s){function c(e,t){if(!u[e]){if(!a[e]){var n="function"==typeof z&&z;if(!t&&n)return n(e,!0);if(l)return l(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[e]={exports:{}};a[e][0].call(o.exports,function(t){return c(a[e][1][t]||t)},o,o.exports,i,a,u,s)}return u[e].exports}for(var l="function"==typeof z&&z,t=0;t<s.length;t++)c(s[t]);return c}({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&&p())}function p(){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 g(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new g(t,e)),1!==l.length||f||s(p)},g.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=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,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,f,e){(function(n){!function(t){var e=setTimeout;function r(){}function a(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=undefined,this._deferreds=[],l(t,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,a._immediateFn(function(){var t=1===r._state?o.onFulfilled:o.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(n){return void u(o.promise,n)}i(o.promise,e)}else(1===r._state?i:u)(o.promise,r._value)})):r._deferreds.push(o)}function i(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 a)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(i){u(t,i)}var r,o}function u(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&a._immediateFn(function(){t._handled||a._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)o(t,t._deferreds[e]);t._deferreds=null}function c(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t(function(t){n||(n=!0,i(e,t))},function(t){n||(n=!0,u(e,t))})}catch(r){if(n)return;n=!0,u(e,r)}}a.prototype["catch"]=function(t){return this.then(null,t)},a.prototype.then=function(t,e){var n=new this.constructor(r);return o(this,new c(t,e,n)),n},a.all=function(t){var s=Array.prototype.slice.call(t);return new a(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){u(e,t)},i)}s[e]=t,0==--a&&o(s)}catch(r){i(r)}}for(var t=0;t<s.length;t++)u(t,s[t])})},a.resolve=function(e){return e&&"object"==typeof e&&e.constructor===a?e:new a(function(t){t(e)})},a.reject=function(n){return new a(function(t,e){e(n)})},a.race=function(o){return new a(function(t,e){for(var n=0,r=o.length;n<r;n++)o[n].then(t,e)})},a._immediateFn="function"==typeof n?function(t){n(t)}:function(t){e(t,0)},a._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},a._setImmediateFn=function(t){a._immediateFn=t},a._setUnhandledRejectionFn=function(t){a._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=a:t.Promise||(t.Promise=a)}(this)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(s,t,c){(function(t,e){var r=s("process/browser.js").nextTick,n=Function.prototype.apply,o=Array.prototype.slice,i={},a=0;function u(t,e){this._id=t,this._clearFn=e}c.setTimeout=function(){return new u(n.call(setTimeout,window,arguments),clearTimeout)},c.setInterval=function(){return new u(n.call(setInterval,window,arguments),clearInterval)},c.clearTimeout=c.clearInterval=function(t){t.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},c.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},c.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},c._unrefActive=c.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},c.setImmediate="function"==typeof t?t:function(t){var e=a++,n=!(arguments.length<2)&&o.call(arguments,1);return i[e]=!0,r(function(){i[e]&&(n?t.apply(null,n):t.call(null),c.clearImmediate(e))}),e},c.clearImmediate="function"==typeof e?e:function(t){delete i[t]}}).call(this,s("timers").setImmediate,s("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)});var vt=gt.exports.boltExport,ht=function(t){var n=st.none(),e=[],r=function(t){o()?a(t):e.push(t)},o=function(){return n.isSome()},i=function(t){dt(t,a)},a=function(e){n.each(function(t){v.setTimeout(function(){e(t)},0)})};return t(function(t){n=st.some(t),i(e),e=[]}),{get:r,map:function(n){return ht(function(e){r(function(t){e(n(t))})})},isReady:o}},yt={nu:ht,pure:function(e){return ht(function(t){t(e)})}},bt=function(t){v.setTimeout(function(){throw t},0)},wt=function(n){var t=function(t){n().then(t,bt)};return{map:function(t){return wt(function(){return n().then(t)})},bind:function(e){return wt(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return wt(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return yt.nu(t)},toCached:function(){var t=null;return wt(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},xt=function(t){return wt(function(){return new vt(t)})},_t=function(a,t){return t(function(r){var o=[],i=0;0===a.length?r([]):dt(a,function(t,e){var n;t.get((n=e,function(t){o[n]=t,++i>=a.length&&r(o)}))})})},Pt=function(t,e){return n=ft(t,e),_t(n,xt);var n},Tt=function(t,e,n){var r=n||w(e),o=G(t,f(e),r);!1===o.cancelled&&tt(t,o.content)},Dt=function(t,e){e=t.dom.encode(e).replace(/\r\n/g,"\n"),e=C(e,t.settings.forced_root_block,t.settings.forced_root_block_attrs),Tt(t,e,!1)},Ct=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&0<n.length&&-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(i){e[o]=""}}}return e},kt=function(t,e){return e in t&&0<t[e].length},Ft=function(t){return kt(t,"text/html")||kt(t,"text/plain")},Et=O.createIdGenerator("mceclip"),Rt=function(e,t,n){var r,o,i,a,u="paste"===t.type?t.clipboardData:t.dataTransfer;if(e.settings.paste_data_images&&u){var s=(i=(o=u).items?ft(mt(o.items),function(t){return t.getAsFile()}):[],a=o.files?mt(o.files):[],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}(0<i.length?i:a,function(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)}));if(0<s.length)return t.preventDefault(),(r=s,Pt(r,function(r){return xt(function(t){var e=r.getAsFile?r.getAsFile():r,n=new window.FileReader;n.onload=function(){t({blob:e,uri:n.result})},n.readAsDataURL(e)})})).get(function(t){n&&e.selection.setRng(n),dt(t,function(t){!function(t,e){var n,r,o,i,a,u,s,c=(n=e.uri,-1!==(r=n.indexOf(","))?n.substr(r+1):null),l=Et(),f=t.settings.images_reuse_filename&&e.blob.name?(o=t,i=e.blob.name,(a=i.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i))?o.dom.encode(a[1]):null):l,d=new v.Image;if(d.src=e.uri,u=t.settings,s=d,!u.images_dataimg_filter||u.images_dataimg_filter(s)){var m,p=t.editorUpload.blobCache,g=void 0;(m=p.findFirst(function(t){return t.base64()===c}))?g=m:(g=p.create(l,e.blob,c,f),p.add(g)),Tt(t,'<img src="'+g.blobUri()+'">',!1)}else Tt(t,'<img src="'+e.uri+'">',!1)}(e,t)})}),!0}return!1},It=function(t){return o.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},Ot=function(s,c,l){var e,f,d=(e=p(st.none()),{clear:function(){e.set(st.none())},set:function(t){e.set(st.some(t))},isSet:function(){return e.get().isSome()},on:function(t){e.get().each(t)}});function m(t,e,n,r){var o,i;kt(t,"text/html")?o=t["text/html"]:(o=c.getHtml(),r=r||w(o),c.isDefaultContent(o)&&(n=!0)),o=O.trimHtml(o),c.remove(),i=!1===r&&D(o),o.length&&!i||(n=!0),n&&(o=kt(t,"text/plain")&&i?t["text/plain"]:O.innerText(o)),c.isDefaultContent(o)?e||s.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?Dt(s,o):Tt(s,o,r)}s.on("keydown",function(t){function e(t){It(t)&&!t.isDefaultPrevented()&&c.remove()}if(It(t)&&!t.isDefaultPrevented()){if((f=t.shiftKey&&86===t.keyCode)&&h.webkit&&-1!==v.navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),d.set(t),window.setTimeout(function(){d.clear()},100),h.ie&&f)return t.preventDefault(),void n(s,!0);c.remove(),c.create(),s.once("keyup",e),s.once("paste",function(){s.off("keyup",e)})}}),s.on("paste",function(t){var e,n,r,o=d.isSet(),i=(e=s,n=Ct(t.clipboardData||e.getDoc().dataTransfer),O.isMsEdge()?b.extend(n,{"text/html":""}):n),a="text"===l.get()||f,u=kt(i,x());f=!1,t.isDefaultPrevented()||(r=t.clipboardData,-1!==v.navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length)?c.remove():Ft(i)||!Rt(s,t,c.getLastRng()||s.selection.getRng())?(o||t.preventDefault(),!h.ie||o&&!t.ieFake||kt(i,"text/html")||(c.create(),s.dom.bind(c.getEl(),"paste",function(t){t.stopPropagation()}),s.getDoc().execCommand("Paste",!1,null),i["text/html"]=c.getHtml()),kt(i,"text/html")?(t.preventDefault(),u||(u=w(i["text/html"])),m(i,o,a,u)):y.setEditorTimeout(s,function(){m(i,o,a,u)},0)):c.remove()})},St=function(t){return h.ie&&t.inline?v.document.body:t.getBody()},At=function(e,t,n){var r;St(r=e)!==r.getBody()&&e.dom.bind(t,"paste keyup",function(t){Lt(e,n)||e.fire("paste")})},jt=function(t){return t.dom.get("mcepastebin")},Mt=function(t,e){return e===t},Lt=function(t,e){var n,r=jt(t);return(n=r)&&"mcepastebin"===n.id&&Mt(e,r.innerHTML)},Nt=function(a){var u=p(null),s="%MCEPASTEBIN%";return{create:function(){return e=u,n=s,o=(t=a).dom,i=t.getBody(),e.set(t.selection.getRng()),r=t.dom.add(St(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),(h.ie||h.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(i,"direction",!0)?65535:-65535),o.bind(r,"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),At(t,r,n),r.focus(),void t.selection.select(r,!0);var t,e,n,r,o,i},remove:function(){return function(t,e){if(jt(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)}(a,u)},getEl:function(){return jt(a)},getHtml:function(){return function(n){var e,t,r,o,i,a=function(t,e){t.appendChild(e),n.dom.remove(e,!0)};for(t=b.grep(St(n).childNodes,function(t){return"mcepastebin"===t.id}),e=t.shift(),b.each(t,function(t){a(e,t)}),r=(o=n.dom.select("div[id=mcepastebin]",e)).length-1;0<=r;r--)i=n.dom.create("div"),e.insertBefore(i,o[r]),a(i,o[r]);return e?e.innerHTML:""}(a)},getLastRng:function(){return u.get()},isDefault:function(){return Lt(a,s)},isDefaultContent:function(t){return Mt(s,t)}}},Bt=function(n,t){var e=Nt(n);return n.on("preInit",function(){return Ot(a=n,e,t),void a.parser.addNodeFilter("img",function(t,e,n){var r,o=function(t){t.attr("data-mce-object")||u===h.transparentSrc||t.remove()};if(!a.settings.paste_data_images&&(r=n).data&&!0===r.data.paste)for(var i=t.length;i--;)(u=t[i].attributes.map.src)&&(0===u.indexOf("webkit-fake-url")?o(t[i]):a.settings.allow_html_data_urls||0!==u.indexOf("data:")||o(t[i]))});var a,u}),{pasteFormat:t,pasteHtml:function(t,e){return Tt(n,t,e)},pasteText:function(t){return Dt(n,t)},pasteImageData:function(t,e){return Rt(n,t,e)},getDataTransferItems:Ct,hasHtmlOrText:Ft,hasContentType:kt}},Ht=function(){},$t=function(t,e,n){if(r=t,!1!==h.iOS||r===undefined||"function"!=typeof r.setData||!0===O.isMsEdge())return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(x(),e),!0}catch(o){return!1}var r},Wt=function(t,e,n,r){$t(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)},Ut=function(u){return function(t,e){var n=l(t),r=u.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=u.dom.create("div",{contenteditable:"true"},n);u.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),u.dom.add(u.getBody(),r);var i=u.selection.getRng();o.focus();var a=u.dom.createRng();a.selectNodeContents(o),u.selection.setRng(a),setTimeout(function(){u.selection.setRng(i),r.parentNode.removeChild(r),e()},0)}},zt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},Vt=function(t){return!t.selection.isCollapsed()||!!(e=t).dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody());var e},Kt=function(t){var e,n;t.on("cut",(e=t,function(t){Vt(e)&&Wt(t,zt(e),Ut(e),function(){setTimeout(function(){e.execCommand("Delete")},0)})})),t.on("copy",(n=t,function(t){Vt(n)&&Wt(t,zt(n),Ut(n),Ht)}))},qt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Gt=function(t,e){return qt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},Xt=function(t,e){t.focus(),t.selection.setRng(e)},Yt=function(a,u,s){g.shouldBlockDrop(a)&&a.on("dragend dragover draggesture dragdrop drop drag",function(t){t.preventDefault(),t.stopPropagation()}),g.shouldPasteDataImages(a)||a.on("drop",function(t){var e=t.dataTransfer;e&&e.files&&0<e.files.length&&t.preventDefault()}),a.on("drop",function(t){var e,n;if(n=Gt(a,t),!t.isDefaultPrevented()&&!s.get()){e=u.getDataTransferItems(t.dataTransfer);var r,o=u.hasContentType(e,x());if((u.hasHtmlOrText(e)&&(!(r=e["text/plain"])||0!==r.indexOf("file://"))||!u.pasteImageData(t,n))&&n&&g.shouldFilterDrop(a)){var i=e["mce-internal"]||e["text/html"]||e["text/plain"];i&&(t.preventDefault(),y.setEditorTimeout(a,function(){a.undoManager.transact(function(){e["mce-internal"]&&a.execCommand("Delete"),Xt(a,n),i=O.trimHtml(i),e["text/html"]?u.pasteHtml(i,o):u.pasteText(i)})}))}}}),a.on("dragstart",function(t){s.set(!0)}),a.on("dragover dragend",function(t){g.shouldPasteDataImages(a)&&!1===s.get()&&(t.preventDefault(),Xt(a,Gt(a,t))),"dragend"===t.type&&s.set(!1)})},Zt=function(t){var e=t.plugins.paste,n=g.getPreProcess(t);n&&t.on("PastePreProcess",function(t){n.call(e,e,t)});var r=g.getPostProcess(t);r&&t.on("PastePostProcess",function(t){r.call(e,e,t)})};function Jt(e,n){e.on("PastePreProcess",function(t){t.content=n(e,t.content,t.internal,t.wordContent)})}function Qt(t,e){if(!V.isWordContent(e))return e;var n=[];b.each(t.schema.getBlockElements(),function(t,e){n.push(e)});var r=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return e=O.filter(e,[[r,"$1"]]),e=O.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function te(t,e,n,r){if(r||n)return e;var c,o=g.getWebkitStyles(t);if(!1===g.shouldRemoveWebKitStyles(t)||"all"===o)return e;if(o&&(c=o.split(/[, ]/)),c){var l=t.dom,f=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var o=l.parseStyle(l.decode(n)),i={};if("none"===c)return e+r;for(var a=0;a<c.length;a++){var u=o[c[a]],s=l.getStyle(f,c[a],!0);/color/.test(c[a])&&(u=l.toHex(u),s=l.toHex(s)),s!==u&&(i[c[a]]=u)}return(i=l.serializeStyle(i,"span"))?e+' style="'+i+'"'+r:e+r})}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(t,e,n,r){return e+' style="'+n+'"'+r})}function ee(n,t){n.$("a",t).find("font,u").each(function(t,e){n.dom.remove(e,!0)})}var ne=function(t){var e,n;h.webkit&&Jt(t,te),h.ie&&(Jt(t,Qt),n=ee,(e=t).on("PastePostProcess",function(t){n(e,t.node)}))},re=function(t,e,n){var r=n.control;r.active("text"===e.pasteFormat.get()),t.on("PastePlainTextToggle",function(t){r.active(t.state)})},oe=function(t,e){var n=function(r){for(var o=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=o.concat(t);return r.apply(null,n)}}(re,t,e);t.addButton("pastetext",{active:!1,icon:"pastetext",tooltip:"Paste as text",cmd:"mceTogglePlainTextPaste",onPostRender:n}),t.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:e.pasteFormat,cmd:"mceTogglePlainTextPaste",onPostRender:n})};e.add("paste",function(t){if(!1===a(t)){var e=p(!1),n=p(!1),r=p(g.isPasteAsTextEnabled(t)?"text":"html"),o=Bt(t,r),i=ne(t);return oe(t,o),c(t,o,e),Zt(t),Kt(t),Yt(t,o,n),u(o,i)}})}(window);!function(u){"use strict";var e,n,t,r,o,i,s,a,c,f=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),l=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),m=tinymce.util.Tools.resolve("tinymce.util.VK"),p=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),h=function(e){return e&&"BR"===e.nodeName},y=function(e){return e&&3===e.nodeType},N=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},S=function(e){return e&&/^(OL|UL)$/.test(e.nodeName)},C=function(e){return e&&/^(DT|DD)$/.test(e.nodeName)},O=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},b=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},T=h,E=function(e,n){return n&&!!e.schema.getTextBlockElements()[n.nodeName]},L=function(e,n){return e&&e.nodeName in n},D=function(e,n){return!!h(n)&&!(!e.isBlock(n.nextSibling)||h(n.previousSibling))},w=function(e,n,t){var r=e.isEmpty(n);return!(t&&0<e.select("span[data-mce-type=bookmark]",n).length)&&r},k=function(e,n){return e.isChildOf(n,e.getRoot())},A=function(e,n){if(y(e))return{container:e,offset:n};var t=d.getNode(e,n);return y(t)?{container:t,offset:n>=e.childNodes.length?t.data.length:0}:t.previousSibling&&y(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&y(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}},x=function(e){var n=e.cloneRange(),t=A(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=A(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},R=g.DOM,I=function(o){var i={},e=function(e){var n,t,r;t=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"],1===t.nodeType&&(n=R.create("span",{"data-mce-type":"bookmark"}),t.hasChildNodes()?(r=Math.min(r,t.childNodes.length-1),e?t.insertBefore(n,t.childNodes[r]):R.insertAfter(n,t.childNodes[r])):t.appendChild(n),t=n,r=0),i[e?"startContainer":"endContainer"]=t,i[e?"startOffset":"endOffset"]=r};return e(!0),o.collapsed||e(),i},_=function(o){function e(e){var n,t,r;n=r=o[e?"startContainer":"endContainer"],t=o[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(t=function(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n===e)return t;1===n.nodeType&&"bookmark"===n.getAttribute("data-mce-type")||t++,n=n.nextSibling}return-1}(n),n=n.parentNode,R.remove(r),!n.hasChildNodes()&&R.isBlock(n)&&n.appendChild(R.create("br"))),o[e?"startContainer":"endContainer"]=n,o[e?"startOffset":"endOffset"]=t)}e(!0),e();var n=R.createRng();return n.setStart(o.startContainer,o.startOffset),o.endContainer&&n.setEnd(o.endContainer,o.endOffset),x(n)},B=function(){},P=function(e){return function(){return e}},M=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return!t.apply(null,e)}},U=P(!1),F=P(!0),j=function(){return H},H=(e=function(e){return e.isNone()},r={fold:function(e,n){return e()},is:U,isSome:U,isNone:F,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:P(null),getOrUndefined:P(undefined),or:t,orThunk:n,map:j,each:B,bind:j,exists:U,forall:F,filter:j,equals:e,equals_:e,toArray:function(){return[]},toString:P("none()")},Object.freeze&&Object.freeze(r),r),$=function(t){var e=P(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:F,isNone:U,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return $(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:H},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(U,function(e){return n(t,e)})}};return o},q={some:$,none:j,from:function(e){return null===e||e===undefined?H:$(e)}},W=function(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}},V=W("string"),z=W("array"),K=W("boolean"),X=W("function"),Q=W("number"),Y=Array.prototype.slice,G=Array.prototype.push,J=function(e,n){for(var t=e.length,r=new Array(t),o=0;o<t;o++){var i=e[o];r[o]=n(i,o)}return r},Z=function(e,n){for(var t=0,r=e.length;t<r;t++)n(e[t],t)},ee=function(e,n){for(var t=[],r=0,o=e.length;r<o;r++){var i=e[r];n(i,r)&&t.push(i)}return t},ne=function(e,n,t){return Z(e,function(e){t=n(t,e)}),t},te=function(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t))return q.some(o)}return q.none()},re=function(e,n){return function(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!z(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);G.apply(n,e[t])}return n}(J(e,n))},oe=function(e){return 0===e.length?q.none():q.some(e[0])},ie=function(e){return 0===e.length?q.none():q.some(e[e.length-1])},ue=(X(Array.from)&&Array.from,"undefined"!=typeof u.window?u.window:Function("return this;")()),se=function(e,n){return function(e,n){for(var t=n!==undefined&&null!==n?n:ue,r=0;r<e.length&&t!==undefined&&null!==t;++r)t=t[e[r]];return t}(e.split("."),n)},ae=function(e,n){var t=se(e,n);if(t===undefined||null===t)throw new Error(e+" not available on this browser");return t},ce=function(e){var n,t=se("ownerDocument.defaultView",e);return(n=t,ae("HTMLElement",n)).prototype.isPrototypeOf(e)},fe=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),de=function(e){var n=e.selection.getStart(!0);return e.dom.getParent(n,"OL,UL,DL",me(e,n))},le=function(e){var t,n,r,o=e.selection.getSelectedBlocks();return v.grep((t=e,n=o,r=v.map(n,function(e){var n=t.dom.getParent(e,"li,dd,dt",me(t,e));return n||e}),fe.unique(r)),function(e){return O(e)})},me=function(e,n){var t=e.dom.getParents(n,"TD,TH");return 0<t.length?t[0]:e.getBody()},ge=function(e,n){var t=e.dom.getParents(n,"ol,ul",me(e,n));return ie(t)},pe=function(n,e){var t=J(e,function(e){return ge(n,e).getOr(e)});return fe.unique(t)},ve={isList:function(e){var n=de(e);return ce(n)},getParentList:de,getSelectedSubLists:function(e){var n,t,r,o=de(e),i=e.selection.getSelectedBlocks();return r=i,(t=o)&&1===r.length&&r[0]===t?(n=o,v.grep(n.querySelectorAll("ol,ul,dl"),function(e){return N(e)})):v.grep(i,function(e){return N(e)&&o!==e})},getSelectedListItems:le,getClosestListRootElm:me,getSelectedDlItems:function(e){return ee(le(e),C)},getSelectedListRoots:function(e){var n,t,r,o=(t=ge(n=e,n.selection.getStart()),r=ee(n.selection.getSelectedBlocks(),S),t.toArray().concat(r));return pe(e,o)}},he=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:P(e)}},ye={fromHtml:function(e,n){var t=(n||u.document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw u.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return he(t.childNodes[0])},fromTag:function(e,n){var t=(n||u.document).createElement(e);return he(t)},fromText:function(e,n){var t=(n||u.document).createTextNode(e);return he(t)},fromDom:he,fromPoint:function(e,n,t){var r=e.dom();return q.from(r.elementFromPoint(n,t)).map(he)}},Ne=function(e,n,t){return e.isSome()&&n.isSome()?q.some(t(e.getOrDie(),n.getOrDie())):q.none()},Se=Object.keys,Ce=function(){return ae("Node")},Oe=function(e,n,t){return 0!=(e.compareDocumentPosition(n)&t)},be=function(e,n){return Oe(e,n,Ce().DOCUMENT_POSITION_CONTAINED_BY)},Te=function(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};var r=function(e){return Number(n.replace(t,"$"+e))};return Le(r(1),r(2))},Ee=function(){return Le(0,0)},Le=function(e,n){return{major:e,minor:n}},De={nu:Le,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?Ee():Te(e,t)},unknown:Ee},we="Firefox",ke=function(e,n){return function(){return n===e}},Ae=function(e){var n=e.current;return{current:n,version:e.version,isEdge:ke("Edge",n),isChrome:ke("Chrome",n),isIE:ke("IE",n),isOpera:ke("Opera",n),isFirefox:ke(we,n),isSafari:ke("Safari",n)}},xe={unknown:function(){return Ae({current:undefined,version:De.unknown()})},nu:Ae,edge:P("Edge"),chrome:P("Chrome"),ie:P("IE"),opera:P("Opera"),firefox:P(we),safari:P("Safari")},Re="Windows",Ie="Android",_e="Solaris",Be="FreeBSD",Pe=function(e,n){return function(){return n===e}},Me=function(e){var n=e.current;return{current:n,version:e.version,isWindows:Pe(Re,n),isiOS:Pe("iOS",n),isAndroid:Pe(Ie,n),isOSX:Pe("OSX",n),isLinux:Pe("Linux",n),isSolaris:Pe(_e,n),isFreeBSD:Pe(Be,n)}},Ue={unknown:function(){return Me({current:undefined,version:De.unknown()})},nu:Me,windows:P(Re),ios:P("iOS"),android:P(Ie),linux:P("Linux"),osx:P("OSX"),solaris:P(_e),freebsd:P(Be)},Fe=function(e,n){var t=String(n).toLowerCase();return te(e,function(e){return e.search(t)})},je=function(e,t){return Fe(e,t).map(function(e){var n=De.detect(e.versionRegexes,t);return{current:e.name,version:n}})},He=function(e,t){return Fe(e,t).map(function(e){var n=De.detect(e.versionRegexes,t);return{current:e.name,version:n}})},$e=function(e,n){return-1!==e.indexOf(n)},qe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,We=function(n){return function(e){return $e(e,n)}},Ve=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return $e(e,"edge/")&&$e(e,"chrome")&&$e(e,"safari")&&$e(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qe],search:function(e){return $e(e,"chrome")&&!$e(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return $e(e,"msie")||$e(e,"trident")}},{name:"Opera",versionRegexes:[qe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:We("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:We("firefox")},{name:"Safari",versionRegexes:[qe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return($e(e,"safari")||$e(e,"mobile/"))&&$e(e,"applewebkit")}}],ze=[{name:"Windows",search:We("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return $e(e,"iphone")||$e(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:We("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:We("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:We("linux"),versionRegexes:[]},{name:"Solaris",search:We("sunos"),versionRegexes:[]},{name:"FreeBSD",search:We("freebsd"),versionRegexes:[]}],Ke={browsers:P(Ve),oses:P(ze)},Xe=function(e){var n,t,r,o,i,u,s,a,c,f,d,l=Ke.browsers(),m=Ke.oses(),g=je(l,e).fold(xe.unknown,xe.nu),p=He(m,e).fold(Ue.unknown,Ue.nu);return{browser:g,os:p,deviceType:(t=g,r=e,o=(n=p).isiOS()&&!0===/ipad/i.test(r),i=n.isiOS()&&!o,u=n.isAndroid()&&3===n.version.major,s=n.isAndroid()&&4===n.version.major,a=o||u||s&&!0===/mobile/i.test(r),c=n.isiOS()||n.isAndroid(),f=c&&!a,d=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(r),{isiPad:P(o),isiPhone:P(i),isTablet:P(a),isPhone:P(f),isTouch:P(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:P(d)})}},Qe={detect:(o=function(){var e=u.navigator.userAgent;return Xe(e)},s=!1,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return s||(s=!0,i=o.apply(null,e)),i})},Ye=(u.Node.ATTRIBUTE_NODE,u.Node.CDATA_SECTION_NODE,u.Node.COMMENT_NODE,u.Node.DOCUMENT_NODE,u.Node.DOCUMENT_TYPE_NODE,u.Node.DOCUMENT_FRAGMENT_NODE,u.Node.ELEMENT_NODE),Ge=(u.Node.TEXT_NODE,u.Node.PROCESSING_INSTRUCTION_NODE,u.Node.ENTITY_REFERENCE_NODE,u.Node.ENTITY_NODE,u.Node.NOTATION_NODE,Ye),Je=function(e,n){return e.dom()===n.dom()},Ze=Qe.detect().browser.isIE()?function(e,n){return be(e.dom(),n.dom())}:function(e,n){var t=e.dom(),r=n.dom();return t!==r&&t.contains(r)},en=function(e,n){var t=e.dom();if(t.nodeType!==Ge)return!1;var r=t;if(r.matches!==undefined)return r.matches(n);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(n);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(n);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},nn=function(e){return q.from(e.dom().parentNode).map(ye.fromDom)},tn=function(e){return J(e.dom().childNodes,ye.fromDom)},rn=function(e,n){var t=e.dom().childNodes;return q.from(t[n]).map(ye.fromDom)},on=function(e){return rn(e,0)},un=function(e){return rn(e,e.dom().childNodes.length-1)},sn=(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]}("element","offset"),function(n,t){nn(n).each(function(e){e.dom().insertBefore(t.dom(),n.dom())})}),an=function(e,n){e.dom().appendChild(n.dom())},cn=function(n,e){Z(e,function(e){an(n,e)})},fn=function(e){var n=e.dom();null!==n.parentNode&&n.parentNode.removeChild(n)},dn=function(e){return e.dom().nodeName.toLowerCase()},ln=(a=Ye,function(e){return e.dom().nodeType===a}),mn=function(e,n){var t=e.dom();!function(e,n){for(var t=Se(e),r=0,o=t.length;r<o;r++){var i=t[r];n(e[i],i)}}(n,function(e,n){!function(e,n,t){if(!(V(t)||K(t)||Q(t)))throw u.console.error("Invalid call to Attr.set. Key ",n,":: Value ",t,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,t+"")}(t,n,e)})},gn=function(e){return ne(e.dom().attributes,function(e,n){return e[n.name]=n.value,e},{})},pn=function(e,n,t){if(!V(t))throw u.console.error("Invalid call to CSS.set. Property ",n,":: Value ",t,":: Element ",e),new Error("CSS value must be a string: "+t);var r;(r=e).style!==undefined&&X(r.style.getPropertyValue)&&e.style.setProperty(n,t)},vn=function(e){return n=e,t=!0,ye.fromDom(n.dom().cloneNode(t));var n,t},hn=function(e,n){var t,r,o,i,u=(t=e,r=n,o=ye.fromTag(r),i=gn(t),mn(o,i),o);sn(e,u);var s=tn(e);return cn(u,s),fn(e),u},yn=function(e,n){an(e.item,n.list)},Nn=function(f,e,d){var n=e.slice(0,d.depth);return ie(n).each(function(e){var n,t,r,o,i,u,s,a,c=(n=f,t=d.itemAttributes,r=d.content,o=ye.fromTag("li",n),mn(o,t),cn(o,r),o);u=c,an((i=e).list,u),i.item=u,a=d,dn((s=e).list)!==a.listType&&(s.list=hn(s.list,a.listType)),mn(s.list,a.listAttributes)}),n},Sn=function(e,n,t){var r,o=function(e,n,t){for(var r,o,i,u=[],s=0;s<t;s++)u.push((r=e,o=n.listType,i={list:ye.fromTag(o,r),item:ye.fromTag("li",r)},an(i.list,i.item),i));return u}(e,t,t.depth-n.length);return function(e){for(var n=1;n<e.length;n++)yn(e[n-1],e[n])}(o),function(e,n){for(var t=0;t<e.length-1;t++)r=e[t].item,o="list-style-type",i="none",u=r.dom(),pn(u,o,i);var r,o,i,u;ie(e).each(function(e){mn(e.list,n.listAttributes),mn(e.item,n.itemAttributes),cn(e.item,n.content)})}(o,t),r=o,Ne(ie(n),oe(r),yn),n.concat(o)},Cn=function(e){return en(e,"OL,UL")},On=function(e){return on(e).map(Cn).getOr(!1)},bn=function(e){return 0<e.depth},Tn=function(e){return e.isSelected},En=function(e){var n=tn(e),t=un(e).map(Cn).getOr(!1)?n.slice(0,-1):n;return J(t,vn)},Ln=Object.prototype.hasOwnProperty,Dn=(c=function(e,n){return n},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 t={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Ln.call(o,i)&&(t[i]=c(t[i],o[i]))}return t}),wn=function(n){Z(n,function(r,e){(function(e,n){for(var t=e[n].depth,r=n-1;0<=r;r--){if(e[r].depth===t)return q.some(e[r]);if(e[r].depth<t)break}return q.none()})(n,e).each(function(e){var n,t;t=e,(n=r).listType=t.listType,n.listAttributes=Dn({},t.listAttributes)})})},kn=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return kn(t())}}},An=function(i,u,s,a){return on(a).filter(Cn).fold(function(){u.each(function(e){Je(e.start,a)&&s.set(!0)});var n,t,r,e=(n=a,t=i,r=s.get(),nn(n).filter(ln).map(function(e){return{depth:t,isSelected:r,content:En(n),itemAttributes:gn(n),listAttributes:gn(e),listType:dn(e)}}));u.each(function(e){Je(e.end,a)&&s.set(!1)});var o=un(a).filter(Cn).map(function(e){return xn(i,u,s,e)}).getOr([]);return e.toArray().concat(o)},function(e){return xn(i,u,s,e)})},xn=function(n,t,r,e){return re(tn(e),function(e){return(Cn(e)?xn:An)(n+1,t,r,e)})},Rn=tinymce.util.Tools.resolve("tinymce.Env"),In=function(e,n){var t,r,o,i,u=e.dom,s=e.schema.getBlockElements(),a=u.createFragment();if(e.settings.forced_root_block&&(o=e.settings.forced_root_block),o&&((r=u.create(o)).tagName===e.settings.forced_root_block&&u.setAttribs(r,e.settings.forced_root_block_attrs),L(n.firstChild,s)||a.appendChild(r)),n)for(;t=n.firstChild;){var c=t.nodeName;i||"SPAN"===c&&"bookmark"===t.getAttribute("data-mce-type")||(i=!0),L(t,s)?(a.appendChild(t),r=null):o?(r||(r=u.create(o),a.appendChild(r)),r.appendChild(t)):a.appendChild(t)}return e.settings.forced_root_block?i||Rn.ie&&!(10<Rn.ie)||r.appendChild(u.create("br",{"data-mce-bogus":"1"})):a.appendChild(u.create("br")),a},_n=function(i,e){return J(e,function(e){var n,t,r,o=(n=e.content,r=(t||u.document).createDocumentFragment(),Z(n,function(e){r.appendChild(e.dom())}),ye.fromDom(r));return ye.fromDom(In(i,o.dom()))})},Bn=function(e,n){return wn(n),(t=e.contentDocument,r=n,o=ne(r,function(e,n){return n.depth>e.length?Sn(t,e,n):Nn(t,e,n)},[]),oe(o).map(function(e){return e.list})).toArray();var t,r,o},Pn=function(e){var n,t,r=J(ve.getSelectedListItems(e),ye.fromDom);return Ne(te(r,M(On)),te((n=r,(t=Y.call(n,0)).reverse(),t),M(On)),function(e,n){return{start:e,end:n}})},Mn=function(s,e,a){var n,t,r,o=(n=e,t=Pn(s),r=kn(!1),J(n,function(e){return{sourceList:e,entries:xn(0,t,r,e)}}));Z(o,function(e){var n,t,r,o,i,u;n=e.entries,t=a,Z(ee(n,Tn),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(t,e)}),r=e.sourceList,i=s,u=e.entries,o=re(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i<u;i++){var s=e[i],a=n(s);a!==t&&(r.push(o),o=[]),t=a,o.push(s)}return 0!==o.length&&r.push(o),r}(u,bn),function(e){return oe(e).map(bn).getOr(!1)?Bn(i,e):_n(i,e)}),Z(o,function(e){sn(r,e)}),fn(e.sourceList)})},Un=g.DOM,Fn=function(e,n,t){var r,o,i,u,s,a;for(i=Un.select('span[data-mce-type="bookmark"]',n),s=In(e,t),(r=Un.createRng()).setStartAfter(t),r.setEndAfter(n),u=(o=r.extractContents()).firstChild;u;u=u.firstChild)if("LI"===u.nodeName&&e.dom.isEmpty(u)){Un.remove(u);break}e.dom.isEmpty(o)||Un.insertAfter(o,n),Un.insertAfter(s,n),w(e.dom,t.parentNode)&&(a=t.parentNode,v.each(i,function(e){a.parentNode.insertBefore(e,t.parentNode)}),Un.remove(a)),Un.remove(t),w(e.dom,n)&&Un.remove(n)},jn=function(e){en(e,"dt")&&hn(e,"dd")},Hn=function(r,e,n){Z(n,"Indent"===e?jn:function(e){return n=r,void(en(t=e,"dd")?hn(t,"dt"):en(t,"dt")&&nn(t).each(function(e){return Fn(n,e.dom(),t.dom())}));var n,t})},$n=function(e,n){var t=J(ve.getSelectedListRoots(e),ye.fromDom),r=J(ve.getSelectedDlItems(e),ye.fromDom),o=!1;if(t.length||r.length){var i=e.selection.getBookmark();Mn(e,t,n),Hn(e,n,r),e.selection.moveToBookmark(i),e.selection.setRng(x(e.selection.getRng())),e.nodeChanged(),o=!0}return o},qn=function(e){return $n(e,"Indent")},Wn=function(e){return $n(e,"Outdent")},Vn=function(e){return $n(e,"Flatten")},zn=function(t,e){v.each(e,function(e,n){t.setAttribute(n,e)})},Kn=function(e,n,t){var r,o,i,u,s,a,c;r=e,o=n,u=(i=t)["list-style-type"]?i["list-style-type"]:null,r.setStyle(o,"list-style-type",u),s=e,zn(a=n,(c=t)["list-attributes"]),v.each(s.select("li",a),function(e){zn(e,c["list-item-attributes"])})},Xn=function(e,n,t,r){var o,i;for(o=n[t?"startContainer":"endContainer"],i=n[t?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!t&&T(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(E(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Qn=function(f,d,l){void 0===l&&(l={});var e,n=f.selection.getRng(!0),m="LI",t=ve.getClosestListRootElm(f,f.selection.getStart(!0)),g=f.dom;"false"!==g.getContentEditable(f.selection.getNode())&&("DL"===(d=d.toUpperCase())&&(m="DT"),e=I(n),v.each(function(t,e,r){for(var o,i=[],u=t.dom,n=Xn(t,e,!0,r),s=Xn(t,e,!1,r),a=[],c=n;c&&(a.push(c),c!==s);c=c.nextSibling);return v.each(a,function(e){if(E(t,e))return i.push(e),void(o=null);if(u.isBlock(e)||T(e))return T(e)&&u.remove(e),void(o=null);var n=e.nextSibling;p.isBookmarkNode(e)&&(E(t,n)||!n&&e.parentNode===r)?o=null:(o||(o=u.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(f,n,t),function(e){var n,t,r,o,i,u,s,a,c;(t=e.previousSibling)&&N(t)&&t.nodeName===d&&(r=t,o=l,i=g.getStyle(r,"list-style-type"),u=o?o["list-style-type"]:"",i===(u=null===u?"":u))?(n=t,e=g.rename(e,m),t.appendChild(e)):(n=g.create(d),e.parentNode.insertBefore(n,e),n.appendChild(e),e=g.rename(e,m)),s=g,a=e,c=["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],v.each(c,function(e){var n;return s.setStyle(a,((n={})[e]="",n))}),Kn(g,n,l),Gn(f.dom,n)}),f.selection.setRng(_(e)))},Yn=function(e,n,t){return a=t,(s=n)&&a&&N(s)&&s.nodeName===a.nodeName&&(i=n,u=t,(o=e).getStyle(i,"list-style-type",!0)===o.getStyle(u,"list-style-type",!0))&&(r=t,n.className===r.className);var r,o,i,u,s,a},Gn=function(e,n){var t,r;if(t=n.nextSibling,Yn(e,n,t)){for(;r=t.firstChild;)n.appendChild(r);e.remove(t)}if(t=n.previousSibling,Yn(e,n,t)){for(;r=t.lastChild;)n.insertBefore(r,n.firstChild);e.remove(t)}},Jn=function(n,e,t,r,o){if(e.nodeName!==r||Zn(o)){var i=I(n.selection.getRng(!0));v.each([e].concat(t),function(e){!function(e,n,t,r){if(n.nodeName!==t){var o=e.rename(n,t);Kn(e,o,r)}else Kn(e,n,r)}(n.dom,e,r,o)}),n.selection.setRng(_(i))}else Vn(n)},Zn=function(e){return"list-style-type"in e},et={toggleList:function(e,n,t){var r=ve.getParentList(e),o=ve.getSelectedSubLists(e);t=t||{},r&&0<o.length?Jn(e,r,o,n,t):function(e,n,t,r){if(n!==e.getBody())if(n)if(n.nodeName!==t||Zn(r)){var o=I(e.selection.getRng(!0));Kn(e.dom,n,r),Gn(e.dom,e.dom.rename(n,t)),e.selection.setRng(_(o))}else Vn(e);else Qn(e,t,r)}(e,r,n,t)},mergeWithAdjacentLists:Gn},nt=g.DOM,tt=function(e,n){var t,r=n.parentNode;"LI"===r.nodeName&&r.firstChild===n&&((t=r.previousSibling)&&"LI"===t.nodeName?(t.appendChild(n),w(e,r)&&nt.remove(r)):nt.setStyle(r,"listStyleType","none")),N(r)&&(t=r.previousSibling)&&"LI"===t.nodeName&&t.appendChild(n)},rt=function(n,e){v.each(v.grep(n.select("ol,ul",e)),function(e){tt(n,e)})},ot=function(e,n,t,r){var o,i,u=n.startContainer,s=n.startOffset;if(3===u.nodeType&&(t?s<u.data.length:0<s))return u;for(o=e.schema.getNonEmptyElements(),1===u.nodeType&&(u=d.getNode(u,s)),i=new l(u,r),t&&D(e.dom,u)&&i.next();u=i[t?"next":"prev2"]();){if("LI"===u.nodeName&&!u.hasChildNodes())return u;if(o[u.nodeName])return u;if(3===u.nodeType&&0<u.data.length)return u}},it=function(e,n){var t=n.childNodes;return 1===t.length&&!N(t[0])&&e.isBlock(t[0])},ut=function(e,n,t){var r,o,i,u;if(o=it(e,t)?t.firstChild:t,it(i=e,u=n)&&i.remove(u.firstChild,!0),!w(e,n,!0))for(;r=n.firstChild;)o.appendChild(r)},st=function(n,e,t){var r,o,i=e.parentNode;if(k(n,e)&&k(n,t)){N(t.lastChild)&&(o=t.lastChild),i===t.lastChild&&T(i.previousSibling)&&n.remove(i.previousSibling),(r=t.lastChild)&&T(r)&&e.hasChildNodes()&&n.remove(r),w(n,t,!0)&&n.$(t).empty(),ut(n,e,t),o&&t.appendChild(o);var u=Ze(ye.fromDom(t),ye.fromDom(e))?n.getParents(e,N,t):[];n.remove(e),Z(u,function(e){w(n,e)&&e!==n.getRoot()&&n.remove(e)})}},at=function(e,n,t,r){var o,i,u,s=e.dom;if(s.isEmpty(r))i=t,u=r,(o=e).dom.$(u).empty(),st(o.dom,i,u),o.selection.setCursorLocation(u);else{var a=I(n);st(s,t,r),e.selection.setRng(_(a))}},ct=function(e,n){var t,r,o,i=e.dom,u=e.selection,s=u.getStart(),a=ve.getClosestListRootElm(e,s),c=i.getParent(u.getStart(),"LI",a);if(c){if((t=c.parentNode)===e.getBody()&&w(i,t))return!0;if(r=x(u.getRng(!0)),(o=i.getParent(ot(e,r,n,a),"LI",a))&&o!==c)return n?at(e,r,o,c):function(e,n,t,r){var o=I(n);st(e.dom,t,r);var i=_(o);e.selection.setRng(i)}(e,r,c,o),!0;if(!o&&!n)return Vn(e),!0}return!1},ft=function(e,n){return ct(e,n)||function(o,i){var u=o.dom,e=o.selection.getStart(),s=ve.getClosestListRootElm(o,e),a=u.getParent(e,u.isBlock,s);if(a&&u.isEmpty(a)){var n=x(o.selection.getRng(!0)),c=u.getParent(ot(o,n,i,s),"LI",s);if(c)return o.undoManager.transact(function(){var e,n,t,r;n=a,t=s,r=(e=u).getParent(n.parentNode,e.isBlock,t),e.remove(n),r&&e.isEmpty(r)&&e.remove(r),et.mergeWithAdjacentLists(u,c.parentNode),o.selection.select(c,!0),o.selection.collapse(i)}),!0}return!1}(e,n)},dt=function(e,n){return e.selection.isCollapsed()?ft(e,n):(r=(t=e).selection.getStart(),o=ve.getClosestListRootElm(t,r),!!(t.dom.getParent(r,"LI,DT,DD",o)||0<ve.getSelectedListItems(t).length)&&(t.undoManager.transact(function(){t.execCommand("Delete"),rt(t.dom,t.getBody())}),!0));var t,r,o},lt=function(n){n.on("keydown",function(e){e.keyCode===m.BACKSPACE?dt(n,!1)&&e.preventDefault():e.keyCode===m.DELETE&&dt(n,!0)&&e.preventDefault()})},mt=dt,gt=function(n){return{backspaceDelete:function(e){mt(n,e)}}},pt=function(n,t){return function(){var e=n.dom.getParent(n.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===t}},vt=function(t){t.on("BeforeExecCommand",function(e){var n=e.command.toLowerCase();"indent"===n?qn(t):"outdent"===n&&Wn(t)}),t.addCommand("InsertUnorderedList",function(e,n){et.toggleList(t,"UL",n)}),t.addCommand("InsertOrderedList",function(e,n){et.toggleList(t,"OL",n)}),t.addCommand("InsertDefinitionList",function(e,n){et.toggleList(t,"DL",n)}),t.addCommand("RemoveList",function(){Vn(t)}),t.addQueryStateHandler("InsertUnorderedList",pt(t,"UL")),t.addQueryStateHandler("InsertOrderedList",pt(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",pt(t,"DL"))},ht=function(e){return e.getParam("lists_indent_on_tab",!0)},yt=function(e){var n;ht(e)&&(n=e).on("keydown",function(e){e.keyCode!==m.TAB||m.metaKeyPressed(e)||n.undoManager.transact(function(){(e.shiftKey?Wn(n):qn(n))&&e.preventDefault()})}),lt(e)},Nt=function(n,i){return function(e){var o=e.control;n.on("NodeChange",function(e){var n=function(e,n){for(var t=0;t<e.length;t++)if(n(e[t]))return t;return-1}(e.parents,b),t=-1!==n?e.parents.slice(0,n):e.parents,r=v.grep(t,N);o.active(0<r.length&&r[0].nodeName===i)})}},St=function(e){var n,t,r;t="advlist",r=(n=e).settings.plugins?n.settings.plugins:"",-1===v.inArray(r.split(/[ ,]/),t)&&(e.addButton("numlist",{active:!1,title:"Numbered list",cmd:"InsertOrderedList",onPostRender:Nt(e,"OL")}),e.addButton("bullist",{active:!1,title:"Bullet list",cmd:"InsertUnorderedList",onPostRender:Nt(e,"UL")})),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent"})};f.add("lists",function(e){return yt(e),St(e),vt(e),gt(e)})}(window);!function(l){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),e=function(t){return t.target_list},o=function(t){return t.rel_list},i=function(t){return t.link_class_list},p=function(t){return"boolean"==typeof t.link_assume_external_targets&&t.link_assume_external_targets},a=function(t){return"boolean"==typeof t.link_context_toolbar&&t.link_context_toolbar},r=function(t){return t.link_list},k=function(t){return"string"==typeof t.default_link_target},y=function(t){return t.default_link_target},b=e,_=function(t,e){t.settings.target_list=e},w=function(t){return!1!==e(t)},T=o,C=function(t){return o(t)!==undefined},M=i,O=function(t){return i(t)!==undefined},R=function(t){return!1!==t.link_title},N=function(t){return"boolean"==typeof t.allow_unsafe_link_target&&t.allow_unsafe_link_target},u=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.Env"),s=function(t){if(!c.ie||10<c.ie){var e=l.document.createElement("a");e.target="_blank",e.href=t,e.rel="noreferrer noopener";var n=l.document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,l.window,0,0,0,0,0,!1,!1,!1,!1,0,null),r=e,a=n,l.document.body.appendChild(r),r.dispatchEvent(a),l.document.body.removeChild(r)}else{var o=l.window.open("","_blank");if(o){o.opener=null;var i=o.document;i.open(),i.write('<meta http-equiv="refresh" content="0; url='+u.DOM.encode(t)+'">'),i.close()}}var r,a},A=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=function(t,e){var n,o,i=["noopener"],r=t?t.split(/\s+/):[],a=function(t){return t.filter(function(t){return-1===A.inArray(i,t)})};return(r=e?(n=a(n=r)).length?n.concat(i):i:a(r)).length?(o=r,A.trim(o.sort().join(" "))):null},d=function(t,e){return e=e||t.selection.getNode(),v(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},m=function(t){return t&&"A"===t.nodeName&&t.href},v=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},g=function(t,e){var n,o;(o=t.dom.select("img",e)[0])&&(n=t.dom.getParents(o,"a[href]",e)[0])&&(n.parentNode.insertBefore(o,n),t.dom.remove(n))},h=function(t,e,n){var o,i;(i=t.dom.select("img",e)[0])&&(o=t.dom.create("a",n),i.parentNode.insertBefore(o,i),o.appendChild(i))},L=function(i,r){return function(o){i.undoManager.transact(function(){var t=i.selection.getNode(),e=d(i,t),n={href:o.href,target:o.target?o.target:null,rel:o.rel?o.rel:null,"class":o["class"]?o["class"]:null,title:o.title?o.title:null};C(i.settings)||!1!==N(i.settings)||(n.rel=f(n.rel,"_blank"===n.target)),o.href===r.href&&(r.attach(),r={}),e?(i.focus(),o.hasOwnProperty("text")&&("innerText"in e?e.innerText=o.text:e.textContent=o.text),i.dom.setAttribs(e,n),i.selection.select(e),i.undoManager.add()):v(t)?h(i,t,n):o.hasOwnProperty("text")?i.insertContent(i.dom.createHTML("a",n,i.dom.encode(o.text))):i.execCommand("mceInsertLink",!1,n)})}},P=function(e){return function(){e.undoManager.transact(function(){var t=e.selection.getNode();v(t)?g(e,t):e.execCommand("unlink")})}},x=m,E=function(t){return 0<A.grep(t,m).length},S=function(t){return!(/</.test(t)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(t)||-1===t.indexOf("href=")))},I=d,K=function(t,e){var n=e?e.innerText||e.textContent:t.getContent({format:"text"});return n.replace(/\uFEFF/g,"")},U=f,D=tinymce.util.Tools.resolve("tinymce.util.Delay"),B=tinymce.util.Tools.resolve("tinymce.util.XHR"),F={},q=function(t,o,e){var i=function(t,n){return n=n||[],A.each(t,function(t){var e={text:t.text||t.title};t.menu?e.menu=i(t.menu):(e.value=t.value,o&&o(e)),n.push(e)}),n};return i(t,e||[])},V=function(e,t,n){var o=e.selection.getRng();D.setEditorTimeout(e,function(){e.windowManager.confirm(t,function(t){e.selection.setRng(o),n(t)})})},z=function(a,t){var e,l,o,u,n,i,r,c,s,f,d,m={},v=a.selection,g=a.dom,h=function(t){var e=o.find("#text");(!e.value()||t.lastControl&&e.value()===t.lastControl.text())&&e.value(t.control.text()),o.find("#href").value(t.control.value())},x=function(){l||!u||m.text||this.parent().parent().find("#text")[0].value(this.value())};u=S(v.getContent()),e=I(a),m.text=l=K(a.selection,e),m.href=e?g.getAttrib(e,"href"):"",e?m.target=g.getAttrib(e,"target"):k(a.settings)&&(m.target=y(a.settings)),(d=g.getAttrib(e,"rel"))&&(m.rel=d),(d=g.getAttrib(e,"class"))&&(m["class"]=d),(d=g.getAttrib(e,"title"))&&(m.title=d),u&&(n={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){m.text=this.value()}}),t&&(i={type:"listbox",label:"Link list",values:q(t,function(t){t.value=a.convertURL(t.value||t.url,"href")},[{text:"None",value:""}]),onselect:h,value:a.convertURL(m.href,"href"),onPostRender:function(){i=this}}),w(a.settings)&&(b(a.settings)===undefined&&_(a,[{text:"None",value:""},{text:"New window",value:"_blank"}]),c={name:"target",type:"listbox",label:"Target",values:q(b(a.settings))}),C(a.settings)&&(r={name:"rel",type:"listbox",label:"Rel",values:q(T(a.settings),function(t){!1===N(a.settings)&&(t.value=U(t.value,"_blank"===m.target))})}),O(a.settings)&&(s={name:"class",type:"listbox",label:"Class",values:q(M(a.settings),function(t){t.value&&(t.textStyle=function(){return a.formatter.getCssText({inline:"a",classes:[t.value]})})})}),R(a.settings)&&(f={name:"title",type:"textbox",label:"Title",value:m.title}),o=a.windowManager.open({title:"Insert link",data:m,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:function(t){var e=t.meta||{};i&&i.value(a.convertURL(this.value(),"href")),A.each(t.meta,function(t,e){var n=o.find("#"+e);"text"===e?0===l.length&&(n.value(t),m.text=t):n.value(t)}),e.attach&&(F={href:this.value(),attach:e.attach}),e.text||x.call(this)},onkeyup:x,onpaste:x,onbeforecall:function(t){t.meta=o.toJSON()}},n,f,function(n){var o=[];if(A.each(a.dom.select("a:not([href])"),function(t){var e=t.name||t.id;e&&o.push({text:e,value:"#"+e,selected:-1!==n.indexOf("#"+e)})}),o.length)return o.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:o,onselect:h}}(m.href),i,r,c,s],onSubmit:function(t){var e=p(a.settings),n=L(a,F),o=P(a),i=A.extend({},m,t.data),r=i.href;r?(u&&i.text!==l||delete i.text,0<r.indexOf("@")&&-1===r.indexOf("//")&&-1===r.indexOf("mailto:")?V(a,"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(t){t&&(i.href="mailto:"+r),n(i)}):!0===e&&!/^\w+:/i.test(r)||!1===e&&/^\s*www[\.|\d\.]/i.test(r)?V(a,"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(t){t&&(i.href="http://"+r),n(i)}):n(i)):o()}})},H=function(t){var e,n,o;n=z,"string"==typeof(o=r((e=t).settings))?B.send({url:o,success:function(t){n(e,JSON.parse(t))}}):"function"==typeof o?o(function(t){n(e,t)}):n(e,o)},J=function(t,e){return t.dom.getParent(e,"a[href]")},$=function(t){return J(t,t.selection.getStart())},j=function(t,e){if(e){var n=(i=e).getAttribute("data-mce-href")||i.getAttribute("href");if(/^#/.test(n)){var o=t.$(n);o.length&&t.selection.scrollIntoView(o[0],!0)}else s(e.href)}var i},G=function(t){return function(){H(t)}},X=function(t){return function(){j(t,$(t))}},Q=function(r){return function(t){var e,n,o,i;return!!(a(r.settings)&&(!(i=r.plugins.contextmenu)||!i.isContextMenuVisible())&&x(t)&&3===(o=(n=(e=r.selection).getRng()).startContainer).nodeType&&e.isCollapsed()&&0<n.startOffset&&n.startOffset<o.data.length)}},W=function(o){o.on("click",function(t){var e=J(o,t.target);e&&n.metaKeyPressed(t)&&(t.preventDefault(),j(o,e))}),o.on("keydown",function(t){var e,n=$(o);n&&13===t.keyCode&&!0===(e=t).altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey&&(t.preventDefault(),j(o,n))})},Y=function(n){return function(){var e=this;n.on("nodechange",function(t){e.active(!n.readonly&&!!I(n,t.element))})}},Z=function(n){return function(){var e=this,t=function(t){E(t.parents)?e.show():e.hide()};E(n.dom.getParents(n.selection.getStart()))||e.hide(),n.on("nodechange",t),e.on("remove",function(){n.off("nodechange",t)})}},tt=function(t){t.addCommand("mceLink",G(t))},et=function(t){t.addShortcut("Meta+K","",G(t))},nt=function(t){t.addButton("link",{active:!1,icon:"link",tooltip:"Insert/edit link",onclick:G(t),onpostrender:Y(t)}),t.addButton("unlink",{active:!1,icon:"unlink",tooltip:"Remove link",onclick:P(t),onpostrender:Y(t)}),t.addContextToolbar&&t.addButton("openlink",{icon:"newtab",tooltip:"Open link",onclick:X(t)})},ot=function(t){t.addMenuItem("openlink",{text:"Open link",icon:"newtab",onclick:X(t),onPostRender:Z(t),prependToContext:!0}),t.addMenuItem("link",{icon:"link",text:"Link",shortcut:"Meta+K",onclick:G(t),stateSelector:"a[href]",context:"insert",prependToContext:!0}),t.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onclick:P(t),stateSelector:"a[href]"})},it=function(t){t.addContextToolbar&&t.addContextToolbar(Q(t),"openlink | link unlink")};t.add("link",function(t){nt(t),ot(t),it(t),W(t),tt(t),et(t)})}(window);!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},o=function(n){n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})};n.add("hr",function(n){t(n),o(n)})}();!function(m){"use strict";var i=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return i(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return{isFullscreen:function(){return null!==e.get()}}},n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),g=function(e,n){e.fire("FullscreenStateChanged",{state:n})},w=n.DOM,r=function(e,n){var t,r,l,i,o,c,s=m.document.body,u=m.document.documentElement,d=n.get(),a=function(){var e,n,t,i;w.setStyle(l,"height",(t=m.window,i=m.document.body,i.offsetWidth&&(e=i.offsetWidth,n=i.offsetHeight),t.innerWidth&&t.innerHeight&&(e=t.innerWidth,n=t.innerHeight),{w:e,h:n}).h-(r.clientHeight-l.clientHeight))},h=function(){w.unbind(m.window,"resize",a)};if(t=(r=e.getContainer()).style,i=(l=e.getContentAreaContainer().firstChild).style,d)i.width=d.iframeWidth,i.height=d.iframeHeight,d.containerWidth&&(t.width=d.containerWidth),d.containerHeight&&(t.height=d.containerHeight),w.removeClass(s,"mce-fullscreen"),w.removeClass(u,"mce-fullscreen"),w.removeClass(r,"mce-fullscreen"),o=d.scrollPos,m.window.scrollTo(o.x,o.y),w.unbind(m.window,"resize",d.resizeHandler),e.off("remove",d.removeHandler),n.set(null),g(e,!1);else{var f={scrollPos:(c=w.getViewPort(),{x:c.x,y:c.y}),containerWidth:t.width,containerHeight:t.height,iframeWidth:i.width,iframeHeight:i.height,resizeHandler:a,removeHandler:h};i.width=i.height="100%",t.width=t.height="",w.addClass(s,"mce-fullscreen"),w.addClass(u,"mce-fullscreen"),w.addClass(r,"mce-fullscreen"),w.bind(m.window,"resize",a),e.on("remove",h),a(),n.set(f),g(e,!0)}},l=function(e,n){e.addCommand("mceFullScreen",function(){r(e,n)})},o=function(t){return function(e){var n=e.control;t.on("FullscreenStateChanged",function(e){n.active(e.state)})}},c=function(e){e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,cmd:"mceFullScreen",onPostRender:o(e),context:"view"}),e.addButton("fullscreen",{active:!1,tooltip:"Fullscreen",cmd:"mceFullScreen",onPostRender:o(e)})};e.add("fullscreen",function(e){var n=i(null);return e.settings.inline||(l(e,n),c(e),e.addShortcut("Ctrl+Shift+F","","mceFullScreen")),t(n)})}(window);!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=function(t,e){var i,n=t.dom,o=t.selection.getSelectedBlocks();o.length&&(i=n.getAttrib(o[0],"dir"),c.each(o,function(t){n.getParent(t.parentNode,'*[dir="'+e+'"]',n.getRoot())||n.setAttrib(t,"dir",i!==e?e:null)}),t.nodeChanged())},i=function(t){t.addCommand("mceDirectionLTR",function(){e(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){e(t,"rtl")})},n=function(e){var i=[];return c.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(t){i.push(t+"[dir="+e+"]")}),i.join(",")},o=function(t){t.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),t.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})};t.add("directionality",function(t){i(t),o(t)})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(t){return t.getParam("code_dialog_width",600)},i=function(t){return t.getParam("code_dialog_height",Math.min(n.DOM.getViewPort().h-200,500))},c=function(t,n){t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged()},d=function(t){return t.getContent({source_view:!0})},e=function(n){var t=o(n),e=i(n);n.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:t,minHeight:e,spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(t){c(n,t.data.code)}}).find("#code").value(d(n))},u=function(t){t.addCommand("mceCodeEditor",function(){e(t)})},a=function(t){t.addButton("code",{icon:"code",tooltip:"Source code",onclick:function(){e(t)}}),t.addMenuItem("code",{icon:"code",text:"Source code",onclick:function(){e(t)}})};t.add("code",function(t){return u(t),a(t),{}})}();!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){return e.fire("insertCustomChar",{chr:t})},l=function(e,t){var a=i(e,t).chr;e.execCommand("mceInsertContent",!1,a)},a=tinymce.util.Tools.resolve("tinymce.util.Tools"),r=function(e){return e.settings.charmap},n=function(e){return e.settings.charmap_append},o=a.isArray,c=function(e){return o(e)?[].concat((t=e,a.grep(t,function(e){return o(e)&&2===e.length}))):"function"==typeof e?e():[];var t},s=function(e){return function(e,t){var a=r(e);a&&(t=c(a));var i=n(e);return i?[].concat(t).concat(c(i)):t}(e,[["160","no-break space"],["173","soft hyphen"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["256","A - macron"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["274","E - macron"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["298","I - macron"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["332","O - macron"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["362","U - macron"],["221","Y - acute"],["376","Y - diaeresis"],["562","Y - macron"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["257","a - macron"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["275","e - macron"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["299","i - macron"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["333","o macron"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["363","u - macron"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["563","y - macron"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"]])},t=function(t){return{getCharMap:function(){return s(t)},insertChar:function(e){l(t,e)}}},u=function(e){var t,a,i,r=Math.min(e.length,25),n=Math.ceil(e.length/r);for(t='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>',i=0;i<n;i++){for(t+="<tr>",a=0;a<r;a++){var o=i*r+a;if(o<e.length){var l=e[o],c=parseInt(l[0],10),s=l?String.fromCharCode(c):" ";t+='<td title="'+l[1]+'"><div tabindex="-1" title="'+l[1]+'" role="button" data-chr="'+c+'">'+s+"</div></td>"}else t+="<td />"}t+="</tr>"}return t+="</tbody></table>"},d=function(e){for(;e;){if("TD"===e.nodeName)return e;e=e.parentNode}},m=function(n){var o,e={type:"container",html:u(s(n)),onclick:function(e){var t=e.target;if(/^(TD|DIV)$/.test(t.nodeName)){var a=d(t).firstChild;if(a&&a.hasAttribute("data-chr")){var i=a.getAttribute("data-chr"),r=parseInt(i,10);isNaN(r)||l(n,String.fromCharCode(r)),e.ctrlKey||o.close()}}},onmouseover:function(e){var t=d(e.target);t&&t.firstChild?(o.find("#preview").text(t.firstChild.firstChild.data),o.find("#previewTitle").text(t.title)):(o.find("#preview").text(" "),o.find("#previewTitle").text(" "))}};o=n.windowManager.open({title:"Special character",spacing:10,padding:10,items:[e,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"spacer",minHeight:20},{type:"label",name:"previewTitle",text:" ",style:"white-space: pre-wrap;",border:1,minWidth:140}]}],buttons:[{text:"Close",onclick:function(){o.close()}}]})},g=function(e){e.addCommand("mceShowCharmap",function(){m(e)})},p=function(e){e.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"mceShowCharmap"}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"})};e.add("charmap",function(e){return g(e),p(e),t(e)})}();!function(){"use strict";var i=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return i(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),h=function(t){return parseInt(t.getParam("autoresize_min_height",t.getElement().offsetHeight),10)},v=function(t){return parseInt(t.getParam("autoresize_max_height",0),10)},o=function(t){return t.getParam("autoresize_overflow_padding",1)},a=function(t){return t.getParam("autoresize_bottom_margin",50)},n=function(t){return t.getParam("autoresize_on_init",!0)},u=function(t,e,n,i,o){r.setEditorTimeout(t,function(){_(t,e),n--?u(t,e,n,i,o):o&&o()},i)},S=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},_=function(t,e){var n,i,o,r,a,u,s,l,g,c,f,d=t.dom;if(i=t.getDoc())if((m=t).plugins.fullscreen&&m.plugins.fullscreen.isFullscreen())S(t,!0);else{var m;o=i.body,r=h(t),u=d.getStyle(o,"margin-top",!0),s=d.getStyle(o,"margin-bottom",!0),l=d.getStyle(o,"padding-top",!0),g=d.getStyle(o,"padding-bottom",!0),c=d.getStyle(o,"border-top-width",!0),f=d.getStyle(o,"border-bottom-width",!0),a=o.offsetHeight+parseInt(u,10)+parseInt(s,10)+parseInt(l,10)+parseInt(g,10)+parseInt(c,10)+parseInt(f,10),(isNaN(a)||a<=0)&&(a=y.ie?o.scrollHeight:y.webkit&&0===o.clientHeight?0:o.offsetHeight),a>h(t)&&(r=a);var p=v(t);p&&p<a?(r=p,S(t,!0)):S(t,!1),r!==e.get()&&(n=r-e.get(),d.setStyle(t.iframeElement,"height",r+"px"),e.set(r),y.webkit&&n<0&&_(t,e))}},s={setup:function(i,e){i.on("init",function(){var t,e,n=i.dom;t=o(i),e=a(i),!1!==t&&n.setStyles(i.getBody(),{paddingLeft:t,paddingRight:t}),!1!==e&&n.setStyles(i.getBody(),{paddingBottom:e})}),i.on("nodechange setcontent keyup FullscreenStateChanged",function(t){_(i,e)}),n(i)&&i.on("init",function(){u(i,e,20,100,function(){u(i,e,5,1e3)})})},resize:_},l=function(t,e){t.addCommand("mceAutoResize",function(){s.resize(t,e)})};t.add("autoresize",function(t){if(!t.inline){var e=i(0);l(t,e),s.setup(t,e)}})}();!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},e=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.id||e.name:""},i=function(t,e){var n=t.selection.getNode();"A"===n.tagName&&""===t.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=e,t.undoManager.add()):(t.focus(),t.selection.collapse(!0),t.execCommand("mceInsertContent",!1,t.dom.createHTML("a",{id:e})))},n=function(r){var t=e(r);r.windowManager.open({title:"Anchor",body:{type:"textbox",name:"id",size:40,label:"Id",value:t},onsubmit:function(t){var e,n,o=t.data.id;e=r,(a(n=o)?(i(e,n),0):(e.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))&&t.preventDefault()}})},o=function(t){t.addCommand("mceAnchor",function(){n(t)})},r=function(o){return function(t){for(var e=0;e<t.length;e++)(n=t[e]).attr("href")||!n.attr("id")&&!n.attr("name")||n.firstChild||t[e].attr("contenteditable",o);var n}},c=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("a",r("false")),t.serializer.addNodeFilter("a",r(null))})},d=function(t){t.addButton("anchor",{icon:"anchor",tooltip:"Anchor",cmd:"mceAnchor",stateSelector:"a:not([href])"}),t.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",cmd:"mceAnchor"})};t.add("anchor",function(t){c(t),o(t),d(t)})}();!function(_){"use strict";var e,t,n,i,r=tinymce.util.Tools.resolve("tinymce.ThemeManager"),l=tinymce.util.Tools.resolve("tinymce.EditorManager"),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(e){return!1!==c(e)},c=function(e){return e.getParam("menubar")},f=function(e){return e.getParam("toolbar_items_size")},h=function(e){return e.getParam("menu")},m=function(e){return!1===e.settings.skin},g=function(e){var t=e.getParam("resize","vertical");return!1===t?"none":"both"===t?"both":"vertical"},p=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),v=tinymce.util.Tools.resolve("tinymce.ui.Factory"),b=tinymce.util.Tools.resolve("tinymce.util.I18n"),o=function(e){return e.fire("SkinLoaded")},y=function(e){return e.fire("ResizeEditor")},x=function(e){return e.fire("BeforeRenderUI")},s=function(t,n){return function(){var e=t.find(n)[0];e&&e.focus(!0)}},R=function(e,t){e.shortcuts.add("Alt+F9","",s(t,"menubar")),e.shortcuts.add("Alt+F10,F10","",s(t,"toolbar")),e.shortcuts.add("Alt+F11","",s(t,"elementpath")),t.on("cancel",function(){e.focus()})},C=tinymce.util.Tools.resolve("tinymce.geom.Rect"),u=tinymce.util.Tools.resolve("tinymce.util.Delay"),E=function(){},k=function(e){return function(){return e}},a=k(!1),H=k(!0),S=function(){return T},T=(e=function(e){return e.isNone()},i={fold:function(e,t){return e()},is:a,isSome:a,isNone:H,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:k(null),getOrUndefined:k(undefined),or:n,orThunk:t,map:S,each:E,bind:S,exists:a,forall:H,filter:S,equals:e,equals_:e,toArray:function(){return[]},toString:k("none()")},Object.freeze&&Object.freeze(i),i),M=function(n){var e=k(n),t=function(){return r},i=function(e){return e(n)},r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:H,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return M(e(n))},each:function(e){e(n)},bind:i,exists:i,forall:i,filter:function(e){return e(n)?r:T},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(a,function(e){return t(n,e)})}};return r},N={some:M,none:S,from:function(e){return null===e||e===undefined?T:M(e)}},P=function(e){return e?e.getRoot().uiContainer:null},W={getUiContainerDelta:function(e){var t=P(e);if(t&&"static"!==p.DOM.getStyle(t,"position",!0)){var n=p.DOM.getPos(t),i=t.scrollLeft-n.x,r=t.scrollTop-n.y;return N.some({x:i,y:r})}return N.none()},setUiContainer:function(e,t){var n=p.DOM.select(e.settings.ui_container)[0];t.getRoot().uiContainer=n},getUiContainer:P,inheritUiContainer:function(e,t){return t.uiContainer=P(e)}},D=function(i,e,r){var o,s=[];if(e)return w.each(e.split(/[ ,]/),function(t){var e,n=function(){var e=i.selection;t.settings.stateSelector&&e.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&e.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})};"|"===t?o=null:(o||(o={type:"buttongroup",items:[]},s.push(o)),i.buttons[t]&&(e=t,"function"==typeof(t=i.buttons[e])&&(t=t()),t.type=t.type||"button",t.size=r,t=v.create(t),o.items.push(t),i.initialized?n():i.on("init",n)))}),{type:"toolbar",layout:"flow",items:s}},O=D,A=function(n,i){var e,t,r=[];if(w.each(!1===(t=(e=n).getParam("toolbar"))?[]:w.isArray(t)?w.grep(t,function(e){return 0<e.length}):function(e,t){for(var n=[],i=1;i<10;i++){var r=e["toolbar"+i];if(!r)break;n.push(r)}var o=e.toolbar?[e.toolbar]:[t];return 0<n.length?n:o}(e.settings,"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"),function(e){var t;(t=e)&&r.push(D(n,t,i))}),r.length)return{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:r}},B=p.DOM,L=function(e){return{left:e.x,top:e.y,width:e.w,height:e.h,right:e.x+e.w,bottom:e.y+e.h}},z=function(e,t){e.moveTo(t.left,t.top)},I=function(e,t,n,i,r,o){return o=L({x:t,y:n,w:o.w,h:o.h}),e&&(o=e({elementRect:L(i),contentAreaRect:L(r),panelRect:o})),o},F=function(x){var i,o=function(){return x.contextToolbars||[]},n=function(e,t){var n,i,r,o,s,a,l,u=x.getParam("inline_toolbar_position_handler");if(!x.removed){if(!e||!e.toolbar.panel)return c=x,void w.each(c.contextToolbars,function(e){e.panel&&e.panel.hide()});var c,d,f,h,m;l=["bc-tc","tc-bc","tl-bl","bl-tl","tr-br","br-tr"],s=e.toolbar.panel,t&&s.show(),d=e.element,f=B.getPos(x.getContentAreaContainer()),h=x.dom.getRect(d),"BODY"===(m=x.dom.getRoot()).nodeName&&(h.x-=m.ownerDocument.documentElement.scrollLeft||m.scrollLeft,h.y-=m.ownerDocument.documentElement.scrollTop||m.scrollTop),h.x+=f.x,h.y+=f.y,r=h,i=B.getRect(s.getEl()),o=B.getRect(x.getContentAreaContainer()||x.getBody());var g,p,v,b=W.getUiContainerDelta(s).getOr({x:0,y:0});if(r.x+=b.x,r.y+=b.y,i.x+=b.x,i.y+=b.y,o.x+=b.x,o.y+=b.y,"inline"!==B.getStyle(e.element,"display",!0)){var y=e.element.getBoundingClientRect();r.w=y.width,r.h=y.height}x.inline||(o.w=x.getDoc().documentElement.offsetWidth),x.selection.controlSelection.isResizable(e.element)&&r.w<25&&(r=C.inflate(r,0,8)),n=C.findBestRelativePosition(i,r,o,l),r=C.clamp(r,o),n?(a=C.relativePosition(i,r,n),z(s,I(u,a.x,a.y,r,o,i))):(o.h+=i.h,(r=C.intersect(o,r))?(n=C.findBestRelativePosition(i,r,o,["bc-tc","bl-tl","br-tr"]))?(a=C.relativePosition(i,r,n),z(s,I(u,a.x,a.y,r,o,i))):z(s,I(u,r.x,r.y,r,o,i)):s.hide()),g=s,v=function(e,t){return e===t},p=(p=n)?p.substr(0,2):"",w.each({t:"down",b:"up"},function(e,t){g.classes.toggle("arrow-"+e,v(t,p.substr(0,1)))}),w.each({l:"left",r:"right"},function(e,t){g.classes.toggle("arrow-"+e,v(t,p.substr(1,1)))})}},r=function(e){return function(){u.requestAnimationFrame(function(){x.selection&&n(a(x.selection.getNode()),e)})}},t=function(e){var t;if(e.toolbar.panel)return e.toolbar.panel.show(),void n(e);t=v.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:O(x,e.toolbar.items),oncancel:function(){x.focus()}}),W.setUiContainer(x,t),function(e){if(!i){var t=r(!0),n=W.getUiContainer(e);i=x.selection.getScrollContainer()||x.getWin(),B.bind(i,"scroll",t),B.bind(n,"scroll",t),x.on("remove",function(){B.unbind(i,"scroll",t),B.unbind(n,"scroll",t)})}}(t),(e.toolbar.panel=t).renderTo().reflow(),n(e)},s=function(){w.each(o(),function(e){e.panel&&e.panel.hide()})},a=function(e){var t,n,i,r=o();for(t=(i=x.$(e).parents().add(e)).length-1;0<=t;t--)for(n=r.length-1;0<=n;n--)if(r[n].predicate(i[t]))return{toolbar:r[n],element:i[t]};return null};x.on("click keyup setContent ObjectResized",function(e){("setcontent"!==e.type||e.selection)&&u.setEditorTimeout(x,function(){var e;(e=a(x.selection.getNode()))?(s(),t(e)):s()})}),x.on("blur hide contextmenu",s),x.on("ObjectResizeStart",function(){var e=a(x.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.hide()}),x.on("ResizeEditor ResizeWindow",r(!0)),x.on("nodeChange",r(!1)),x.on("remove",function(){w.each(o(),function(e){e.panel&&e.panel.remove()}),x.contextToolbars={}}),x.shortcuts.add("ctrl+F9","",function(){var e=a(x.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.items()[0].focus()})},U=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===t}},V=U("array"),Y=U("function"),$=U("number"),q=(Array.prototype.slice,Array.prototype.indexOf),X=Array.prototype.push,j=function(e,t){var n,i,r=(n=e,i=t,q.call(n,i));return-1===r?N.none():N.some(r)},J=function(e,t){for(var n=0,i=e.length;n<i;n++)if(t(e[n],n))return!0;return!1},G=function(e,t){for(var n=e.length,i=new Array(n),r=0;r<n;r++){var o=e[r];i[r]=t(o,r)}return i},K=function(e,t){for(var n=0,i=e.length;n<i;n++)t(e[n],n)},Z=function(e,t){for(var n=[],i=0,r=e.length;i<r;i++){var o=e[i];t(o,i)&&n.push(o)}return n},Q=(Y(Array.from)&&Array.from,{file:{title:"File",items:"newdocument restoredraft | preview | print"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen"},insert:{title:"Insert",items:"image link media template codesample inserttable | charmap hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | blockformats align | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code"},table:{title:"Table"},help:{title:"Help"}}),ee=function(e,t){return"|"===e?{name:"|",item:{text:"|"}}:t?{name:e,item:t}:null},te=function(e,t){return function(e,t){for(var n=0,i=e.length;n<i;n++)if(t(e[n],n))return N.some(n);return N.none()}(e,function(e){return e.name===t}).isSome()},ne=function(e){return e&&"|"===e.item.text},ie=function(n,e,t,i){var r,o,s,a,l,u,c;return e?(o=e[i],a=!0):o=Q[i],o&&(r={text:o.title},s=[],w.each((o.items||"").split(/[ ,]/),function(e){var t=ee(e,n[e]);t&&s.push(t)}),a||w.each(n,function(e,t){e.context!==i||te(s,t)||("before"===e.separator&&s.push({name:"|",item:{text:"|"}}),e.prependToContext?s.unshift(ee(t,e)):s.push(ee(t,e)),"after"===e.separator&&s.push({name:"|",item:{text:"|"}}))}),r.menu=G((l=t,u=Z(s,function(e){return!1===l.hasOwnProperty(e.name)}),c=Z(u,function(e,t){return!ne(e)||!ne(u[t-1])}),Z(c,function(e,t){return!ne(e)||0<t&&t<c.length-1})),function(e){return e.item}),!r.menu.length)?null:r},re=function(e){for(var t,n=[],i=function(e){var t,n=[],i=h(e);if(i)for(t in i)n.push(t);else for(t in Q)n.push(t);return n}(e),r=w.makeMap((t=e,t.getParam("removed_menuitems","")).split(/[ ,]/)),o=c(e),s="string"==typeof o?o.split(/[ ,]/):i,a=0;a<s.length;a++){var l=s[a],u=ie(e.menuItems,h(e),r,l);u&&n.push(u)}return n},oe=p.DOM,se=function(e){return{width:e.clientWidth,height:e.clientHeight}},ae=function(e,t,n){var i,r,o,s;i=e.getContainer(),r=e.getContentAreaContainer().firstChild,o=se(i),s=se(r),null!==t&&(t=Math.max(e.getParam("min_width",100,"number"),t),t=Math.min(e.getParam("max_width",65535,"number"),t),oe.setStyle(i,"width",t+(o.width-s.width)),oe.setStyle(r,"width",t)),n=Math.max(e.getParam("min_height",100,"number"),n),n=Math.min(e.getParam("max_height",65535,"number"),n),oe.setStyle(r,"height",n),y(e)},le=ae,ue=function(e,t,n){var i=e.getContentAreaContainer();ae(e,i.clientWidth+t,i.clientHeight+n)},ce=tinymce.util.Tools.resolve("tinymce.Env"),de=function(e,t,n){var i,r=e.settings[n];r&&r((i=t.getEl("body"),{element:function(){return i}}))},fe=function(c,d,f){return function(e){var t,n,i,r,o,s=e.control,a=s.parents().filter("panel")[0],l=a.find("#"+d)[0],u=(t=f,n=d,w.grep(t,function(e){return e.name===n})[0]);i=d,r=a,o=f,w.each(o,function(e){var t=r.items().filter("#"+e.name)[0];t&&t.visible()&&e.name!==i&&(de(e,t,"onhide"),t.visible(!1))}),s.parent().items().each(function(e){e.active(!1)}),l&&l.visible()?(de(u,l,"onhide"),l.hide(),s.active(!1)):(l?l.show():(l=v.create({type:"container",name:d,layout:"stack",classes:"sidebar-panel",html:""}),a.prepend(l),de(u,l,"onrender")),de(u,l,"onshow"),s.active(!0)),y(c)}},he=function(e){return!(ce.ie&&!(11<=ce.ie)||!e.sidebars)&&0<e.sidebars.length},me=function(n){return{type:"panel",name:"sidebar",layout:"stack",classes:"sidebar",items:[{type:"toolbar",layout:"stack",classes:"sidebar-toolbar",items:w.map(n.sidebars,function(e){var t=e.settings;return{type:"button",icon:t.icon,image:t.image,tooltip:t.tooltip,onclick:fe(n,e.name,n.sidebars)}})}]}},ge=function(e){var t=function(){e._skinLoaded=!0,o(e)};return function(){e.initialized?t():e.on("init",t)}},pe=p.DOM,ve=function(e){return{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",border:e,html:""}},be=function(t,e,n){var i,r,o,s,a;if(!1===m(t)&&n.skinUiCss?pe.styleSheetLoader.load(n.skinUiCss,ge(t)):ge(t)(),i=e.panel=v.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[{type:"container",classes:"top-part",items:[!1===d(t)?null:{type:"menubar",border:"0 0 1 0",items:re(t)},A(t,f(t))]},he(t)?(s=t,{type:"panel",layout:"stack",classes:"edit-aria-container",border:"1 0 0 0",items:[ve("0"),me(s)]}):ve("1 0 0 0")]}),W.setUiContainer(t,i),"none"!==g(t)&&(r={type:"resizehandle",direction:g(t),onResizeStart:function(){var e=t.getContentAreaContainer().firstChild;o={width:e.clientWidth,height:e.clientHeight}},onResize:function(e){"both"===g(t)?le(t,o.width+e.deltaX,o.height+e.deltaY):le(t,null,o.height+e.deltaY)}}),t.getParam("statusbar",!0,"boolean")){var l=b.translate(["Powered by {0}",'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce" rel="noopener" target="_blank" role="presentation" tabindex="-1">Tiny</a>']),u=t.getParam("branding",!0,"boolean")?{type:"label",classes:"branding",html:" "+l}:null;i.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath",editor:t},r,u]})}return x(t),t.on("SwitchMode",(a=i,function(e){a.find("*").disabled("readonly"===e.mode)})),i.renderBefore(n.targetNode).reflow(),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly"),n.width&&pe.setStyle(i.getEl(),"width",n.width),t.on("remove",function(){i.remove(),i=null}),R(t,i),F(t),{iframeContainer:i.find("#iframe")[0].getEl(),editorContainer:i.getEl()}},ye=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),xe=0,we={id:function(){return"mceu_"+xe++},create:function(e,t,n){var i=_.document.createElement(e);return p.DOM.setAttribs(i,t),"string"==typeof n?i.innerHTML=n:w.each(n,function(e){e.nodeType&&i.appendChild(e)}),i},createFragment:function(e){return p.DOM.createFragment(e)},getWindowSize:function(){return p.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var i=e.getBoundingClientRect();t=Math.max(i.width||i.right-i.left,e.offsetWidth),n=Math.max(i.height||i.bottom-i.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return p.DOM.getPos(e,t||we.getContainer())},getContainer:function(){return ce.container?ce.container:_.document.body},getViewPort:function(e){return p.DOM.getViewPort(e)},get:function(e){return _.document.getElementById(e)},addClass:function(e,t){return p.DOM.addClass(e,t)},removeClass:function(e,t){return p.DOM.removeClass(e,t)},hasClass:function(e,t){return p.DOM.hasClass(e,t)},toggleClass:function(e,t,n){return p.DOM.toggleClass(e,t,n)},css:function(e,t,n){return p.DOM.setStyle(e,t,n)},getRuntimeStyle:function(e,t){return p.DOM.getStyle(e,t,!0)},on:function(e,t,n,i){return p.DOM.bind(e,t,n,i)},off:function(e,t,n){return p.DOM.unbind(e,t,n)},fire:function(e,t,n){return p.DOM.fire(e,t,n)},innerHtml:function(e,t){p.DOM.setHTML(e,t)}},_e=function(e){return"static"===we.getRuntimeStyle(e,"position")},Re=function(e){return e.state.get("fixed")};function Ce(e,t,n){var i,r,o,s,a,l,u,c,d,f;return d=Ee(),o=(r=we.getPos(t,W.getUiContainer(e))).x,s=r.y,Re(e)&&_e(_.document.body)&&(o-=d.x,s-=d.y),i=e.getEl(),a=(f=we.getSize(i)).width,l=f.height,u=(f=we.getSize(t)).width,c=f.height,"b"===(n=(n||"").split(""))[0]&&(s+=c),"r"===n[1]&&(o+=u),"c"===n[0]&&(s+=Math.round(c/2)),"c"===n[1]&&(o+=Math.round(u/2)),"b"===n[3]&&(s-=l),"r"===n[4]&&(o-=a),"c"===n[3]&&(s-=Math.round(l/2)),"c"===n[4]&&(o-=Math.round(a/2)),{x:o,y:s,w:a,h:l}}var Ee=function(){var e=_.window;return{x:Math.max(e.pageXOffset,_.document.body.scrollLeft,_.document.documentElement.scrollLeft),y:Math.max(e.pageYOffset,_.document.body.scrollTop,_.document.documentElement.scrollTop),w:e.innerWidth||_.document.documentElement.clientWidth,h:e.innerHeight||_.document.documentElement.clientHeight}},ke=function(e){var t,n=W.getUiContainer(e);return n&&!Re(e)?{x:0,y:0,w:(t=n).scrollWidth-1,h:t.scrollHeight-1}:Ee()},He={testMoveRel:function(e,t){for(var n=ke(this),i=0;i<t.length;i++){var r=Ce(this,e,t[i]);if(Re(this)){if(0<r.x&&r.x+r.w<n.w&&0<r.y&&r.y+r.h<n.h)return t[i]}else if(r.x>n.x&&r.x+r.w<n.w+n.x&&r.y>n.y&&r.y+r.h<n.h+n.y)return t[i]}return t[0]},moveRel:function(e,t){"string"!=typeof t&&(t=this.testMoveRel(e,t));var n=Ce(this,e,t);return this.moveTo(n.x,n.y)},moveBy:function(e,t){var n=this.layoutRect();return this.moveTo(n.x+e,n.y+t),this},moveTo:function(e,t){var n=this;function i(e,t,n){return e<0?0:t<e+n&&(e=t-n)<0?0:e}if(n.settings.constrainToViewport){var r=ke(this),o=n.layoutRect();e=i(e,r.w+r.x,o.w),t=i(t,r.h+r.y,o.h)}var s=W.getUiContainer(n);return s&&_e(s)&&!Re(n)&&(e-=s.scrollLeft,t-=s.scrollTop),s&&(e+=1,t+=1),n.state.get("rendered")?n.layoutRect({x:e,y:t}).repaint():(n.settings.x=e,n.settings.y=t),n.fire("move",{x:e,y:t}),n}},Se=tinymce.util.Tools.resolve("tinymce.util.Class"),Te=tinymce.util.Tools.resolve("tinymce.util.EventDispatcher"),Me=function(e){var t;if(e)return"number"==typeof e?{top:e=e||0,left:e,bottom:e,right:e}:(1===(t=(e=e.split(" ")).length)?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],10)||0,right:parseInt(e[1],10)||0,bottom:parseInt(e[2],10)||0,left:parseInt(e[3],10)||0})},Ne=function(i,e){function t(e){var t=parseFloat(function(e){var t=i.ownerDocument.defaultView;if(t){var n=t.getComputedStyle(i,null);return n?(e=e.replace(/[A-Z]/g,function(e){return"-"+e}),n.getPropertyValue(e)):null}return i.currentStyle[e]}(e));return isNaN(t)?0:t}return{top:t(e+"TopWidth"),right:t(e+"RightWidth"),bottom:t(e+"BottomWidth"),left:t(e+"LeftWidth")}};function Pe(){}function We(e){this.cls=[],this.cls._map={},this.onchange=e||Pe,this.prefix=""}w.extend(We.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){var t=void 0;for(t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),We.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)0<t&&(e+=" "),e+=this.prefix+this.cls[t];return e};var De,Oe,Ae,Be=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,Le=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,ze=/^\s*|\s*$/g,Ie=Se.extend({init:function(e){var o=this.match;function s(e,t,n){var i;function r(e){e&&t.push(e)}return r(function(t){if(t)return t=t.toLowerCase(),function(e){return"*"===t||e.type===t}}((i=Be.exec(e.replace(ze,"")))[1])),r(function(t){if(t)return function(e){return e._name===t}}(i[2])),r(function(n){if(n)return n=n.split("."),function(e){for(var t=n.length;t--;)if(!e.classes.contains(n[t]))return!1;return!0}}(i[3])),r(function(n,i,r){if(n)return function(e){var t=e[n]?e[n]():"";return i?"="===i?t===r:"*="===i?0<=t.indexOf(r):"~="===i?0<=(" "+t+" ").indexOf(" "+r+" "):"!="===i?t!==r:"^="===i?0===t.indexOf(r):"$="===i&&t.substr(t.length-r.length)===r:!!r}}(i[4],i[5],i[6])),r(function(i){var t;if(i)return(i=/(?:not\((.+)\))|(.+)/i.exec(i))[1]?(t=a(i[1],[]),function(e){return!o(e,t)}):(i=i[2],function(e,t,n){return"first"===i?0===t:"last"===i?t===n-1:"even"===i?t%2==0:"odd"===i?t%2==1:!!e[i]&&e[i]()})}(i[7])),t.pseudo=!!i[7],t.direct=n,t}function a(e,t){var n,i,r,o=[];do{if(Le.exec(""),(i=Le.exec(e))&&(e=i[3],o.push(i[1]),i[2])){n=i[3];break}}while(i);for(n&&a(n,t),e=[],r=0;r<o.length;r++)">"!==o[r]&&e.push(s(o[r],[],">"===o[r-1]));return t.push(e),t}this._selectors=a(e,[])},match:function(e,t){var n,i,r,o,s,a,l,u,c,d,f,h,m;for(n=0,i=(t=t||this._selectors).length;n<i;n++){for(m=e,h=0,r=(o=(s=t[n]).length)-1;0<=r;r--)for(u=s[r];m;){if(u.pseudo)for(c=d=(f=m.parent().items()).length;c--&&f[c]!==m;);for(a=0,l=u.length;a<l;a++)if(!u[a](m,c,d)){a=l+1;break}if(a===l){h++;break}if(r===o-1)break;m=m.parent()}if(h===o)return!0}return!1},find:function(e){var t,n,u=[],i=this._selectors;function c(e,t,n){var i,r,o,s,a,l=t[n];for(i=0,r=e.length;i<r;i++){for(a=e[i],o=0,s=l.length;o<s;o++)if(!l[o](a,i,r)){o=s+1;break}if(o===s)n===t.length-1?u.push(a):a.items&&c(a.items(),t,n+1);else if(l.direct)return;a.items&&c(a.items(),t,n)}}if(e.items){for(t=0,n=i.length;t<n;t++)c(e.items(),i[t],0);1<n&&(u=function(e){for(var t,n=[],i=e.length;i--;)(t=e[i]).__checked||(n.push(t),t.__checked=1);for(i=n.length;i--;)delete n[i].__checked;return n}(u))}return De||(De=Ie.Collection),new De(u)}}),Fe=Array.prototype.push,Ue=Array.prototype.slice;Ae={length:0,init:function(e){e&&this.add(e)},add:function(e){return w.isArray(e)?Fe.apply(this,e):e instanceof Oe?this.add(e.toArray()):Fe.call(this,e),this},set:function(e){var t,n=this,i=n.length;for(n.length=0,n.add(e),t=n.length;t<i;t++)delete n[t];return n},filter:function(t){var e,n,i,r,o=[];for("string"==typeof t?(t=new Ie(t),r=function(e){return t.match(e)}):r=t,e=0,n=this.length;e<n;e++)r(i=this[e])&&o.push(i);return new Oe(o)},slice:function(){return new Oe(Ue.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(e){return w.each(this,e),this},toArray:function(){return w.toArray(this)},indexOf:function(e){for(var t=this.length;t--&&this[t]!==e;);return t},reverse:function(){return new Oe(w.toArray(this).reverse())},hasClass:function(e){return!!this[0]&&this[0].classes.contains(e)},prop:function(t,n){var e;return n!==undefined?(this.each(function(e){e[t]&&e[t](n)}),this):(e=this[0])&&e[t]?e[t]():void 0},exec:function(t){var n=w.toArray(arguments).slice(1);return this.each(function(e){e[t]&&e[t].apply(e,n)}),this},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(t){return this.each(function(e){e.classes.add(t)})},removeClass:function(t){return this.each(function(e){e.classes.remove(t)})}},w.each("fire on off show hide append prepend before after reflow".split(" "),function(n){Ae[n]=function(){var t=w.toArray(arguments);return this.each(function(e){n in e&&e[n].apply(e,t)}),this}}),w.each("text name disabled active selected checked visible parent value data".split(" "),function(t){Ae[t]=function(e){return this.prop(t,e)}}),Oe=Se.extend(Ae);var Ve=Ie.Collection=Oe,Ye=function(e){this.create=e.create};Ye.create=function(r,o){return new Ye({create:function(t,n){var i,e=function(e){t.set(n,e.value)};return t.on("change:"+n,function(e){r.set(o,e.value)}),r.on("change:"+o,e),(i=t._bindings)||(i=t._bindings=[],t.on("destroy",function(){for(var e=i.length;e--;)i[e]()})),i.push(function(){r.off("change:"+o,e)}),r.get(o)}})};var $e=tinymce.util.Tools.resolve("tinymce.util.Observable");function qe(e){return 0<e.nodeType}var Xe,je,Je=Se.extend({Mixins:[$e],init:function(e){var t,n;for(t in e=e||{})(n=e[t])instanceof Ye&&(e[t]=n.create(this,t));this.data=e},set:function(t,n){var i,r,o=this.data[t];if(n instanceof Ye&&(n=n.create(this,t)),"object"==typeof t){for(i in t)this.set(i,t[i]);return this}return function e(t,n){var i,r;if(t===n)return!0;if(null===t||null===n)return t===n;if("object"!=typeof t||"object"!=typeof n)return t===n;if(w.isArray(n)){if(t.length!==n.length)return!1;for(i=t.length;i--;)if(!e(t[i],n[i]))return!1}if(qe(t)||qe(n))return t===n;for(i in r={},n){if(!e(t[i],n[i]))return!1;r[i]=!0}for(i in t)if(!r[i]&&!e(t[i],n[i]))return!1;return!0}(o,n)||(this.data[t]=n,r={target:this,name:t,value:n,oldValue:o},this.fire("change:"+t,r),this.fire("change",r)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(e){return Ye.create(this,e)},destroy:function(){this.fire("destroy")}}),Ge={},Ke={add:function(e){var t=e.parent();if(t){if(!t._layout||t._layout.isNative())return;Ge[t._id]||(Ge[t._id]=t),Xe||(Xe=!0,u.requestAnimationFrame(function(){var e,t;for(e in Xe=!1,Ge)(t=Ge[e]).state.get("rendered")&&t.reflow();Ge={}},_.document.body))}},remove:function(e){Ge[e._id]&&delete Ge[e._id]}},Ze="onmousewheel"in _.document,Qe=!1,et=0,tt={Statics:{classPrefix:"mce-"},isRtl:function(){return je.rtl},classPrefix:"mce-",init:function(t){var e,n,i=this;function r(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}i.settings=t=w.extend({},i.Defaults,t),i._id=t.id||"mceu_"+et++,i._aria={role:t.role},i._elmCache={},i.$=ye,i.state=new Je({visible:!0,active:!1,disabled:!1,value:""}),i.data=new Je(t.data),i.classes=new We(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,(e=t.classes)&&(i.Defaults&&(n=i.Defaults.classes)&&e!==n&&r(n),r(e)),w.each("title text name visible disabled active value".split(" "),function(e){e in t&&i[e](t[e])}),i.on("click",function(){if(i.disabled())return!1}),i.settings=t,i.borderBox=Me(t.border),i.paddingBox=Me(t.padding),i.marginBox=Me(t.margin),t.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){var e=W.getUiContainer(this);return e||we.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e,t,n,i,r,o,s,a,l,u,c=this,d=c.settings,f=c.getEl();e=c.borderBox=c.borderBox||Ne(f,"border"),c.paddingBox=c.paddingBox||Ne(f,"padding"),c.marginBox=c.marginBox||Ne(f,"margin"),u=we.getSize(f),a=d.minWidth,l=d.minHeight,r=a||u.width,o=l||u.height,n=d.width,i=d.height,s=void 0!==(s=d.autoResize)?s:!n&&!i,n=n||r,i=i||o;var h=e.left+e.right,m=e.top+e.bottom,g=d.maxWidth||65535,p=d.maxHeight||65535;return c._layoutRect=t={x:d.x||0,y:d.y||0,w:n,h:i,deltaW:h,deltaH:m,contentW:n-h,contentH:i-m,innerW:n-h,innerH:i-m,startMinWidth:a||0,startMinHeight:l||0,minW:Math.min(r,g),minH:Math.min(o,p),maxW:g,maxH:p,autoResize:s,scrollW:0},c._lastLayoutRect={},t},layoutRect:function(e){var t,n,i,r,o,s=this,a=s._layoutRect;return a||(a=s.initLayoutRect()),e?(i=a.deltaW,r=a.deltaH,e.x!==undefined&&(a.x=e.x),e.y!==undefined&&(a.y=e.y),e.minW!==undefined&&(a.minW=e.minW),e.minH!==undefined&&(a.minH=e.minH),(n=e.w)!==undefined&&(n=(n=n<a.minW?a.minW:n)>a.maxW?a.maxW:n,a.w=n,a.innerW=n-i),(n=e.h)!==undefined&&(n=(n=n<a.minH?a.minH:n)>a.maxH?a.maxH:n,a.h=n,a.innerH=n-r),(n=e.innerW)!==undefined&&(n=(n=n<a.minW-i?a.minW-i:n)>a.maxW-i?a.maxW-i:n,a.innerW=n,a.w=n+i),(n=e.innerH)!==undefined&&(n=(n=n<a.minH-r?a.minH-r:n)>a.maxH-r?a.maxH-r:n,a.innerH=n,a.h=n+r),e.contentW!==undefined&&(a.contentW=e.contentW),e.contentH!==undefined&&(a.contentH=e.contentH),(t=s._lastLayoutRect).x===a.x&&t.y===a.y&&t.w===a.w&&t.h===a.h||((o=je.repaintControls)&&o.map&&!o.map[s._id]&&(o.push(s),o.map[s._id]=!0),t.x=a.x,t.y=a.y,t.w=a.w,t.h=a.h),s):a},repaint:function(){var e,t,n,i,r,o,s,a,l,u,c=this;l=_.document.createRange?function(e){return e}:Math.round,e=c.getEl().style,i=c._layoutRect,a=c._lastRepaintRect||{},o=(r=c.borderBox).left+r.right,s=r.top+r.bottom,i.x!==a.x&&(e.left=l(i.x)+"px",a.x=i.x),i.y!==a.y&&(e.top=l(i.y)+"px",a.y=i.y),i.w!==a.w&&(u=l(i.w-o),e.width=(0<=u?u:0)+"px",a.w=i.w),i.h!==a.h&&(u=l(i.h-s),e.height=(0<=u?u:0)+"px",a.h=i.h),c._hasBody&&i.innerW!==a.innerW&&(u=l(i.innerW),(n=c.getEl("body"))&&((t=n.style).width=(0<=u?u:0)+"px"),a.innerW=i.innerW),c._hasBody&&i.innerH!==a.innerH&&(u=l(i.innerH),(n=n||c.getEl("body"))&&((t=t||n.style).height=(0<=u?u:0)+"px"),a.innerH=i.innerH),c._lastRepaintRect=a,c.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,we.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){var n,i,r,o=this;return nt(o).on(e,"string"!=typeof(n=t)?n:function(e){return i||o.parentsAndSelf().each(function(e){var t=e.settings.callbacks;if(t&&(i=t[n]))return r=e,!1}),i?i.call(r,e):(e.action=n,void this.fire("execute",e))}),o},off:function(e,t){return nt(this).off(e,t),this},fire:function(e,t,n){if((t=t||{}).control||(t.control=this),t=nt(this).fire(e,t),!1!==n&&this.parent)for(var i=this.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return nt(this).has(e)},parents:function(e){var t,n=new Ve;for(t=this.parent();t;t=t.parent())n.add(t);return e&&(n=n.filter(e)),n},parentsAndSelf:function(e){return new Ve(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=ye("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,i=n.getEl(n.ariaTarget);return void 0===t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&i.setAttribute("role"===e?e:"aria-"+e,t),n)},encode:function(e,t){return!1!==t&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return je.translate?je.translate(e):e},before:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this),!0),this},after:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this)),this},remove:function(){var t,e,n=this,i=n.getEl(),r=n.parent();if(n.items){var o=n.items().toArray();for(e=o.length;e--;)o[e].remove()}r&&r.items&&(t=[],r.items().each(function(e){e!==n&&t.push(e)}),r.items().set(t),r._lastRect=null),n._eventsRoot&&n._eventsRoot===n&&ye(i).off();var s=n.getRoot().controlIdLookup;return s&&delete s[n._id],i&&i.parentNode&&i.parentNode.removeChild(i),n.state.set("rendered",!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(e){return ye(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return ye(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e,t,n,i,r,o=this,s=o.settings;for(i in o.$el=ye(o.getEl()),o.state.set("rendered",!0),s)0===i.indexOf("on")&&o.on(i.substr(2),s[i]);if(o._eventsRoot){for(n=o.parent();!r&&n;n=n.parent())r=n._eventsRoot;if(r)for(i in r._nativeEvents)o._nativeEvents[i]=!0}it(o),s.style&&(e=o.getEl())&&(e.setAttribute("style",s.style),e.style.cssText=s.style),o.settings.border&&(t=o.borderBox,o.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left}));var a=o.getRoot();for(var l in a.controlIdLookup||(a.controlIdLookup={}),(a.controlIdLookup[o._id]=o)._aria)o.aria(l,o._aria[l]);!1===o.state.get("visible")&&(o.getEl().style.display="none"),o.bindStates(),o.state.on("change:visible",function(e){var t,n=e.value;o.state.get("rendered")&&(o.getEl().style.display=!1===n?"none":"",o.getEl().getBoundingClientRect()),(t=o.parent())&&(t._lastRect=null),o.fire(n?"show":"hide"),Ke.add(o)}),o.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){var t,n,i,r,o,s,a=this.getEl(),l=a.parentNode,u=function(e,t){var n,i,r=e;for(n=i=0;r&&r!==t&&r.nodeType;)n+=r.offsetLeft||0,i+=r.offsetTop||0,r=r.offsetParent;return{x:n,y:i}}(a,l);return t=u.x,n=u.y,i=a.offsetWidth,r=a.offsetHeight,o=l.clientWidth,s=l.clientHeight,"end"===e?(t-=o-i,n-=s-r):"center"===e&&(t-=o/2-i/2,n-=s/2-r/2),l.scrollLeft=t,l.scrollTop=n,this},getRoot:function(){for(var e,t=this,n=[];t;){if(t.rootControl){e=t.rootControl;break}n.push(t),t=(e=t).parent()}e||(e=this);for(var i=n.length;i--;)n[i].rootControl=e;return e},reflow:function(){Ke.remove(this);var e=this.parent();return e&&e._layout&&!e._layout.isNative()&&e.reflow(),this}};function nt(n){return n._eventDispatcher||(n._eventDispatcher=new Te({scope:n,toggleEvent:function(e,t){t&&Te.isNative(e)&&(n._nativeEvents||(n._nativeEvents={}),n._nativeEvents[e]=!0,n.state.get("rendered")&&it(n))}})),n._eventDispatcher}function it(a){var e,t,n,l,i,r;function o(e){var t=a.getParentCtrl(e.target);t&&t.fire(e.type,e)}function s(){var e=l._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),l._lastHoverCtrl=null)}function u(e){var t,n,i,r=a.getParentCtrl(e.target),o=l._lastHoverCtrl,s=0;if(r!==o){if((n=(l._lastHoverCtrl=r).parents().toArray().reverse()).push(r),o){for((i=o.parents().toArray().reverse()).push(o),s=0;s<i.length&&n[s]===i[s];s++);for(t=i.length-1;s<=t;t--)(o=i[t]).fire("mouseleave",{target:o.getEl()})}for(t=s;t<n.length;t++)(r=n[t]).fire("mouseenter",{target:r.getEl()})}}function c(e){e.preventDefault(),"mousewheel"===e.type?(e.deltaY=-.025*e.wheelDelta,e.wheelDeltaX&&(e.deltaX=-.025*e.wheelDeltaX)):(e.deltaX=0,e.deltaY=e.detail),e=a.fire("wheel",e)}if(i=a._nativeEvents){for((n=a.parents().toArray()).unshift(a),e=0,t=n.length;!l&&e<t;e++)l=n[e]._eventsRoot;for(l||(l=n[n.length-1]||a),a._eventsRoot=l,t=e,e=0;e<t;e++)n[e]._eventsRoot=l;var d=l._delegates;for(r in d||(d=l._delegates={}),i){if(!i)return!1;"wheel"!==r||Qe?("mouseenter"===r||"mouseleave"===r?l._hasMouseEnter||(ye(l.getEl()).on("mouseleave",s).on("mouseover",u),l._hasMouseEnter=1):d[r]||(ye(l.getEl()).on(r,o),d[r]=!0),i[r]=!1):Ze?ye(a.getEl()).on("mousewheel",c):ye(a.getEl()).on("DOMMouseScroll",c)}}}w.each("text title visible disabled active value".split(" "),function(t){tt[t]=function(e){return 0===arguments.length?this.state.get(t):(void 0!==e&&this.state.set(t,e),this)}});var rt=je=Se.extend(tt),ot=function(e){return!!e.getAttribute("data-mce-tabstop")};function st(e){var o,r,n=e.root;function i(e){return e&&1===e.nodeType}try{o=_.document.activeElement}catch(t){o=_.document.body}function s(e){return i(e=e||o)?e.getAttribute("role"):null}function a(e){for(var t,n=e||o;n=n.parentNode;)if(t=s(n))return t}function l(e){var t=o;if(i(t))return t.getAttribute("aria-"+e)}function u(e){var t=e.tagName.toUpperCase();return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}function c(t){var r=[];return function e(t){if(1===t.nodeType&&"none"!==t.style.display&&!t.disabled){var n;(u(n=t)&&!n.hidden||ot(n)||/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(s(n)))&&r.push(t);for(var i=0;i<t.childNodes.length;i++)e(t.childNodes[i])}}(t||n.getEl()),r}function d(e){var t,n;(n=(e=e||r).parents().toArray()).unshift(e);for(var i=0;i<n.length&&!(t=n[i]).settings.ariaRoot;i++);return t}function f(e,t){return e<0?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function h(e,t){var n=-1,i=d();t=t||c(i.getEl());for(var r=0;r<t.length;r++)t[r]===o&&(n=r);n+=e,i.lastAriaIndex=f(n,t)}function m(){"tablist"===a()?h(-1,c(o.parentNode)):r.parent().submenu?b():h(-1)}function g(){var e=s(),t=a();"tablist"===t?h(1,c(o.parentNode)):"menuitem"===e&&"menu"===t&&l("haspopup")?y():h(1)}function p(){h(-1)}function v(){var e=s(),t=a();"menuitem"===e&&"menubar"===t?y():"button"===e&&l("haspopup")?y({key:"down"}):h(1)}function b(){r.fire("cancel")}function y(e){e=e||{},r.fire("click",{target:o,aria:e})}return r=n.getParentCtrl(o),n.on("keydown",function(e){function t(e,t){u(o)||ot(o)||"slider"!==s(o)&&!1!==t(e)&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,m);break;case 39:t(e,g);break;case 38:t(e,p);break;case 40:t(e,v);break;case 27:b();break;case 14:case 13:case 32:t(e,y);break;case 9:!function(e){if("tablist"===a()){var t=c(r.getEl("body"))[0];t&&t.focus()}else h(e.shiftKey?-1:1)}(e),e.preventDefault()}}),n.on("focusin",function(e){o=e.target,r=e.control}),{focusFirst:function(e){var t=d(e),n=c(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?f(t.lastAriaIndex,n):f(0,n)}}}var at={},lt=rt.extend({init:function(e){var t=this;t._super(e),(e=t.settings).fixed&&t.state.set("fixed",!0),t._items=new Ve,t.isRtl()&&t.classes.add("rtl"),t.bodyClasses=new We(function(){t.state.get("rendered")&&(t.getEl("body").className=this.toString())}),t.bodyClasses.prefix=t.classPrefix,t.classes.add("container"),t.bodyClasses.add("container-body"),e.containerCls&&t.classes.add(e.containerCls),t._layout=v.create((e.layout||"")+"layout"),t.settings.items?t.add(t.settings.items):t.add(t.render()),t._hasBody=!0},items:function(){return this._items},find:function(e){return(e=at[e]=at[e]||new Ie(e)).find(this)},add:function(e){return this.items().add(this.create(e)).parent(this),this},focus:function(e){var t,n,i,r=this;if(!e||!(n=r.keyboardNav||r.parents().eq(-1)[0].keyboardNav))return i=r.find("*"),r.statusbar&&i.add(r.statusbar.items()),i.each(function(e){if(e.settings.autofocus)return t=null,!1;e.canFocus&&(t=t||e)}),t&&t.focus(),r;n.focusFirst(r)},replace:function(e,t){for(var n,i=this.items(),r=i.length;r--;)if(i[r]===e){i[r]=t;break}0<=r&&((n=t.getEl())&&n.parentNode.removeChild(n),(n=e.getEl())&&n.parentNode.removeChild(n)),t.parent(this)},create:function(e){var t,n=this,i=[];return w.isArray(e)||(e=[e]),w.each(e,function(e){e&&(e instanceof rt||("string"==typeof e&&(e={type:e}),t=w.extend({},n.settings.defaults,e),e.type=t.type=t.type||e.type||n.settings.defaultType||(t.defaults?t.defaults.type:null),e=v.create(t)),i.push(e))}),i},renderNew:function(){var i=this;return i.items().each(function(e,t){var n;e.parent(i),e.state.get("rendered")||((n=i.getEl("body")).hasChildNodes()&&t<=n.childNodes.length-1?ye(n.childNodes[t]).before(e.renderHtml()):ye(n).append(e.renderHtml()),e.postRender(),Ke.add(e))}),i._layout.applyClasses(i.items().filter(":visible")),i._lastRect=null,i},append:function(e){return this.add(e).renderNew()},prepend:function(e){return this.items().set(this.create(e).concat(this.items().toArray())),this.renderNew()},insert:function(e,t,n){var i,r,o;return e=this.create(e),i=this.items(),!n&&t<i.length-1&&(t+=1),0<=t&&t<i.length&&(r=i.slice(0,t).toArray(),o=i.slice(t).toArray(),i.set(r.concat(e,o))),this.renderNew()},fromJSON:function(e){for(var t in e)this.find("#"+t).value(e[t]);return this},toJSON:function(){var i={};return this.find("*").each(function(e){var t=e.name(),n=e.value();t&&void 0!==n&&(i[t]=n)}),i},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e,t=this;return t.items().exec("postRender"),t._super(),t._layout.postRender(t),t.state.set("rendered",!0),t.settings.style&&t.$el.css(t.settings.style),t.settings.border&&(e=t.borderBox,t.$el.css({"border-top-width":e.top,"border-right-width":e.right,"border-bottom-width":e.bottom,"border-left-width":e.left})),t.parent()||(t.keyboardNav=st({root:t})),t},initLayoutRect:function(){var e=this._super();return this._layout.recalc(this),e},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;if(!n||n.w!==t.w||n.h!==t.h)return e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0},reflow:function(){var e;if(Ke.remove(this),this.visible()){for(rt.repaintControls=[],rt.repaintControls.map={},this.recalc(),e=rt.repaintControls.length;e--;)rt.repaintControls[e].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),rt.repaintControls=[]}return this}});function ut(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}function ct(e,h){var m,g,t,p,v,b,y,x=h.document||_.document;h=h||{};var w=x.getElementById(h.handle||e);t=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=(t=x,u=Math.max,n=t.documentElement,i=t.body,r=u(n.scrollWidth,i.scrollWidth),o=u(n.clientWidth,i.clientWidth),s=u(n.offsetWidth,i.offsetWidth),a=u(n.scrollHeight,i.scrollHeight),l=u(n.clientHeight,i.clientHeight),{width:r<s?o:r,height:a<u(n.offsetHeight,i.offsetHeight)?l:a});ut(e),e.preventDefault(),g=e.button,c=w,b=e.screenX,y=e.screenY,d=_.window.getComputedStyle?_.window.getComputedStyle(c,null).getPropertyValue("cursor"):c.runtimeStyle.cursor,m=ye("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:d}).appendTo(x.body),ye(x).on("mousemove touchmove",v).on("mouseup touchend",p),h.start(e)},v=function(e){if(ut(e),e.button!==g)return p(e);e.deltaX=e.screenX-b,e.deltaY=e.screenY-y,e.preventDefault(),h.drag(e)},p=function(e){ut(e),ye(x).off("mousemove touchmove",v).off("mouseup touchend",p),m.remove(),h.stop&&h.stop(e)},this.destroy=function(){ye(w).off()},ye(w).on("mousedown touchstart",t)}var dt,ft,ht,mt,gt={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var p=this,v=2;function n(){var m,g,e;function t(e,t,n,i,r,o){var s,a,l,u,c,d,f,h;if(a=p.getEl("scroll"+e)){if(f=t.toLowerCase(),h=n.toLowerCase(),ye(p.getEl("absend")).css(f,p.layoutRect()[i]-1),!r)return void ye(a).css("display","none");ye(a).css("display","block"),s=p.getEl("body"),l=p.getEl("scroll"+e+"t"),u=s["client"+n]-2*v,c=(u-=m&&g?a["client"+o]:0)/s["scroll"+n],(d={})[f]=s["offset"+t]+v,d[h]=u,ye(a).css(d),(d={})[f]=s["scroll"+t]*c,d[h]=u*c,ye(l).css(d)}}e=p.getEl("body"),m=e.scrollWidth>e.clientWidth,g=e.scrollHeight>e.clientHeight,t("h","Left","Width","contentW",m,"Height"),t("v","Top","Height","contentH",g,"Width")}p.settings.autoScroll&&(p._hasScroll||(p._hasScroll=!0,function(){function e(s,a,l,u,c){var d,e=p._id+"-scroll"+s,t=p.classPrefix;ye(p.getEl()).append('<div id="'+e+'" class="'+t+"scrollbar "+t+"scrollbar-"+s+'"><div id="'+e+'t" class="'+t+'scrollbar-thumb"></div></div>'),p.draghelper=new ct(e+"t",{start:function(){d=p.getEl("body")["scroll"+a],ye("#"+e).addClass(t+"active")},drag:function(e){var t,n,i,r,o=p.layoutRect();n=o.contentW>o.innerW,i=o.contentH>o.innerH,r=p.getEl("body")["client"+l]-2*v,t=(r-=n&&i?p.getEl("scroll"+s)["client"+c]:0)/p.getEl("body")["scroll"+l],p.getEl("body")["scroll"+a]=d+e["delta"+u]/t},stop:function(){ye("#"+e).removeClass(t+"active")}})}p.classes.add("scroll"),e("v","Top","Height","Y","Width"),e("h","Left","Width","X","Height")}(),p.on("wheel",function(e){var t=p.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),ye(p.getEl("body")).on("scroll",n)),n())}},pt=lt.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[gt],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),void 0===n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}}),vt={resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(e,t){if(e<=1||t<=1){var n=we.getWindowSize();e=e<=1?e*n.w:e,t=t<=1?t*n.h:t}return this._layoutRect.autoResize=!1,this.layoutRect({minW:e,minH:t,w:e,h:t}).reflow()},resizeBy:function(e,t){var n=this.layoutRect();return this.resizeTo(n.w+e,n.h+t)}},bt=[],yt=[];function xt(e,t){for(;e;){if(e===t)return!0;e=e.parent()}}function wt(){dt||(dt=function(e){2!==e.button&&function(e){for(var t=bt.length;t--;){var n=bt[t],i=n.getParentCtrl(e.target);if(n.settings.autohide){if(i&&(xt(i,n)||n.parent()===i))continue;(e=n.fire("autohide",{target:e.target})).isDefaultPrevented()||n.hide()}}}(e)},ye(_.document).on("click touchstart",dt))}function _t(r){var e=we.getViewPort().y;function t(e,t){for(var n,i=0;i<bt.length;i++)if(bt[i]!==r)for(n=bt[i].parent();n&&(n=n.parent());)n===r&&bt[i].fixed(e).moveBy(0,t).repaint()}r.settings.autofix&&(r.state.get("fixed")?r._autoFixY>e&&(r.fixed(!1).layoutRect({y:r._autoFixY}).repaint(),t(!1,r._autoFixY-e)):(r._autoFixY=r.layoutRect().y,r._autoFixY<e&&(r.fixed(!0).layoutRect({y:0}).repaint(),t(!0,e-r._autoFixY))))}function Rt(e,t){var n,i,r=Ct.zIndex||65535;if(e)yt.push(t);else for(n=yt.length;n--;)yt[n]===t&&yt.splice(n,1);if(yt.length)for(n=0;n<yt.length;n++)yt[n].modal&&(r++,i=yt[n]),yt[n].getEl().style.zIndex=r,yt[n].zIndex=r,r++;var o=ye("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];i?ye(o).css("z-index",i.zIndex-1):o&&(o.parentNode.removeChild(o),mt=!1),Ct.currentZIndex=r}var Ct=pt.extend({Mixins:[He,vt],init:function(e){var i=this;i._super(e),(i._eventsRoot=i).classes.add("floatpanel"),e.autohide&&(wt(),function(){if(!ht){var e=_.document.documentElement,t=e.clientWidth,n=e.clientHeight;ht=function(){_.document.all&&t===e.clientWidth&&n===e.clientHeight||(t=e.clientWidth,n=e.clientHeight,Ct.hideAll())},ye(_.window).on("resize",ht)}}(),bt.push(i)),e.autofix&&(ft||(ft=function(){var e;for(e=bt.length;e--;)_t(bt[e])},ye(_.window).on("scroll",ft)),i.on("move",function(){_t(this)})),i.on("postrender show",function(e){if(e.control===i){var t,n=i.classPrefix;i.modal&&!mt&&((t=ye("#"+n+"modal-block",i.getContainerElm()))[0]||(t=ye('<div id="'+n+'modal-block" class="'+n+"reset "+n+'fade"></div>').appendTo(i.getContainerElm())),u.setTimeout(function(){t.addClass(n+"in"),ye(i.getEl()).addClass(n+"in")}),mt=!0),Rt(!0,i)}}),i.on("show",function(){i.parents().each(function(e){if(e.state.get("fixed"))return i.fixed(!0),!1})}),e.popover&&(i._preBodyHtml='<div class="'+i.classPrefix+'arrow"></div>',i.classes.add("popover").add("bottom").add(i.isRtl()?"end":"start")),i.aria("label",e.ariaLabel),i.aria("labelledby",i._id),i.aria("describedby",i.describedBy||i._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!==e){if(t.state.get("rendered")){var n=we.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e,t=this._super();for(e=bt.length;e--&&bt[e]!==this;);return-1===e&&bt.push(this),t},hide:function(){return Et(this),Rt(!1,this),this._super()},hideAll:function(){Ct.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),Rt(!1,this)),this},remove:function(){Et(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function Et(e){var t;for(t=bt.length;t--;)bt[t]===e&&bt.splice(t,1);for(t=yt.length;t--;)yt[t]===e&&yt.splice(t,1)}Ct.hideAll=function(){for(var e=bt.length;e--;){var t=bt[e];t&&t.settings.autohide&&(t.hide(),bt.splice(e,1))}};var kt=function(s,n,e){var a,i,l=p.DOM,t=s.getParam("fixed_toolbar_container");t&&(i=l.select(t)[0]);var r=function(){if(a&&a.moveRel&&a.visible()&&!a._fixed){var e=s.selection.getScrollContainer(),t=s.getBody(),n=0,i=0;if(e){var r=l.getPos(t),o=l.getPos(e);n=Math.max(0,o.x-r.x),i=Math.max(0,o.y-r.y)}a.fixed(!1).moveRel(t,s.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(n,i)}},o=function(){a&&(a.show(),r(),l.addClass(s.getBody(),"mce-edit-focus"))},u=function(){a&&(a.hide(),Ct.hideAll(),l.removeClass(s.getBody(),"mce-edit-focus"))},c=function(){var e,t;a?a.visible()||o():(a=n.panel=v.create({type:i?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:(e=i,t=s,!(!e||t.settings.ui_container)),border:1,items:[!1===d(s)?null:{type:"menubar",border:"0 0 1 0",items:re(s)},A(s,f(s))]}),W.setUiContainer(s,a),x(s),i?a.renderTo(i).reflow():a.renderTo().reflow(),R(s,a),o(),F(s),s.on("nodeChange",r),s.on("ResizeWindow",r),s.on("activate",o),s.on("deactivate",u),s.nodeChanged())};return s.settings.content_editable=!0,s.on("focus",function(){!1===m(s)&&e.skinUiCss?l.styleSheetLoader.load(e.skinUiCss,c,c):c()}),s.on("blur hide",u),s.on("remove",function(){a&&(a.remove(),a=null)}),!1===m(s)&&e.skinUiCss?l.styleSheetLoader.load(e.skinUiCss,ge(s)):ge(s)(),{}};function Ht(i,r){var o,s,a=this,l=rt.classPrefix;a.show=function(e,t){function n(){o&&(ye(i).append('<div class="'+l+"throbber"+(r?" "+l+"throbber-inline":"")+'"></div>'),t&&t())}return a.hide(),o=!0,e?s=u.setTimeout(n,e):n(),a},a.hide=function(){var e=i.lastChild;return u.clearTimeout(s),e&&-1!==e.className.indexOf("throbber")&&e.parentNode.removeChild(e),o=!1,a}}var St=function(e,t){var n;e.on("ProgressState",function(e){n=n||new Ht(t.panel.getEl("body")),e.state?n.show(e.time):n.hide()})},Tt=function(e,t,n){var i=function(e){var t=e.settings,n=t.skin,i=t.skin_url;if(!1!==n){var r=n||"lightgray";i=i?e.documentBaseURI.toAbsolute(i):l.baseURL+"/skins/"+r}return i}(e);return i&&(n.skinUiCss=i+"/skin.min.css",e.contentCSS.push(i+"/content"+(e.inline?".inline":"")+".min.css")),St(e,t),e.getParam("inline",!1,"boolean")?kt(e,t,n):be(e,t,n)},Mt=rt.extend({Mixins:[He],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().lastChild.innerHTML=t.encode(e.value)}),t._super()},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=131070}}),Nt=rt.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.canFocus=!0,i.tooltip&&!1!==Nt.tooltips&&(r.on("mouseenter",function(e){var t=r.tooltip().moveTo(-65535);if(e.control===r){var n=t.text(i.tooltip).show().testMoveRel(r.getEl(),["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===n),t.classes.toggle("tooltip-nw","bc-tl"===n),t.classes.toggle("tooltip-ne","bc-tr"===n),t.moveRel(r.getEl(),n)}else t.hide()}),r.on("mouseleave mousedown click",function(){r.tooltip().remove(),r._tooltip=null})),r.aria("label",i.ariaLabel||i.tooltip)},tooltip:function(){return this._tooltip||(this._tooltip=new Mt({type:"tooltip"}),W.inheritUiContainer(this,this._tooltip),this._tooltip.renderTo()),this._tooltip},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){var t=this;function n(e){t.aria("disabled",e),t.classes.toggle("disabled",e)}function i(e){t.aria("pressed",e),t.classes.toggle("active",e)}return t.state.on("change:disabled",function(e){n(e.value)}),t.state.on("change:active",function(e){i(e.value)}),t.state.get("disabled")&&n(!0),t.state.get("active")&&i(!0),t._super()},remove:function(){this._super(),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}}),Pt=Nt.extend({Defaults:{value:0},init:function(e){this._super(e),this.classes.add("progress"),this.settings.filter||(this.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div class="'+t+'bar-container"><div class="'+t+'bar"></div></div><div class="'+t+'text">0%</div></div>'},postRender:function(){return this._super(),this.value(this.settings.value),this},bindStates:function(){var t=this;function n(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}return t.state.on("change:value",function(e){n(e.value)}),n(t.state.get("value")),t._super()}}),Wt=function(e,t){e.getEl().lastChild.textContent=t+(e.progressBar?" "+e.progressBar.value()+"%":"")},Dt=rt.extend({Mixins:[He],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),t.maxWidth=e.maxWidth,e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||0<e.timeout)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new Pt),t.on("click",function(e){-1!==e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e,t=this,n=t.classPrefix,i="",r="",o="";return t.icon&&(i='<i class="'+n+"ico "+n+"i-"+t.icon+'"></i>'),e=' style="max-width: '+t.maxWidth+"px;"+(t.color?"background-color: "+t.color+';"':'"'),t.closeButton&&(r='<button type="button" class="'+n+'close" aria-hidden="true">\xd7</button>'),t.progressBar&&(o=t.progressBar.renderHtml()),'<div id="'+t._id+'" class="'+t.classes+'"'+e+' role="presentation">'+i+'<div class="'+n+'notification-inner">'+t.state.get("text")+"</div>"+o+r+'<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;" aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div></div>'},postRender:function(){var e=this;return u.setTimeout(function(){e.$el.addClass(e.classPrefix+"in"),Wt(e,e.state.get("text"))},100),e._super()},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().firstChild.innerHTML=e.value,Wt(t,e.value)}),t.progressBar&&(t.progressBar.bindStates(),t.progressBar.state.on("change:value",function(e){Wt(t,t.state.get("text"))})),t._super()},close:function(){return this.fire("close").isDefaultPrevented()||this.remove(),this},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=65534}});function Ot(o){var s=function(e){return e.inline?e.getElement():e.getContentAreaContainer()};return{open:function(e,t){var n,i=w.extend(e,{maxWidth:(n=s(o),we.getSize(n).width)}),r=new Dt(i);return 0<(r.args=i).timeout&&(r.timer=setTimeout(function(){r.close(),t()},i.timeout)),r.on("close",function(){t()}),r.renderTo(),r},close:function(e){e.close()},reposition:function(e){K(e,function(e){e.moveTo(0,0)}),function(n){if(0<n.length){var e=n.slice(0,1)[0],t=s(o);e.moveRel(t,"tc-tc"),K(n,function(e,t){0<t&&e.moveRel(n[t-1].getEl(),"bc-tc")})}}(e)},getArgs:function(e){return e.args}}}var At=[],Bt="";function Lt(e){var t,n=ye("meta[name=viewport]")[0];!1!==ce.overrideViewPort&&(n||((n=_.document.createElement("meta")).setAttribute("name","viewport"),_.document.getElementsByTagName("head")[0].appendChild(n)),(t=n.getAttribute("content"))&&void 0!==Bt&&(Bt=t),n.setAttribute("content",e?"width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0":Bt))}function zt(e,t){(function(){for(var e=0;e<At.length;e++)if(At[e]._fullscreen)return!0;return!1})()&&!1===t&&ye([_.document.documentElement,_.document.body]).removeClass(e+"fullscreen")}var It=Ct.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.classes.add("rtl"),n.classes.add("window"),n.bodyClasses.add("window-body"),n.state.set("fixed",!0),e.buttons&&(n.statusbar=new pt({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.classes.add("foot"),n.statusbar.parent(n)),n.on("click",function(e){var t=n.classPrefix+"close";(we.hasClass(e.target,t)||we.hasClass(e.target.parentNode,t))&&n.close()}),n.on("cancel",function(){n.close()}),n.on("move",function(e){e.control===n&&Ct.hideAll()}),n.aria("describedby",n.describedBy||n._id+"-none"),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e,t,n,i,r=this,o=r.statusbar;r._fullscreen&&(r.layoutRect(we.getWindowSize()),r.layoutRect().contentH=r.layoutRect().innerH),r._super(),e=r.layoutRect(),r.settings.title&&!r._fullscreen&&(t=e.headerW)>e.w&&(n=e.x-Math.max(0,t/2),r.layoutRect({w:t,x:n}),i=!0),o&&(o.layoutRect({w:r.layoutRect().innerW}).recalc(),(t=o.layoutRect().minW+e.deltaW)>e.w&&(n=e.x-Math.max(0,t-e.w),r.layoutRect({w:t,x:n}),i=!0)),i&&r.recalc()},initLayoutRect:function(){var e,t=this,n=t._super(),i=0;if(t.settings.title&&!t._fullscreen){e=t.getEl("head");var r=we.getSize(e);n.headerW=r.width,n.headerH=r.height,i+=n.headerH}t.statusbar&&(i+=t.statusbar.layoutRect().h),n.deltaH+=i,n.minH+=i,n.h+=i;var o=we.getWindowSize();return n.x=t.settings.x||Math.max(0,o.w/2-n.w/2),n.y=t.settings.y||Math.max(0,o.h/2-n.h/2),n},renderHtml:function(){var e=this,t=e._layout,n=e._id,i=e.classPrefix,r=e.settings,o="",s="",a=r.html;return e.preRender(),t.preRender(e),r.title&&(o='<div id="'+n+'-head" class="'+i+'window-head"><div id="'+n+'-title" class="'+i+'title">'+e.encode(r.title)+'</div><div id="'+n+'-dragh" class="'+i+'dragh"></div><button type="button" class="'+i+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),r.url&&(a='<iframe src="'+r.url+'" tabindex="-1"></iframe>'),void 0===a&&(a=t.renderHtml(e)),e.statusbar&&(s=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+a+"</div>"+s+"</div></div>"},fullscreen:function(e){var n,t,i=this,r=_.document.documentElement,o=i.classPrefix;if(e!==i._fullscreen)if(ye(_.window).on("resize",function(){var e;if(i._fullscreen)if(n)i._timer||(i._timer=u.setTimeout(function(){var e=we.getWindowSize();i.moveTo(0,0).resizeTo(e.w,e.h),i._timer=0},50));else{e=(new Date).getTime();var t=we.getWindowSize();i.moveTo(0,0).resizeTo(t.w,t.h),50<(new Date).getTime()-e&&(n=!0)}}),t=i.layoutRect(),i._fullscreen=e){i._initial={x:t.x,y:t.y,w:t.w,h:t.h},i.borderBox=Me("0"),i.getEl("head").style.display="none",t.deltaH-=t.headerH+2,ye([r,_.document.body]).addClass(o+"fullscreen"),i.classes.add("fullscreen");var s=we.getWindowSize();i.moveTo(0,0).resizeTo(s.w,s.h)}else i.borderBox=Me(i.settings.border),i.getEl("head").style.display="",t.deltaH+=t.headerH,ye([r,_.document.body]).removeClass(o+"fullscreen"),i.classes.remove("fullscreen"),i.moveTo(i._initial.x,i._initial.y).resizeTo(i._initial.w,i._initial.h);return i.reflow()},postRender:function(){var t,n=this;setTimeout(function(){n.classes.add("in"),n.fire("open")},0),n._super(),n.statusbar&&n.statusbar.postRender(),n.focus(),this.dragHelper=new ct(n._id+"-dragh",{start:function(){t={x:n.layoutRect().x,y:n.layoutRect().y}},drag:function(e){n.moveTo(t.x+e.deltaX,t.y+e.deltaY)}}),n.on("submit",function(e){e.isDefaultPrevented()||n.close()}),At.push(n),Lt(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e,t=this;for(t.dragHelper.destroy(),t._super(),t.statusbar&&this.statusbar.remove(),zt(t.classPrefix,!1),e=At.length;e--;)At[e]===t&&At.splice(e,1);Lt(0<At.length)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});!function(){if(!ce.desktop){var n={w:_.window.innerWidth,h:_.window.innerHeight};u.setInterval(function(){var e=_.window.innerWidth,t=_.window.innerHeight;n.w===e&&n.h===t||(n={w:e,h:t},ye(_.window).trigger("resize"))},100)}ye(_.window).on("resize",function(){var e,t,n=we.getWindowSize();for(e=0;e<At.length;e++)t=At[e].layoutRect(),At[e].moveTo(At[e].settings.x||Math.max(0,n.w/2-t.w/2),At[e].settings.y||Math.max(0,n.h/2-t.h/2))})}();var Ft,Ut,Vt,Yt=It.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(e){var t,i=e.callback||function(){};function n(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),i(t)}}}switch(e.buttons){case Yt.OK_CANCEL:t=[n("Ok",!0,!0),n("Cancel",!1)];break;case Yt.YES_NO:case Yt.YES_NO_CANCEL:t=[n("Yes",1,!0),n("No",0)],e.buttons===Yt.YES_NO_CANCEL&&t.push(n("Cancel",-1));break;default:t=[n("Ok",!0,!0)]}return new It({padding:20,x:e.x,y:e.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:t,title:e.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:e.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:e.onClose,onCancel:function(){i(!1)}}).renderTo(_.document.body).reflow()},alert:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,Yt.msgBox(e)},confirm:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,e.buttons=Yt.OK_CANCEL,Yt.msgBox(e)}}}),$t=function(n){return{renderUI:function(e){return Tt(n,this,e)},resizeTo:function(e,t){return le(n,e,t)},resizeBy:function(e,t){return ue(n,e,t)},getNotificationManagerImpl:function(){return Ot(n)},getWindowManagerImpl:function(){return{open:function(n,e,t){var i;return n.title=n.title||" ",n.url=n.url||n.file,n.url&&(n.width=parseInt(n.width||320,10),n.height=parseInt(n.height||240,10)),n.body&&(n.items={defaults:n.defaults,type:n.bodyType||"form",items:n.body,data:n.data,callbacks:n.commands}),n.url||n.buttons||(n.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),(i=new It(n)).on("close",function(){t(i)}),n.data&&i.on("postRender",function(){this.find("*").each(function(e){var t=e.name();t in n.data&&e.value(n.data[t])})}),i.features=n||{},i.params=e||{},i=i.renderTo(_.document.body).reflow()},alert:function(e,t,n){var i;return(i=Yt.alert(e,function(){t()})).on("close",function(){n(i)}),i},confirm:function(e,t,n){var i;return(i=Yt.confirm(e,function(e){t(e)})).on("close",function(){n(i)}),i},close:function(e){e.close()},getParams:function(e){return e.params},setParams:function(e,t){e.params=t}}}}},qt=Se.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=w.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t,n,i,r,o=this.settings;t=o.firstControlClass,n=o.lastControlClass,e.each(function(e){e.classes.remove(t).remove(n).add(o.controlClass),e.visible()&&(i||(i=e),r=e)}),i&&i.classes.add(t),r&&r.classes.add(n)},renderHtml:function(e){var t="";return this.applyClasses(e.items()),e.items().each(function(e){t+=e.renderHtml()}),t},recalc:function(){},postRender:function(){},isNative:function(){return!1}}),Xt=qt.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}}),jt=Nt.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t,n=this;n._super(e),e=n.settings,t=n.settings.size,n.on("click mousedown",function(e){e.preventDefault()}),n.on("touchstart",function(e){n.fire("click",e),e.preventDefault()}),e.subtype&&n.classes.add(e.subtype),t&&n.classes.add("btn-"+t),e.icon&&n.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e,t=this.getEl().firstChild;t&&((e=t.style).width=e.height="100%"),this._super()},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a="",l=n.settings;return(e=l.image)?(o="none","string"!=typeof e&&(e=_.window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",s&&(n.classes.add("btn-has-text"),a='<span class="'+r+'txt">'+n.encode(s)+"</span>"),o=o?r+"ico "+r+"i-"+o:"",t="boolean"==typeof l.active?' aria-pressed="'+l.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" tabindex="-1"'+t+'><button id="'+i+'-button" role="presentation" type="button" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+a+"</button></div>"},bindStates:function(){var o=this,n=o.$,i=o.classPrefix+"txt";function s(e){var t=n("span."+i,o.getEl());e?(t[0]||(n("button:first",o.getEl()).append('<span class="'+i+'"></span>'),t=n("span."+i,o.getEl())),t.html(o.encode(e))):t.remove(),o.classes.toggle("btn-has-text",!!e)}return o.state.on("change:text",function(e){s(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=_.document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r),s(o.state.get("text"))}),o._super()}}),Jt=jt.extend({init:function(e){e=w.extend({text:"Browse...",multiple:!1,accept:null},e),this._super(e),this.classes.add("browsebutton"),e.multiple&&this.classes.add("multiple")},postRender:function(){var n=this,t=we.create("input",{type:"file",id:n._id+"-browse",accept:n.settings.accept});n._super(),ye(t).on("change",function(e){var t=e.target.files;n.value=function(){return t.length?n.settings.multiple?t:t[0]:null},e.preventDefault(),t.length&&n.fire("change",e)}),ye(t).on("click",function(e){e.stopPropagation()}),ye(n.getEl("button")).on("click touchstart",function(e){e.stopPropagation(),t.click(),e.preventDefault()}),n.getEl().appendChild(t)},remove:function(){ye(this.getEl("button")).off(),ye(this.getEl("input")).off(),this._super()}}),Gt=lt.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}}),Kt=Nt.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div>"},bindStates:function(){var o=this;function t(e){o.classes.toggle("checked",e),o.aria("checked",e)}return o.state.on("change:text",function(e){o.getEl("al").firstChild.data=o.translate(e.value)}),o.state.on("change:checked change:value",function(e){o.fire("change"),t(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;if(void 0===t)return o.settings.icon;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=_.document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r)}),o.state.get("checked")&&t(!0),o._super()}}),Zt=tinymce.util.Tools.resolve("tinymce.util.VK"),Qt=Nt.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.classes.add("combobox"),r.subinput=!0,r.ariaTarget="inp",i.menu=i.menu||i.values,i.menu&&(i.icon="caret"),r.on("click",function(e){var t=e.target,n=r.getEl();if(ye.contains(n,t)||t===n)for(;t&&t!==n;)t.id&&-1!==t.id.indexOf("-open")&&(r.fire("action"),i.menu&&(r.showMenu(),e.aria&&r.menu.items()[0].focus())),t=t.parentNode}),r.on("keydown",function(e){var t;13===e.keyCode&&"INPUT"===e.target.nodeName&&(e.preventDefault(),r.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),r.fire("submit",{data:t.toJSON()}))}),r.on("keyup",function(e){if("INPUT"===e.target.nodeName){var t=r.state.get("value"),n=e.target.value;n!==t&&(r.state.set("value",n),r.fire("autocomplete",e))}}),r.on("mouseover",function(e){var t=r.tooltip().moveTo(-65535);if(r.statusLevel()&&-1!==e.target.className.indexOf(r.classPrefix+"status")){var n=r.statusMessage()||"Ok",i=t.text(n).show().testMoveRel(e.target,["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===i),t.classes.toggle("tooltip-nw","bc-tl"===i),t.classes.toggle("tooltip-ne","bc-tr"===i),t.moveRel(e.target,i)}})},statusLevel:function(e){return 0<arguments.length&&this.state.set("statusLevel",e),this.state.get("statusLevel")},statusMessage:function(e){return 0<arguments.length&&this.state.set("statusMessage",e),this.state.get("statusMessage")},showMenu:function(){var e,t=this,n=t.settings;t.menu||((e=n.menu||[]).length?e={type:"menu",items:e}:e.type=e.type||"menu",t.menu=v.create(e).parent(t).renderTo(t.getContainerElm()),t.fire("createmenu"),t.menu.reflow(),t.menu.on("cancel",function(e){e.control===t.menu&&t.focus()}),t.menu.on("show hide",function(e){e.control.items().each(function(e){e.active(e.value()===t.value())})}).fire("show"),t.menu.on("select",function(e){t.value(e.control.value())}),t.on("focusin",function(e){"INPUT"===e.target.tagName.toUpperCase()&&t.menu.hide()}),t.aria("expanded",!0)),t.menu.show(),t.menu.layoutRect({w:t.layoutRect().w}),t.menu.moveRel(t.getEl(),t.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e,t,n=this,i=n.getEl(),r=n.getEl("open"),o=n.layoutRect(),s=0,a=i.firstChild;n.statusLevel()&&"none"!==n.statusLevel()&&(s=parseInt(we.getRuntimeStyle(a,"padding-right"),10)-parseInt(we.getRuntimeStyle(a,"padding-left"),10)),e=r?o.w-we.getSize(r).width-10:o.w-10;var l=_.document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(t=n.layoutRect().h-2+"px"),ye(a).css({width:e-s,lineHeight:t}),n._super(),n},postRender:function(){var t=this;return ye(this.getEl("inp")).on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)}),t._super()},renderHtml:function(){var e,t,n,i=this,r=i._id,o=i.settings,s=i.classPrefix,a=i.state.get("value")||"",l="",u="";return"spellcheck"in o&&(u+=' spellcheck="'+o.spellcheck+'"'),o.maxLength&&(u+=' maxlength="'+o.maxLength+'"'),o.size&&(u+=' size="'+o.size+'"'),o.subtype&&(u+=' type="'+o.subtype+'"'),n='<i id="'+r+'-status" class="mce-status mce-ico" style="display: none"></i>',i.disabled()&&(u+=' disabled="disabled"'),(e=o.icon)&&"caret"!==e&&(e=s+"ico "+s+"i-"+o.icon),t=i.state.get("text"),(e||t)&&(l='<div id="'+r+'-open" class="'+s+"btn "+s+'open" tabIndex="-1" role="button"><button id="'+r+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!==e?'<i class="'+e+'"></i>':'<i class="'+s+'caret"></i>')+(t?(e?" ":"")+t:"")+"</button></div>",i.classes.add("has-open")),'<div id="'+r+'" class="'+i.classes+'"><input id="'+r+'-inp" class="'+s+'textbox" value="'+i.encode(a,!1)+'" hidefocus="1"'+u+' placeholder="'+i.encode(o.placeholder)+'" />'+n+l+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},showAutoComplete:function(e,i){var r=this;if(0!==e.length){r.menu?r.menu.items().remove():r.menu=v.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(r).renderTo(),w.each(e,function(e){var t,n;r.menu.add({text:e.title,url:e.previewUrl,match:i,classes:"menu-item-ellipsis",onclick:(t=e.value,n=e.title,function(){r.fire("selectitem",{title:n,value:t})})})}),r.menu.renderNew(),r.hideMenu(),r.menu.on("cancel",function(e){e.control.parent()===r.menu&&(e.stopPropagation(),r.focus(),r.hideMenu())}),r.menu.on("select",function(){r.focus()});var t=r.layoutRect().w;r.menu.layoutRect({w:t,minW:0,maxW:t}),r.menu.repaint(),r.menu.reflow(),r.menu.show(),r.menu.moveRel(r.getEl(),r.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])}else r.hideMenu()},hideMenu:function(){this.menu&&this.menu.hide()},bindStates:function(){var r=this;r.state.on("change:value",function(e){r.getEl("inp").value!==e.value&&(r.getEl("inp").value=e.value)}),r.state.on("change:disabled",function(e){r.getEl("inp").disabled=e.value}),r.state.on("change:statusLevel",function(e){var t=r.getEl("status"),n=r.classPrefix,i=e.value;we.css(t,"display","none"===i?"none":""),we.toggleClass(t,n+"i-checkmark","ok"===i),we.toggleClass(t,n+"i-warning","warn"===i),we.toggleClass(t,n+"i-error","error"===i),r.classes.toggle("has-status","none"!==i),r.repaint()}),we.on(r.getEl("status"),"mouseleave",function(){r.tooltip().hide()}),r.on("cancel",function(e){r.menu&&r.menu.visible()&&(e.stopPropagation(),r.hideMenu())});var n=function(e,t){t&&0<t.items().length&&t.items().eq(e)[0].focus()};return r.on("keydown",function(e){var t=e.keyCode;"INPUT"===e.target.nodeName&&(t===Zt.DOWN?(e.preventDefault(),r.fire("autocomplete"),n(0,r.menu)):t===Zt.UP&&(e.preventDefault(),n(-1,r.menu)))}),r._super()},remove:function(){ye(this.getEl("inp")).off(),this.menu&&this.menu.remove(),this._super()}}),en=Qt.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl("open"),n=t?t.getElementsByTagName("i")[0]:null;if(n)try{n.style.background=e}catch(i){}},bindStates:function(){var t=this;return t.state.on("change:value",function(e){t.state.get("rendered")&&t.repaintColor(e.value)}),t._super()}}),tn=jt.extend({showPanel:function(){var t=this,e=t.settings;if(t.classes.add("opened"),t.panel)t.panel.show();else{var n=e.panel;n.type&&(n={layout:"grid",items:n}),n.role=n.role||"dialog",n.popover=!0,n.autohide=!0,n.ariaRoot=!0,t.panel=new Ct(n).on("hide",function(){t.classes.remove("opened")}).on("cancel",function(e){e.stopPropagation(),t.focus(),t.hidePanel()}).parent(t).renderTo(t.getContainerElm()),t.panel.fire("show"),t.panel.reflow()}var i=t.panel.testMoveRel(t.getEl(),e.popoverAlign||(t.isRtl()?["bc-tc","bc-tl","bc-tr"]:["bc-tc","bc-tr","bc-tl","tc-bc","tc-br","tc-bl"]));t.panel.classes.toggle("start","l"===i.substr(-1)),t.panel.classes.toggle("end","r"===i.substr(-1));var r="t"===i.substr(0,1);t.panel.classes.toggle("bottom",!r),t.panel.classes.toggle("top",r),t.panel.moveRel(t.getEl(),i)},hidePanel:function(){this.panel&&this.panel.hide()},postRender:function(){var t=this;return t.aria("haspopup",!0),t.on("click",function(e){e.control===t&&(t.panel&&t.panel.visible()?t.hidePanel():(t.showPanel(),t.panel.focus(!!e.aria)))}),t._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}}),nn=p.DOM,rn=tn.extend({init:function(e){this._super(e),this.classes.add("splitbtn"),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,i=e.state.get("text"),r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",s="";return i&&(e.classes.add("btn-has-text"),s='<span class="'+n+'txt">'+e.encode(i)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+s+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var t=this,n=t.settings.onclick;return t.on("click",function(e){e.aria&&"down"===e.aria.key||e.control!==t||nn.getParent(e.target,"."+t.classPrefix+"open")||(e.stopImmediatePropagation(),n.call(t,e))}),delete t.settings.onclick,t._super()}}),on=tinymce.util.Tools.resolve("tinymce.util.Color"),sn=Nt.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){var n,i,r,o,s,a=this,l=a.color();function u(e,t){var n,i,r=we.getPos(e);return n=t.pageX-r.x,i=t.pageY-r.y,{x:n=Math.max(0,Math.min(n/e.clientWidth,1)),y:i=Math.max(0,Math.min(i/e.clientHeight,1))}}function c(e,t){var n=(360-e.h)/360;we.css(r,{top:100*n+"%"}),t||we.css(s,{left:e.s+"%",top:100-e.v+"%"}),o.style.background=on({s:100,v:100,h:e.h}).toHex(),a.color().parse({s:e.s,v:e.v,h:e.h})}function e(e){var t;t=u(o,e),n.s=100*t.x,n.v=100*(1-t.y),c(n),a.fire("change")}function t(e){var t;t=u(i,e),(n=l.toHsv()).h=360*(1-t.y),c(n,!0),a.fire("change")}i=a.getEl("h"),r=a.getEl("hp"),o=a.getEl("sv"),s=a.getEl("svp"),a._repaint=function(){c(n=l.toHsv())},a._super(),a._svdraghelper=new ct(a._id+"-sv",{start:e,drag:e}),a._hdraghelper=new ct(a._id+"-h",{start:t,drag:t}),a._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){if(!arguments.length)return this.color().toHex();this.color().parse(e),this._rendered&&this._repaint()},color:function(){return this._color||(this._color=on()),this._color},renderHtml:function(){var e,t=this._id,o=this.classPrefix,s="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000";return e='<div id="'+t+'-h" class="'+o+'colorpicker-h" style="background: -ms-linear-gradient(top,'+s+");background: linear-gradient(to bottom,"+s+');">'+function(){var e,t,n,i,r="";for(n="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",e=0,t=(i=s.split(",")).length-1;e<t;e++)r+='<div class="'+o+'colorpicker-h-chunk" style="height:'+100/t+"%;"+n+i[e]+",endColorstr="+i[e+1]+");-ms-"+n+i[e]+",endColorstr="+i[e+1]+')"></div>';return r}()+'<div id="'+t+'-hp" class="'+o+'colorpicker-h-marker"></div></div>','<div id="'+t+'" class="'+this.classes+'"><div id="'+t+'-sv" class="'+o+'colorpicker-sv"><div class="'+o+'colorpicker-overlay1"><div class="'+o+'colorpicker-overlay2"><div id="'+t+'-svp" class="'+o+'colorpicker-selector1"><div class="'+o+'colorpicker-selector2"></div></div></div></div></div>'+e+"</div>"}}),an=Nt.extend({init:function(e){e=w.extend({height:100,text:"Drop an image here",multiple:!1,accept:null},e),this._super(e),this.classes.add("dropzone"),e.multiple&&this.classes.add("multiple")},renderHtml:function(){var e,t,n=this.settings;return e={id:this._id,hidefocus:"1"},t=we.create("div",e,"<span>"+this.translate(n.text)+"</span>"),n.height&&we.css(t,"height",n.height+"px"),n.width&&we.css(t,"width",n.width+"px"),t.className=this.classes,t.outerHTML},postRender:function(){var i=this,e=function(e){e.preventDefault(),i.classes.toggle("dragenter"),i.getEl().className=i.classes};i._super(),i.$el.on("dragover",function(e){e.preventDefault()}),i.$el.on("dragenter",e),i.$el.on("dragleave",e),i.$el.on("drop",function(e){if(e.preventDefault(),!i.state.get("disabled")){var t=function(e){var t=i.settings.accept;if("string"!=typeof t)return e;var n=new RegExp("("+t.split(/\s*,\s*/).join("|")+")$","i");return w.grep(e,function(e){return n.test(e.name)})}(e.dataTransfer.files);i.value=function(){return t.length?i.settings.multiple?t:t[0]:null},t.length&&i.fire("change",e)}})},remove:function(){this.$el.off(),this._super()}}),ln=Nt.extend({init:function(e){var n=this;e.delimiter||(e.delimiter="\xbb"),n._super(e),n.classes.add("path"),n.canFocus=!0,n.on("click",function(e){var t;(t=e.target.getAttribute("data-index"))&&n.fire("select",{value:n.row()[t],index:t})}),n.row(n.settings.row)},focus:function(){return this.getEl().firstChild.focus(),this},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'">'+this._getDataPathHtml(this.state.get("row"))+"</div>"},bindStates:function(){var t=this;return t.state.on("change:row",function(e){t.innerHtml(t._getDataPathHtml(e.value))}),t._super()},_getDataPathHtml:function(e){var t,n,i=e||[],r="",o=this.classPrefix;for(t=0,n=i.length;t<n;t++)r+=(0<t?'<div class="'+o+'divider" aria-hidden="true"> '+this.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(t===n-1?" "+o+"last":"")+'" data-index="'+t+'" tabindex="-1" id="'+this._id+"-"+t+'" aria-level="'+(t+1)+'">'+i[t].name+"</div>";return r||(r='<div class="'+o+'path-item">\xa0</div>'),r}}),un=ln.extend({postRender:function(){var o=this,s=o.settings.editor;function a(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}return!1!==s.settings.elementpath&&(o.on("select",function(e){s.focus(),s.selection.select(this.row()[e.index].element),s.nodeChanged()}),s.on("nodeChange",function(e){for(var t=[],n=e.parents,i=n.length;i--;)if(1===n[i].nodeType&&!a(n[i])){var r=s.fire("ResolveName",{name:n[i].nodeName.toLowerCase(),target:n[i]});if(r.isDefaultPrevented()||t.push({name:r.name,element:n[i]}),r.isPropagationStopped())break}o.row(t)})),o._super()}}),cn=lt.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}}),dn=lt.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:15,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var i=this,e=i.items();i.settings.formItemDefaults||(i.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),e.each(function(e){var t,n=e.settings.label;n&&((t=new cn(w.extend({items:{type:"label",id:e._id+"-l",text:n,flex:0,forId:e._id,disabled:e.disabled()}},i.settings.formItemDefaults))).type="formitem",e.aria("labelledby",e._id+"-l"),"undefined"==typeof e.settings.flex&&(e.settings.flex=1),i.replace(e,t),t.add(e))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){this._super(),this.fromJSON(this.settings.data)},bindStates:function(){var n=this;function e(){var e,t,i=0,r=[];if(!1!==n.settings.labelGapCalc)for(("children"===n.settings.labelGapCalc?n.find("formitem"):n.items()).filter("formitem").each(function(e){var t=e.items()[0],n=t.getEl().clientWidth;i=i<n?n:i,r.push(t)}),t=n.settings.labelGap||0,e=r.length;e--;)r[e].settings.minWidth=i+t}n._super(),n.on("show",e),e()}}),fn=dn.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}}),hn=0,mn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:k(e)}},gn={fromHtml:function(e,t){var n=(t||_.document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw _.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return mn(n.childNodes[0])},fromTag:function(e,t){var n=(t||_.document).createElement(e);return mn(n)},fromText:function(e,t){var n=(t||_.document).createTextNode(e);return mn(n)},fromDom:mn,fromPoint:function(e,t,n){var i=e.dom();return N.from(i.elementFromPoint(t,n)).map(mn)}},pn=(_.Node.ATTRIBUTE_NODE,_.Node.CDATA_SECTION_NODE,_.Node.COMMENT_NODE,_.Node.DOCUMENT_NODE),vn=(_.Node.DOCUMENT_TYPE_NODE,_.Node.DOCUMENT_FRAGMENT_NODE,_.Node.ELEMENT_NODE),bn=(_.Node.TEXT_NODE,_.Node.PROCESSING_INSTRUCTION_NODE,_.Node.ENTITY_REFERENCE_NODE,_.Node.ENTITY_NODE,_.Node.NOTATION_NODE,"undefined"!=typeof _.window?_.window:Function("return this;")(),function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.test(t))return i}return undefined}(e,t);if(!n)return{major:0,minor:0};var i=function(e){return Number(t.replace(n,"$"+e))};return xn(i(1),i(2))}),yn=function(){return xn(0,0)},xn=function(e,t){return{major:e,minor:t}},wn={nu:xn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?yn():bn(e,n)},unknown:yn},_n="Firefox",Rn=function(e,t){return function(){return t===e}},Cn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Rn("Edge",t),isChrome:Rn("Chrome",t),isIE:Rn("IE",t),isOpera:Rn("Opera",t),isFirefox:Rn(_n,t),isSafari:Rn("Safari",t)}},En={unknown:function(){return Cn({current:undefined,version:wn.unknown()})},nu:Cn,edge:k("Edge"),chrome:k("Chrome"),ie:k("IE"),opera:k("Opera"),firefox:k(_n),safari:k("Safari")},kn="Windows",Hn="Android",Sn="Solaris",Tn="FreeBSD",Mn=function(e,t){return function(){return t===e}},Nn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Mn(kn,t),isiOS:Mn("iOS",t),isAndroid:Mn(Hn,t),isOSX:Mn("OSX",t),isLinux:Mn("Linux",t),isSolaris:Mn(Sn,t),isFreeBSD:Mn(Tn,t)}},Pn={unknown:function(){return Nn({current:undefined,version:wn.unknown()})},nu:Nn,windows:k(kn),ios:k("iOS"),android:k(Hn),linux:k("Linux"),osx:k("OSX"),solaris:k(Sn),freebsd:k(Tn)},Wn=function(e,t){var n=String(t).toLowerCase();return function(e,t){for(var n=0,i=e.length;n<i;n++){var r=e[n];if(t(r,n))return N.some(r)}return N.none()}(e,function(e){return e.search(n)})},Dn=function(e,n){return Wn(e,n).map(function(e){var t=wn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},On=function(e,n){return Wn(e,n).map(function(e){var t=wn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},An=function(e,t){return-1!==e.indexOf(t)},Bn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ln=function(t){return function(e){return An(e,t)}},zn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return An(e,"edge/")&&An(e,"chrome")&&An(e,"safari")&&An(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Bn],search:function(e){return An(e,"chrome")&&!An(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return An(e,"msie")||An(e,"trident")}},{name:"Opera",versionRegexes:[Bn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ln("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ln("firefox")},{name:"Safari",versionRegexes:[Bn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(An(e,"safari")||An(e,"mobile/"))&&An(e,"applewebkit")}}],In=[{name:"Windows",search:Ln("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return An(e,"iphone")||An(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ln("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Ln("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ln("linux"),versionRegexes:[]},{name:"Solaris",search:Ln("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ln("freebsd"),versionRegexes:[]}],Fn={browsers:k(zn),oses:k(In)},Un=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=Fn.browsers(),h=Fn.oses(),m=Dn(f,e).fold(En.unknown,En.nu),g=On(h,e).fold(Pn.unknown,Pn.nu);return{browser:m,os:g,deviceType:(n=m,i=e,r=(t=g).isiOS()&&!0===/ipad/i.test(i),o=t.isiOS()&&!r,s=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,l=r||s||a&&!0===/mobile/i.test(i),u=t.isiOS()||t.isAndroid(),c=u&&!l,d=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(i),{isiPad:k(r),isiPhone:k(o),isTablet:k(l),isPhone:k(c),isTouch:k(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:k(d)})}},Vn=(Vt=!(Ft=function(){var e=_.navigator.userAgent;return Un(e)}),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vt||(Vt=!0,Ut=Ft.apply(null,e)),Ut}),Yn=vn,$n=pn,qn=function(e){return e.nodeType!==Yn&&e.nodeType!==$n||0===e.childElementCount},Xn=(Vn().browser.isIE(),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}("element","offset"),w.trim),jn=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}},Jn=jn("true"),Gn=jn("false"),Kn=function(e,t,n,i,r){return{type:e,title:t,url:n,level:i,attach:r}},Zn=function(e){return e.innerText||e.textContent},Qn=function(e){return e.id?e.id:(t="h",n=(new Date).getTime(),t+"_"+Math.floor(1e9*Math.random())+ ++hn+String(n));var t,n},ei=function(e){return(t=e)&&"A"===t.nodeName&&(t.id||t.name)&&ni(e);var t},ti=function(e){return e&&/^(H[1-6])$/.test(e.nodeName)},ni=function(e){return function(e){for(;e=e.parentNode;){var t=e.contentEditable;if(t&&"inherit"!==t)return Jn(e)}return!1}(e)&&!Gn(e)},ii=function(e){return ti(e)&&ni(e)},ri=function(e){var t,n=Qn(e);return Kn("header",Zn(e),"#"+n,ti(t=e)?parseInt(t.nodeName.substr(1),10):0,function(){e.id=n})},oi=function(e){var t=e.id||e.name,n=Zn(e);return Kn("anchor",n||"#"+t,"#"+t,0,E)},si=function(e){var t,n,i,r,o,s;return t="h1,h2,h3,h4,h5,h6,a:not([href])",n=e,G((Vn().browser.isIE(),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}("element","offset"),i=gn.fromDom(n),r=t,s=(o=i)===undefined?_.document:o.dom(),qn(s)?[]:G(s.querySelectorAll(r),gn.fromDom)),function(e){return e.dom()})},ai=function(e){return 0<Xn(e.title).length},li=function(e){var t,n=si(e);return Z((t=n,G(Z(t,ii),ri)).concat(G(Z(n,ei),oi)),ai)},ui={},ci=function(e){return{title:e.title,value:{title:{raw:e.title},url:e.url,attach:e.attach}}},di=function(e,t){return{title:e,value:{title:e,url:t,attach:E}}},fi=function(e,t,n){var i=t in e?e[t]:n;return!1===i?null:i},hi=function(e,i,r,t){var n,o,s,a,l,u,c={title:"-"},d=function(e){var t=e.hasOwnProperty(r)?e[r]:[],n=Z(t,function(e){return t=e,!J(i,function(e){return e.url===t});var t});return w.map(n,function(e){return{title:e,value:{title:e,url:e,attach:E}}})},f=function(t){var e,n=Z(i,function(e){return e.type===t});return e=n,w.map(e,ci)};return!1===t.typeahead_urls?[]:"file"===r?(n=[mi(e,d(ui)),mi(e,f("header")),mi(e,(a=f("anchor"),l=fi(t,"anchor_top","#top"),u=fi(t,"anchor_bottom","#bottom"),null!==l&&a.unshift(di("<top>",l)),null!==u&&a.push(di("<bottom>",u)),a))],o=function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(c,t)},s=[],K(n,function(e){s=o(s,e)}),s):mi(e,d(ui))},mi=function(e,t){var n=e.toLowerCase(),i=w.grep(t,function(e){return-1!==e.title.toLowerCase().indexOf(n)});return 1===i.length&&i[0].title===e?[]:i},gi=function(r,i,o,s){var t=function(e){var t=li(o),n=hi(e,t,s,i);r.showAutoComplete(n,e)};r.on("autocomplete",function(){t(r.value())}),r.on("selectitem",function(e){var t=e.value;r.value(t.url);var n,i=(n=t.title).raw?n.raw:n;"image"===s?r.fire("change",{meta:{alt:i,attach:t.attach}}):r.fire("change",{meta:{text:i,attach:t.attach}}),r.focus()}),r.on("click",function(e){0===r.value().length&&"INPUT"===e.target.nodeName&&t("")}),r.on("PostRender",function(){r.getRoot().on("submit",function(e){var t,n,i;e.isDefaultPrevented()||(t=r.value(),i=ui[n=s],/^https?/.test(t)&&(i?j(i,t).isNone()&&(ui[n]=i.slice(0,5).concat(t)):ui[n]=[t]))})})},pi=function(o,e,n){var i=e.filepicker_validator_handler;i&&o.state.on("change:value",function(e){var t;0!==(t=e.value).length?i({url:t,type:n},function(e){var t,n,i,r=(n=(t=e).status,i=t.message,"valid"===n?{status:"ok",message:i}:"unknown"===n?{status:"warn",message:i}:"invalid"===n?{status:"warn",message:i}:{status:"none",message:""});o.statusMessage(r.message),o.statusLevel(r.status)}):o.statusLevel("none")})},vi=Qt.extend({Statics:{clearHistory:function(){ui={}}},init:function(e){var t,n,i,r=this,o=window.tinymce?window.tinymce.activeEditor:l.activeEditor,s=o.settings,a=e.filetype;e.spellcheck=!1,(i=s.file_picker_types||s.file_browser_callback_types)&&(i=w.makeMap(i,/[, ]/)),i&&!i[a]||(!(n=s.file_picker_callback)||i&&!i[a]?!(n=s.file_browser_callback)||i&&!i[a]||(t=function(){n(r.getEl("inp").id,r.value(),a,window)}):t=function(){var e=r.fire("beforecall").meta;e=w.extend({filetype:a},e),n.call(o,function(e,t){r.value(e).fire("change",{meta:t})},r.value(),e)}),t&&(e.icon="browse",e.onaction=t),r._super(e),r.classes.add("filepicker"),gi(r,s,o.getBody(),a),pi(r,s,a)}}),bi=Xt.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}}),yi=Xt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,R,C,E,k,H,S,T,M,N,P,W,D,O,A,B,L=[],z=Math.max,I=Math.min;for(i=e.items().filter(":visible"),r=e.layoutRect(),o=e.paddingBox,s=e.settings,f=e.isRtl()?s.direction||"row-reversed":s.direction,a=s.align,l=e.isRtl()?s.pack||"end":s.pack,u=s.spacing||0,"row-reversed"!==f&&"column-reverse"!==f||(i=i.set(i.toArray().reverse()),f=f.split("-")[0]),"column"===f?(C="y",_="h",R="minH",E="maxH",H="innerH",k="top",S="deltaH",T="contentH",D="left",P="w",M="x",N="innerW",W="minW",O="right",A="deltaW",B="contentW"):(C="x",_="w",R="minW",E="maxW",H="innerW",k="left",S="deltaW",T="contentW",D="top",P="h",M="y",N="innerH",W="minH",O="bottom",A="deltaH",B="contentH"),d=r[H]-o[k]-o[k],w=c=0,t=0,n=i.length;t<n;t++)m=(h=i[t]).layoutRect(),d-=t<n-1?u:0,0<(g=h.settings.flex)&&(c+=g,m[E]&&L.push(h),m.flex=g),d-=m[R],w<(p=o[D]+m[W]+o[O])&&(w=p);if((y={})[R]=d<0?r[R]-d+r[S]:r[H]-d+r[S],y[W]=w+r[A],y[T]=r[H]-d,y[B]=w,y.minW=I(y.minW,r.maxW),y.minH=I(y.minH,r.maxH),y.minW=z(y.minW,r.startMinWidth),y.minH=z(y.minH,r.startMinHeight),!r.autoResize||y.minW===r.minW&&y.minH===r.minH){for(b=d/c,t=0,n=L.length;t<n;t++)(v=(m=(h=L[t]).layoutRect())[E])<(p=m[R]+m.flex*b)?(d-=m[E]-m[R],c-=m.flex,m.flex=0,m.maxFlexSize=v):m.maxFlexSize=0;for(b=d/c,x=o[k],y={},0===c&&("end"===l?x=d+o[k]:"center"===l?(x=Math.round(r[H]/2-(r[H]-d)/2)+o[k])<0&&(x=o[k]):"justify"===l&&(x=o[k],u=Math.floor(d/(i.length-1)))),y[M]=o[D],t=0,n=i.length;t<n;t++)p=(m=(h=i[t]).layoutRect()).maxFlexSize||m[R],"center"===a?y[M]=Math.round(r[N]/2-m[P]/2):"stretch"===a?(y[P]=z(m[W]||0,r[N]-o[D]-o[O]),y[M]=o[D]):"end"===a&&(y[M]=r[N]-m[P]-o.top),0<m.flex&&(p+=m.flex*b),y[_]=p,y[C]=x,h.layoutRect(y),h.recalc&&h.recalc(),x+=p+u}else if(y.w=y.minW,y.h=y.minH,e.layoutRect(y),this.recalc(e),null===e._lastRect){var F=e.parent();F&&(F._lastRect=null,F.recalc())}}}),xi=qt.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}}),wi=function(e,t){return n=t,r=(i=e)===undefined?_.document:i.dom(),qn(r)?N.none():N.from(r.querySelector(n)).map(gn.fromDom);var n,i,r},_i=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},Ri=function(e,t,n){var i=function(e){n(e,t)};e.formatter?e.formatter.formatChanged(t,i):e.on("init",function(){e.formatter.formatChanged(t,i)})},Ci=function(e,n){return function(t){Ri(e,n,function(e){t.control.active(e)})}},Ei=function(i){var t=["alignleft","aligncenter","alignright","alignjustify"],r="alignleft",e=[{text:"Left",icon:"alignleft",onclick:_i(i,"alignleft")},{text:"Center",icon:"aligncenter",onclick:_i(i,"aligncenter")},{text:"Right",icon:"alignright",onclick:_i(i,"alignright")},{text:"Justify",icon:"alignjustify",onclick:_i(i,"alignjustify")}];i.addMenuItem("align",{text:"Align",menu:e}),i.addButton("align",{type:"menubutton",icon:r,menu:e,onShowMenu:function(e){var n=e.control.menu;w.each(t,function(t,e){n.items().eq(e).each(function(e){return e.active(i.formatter.match(t))})})},onPostRender:function(e){var n=e.control;w.each(t,function(t,e){Ri(i,t,function(e){n.icon(r),e&&n.icon(t)})})}}),w.each({alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(e,t){i.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Ci(i,t)})})},ki=function(e){return e?e.split(",")[0]:""},Hi=function(l,u){return function(){var a=this;a.state.set("value",null),l.on("init nodeChange",function(e){var t,n,i,r,o=l.queryCommandValue("FontName"),s=(t=u,r=(n=o)?n.toLowerCase():"",w.each(t,function(e){e.value.toLowerCase()===r&&(i=e.value)}),w.each(t,function(e){i||ki(e.value).toLowerCase()!==ki(r).toLowerCase()||(i=e.value)}),i);a.value(s||null),!s&&o&&a.text(ki(o))})}},Si=function(n){n.addButton("fontselect",function(){var e,t=(e=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(n.settings.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"),w.map(e,function(e){return{text:{raw:e[0]},value:e[1],textStyle:-1===e[1].indexOf("dings")?"font-family:"+e[1]:""}}));return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:t,fixedWidth:!0,onPostRender:Hi(n,t),onselect:function(e){e.control.settings.value&&n.execCommand("FontName",!1,e.control.settings.value)}}})},Ti=function(e){Si(e)},Mi=function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,i=t||0,r=Math.pow(10,i),Math.round(n*r)/r+"pt"):e;var n,i,r},Ni=function(e,t,n){var i;return w.each(e,function(e){e.value===n?i=n:e.value===t&&(i=t)}),i},Pi=function(n){n.addButton("fontsizeselect",function(){var e,s,a,t=(e=n.settings.fontsize_formats||"8pt 10pt 12pt 14pt 18pt 24pt 36pt",w.map(e.split(" "),function(e){var t=e,n=e,i=e.split("=");return 1<i.length&&(t=i[0],n=i[1]),{text:t,value:n}}));return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:(s=n,a=t,function(){var o=this;s.on("init nodeChange",function(e){var t,n,i,r;if(t=s.queryCommandValue("FontSize"))for(i=3;!r&&0<=i;i--)n=Mi(t,i),r=Ni(a,n,t);o.value(r||null),r||o.text(n)})}),onclick:function(e){e.control.settings.value&&n.execCommand("FontSize",!1,e.control.settings.value)}}})},Wi=function(e){Pi(e)},Di=function(n,e){var i=e.length;return w.each(e,function(e){e.menu&&(e.hidden=0===Di(n,e.menu));var t=e.format;t&&(e.hidden=!n.formatter.canApply(t)),e.hidden&&i--}),i},Oi=function(n,e){var i=e.items().length;return e.items().each(function(e){e.menu&&e.visible(0<Oi(n,e.menu)),!e.menu&&e.settings.menu&&e.visible(0<Di(n,e.settings.menu));var t=e.settings.format;t&&e.visible(n.formatter.canApply(t)),e.visible()||i--}),i},Ai=function(e){var i,r,o,t,s,n,a,l,u=(r=0,o=[],t=[{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",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],s=function(e){var i=[];if(e)return w.each(e,function(e){var t={text:e.title,icon:e.icon};if(e.items)t.menu=s(e.items);else{var n=e.format||"custom"+r++;e.format||(e.name=n,o.push(e)),t.format=n,t.cmd=e.cmd}i.push(t)}),i},(i=e).on("init",function(){w.each(o,function(e){i.formatter.register(e.name,e)})}),{type:"menu",items:i.settings.style_formats_merge?i.settings.style_formats?s(t.concat(i.settings.style_formats)):s(t):s(i.settings.style_formats||t),onPostRender:function(e){i.fire("renderFormatsMenu",{control:e.control})},itemDefaults:{preview:!0,textStyle:function(){if(this.settings.format)return i.formatter.getCssText(this.settings.format)},onPostRender:function(){var n=this;n.parent().on("show",function(){var e,t;(e=n.settings.format)&&(n.disabled(!i.formatter.canApply(e)),n.active(i.formatter.match(e))),(t=n.settings.cmd)&&n.active(i.queryCommandState(t))})},onclick:function(){this.settings.format&&_i(i,this.settings.format)(),this.settings.cmd&&i.execCommand(this.settings.cmd)}}});n=u,e.addMenuItem("formats",{text:"Formats",menu:n}),l=u,(a=e).addButton("styleselect",{type:"menubutton",text:"Formats",menu:l,onShowMenu:function(){a.settings.style_formats_autohide&&Oi(a,this.menu)}})},Bi=function(n,e){return function(){var r,o,s,t=[];return w.each(e,function(e){t.push({text:e[0],value:e[1],textStyle:function(){return n.formatter.getCssText(e[1])}})}),{type:"listbox",text:e[0][0],values:t,fixedWidth:!0,onselect:function(e){if(e.control){var t=e.control.value();_i(n,t)()}},onPostRender:(r=n,o=t,function(){var t=this;r.on("nodeChange",function(e){var n=r.formatter,i=null;w.each(e.parents,function(t){if(w.each(o,function(e){if(s?n.matchNode(t,s,{value:e.value})&&(i=e.value):n.matchNode(t,e.value)&&(i=e.value),i)return!1}),i)return!1}),t.value(i)})})}}},Li=function(e){var t,n,i=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");e.addMenuItem("blockformats",{text:"Blocks",menu:(t=e,n=i,w.map(n,function(e){return{text:e[0],onclick:_i(t,e[1]),textStyle:function(){return t.formatter.getCssText(e[1])}}}))}),e.addButton("formatselect",Bi(e,i))},zi=function(t,e){var n,i;if("string"==typeof e)i=e.split(" ");else if(w.isArray(e))return function(e){for(var t=[],n=0,i=e.length;n<i;++n){if(!V(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);X.apply(t,e[n])}return t}(w.map(e,function(e){return zi(t,e)}));return n=w.grep(i,function(e){return"|"===e||e in t.menuItems}),w.map(n,function(e){return"|"===e?{text:"-"}:t.menuItems[e]})},Ii=function(e){return e&&"-"===e.text},Fi=function(n){var i=Z(n,function(e,t){return!Ii(e)||!Ii(n[t-1])});return Z(i,function(e,t){return!Ii(e)||0<t&&t<i.length-1})},Ui=function(e){var t,n,i,r,o=e.settings.insert_button_items;return Fi(o?zi(e,o):(t=e,n="insert",i=[{text:"-"}],r=w.grep(t.menuItems,function(e){return e.context===n}),w.each(r,function(e){"before"===e.separator&&i.push({text:"|"}),e.prependToContext?i.unshift(e):i.push(e),"after"===e.separator&&i.push({text:"|"})}),i))},Vi=function(e){var t;(t=e).addButton("insert",{type:"menubutton",icon:"insert",menu:[],oncreatemenu:function(){this.menu.add(Ui(t)),this.menu.renderNew()}})},Yi=function(e){var n,i,r;n=e,w.each({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(e,t){n.addButton(t,{active:!1,tooltip:e,onPostRender:Ci(n,t),onclick:_i(n,t)})}),i=e,w.each({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"],removeformat:["Clear formatting","RemoveFormat"],remove:["Remove","Delete"]},function(e,t){i.addButton(t,{tooltip:e[0],cmd:e[1]})}),r=e,w.each({blockquote:["Blockquote","mceBlockQuote"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"]},function(e,t){r.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Ci(r,t)})})},$i=function(e){var n;Yi(e),n=e,w.each({bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline","Meta+U"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"],newdocument:["New document","mceNewDocument"],cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"]},function(e,t){n.addMenuItem(t,{text:e[0],icon:t,shortcut:e[2],cmd:e[1]})}),n.addMenuItem("codeformat",{text:"Code",icon:"code",onclick:_i(n,"code")})},qi=function(n,i){return function(){var e=this,t=function(){var e="redo"===i?"hasRedo":"hasUndo";return!!n.undoManager&&n.undoManager[e]()};e.disabled(!t()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){e.disabled(n.readonly||!t())})}},Xi=function(e){var t,n;(t=e).addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:qi(t,"undo"),cmd:"undo"}),t.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:qi(t,"redo"),cmd:"redo"}),(n=e).addButton("undo",{tooltip:"Undo",onPostRender:qi(n,"undo"),cmd:"undo"}),n.addButton("redo",{tooltip:"Redo",onPostRender:qi(n,"redo"),cmd:"redo"})},ji=function(e){var t,n;(t=e).addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:(n=t,function(){var t=this;n.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(n.hasVisual)}),cmd:"mceToggleVisualAid"})},Ji={setup:function(e){var t;e.rtl&&(rt.rtl=!0),e.on("mousedown progressstate",function(){Ct.hideAll()}),(t=e).settings.ui_container&&(ce.container=wi(gn.fromDom(_.document.body),t.settings.ui_container).fold(k(null),function(e){return e.dom()})),Nt.tooltips=!ce.iOS,rt.translate=function(e){return l.translate(e)},Li(e),Ei(e),$i(e),Xi(e),Wi(e),Ti(e),Ai(e),ji(e),Vi(e)}},Gi=Xt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,R,C,E,k,H,S,T=[],M=[];t=e.settings,r=e.items().filter(":visible"),o=e.layoutRect(),i=t.columns||Math.ceil(Math.sqrt(r.length)),n=Math.ceil(r.length/i),b=t.spacingH||t.spacing||0,y=t.spacingV||t.spacing||0,x=t.alignH||t.align,w=t.alignV||t.align,p=e.paddingBox,S="reverseRows"in t?t.reverseRows:e.isRtl(),x&&"string"==typeof x&&(x=[x]),w&&"string"==typeof w&&(w=[w]);for(d=0;d<i;d++)T.push(0);for(f=0;f<n;f++)M.push(0);for(f=0;f<n;f++)for(d=0;d<i&&(c=r[f*i+d]);d++)C=(u=c.layoutRect()).minW,E=u.minH,T[d]=C>T[d]?C:T[d],M[f]=E>M[f]?E:M[f];for(k=o.innerW-p.left-p.right,d=_=0;d<i;d++)_+=T[d]+(0<d?b:0),k-=(0<d?b:0)+T[d];for(H=o.innerH-p.top-p.bottom,f=R=0;f<n;f++)R+=M[f]+(0<f?y:0),H-=(0<f?y:0)+M[f];if(_+=p.left+p.right,R+=p.top+p.bottom,(l={}).minW=_+(o.w-o.innerW),l.minH=R+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW===o.minW&&l.minH===o.minH){var N;o.autoResize&&((l=e.layoutRect(l)).contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH),N="start"===t.packV?0:0<H?Math.floor(H/n):0;var P=0,W=t.flexWidths;if(W)for(d=0;d<W.length;d++)P+=W[d];else P=i;var D=k/P;for(d=0;d<i;d++)T[d]+=W?W[d]*D:D;for(m=p.top,f=0;f<n;f++){for(h=p.left,a=M[f]+N,d=0;d<i&&(c=r[S?f*i+i-1-d:f*i+d]);d++)g=c.settings,u=c.layoutRect(),s=Math.max(T[d],u.startMinWidth),u.x=h,u.y=m,"center"===(v=g.alignH||(x?x[d]||x[0]:null))?u.x=h+s/2-u.w/2:"right"===v?u.x=h+s-u.w:"stretch"===v&&(u.w=s),"center"===(v=g.alignV||(w?w[d]||w[0]:null))?u.y=m+a/2-u.h/2:"bottom"===v?u.y=m+a-u.h:"stretch"===v&&(u.h=a),c.layoutRect(u),h+=s+b,c.recalc&&c.recalc();m+=a+y}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}}),Ki=Nt.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,t&&t()):u.setTimeout(function(){n.html(e)}),this}}),Zi=Nt.extend({init:function(e){this._super(e),this.classes.add("widget").add("infobox"),this.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl("body").firstChild.data=t.encode(e.value),t.state.get("rendered")&&t.updateLayoutRect()}),t.state.on("change:help",function(e){t.classes.toggle("has-help",e.value),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),Qi=Nt.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,t=e._super();return e.settings.multiline&&(we.getSize(e.getEl()).width>t.maxW&&(t.minW=t.maxW,e.classes.add("multiline")),e.getEl().style.width=t.minW+"px",t.startMinH=t.h=t.minH=Math.min(t.maxH,we.getSize(e.getEl()).height)),t},repaint:function(){return this.settings.multiline||(this.getEl().style.lineHeight=this.layoutRect().h+"px"),this._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e,t,n=this,i=n.settings.forId,r=n.settings.html?n.settings.html:n.encode(n.state.get("text"));return!i&&(t=n.settings.forName)&&(e=n.getRoot().find("#"+t)[0])&&(i=e._id),i?'<label id="'+n._id+'" class="'+n.classes+'"'+(i?' for="'+i+'"':"")+">"+r+"</label>":'<span id="'+n._id+'" class="'+n.classes+'">'+r+"</span>"},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.innerHtml(t.encode(e.value)),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),er=lt.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){this._super(e),this.classes.add("toolbar")},postRender:function(){return this.items().each(function(e){e.classes.add("toolbar-item")}),this._super()}}),tr=er.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}}),nr=jt.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(e){var t,n=this;if(n.menu&&n.menu.visible()&&!1!==e)return n.hideMenu();n.menu||(t=n.state.get("menu")||[],n.classes.add("opened"),t.length?t={type:"menu",animate:!0,items:t}:(t.type=t.type||"menu",t.animate=!0),t.renderTo?n.menu=t.parent(n).show().renderTo():n.menu=v.create(t).parent(n).renderTo(),n.fire("createmenu"),n.menu.reflow(),n.menu.on("cancel",function(e){e.control.parent()===n.menu&&(e.stopPropagation(),n.focus(),n.hideMenu())}),n.menu.on("select",function(){n.focus()}),n.menu.on("show hide",function(e){"hide"===e.type&&e.control.parent()===n&&n.classes.remove("opened-under"),e.control===n.menu&&(n.activeMenu("show"===e.type),n.classes.toggle("opened","show"===e.type)),n.aria("expanded","show"===e.type)}).fire("show")),n.menu.show(),n.menu.layoutRect({w:n.layoutRect().w}),n.menu.repaint(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]);var i=n.menu.layoutRect(),r=n.$el.offset().top+n.layoutRect().h;r>i.y&&r<i.y+i.h&&n.classes.add("opened-under"),n.fire("showmenu")},hideMenu:function(){this.menu&&(this.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),this.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e,t=this,n=t._id,i=t.classPrefix,r=t.settings.icon,o=t.state.get("text"),s="";return(e=t.settings.image)?(r="none","string"!=typeof e&&(e=_.window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o&&(t.classes.add("btn-has-text"),s='<span class="'+i+'txt">'+t.encode(o)+"</span>"),r=t.settings.icon?i+"ico "+i+"i-"+r:"",t.aria("role",t.parent()instanceof tr?"menuitem":"button"),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1" aria-labelledby="'+n+'"><button id="'+n+'-open" role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+e+"></i>":"")+s+' <i class="'+i+'caret"></i></button></div>'},postRender:function(){var r=this;return r.on("click",function(e){e.control===r&&function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}(e.target,r.getEl())&&(r.focus(),r.showMenu(!e.aria),e.aria&&r.menu.items().filter(":visible")[0].focus())}),r.on("mouseenter",function(e){var t,n=e.control,i=r.parent();n&&i&&n instanceof nr&&n.parent()===i&&(i.items().filter("MenuButton").each(function(e){e.hideMenu&&e!==n&&(e.menu&&e.menu.visible()&&(t=!0),e.hideMenu())}),t&&(n.focus(),n.showMenu()))}),r._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}}),ir=Ct.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var t=e.items,n=t.length;n--;)t[n]=w.extend({},e.itemDefaults,t[n]);this._super(e),this.classes.add("menu"),e.animate&&11!==ce.ie&&this.classes.add("animate")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){this.hideAll(),this.fire("select")},load:function(){var t,n=this;function i(){n.throbber&&(n.throbber.hide(),n.throbber=null)}n.settings.itemsFactory&&(n.throbber||(n.throbber=new Ht(n.getEl("body"),!0),0===n.items().length?(n.throbber.show(),n.fire("loading")):n.throbber.show(100,function(){n.items().remove(),n.fire("loading")}),n.on("hide close",i)),n.requestTime=t=(new Date).getTime(),n.settings.itemsFactory(function(e){0!==e.length?n.requestTime===t&&(n.getEl().style.width="",n.getEl("body").style.width="",i(),n.items().remove(),n.getEl("body").innerHTML="",n.add(e),n.renderNew(),n.fire("loaded")):n.hide()}))},hideAll:function(){return this.find("menuitem").exec("hideMenu"),this._super()},preRender:function(){var n=this;return n.items().each(function(e){var t=e.settings;if(t.icon||t.image||t.selectable)return!(n._hasIcons=!0)}),n.settings.itemsFactory&&n.on("postrender",function(){n.settings.itemsFactory&&n.load()}),n.on("show hide",function(e){e.control===n&&("show"===e.type?u.setTimeout(function(){n.classes.add("in")},0):n.classes.remove("in"))}),n._super()}}),rr=nr.extend({init:function(i){var t,r,o,n,s=this;s._super(i),i=s.settings,s._values=t=i.values,t&&("undefined"!=typeof i.value&&function e(t){for(var n=0;n<t.length;n++){if(r=t[n].selected||i.value===t[n].value)return o=o||t[n].text,s.state.set("value",t[n].value),!0;if(t[n].menu&&e(t[n].menu))return!0}}(t),!r&&0<t.length&&(o=t[0].text,s.state.set("value",t[0].value)),s.state.set("menu",t)),s.state.set("text",i.text||o),s.classes.add("listbox"),s.on("select",function(e){var t=e.control;n&&(e.lastControl=n),i.multiple?t.active(!t.active()):s.value(e.control.value()),n=t})},value:function(n){return 0===arguments.length?this.state.get("value"):(void 0===n||(this.settings.values&&!function t(e){return J(e,function(e){return e.menu?t(e.menu):e.value===n})}(this.settings.values)?null===n&&this.state.set("value",null):this.state.set("value",n)),this)},bindStates:function(){var i=this;return i.on("show",function(e){var t,n;t=e.control,n=i.value(),t instanceof ir&&t.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}),i.state.on("change:value",function(t){var n=function e(t,n){var i;if(t)for(var r=0;r<t.length;r++){if(t[r].value===n)return t[r];if(t[r].menu&&(i=e(t[r].menu,n)))return i}}(i.state.get("menu"),t.value);n?i.text(n.text):i.text(i.settings.text)}),i._super()}}),or=Nt.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t,n=this;n._super(e),e=n.settings,n.classes.add("menu-item"),e.menu&&n.classes.add("menu-item-expand"),e.preview&&n.classes.add("menu-item-preview"),"-"!==(t=n.state.get("text"))&&"|"!==t||(n.classes.add("menu-item-sep"),n.aria("role","separator"),n.state.set("text","-")),e.selectable&&(n.aria("role","menuitemcheckbox"),n.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||n.classes.add("menu-item-normal"),n.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&n.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var t,n=this,e=n.settings,i=n.parent();if(i.items().each(function(e){e!==n&&e.hideMenu()}),e.menu){(t=n.menu)?t.show():((t=e.menu).length?t={type:"menu",items:t}:t.type=t.type||"menu",i.settings.itemDefaults&&(t.itemDefaults=i.settings.itemDefaults),(t=n.menu=v.create(t).parent(n).renderTo()).reflow(),t.on("cancel",function(e){e.stopPropagation(),n.focus(),t.hide()}),t.on("show hide",function(e){e.control.items&&e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),t.on("hide",function(e){e.control===t&&n.classes.remove("selected")}),t.submenu=!0),t._parentMenu=i,t.classes.add("menu-sub");var r=t.testMoveRel(n.getEl(),n.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);t.moveRel(n.getEl(),r),r="menu-sub-"+(t.rel=r),t.classes.remove(t._lastRel).add(r),t._lastRel=r,n.classes.add("selected"),n.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){var e,t=this,n=t._id,i=t.settings,r=t.classPrefix,o=t.state.get("text"),s=t.settings.icon,a="",l=i.shortcut,u=t.encode(i.url);function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(e){var t=i.match||"";return t?e.replace(new RegExp(c(t),"gi"),function(e){return"!mce~match["+e+"]mce~match!"}):e}function f(e){return e.replace(new RegExp(c("!mce~match["),"g"),"<b>").replace(new RegExp(c("]mce~match!"),"g"),"</b>")}return s&&t.parent().classes.add("menu-has-icons"),i.image&&(a=" style=\"background-image: url('"+i.image+"')\""),l&&(l=function(e){var t,n,i={};for(i=ce.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)(n=i[e[t].toLowerCase()])&&(e[t]=n);return e.join("+")}(l)),s=r+"ico "+r+"i-"+(t.settings.icon||"none"),e="-"!==o?'<i class="'+s+'"'+a+"></i>\xa0":"",o=f(t.encode(d(o))),u=f(t.encode(d(u))),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1">'+e+("-"!==o?'<span id="'+n+'-text" class="'+r+'text">'+o+"</span>":"")+(l?'<div id="'+n+'-shortcut" class="'+r+'menu-shortcut">'+l+"</div>":"")+(i.menu?'<div class="'+r+'caret"></div>':"")+(u?'<div class="'+r+'menu-item-link">'+u+"</div>":"")+"</div>"},postRender:function(){var t=this,n=t.settings,e=n.textStyle;if("function"==typeof e&&(e=e.call(this)),e){var i=t.getEl("text");i&&(i.setAttribute("style",e),t._textStyle=e)}return t.on("mouseenter click",function(e){e.control===t&&(n.menu||"click"!==e.type?(t.showMenu(),e.aria&&t.menu.focus(!0)):(t.fire("select"),u.requestAnimationFrame(function(){t.parent().hideAll()})))}),t._super(),t},hover:function(){return this.parent().items().each(function(e){e.classes.remove("selected")}),this.classes.toggle("selected",!0),this},active:function(e){return function(e,t){var n=e._textStyle;if(n){var i=e.getEl("text");i.setAttribute("style",n),t&&(i.style.color="",i.style.backgroundColor="")}}(this,e),void 0!==e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}}),sr=Kt.extend({Defaults:{classes:"radio",role:"radio"}}),ar=Nt.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"===e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var t=this;t._super(),t.resizeDragHelper=new ct(this._id,{start:function(){t.fire("ResizeStart")},drag:function(e){"both"!==t.settings.direction&&(e.deltaX=0),t.fire("Resize",e)},stop:function(){t.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}});function lr(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}var ur=Nt.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var n=this;n._super(e),n.settings.size&&(n.size=n.settings.size),n.settings.options&&(n._options=n.settings.options),n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e,t=this,n="";return e=lr(t._options),t.size&&(n=' size = "'+t.size+'"'),'<select id="'+t._id+'" class="'+t.classes+'"'+n+">"+e+"</select>"},bindStates:function(){var t=this;return t.state.on("change:options",function(e){t.getEl().innerHTML=lr(e.value)}),t._super()}});function cr(e,t,n){return e<t&&(e=t),n<e&&(e=n),e}function dr(e,t,n){e.setAttribute("aria-"+t,n)}function fr(e,t){var n,i,r,o,s;"v"===e.settings.orientation?(r="top",i="height",n="h"):(r="left",i="width",n="w"),s=e.getEl("handle"),o=((e.layoutRect()[n]||100)-we.getSize(s)[i])*((t-e._minValue)/(e._maxValue-e._minValue))+"px",s.style[r]=o,s.style.height=e.layoutRect().h+"px",dr(s,"valuenow",t),dr(s,"valuetext",""+e.settings.previewFilter(t)),dr(s,"valuemin",e._minValue),dr(s,"valuemax",e._maxValue)}var hr=Nt.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"===e.orientation&&t.classes.add("vertical"),t._minValue=$(e.minValue)?e.minValue:0,t._maxValue=$(e.maxValue)?e.maxValue:100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div id="'+e+'-handle" class="'+t+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var e,t,n,i,r,o,s,a,l,u,c,d,f,h,m=this;e=m._minValue,t=m._maxValue,"v"===m.settings.orientation?(n="screenY",i="top",r="height",o="h"):(n="screenX",i="left",r="width",o="w"),m._super(),function(o,s){function t(e){var t,n,i,r;t=cr(t=(((t=m.value())+(r=n=o))/((i=s)-r)+.05*e)*(i-n)-n,o,s),m.value(t),m.fire("dragstart",{value:t}),m.fire("drag",{value:t}),m.fire("dragend",{value:t})}m.on("keydown",function(e){switch(e.keyCode){case 37:case 38:t(-1);break;case 39:case 40:t(1)}})}(e,t),s=e,a=t,l=m.getEl("handle"),m._dragHelper=new ct(m._id,{handle:m._id+"-handle",start:function(e){u=e[n],c=parseInt(m.getEl("handle").style[i],10),d=(m.layoutRect()[o]||100)-we.getSize(l)[r],m.fire("dragstart",{value:h})},drag:function(e){var t=e[n]-u;f=cr(c+t,0,d),l.style[i]=f+"px",h=s+f/d*(a-s),m.value(h),m.tooltip().text(""+m.settings.previewFilter(h)).show().moveRel(l,"bc tc"),m.fire("drag",{value:h})},stop:function(){m.tooltip().hide(),m.fire("dragend",{value:h})}})},repaint:function(){this._super(),fr(this,this.value())},bindStates:function(){var t=this;return t.state.on("change:value",function(e){fr(t,e.value)}),t._super()}}),mr=Nt.extend({renderHtml:function(){return this.classes.add("spacer"),this.canFocus=!1,'<div id="'+this._id+'" class="'+this.classes+'"></div>'}}),gr=nr.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e,t,n=this.getEl(),i=this.layoutRect();return this._super(),e=n.firstChild,t=n.lastChild,ye(e).css({width:i.w-we.getSize(t).width,height:i.h-2}),ye(t).css({height:i.h-2}),this},activeMenu:function(e){ye(this.getEl().lastChild).toggleClass(this.classPrefix+"active",e)},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a=n.settings,l="";return(e=a.image)?(o="none","string"!=typeof e&&(e=_.window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o=a.icon?r+"ico "+r+"i-"+o:"",s&&(n.classes.add("btn-has-text"),l='<span class="'+r+'txt">'+n.encode(s)+"</span>"),t="boolean"==typeof a.active?' aria-pressed="'+a.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" role="button"'+t+' tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+l+'</button><button type="button" class="'+r+'open" hidefocus="1" tabindex="-1">'+(n._menuBtnText?(o?"\xa0":"")+n._menuBtnText:"")+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var n=this.settings.onclick;return this.on("click",function(e){var t=e.target;if(e.control===this)for(;t;){if(e.aria&&"down"!==e.aria.key||"BUTTON"===t.nodeName&&-1===t.className.indexOf("open"))return e.stopImmediatePropagation(),void(n&&n.call(this,e));t=t.parentNode}}),delete this.settings.onclick,this._super()}}),pr=xi.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}}),vr=pt.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(n){var e;this.activeTabId&&(e=this.getEl(this.activeTabId),ye(e).removeClass(this.classPrefix+"active"),e.setAttribute("aria-selected","false")),this.activeTabId="t"+n,(e=this.getEl("t"+n)).setAttribute("aria-selected","true"),ye(e).addClass(this.classPrefix+"active"),this.items()[n].show().fire("showtab"),this.reflow(),this.items().each(function(e,t){n!==t&&e.hide()})},renderHtml:function(){var i=this,e=i._layout,r="",o=i.classPrefix;return i.preRender(),e.preRender(i),i.items().each(function(e,t){var n=i._id+"-t"+t;e.aria("role","tabpanel"),e.aria("labelledby",n),r+='<div id="'+n+'" class="'+o+'tab" unselectable="on" role="tab" aria-controls="'+e._id+'" aria-selected="false" tabIndex="-1">'+i.encode(e.settings.title)+"</div>"}),'<div id="'+i._id+'" class="'+i.classes+'" hidefocus="1" tabindex="-1"><div id="'+i._id+'-head" class="'+o+'tabs" role="tablist">'+r+'</div><div id="'+i._id+'-body" class="'+i.bodyClasses+'">'+e.renderHtml(i)+"</div></div>"},postRender:function(){var i=this;i._super(),i.settings.activeTab=i.settings.activeTab||0,i.activateTab(i.settings.activeTab),this.on("click",function(e){var t=e.target.parentNode;if(t&&t.id===i._id+"-head")for(var n=t.childNodes.length;n--;)t.childNodes[n]===e.target&&i.activateTab(n)})},initLayoutRect:function(){var e,t,n,i=this;t=(t=we.getSize(i.getEl("head")).width)<0?0:t,n=0,i.items().each(function(e){t=Math.max(t,e.layoutRect().minW),n=Math.max(n,e.layoutRect().minH)}),i.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=t,e.settings.h=n,e.layoutRect({x:0,y:0,w:t,h:n})});var r=we.getSize(i.getEl("head")).height;return i.settings.minWidth=t,i.settings.minHeight=n+r,(e=i._super()).deltaH+=r,e.innerH=e.h-e.deltaH,e}}),br=Nt.extend({init:function(e){var n=this;n._super(e),n.classes.add("textbox"),e.multiline?n.classes.add("multiline"):(n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))}),n.on("keyup",function(e){n.state.set("value",e.target.value)}))},repaint:function(){var e,t,n,i,r,o=this,s=0;e=o.getEl().style,t=o._layoutRect,r=o._lastRepaintRect||{};var a=_.document;return!o.settings.multiline&&a.all&&(!a.documentMode||a.documentMode<=8)&&(e.lineHeight=t.h-s+"px"),i=(n=o.borderBox).left+n.right+8,s=n.top+n.bottom+(o.settings.multiline?8:0),t.x!==r.x&&(e.left=t.x+"px",r.x=t.x),t.y!==r.y&&(e.top=t.y+"px",r.y=t.y),t.w!==r.w&&(e.width=t.w-i+"px",r.w=t.w),t.h!==r.h&&(e.height=t.h-s+"px",r.h=t.h),o._lastRepaintRect=r,o.fire("repaint",{},!1),o},renderHtml:function(){var t,e,n=this,i=n.settings;return t={id:n._id,hidefocus:"1"},w.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){t[e]=i[e]}),n.disabled()&&(t.disabled="disabled"),i.subtype&&(t.type=i.subtype),(e=we.create(i.multiline?"textarea":"input",t)).value=n.state.get("value"),e.className=n.classes.toString(),e.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var t=this;t.getEl().value=t.state.get("value"),t._super(),t.$el.on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)})},bindStates:function(){var t=this;return t.state.on("change:value",function(e){t.getEl().value!==e.value&&(t.getEl().value=e.value)}),t.state.on("change:disabled",function(e){t.getEl().disabled=e.value}),t._super()},remove:function(){this.$el.off(),this._super()}}),yr=function(){return{Selector:Ie,Collection:Ve,ReflowQueue:Ke,Control:rt,Factory:v,KeyboardNavigation:st,Container:lt,DragHelper:ct,Scrollable:gt,Panel:pt,Movable:He,Resizable:vt,FloatPanel:Ct,Window:It,MessageBox:Yt,Tooltip:Mt,Widget:Nt,Progress:Pt,Notification:Dt,Layout:qt,AbsoluteLayout:Xt,Button:jt,ButtonGroup:Gt,Checkbox:Kt,ComboBox:Qt,ColorBox:en,PanelButton:tn,ColorButton:rn,ColorPicker:sn,Path:ln,ElementPath:un,FormItem:cn,Form:dn,FieldSet:fn,FilePicker:vi,FitLayout:bi,FlexLayout:yi,FlowLayout:xi,FormatControls:Ji,GridLayout:Gi,Iframe:Ki,InfoBox:Zi,Label:Qi,Toolbar:er,MenuBar:tr,MenuButton:nr,MenuItem:or,Throbber:Ht,Menu:ir,ListBox:rr,Radio:sr,ResizeHandle:ar,SelectBox:ur,Slider:hr,Spacer:mr,SplitButton:gr,StackLayout:pr,TabPanel:vr,TextBox:br,DropZone:an,BrowseButton:Jt}},xr=function(n){n.ui?w.each(yr(),function(e,t){n.ui[t]=e}):n.ui=yr()};w.each(yr(),function(e,t){v.add(t,e)}),xr(window.tinymce?window.tinymce:{}),r.add("modern",function(e){return Ji.setup(e),$t(e)})}(window);
|