hoodcms 5.0.11 → 5.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/js/app.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * hoodcms v5.0.11
2
+ * hoodcms v5.0.15
3
3
  * A fully customisable content management system built in ASP.NET Core 5 & Bootstrap 5.
4
- * Written by George Whysall, 2021
4
+ * Written by George Whysall, 2022
5
5
  * Released under the GPL-3.0 License.
6
6
  */
7
- (function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('sweetalert2'),require('@simonwep/pickr'),require('tinymce/tinymce'),require('bootstrap')):typeof define==='function'&&define.amd?define(['exports','sweetalert2','@simonwep/pickr','tinymce/tinymce','bootstrap'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.hood={},g.Swal,g.Pickr,g.tinymce,g.bootstrap));})(this,(function(exports,Swal,Pickr,tinymce,bootstrap){'use strict';function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var Swal__default=/*#__PURE__*/_interopDefaultLegacy(Swal);var Pickr__default=/*#__PURE__*/_interopDefaultLegacy(Pickr);var tinymce__default=/*#__PURE__*/_interopDefaultLegacy(tinymce);/*! *****************************************************************************
7
+ (function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports,require('sweetalert2'),require('bootstrap')):typeof define==='function'&&define.amd?define(['exports','sweetalert2','bootstrap'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.hood={},g.Swal));})(this,(function(exports,Swal){'use strict';function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var Swal__default=/*#__PURE__*/_interopDefaultLegacy(Swal);/*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
9
9
 
10
10
  Permission to use, copy, modify, and/or distribute this software for any
@@ -18,6 +18,12 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
18
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
19
  PERFORMANCE OF THIS SOFTWARE.
20
20
  ***************************************************************************** */
21
- var extendStatics=function(t,e){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);},extendStatics(t,e)};function __extends(t,e){function r(){this.constructor=t;}extendStatics(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r);}var __assign=function(){return __assign=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},__assign.apply(this,arguments)};"function"!=typeof Object.create&&(Object.create=function(t){function o(){}return o.prototype=t,new o}),function(t,o,i,s){var n={_positionClasses:["bottom-left","bottom-right","top-right","top-left","bottom-center","top-center","mid-center"],_defaultIcons:["success","error","info","warning"],init:function(o,i){this.prepareOptions(o,t.toast.options),this.process();},prepareOptions:function(o,i){var s={};"string"==typeof o||o instanceof Array?s.text=o:s=o,this.options=t.extend({},i,s);},process:function(){this.setup(),this.addToDom(),this.position(),this.bindToast(),this.animate();},setup:function(){var o="";if(this._toastEl=this._toastEl||t("<div></div>",{class:"jq-toast-single"}),o+='<span class="jq-toast-loader"></span>',this.options.allowToastClose&&(o+='<span class="close-jq-toast-single">&times;</span>'),this.options.text instanceof Array){this.options.heading&&(o+='<h2 class="jq-toast-heading">'+this.options.heading+"</h2>"),o+='<ul class="jq-toast-ul">';for(var i=0;i<this.options.text.length;i++)o+='<li class="jq-toast-li" id="jq-toast-item-'+i+'">'+this.options.text[i]+"</li>";o+="</ul>";}else this.options.heading&&(o+='<h2 class="jq-toast-heading">'+this.options.heading+"</h2>"),o+=this.options.text;this._toastEl.html(o),!1!==this.options.bgColor&&this._toastEl.css("background-color",this.options.bgColor),!1!==this.options.textColor&&this._toastEl.css("color",this.options.textColor),this.options.textAlign&&this._toastEl.css("text-align",this.options.textAlign),!1!==this.options.icon&&(this._toastEl.addClass("jq-has-icon"),-1!==t.inArray(this.options.icon,this._defaultIcons)&&this._toastEl.addClass("jq-icon-"+this.options.icon)),!1!==this.options.class&&this._toastEl.addClass(this.options.class);},position:function(){"string"==typeof this.options.position&&-1!==t.inArray(this.options.position,this._positionClasses)?"bottom-center"===this.options.position?this._container.css({left:t(o).outerWidth()/2-this._container.outerWidth()/2,bottom:20}):"top-center"===this.options.position?this._container.css({left:t(o).outerWidth()/2-this._container.outerWidth()/2,top:20}):"mid-center"===this.options.position?this._container.css({left:t(o).outerWidth()/2-this._container.outerWidth()/2,top:t(o).outerHeight()/2-this._container.outerHeight()/2}):this._container.addClass(this.options.position):"object"==typeof this.options.position?this._container.css({top:this.options.position.top?this.options.position.top:"auto",bottom:this.options.position.bottom?this.options.position.bottom:"auto",left:this.options.position.left?this.options.position.left:"auto",right:this.options.position.right?this.options.position.right:"auto"}):this._container.addClass("bottom-left");},bindToast:function(){var t=this;this._toastEl.on("afterShown",(function(){t.processLoader();})),this._toastEl.find(".close-jq-toast-single").on("click",(function(o){o.preventDefault(),"fade"===t.options.showHideTransition?(t._toastEl.trigger("beforeHide"),t._toastEl.fadeOut((function(){t._toastEl.trigger("afterHidden");}))):"slide"===t.options.showHideTransition?(t._toastEl.trigger("beforeHide"),t._toastEl.slideUp((function(){t._toastEl.trigger("afterHidden");}))):(t._toastEl.trigger("beforeHide"),t._toastEl.hide((function(){t._toastEl.trigger("afterHidden");})));})),"function"==typeof this.options.beforeShow&&this._toastEl.on("beforeShow",(function(){t.options.beforeShow();})),"function"==typeof this.options.afterShown&&this._toastEl.on("afterShown",(function(){t.options.afterShown();})),"function"==typeof this.options.beforeHide&&this._toastEl.on("beforeHide",(function(){t.options.beforeHide();})),"function"==typeof this.options.afterHidden&&this._toastEl.on("afterHidden",(function(){t.options.afterHidden();}));},addToDom:function(){var o=t(".jq-toast-wrap");if(0===o.length?(o=t("<div></div>",{class:"jq-toast-wrap"}),t("body").append(o)):(!this.options.stack||isNaN(parseInt(this.options.stack,10)))&&o.empty(),o.find(".jq-toast-single:hidden").remove(),o.append(this._toastEl),this.options.stack&&!isNaN(parseInt(this.options.stack),10)){var i=o.find(".jq-toast-single").length-this.options.stack;i>0&&t(".jq-toast-wrap").find(".jq-toast-single").slice(0,i).remove();}this._container=o;},canAutoHide:function(){return !1!==this.options.hideAfter&&!isNaN(parseInt(this.options.hideAfter,10))},processLoader:function(){if(!this.canAutoHide()||!1===this.options.loader)return !1;var t=this._toastEl.find(".jq-toast-loader"),o=(this.options.hideAfter-400)/1e3+"s",i=this.options.loaderBg,s=t.attr("style")||"";s=s.substring(0,s.indexOf("-webkit-transition")),s+="-webkit-transition: width "+o+" ease-in; -o-transition: width "+o+" ease-in; transition: width "+o+" ease-in; background-color: "+i+";",t.attr("style",s).addClass("jq-toast-loaded");},animate:function(){var t=this;if(this._toastEl.hide(),this._toastEl.trigger("beforeShow"),"fade"===this.options.showHideTransition.toLowerCase()?this._toastEl.fadeIn((function(){t._toastEl.trigger("afterShown");})):"slide"===this.options.showHideTransition.toLowerCase()?this._toastEl.slideDown((function(){t._toastEl.trigger("afterShown");})):this._toastEl.show((function(){t._toastEl.trigger("afterShown");})),this.canAutoHide()){t=this;o.setTimeout((function(){"fade"===t.options.showHideTransition.toLowerCase()?(t._toastEl.trigger("beforeHide"),t._toastEl.fadeOut((function(){t._toastEl.trigger("afterHidden");}))):"slide"===t.options.showHideTransition.toLowerCase()?(t._toastEl.trigger("beforeHide"),t._toastEl.slideUp((function(){t._toastEl.trigger("afterHidden");}))):(t._toastEl.trigger("beforeHide"),t._toastEl.hide((function(){t._toastEl.trigger("afterHidden");})));}),this.options.hideAfter);}},reset:function(o){"all"===o?t(".jq-toast-wrap").remove():this._toastEl.remove();},update:function(t){this.prepareOptions(t,this.options),this.setup(),this.bindToast();}};t.toast=function(t){var o=Object.create(n);return o.init(t,this),{reset:function(t){o.reset(t);},update:function(t){o.update(t);}}},t.toast.options={text:"",heading:"",showHideTransition:"fade",allowToastClose:!0,hideAfter:3e3,loader:!0,loaderBg:"#9EC600",stack:5,position:"bottom-left",bgColor:!1,textColor:!1,textAlign:"left",icon:!1,beforeShow:function(){},afterShown:function(){},beforeHide:function(){},afterHidden:function(){}};}(jQuery,window);var BootstrapSwal=Swal__default["default"].mixin({customClass:{confirmButton:"btn btn-success m-1 px-3",cancelButton:"btn btn-danger m-1 px-3"},buttonsStyling:!1}),Alerts=function(){function o(){}return o.log=function(o,t){if(void 0===t&&(t="message"),document.body.classList.contains("dev-mode"))switch(t){case"error":console.error(o);break;case"message":console.log(o);break;case"warning":console.warn(o);break;case"info":console.info(o);}},o.error=function(o,t,e){void 0===t&&(t=null),void 0===e&&(e=null),$.toast({heading:t,text:o,icon:"error",position:"bottom-left",loader:!1,bgColor:"#d0100b",textColor:"white",hideAfter:e});},o.warning=function(o,t,e){void 0===t&&(t=null),void 0===e&&(e=null),$.toast({heading:t,text:o,icon:"error",position:"bottom-left",loader:!1,bgColor:"#ef9007",textColor:"white",hideAfter:e});},o.message=function(o,t,e){void 0===t&&(t=null),void 0===e&&(e=null),$.toast({heading:t,text:o,icon:"error",position:"bottom-left",loader:!1,bgColor:"#222222",textColor:"white",hideAfter:e});},o.success=function(o,t,e){void 0===t&&(t=null),void 0===e&&(e=null),$.toast({heading:t,text:o,icon:"error",position:"bottom-left",loader:!1,bgColor:"#28a745",textColor:"white",hideAfter:e});},o.alert=function(t,e,n,i){switch(void 0===e&&(e=null),void 0===n&&(n="info"),void 0===i&&(i=1e4),n){case"error":o.error(t,e,i);break;case"warning":o.warning(t,e,i);break;case"info":o.message(t,e,i);break;case"success":o.success(t,e,i);}},o.sweetAlert=function(o,t){BootstrapSwal.fire(o).then((function(o){t(o);}));},o.confirm=function(t,e){o.sweetAlert(__assign(__assign({},{showCancelButton:!0,footer:null,title:"Are you sure?",html:"Are you sure you want to do this?",confirmButtonText:"Ok",cancelButtonText:"Cancel"}),t),e);},o.prompt=function(t,e){o.sweetAlert(__assign(__assign({},{input:"text",inputAttributes:{autocapitalize:"off"},showCancelButton:!0,icon:"info",footer:'<span class="text-warning"><i class="fa fa-exclamation-triangle"></i> This cannot be undone.</span>',confirmButtonText:"Ok",cancelButtonText:"Cancel"}),t),e);},o.prototype.log=function(t,e){void 0===e&&(e="message"),o.log(t,e);},o.prototype.error=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null),o.error(t,e,n);},o.prototype.warning=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null),o.warning(t,e,n);},o.prototype.message=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null),o.message(t,e,n);},o.prototype.success=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null),o.success(t,e,n);},o.prototype.alert=function(t,e,n,i){void 0===n&&(n="info"),void 0===i&&(i=1e4),o.alert(t,t,n,i);},o.prototype.sweetAlert=function(t,e){o.sweetAlert(t,e);},o.prototype.confirm=function(t,e){o.confirm(t,e);},o.prototype.prompt=function(t,e){o.prompt(t,e);},o}();var ColorPickers=function(){function t(){}return t.prototype.loadColorPickers=function(t){void 0===t&&(t=".color-picker");var o=function(t,o,r){var n=$(r._root.button).parent().data("target");$(r._root.button).parent().css({"background-color":t.toHEXA().toString()});for(var a=r.getColor().toHEXA(),e="",i=a.length-1;i>=0;i--)e=a[i]+e;$(n).val("#"+e),$(n).change();};$(t).each((function(t,n){var a=!0;"true"==$(this).data("opacity")&&(a=!1);Pickr__default["default"].create({el:n.children[0],appClass:"custom-class",theme:"monolith",useAsButton:!0,default:$(this).data("default")||"none",lockOpacity:a,defaultRepresentation:"HEXA",position:"bottom-end",components:{opacity:!0,hue:!0,interaction:{hex:!1,rgba:!1,hsva:!1,input:!0,clear:!0}}}).on("init",(function(t){var r=$(t._root.button).parent().data("target"),n=$(r).val();$(t._root.button).parent().on("click",$.proxy((function(){this.show();}),t)),$(r).on("click",$.proxy((function(){this.show();}),t)),n&&(t.setColor(n),o(t.getColor(),0,t));})).on("clear",(function(t){var r=$(t._root.button).parent().data("target");t.setColor("transparent"),o(t.getColor(),0,t),$(r).val(""),$(r).change();})).on("change",o);}));},t}();var Response=function(){function e(){}return e.process=function(e,s){void 0===s&&(s=5e3),e.success?Alerts.success(e.message,e.title,s):Alerts.error(e.errors,e.title,s);},e}();var Inline=function(){function o(){}return o.load=function(n,r){var t,e=$(n);e.addClass("loading"),r.onLoad&&r.onLoad(n);var l=e.data("url");$.get(l,(function(o){r.onRender&&(o=r.onRender(o,n)),e.html(o),e.removeClass("loading"),r.onComplete&&r.onComplete(o,n);})).fail(null!==(t=r.onError)&&void 0!==t?t:o.handleError);},o.task=function(n,r,t,e){void 0===t&&(t=null),void 0===e&&(e=null),r&&r.classList.add("loading"),$.get(n,(function(o){r&&r.classList.remove("loading"),t&&t(o,r);})).fail(null!=e?e:o.handleError);},o.post=function(n,r,t,e){void 0===t&&(t=null),void 0===e&&(e=null),r&&r.classList.add("loading"),$.post(n,(function(o){r&&r.classList.remove("loading"),t&&t(o,r);})).fail(null!=e?e:o.handleError);},o.handleError=function(o,n,r){500===o.status?Alerts.error("There was an error processing the content, please contact an administrator if this continues.","Error "+o.status,1e4):404===o.status?Alerts.error("The content could not be found.","Error "+o.status,1e4):401===o.status&&(Alerts.error("You are not allowed to view this resource, are you logged in correctly?","Error "+o.status,1e4),window.location=window.location);},o}();var DataList=function(){function e(e,t){if(this.element=e,this.element.hoodDataList=this,void 0!==e&&null!=e){if(this.options=__assign(__assign({},this.options),t),$(this.element).hasClass("query")){var n=$(this.element).data("url")+window.location.search;$(this.element).attr("data-url",n),$(this.element).data("url",n);}if(!$(this.element).hasClass("refresh-only")){var i=document.createElement("a");i.href=$(this.element).data("url"),this.reload(new URL(i.href));}$(this.element).on("click",".pagination a, a.hood-inline-list-target",function(e){e.preventDefault();var t=document.createElement("a");t.href=e.currentTarget.href;var n=document.createElement("a");n.href=$(this.element).data("url"),n.search=t.search,this.reload(new URL(n.href));}.bind(this)),$("body").on("submit",'form.inline[data-target="#'.concat(this.element.id,'"]'),function(e){e.preventDefault();var t=$(e.currentTarget),n=document.createElement("a");n.href=$(this.element).data("url"),n.search="?"+t.serialize(),this.reload(new URL(n.href));}.bind(this));}else Alerts.log("Could not DataList to element, element does not exist.","error");}return e.prototype.reload=function(e){if(void 0===e&&(e=null),e){if(history.pushState&&$(this.element).hasClass("query")){var t=window.location.protocol+"//"+window.location.host+window.location.pathname+(e.href.contains("?")?"?"+e.href.substring(e.href.indexOf("?")+1):"");window.history.pushState({path:t},"",t);}$(this.element).data("url",e);}Inline.load(this.element,__assign({},this.options));},e}();
22
- var ModalController=function(){function t(t){void 0===t&&(t=null),this.isOpen=!1,this.options={closePrevious:!0},this.options=__assign(__assign({},this.options),t);}return t.prototype.show=function(t,o){this.options.onLoad&&this.options.onLoad(this.element),this.isOpen||(this.isOpen=!0,$.get(t,function(t){this.modal&&this.options.closePrevious&&this.close(),this.options.onRender&&(t=this.options.onRender(this.element,t)),this.element=this.createElementFromHTML(t),this.element.classList.add("hood-inline-modal"),$("body").append(this.element),this.modal=new bootstrap.Modal(this.element,{}),this.modal.show(),this.element.addEventListener("shown.bs.modal",function(){$(document).off("focusin.modal");}.bind(this)),this.element.addEventListener("hidden.bs.modal",function(){this.options.onHidden&&this.options.onHidden(this.element),this.dispose(),this.isOpen=!1;}.bind(this)),this.options.onComplete&&this.options.onComplete(this.element);}.bind(this)).fail(function(t,o,i){this.isOpen=!1,this.options.onError&&this.options.onError(t,o,i),Inline.handleError(t,o,i);}.bind(this)));},t.prototype.close=function(){this.modal&&this.modal.hide();},t.prototype.dispose=function(){this.modal.dispose(),this.element.remove();},t.prototype.createElementFromHTML=function(t){var o=document.createElement("div");return o.innerHTML=t.trim(),o.firstChild},t}();var Validator=function(){function t(t,i){if(this.options={errorAlert:"There are errors, please check the form.",useAjax:!0},this.element=t,this.element){this.options.serializationFunction=function(){return $(this.element).serialize()}.bind(this),this.options=__assign(__assign({},this.options),i),this.element.addEventListener("submit",function(t){t.preventDefault(),t.stopImmediatePropagation(),this.submitForm();}.bind(this));var e='[data-submit="#'+this.element.id+'"]',n=$(e);n&&n.on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),$(t.currentTarget).data("exit")&&($(this.element).find("input#exit").remove(),$("<input id='exit' />").attr("type","hidden").attr("name","exit").attr("value","true").appendTo(this.element)),this.submitForm();}.bind(this));}}return t.prototype.submitForm=function(){var t;if(this.element.classList.add("was-validated"),this.element.checkValidity()){this.element.classList.add("loading");var i=this.element.querySelector("input[type=checkbox]");if(i&&Array.prototype.slice.call(i).forEach((function(t){$(this).is(":checked")&&$(this).val("true");})),this.options.onSubmit&&this.options.onSubmit(this),this.options.useAjax){var e=this.options.serializationFunction();$.post(this.element.action,e,function(t){this.options.onComplete&&this.options.onComplete(t,this);}.bind(this)).fail(null!==(t=this.options.onError)&&void 0!==t?t:Inline.handleError);}else this.element.submit();}else this.options.errorAlert&&Alerts.error(this.options.errorAlert,null,5e3);},t}();var MediaService=function(){function e(e,t){this.options={action:"show",size:"large"},this.galleryInitialised=!1,this.selectedMedia=new Array,this.element=e,this.element&&(this.options=__assign(__assign({},this.options),t),$("body").off("click",".media-delete",this.delete.bind(this)),$("body").on("click",".media-delete",this.delete.bind(this)),$(this.element).on("click",".media-item",this.action.bind(this)),$(this.element).on("click",".media-create-directory",this.createDirectory.bind(this)),$(this.element).on("click",".media-delete-directory",this.deleteDirectory.bind(this)),this.media=new DataList(this.element,{onLoad:this.options.onListLoad,onError:this.options.onError,onRender:this.options.onListRender,onComplete:function(e,t){this.initUploader(),"gallery"!=this.options.action||this.galleryInitialised||($("#media-select-modal .modal-footer").removeClass("d-none"),$("#media-select-modal .modal-footer").on("click",this.galleryAdd.bind(this)),this.galleryInitialised=!0),this.options.onListComplete&&this.options.onListComplete(e,t);}.bind(this)}));}return e.prototype.initUploader=function(){if(this.uploadButton=document.getElementById("media-add"),this.uploader=document.getElementById("media-upload"),this.uploadButton&&this.uploader){this.progressArea=document.getElementById("media-progress"),this.progressText=$('<div class="progress-text text-muted mb-3"><i class="fa fa-info-circle me-2"></i>Uploading file <span></span>...</div>'),this.progress=$('<div class="progress"><div class= "progress-bar progress-bar-striped" role="progressbar" style="width:0%" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100" ></div></div>'),this.progressText.appendTo(this.progressArea),this.progress.appendTo(this.progressArea);var e=null;$("#media-upload").dropzone({url:$("#media-upload").data("url")+"?directoryId="+$("#media-list > #upload-directory-id").val(),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,paramName:"files",acceptedFiles:$("#media-upload").data("types")||".png,.jpg,.jpeg,.gif",autoProcessQueue:!0,previewsContainer:!1,clickable:"#media-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!",init:function(){e=this;}}),e.on("error",function(e,t){Alerts.warning(t);}.bind(this)),e.on("success",function(e,t){Response.process(t);}.bind(this)),e.on("addedfile",function(e){this.progress.find(".progress-bar").css({width:"0%"}),this.progressText.find("span").html("0%");}.bind(this)),e.on("totaluploadprogress",function(e,t,i){this.progress.find(".progress-bar").css({width:e+"%"}),this.progressText.find("span").html(Math.round(e)+"% - "+i.formatKilobytes()+" / "+t.formatKilobytes());}.bind(this)),e.on("sending",function(e){this.progressArea.classList.remove("collapse"),this.progress.find(".progress-bar").css({width:"0%"}),this.progressText.find("span").html("0%");}.bind(this)),e.on("complete",function(e){this.media.reload();}.bind(this)),e.on("queuecomplete",function(){this.progressArea.classList.add("collapse"),this.media.reload();}.bind(this));}},e.prototype.createDirectory=function(e){e.preventDefault(),e.stopPropagation();var t=new ModalController({onComplete:function(){var e=document.getElementById("content-directories-edit-form");new Validator(e,{onComplete:function(e){Response.process(e,5e3),e.success&&(this.media.reload(),t.close());}.bind(this)});}.bind(this)});t.show($(e.currentTarget).attr("href"),this.element);},e.prototype.deleteDirectory=function(e){e.preventDefault(),e.stopPropagation(),Alerts.confirm({},function(t){t.isConfirmed&&Inline.post(e.currentTarget.href,e.currentTarget,function(e,t){if(Response.process(e,5e3),e.data.length>0){var i=document.createElement("a");i.href=$(this.element).data("url"),i.search="?dir=".concat(e.data[0]),this.media.reload(new URL(i.href));}}.bind(this));}.bind(this));},e.prototype.uploadUrl=function(){return $("#media-upload").data("url")+"?directoryId="+$("#media-list > #upload-directory-id").val()},e.prototype.action=function(e){e.preventDefault(),e.stopPropagation();var t=$(e.currentTarget).data("json");switch(this.options.action){case"select":this.select(t,e);break;case"insert":this.insert(t,e);break;case"attach":this.attach(t,e);break;case"gallery":this.galleryClick(t,e);break;default:this.show(t,e);}},e.prototype.show=function(e,t){this.currentBlade=new ModalController,this.currentBlade.show($(t.target).data("blade"),t.target);},e.prototype.select=function(t,i){if(Alerts.log("[MediaService.select] Selecting media object id ".concat(t.id," - ").concat(t.filename," and inserting ").concat(this.options.size," url to target: ").concat(this.options.target)),this.options.target){var o=$(this.options.target);switch(this.options.size){case"thumb":o.val(t.thumbUrl);break;case"small":o.val(t.smallUrl);break;case"medium":o.val(t.mediumUrl);break;case"large":o.val(t.largeUrl);break;case"full":o.val(t.url);}}this.options.refresh&&e.refresh(t,this.options.refresh),this.options.onAction&&this.options.onAction(t);},e.prototype.insert=function(e,t){Alerts.log("[MediaService.insert] Selecting media object id ".concat(e.id," - ").concat(e.filename," and inserting ").concat(this.options.size," image to target editor: ").concat(this.options.target)),this.options.targetEditor.insertContent('<img alt="'+e.filename+'" src="'+e.url+'" class="img-fluid" />'),this.options.onAction&&this.options.onAction(e);},e.prototype.attach=function(t,i){Alerts.log("[MediaService.attach] Attaching media object id ".concat(t.id," - ").concat(t.filename," to url: ").concat(this.options.url)),$.post(this.options.url,{mediaId:t.id},function(i){Response.process(i,5e3),e.refresh(i.media,this.options.refresh),this.options.onAction&&this.options.onAction(t);}.bind(this));},e.prototype.galleryClick=function(e,t){this.isMediaSelected(e)?(Alerts.log("[MediaService.galleryClick] Removing media from selection - id ".concat(e.id," - ").concat(e.filename,".}")),this.selectedMedia=this.selectedMedia.filter((function(t){return t.id!==e.id})),$(t.currentTarget).parents(".media-item").removeClass("active")):(Alerts.log("[MediaService.galleryClick] Adding to selected media objects - id ".concat(e.id," - ").concat(e.filename,".")),this.selectedMedia.push(e),$(t.currentTarget).parents(".media-item").addClass("active"));},e.prototype.galleryAdd=function(e){e.preventDefault(),e.stopPropagation(),Alerts.log("[MediaService.galleryAdd] Adding ".concat(this.selectedMedia.length," selected media objects to url: ").concat(this.options.url));var t=this.selectedMedia.map((function(e){return e.id}));$.post(this.options.url,{media:t},function(e){Response.process(e),document.getElementById(this.options.target).hoodDataList.reload(),this.options.onAction&&this.options.onAction(e.media);}.bind(this));},e.prototype.isMediaSelected=function(e){var t=!1;return this.selectedMedia.forEach((function(i,o,s){i.id==e.id&&(t=!0);})),t},e.refresh=function(e,t){var i=e.icon;if("Image"===e.genericFileType&&(i=e.mediumUrl),t){var o=$(t);o.css({"background-image":"url("+i+")"}),o.find("img").attr("src",i),o.removeClass("loading");}},e.prototype.delete=function(e){e.preventDefault(),e.stopPropagation(),Alerts.confirm({html:"This file will be permanently deleted, are you sure?"},function(t){t.isConfirmed&&Inline.post(e.currentTarget.href,e.currentTarget,function(e){Response.process(e,5e3),this.media.reload(),this.currentBlade&&this.currentBlade.close();}.bind(this));}.bind(this));},e}();var MediaModal=function(){function e(){$("body").on("click","[data-hood-media=attach],[data-hood-media=select],[data-hood-media=gallery]",this.load.bind(this)),$("body").on("click","[data-hood-media=clear]",this.clear.bind(this)),$("[data-hood-media=gallery]").each(this.initGallery.bind(this));}return e.prototype.initGallery=function(e,t){var i=document.getElementById(t.dataset.hoodMediaTarget);i&&new DataList(i,{onComplete:function(e,t){Alerts.log("Finished loading gallery media list.","info");}.bind(this)});},e.prototype.load=function(e){e.preventDefault(),e.stopPropagation(),this.element=e.currentTarget,this.modal&&this.modal.isOpen||(this.modal=new ModalController({onComplete:function(e){this.list=document.getElementById("media-list"),this.service=new MediaService(this.list,{action:this.element.dataset.hoodMedia,url:this.element.dataset.hoodMediaUrl,refresh:this.element.dataset.hoodMediaRefresh,target:this.element.dataset.hoodMediaTarget,size:this.element.dataset.hoodMediaSize,beforeAction:function(e,t){}.bind(this),onAction:function(e,t){this.modal.close();}.bind(this),onListLoad:function(e){},onListRender:function(e){return e},onListComplete:function(e){},onError:function(e,t,i){}});}.bind(this)}),this.modal.show($(e.currentTarget).data("hood-media-list"),e.currentTarget));},e.prototype.clear=function(e){e.preventDefault(),e.stopPropagation(),Alerts.confirm({},function(t){t.isConfirmed&&Inline.post(e.currentTarget.href,e.currentTarget,function(t){Response.process(t,5e3),MediaService.refresh(t.media,e.currentTarget.dataset.hoodMediaRefresh);}.bind(this));}.bind(this));},e}();var Editors=function(){function e(e){this.options={linkClasses:[{title:"None",value:""},{title:"Button link",value:"btn btn-default"},{title:"Theme coloured button link",value:"btn btn-primary"},{title:"Popup image/video",value:"colorbox-iframe"},{title:"Button popup link",value:"btn btn-default colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary colorbox-iframe"},{title:"Large link",value:"font-lg"},{title:"Large button link",value:"btn btn-default btn-lg"},{title:"Large theme coloured button link",value:"btn btn-primary btn-lg"},{title:"Large popup image/video",value:"font-lg colorbox-iframe"},{title:"Large Button popup link",value:"btn btn-default btn-lg colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary btn-lg colorbox-iframe"}],imageClasses:[{title:"None",value:""},{title:"Full Width",value:"user-image full"},{title:"Left Aligned",value:"user-image left"},{title:"Centered",value:"user-image center"},{title:"Right Aligned",value:"user-image right"},{title:"Inline with text, top aligned",value:"user-image inline top"},{title:"Inline with text, middle aligned",value:"user-image inline"},{title:"Inline with text, bottom aligned",value:"user-image inline bottom"},{title:"Pulled Left",value:"user-image pull-left"},{title:"Pulled Right",value:"user-image pull-right"}]},this.options=__assign(__assign({},this.options),e);}return e.prototype.richTextEditors=function(){tinymce__default["default"].init({selector:".tinymce-full",height:150,menubar:!1,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste code textcolor"],toolbar:"fullscreen | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",link_class_list:this.options.linkClasses,image_class_list:this.options.imageClasses,setup:this.setupCommands.bind(this),image_dimensions:!1,content_css:["/dist/css/editor.css"]}),tinymce__default["default"].init({selector:".tinymce-simple",height:150,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste code"],menubar:!1,toolbar:"fullscreen | bold italic | bullist numlist | undo redo | link",link_class_list:this.options.linkClasses,image_class_list:this.options.imageClasses,setup:this.setupCommands.bind(this),image_dimensions:!1}),tinymce__default["default"].init({selector:".tinymce-full-content",height:500,menubar:!1,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste code textcolor"],toolbar:"fullscreen | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",link_class_list:this.options.linkClasses,image_class_list:this.options.imageClasses,setup:this.setupCommands.bind(this),image_dimensions:!1}),tinymce__default["default"].init({selector:".tinymce-simple-content",height:500,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste code"],menubar:!1,toolbar:"fullscreen | bold italic | bullist numlist | undo redo | link",link_class_list:this.options.linkClasses,image_class_list:this.options.imageClasses,image_dimensions:!1});},e.prototype.setupCommands=function(e){this.currentEditor=$("#"+e.id),this.currentEditor.data("hoodMediaList")&&e.addButton("hoodimage",{text:"Insert image...",icon:!1,onclick:function(t){this.mediaModal=new ModalController({onComplete:function(t){this.list=document.getElementById("media-list"),this.service=new MediaService(this.list,{action:"insert",url:this.currentEditor.data("hoodMediaList"),targetEditor:e,size:this.currentEditor.data("hoodMediaSize"),beforeAction:function(e,t){}.bind(this),onAction:function(e,t){this.mediaModal.close();}.bind(this),onListLoad:function(e){},onListRender:function(e){return e},onListComplete:function(e){},onError:function(e,t,i){}});}.bind(this)}),this.mediaModal.show(this.currentEditor.data("hoodMediaList"),t.currentTarget);}.bind(this)});},e}();var Handlers=function(){function t(){}return t.prototype.initDefaultHandlers=function(){this.checkboxToCsvInput(),this.iconSelector(),this.initSelectValues(),this.scrollHandlers(),this.selectText(),this.setValueOnClick(),this.submitOnChange();},t.prototype.initSelectValues=function(t){void 0===t&&(t="body"),$(t).find("select[data-selected]").each(this.initSelectValuesHandler);},t.prototype.initSelectValuesHandler=function(t,e){var o=$(this).data("selected");if("undefined"!==o&&""!==o){var a=String(o);$(this).val(a);}},t.prototype.iconSelector=function(t){void 0===t&&(t="body"),$(t).find("[data-hood-icon]").each(this.iconSelectorHandler);},t.prototype.iconSelectorHandler=function(t,e){var o=$(this),a=o.find("input[data-hood-icon-input]"),n=o.find("[data-hood-icon-display]"),i=o.find(".collapse");o.find("[data-hood-icon-key][data-hood-icon-value]").on("click",(function(){o.find("[data-hood-icon-key][data-hood-icon-value]").removeClass("active"),$(this).addClass("active");var t=$(this).data("hoodIconKey"),e=$(this).data("hoodIconValue");$(this),n.html(e),a.val(t),i&&i.removeClass("show");}));},t.prototype.selectText=function(t){void 0===t&&(t="body"),$(t).on("click",".select-text",this.selectTextHandler);},t.prototype.selectTextHandler=function(){var t=$(this);t.select(),t.mouseup((function(){return t.unbind("mouseup"),!1}));},t.prototype.scrollHandlers=function(t){void 0===t&&(t="body"),$(t).on("click",".scroll-top, .scroll-to-top",this.scrollTop),$(t).on("click",".scroll-target, .scroll-to-target",this.scrollTarget),$(t).on("click",".scroll-target-direct, .scroll-to-target-direct",this.scrollTargetDirect);},t.prototype.scrollTop=function(t){return t&&t.preventDefault(),$("html, body").animate({scrollTop:0},800),!1},t.prototype.scrollTarget=function(t){t&&t.preventDefault();var e=$(this).attr("href").split("#")[0];if(e===window.location.pathname||""===e){var o=this.hash,a=$(o),n=$("header.header"),i=0;n&&(i=n.height()),$(this).data("offset")?$("html, body").stop().animate({scrollTop:a.offset().top-$(this).data("offset")},900,"swing"):$("html, body").stop().animate({scrollTop:a.offset().top-i},900,"swing");}},t.prototype.scrollTargetDirect=function(){var t=$("body").scrollTop(),e=$($(this).attr("href")).offset().top;return $("html, body").animate({scrollTop:e},Math.abs(e-t)),!1},t.prototype.checkboxToCsvInput=function(t){void 0===t&&(t="body"),$(t).on("change","input[type=checkbox][data-hood-csv-input]",this.checkboxToCsvInputHandler);},t.prototype.checkboxToCsvInputHandler=function(t){t&&t.preventDefault();var e=new Array;$('input[data-hood-csv-input="'+$(this).data("hoodCsvInput")+'"]').each((function(){$(this).is(":checked")&&e.push($(this).val());}));var o="#"+$(this).data("input"),a=JSON.stringify(e);$(o).val(a);},t.prototype.submitOnChange=function(t){void 0===t&&(t="body"),$(t).on("change",".submit-on-change",this.submitOnChangeHandler);},t.prototype.submitOnChangeHandler=function(t){t&&t.preventDefault(),$(this).parents("form").submit();},t.prototype.setValueOnClick=function(t){void 0===t&&(t="body"),$(t).on("click",".click-select[data-target][data-value]",this.setValueOnClickHandler);},t.prototype.setValueOnClickHandler=function(){var t=$(this),e="#"+t.data("target");$(e).val(t.data("value")),$(e).trigger("change"),$('.click-select.clean[data-target="'+t.data("target")+'"]').each((function(){$(this).removeClass("active");})),$('.click-select.clean[data-target="'+t.data("target")+'"][data-value="'+t.data("value")+'"]').each((function(){$(this).addClass("active");}));},t}();var Uploader=function(){function e(){($(".image-uploader").length||$(".gallery-uploader").length)&&($(".upload-progress-bar").hide(),$(".image-uploader").each(this.singleImage),$(".gallery-uploader").each(this.gallery));}return e.prototype.refreshImage=function(e,r){$(e.data("preview")).css({"background-image":"url("+r.media.smallUrl+")"}),$(e.data("preview")).find("img").attr("src",r.media.smallUrl);},e.prototype.singleImage=function(){var e="#"+$(this).attr("id"),r=$(e),a="#"+$(this).attr("json"),l=null;r.dropzone({url:r.data("url"),maxFiles:1,paramName:"file",parallelUploads:1,acceptedFiles:r.data("types")||".png,.jpg,.jpeg,.gif",autoProcessQueue:!0,previewsContainer:!1,clickable:e,init:function(){l=this;}}),l.on("addedfile",(function(){})),l.on("totaluploadprogress",(function(r){$(".upload-progress-bar."+e.replace("#","")+" .progress-bar").css({width:r+"%"});})),l.on("sending",(function(a){$(".upload-progress-bar."+e.replace("#","")).show(),$(r.data("preview")).addClass("loading");})),l.on("queuecomplete",(function(r){$(".upload-progress-bar."+e.replace("#","")).hide();})),l.on("success",(function(e,o){o.success?(o.media&&($(a).val(JSON.stringify(o.media)),$(r.data("preview")).css({"background-image":"url("+o.media.smallUrl+")"}),$(r.data("preview")).find("img").attr("src",o.media.smallUrl)),Alerts.success("New image added!")):Alerts.error("There was a problem adding the image: "+o.error),l.removeFile(e),$(r.data("preview")).removeClass("loading");}));},e.prototype.gallery=function(){var e="#"+$(this).attr("id"),r=$(e),a=document.querySelector(e+"-template");a.id="";var l=a.parentNode.innerHTML;a.parentNode.removeChild(a);var o=null;r.dropzone({url:r.data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:l,paramName:"files",acceptedFiles:r.data("types")||".png,.jpg,.jpeg,.gif",autoProcessQueue:!0,previewsContainer:"#previews",clickable:".fileinput-button",init:function(){o=this;}}),$(e+" .cancel").hide(),o.on("addedfile",(function(r){$(r.previewElement.querySelector(".complete")).hide(),$(r.previewElement.querySelector(".cancel")).show(),$(e+" .cancel").show();})),o.on("totaluploadprogress",(function(e,r,a){document.querySelector("#total-progress .progress-bar").style.width=e+"%";})),o.on("sending",(function(e){document.querySelector("#total-progress").style.opacity="1";})),o.on("complete",(function(e){$(e.previewElement.querySelector(".cancel")).hide(),$(e.previewElement.querySelector(".progress")).hide(),$(e.previewElement.querySelector(".complete")).show(),console.error("Uploader.Gallery.Dropzone.OnComplete - Inline.Refresh('.gallery') is not implemented.");})),o.on("queuecomplete",(function(r){document.querySelector("#total-progress").style.opacity="0",$(e+" .cancel").hide();})),o.on("success",(function(e,r){console.error("Uploader.Gallery.Dropzone.OnSuccess - Inline.Refresh('.gallery') is not implemented."),r.success?Alerts.success("New images added!"):Alerts.error("There was a problem adding the profile image: "+r.error);})),$(".actions .cancel").click((function(){o.removeAllFiles(!0);}));},e}();var HoodApi=function(){function o(){this.alerts=new Alerts,this.uploader=new Uploader,this.handlers=new Handlers,this.editors=new Editors,this.colorPickers=new ColorPickers,this.mediaModal=new MediaModal,this.setupLoaders();}return o.prototype.setupLoaders=function(){$("body").on("loader-show",(function(){Alerts.success("Showing loader...");})),$("body").on("loader-hide",(function(){Alerts.error("Hiding loader...");}));},o}();var PropertyController=function(){function t(){this.map=null,this.center={lat:30,lng:-110},this.initList();}return t.prototype.initList=function(){this.element=document.getElementById("property-list"),this.element&&(this.list=new DataList(this.element,{onComplete:function(t,e){Alerts.log("Finished loading property list.","info");}.bind(this)}));},t.prototype.initMapList=function(){this.mapListElement=document.getElementById("property-map-list"),this.mapElement&&(this.mapList=new DataList(this.mapListElement,{onComplete:function(t,e){Alerts.log("Finished loading map list.","info"),this.reloadMarkers();}.bind(this)}));},t.prototype.initMap=function(t){void 0===t&&(t="property-map"),this.mapElement=document.getElementById(t),this.mapElement&&(this.center={lat:+this.mapElement.dataset.lat,lng:+this.mapElement.dataset.long},this.map=new google.maps.Map(this.mapElement,{zoom:+this.mapElement.dataset.zoom||15,center:this.center,scrollwheel:!1}),$(window).resize(function(){google.maps.event.trigger(this.map,"resize");}.bind(this)),google.maps.event.trigger(this.map,"resize"),this.initMapList());},t.prototype.reloadMarkers=function(){var t=null;if(this.mapElement){var e=this.map;if(this.markers)for(var i=0;i<this.markers.length;i++)this.markers[i].setMap(null);this.markers=[],$("#property-map-locations").data("locations").map(function(i,n){var o=new google.maps.Marker({position:new google.maps.LatLng(+i.Latitude,+i.Longitude),map:this.map,optimized:!0});o.info='<div class="card border-0" style="max-width:300px">\n <div style="background-image:url('.concat(i.ImageUrl,')" class="rounded img-full img img-wide"></div>\n <div class="card-body border-0">\n <p style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">\n <strong>').concat(i.Address1,", ").concat(i.Postcode,"</strong>\n </p>\n <p>").concat(i.Description,'</p>\n <a href="').concat(i.MarkerUrl,'" class="btn btn-block btn-primary">Find out more...</a>\n </div>\n</div>'),google.maps.event.addListener(o,"click",function(){t&&t.close(),(t=new google.maps.InfoWindow({content:this.info})).open(e,this);}.bind(this)),this.markers.push(o);}.bind(this));}},t}();var App=function(r){function o(){var o=r.call(this)||this;return o.handlers.initDefaultHandlers(),o.initContactForms(),o.propertyController=new PropertyController,o}return __extends(o,r),o.prototype.initGoogleMaps=function(r){void 0===r&&(r=".google-map"),$(r).each((function(){var r=new google.maps.LatLng($(this).data("lat"),$(this).data("long"));console.log("Loading map at: "+$(this).data("lat")+", "+$(this).data("long"));var o=new google.maps.Map(this,{zoom:$(this).data("zoom")||15,center:r,scrollwheel:!1});new google.maps.Marker({position:r,map:o,title:$(this).data("marker")});$(window).resize((function(){google.maps.event.trigger(o,"resize");})),google.maps.event.trigger(o,"resize");}));},o.prototype.initContactForms=function(r){void 0===r&&(r=".contact-form");var o=$(r);o.find(".thank-you").hide(),o.find(".form-content").show();var t=$(r)[0];new Validator(t,{onComplete:function(r){Response.process(r,5e3),r.success?(o.attr("data-redirect")&&(window.location.href=o.attr("data-redirect")),o.attr("data-alert-message")&&Alerts.success(o.attr("data-alert-message"),"Success"),o.find(".form").hide(),o.find(".thank-you").show()):o.attr("data-alert-error")?Alerts.error(o.attr("data-alert-error"),"Error"):Alerts.error("There was an error sending the message: "+r.errors,"Error");}.bind(this)});},o}(HoodApi);window.hood=new App;exports.App=App;Object.defineProperty(exports,'__esModule',{value:true});}));
23
- if (typeof this !== 'undefined' && this.hood){ this.hoodCMS = this.Hood = this.hoodCMS = this.HoodCMS = this.hood }
21
+ var extendStatics=function(t,e){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);},extendStatics(t,e)};function __extends(t,e){function r(){this.constructor=t;}extendStatics(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r);}var __assign=function(){return __assign=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},__assign.apply(this,arguments)};"function"!=typeof Object.create&&(Object.create=function(t){function o(){}return o.prototype=t,new o}),function(t,o,i,s){var n={_positionClasses:["bottom-left","bottom-right","top-right","top-left","bottom-center","top-center","mid-center"],_defaultIcons:["success","error","info","warning"],init:function(o,i){this.prepareOptions(o,t.toast.options),this.process();},prepareOptions:function(o,i){var s={};"string"==typeof o||o instanceof Array?s.text=o:s=o,this.options=t.extend({},i,s);},process:function(){this.setup(),this.addToDom(),this.position(),this.bindToast(),this.animate();},setup:function(){var o="";if(this._toastEl=this._toastEl||t("<div></div>",{class:"jq-toast-single"}),o+='<span class="jq-toast-loader"></span>',this.options.allowToastClose&&(o+='<span class="close-jq-toast-single">&times;</span>'),this.options.text instanceof Array){this.options.heading&&(o+='<h2 class="jq-toast-heading">'+this.options.heading+"</h2>"),o+='<ul class="jq-toast-ul">';for(var i=0;i<this.options.text.length;i++)o+='<li class="jq-toast-li" id="jq-toast-item-'+i+'">'+this.options.text[i]+"</li>";o+="</ul>";}else this.options.heading&&(o+='<h2 class="jq-toast-heading">'+this.options.heading+"</h2>"),o+=this.options.text;this._toastEl.html(o),!1!==this.options.bgColor&&this._toastEl.css("background-color",this.options.bgColor),!1!==this.options.textColor&&this._toastEl.css("color",this.options.textColor),this.options.textAlign&&this._toastEl.css("text-align",this.options.textAlign),!1!==this.options.icon&&(this._toastEl.addClass("jq-has-icon"),-1!==t.inArray(this.options.icon,this._defaultIcons)&&this._toastEl.addClass("jq-icon-"+this.options.icon)),!1!==this.options.class&&this._toastEl.addClass(this.options.class);},position:function(){"string"==typeof this.options.position&&-1!==t.inArray(this.options.position,this._positionClasses)?"bottom-center"===this.options.position?this._container.css({left:t(o).outerWidth()/2-this._container.outerWidth()/2,bottom:20}):"top-center"===this.options.position?this._container.css({left:t(o).outerWidth()/2-this._container.outerWidth()/2,top:20}):"mid-center"===this.options.position?this._container.css({left:t(o).outerWidth()/2-this._container.outerWidth()/2,top:t(o).outerHeight()/2-this._container.outerHeight()/2}):this._container.addClass(this.options.position):"object"==typeof this.options.position?this._container.css({top:this.options.position.top?this.options.position.top:"auto",bottom:this.options.position.bottom?this.options.position.bottom:"auto",left:this.options.position.left?this.options.position.left:"auto",right:this.options.position.right?this.options.position.right:"auto"}):this._container.addClass("bottom-left");},bindToast:function(){var t=this;this._toastEl.on("afterShown",(function(){t.processLoader();})),this._toastEl.find(".close-jq-toast-single").on("click",(function(o){o.preventDefault(),"fade"===t.options.showHideTransition?(t._toastEl.trigger("beforeHide"),t._toastEl.fadeOut((function(){t._toastEl.trigger("afterHidden");}))):"slide"===t.options.showHideTransition?(t._toastEl.trigger("beforeHide"),t._toastEl.slideUp((function(){t._toastEl.trigger("afterHidden");}))):(t._toastEl.trigger("beforeHide"),t._toastEl.hide((function(){t._toastEl.trigger("afterHidden");})));})),"function"==typeof this.options.beforeShow&&this._toastEl.on("beforeShow",(function(){t.options.beforeShow();})),"function"==typeof this.options.afterShown&&this._toastEl.on("afterShown",(function(){t.options.afterShown();})),"function"==typeof this.options.beforeHide&&this._toastEl.on("beforeHide",(function(){t.options.beforeHide();})),"function"==typeof this.options.afterHidden&&this._toastEl.on("afterHidden",(function(){t.options.afterHidden();}));},addToDom:function(){var o=t(".jq-toast-wrap");if(0===o.length?(o=t("<div></div>",{class:"jq-toast-wrap"}),t("body").append(o)):(!this.options.stack||isNaN(parseInt(this.options.stack,10)))&&o.empty(),o.find(".jq-toast-single:hidden").remove(),o.append(this._toastEl),this.options.stack&&!isNaN(parseInt(this.options.stack),10)){var i=o.find(".jq-toast-single").length-this.options.stack;i>0&&t(".jq-toast-wrap").find(".jq-toast-single").slice(0,i).remove();}this._container=o;},canAutoHide:function(){return !1!==this.options.hideAfter&&!isNaN(parseInt(this.options.hideAfter,10))},processLoader:function(){if(!this.canAutoHide()||!1===this.options.loader)return !1;var t=this._toastEl.find(".jq-toast-loader"),o=(this.options.hideAfter-400)/1e3+"s",i=this.options.loaderBg,s=t.attr("style")||"";s=s.substring(0,s.indexOf("-webkit-transition")),s+="-webkit-transition: width "+o+" ease-in; -o-transition: width "+o+" ease-in; transition: width "+o+" ease-in; background-color: "+i+";",t.attr("style",s).addClass("jq-toast-loaded");},animate:function(){var t=this;if(this._toastEl.hide(),this._toastEl.trigger("beforeShow"),"fade"===this.options.showHideTransition.toLowerCase()?this._toastEl.fadeIn((function(){t._toastEl.trigger("afterShown");})):"slide"===this.options.showHideTransition.toLowerCase()?this._toastEl.slideDown((function(){t._toastEl.trigger("afterShown");})):this._toastEl.show((function(){t._toastEl.trigger("afterShown");})),this.canAutoHide()){t=this;o.setTimeout((function(){"fade"===t.options.showHideTransition.toLowerCase()?(t._toastEl.trigger("beforeHide"),t._toastEl.fadeOut((function(){t._toastEl.trigger("afterHidden");}))):"slide"===t.options.showHideTransition.toLowerCase()?(t._toastEl.trigger("beforeHide"),t._toastEl.slideUp((function(){t._toastEl.trigger("afterHidden");}))):(t._toastEl.trigger("beforeHide"),t._toastEl.hide((function(){t._toastEl.trigger("afterHidden");})));}),this.options.hideAfter);}},reset:function(o){"all"===o?t(".jq-toast-wrap").remove():this._toastEl.remove();},update:function(t){this.prepareOptions(t,this.options),this.setup(),this.bindToast();}};t.toast=function(t){var o=Object.create(n);return o.init(t,this),{reset:function(t){o.reset(t);},update:function(t){o.update(t);}}},t.toast.options={text:"",heading:"",showHideTransition:"fade",allowToastClose:!0,hideAfter:3e3,loader:!0,loaderBg:"#9EC600",stack:5,position:"bottom-left",bgColor:!1,textColor:!1,textAlign:"left",icon:!1,beforeShow:function(){},afterShown:function(){},beforeHide:function(){},afterHidden:function(){}};}(jQuery,window);var BootstrapSwal=Swal__default["default"].mixin({customClass:{confirmButton:"btn btn-success m-1 px-3",cancelButton:"btn btn-danger m-1 px-3"},buttonsStyling:!1}),Alerts=function(){function o(){}return o.log=function(o,t){if(void 0===t&&(t="message"),document.body.classList.contains("dev-mode"))switch(t){case"error":console.error(o);break;case"message":console.log(o);break;case"warning":console.warn(o);break;case"info":console.info(o);}},o.error=function(o,t,e){void 0===t&&(t=null),void 0===e&&(e=null),$.toast({heading:t,text:o,icon:"error",position:"bottom-left",loader:!1,bgColor:"#d0100b",textColor:"white",hideAfter:e});},o.warning=function(o,t,e){void 0===t&&(t=null),void 0===e&&(e=null),$.toast({heading:t,text:o,icon:"error",position:"bottom-left",loader:!1,bgColor:"#ef9007",textColor:"white",hideAfter:e});},o.message=function(o,t,e){void 0===t&&(t=null),void 0===e&&(e=null),$.toast({heading:t,text:o,icon:"error",position:"bottom-left",loader:!1,bgColor:"#222222",textColor:"white",hideAfter:e});},o.success=function(o,t,e){void 0===t&&(t=null),void 0===e&&(e=null),$.toast({heading:t,text:o,icon:"error",position:"bottom-left",loader:!1,bgColor:"#28a745",textColor:"white",hideAfter:e});},o.alert=function(t,e,n,i){switch(void 0===e&&(e=null),void 0===n&&(n="info"),void 0===i&&(i=1e4),n){case"error":o.error(t,e,i);break;case"warning":o.warning(t,e,i);break;case"info":o.message(t,e,i);break;case"success":o.success(t,e,i);}},o.sweetAlert=function(o,t){BootstrapSwal.fire(o).then((function(o){t(o);}));},o.confirm=function(t,e){o.sweetAlert(__assign(__assign({},{showCancelButton:!0,footer:null,title:"Are you sure?",html:"Are you sure you want to do this?",confirmButtonText:"Ok",cancelButtonText:"Cancel"}),t),e);},o.prompt=function(t,e){o.sweetAlert(__assign(__assign({},{input:"text",inputAttributes:{autocapitalize:"off"},showCancelButton:!0,icon:"info",footer:'<span class="text-warning"><i class="fa fa-exclamation-triangle"></i> This cannot be undone.</span>',confirmButtonText:"Ok",cancelButtonText:"Cancel"}),t),e);},o.prototype.log=function(t,e){void 0===e&&(e="message"),o.log(t,e);},o.prototype.error=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null),o.error(t,e,n);},o.prototype.warning=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null),o.warning(t,e,n);},o.prototype.message=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null),o.message(t,e,n);},o.prototype.success=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null),o.success(t,e,n);},o.prototype.alert=function(t,e,n,i){void 0===n&&(n="info"),void 0===i&&(i=1e4),o.alert(t,t,n,i);},o.prototype.sweetAlert=function(t,e){o.sweetAlert(t,e);},o.prototype.confirm=function(t,e){o.confirm(t,e);},o.prototype.prompt=function(t,e){o.prompt(t,e);},o}();var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
22
+
23
+ function getDefaultExportFromCjs (x) {
24
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
25
+ }var pickr_min = {exports: {}};/*! Pickr 1.8.2 MIT | https://github.com/Simonwep/pickr */
26
+ !function(t,e){var o;o=function(){return (()=>{var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]});},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});}},e={};t.d(e,{default:()=>E});var o={};function n(t,e,o,n,i={}){e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(o)||(o=[o]);for(const s of e)for(const e of o)s[t](e,n,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}t.r(o),t.d(o,{adjustableInputNumbers:()=>p,createElementFromString:()=>r,createFromTemplate:()=>a,eventPath:()=>l,off:()=>s,on:()=>i,resolveElement:()=>c});const i=n.bind(null,"addEventListener"),s=n.bind(null,"removeEventListener");function r(t){const e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function a(t){const e=(t,e)=>{const o=t.getAttribute(e);return t.removeAttribute(e),o},o=(t,n={})=>{const i=e(t,":obj"),s=e(t,":ref"),r=i?n[i]={}:n;s&&(n[s]=t);for(const n of Array.from(t.children)){const t=e(n,":arr"),i=o(n,t?{}:r);t&&(r[t]||(r[t]=[])).push(Object.keys(i).length?i:n);}return n};return o(r(t))}function l(t){let e=t.path||t.composedPath&&t.composedPath();if(e)return e;let o=t.target.parentElement;for(e=[t.target,o];o=o.parentElement;)e.push(o);return e.push(document,window),e}function c(t){return t instanceof Element?t:"string"==typeof t?t.split(/>>/g).reduce(((t,e,o,n)=>(t=t.querySelector(e),o<n.length-1?t.shadowRoot:t)),document):null}function p(t,e=(t=>t)){function o(o){const n=[.001,.01,.1][Number(o.shiftKey||2*o.ctrlKey)]*(o.deltaY<0?1:-1);let i=0,s=t.selectionStart;t.value=t.value.replace(/[\d.]+/g,((t,o)=>o<=s&&o+t.length>=s?(s=o,e(Number(t),n,i)):(i++,t))),t.focus(),t.setSelectionRange(s,s),o.preventDefault(),t.dispatchEvent(new Event("input"));}i(t,"focus",(()=>i(window,"wheel",o,{passive:!1}))),i(t,"blur",(()=>s(window,"wheel",o)));}const{min:u,max:h,floor:d,round:m}=Math;function f(t,e,o){e/=100,o/=100;const n=d(t=t/360*6),i=t-n,s=o*(1-e),r=o*(1-i*e),a=o*(1-(1-i)*e),l=n%6;return [255*[o,r,s,s,a,o][l],255*[a,o,o,r,s,s][l],255*[s,s,a,o,o,r][l]]}function v(t,e,o){const n=(2-(e/=100))*(o/=100)/2;return 0!==n&&(e=1===n?0:n<.5?e*o/(2*n):e*o/(2-2*n)),[t,100*e,100*n]}function b(t,e,o){const n=u(t/=255,e/=255,o/=255),i=h(t,e,o),s=i-n;let r,a;if(0===s)r=a=0;else {a=s/i;const n=((i-t)/6+s/2)/s,l=((i-e)/6+s/2)/s,c=((i-o)/6+s/2)/s;t===i?r=c-l:e===i?r=1/3+n-c:o===i&&(r=2/3+l-n),r<0?r+=1:r>1&&(r-=1);}return [360*r,100*a,100*i]}function _(t,e,o,n){return e/=100,o/=100,[...b(255*(1-u(1,(t/=100)*(1-(n/=100))+n)),255*(1-u(1,e*(1-n)+n)),255*(1-u(1,o*(1-n)+n)))]}function g(t,e,o){e/=100;const n=2*(e*=(o/=100)<.5?o:1-o)/(o+e)*100,i=100*(o+e);return [t,isNaN(n)?0:n,i]}function y(t){return b(...t.match(/.{2}/g).map((t=>parseInt(t,16))))}function w(t=0,e=0,o=0,n=1){const i=(t,e)=>(o=-1)=>e(~o?t.map((t=>Number(t.toFixed(o)))):t),s={h:t,s:e,v:o,a:n,toHSVA(){const t=[s.h,s.s,s.v,s.a];return t.toString=i(t,(t=>`hsva(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toHSLA(){const t=[...v(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`hsla(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toRGBA(){const t=[...f(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${s.a})`)),t},toCMYK(){const t=function(t,e,o){const n=f(t,e,o),i=n[0]/255,s=n[1]/255,r=n[2]/255,a=u(1-i,1-s,1-r);return [100*(1===a?0:(1-i-a)/(1-a)),100*(1===a?0:(1-s-a)/(1-a)),100*(1===a?0:(1-r-a)/(1-a)),100*a]}(s.h,s.s,s.v);return t.toString=i(t,(t=>`cmyk(${t[0]}%, ${t[1]}%, ${t[2]}%, ${t[3]}%)`)),t},toHEXA(){const t=function(t,e,o){return f(t,e,o).map((t=>m(t).toString(16).padStart(2,"0")))}(s.h,s.s,s.v),e=s.a>=1?"":Number((255*s.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return e&&t.push(e),t.toString=()=>`#${t.join("").toUpperCase()}`,t},clone:()=>w(s.h,s.s,s.v,s.a)};return s}const A=t=>Math.max(Math.min(t,1),0);function k(t){const e={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},t),_keyboard(t){const{options:o}=e,{type:n,key:i}=t;if(document.activeElement===o.wrapper){const{lock:o}=e.options,s="ArrowUp"===i,r="ArrowRight"===i,a="ArrowDown"===i,l="ArrowLeft"===i;if("keydown"===n&&(s||r||a||l)){let n=0,i=0;"v"===o?n=s||r?1:-1:"h"===o?n=s||r?-1:1:(i=s?-1:a?1:0,n=l?-1:r?1:0),e.update(A(e.cache.x+.01*n),A(e.cache.y+.01*i)),t.preventDefault();}else i.startsWith("Arrow")&&(e.options.onstop(),t.preventDefault());}},_tapstart(t){i(document,["mouseup","touchend","touchcancel"],e._tapstop),i(document,["mousemove","touchmove"],e._tapmove),t.cancelable&&t.preventDefault(),e._tapmove(t);},_tapmove(t){const{options:o,cache:n}=e,{lock:i,element:s,wrapper:r}=o,a=r.getBoundingClientRect();let l=0,c=0;if(t){const e=t&&t.touches&&t.touches[0];l=t?(e||t).clientX:0,c=t?(e||t).clientY:0,l<a.left?l=a.left:l>a.left+a.width&&(l=a.left+a.width),c<a.top?c=a.top:c>a.top+a.height&&(c=a.top+a.height),l-=a.left,c-=a.top;}else n&&(l=n.x*a.width,c=n.y*a.height);"h"!==i&&(s.style.left=`calc(${l/a.width*100}% - ${s.offsetWidth/2}px)`),"v"!==i&&(s.style.top=`calc(${c/a.height*100}% - ${s.offsetHeight/2}px)`),e.cache={x:l/a.width,y:c/a.height};const p=A(l/a.width),u=A(c/a.height);switch(i){case"v":return o.onchange(p);case"h":return o.onchange(u);default:return o.onchange(p,u)}},_tapstop(){e.options.onstop(),s(document,["mouseup","touchend","touchcancel"],e._tapstop),s(document,["mousemove","touchmove"],e._tapmove);},trigger(){e._tapmove();},update(t=0,o=0){const{left:n,top:i,width:s,height:r}=e.options.wrapper.getBoundingClientRect();"h"===e.options.lock&&(o=t),e._tapmove({clientX:n+s*t,clientY:i+r*o});},destroy(){const{options:t,_tapstart:o,_keyboard:n}=e;s(document,["keydown","keyup"],n),s([t.wrapper,t.element],"mousedown",o),s([t.wrapper,t.element],"touchstart",o,{passive:!1});}},{options:o,_tapstart:n,_keyboard:r}=e;return i([o.wrapper,o.element],"mousedown",n),i([o.wrapper,o.element],"touchstart",n,{passive:!1}),i(document,["keydown","keyup"],r),e}function C(t={}){t=Object.assign({onchange:()=>0,className:"",elements:[]},t);const e=i(t.elements,"click",(e=>{t.elements.forEach((o=>o.classList[e.target===o?"add":"remove"](t.className))),t.onchange(e),e.stopPropagation();}));return {destroy:()=>s(...e)}}const $={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8};function S(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}class E{constructor(t){S(this,"_initializingActive",!0),S(this,"_recalc",!0),S(this,"_nanopop",null),S(this,"_root",null),S(this,"_color",w()),S(this,"_lastColor",w()),S(this,"_swatchColors",[]),S(this,"_setupAnimationFrame",null),S(this,"_eventListener",{init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]}),this.options=t=Object.assign({...E.DEFAULT_OPTIONS},t);const{swatches:e,components:o,theme:n,sliders:i,lockOpacity:s,padding:r}=t;["nano","monolith"].includes(n)&&!i&&(t.sliders="h"),o.interaction||(o.interaction={});const{preview:a,opacity:l,hue:c,palette:p}=o;o.opacity=!s&&l,o.palette=p||a||l||c,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),e&&e.length&&e.forEach((t=>this.addSwatch(t)));const{button:u,app:h}=this._root;this._nanopop=((t,e,o)=>{const n="object"!=typeof t||t instanceof HTMLElement?{reference:t,popper:e,...o}:t;return {update(t=n){const{reference:e,popper:o}=Object.assign(n,t);if(!o||!e)throw new Error("Popper- or reference-element missing.");return ((t,e,o)=>{const{container:n,margin:i,position:s,variantFlipOrder:r,positionFlipOrder:a}={container:document.documentElement.getBoundingClientRect(),...$,...o},{left:l,top:c}=e.style;e.style.left="0",e.style.top="0";const p=t.getBoundingClientRect(),u=e.getBoundingClientRect(),h={t:p.top-u.height-i,b:p.bottom+i,r:p.right+i,l:p.left-u.width-i},d={vs:p.left,vm:p.left+p.width/2+-u.width/2,ve:p.left+p.width-u.width,hs:p.top,hm:p.bottom-p.height/2-u.height/2,he:p.bottom-u.height},[m,f="middle"]=s.split("-"),v=a[m],b=r[f],{top:_,left:g,bottom:y,right:w}=n;for(const t of v){const o="t"===t||"b"===t,n=h[t],[i,s]=o?["top","left"]:["left","top"],[r,a]=o?[u.height,u.width]:[u.width,u.height],[l,c]=o?[y,w]:[w,y],[p,m]=o?[_,g]:[g,_];if(!(n<p||n+r>l))for(const r of b){const l=d[(o?"v":"h")+r];if(!(l<m||l+a>c))return e.style[s]=l-u[s]+"px",e.style[i]=n-u[i]+"px",t+r}}return e.style.left=l,e.style.top=c,null})(e,o,n)}}})(u,h,{margin:r}),u.setAttribute("role","button"),u.setAttribute("aria-label",this._t("btn:toggle"));const d=this;this._setupAnimationFrame=requestAnimationFrame((function e(){if(!h.offsetWidth)return requestAnimationFrame(e);d.setColor(t.default),d._rePositioningPicker(),t.defaultRepresentation&&(d._representation=t.defaultRepresentation,d.setColorRepresentation(d._representation)),t.showAlways&&d.show(),d._initializingActive=!1,d._emit("init");}));}_preBuild(){const{options:t}=this;for(const e of ["el","container"])t[e]=c(t[e]);this._root=(t=>{const{components:e,useAsButton:o,inline:n,appClass:i,theme:s,lockOpacity:r}=t.options,l=t=>t?"":'style="display:none" hidden',c=e=>t._t(e),p=a(`\n <div :ref="root" class="pickr">\n\n ${o?"":'<button type="button" :ref="button" class="pcr-button"></button>'}\n\n <div :ref="app" class="pcr-app ${i||""}" data-theme="${s}" ${n?'style="position: unset"':""} aria-label="${c("ui:dialog")}" role="window">\n <div class="pcr-selection" ${l(e.palette)}>\n <div :obj="preview" class="pcr-color-preview" ${l(e.preview)}>\n <button type="button" :ref="lastColor" class="pcr-last-color" aria-label="${c("btn:last-color")}"></button>\n <div :ref="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div :obj="palette" class="pcr-color-palette">\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="palette" class="pcr-palette" tabindex="0" aria-label="${c("aria:palette")}" role="listbox"></div>\n </div>\n\n <div :obj="hue" class="pcr-color-chooser" ${l(e.hue)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-hue pcr-slider" tabindex="0" aria-label="${c("aria:hue")}" role="slider"></div>\n </div>\n\n <div :obj="opacity" class="pcr-color-opacity" ${l(e.opacity)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-opacity pcr-slider" tabindex="0" aria-label="${c("aria:opacity")}" role="slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ${e.palette?"":"pcr-last"}" :ref="swatches"></div>\n\n <div :obj="interaction" class="pcr-interaction" ${l(Object.keys(e.interaction).length)}>\n <input :ref="result" class="pcr-result" type="text" spellcheck="false" ${l(e.interaction.input)} aria-label="${c("aria:input")}">\n\n <input :arr="options" class="pcr-type" data-type="HEXA" value="${r?"HEX":"HEXA"}" type="button" ${l(e.interaction.hex)}>\n <input :arr="options" class="pcr-type" data-type="RGBA" value="${r?"RGB":"RGBA"}" type="button" ${l(e.interaction.rgba)}>\n <input :arr="options" class="pcr-type" data-type="HSLA" value="${r?"HSL":"HSLA"}" type="button" ${l(e.interaction.hsla)}>\n <input :arr="options" class="pcr-type" data-type="HSVA" value="${r?"HSV":"HSVA"}" type="button" ${l(e.interaction.hsva)}>\n <input :arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ${l(e.interaction.cmyk)}>\n\n <input :ref="save" class="pcr-save" value="${c("btn:save")}" type="button" ${l(e.interaction.save)} aria-label="${c("aria:btn:save")}">\n <input :ref="cancel" class="pcr-cancel" value="${c("btn:cancel")}" type="button" ${l(e.interaction.cancel)} aria-label="${c("aria:btn:cancel")}">\n <input :ref="clear" class="pcr-clear" value="${c("btn:clear")}" type="button" ${l(e.interaction.clear)} aria-label="${c("aria:btn:clear")}">\n </div>\n </div>\n </div>\n `),u=p.interaction;return u.options.find((t=>!t.hidden&&!t.classList.add("active"))),u.type=()=>u.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root);}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app);}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide();}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[n,i]=o.match(/^[vh]+$/g)?o:[],s=()=>this._color||(this._color=this._lastColor.clone()),r={palette:k({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,n){if(!e.palette)return;const i=s(),{_root:r,options:a}=t,{lastColor:l,currentColor:c}=r.preview;t._recalc&&(i.s=100*o,i.v=100-100*n,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||l.style.setProperty("--pcr-color",p):(r.button.style.setProperty("--pcr-color",p),r.button.classList.remove("clear"));const u=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[u===o.toHEXA().toString()?"add":"remove"]("pcr-active");c.style.setProperty("--pcr-color",p);}}),hue:k({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const n=s();t._recalc&&(n.h=360*o),this.element.style.backgroundColor=`hsl(${n.h}, 100%, 50%)`,r.palette.trigger();}}),opacity:k({lock:"v"===n?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const n=s();t._recalc&&(n.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${n.a})`,r.palette.trigger();}}),selectable:C({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch");}})};this._components=r;}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel");})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide();})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation();})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null);})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const n=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===n||t.code===n)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!l(e).some((e=>e===t.app||e===t.button))&&this.hide();}),{capture:!0}));}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,n)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[n],s=t+(e>=100?1e3*o:o);return s<=0?0:Number((s<e?s:e).toPrecision(3))}return t}));}if(e.autoReposition&&!e.inline){let t=null;const n=this;o.push(i(window,["scroll","resize"],(()=>{n.isOpen()&&(e.closeOnScroll&&n.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){n._rePositioningPicker(),null!==t&&requestAnimationFrame(e);}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)));}),{capture:!0}));}this._eventBindings=o;}_rePositioningPicker(){const{options:t}=this;if(!t.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px";}}_updateOutput(t){const{_root:e,_color:o,options:n}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(n.outputPrecision):"";}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this);}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"));}_parseLocalColor(t){const{values:e,type:o,a:n}=function(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return "#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)/i,rgba:/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsla:/^((hsla)|hsl)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsva:/^((hsva)|hsv)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let n;t:for(const i in e){if(!(n=e[i].exec(t)))continue;const s=t=>!!n[2]==("number"==typeof t);switch(i){case"cmyk":{const[,t,e,s,r]=o(n);if(t>100||e>100||s>100||r>100)break t;return {values:_(t,e,s,r),type:i}}case"rgba":{const[,,,t,e,r,a]=o(n);if(t>255||e>255||r>255||a<0||a>1||!s(a))break t;return {values:[...b(t,e,r),a],a:a,type:i}}case"hexa":{let[,t]=n;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[...y(e),o],a:o,type:i}}case"hsla":{const[,,,t,e,r,a]=o(n);if(t>360||e>100||r>100||a<0||a>1||!s(a))break t;return {values:[...g(t,e,r),a],a:a,type:i}}case"hsva":{const[,,,t,e,r,a]=o(n);if(t>360||e>100||r>100||a<0||a>1||!s(a))break t;return {values:[t,e,r,a],a:a,type:i}}}}return {values:null,type:null}}(t),{lockOpacity:i}=this.options,s=void 0!==n&&1!==n;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&s?null:e,type:o}}_t(t){return this.options.i18n[t]||E.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)));}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],n=o.indexOf(e);return ~n&&o.splice(n,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,n=w(...e),s=r(`<button type="button" style="--pcr-color: ${n.toRGBA().toString(0)}" aria-label="${this._t("btn:swatch")}"/>`);return o.swatches.appendChild(s),t.push({el:s,color:n}),this._eventBindings.push(i(s,"click",(()=>{this.setHSVA(...n.toHSVA(),!0),this._emit("swatchselect",n),this._emit("change",n,"swatch",this);}))),!0}return !1}removeSwatch(t){const e=this._swatchColors[t];if(e){const{el:o}=e;return this._root.swatches.removeChild(o),this._swatchColors.splice(t,1),!0}return !1}applyColor(t=!1){const{preview:e,button:o}=this._root,n=this._color.toRGBA().toString(0);return e.lastColor.style.setProperty("--pcr-color",n),this.options.useAsButton||o.style.setProperty("--pcr-color",n),o.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this._emit("save",this._color),this}destroy(){cancelAnimationFrame(this._setupAnimationFrame),this._eventBindings.forEach((t=>s(...t))),Object.keys(this._components).forEach((t=>this._components[t].destroy()));}destroyAndRemove(){this.destroy();const{root:t,app:e}=this._root;t.parentElement&&t.parentElement.removeChild(t),e.parentElement.removeChild(e),Object.keys(this).forEach((t=>this[t]=null));}hide(){return !!this.isOpen()&&(this._root.app.classList.remove("visible"),this._emit("hide"),!0)}show(){return !this.options.disabled&&!this.isOpen()&&(this._root.app.classList.add("visible"),this._rePositioningPicker(),this._emit("show",this._color),this)}isOpen(){return this._root.app.classList.contains("visible")}setHSVA(t=360,e=0,o=0,n=1,i=!1){const s=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||o<0||o>100||n<0||n>1)return !1;this._color=w(t,e,o,n);const{hue:r,opacity:a,palette:l}=this._components;return r.update(t/360),a.update(n),l.update(e/100,1-o/100),i||this.applyColor(),s&&this._updateOutput(),this._recalc=s,!0}setColor(t,e=!1){if(null===t)return this._clearColor(e),!0;const{values:o,type:n}=this._parseLocalColor(t);if(o){const t=n.toUpperCase(),{options:i}=this._root.interaction,s=i.find((e=>e.getAttribute("data-type")===t));if(s&&!s.hidden)for(const t of i)t.classList[t===s?"add":"remove"]("active");return !!this.setHSVA(...o,e)&&this.setColorRepresentation(t)}return !1}setColorRepresentation(t){return t=t.toUpperCase(),!!this._root.interaction.options.find((e=>e.getAttribute("data-type").startsWith(t)&&!e.click()))}getColorRepresentation(){return this._representation}getColor(){return this._color}getSelectedColor(){return this._lastColor}getRoot(){return this._root}disable(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}enable(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}return S(E,"utils",o),S(E,"version","1.8.2"),S(E,"I18N_DEFAULTS",{"ui:dialog":"color picker dialog","btn:toggle":"toggle color picker dialog","btn:swatch":"color swatch","btn:last-color":"use previous color","btn:save":"Save","btn:cancel":"Cancel","btn:clear":"Clear","aria:btn:save":"save and close","aria:btn:cancel":"cancel and close","aria:btn:clear":"clear and close","aria:input":"color input field","aria:palette":"color selection area","aria:hue":"hue selection slider","aria:opacity":"selection slider"}),S(E,"DEFAULT_OPTIONS",{appClass:null,theme:"classic",useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:"body",components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:"#42445a",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"}),S(E,"create",(t=>new E(t))),e.default})()},pickr_min.exports=o();}();getDefaultExportFromCjs(pickr_min.exports);var Inline=function(){function o(){}return o.load=function(n,r){var t,e=$(n);e.addClass("loading"),r.onLoad&&r.onLoad(n);var l=e.data("url");$.get(l,(function(o){r.onRender&&(o=r.onRender(o,n)),e.html(o),e.removeClass("loading"),r.onComplete&&r.onComplete(o,n);})).fail(null!==(t=r.onError)&&void 0!==t?t:o.handleError);},o.task=function(n,r,t,e){void 0===t&&(t=null),void 0===e&&(e=null),r&&r.classList.add("loading"),$.get(n,(function(o){r&&r.classList.remove("loading"),t&&t(o,r);})).fail(null!=e?e:o.handleError);},o.post=function(n,r,t,e){void 0===t&&(t=null),void 0===e&&(e=null),r&&r.classList.add("loading"),$.post(n,(function(o){r&&r.classList.remove("loading"),t&&t(o,r);})).fail(null!=e?e:o.handleError);},o.handleError=function(o,n,r){500===o.status?Alerts.error("There was an error processing the content, please contact an administrator if this continues.","Error "+o.status,1e4):404===o.status?Alerts.error("The content could not be found.","Error "+o.status,1e4):401===o.status&&(Alerts.error("You are not allowed to view this resource, are you logged in correctly?","Error "+o.status,1e4),window.location=window.location);},o}();var tinymce = {exports: {}};!function(e){!function(){var t=function(e){if(null===e)return "null";if(void 0===e)return "undefined";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},n=function(e){return {eq:e}},r=n((function(e,t){return e===t})),o=function(e){return n((function(t,n){if(t.length!==n.length)return !1;for(var r=t.length,o=0;o<r;o++)if(!e.eq(t[o],n[o]))return !1;return !0}))},i=function(e,t){return function(e,t){return n((function(n,r){return e.eq(t(n),t(r))}))}(o(e),(function(e){return function(e,t){return Array.prototype.slice.call(e).sort(t)}(e,t)}))},a=function(e){return n((function(t,n){var o=Object.keys(t),a=Object.keys(n);if(!i(r).eq(o,a))return !1;for(var u=o.length,c=0;c<u;c++){var s=o[c];if(!e.eq(t[s],n[s]))return !1}return !0}))},u=n((function(e,n){if(e===n)return !0;var r=t(e);return r===t(n)&&(function(e){return -1!==["undefined","boolean","number","string","function","xml","null"].indexOf(e)}(r)?e===n:"array"===r?o(u).eq(e,n):"object"===r&&a(u).eq(e,n))})),c=function(e){return function(t){return r=typeof(n=t),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===e;var n,r;}},s=function(e){return function(t){return typeof t===e}},f=function(e){return function(t){return e===t}},l=c("string"),d=c("object"),m=c("array"),g=f(null),p=s("boolean"),h=f(void 0),v=function(e){return null==e},b=function(e){return !v(e)},y=s("function"),C=s("number"),x=function(){},w=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t.apply(null,n))}},S=function(e,t){return function(n){return e(t(n))}},k=function(e){return function(){return e}},N=function(e){return e},E=function(e,t){return e===t};function _(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}var A=function(e){return function(t){return !e(t)}},R=function(e){return e()},D=function(e){e();},T=k(!1),O=k(!0),B=function(){return P},P=function(){var e=function(e){return e()},t=N;return {fold:function(e,t){return e()},isSome:T,isNone:O,getOr:t,getOrThunk:e,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:k(null),getOrUndefined:k(void 0),or:t,orThunk:e,map:B,each:x,bind:B,exists:T,forall:O,filter:function(){return B()},toArray:function(){return []},toString:k("none()")}}(),L=function(e){var t=k(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:O,isNone:T,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return L(t(e))},each:function(t){t(e);},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:P},toArray:function(){return [e]},toString:function(){return "some("+e+")"}};return o},I={some:L,none:B,from:function(e){return null==e?P:L(e)}},M=Array.prototype.slice,F=Array.prototype.indexOf,U=Array.prototype.push,z=function(e,t){return F.call(e,t)},H=function(e,t){return z(e,t)>-1},j=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return !0}return !1},V=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},q=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n);}},$=function(e,t){for(var n=e.length-1;n>=0;n--){t(e[n],n);}},W=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}},K=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},X=function(e,t,n){return $(e,(function(e,r){n=t(n,e,r);})),n},Y=function(e,t,n){return q(e,(function(e,r){n=t(n,e,r);})),n},G=function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return I.some(i);if(n(i,r))break}return I.none()},J=function(e,t){return G(e,t,T)},Q=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return I.some(n)}return I.none()},Z=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!m(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);U.apply(t,e[n]);}return t}(V(e,t))},ee=function(e,t){for(var n=0,r=e.length;n<r;++n){if(!0!==t(e[n],n))return !1}return !0},te=function(e){var t=M.call(e,0);return t.reverse(),t},ne=function(e,t){return K(e,(function(e){return !H(t,e)}))},re=function(e,t){var n=M.call(e,0);return n.sort(t),n},oe=function(e,t){return t>=0&&t<e.length?I.some(e[t]):I.none()},ie=function(e){return oe(e,0)},ae=function(e){return oe(e,e.length-1)},ue=y(Array.from)?Array.from:function(e){return M.call(e)},ce=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return I.none()},se=Object.keys,fe=Object.hasOwnProperty,le=function(e,t){for(var n=se(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i);}},de=function(e,t){return me(e,(function(e,n){return {k:n,v:t(e,n)}}))},me=function(e,t){var n={};return le(e,(function(e,r){var o=t(e,r);n[o.k]=o.v;})),n},ge=function(e){return function(t,n){e[n]=t;}},pe=function(e,t,n,r){return le(e,(function(e,o){(t(e,o)?n:r)(e,o);})),{}},he=function(e,t){var n={};return pe(e,t,ge(n),x),n},ve=function(e){return function(e,t){var n=[];return le(e,(function(e,r){n.push(t(e,r));})),n}(e,N)},be=function(e,t){return ye(e,t)?I.from(e[t]):I.none()},ye=function(e,t){return fe.call(e,t)},Ce=function(e,t){return ye(e,t)&&void 0!==e[t]&&null!==e[t]},xe=Array.isArray,we=function(e,t,n){var r,o;if(!e)return !1;if(n=n||e,void 0!==e.length){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return !1}else for(r in e)if(ye(e,r)&&!1===t.call(n,e[r],r,e))return !1;return !0},Se=function(e,t){var n=[];return we(e,(function(r,o){n.push(t(r,o,e));})),n},ke=function(e,t){var n=[];return we(e,(function(r,o){t&&!t(r,o,e)||n.push(r);})),n},Ne=function(e,t){if(e)for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return -1},Ee=function(e,t,n,r){for(var o=h(n)?e[0]:n,i=0;i<e.length;i++)o=t.call(r,o,e[i],i);return o},_e=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},Ae=function(e){return e[e.length-1]},Re=function(){return Re=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},Re.apply(this,arguments)};function De(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var Te=function(e){var t,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,t=e.apply(null,r)),t}},Oe=function(){return Be(0,0)},Be=function(e,t){return {major:e,minor:t}},Pe={nu:Be,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Oe():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}}(e,t);if(!n)return {major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Be(r(1),r(2))}(e,n)},unknown:Oe},Le=function(e,t){var n=String(t).toLowerCase();return J(e,(function(e){return e.search(n)}))},Ie=function(e,t){return -1!==e.indexOf(t)},Me=function(e,t){return function(e,t,n){return ""===t||e.length>=t.length&&e.substr(n,n+t.length)===t}(e,t,0)},Fe=function(e){return function(t){return t.replace(e,"")}},Ue=Fe(/^\s+|\s+$/g),ze=Fe(/^\s+/g),He=Fe(/\s+$/g),je=function(e){return e.length>0},Ve=function(e){return !je(e)},qe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$e=function(e){return function(t){return Ie(t,e)}},We=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Ie(e,"edge/")&&Ie(e,"chrome")&&Ie(e,"safari")&&Ie(e,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qe],search:function(e){return Ie(e,"chrome")&&!Ie(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Ie(e,"msie")||Ie(e,"trident")}},{name:"Opera",versionRegexes:[qe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$e("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$e("firefox")},{name:"Safari",versionRegexes:[qe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return (Ie(e,"safari")||Ie(e,"mobile/"))&&Ie(e,"applewebkit")}}],Ke=[{name:"Windows",search:$e("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Ie(e,"iphone")||Ie(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$e("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$e("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$e("linux"),versionRegexes:[]},{name:"Solaris",search:$e("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$e("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:$e("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Xe={browsers:k(We),oses:k(Ke)},Ye="Edge",Ge="Chrome",Je="Opera",Qe="Firefox",Ze="Safari",et=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return {current:t,version:n,isEdge:r(Ye),isChrome:r(Ge),isIE:r("IE"),isOpera:r(Je),isFirefox:r(Qe),isSafari:r(Ze)}},tt={unknown:function(){return et({current:void 0,version:Pe.unknown()})},nu:et,edge:k(Ye),chrome:k(Ge),ie:k("IE"),opera:k(Je),firefox:k(Qe),safari:k(Ze)},nt="Windows",rt="Android",ot="Linux",it="Solaris",at="FreeBSD",ut="ChromeOS",ct=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return {current:t,version:n,isWindows:r(nt),isiOS:r("iOS"),isAndroid:r(rt),isOSX:r("OSX"),isLinux:r(ot),isSolaris:r(it),isFreeBSD:r(at),isChromeOS:r(ut)}},st={unknown:function(){return ct({current:void 0,version:Pe.unknown()})},nu:ct,windows:k(nt),ios:k("iOS"),android:k(rt),linux:k(ot),osx:k("OSX"),solaris:k(it),freebsd:k(at),chromeos:k(ut)},ft=function(e,t,n){var r=Xe.browsers(),o=Xe.oses(),i=t.bind((function(e){return function(e,t){return ce(t.brands,(function(t){var n=t.brand.toLowerCase();return J(e,(function(e){var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((function(e){return {current:e.name,version:Pe.nu(parseInt(t.version,10),0)}}))}))}(r,e)})).orThunk((function(){return function(e,t){return Le(e,t).map((function(e){var n=Pe.detect(e.versionRegexes,t);return {current:e.name,version:n}}))}(r,e)})).fold(tt.unknown,tt.nu),a=function(e,t){return Le(e,t).map((function(e){var n=Pe.detect(e.versionRegexes,t);return {current:e.name,version:n}}))}(o,e).fold(st.unknown,st.nu),u=function(e,t,n,r){var o=e.isiOS()&&!0===/ipad/i.test(n),i=e.isiOS()&&!o,a=e.isiOS()||e.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,f=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),l=!s&&!c&&!f;return {isiPad:k(o),isiPhone:k(i),isTablet:k(c),isPhone:k(s),isTouch:k(u),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:k(f),isDesktop:k(l)}}(a,i,e,n);return {browser:i,os:a,deviceType:u}},lt=function(e){return window.matchMedia(e).matches},dt=Te((function(){return ft(navigator.userAgent,I.from(navigator.userAgentData),lt)})),mt=function(){return dt()},gt=navigator.userAgent,pt=mt(),ht=pt.browser,vt=pt.os,bt=pt.deviceType,yt=/WebKit/.test(gt)&&!ht.isEdge(),Ct="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,xt=-1!==gt.indexOf("Windows Phone"),wt={opera:ht.isOpera(),webkit:yt,ie:!(!ht.isIE()&&!ht.isEdge())&&ht.version.major,gecko:ht.isFirefox(),mac:vt.isOSX()||vt.isiOS(),iOS:bt.isiPad()||bt.isiPhone(),android:vt.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:ht.isIE()?document.documentMode||7:10,fileApi:Ct,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!ht.isIE(),desktop:bt.isDesktop(),windowsPhone:xt,browser:{current:ht.current,version:ht.version,isChrome:ht.isChrome,isEdge:ht.isEdge,isFirefox:ht.isFirefox,isIE:ht.isIE,isOpera:ht.isOpera,isSafari:ht.isSafari},os:{current:vt.current,version:vt.version,isAndroid:vt.isAndroid,isChromeOS:vt.isChromeOS,isFreeBSD:vt.isFreeBSD,isiOS:vt.isiOS,isLinux:vt.isLinux,isOSX:vt.isOSX,isSolaris:vt.isSolaris,isWindows:vt.isWindows},deviceType:{isDesktop:bt.isDesktop,isiPad:bt.isiPad,isiPhone:bt.isiPhone,isPhone:bt.isPhone,isTablet:bt.isTablet,isTouch:bt.isTouch,isWebView:bt.isWebView}},St=/^\s*|\s*$/g,kt=function(e){return null==e?"":(""+e).replace(St,"")},Nt=function(e,t){return t?!("array"!==t||!xe(e))||typeof e===t:void 0!==e},Et=function(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),we(e,(function(e,o){if(!1===t.call(r,e,o,n))return !1;Et(e,t,n,r);})));},_t={trim:kt,isArray:xe,is:Nt,toArray:function(e){if(xe(e))return e;for(var t=[],n=0,r=e.length;n<r;n++)t[n]=e[n];return t},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:we,map:Se,grep:ke,inArray:Ne,hasOwn:ye,extend:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var o=t[r];for(var i in o)if(ye(o,i)){var a=o[i];void 0!==a&&(e[i]=a);}}return e},create:function(e,t,n){var r,o,i,a=this,u=0,c=(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e))[3].match(/(^|\.)(\w+)$/i)[2],s=a.createNS(e[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===e[2])return s[c]=t,void(this.onCreate&&this.onCreate(e[2],e[3],s[c]));t[c]||(t[c]=function(){},u=1),s[c]=t[c],a.extend(s[c].prototype,t),e[5]&&(r=a.resolve(e[5]).prototype,o=e[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=u?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],a.each(r,(function(e,t){s[c].prototype[t]=r[t];})),a.each(t,(function(e,t){r[t]?s[c].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==c&&(s[c].prototype[t]=e);}))),a.each(t.static,(function(e,t){s[c][t]=e;}));}},walk:Et,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||Nt(e,"array")?e:Se(e.split(t||","),kt)},_addCacheSuffix:function(e){var t=wt.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},At=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return {dom:e}},Rt={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return At(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return At(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return At(n)},fromDom:At,fromPoint:function(e,t,n){return I.from(e.dom.elementFromPoint(t,n)).map(At)}},Dt=function(e,t){var n=[],r=function(e){return n.push(e),t(e)},o=t(e);do{o=o.bind(r);}while(o.isSome());return n},Tt=function(e,t){var n=e.dom;if(1!==n.nodeType)return !1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},Ot=function(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount},Bt=function(e,t){return e.dom===t.dom},Pt=function(e,t){return n=e.dom,r=t.dom,function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)}(n,r,Node.DOCUMENT_POSITION_CONTAINED_BY);var n,r;},Lt=function(e,t){return mt().browser.isIE()?Pt(e,t):function(e,t){var n=e.dom,r=t.dom;return n!==r&&n.contains(r)}(e,t)};"undefined"!=typeof window?window:Function("return this;")();var It=function(e){return e.dom.nodeName.toLowerCase()},Mt=function(e){return e.dom.nodeType},Ft=function(e){return function(t){return Mt(t)===e}},Ut=Ft(1),zt=Ft(3),Ht=Ft(9),jt=Ft(11),Vt=function(e){return Rt.fromDom(e.dom.ownerDocument)},qt=function(e){return Ht(e)?e:Vt(e)},$t=function(e){return Rt.fromDom(qt(e).dom.defaultView)},Wt=function(e){return I.from(e.dom.parentNode).map(Rt.fromDom)},Kt=function(e){return I.from(e.dom.previousSibling).map(Rt.fromDom)},Xt=function(e){return I.from(e.dom.nextSibling).map(Rt.fromDom)},Yt=function(e){return te(Dt(e,Kt))},Gt=function(e){return Dt(e,Xt)},Jt=function(e){return V(e.dom.childNodes,Rt.fromDom)},Qt=function(e,t){var n=e.dom.childNodes;return I.from(n[t]).map(Rt.fromDom)},Zt=function(e){return Qt(e,0)},en=function(e){return Qt(e,e.dom.childNodes.length-1)},tn=function(e){return e.dom.childNodes.length},nn=function(e){return jt(e)&&b(e.dom.host)},rn=y(Element.prototype.attachShadow)&&y(Node.prototype.getRootNode),on=k(rn),an=rn?function(e){return Rt.fromDom(e.dom.getRootNode())}:qt,un=function(e){return nn(e)?e:function(e){var t=e.dom.head;if(null==t)throw new Error("Head is not available yet");return Rt.fromDom(t)}(qt(e))},cn=function(e){return Rt.fromDom(e.dom.host)},sn=function(e){return b(e.dom.shadowRoot)},fn=function(e,t){Wt(e).each((function(n){n.dom.insertBefore(t.dom,e.dom);}));},ln=function(e,t){Xt(e).fold((function(){Wt(e).each((function(e){mn(e,t);}));}),(function(e){fn(e,t);}));},dn=function(e,t){Zt(e).fold((function(){mn(e,t);}),(function(n){e.dom.insertBefore(t.dom,n.dom);}));},mn=function(e,t){e.dom.appendChild(t.dom);},gn=function(e,t){q(t,(function(t){mn(e,t);}));},pn=function(e){e.dom.textContent="",q(Jt(e),(function(e){hn(e);}));},hn=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t);},vn=function(e){var t,n=Jt(e);n.length>0&&(t=e,q(n,(function(e){fn(t,e);}))),hn(e);},bn=function(e){var t=zt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return !1;var n=t.ownerDocument;return function(e){var t=an(e);return nn(t)?I.some(t):I.none()}(Rt.fromDom(t)).fold((function(){return n.body.contains(t)}),S(bn,cn))},yn=function(e,t){return {left:e,top:t,translate:function(n,r){return yn(e+n,t+r)}}},Cn=yn,xn=function(e,t){return void 0!==e?e:void 0!==t?t:0},wn=function(e){var t=e.dom,n=t.ownerDocument.body;return n===t?Cn(n.offsetLeft,n.offsetTop):bn(e)?function(e){var t=e.getBoundingClientRect();return Cn(t.left,t.top)}(t):Cn(0,0)},Sn=function(e){var t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return Cn(n,r)},kn=function(e,t,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(e,t);},Nn=function(e,t){mt().browser.isSafari()&&y(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t);},En=function(e,t,n,r){return {x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}},_n=function(e){var t=void 0===e?window:e,n=t.document,r=Sn(Rt.fromDom(n));return function(e){var t=void 0===e?window:e;return mt().browser.isFirefox()?I.none():I.from(t.visualViewport)}(t).fold((function(){var e=t.document.documentElement,n=e.clientWidth,o=e.clientHeight;return En(r.left,r.top,n,o)}),(function(e){return En(Math.max(e.pageLeft,r.left),Math.max(e.pageTop,r.top),e.width,e.height)}))},An=function(e){return function(t){return !!t&&t.nodeType===e}},Rn=function(e){return !!e&&!Object.getPrototypeOf(e)},Dn=An(1),Tn=function(e){var t=e.map((function(e){return e.toLowerCase()}));return function(e){if(e&&e.nodeName){var n=e.nodeName.toLowerCase();return H(t,n)}return !1}},On=function(e,t){var n=t.toLowerCase().split(" ");return function(t){if(Dn(t))for(var r=0;r<n.length;r++){var o=t.ownerDocument.defaultView.getComputedStyle(t,null);if((o?o.getPropertyValue(e):null)===n[r])return !0}return !1}},Bn=function(e){return function(t){return Dn(t)&&t.hasAttribute(e)}},Pn=function(e){return Dn(e)&&e.hasAttribute("data-mce-bogus")},Ln=function(e){return Dn(e)&&"TABLE"===e.tagName},In=function(e){return function(t){if(Dn(t)){if(t.contentEditable===e)return !0;if(t.getAttribute("data-mce-contenteditable")===e)return !0}return !1}},Mn=Tn(["textarea","input"]),Fn=An(3),Un=An(8),zn=An(9),Hn=An(11),jn=Tn(["br"]),Vn=Tn(["img"]),qn=In("true"),$n=In("false"),Wn=Tn(["td","th"]),Kn=Tn(["video","audio","object","embed"]),Xn=function(e,t,n){return void 0===n&&(n=E),e.exists((function(e){return n(e,t)}))},Yn=function(e,t,n){return e.isSome()&&t.isSome()?I.some(n(e.getOrDie(),t.getOrDie())):I.none()},Gn=function(e){return void 0!==e.style&&y(e.style.getPropertyValue)},Jn=function(e,t,n){if(!(l(n)||p(n)||C(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"");},Qn=function(e,t,n){Jn(e.dom,t,n);},Zn=function(e,t){var n=e.dom;le(t,(function(e,t){Jn(n,t,e);}));},er=function(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n},tr=function(e,t){return I.from(er(e,t))},nr=function(e,t){e.dom.removeAttribute(t);},rr=function(e,t){var n=e.dom;le(t,(function(e,t){!function(e,t,n){if(!l(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Gn(e)&&e.style.setProperty(t,n);}(n,t,e);}));},or=function(e,t){var n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return ""!==r||bn(e)?r:ir(n,t)},ir=function(e,t){return Gn(e)?e.style.getPropertyValue(t):""},ar=function(e,t){var n=e.dom,r=ir(n,t);return I.from(r).filter((function(e){return e.length>0}))},ur=function(e){var t={},n=e.dom;if(Gn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o];}return t},cr=mt().browser,sr=function(e){return J(e,Ut)},fr=function(e,t){return e.children&&H(e.children,t)},lr=function(e,t,n){var r=0,o=0,i=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===or(Rt.fromDom(e),"position")){var a=t.getBoundingClientRect();return {x:r=a.left+(i.documentElement.scrollLeft||e.scrollLeft)-i.documentElement.clientLeft,y:o=a.top+(i.documentElement.scrollTop||e.scrollTop)-i.documentElement.clientTop}}for(var u=t;u&&u!==n&&u.nodeType&&!fr(u,n);){var c=u;r+=c.offsetLeft||0,o+=c.offsetTop||0,u=c.offsetParent;}for(u=t.parentNode;u&&u!==n&&u.nodeType&&!fr(u,n);)r-=u.scrollLeft||0,o-=u.scrollTop||0,u=u.parentNode;o+=function(e){return cr.isFirefox()&&"table"===It(e)?sr(Jt(e)).filter((function(e){return "caption"===It(e)})).bind((function(e){return sr(Gt(e)).map((function(t){var n=t.dom.offsetTop,r=e.dom.offsetTop,o=e.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0}(Rt.fromDom(t));}return {x:r,y:o}},dr={},mr={exports:dr};!function(e,t,n,r){var o,i;o=this,i=function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:{},t={exports:{}};!function(t){!function(e){var n=setTimeout;function r(){}function o(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=void 0,this._deferreds=[],f(e,this);}function i(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,o._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value);}catch(e){return void u(t.promise,e)}a(t.promise,r);}else (1===e._state?a:u)(t.promise,e._value);}))):e._deferreds.push(t);}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 o)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void f((r=n,i=t,function(){r.apply(i,arguments);}),e)}e._state=1,e._value=t,c(e);}catch(t){u(e,t);}var r,i;}function u(e,t){e._state=2,e._value=t,c(e);}function c(e){2===e._state&&0===e._deferreds.length&&o._immediateFn((function(){e._handled||o._unhandledRejectionFn(e._value);}));for(var t=0,n=e._deferreds.length;t<n;t++)i(e,e._deferreds[t]);e._deferreds=null;}function s(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n;}function f(e,t){var n=!1;try{e((function(e){n||(n=!0,a(t,e));}),(function(e){n||(n=!0,u(t,e));}));}catch(e){if(n)return;n=!0,u(t,e);}}o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=new this.constructor(r);return i(this,new s(e,t,n)),n},o.all=function(e){var t=Array.prototype.slice.call(e);return new o((function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(e){o(i,e);}),n)}t[i]=a,0==--r&&e(t);}catch(e){n(e);}}for(var i=0;i<t.length;i++)o(i,t[i]);}))},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o((function(t){t(e);}))},o.reject=function(e){return new o((function(t,n){n(e);}))},o.race=function(e){return new o((function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n);}))},o._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e);}:function(e){n(e,0);},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e);},o._setImmediateFn=function(e){o._immediateFn=e;},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e;},t.exports?t.exports=o:e.Promise||(e.Promise=o);}(e);}(t);var n=t.exports;return {boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||n}},"object"==typeof t&&void 0!==n?n.exports=i():"function"==typeof e&&e.amd?e(i):(o="undefined"!=typeof globalThis?globalThis:o||self).EphoxContactWrapper=i();}(void 0,dr,mr);var gr=mr.exports.boltExport,pr=function(e){var t=I.none(),n=[],r=function(e){o()?a(e):n.push(e);},o=function(){return t.isSome()},i=function(e){q(e,a);},a=function(e){t.each((function(t){setTimeout((function(){e(t);}),0);}));};return e((function(e){o()||(t=I.some(e),i(n),n=[]);})),{get:r,map:function(e){return pr((function(t){r((function(n){t(e(n));}));}))},isReady:o}},hr={nu:pr,pure:function(e){return pr((function(t){t(e);}))}},vr=function(e){setTimeout((function(){throw e}),0);},br=function(e){var t=function(t){e().then(t,vr);};return {map:function(t){return br((function(){return e().then(t)}))},bind:function(t){return br((function(){return e().then((function(e){return t(e).toPromise()}))}))},anonBind:function(t){return br((function(){return e().then((function(){return t.toPromise()}))}))},toLazy:function(){return hr.nu(t)},toCached:function(){var t=null;return br((function(){return null===t&&(t=e()),t}))},toPromise:e,get:t}},yr=function(e){return br((function(){return new gr(e)}))},Cr=function(e,t){return t((function(t){var n=[],r=0;0===e.length?t([]):q(e,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=e.length&&t(n);}}(i));}));}))},xr=function(e){return {isValue:O,isError:T,getOr:k(e),getOrThunk:k(e),getOrDie:k(e),or:function(t){return xr(e)},orThunk:function(t){return xr(e)},fold:function(t,n){return n(e)},map:function(t){return xr(t(e))},mapError:function(t){return xr(e)},each:function(t){t(e);},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return I.some(e)}}},wr=function(e){return {isValue:T,isError:O,getOr:N,getOrThunk:function(e){return e()},getOrDie:function(){return (t=String(e),function(){throw new Error(t)})();var t;},or:N,orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return wr(e)},mapError:function(t){return wr(t(e))},each:x,bind:function(t){return wr(e)},exists:T,forall:O,toOptional:I.none}},Sr={value:xr,error:wr,fromOption:function(e,t){return e.fold((function(){return wr(t)}),xr)}},kr=function(e){if(!m(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return q(e,(function(r,o){var i=se(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!m(u))throw new Error("case arguments must be an array");t.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+i);var c=function(e){var r=se(e);if(t.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+r.join(","));if(!ee(t,(function(e){return H(r,e)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,n)};return {fold:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);var i=t[o];return i.apply(null,n)},match:c,log:function(e){console.log(e,{constructors:t,constructor:a,params:n});}}};})),n};kr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Nr=function(e){return e.fold(N,N)};function Er(e,t,n,r,o){return e(n,r)?I.some(n):y(o)&&o(n)?I.none():t(n,r,o)}var _r,Ar,Rr,Dr,Tr,Or,Br,Pr,Lr,Ir,Mr,Fr,Ur,zr,Hr,jr,Vr,qr,$r,Wr,Kr=function(e,t,n){for(var r=e.dom,o=y(n)?n:T;r.parentNode;){r=r.parentNode;var i=Rt.fromDom(r);if(t(i))return I.some(i);if(o(i))break}return I.none()},Xr=function(e,t,n){return Er((function(e,t){return t(e)}),Kr,e,t,n)},Yr=function(e,t){return J(e.dom.childNodes,(function(e){return t(Rt.fromDom(e))})).map(Rt.fromDom)},Gr=function(e,t,n){return Kr(e,(function(e){return Tt(e,t)}),n)},Jr=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return Ot(n)?I.none():I.from(n.querySelector(e)).map(Rt.fromDom)}(t,e)},Qr=function(e,t,n){return Er((function(e,t){return Tt(e,t)}),Gr,e,t,n)},Zr=window.Promise?window.Promise:gr,eo=function(e,t){return "number"!=typeof t&&(t=0),setTimeout(e,t)},to=function(e,t){return "number"!=typeof t&&(t=1),setInterval(e,t)},no=function(e,t){var n,r=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=eo((function(){e.apply(this,r);}),t);};return r.stop=function(){clearTimeout(n);},r},ro={requestAnimationFrame:function(e,t){_r?_r.then(e):_r=new Zr((function(e){t||(t=document.body),function(e,t){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];n||(n=function(e){window.setTimeout(e,0);}),n(e,t);}(e,t);})).then(e);},setTimeout:eo,setInterval:to,setEditorTimeout:function(e,t,n){return eo((function(){e.removed||t();}),n)},setEditorInterval:function(e,t,n){var r=to((function(){e.removed?clearInterval(r):t();}),n);return r},debounce:no,throttle:no,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},oo=function(e,t){void 0===t&&(t={});var n=0,r={},o=Rt.fromDom(e),i=qt(o),a=t.maxLoadTime||5e3,u=function(u,c,s){var f,l=_t._addCacheSuffix(u),d=function(e){return be(r,e).getOrThunk((function(){return {id:"mce-u"+n++,passed:[],failed:[],count:0}}))}(l);r[l]=d,d.count++;var m=function(e,t){for(var n=e.length;n--;)e[n]();d.status=t,d.passed=[],d.failed=[],f&&(f.onload=null,f.onerror=null,f=null);},g=function(){return m(d.passed,2)},p=function(){return m(d.failed,3)},h=function(){var t,n;t=function(){for(var t=e.styleSheets,n=t.length;n--;){var r=t[n].ownerNode;if(r&&r.id===f.id)return g(),!0}return !1},n=h,t()||(Date.now()-y<a?ro.setTimeout(n):p());};if(c&&d.passed.push(c),s&&d.failed.push(s),1!==d.status)if(2!==d.status)if(3!==d.status){d.status=1;var v=Rt.fromTag("link",i.dom);Zn(v,{rel:"stylesheet",type:"text/css",id:d.id});var b,y=Date.now();t.contentCssCors&&Qn(v,"crossOrigin","anonymous"),t.referrerPolicy&&Qn(v,"referrerpolicy",t.referrerPolicy),(f=v.dom).onload=h,f.onerror=p,b=v,mn(un(o),b),Qn(v,"href",l);}else p();else g();},c=function(e){return yr((function(t){u(e,w(t,k(Sr.value(e))),w(t,k(Sr.error(e))));}))},s=function(e){var t=_t._addCacheSuffix(e);be(r,t).each((function(e){var n,i;0===--e.count&&(delete r[t],n=e.id,i=un(o),Jr(i,"#"+n).each(hn));}));};return {load:u,loadAll:function(e,t,n){var r;(r=V(e,c),Cr(r,yr)).get((function(e){var r=W(e,(function(e){return e.isValue()}));r.fail.length>0?n(r.fail.map(Nr)):t(r.pass.map(Nr));}));},unload:s,unloadAll:function(e){q(e,(function(e){s(e);}));},_setReferrerPolicy:function(e){t.referrerPolicy=e;}}},io=function(){var e=new WeakMap;return {forElement:function(t,n){var r=an(t).dom;return I.from(e.get(r)).getOrThunk((function(){var t=oo(r,n);return e.set(r,t),t}))}}}(),ao=function(){function e(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this);}return e.prototype.current=function(){return this.node},e.prototype.next=function(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node},e.prototype.prev=function(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node},e.prototype.prev2=function(e){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",e),this.node},e.prototype.findSibling=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==this.rootNode){if(o=e[n])return o;for(i=e.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},e.prototype.findPreviousNode=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==this.rootNode)return i}},e}(),uo=function(e){var t;return function(n){return t=t||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}(e,O),ye(t,It(n))}},co=uo(["h1","h2","h3","h4","h5","h6"]),so=uo(["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 Ut(e)&&!so(e)},lo=function(e){return Ut(e)&&"br"===It(e)},mo=uo(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),go=uo(["ul","ol","dl"]),po=uo(["li","dd","dt"]),ho=uo(["thead","tbody","tfoot"]),vo=uo(["td","th"]),bo=uo(["pre","script","textarea","style"]),yo=" ",Co="\ufeff",xo=function(e){return "\ufeff"===e},wo=function(e){return e.replace(/\uFEFF/g,"")},So=Dn,ko=Fn,No=function(e){return ko(e)&&(e=e.parentNode),So(e)&&e.hasAttribute("data-mce-caret")},Eo=function(e){return ko(e)&&xo(e.data)},_o=function(e){return No(e)||Eo(e)},Ao=function(e){return e.firstChild!==e.lastChild||!jn(e.firstChild)},Ro=function(e){var t=e.container();return !!Fn(t)&&(t.data.charAt(e.offset())===Co||e.isAtStart()&&Eo(t.previousSibling))},Do=function(e){var t=e.container();return !!Fn(t)&&(t.data.charAt(e.offset()-1)===Co||e.isAtEnd()&&Eo(t.nextSibling))},To=function(e,t,n){var r,o=t.ownerDocument.createElement(e);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=t.parentNode;return n?i.insertBefore(o,t):t.nextSibling?i.insertBefore(o,t.nextSibling):i.appendChild(o),o},Oo=function(e){return ko(e)&&e.data[0]===Co},Bo=function(e){return ko(e)&&e.data[e.data.length-1]===Co},Po=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],Pn(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;},Lo=function(e){return No(e.startContainer)},Io=qn,Mo=$n,Fo=jn,Uo=Fn,zo=Tn(["script","style","textarea"]),Ho=Tn(["img","input","textarea","hr","iframe","video","audio","object","embed"]),jo=Tn(["table"]),Vo=_o,qo=function(e){return !Vo(e)&&(Uo(e)?!zo(e.parentNode):Ho(e)||Fo(e)||jo(e)||$o(e))},$o=function(e){return !1===function(e){return Dn(e)&&"true"===e.getAttribute("unselectable")}(e)&&Mo(e)},Wo=function(e,t){return qo(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if($o(e))return !1;if(Io(e))return !0}return !0}(e,t)},Ko=/^[ \t\r\n]*$/,Xo=function(e){return Ko.test(e)},Yo=function(e,t){var n,r,o,i=Rt.fromDom(t),a=Rt.fromDom(e);return n=a,r="pre,code",o=_(Bt,i),Gr(n,r,o).isSome()},Go=function(e,t){return qo(e)&&!1===function(e,t){return Fn(e)&&Xo(e.data)&&!1===Yo(e,t)}(e,t)||function(e){return Dn(e)&&"A"===e.nodeName&&!e.hasAttribute("href")&&(e.hasAttribute("name")||e.hasAttribute("id"))}(e)||Jo(e)},Jo=Bn("data-mce-bookmark"),Qo=Bn("data-mce-bogus"),Zo=(Ar="data-mce-bogus",Rr="all",function(e){return Dn(e)&&e.getAttribute(Ar)===Rr}),ei=function(e,t){return void 0===t&&(t=!0),function(e,t){var n=0;if(Go(e,e))return !1;var r=e.firstChild;if(!r)return !0;var o=new ao(r,e);do{if(t){if(Zo(r)){r=o.next(!0);continue}if(Qo(r)){r=o.next();continue}}if(jn(r))n++,r=o.next();else {if(Go(r,e))return !1;r=o.next();}}while(r);return n<=1}(e.dom,t)},ti=function(e,t){return b(e)&&(Go(e,t)||fo(Rt.fromDom(e)))},ni=function(e){return function(e){return "span"===e.nodeName.toLowerCase()}(e)&&"bookmark"===e.getAttribute("data-mce-type")},ri=function(e,t){return Fn(e)&&e.data.length>0&&function(e,t){var n=new ao(e,t).prev(!1),r=new ao(e,t).next(!1),o=h(n)||ti(n,t),i=h(r)||ti(r,t);return o&&i}(e,t)},oi=function(e,t,n){var r=n||t;if(Dn(t)&&ni(t))return t;for(var o=t.childNodes,i=o.length-1;i>=0;i--)oi(e,o[i],r);if(Dn(t)){var a=t.childNodes;1===a.length&&ni(a[0])&&t.parentNode.insertBefore(a[0],t);}return function(e){return Hn(e)||zn(e)}(t)||Go(t,r)||function(e){return !!Dn(e)&&e.childNodes.length>0}(t)||ri(t,r)||e.remove(t),t},ii=_t.makeMap,ai=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ui=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ci=/[<>&\"\']/g,si=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,fi={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},li={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},di={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},mi=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)),li[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}},gi=mi("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),pi=function(e,t){return e.replace(t?ai:ui,(function(e){return li[e]||e}))},hi=function(e,t){return e.replace(t?ai:ui,(function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":li[e]||"&#"+e.charCodeAt(0)+";"}))},vi=function(e,t,n){return n=n||gi,e.replace(t?ai:ui,(function(e){return li[e]||n[e]||e}))},bi={encodeRaw:pi,encodeAllRaw:function(e){return (""+e).replace(ci,(function(e){return li[e]||e}))},encodeNumeric:hi,encodeNamed:vi,getEncodeFunc:function(e,t){var n=mi(t)||gi,r=ii(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?ai:ui,(function(e){return void 0!==li[e]?li[e]:void 0!==n[e]?n[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"}))}:r.named?t?function(e,t){return vi(e,t,n)}:vi:r.numeric?hi:pi},decode:function(e){return e.replace(si,(function(e,t){return t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):fi[t]||String.fromCharCode(t):di[e]||gi[e]||function(e){var t=Rt.fromTag("div").dom;return t.innerHTML=e,t.textContent||t.innerText||e}(e)}))}},yi={},Ci={},xi=_t.makeMap,wi=_t.each,Si=_t.extend,ki=_t.explode,Ni=_t.inArray,Ei=function(e,t){return (e=_t.trim(e))?e.split(t||" "):[]},_i=function(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),wi(e,(function(e,r){n[r]=n[r.toUpperCase()]="map"===t?xi(e,/[, ]/):ki(e,/[, ]/);}))),n},Ai=function(e){var t={},n={},r=[],o={},i={},a=function(t,n,r){var o=e[t];return o?o=xi(o,/[, ]/,xi(o.toUpperCase(),/[, ]/)):(o=yi[t])||(o=xi(n," ",xi(n.toUpperCase()," ")),o=Si(o,r),yi[t]=o),o},u=function(e){var t,n,r,o,i,a,u={},c=function(e,n,r){var o,i,a,c=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};n=n||"","string"==typeof(r=r||[])&&(r=Ei(r));var s=Ei(e);for(o=s.length;o--;)a={attributes:c(i=Ei([t,n].join(" "))),attributesOrder:i,children:c(r,Ci)},u[s[o]]=a;},s=function(e,t){var n,r,o,i,a=Ei(e);n=a.length;for(var c=Ei(t);n--;)for(r=u[a[n]],o=0,i=c.length;o<i;o++)r.attributes[c[o]]={},r.attributesOrder.push(c[o]);};return yi[e]?yi[e]:(t="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(t+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(t+=" xml:lang",r=[r,a="acronym applet basefont big font strike tt"].join(" "),wi(Ei(a),(function(e){c(e,"",r);})),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),wi(Ei(i),(function(e){c(e,"",o);}))),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",r),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==e&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==e&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),wi(Ei("a form meter progress dfn"),(function(e){u[e]&&delete u[e].children[e];})),delete u.caption.children.table,delete u.script,yi[e]=u,u)}((e=e||{}).schema);!1===e.verify_html&&(e.valid_elements="*[*]");var c=_i(e.valid_styles),s=_i(e.invalid_styles,"map"),f=_i(e.valid_classes,"map"),l=a("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=a("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=a("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),g=a("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),p="td th iframe video audio object script code",h=a("non_empty_elements",p+" pre",m),v=a("move_caret_before_on_enter_elements",p+" table",m),b=a("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),y=a("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",b),C=a("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");wi((e.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(e){i[e]=new RegExp("</"+e+"[^>]*>","gi");}));var x=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},w=function(e){var n,o,i,a,u,c,s,f,l,d,m,g,p,h,v,b,y,C,w=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,k=/[*?+]/;if(e){var N=Ei(e,",");for(t["@"]&&(b=t["@"].attributes,y=t["@"].attributesOrder),n=0,o=N.length;n<o;n++)if(u=w.exec(N[n])){if(h=u[1],l=u[2],v=u[3],f=u[5],c={attributes:g={},attributesOrder:p=[]},"#"===h&&(c.paddEmpty=!0),"-"===h&&(c.removeEmpty=!0),"!"===u[4]&&(c.removeEmptyAttrs=!0),b&&(le(b,(function(e,t){g[t]=e;})),p.push.apply(p,y)),f)for(i=0,a=(f=Ei(f,"|")).length;i<a;i++)if(u=S.exec(f[i])){if(s={},m=u[1],d=u[2].replace(/[\\:]:/g,":"),h=u[3],C=u[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete g[d],p.splice(Ni(p,d),1);continue}h&&("="===h&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:C}),s.defaultValue=C),":"===h&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:C}),s.forcedValue=C),"<"===h&&(s.validValues=xi(C,"?"))),k.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=x(d),c.attributePatterns.push(s)):(g[d]||p.push(d),g[d]=s);}b||"@"!==l||(b=g,y=p),v&&(c.outputName=l,t[v]=c),k.test(l)?(c.pattern=x(l),r.push(c)):t[l]=c;}}},S=function(e){t={},r=[],w(e),wi(u,(function(e,t){n[t]=e.children;}));},N=function(e){var r=/^(~)?(.+)$/;e&&(yi.text_block_elements=yi.block_elements=null,wi(Ei(e,","),(function(e){var i=r.exec(e),a="~"===i[1],u=a?"span":"div",c=i[2];if(n[c]=n[u],o[c]=u,a||(y[c.toUpperCase()]={},y[c]={}),!t[c]){var s=t[u];delete(s=Si({},s)).removeEmptyAttrs,delete s.removeEmpty,t[c]=s;}wi(n,(function(e,t){e[u]&&(n[t]=e=Si({},n[t]),e[c]=e[u]);}));})));},E=function(t){var r=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;yi[e.schema]=null,t&&wi(Ei(t,","),(function(e){var t,o,i=r.exec(e);i&&(o=i[1],t=o?n[i[2]]:n[i[2]]={"#comment":{}},t=n[i[2]],wi(Ei(i[3],"|"),(function(e){"-"===o?delete t[e]:t[e]={};})));}));},_=function(e){var n,o=t[e];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(e))return o};e.valid_elements?S(e.valid_elements):(wi(u,(function(e,r){t[r]={attributes:e.attributes,attributesOrder:e.attributesOrder},n[r]=e.children;})),"html5"!==e.schema&&wi(Ei("strong/b em/i"),(function(e){var n=Ei(e,"/");t[n[1]].outputName=n[0];})),wi(Ei("ol ul sub sup blockquote span font a table tbody strong em b i"),(function(e){t[e]&&(t[e].removeEmpty=!0);})),wi(Ei("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(e){t[e].paddEmpty=!0;})),wi(Ei("span"),(function(e){t[e].removeEmptyAttrs=!0;}))),N(e.custom_elements),E(e.valid_children),w(e.extended_valid_elements),E("+ol[ul|ol],+ul[ul|ol]"),wi({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,n){t[n]&&(t[n].parentsRequired=Ei(e));})),e.invalid_elements&&wi(ki(e.invalid_elements),(function(e){t[e]&&delete t[e];})),_("span")||w("span[!data-mce-type|*]");var A=k(c),R=k(s),D=k(f),T=k(g),O=k(y),B=k(b),P=k(C),L=k(m),I=k(d),M=k(h),F=k(v),U=k(l),z=k(i),H=k(o);return {children:n,elements:t,getValidStyles:A,getValidClasses:D,getBlockElements:O,getInvalidStyles:R,getShortEndedElements:L,getTextBlockElements:B,getTextInlineElements:P,getBoolAttrs:T,getElementRule:_,getSelfClosingElements:I,getNonEmptyElements:M,getMoveCaretBeforeOnEnterElements:F,getWhiteSpaceElements:U,getSpecialElements:z,isValidChild:function(e,t){var r=n[e.toLowerCase()];return !(!r||!r[t.toLowerCase()])},isValid:function(e,t){var n,r,o=_(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:H,addValidElements:w,setValidElements:S,addCustomElements:N,addValidChildren:E}},Ri=function(e,t,n,r){var o=function(e){return (e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return "#"+o(t)+o(n)+o(r)},Di=function(e,t){var n,r,o,i=this,a=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,u=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,c=/\s*([^:]+):\s*([^;]+);?/g,s=/\s+$/,f={},l="\ufeff";e=e||{},t&&(r=t.getValidStyles(),o=t.getInvalidStyles());var d="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<d.length;n++)f[d[n]]=l+n,f[l+n]=d[n];return {toHex:function(e){return e.replace(a,Ri)},parse:function(t){var r,o,d,m,g,p,h,v,b={},y=e.url_converter,C=e.url_converter_scope||i,x=function(e,t,r){var o=b[e+"-top"+t];if(o){var i=b[e+"-right"+t];if(i){var a=b[e+"-bottom"+t];if(a){var u=b[e+"-left"+t];if(u){var c=[o,i,a,u];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(b[e+t]=-1===n?c[0]:c.join(" "),delete b[e+"-top"+t],delete b[e+"-right"+t],delete b[e+"-bottom"+t],delete b[e+"-left"+t]);}}}}},w=function(e){var t,n=b[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return !1;return b[e]=n[0],!0}},S=function(e){return m=!0,f[e]},k=function(e,t){return m&&(e=e.replace(/\uFEFF[0-9]/g,(function(e){return f[e]}))),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},N=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},E=function(e){return e.replace(/\\[0-9a-f]+/gi,N)},_=function(t,n,r,o,i,a){if(i=i||a)return "'"+(i=k(i)).replace(/\'/g,"\\'")+"'";if(n=k(n||r||o),!e.allow_script_urls){var u=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(u))return "";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(u))return ""}return y&&(n=y.call(C,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(t){for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,S).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(e){return e.replace(/[;:]/g,S)}));r=c.exec(t);)if(c.lastIndex=r.index+r[0].length,o=r[1].replace(s,"").toLowerCase(),d=r[2].replace(s,""),o&&d){if(o=E(o),d=E(d),-1!==o.indexOf(l)||-1!==o.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(d)))continue;"font-weight"===o&&"700"===d?d="bold":"color"!==o&&"background-color"!==o||(d=d.toLowerCase()),d=(d=d.replace(a,Ri)).replace(u,_),b[o]=m?k(d,!0):d;}x("border","",!0),x("border","-width"),x("border","-color"),x("border","-style"),x("padding",""),x("margin",""),g="border",h="border-style",v="border-color",w(p="border-width")&&w(h)&&w(v)&&(b[g]=b[p]+" "+b[h]+" "+b[v],delete b[p],delete b[h],delete b[v]),"medium none"===b.border&&delete b.border,"none"===b["border-image"]&&delete b["border-image"];}return b},serialize:function(e,t){var n="",i=function(t){var o,i=r[t];if(i)for(var a=0,u=i.length;a<u;a++)t=i[a],(o=e[t])&&(n+=(n.length>0?" ":"")+t+": "+o+";");};return t&&r?(i("*"),i(t)):le(e,(function(e,r){!e||o&&!function(e,t){var n=o["*"];return !(n&&n[e]||(n=o[t])&&n[e])}(r,t)||(n+=(n.length>0?" ":"")+r+": "+e+";");})),n}}},Ti={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Oi=function(e){return e instanceof Event||y(e.initEvent)},Bi=function(e,t,n,r){var o,i=function(e,t){var n=null!=t?t:{};for(var r in e)ye(Ti,r)||(n[r]=e[r]);return b(n.composedPath)&&(n.composedPath=function(){return e.composedPath()}),n}(t,r);return i.type=e,v(i.target)&&(i.target=null!==(o=i.srcElement)&&void 0!==o?o:n),function(e){return v(e.preventDefault)||Oi(e)}(t)&&(i.preventDefault=function(){i.defaultPrevented=!0,i.isDefaultPrevented=O,y(t.preventDefault)?t.preventDefault():Oi(t)&&(t.returnValue=!1);},i.stopPropagation=function(){i.cancelBubble=!0,i.isPropagationStopped=O,y(t.stopPropagation)?t.stopPropagation():Oi(t)&&(t.cancelBubble=!0);},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=O,i.stopPropagation();},function(e){return e.isDefaultPrevented===O||e.isDefaultPrevented===T}(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?O:T,i.isPropagationStopped=!0===i.cancelBubble?O:T,i.isImmediatePropagationStopped=T)),i},Pi=/^(?:mouse|contextmenu)|click/,Li=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n);},Ii=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n);},Mi=function(e,t){var n=Bi(e.type,e,document,t);if(function(e){return b(e)&&Pi.test(e.type)}(e)&&h(e.pageX)&&!h(e.clientX)){var r=n.target.ownerDocument||document,o=r.documentElement,i=r.body,a=n;a.pageX=e.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),a.pageY=e.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0);}return h(n.metaKey)&&(n.metaKey=!1),n},Fi=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else {var i=function(){Ii(e,"DOMContentLoaded",i),Ii(e,"load",i),n.domLoaded||(n.domLoaded=!0,t(o)),e=null;};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():Li(e,"DOMContentLoaded",i),n.domLoaded||Li(e,"load",i);}},Ui=function(){function e(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1;}return e.prototype.bind=function(e,t,n,r){var o,i,a,u,c,s,f,l=this,d=window,m=function(e){l.executeHandlers(Mi(e||d.event),o);};if(e&&3!==e.nodeType&&8!==e.nodeType){e[l.expando]?o=e[l.expando]:(o=l.count++,e[l.expando]=o,l.events[o]={}),r=r||e;var g=t.split(" ");for(a=g.length;a--;)s=m,c=f=!1,"DOMContentLoaded"===(u=g[a])&&(u="ready"),l.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,Mi({type:u})):(l.hasMouseEnterLeave||(c=l.mouseEnterLeave[u])&&(s=function(e){var t=e.currentTarget,n=e.relatedTarget;if(n&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=Mi(e||d.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,l.executeHandlers(e,o));}),l.hasFocusIn||"focusin"!==u&&"focusout"!==u||(f=!0,c="focusin"===u?"focus":"blur",s=function(e){(e=Mi(e||d.event)).type="focus"===e.type?"focusin":"focusout",l.executeHandlers(e,o);}),(i=l.events[o][u])?"ready"===u&&l.domLoaded?n(Mi({type:u})):i.push({func:n,scope:r}):(l.events[o][u]=i=[{func:n,scope:r}],i.fakeName=c,i.capture=f,i.nativeHandler=s,"ready"===u?Fi(e,s,l):Li(e,c||u,s,f)));return e=i=null,n}},e.prototype.unbind=function(e,t,n){var r,o,i,a,u;if(!e||3===e.nodeType||8===e.nodeType)return this;var c=e[this.expando];if(c){if(u=this.events[c],t){var s=t.split(" ");for(o=s.length;o--;)if(r=u[a=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var f=r.nativeHandler,l=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=f,r.fakeName=l,r.capture=d,u[a]=r;}n&&0!==r.length||(delete u[a],Ii(e,r.fakeName||a,r.nativeHandler,r.capture));}}else le(u,(function(t,n){Ii(e,t.fakeName||n,t.nativeHandler,t.capture);})),u={};for(a in u)if(ye(u,a))return this;delete this.events[c];try{delete e[this.expando];}catch(t){e[this.expando]=null;}}return this},e.prototype.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return this;var o=Mi({type:t,target:e},n);do{(r=e[this.expando])&&this.executeHandlers(o,r),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;}while(e&&!o.isPropagationStopped());return this},e.prototype.clean=function(e){var t,n;if(!e||3===e.nodeType||8===e.nodeType)return this;if(e[this.expando]&&this.unbind(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(this.unbind(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[this.expando]&&this.unbind(e);return this},e.prototype.destroy=function(){this.events={};},e.prototype.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1},e.prototype.executeHandlers=function(e,t){var n=this.events[t],r=n&&n[e.type];if(r)for(var o=0,i=r.length;o<i;o++){var a=r[o];if(a&&!1===a.func.call(a.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return}},e.Event=new e,e}(),zi="sizzle"+-new Date,Hi=window.document,ji=0,Vi=0,qi=Sa(),$i=Sa(),Wi=Sa(),Ki=function(e,t){return e===t&&(Ur=!0),0},Xi="undefined",Yi=1<<31,Gi={}.hasOwnProperty,Ji=[],Qi=Ji.pop,Zi=Ji.push,ea=Ji.push,ta=Ji.slice,na=Ji.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return -1},ra="[\\x20\\t\\r\\n\\f]",oa="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ia="\\[[\\x20\\t\\r\\n\\f]*("+oa+")(?:"+ra+"*([*^$|!~]?=)"+ra+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+oa+"))|)"+ra+"*\\]",aa=":("+oa+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ia+")*)|.*)\\)|)",ua=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),ca=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),sa=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),fa=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),la=new RegExp(aa),da=new RegExp("^"+oa+"$"),ma={ID:new RegExp("^#("+oa+")"),CLASS:new RegExp("^\\.("+oa+")"),TAG:new RegExp("^("+oa+"|[*])"),ATTR:new RegExp("^"+ia),PSEUDO:new RegExp("^"+aa),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},ga=/^(?:input|select|textarea|button)$/i,pa=/^h\d$/i,ha=/^[^{]+\{\s*\[native \w/,va=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ba=/[+~]/,ya=/'|\\/g,Ca=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),xa=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{ea.apply(Ji=ta.call(Hi.childNodes),Hi.childNodes),Ji[Hi.childNodes.length].nodeType;}catch(e){ea={apply:Ji.length?function(e,t){Zi.apply(e,ta.call(t));}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1;}};}var wa=function(e,t,n,r){var o,i,a,u,c,s,f,l,d,m;if((t?t.ownerDocument||t:Hi)!==Hr&&zr(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Hr).nodeType)&&9!==u)return [];if(Vr&&!r){if(o=va.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))&&Wr(t,i)&&i.id===a)return n.push(i),n}else {if(o[2])return ea.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&Dr.getElementsByClassName)return ea.apply(n,t.getElementsByClassName(a)),n}if(Dr.qsa&&(!qr||!qr.test(e))){if(l=f=zi,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(s=Pr(e),(f=t.getAttribute("id"))?l=f.replace(ya,"\\$&"):t.setAttribute("id",l),l="[id='"+l+"'] ",c=s.length;c--;)s[c]=l+Ra(s[c]);d=ba.test(e)&&_a(t.parentNode)||t,m=s.join(",");}if(m)try{return ea.apply(n,d.querySelectorAll(m)),n}catch(e){}finally{f||t.removeAttribute("id");}}}return Ir(e.replace(ua,"$1"),t,n,r)};function Sa(){var e=[];return function t(n,r){return e.push(n+" ")>Tr.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function ka(e){return e[zi]=!0,e}function Na(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||Yi)-(~e.sourceIndex||Yi);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return -1;return e?1:-1}function Ea(e){return ka((function(t){return t=+t,ka((function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]));}))}))}function _a(e){return e&&typeof e.getElementsByTagName!==Xi&&e}function Aa(){}function Ra(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Da(e,t,n){var r=t.dir,o=n&&"parentNode"===r,i=Vi++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,a){var u,c,s=[ji,i];if(a){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,a))return !0}else for(;t=t[r];)if(1===t.nodeType||o){if((u=(c=t[zi]||(t[zi]={}))[r])&&u[0]===ji&&u[1]===i)return s[2]=u[2];if(c[r]=s,s[2]=e(t,n,a))return !0}}}function Ta(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return !1;return !0}:e[0]}function Oa(e,t,n,r,o){for(var i,a=[],u=0,c=e.length,s=null!=t;u<c;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),s&&t.push(u)));return a}function Ba(e,t,n,r,o,i){return r&&!r[zi]&&(r=Ba(r)),o&&!o[zi]&&(o=Ba(o,i)),ka((function(i,a,u,c){var s,f,l,d=[],m=[],g=a.length,p=i||function(e,t,n){for(var r=0,o=t.length;r<o;r++)wa(e,t[r],n);return n}(t||"*",u.nodeType?[u]:u,[]),h=!e||!i&&t?p:Oa(p,d,e,u,c),v=n?o||(i?e:g||r)?[]:a:h;if(n&&n(h,v,u,c),r)for(s=Oa(v,m),r(s,[],u,c),f=s.length;f--;)(l=s[f])&&(v[m[f]]=!(h[m[f]]=l));if(i){if(o||e){if(o){for(s=[],f=v.length;f--;)(l=v[f])&&s.push(h[f]=l);o(null,v=[],s,c);}for(f=v.length;f--;)(l=v[f])&&(s=o?na.call(i,l):d[f])>-1&&(i[s]=!(a[s]=l));}}else v=Oa(v===a?v.splice(g,v.length):v),o?o(null,a,v,c):ea.apply(a,v);}))}function Pa(e){for(var t,n,r,o=e.length,i=Tr.relative[e[0].type],a=i||Tr.relative[" "],u=i?1:0,c=Da((function(e){return e===t}),a,!0),s=Da((function(e){return na.call(t,e)>-1}),a,!0),f=[function(e,n,r){var o=!i&&(r||n!==Mr)||((t=n).nodeType?c(e,n,r):s(e,n,r));return t=null,o}];u<o;u++)if(n=Tr.relative[e[u].type])f=[Da(Ta(f),n)];else {if((n=Tr.filter[e[u].type].apply(null,e[u].matches))[zi]){for(r=++u;r<o&&!Tr.relative[e[r].type];r++);return Ba(u>1&&Ta(f),u>1&&Ra(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(ua,"$1"),n,u<r&&Pa(e.slice(u,r)),r<o&&Pa(e=e.slice(r)),r<o&&Ra(e))}f.push(n);}return Ta(f)}Dr=wa.support={},Br=wa.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return !!t&&"HTML"!==t.nodeName},zr=wa.setDocument=function(e){var t,n=e?e.ownerDocument||e:Hi,r=n.defaultView;return n!==Hr&&9===n.nodeType&&n.documentElement?(Hr=n,jr=n.documentElement,Vr=!Br(n),r&&r!==function(e){try{return e.top}catch(e){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){zr();}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){zr();}))),Dr.attributes=!0,Dr.getElementsByTagName=!0,Dr.getElementsByClassName=ha.test(n.getElementsByClassName),Dr.getById=!0,Tr.find.ID=function(e,t){if(typeof t.getElementById!==Xi&&Vr){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},Tr.filter.ID=function(e){var t=e.replace(Ca,xa);return function(e){return e.getAttribute("id")===t}},Tr.find.TAG=Dr.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Xi)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},Tr.find.CLASS=Dr.getElementsByClassName&&function(e,t){if(Vr)return t.getElementsByClassName(e)},$r=[],qr=[],Dr.disconnectedMatch=!0,qr=qr.length&&new RegExp(qr.join("|")),$r=$r.length&&new RegExp($r.join("|")),t=ha.test(jr.compareDocumentPosition),Wr=t||ha.test(jr.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},Ki=t?function(e,t){if(e===t)return Ur=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!Dr.sortDetached&&t.compareDocumentPosition(e)===r?e===n||e.ownerDocument===Hi&&Wr(Hi,e)?-1:t===n||t.ownerDocument===Hi&&Wr(Hi,t)?1:Fr?na.call(Fr,e)-na.call(Fr,t):0:4&r?-1:1)}:function(e,t){if(e===t)return Ur=!0,0;var r,o=0,i=e.parentNode,a=t.parentNode,u=[e],c=[t];if(!i||!a)return e===n?-1:t===n?1:i?-1:a?1:Fr?na.call(Fr,e)-na.call(Fr,t):0;if(i===a)return Na(e,t);for(r=e;r=r.parentNode;)u.unshift(r);for(r=t;r=r.parentNode;)c.unshift(r);for(;u[o]===c[o];)o++;return o?Na(u[o],c[o]):u[o]===Hi?-1:c[o]===Hi?1:0},n):Hr},wa.matches=function(e,t){return wa(e,null,null,t)},wa.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Hr&&zr(e),t=t.replace(fa,"='$1']"),Dr.matchesSelector&&Vr&&(!$r||!$r.test(t))&&(!qr||!qr.test(t)))try{var n=undefined.call(e,t);if(n||Dr.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return wa(t,Hr,null,[e]).length>0},wa.contains=function(e,t){return (e.ownerDocument||e)!==Hr&&zr(e),Wr(e,t)},wa.attr=function(e,t){(e.ownerDocument||e)!==Hr&&zr(e);var n=Tr.attrHandle[t.toLowerCase()],r=n&&Gi.call(Tr.attrHandle,t.toLowerCase())?n(e,t,!Vr):void 0;return void 0!==r?r:Dr.attributes||!Vr?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},wa.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},wa.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Ur=!Dr.detectDuplicates,Fr=!Dr.sortStable&&e.slice(0),e.sort(Ki),Ur){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1);}return Fr=null,e},Or=wa.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+=Or(e);}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=Or(t);return n},Tr=wa.selectors={cacheLength:50,createPseudo:ka,match:ma,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(Ca,xa),e[3]=(e[3]||e[4]||e[5]||"").replace(Ca,xa),"~="===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]||wa.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]&&wa.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ma.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&la.test(n)&&(t=Pr(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(Ca,xa).toLowerCase();return "*"===e?function(){return !0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=qi[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+ra+"|$)"))&&qi(e,(function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Xi&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var o=wa.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===o?function(e){return !!e.parentNode}:function(t,n,c){var s,f,l,d,m,g,p=i!==a?"nextSibling":"previousSibling",h=t.parentNode,v=u&&t.nodeName.toLowerCase(),b=!c&&!u;if(h){if(i){for(;p;){for(l=t;l=l[p];)if(u?l.nodeName.toLowerCase()===v:1===l.nodeType)return !1;g=p="only"===e&&!g&&"nextSibling";}return !0}if(g=[a?h.firstChild:h.lastChild],a&&b){for(m=(s=(f=h[zi]||(h[zi]={}))[e]||[])[0]===ji&&s[1],d=s[0]===ji&&s[2],l=m&&h.childNodes[m];l=++m&&l&&l[p]||(d=m=0)||g.pop();)if(1===l.nodeType&&++d&&l===t){f[e]=[ji,m,d];break}}else if(b&&(s=(t[zi]||(t[zi]={}))[e])&&s[0]===ji)d=s[1];else for(;(l=++m&&l&&l[p]||(d=m=0)||g.pop())&&((u?l.nodeName.toLowerCase()!==v:1!==l.nodeType)||!++d||(b&&((l[zi]||(l[zi]={}))[e]=[ji,d]),l!==t)););return (d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(e,t){var n,r=Tr.pseudos[e]||Tr.setFilters[e.toLowerCase()]||wa.error("unsupported pseudo: "+e);return r[zi]?r(t):r.length>1?(n=[e,e,"",t],Tr.setFilters.hasOwnProperty(e.toLowerCase())?ka((function(e,n){for(var o,i=r(e,t),a=i.length;a--;)e[o=na.call(e,i[a])]=!(n[o]=i[a]);})):function(e){return r(e,0,n)}):r}},pseudos:{not:ka((function(e){var t=[],n=[],r=Lr(e.replace(ua,"$1"));return r[zi]?ka((function(e,t,n,o){for(var i,a=r(e,null,o,[]),u=e.length;u--;)(i=a[u])&&(e[u]=!(t[u]=i));})):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}})),has:ka((function(e){return function(t){return wa(e,t).length>0}})),contains:ka((function(e){return e=e.replace(Ca,xa),function(t){return (t.textContent||t.innerText||Or(t)).indexOf(e)>-1}})),lang:ka((function(e){return da.test(e||"")||wa.error("unsupported lang: "+e),e=e.replace(Ca,xa).toLowerCase(),function(t){var n;do{if(n=Vr?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return (n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.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===jr},focus:function(e){return e===Hr.activeElement&&(!Hr.hasFocus||Hr.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 !Tr.pseudos.empty(e)},header:function(e){return pa.test(e.nodeName)},input:function(e){return ga.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:Ea((function(){return [0]})),last:Ea((function(e,t){return [t-1]})),eq:Ea((function(e,t,n){return [n<0?n+t:n]})),even:Ea((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:Ea((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:Ea((function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e})),gt:Ea((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},Tr.pseudos.nth=Tr.pseudos.eq,q(["radio","checkbox","file","password","image"],(function(e){Tr.pseudos[e]=function(e){return function(t){return "input"===t.nodeName.toLowerCase()&&t.type===e}}(e);})),q(["submit","reset"],(function(e){Tr.pseudos[e]=function(e){return function(t){var n=t.nodeName.toLowerCase();return ("input"===n||"button"===n)&&t.type===e}}(e);})),Aa.prototype=Tr.filters=Tr.pseudos,Tr.setFilters=new Aa,Pr=wa.tokenize=function(e,t){var n,r,o,i,a,u,c,s=$i[e+" "];if(s)return t?0:s.slice(0);for(a=e,u=[],c=Tr.preFilter;a;){for(i in n&&!(r=ca.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=sa.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(ua," ")}),a=a.slice(n.length)),Tr.filter)Tr.filter.hasOwnProperty(i)&&(!(r=ma[i].exec(a))||c[i]&&!(r=c[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?wa.error(e):$i(e,u).slice(0)},Lr=wa.compile=function(e,t){var n,r=[],o=[],i=Wi[e+" "];if(!i){for(t||(t=Pr(e)),n=t.length;n--;)(i=Pa(t[n]))[zi]?r.push(i):o.push(i);i=Wi(e,function(e,t){var n=t.length>0,r=e.length>0,o=function(o,i,a,u,c){var s,f,l,d=0,m="0",g=o&&[],p=[],h=Mr,v=o||r&&Tr.find.TAG("*",c),b=ji+=null==h?1:Math.random()||.1,y=v.length;for(c&&(Mr=i!==Hr&&i);m!==y&&null!=(s=v[m]);m++){if(r&&s){for(f=0;l=e[f++];)if(l(s,i,a)){u.push(s);break}c&&(ji=b);}n&&((s=!l&&s)&&d--,o&&g.push(s));}if(d+=m,n&&m!==d){for(f=0;l=t[f++];)l(g,p,i,a);if(o){if(d>0)for(;m--;)g[m]||p[m]||(p[m]=Qi.call(u));p=Oa(p);}ea.apply(u,p),c&&!o&&p.length>0&&d+t.length>1&&wa.uniqueSort(u);}return c&&(ji=b,Mr=h),g};return n?ka(o):o}(o,r)),i.selector=e;}return i},Ir=wa.select=function(e,t,n,r){var o,i,a,u,c,s="function"==typeof e&&e,f=!r&&Pr(e=s.selector||e);if(n=n||[],1===f.length){if((i=f[0]=f[0].slice(0)).length>2&&"ID"===(a=i[0]).type&&Dr.getById&&9===t.nodeType&&Vr&&Tr.relative[i[1].type]){if(!(t=(Tr.find.ID(a.matches[0].replace(Ca,xa),t)||[])[0]))return n;s&&(t=t.parentNode),e=e.slice(i.shift().value.length);}for(o=ma.needsContext.test(e)?0:i.length;o--&&(a=i[o],!Tr.relative[u=a.type]);)if((c=Tr.find[u])&&(r=c(a.matches[0].replace(Ca,xa),ba.test(i[0].type)&&_a(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&Ra(i)))return ea.apply(n,r),n;break}}return (s||Lr(e,f))(r,t,!Vr,n,ba.test(e)&&_a(t.parentNode)||t),n},Dr.sortStable=zi.split("").sort(Ki).join("")===zi,Dr.detectDuplicates=!!Ur,zr(),Dr.sortDetached=!0;var La=document,Ia=Array.prototype.push,Ma=Array.prototype.slice,Fa=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Ua=Ui.Event,za=_t.makeMap("children,contents,next,prev"),Ha=function(e){return void 0!==e},ja=function(e){return "string"==typeof e},Va=function(e,t){var n,r=(t=t||La).createElement("div"),o=t.createDocumentFragment();for(r.innerHTML=e;n=r.firstChild;)o.appendChild(n);return o},qa=function(e,t,n,r){var o;if(ja(t))t=Va(t,ou(e[0]));else if(t.length&&!t.nodeType){if(t=cu.makeArray(t),r)for(o=t.length-1;o>=0;o--)qa(e,t[o],n,r);else for(o=0;o<t.length;o++)qa(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},$a=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},Wa=function(e,t,n){var r,o;return t=cu(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},Ka=_t.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Xa=_t.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ya={for:"htmlFor",class:"className",readonly:"readOnly"},Ga={float:"cssFloat"},Ja={},Qa={},Za=function(e,t){return new cu.fn.init(e,t)},eu=/^\s*|\s*$/g,tu=function(e){return null==e?"":(""+e).replace(eu,"")},nu=function(e,t){var n,r,o,i;if(e)if(void 0===(n=e.length)){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},ru=function(e,t){var n=[];return nu(e,(function(e,r){t(r,e)&&n.push(r);})),n},ou=function(e){return e?9===e.nodeType?e:e.ownerDocument:La};Za.fn=Za.prototype={constructor:Za,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 cu(e).attr(t);o.context=t=document;}if(ja(e)){if(o.selector=e,!(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:Fa.exec(e)))return cu(t).find(e);if(n[1])for(r=Va(e,ou(t)).firstChild;r;)Ia.call(o,r),r=r.nextSibling;else {if(!(r=ou(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 _t.toArray(this)},add:function(e,t){var n,r,o=this;if(ja(e))return o.add(cu(e));if(!1!==t)for(n=cu.unique(o.toArray().concat(cu.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Ia.apply(o,cu.makeArray(e));return o},attr:function(e,t){var n,r=this;if("object"==typeof e)nu(e,(function(e,t){r.attr(e,t);}));else {if(!Ha(t)){if(r[0]&&1===r[0].nodeType){if((n=Ja[e])&&n.get)return n.get(r[0],e);if(Xa[e])return r.prop(e)?e:void 0;null===(t=r[0].getAttribute(e,2))&&(t=void 0);}return t}this.each((function(){var n;if(1===this.nodeType){if((n=Ja[e])&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2);}}));}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=Ya[e]||e))nu(e,(function(e,t){n.prop(e,t);}));else {if(!Ha(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(e,t){var n,r,o=this,i=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 e)nu(e,(function(e,t){o.css(e,t);}));else if(Ha(t))e=i(e),"number"!=typeof t||Ka[e]||(t=t.toString()+"px"),o.each((function(){var n=this.style;if((r=Qa[e])&&r.set)r.set(this,t);else {try{this.style[Ga[e]||e]=t;}catch(e){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(a(e)):n.removeAttribute(e));}}));else {if(n=o[0],(r=Qa[e])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(e)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(a(e))}catch(e){return}}return o},remove:function(){for(var e,t=this.length;t--;)e=this[t],Ua.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(Ha(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e;}catch(r){cu(n[t]).empty().append(e);}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(Ha(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 qa(this,arguments,(function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e);}))},prepend:function(){return qa(this,arguments,(function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild);}),!0)},before:function(){var e=this;return e[0]&&e[0].parentNode?qa(e,arguments,(function(e){this.parentNode.insertBefore(e,this);})):e},after:function(){var e=this;return e[0]&&e[0].parentNode?qa(e,arguments,(function(e){this.parentNode.insertBefore(e,this.nextSibling);}),!0):e},appendTo:function(e){return cu(e).append(this),this},prependTo:function(e){return cu(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return Wa(this,e)},wrapAll:function(e){return Wa(this,e,!0)},wrapInner:function(e){return this.each((function(){cu(this).contents().wrapAll(e);})),this},unwrap:function(){return this.parent().each((function(){cu(this).replaceWith(this.childNodes);}))},clone:function(){var e=[];return this.each((function(){e.push(this.cloneNode(!0));})),cu(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return "string"!=typeof e||(-1!==e.indexOf(" ")?nu(e.split(" "),(function(){n.toggleClass(this,t);})):n.each((function(n,r){var o=$a(r,e);if(o!==t){var i=r.className;o?r.className=tu((" "+i+" ").replace(" "+e+" "," ")):r.className+=i?" "+e:e;}}))),n},hasClass:function(e){return $a(this[0],e)},each:function(e){return nu(this,e)},on:function(e,t){return this.each((function(){Ua.bind(this,e,t);}))},off:function(e,t){return this.each((function(){Ua.unbind(this,e,t);}))},trigger:function(e){return this.each((function(){"object"==typeof e?Ua.fire(this,e.type,e):Ua.fire(this,e);}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return cu(Ma.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++)cu.find(e,this[t],r);return cu(r)},filter:function(e){return cu("function"==typeof e?ru(this.toArray(),(function(t,n){return e(n,t)})):cu.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof cu&&(e=e[0]),this.each((function(n,r){for(;r;){if("string"==typeof e&&cu(r).is(e)){t.push(r);break}if(r===e){t.push(r);break}r=r.parentNode;}})),cu(t)},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:Ia,sort:Array.prototype.sort,splice:Array.prototype.splice},_t.extend(Za,{extend:_t.extend,makeArray:function(e){return (t=e)&&t===t.window||e.nodeType?[e]:_t.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:_t.isArray,each:nu,trim:tu,grep:ru,find:wa,expr:wa.selectors,unique:wa.uniqueSort,text:wa.getText,contains:wa.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?cu.find.matchesSelector(t[0],e)?[t[0]]:[]:cu.find.matches(e,t)}});var iu=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof cu&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&cu(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t];}return r},au=function(e,t,n,r){var o=[];for(r instanceof cu&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(void 0!==r){if(e===r)break;if("string"==typeof r&&cu(e).is(r))break}o.push(e);}return o},uu=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};nu({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return iu(e,"parentNode")},next:function(e){return uu(e,"nextSibling",1)},prev:function(e){return uu(e,"previousSibling",1)},children:function(e){return au(e.firstChild,"nextSibling",1)},contents:function(e){return _t.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},(function(e,t){Za.fn[e]=function(n){var r=[];this.each((function(){var e=t.call(r,this,n,r);e&&(cu.isArray(e)?r.push.apply(r,e):r.push(e));})),this.length>1&&(za[e]||(r=cu.unique(r)),0===e.indexOf("parents")&&(r=r.reverse()));var o=cu(r);return n?o.filter(n):o};})),nu({parentsUntil:function(e,t){return iu(e,"parentNode",t)},nextUntil:function(e,t){return au(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return au(e,"previousSibling",1,t).slice(1)}},(function(e,t){Za.fn[e]=function(n,r){var o=[];this.each((function(){var e=t.call(o,this,n,o);e&&(cu.isArray(e)?o.push.apply(o,e):o.push(e));})),this.length>1&&(o=cu.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse()));var i=cu(o);return r?i.filter(r):i};})),Za.fn.is=function(e){return !!e&&this.filter(e).length>0},Za.fn.init.prototype=Za.fn,Za.overrideDefaults=function(e){var t,n=function(r,o){return t=t||e(),0===arguments.length&&(r=t.element),o||(o=t.context),new n.fn.init(r,o)};return cu.extend(n,this),n},Za.attrHooks=Ja,Za.cssHooks=Qa;var cu=Za,su=_t.each,fu=_t.grep,lu=wt.ie,du=/^([a-z0-9],?)+$/i,mu=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);},gu=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},pu=function(e,t){void 0===t&&(t={});var n={},r=window,o={},i=0,a=io.forElement(Rt.fromDom(e),{contentCssCors:t.contentCssCors,referrerPolicy:t.referrerPolicy}),u=[],c=t.schema?t.schema:Ai({}),s=Di({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),f=t.ownEvents?new Ui:Ui.Event,d=c.getBlockElements(),m=cu.overrideDefaults((function(){return {context:e,element:V.getRoot()}})),g=function(t){return t&&e&&l(t)?e.getElementById(t):t},p=function(e){return m("string"==typeof e?g(e):e)},h=function(e,t,n){var r,o,i=p(e);return i.length&&(o=(r=$[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},b=function(e){var t=g(e);return t?t.attributes:[]},y=function(e,n,r){""===r&&(r=null);var o=p(e),i=o.attr(n);if(o.length){var a=$[n];a&&a.set?a.set(o,r,n):o.attr(n,r),i!==r&&t.onSetAttrib&&t.onSetAttrib({attrElm:o,attrName:n,attrValue:r});}},C=function(){return t.root_element||e.body},w=function(t,n){return lr(e.body,g(t),n)},S=function(e,t,n){var r=p(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,(function(e,t){return t.toUpperCase()})))&&(t=wt.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:void 0)},N=function(e){var t,n;return e=g(e),t=S(e,"width"),n=S(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(du.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return !0;return !1}if(e.nodeType&&1!==e.nodeType)return !1}var i=Array.isArray(e)?e:[e];return wa(t,i[0].ownerDocument||i[0],null,i).length>0},_=function(e,t,n,r){var o,i=[],a=g(e);for(r=void 0===r,n=n||("BODY"!==C().nodeName?C().parentNode:null),_t.is(t,"string")&&(o=t,t="*"===t?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&!(a===n||v(a.nodeType)||zn(a)||Hn(a));){if(!t||"function"==typeof t&&t(a)){if(!r)return [a];i.push(a);}a=a.parentNode;}return r?i:null},A=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},R=function(e,t,n){var r,o="string"==typeof e?g(e):e;if(!o)return !1;if(_t.isArray(o)&&(o.length||0===o.length))return r=[],su(o,(function(e,o){e&&r.push(t.call(n,"string"==typeof e?g(e):e,o));})),r;var i=n||this;return t.call(i,o)},D=function(e,t){p(e).each((function(e,n){su(t,(function(e,t){y(n,t,e);}));}));},T=function(e,t){var n=p(e);lu?n.each((function(e,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+t,n.removeChild(n.firstChild);}catch(e){cu("<div></div>").html("<br>"+t).contents().slice(1).appendTo(n);}return t}})):n.html(t);},O=function(t,n,r,o,i){return R(t,(function(t){var a="string"==typeof n?e.createElement(n):n;return D(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&T(a,o)),i?a:t.appendChild(a)}))},B=function(t,n,r){return O(e.createElement(t),t,n,r,!0)},P=bi.encodeAllRaw,L=function(e,t){var n=p(e);return t?n.each((function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this);})).remove():n.remove(),n.length>1?n.toArray():n[0]},I=function(e,t,n){p(e).toggleClass(t,n).each((function(){""===this.className&&cu(this).attr("class",null);}));},M=function(e,t,n){return R(t,(function(t){return _t.is(t,"array")&&(e=e.cloneNode(!0)),n&&su(fu(t.childNodes),(function(t){e.appendChild(t);})),t.parentNode.replaceChild(e,t)}))},F=function(e){if(Dn(e)){var t="a"===e.nodeName.toLowerCase()&&!h(e,"href")&&h(e,"id");if(h(e,"name")||h(e,"data-mce-bookmark")||t)return !0}return !1},U=function(){return e.createRange()},z=function(n,o,i,a){if(_t.isArray(n)){for(var c=n.length,s=[];c--;)s[c]=z(n[c],o,i,a);return s}return !t.collect||n!==e&&n!==r||u.push([n,o,i,a]),f.bind(n,o,i,a||V)},H=function(t,n,o){if(_t.isArray(t)){for(var i=t.length,a=[];i--;)a[i]=H(t[i],n,o);return a}if(u.length>0&&(t===e||t===r))for(i=u.length;i--;){var c=u[i];t!==c[0]||n&&n!==c[1]||o&&o!==c[2]||f.unbind(c[0],c[1],c[2]);}return f.unbind(t,n,o)},j=function(e){if(e&&Dn(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},V={doc:e,settings:t,win:r,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:u,styles:s,schema:c,events:f,isBlock:function(e){if("string"==typeof e)return !!d[e];if(e){var t=e.nodeType;if(t)return !(1!==t||!d[e.nodeName])}return !1},$:m,$$:p,root:null,clone:function(t,n){if(!lu||1!==t.nodeType||n)return t.cloneNode(n);var r=e.createElement(t.nodeName);return su(b(t),(function(e){y(r,e.nodeName,h(t,e.nodeName));})),r},getRoot:C,getViewPort:function(e){var t=_n(e);return {x:t.x,y:t.y,w:t.width,h:t.height}},getRect:function(e){e=g(e);var t=w(e),n=N(e);return {x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:function(e,t,n){var r=_(e,t,n,!1);return r&&r.length>0?r[0]:null},getParents:_,get:g,getNext:function(e,t){return A(e,t,"nextSibling")},getPrev:function(e,t){return A(e,t,"previousSibling")},select:function(n,r){return wa(n,g(r)||t.root_element||e,[])},is:E,add:O,create:B,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)Ce(t,r)&&(o+=" "+r+'="'+P(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(t){var n,r=e.createElement("div"),o=e.createDocumentFragment();for(o.appendChild(r),t&&(r.innerHTML=t);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:L,setStyle:function(e,n,r){var o=l(n)?p(e).css(n,r):p(e).css(n);t.update_styles&&mu(s,o);},getStyle:S,setStyles:function(e,n){var r=p(e).css(n);t.update_styles&&mu(s,r);},removeAllAttribs:function(e){return R(e,(function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t));}))},setAttrib:y,setAttribs:D,getAttrib:h,getPos:w,parseStyle:function(e){return s.parse(e)},serializeStyle:function(e,t){return s.serialize(e,t)},addStyle:function(t){var r,o;if(V!==pu.DOM&&e===document){if(n[t])return;n[t]=!0;}(o=e.getElementById("mceDefaultStyles"))||((o=e.createElement("style")).id="mceDefaultStyles",o.type="text/css",(r=e.getElementsByTagName("head")[0]).firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o)),o.styleSheet?o.styleSheet.cssText+=t:o.appendChild(e.createTextNode(t));},loadCSS:function(e){e||(e=""),q(e.split(","),(function(e){o[e]=!0,a.load(e,x);}));},addClass:function(e,t){p(e).addClass(t);},removeClass:function(e,t){I(e,t,!1);},hasClass:function(e,t){return p(e).hasClass(t)},toggleClass:I,show:function(e){p(e).show();},hide:function(e){p(e).hide();},isHidden:function(e){return "none"===p(e).css("display")},uniqueId:function(e){return (e||"mce_")+i++},setHTML:T,getOuterHTML:function(e){var t="string"==typeof e?g(e):e;return Dn(t)?t.outerHTML:cu("<div></div>").append(cu(t).clone()).html()},setOuterHTML:function(e,t){p(e).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}L(cu(this).html(t),!0);}));},decode:bi.decode,encode:P,insertAfter:function(e,t){var n=g(t);return R(e,(function(e){var t=n.parentNode,r=n.nextSibling;return r?t.insertBefore(e,r):t.appendChild(e),e}))},replace:M,rename:function(e,t){var n;return e.nodeName!==t.toUpperCase()&&(n=B(t),su(b(e),(function(t){y(n,t.nodeName,h(e,t.nodeName));})),M(n,e,!0)),n||e},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 s.toHex(_t.trim(e))},run:R,getAttribs:b,isEmpty:function(e,t){var n,r,o=0;if(F(e))return !1;if(e=e.firstChild){var i=new ao(e,e.parentNode),a=c?c.getWhiteSpaceElements():{};t=t||(c?c.getNonEmptyElements():null);do{if(n=e.nodeType,Dn(e)){var u=e.getAttribute("data-mce-bogus");if(u){e=i.next("all"===u);continue}if(r=e.nodeName.toLowerCase(),t&&t[r]){if("br"===r){o++,e=i.next();continue}return !1}if(F(e))return !1}if(8===n)return !1;if(3===n&&!Xo(e.nodeValue))return !1;if(3===n&&e.parentNode&&a[e.parentNode.nodeName]&&Xo(e.nodeValue))return !1;e=i.next();}while(e)}return o<=1},createRng:U,nodeIndex:gu,split:function(e,t,n){var r,o,i,a=U();if(e&&t)return a.setStart(e.parentNode,gu(e)),a.setEnd(t.parentNode,gu(t)),r=a.extractContents(),(a=U()).setStart(t.parentNode,gu(t)+1),a.setEnd(e.parentNode,gu(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(oi(V,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(oi(V,o),e),L(e),n||t},bind:z,unbind:H,fire:function(e,t,n){return f.fire(e,t,n)},getContentEditable:j,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=j(e));e=e.parentNode);return n},destroy:function(){if(u.length>0)for(var e=u.length;e--;){var t=u[e];f.unbind(t[0],t[1],t[2]);}le(o,(function(e,t){a.unload(t),delete o[t];})),wa.setDocument&&wa.setDocument();},isChildOf:function(e,t){if(lu){for(;e;){if(t===e)return !0;e=e.parentNode;}return !1}return e===t||t.contains(e)},dumpRng:function(e){return "startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}},$=function(e,t,n){var r=t.keep_values,o={set:function(e,r,o){t.url_converter&&null!==r&&(r=t.url_converter.call(t.url_converter_scope||n(),r,o,e[0])),e.attr("data-mce-"+o,r).attr(o,r);},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},i={style:{set:function(t,n){null===n||"object"!=typeof n?(r&&t.attr("data-mce-style",n),null!==n&&"string"==typeof n?(t.removeAttr("style"),t.css(e.parse(n))):t.attr("style",n)):t.css(n);},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return e.serialize(e.parse(n),t[0].nodeName)}}};return r&&(i.href=i.src=o),i}(s,t,k(V));return V};pu.DOM=pu(document),pu.nodeIndex=gu;var hu=pu.DOM,vu=_t.each,bu=_t.grep,yu=function(){function e(e){void 0===e&&(e={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=e;}return e.prototype._setReferrerPolicy=function(e){this.settings.referrerPolicy=e;},e.prototype.loadScript=function(e,t,n){var r,o=hu,i=function(){o.remove(a),r&&(r.onerror=r.onload=r=null);},a=o.uniqueId();(r=document.createElement("script")).id=a,r.type="text/javascript",r.src=_t._addCacheSuffix(e),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=function(){i(),t();},r.onerror=function(){i(),y(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+e);},(document.getElementsByTagName("head")[0]||document.body).appendChild(r);},e.prototype.isDone=function(e){return 2===this.states[e]},e.prototype.markDone=function(e){this.states[e]=2;},e.prototype.add=function(e,t,n,r){var o=this.states[e];this.queue.push(e),void 0===o&&(this.states[e]=0),t&&(this.scriptLoadedCallbacks[e]||(this.scriptLoadedCallbacks[e]=[]),this.scriptLoadedCallbacks[e].push({success:t,failure:r,scope:n||this}));},e.prototype.load=function(e,t,n,r){return this.add(e,t,n,r)},e.prototype.remove=function(e){delete this.states[e],delete this.scriptLoadedCallbacks[e];},e.prototype.loadQueue=function(e,t,n){this.loadScripts(this.queue,e,t,n);},e.prototype.loadScripts=function(e,t,n,r){var o=this,i=[],a=function(e,t){vu(o.scriptLoadedCallbacks[t],(function(t){y(t[e])&&t[e].call(t.scope);})),o.scriptLoadedCallbacks[t]=void 0;};o.queueLoadedCallbacks.push({success:t,failure:r,scope:n||this});var u=function(){var t=bu(e);if(e.length=0,vu(t,(function(e){2!==o.states[e]?3!==o.states[e]?1!==o.states[e]&&(o.states[e]=1,o.loading++,o.loadScript(e,(function(){o.states[e]=2,o.loading--,a("success",e),u();}),(function(){o.states[e]=3,o.loading--,i.push(e),a("failure",e),u();}))):a("failure",e):a("success",e);})),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,vu(n,(function(e){0===i.length?y(e.success)&&e.success.call(e.scope):y(e.failure)&&e.failure.call(e.scope,i);}));}};u();},e.ScriptLoader=new e,e}(),Cu=function(e){var t=e;return {get:function(){return t},set:function(e){t=e;}}},xu={},wu=Cu("en"),Su=function(){return be(xu,wu.get())},ku={getData:function(){return de(xu,(function(e){return Re({},e)}))},setCode:function(e){e&&wu.set(e);},getCode:function(){return wu.get()},add:function(e,t){var n=xu[e];n||(xu[e]=n={}),le(t,(function(e,t){n[t.toLowerCase()]=e;}));},translate:function(e){var t,n=Su().getOr({}),r=function(e){return y(e)?Object.prototype.toString.call(e):o(e)?"":""+e},o=function(e){return ""===e||null==e},i=function(e){var t=r(e);return be(n,t.toLowerCase()).map(r).getOr(t)},a=function(e){return e.replace(/{context:\w+}$/,"")};if(o(e))return "";if(d(t=e)&&ye(t,"raw"))return r(e.raw);if(function(e){return m(e)&&e.length>1}(e)){var u=e.slice(1);return a(i(e[0]).replace(/\{([0-9]+)\}/g,(function(e,t){return ye(u,t)?r(u[t]):e})))}return a(i(e))},isRtl:function(){return Su().bind((function(e){return be(e,"_dir")})).exists((function(e){return "rtl"===e}))},hasCode:function(e){return ye(xu,e)}},Nu=function(){var e=[],t={},n={},r=[],o=function(e,t){var n=K(r,(function(n){return n.name===e&&n.state===t}));q(n,(function(e){return e.callback()}));},i=function(e){var t;return n[e]&&(t=n[e].dependencies),t||[]},a=function(e,t){return "object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},u=function(e,r,c,s,f){if(!t[e]){var l="string"==typeof r?r:r.prefix+r.resource+r.suffix;0!==l.indexOf("/")&&-1===l.indexOf("://")&&(l=Nu.baseURL+"/"+l),t[e]=l.substring(0,l.lastIndexOf("/"));var d=function(){o(e,"loaded"),function(e,t,n,r){var o=i(e);q(o,(function(e){var n=a(t,e);u(n.resource,n,void 0,void 0);})),n&&(r?n.call(r):n.call(yu));}(e,r,c,s);};n[e]?d():yu.ScriptLoader.add(l,d,s,f);}},c=function(e,o,i){void 0===i&&(i="added"),ye(n,e)&&"added"===i||ye(t,e)&&"loaded"===i?o():r.push({name:e,state:i,callback:o});};return {items:e,urls:t,lookup:n,_listeners:r,get:function(e){if(n[e])return n[e].instance},dependencies:i,requireLangPack:function(e,n){!1!==Nu.languageLoad&&c(e,(function(){var r=ku.getCode();!r||n&&-1===(","+(n||"")+",").indexOf(","+r+",")||yu.ScriptLoader.add(t[e]+"/langs/"+r+".js");}),"loaded");},add:function(t,r,i){var a=r;return e.push(a),n[t]={instance:a,dependencies:i},o(t,"added"),a},remove:function(e){delete t[e],delete n[e];},createUrl:a,addComponents:function(e,n){var r=t[e];q(n,(function(e){yu.ScriptLoader.add(r+"/"+e);}));},load:u,waitFor:c}};Nu.languageLoad=!0,Nu.baseURL="",Nu.PluginManager=Nu(),Nu.ThemeManager=Nu();var Eu=function(){var e=function(e){var t=Cu(I.none()),n=function(){return t.get().each(e)};return {clear:function(){n(),t.set(I.none());},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(I.some(e));}}}(x);return Re(Re({},e),{on:function(t){return e.get().each(t)}})},_u=function(e,t){var n=null;return {cancel:function(){g(n)||(clearTimeout(n),n=null);},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];g(n)&&(n=setTimeout((function(){n=null,e.apply(null,r);}),t));}}},Au=function(e,t){var n=null,r=function(){g(n)||(clearTimeout(n),n=null);};return {cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,e.apply(null,o);}),t);}}},Ru=function(e,t){var n=er(e,t);return void 0===n||""===n?[]:n.split(" ")},Du=function(e){return void 0!==e.dom.classList},Tu=function(e,t){return function(e,t,n){var r=Ru(e,t).concat([n]);return Qn(e,t,r.join(" ")),!0}(e,"class",t)},Ou=function(e,t){return function(e,t,n){var r=K(Ru(e,t),(function(e){return e!==n}));return r.length>0?Qn(e,t,r.join(" ")):nr(e,t),!1}(e,"class",t)},Bu=function(e,t){Du(e)?e.dom.classList.add(t):Tu(e,t);},Pu=function(e){var t=Du(e)?e.dom.classList:function(e){return Ru(e,"class")}(e);0===t.length&&nr(e,"class");},Lu=function(e,t){return Du(e)&&e.dom.classList.contains(t)},Iu=function(e,t){var n=[];return q(Jt(e),(function(e){t(e)&&(n=n.concat([e])),n=n.concat(Iu(e,t));})),n},Mu=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return Ot(n)?[]:V(n.querySelectorAll(e),Rt.fromDom)}(t,e)},Fu=k("mce-annotation"),Uu=k("data-mce-annotation"),zu=k("data-mce-annotation-uid"),Hu=function(e,t){var n=e.selection.getRng(),r=Rt.fromDom(n.startContainer),o=Rt.fromDom(e.getBody()),i=t.fold((function(){return "."+Fu()}),(function(e){return "["+Uu()+'="'+e+'"]'})),a=Qt(r,n.startOffset).getOr(r),u=Qr(a,i,(function(e){return Bt(e,o)})),c=function(e,t){return function(e,t){var n=e.dom;return !(!n||!n.hasAttribute)&&n.hasAttribute(t)}(e,t)?I.some(er(e,t)):I.none()};return u.bind((function(t){return c(t,""+zu()).bind((function(n){return c(t,""+Uu()).map((function(t){var r=ju(e,n);return {uid:n,name:t,elements:r}}))}))}))},ju=function(e,t){var n=Rt.fromDom(e.getBody());return Mu(n,"["+zu()+'="'+t+'"]')},Vu=function(e,t){var n=Cu({}),r=function(){return {listeners:[],previous:Eu()}},o=function(e,t){i(e,(function(e){return t(e),e}));},i=function(e,t){var o=n.get(),i=t(be(o,e).getOrThunk(r));o[e]=i,n.set(o);},a=Au((function(){var t=n.get(),r=re(se(t));q(r,(function(t){i(t,(function(n){var r=n.previous.get();return Hu(e,I.some(t)).fold((function(){r.isSome()&&(!function(e){o(e,(function(t){q(t.listeners,(function(t){return t(!1,e)}));}));}(t),n.previous.clear());}),(function(e){var t=e.uid,i=e.name,a=e.elements;Xn(r,t)||(!function(e,t,n){o(e,(function(r){q(r.listeners,(function(r){return r(!0,e,{uid:t,nodes:V(n,(function(e){return e.dom}))})}));}));}(i,t,a),n.previous.set(t));})),{previous:n.previous,listeners:n.listeners}}));}));}),30);e.on("remove",(function(){a.cancel();})),e.on("NodeChange",(function(){a.throttle();}));return {addListener:function(e,t){i(e,(function(e){return {previous:e.previous,listeners:e.listeners.concat([t])}}));}}},qu=function(e,t){e.on("init",(function(){e.serializer.addNodeFilter("span",(function(e){q(e,(function(e){(function(e){return I.from(e.attr(Uu())).bind(t.lookup)})(e).each((function(t){!1===t.persistent&&e.unwrap();}));}));}));}));},$u=0,Wu=function(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++$u+String(t)},Ku=function(e,t){var n,r,o=Vt(e).dom,i=Rt.fromDom(o.createDocumentFragment()),a=(n=t,(r=(o||document).createElement("div")).innerHTML=n,Jt(Rt.fromDom(r)));gn(i,a),pn(e),mn(e,i);},Xu=function(e,t){return Rt.fromDom(e.dom.cloneNode(t))},Yu=function(e){return Xu(e,!1)},Gu=function(e){return Xu(e,!0)},Ju=function(e,t,n){void 0===n&&(n=T);var r=new ao(e,t),o=function(e){var t;do{t=r[e]();}while(t&&!Fn(t)&&!n(t));return I.from(t).filter(Fn)};return {current:function(){return I.from(r.current()).filter(Fn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Qu=function(e,t){var n=t||function(t){return e.isBlock(t)||jn(t)||$n(t)},r=function(e,t,n,o){if(Fn(e)){var i=o(e,t,e.data);if(-1!==i)return I.some({container:e,offset:i})}return n().bind((function(e){return r(e.container,e.offset,n,o)}))};return {backwards:function(e,t,o,i){var a=Ju(e,i,n);return r(e,t,(function(){return a.prev().map((function(e){return {container:e,offset:e.length}}))}),o).getOrNull()},forwards:function(e,t,o,i){var a=Ju(e,i,n);return r(e,t,(function(){return a.next().map((function(e){return {container:e,offset:0}}))}),o).getOrNull()}}},Zu=Math.round,ec=function(e){return e?{left:Zu(e.left),top:Zu(e.top),bottom:Zu(e.bottom),right:Zu(e.right),width:Zu(e.width),height:Zu(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},tc=function(e,t){return e=ec(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e},nc=function(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2},rc=function(e,t){var n=Math.min(t.height/2,e.height/2);return e.bottom-n<t.top||!(e.top>t.bottom)&&nc(t.top-e.bottom,e,t)},oc=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&nc(t.bottom-e.top,e,t)},ic=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},ac=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},uc=function(e,t){if(Dn(e)&&e.hasChildNodes()){var n=e.childNodes,r=function(e,t,n){return Math.min(Math.max(e,t),n)}(t,0,n.length-1);return n[r]}return e},cc=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),sc=function(e){return "string"==typeof e&&e.charCodeAt(0)>=768&&cc.test(e)},fc=Dn,lc=qo,dc=On("display","block table"),mc=On("float","left right"),gc=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){for(var n=0;n<e.length;n++)if(!e[n](t))return !1;return !0}}(fc,lc,A(mc)),pc=A(On("white-space","pre pre-line pre-wrap")),hc=Fn,vc=jn,bc=pu.nodeIndex,yc=function(e,t){return t<0&&Dn(e)&&e.hasChildNodes()?void 0:uc(e,t)},Cc=function(e){return "createRange"in e?e.createRange():pu.DOM.createRng()},xc=function(e){return e&&/[\r\n\t ]/.test(e)},wc=function(e){return !!e.setStart&&!!e.setEnd},Sc=function(e){var t=e.startContainer,n=e.startOffset;if(xc(e.toString())&&pc(t.parentNode)&&Fn(t)){var r=t.data;if(xc(r[n-1])||xc(r[n+1]))return !0}return !1},kc=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},Nc=function(e){var t,n=e.getClientRects();return t=n.length>0?ec(n[0]):ec(e.getBoundingClientRect()),!wc(e)&&vc(e)&&kc(t)?function(e){var t=e.ownerDocument,n=Cc(t),r=t.createTextNode(yo),o=e.parentNode;o.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1);var i=ec(n.getBoundingClientRect());return o.removeChild(r),i}(e):kc(t)&&wc(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&Fn(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),Nc(i)}return null}(e):t},Ec=function(e,t){var n=tc(e,t);return n.width=1,n.right=n.left+1,n},_c=function(e){var t=[],n=function(e){var n,r;0!==e.height&&(t.length>0&&(n=e,r=t[t.length-1],n.left===r.left&&n.top===r.top&&n.bottom===r.bottom&&n.right===r.right)||t.push(e));},r=function(e,r){var o=Cc(e.ownerDocument);if(r<e.data.length){if(sc(e.data[r]))return t;if(sc(e.data[r-1])&&(o.setStart(e,r),o.setEnd(e,r+1),!Sc(o)))return n(Ec(Nc(o),!1)),t}r>0&&(o.setStart(e,r-1),o.setEnd(e,r),Sc(o)||n(Ec(Nc(o),!1))),r<e.data.length&&(o.setStart(e,r),o.setEnd(e,r+1),Sc(o)||n(Ec(Nc(o),!0)));},o=e.container(),i=e.offset();if(hc(o))return r(o,i),t;if(fc(o))if(e.isAtEnd()){var a=yc(o,i);hc(a)&&r(a,a.data.length),gc(a)&&!vc(a)&&n(Ec(Nc(a),!1));}else {a=yc(o,i);if(hc(a)&&r(a,0),gc(a)&&e.isAtEnd())return n(Ec(Nc(a),!1)),t;var u=yc(e.container(),e.offset()-1);gc(u)&&!vc(u)&&(dc(u)||dc(a)||!gc(a))&&n(Ec(Nc(u),!1)),gc(a)&&n(Ec(Nc(a),!0));}return t},Ac=function(e,t,n){var r=function(){return n||(n=_c(Ac(e,t))),n};return {container:k(e),offset:k(t),toRange:function(){var n=Cc(e.ownerDocument);return n.setStart(e,t),n.setEnd(e,t),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return hc(e),0===t},isAtEnd:function(){return hc(e)?t>=e.data.length:t>=e.childNodes.length},isEqual:function(n){return n&&e===n.container()&&t===n.offset()},getNode:function(n){return yc(e,n?t-1:t)}}};Ac.fromRangeStart=function(e){return Ac(e.startContainer,e.startOffset)},Ac.fromRangeEnd=function(e){return Ac(e.endContainer,e.endOffset)},Ac.after=function(e){return Ac(e.parentNode,bc(e)+1)},Ac.before=function(e){return Ac(e.parentNode,bc(e))},Ac.isAbove=function(e,t){return Yn(ie(t.getClientRects()),ae(e.getClientRects()),rc).getOr(!1)},Ac.isBelow=function(e,t){return Yn(ae(t.getClientRects()),ie(e.getClientRects()),oc).getOr(!1)},Ac.isAtStart=function(e){return !!e&&e.isAtStart()},Ac.isAtEnd=function(e){return !!e&&e.isAtEnd()},Ac.isTextPosition=function(e){return !!e&&Fn(e.container())},Ac.isElementPosition=function(e){return !1===Ac.isTextPosition(e)};var Rc,Dc=function(e,t){Fn(t)&&0===t.data.length&&e.remove(t);},Tc=function(e,t,n){Hn(n)?function(e,t,n){var r=I.from(n.firstChild),o=I.from(n.lastChild);t.insertNode(n),r.each((function(t){return Dc(e,t.previousSibling)})),o.each((function(t){return Dc(e,t.nextSibling)}));}(e,t,n):function(e,t,n){t.insertNode(n),Dc(e,n.previousSibling),Dc(e,n.nextSibling);}(e,t,n);},Oc=Fn,Bc=Pn,Pc=pu.nodeIndex,Lc=function(e){var t=e.parentNode;return Bc(t)?Lc(t):t},Ic=function(e){return e?Ee(e.childNodes,(function(e,t){return Bc(t)&&"BR"!==t.nodeName?e=e.concat(Ic(t)):e.push(t),e}),[]):[]},Mc=function(e){return function(t){return e===t}},Fc=function(e){return (Oc(e)?"text()":e.nodeName.toLowerCase())+"["+function(e){var t,n;t=Ic(Lc(e)),n=_e(t,Mc(e),e),t=t.slice(0,n+1);var r=Ee(t,(function(e,n,r){return Oc(n)&&Oc(t[r-1])&&e++,e}),0);return t=ke(t,Tn([e.nodeName])),(n=_e(t,Mc(e),e))-r}(e)+"]"},Uc=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),Oc(n)?o=function(e,t){for(;(e=e.previousSibling)&&Oc(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(Fc(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=ke(a,A(Pn)),(u=u.concat(Se(a,(function(e){return Fc(e)})))).reverse().join("/")+","+o},zc=function(e,t){var n;if(!t)return null;var r=t.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=Ee(o,(function(e,t){var n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return n?("text()"===n[1]&&(n[1]="#text"),function(e,t,n){var r=Ic(e);return r=ke(r,(function(e,t){return !Oc(e)||!Oc(r[t-1])})),(r=ke(r,Tn([t])))[n]}(e,n[1],parseInt(n[2],10))):null}),e);return i?Oc(i)?function(e,t){for(var n,r=e,o=0;Oc(r);){if(n=r.data.length,t>=o&&t<=o+n){e=r,t-=o;break}if(!Oc(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling;}return Oc(e)&&t>e.data.length&&(t=e.data.length),Ac(e,t)}(i,parseInt(n,10)):(n="after"===n?Pc(i)+1:Pc(i),Ac(i.parentNode,n)):null},Hc=$n,jc=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],c=[],s=0,f=e.getRoot();for(Fn(a)?c.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&Fn(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(s=1,u=Math.max(0,i.length-1)),c.push(e.nodeIndex(i[u],n)+s));a&&a!==f;a=a.parentNode)c.push(e.nodeIndex(a,n));return c},Vc=function(e,t,n){var r=0;return _t.each(e.select(t),(function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++})),r},qc=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],Dn(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));},$c=function(e){return qc(e,!0),qc(e,!1),e},Wc=function(e,t){var n;if(Dn(e)&&(e=uc(e,t),Hc(e)))return e;if(_o(e)){if(Fn(e)&&No(e)&&(e=e.parentNode),n=e.previousSibling,Hc(n))return n;if(n=e.nextSibling,Hc(n))return n}},Kc=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Hc(r)||"IMG"===o)return {name:o,index:Vc(n.dom,o,r)};var a=function(e){return Wc(e.startContainer,e.startOffset)||Wc(e.endContainer,e.endOffset)}(i);return a?{name:o=a.tagName,index:Vc(n.dom,o,a)}:function(e,t,n,r){var o=t.dom,i={};return i.start=jc(o,e,n,r,!0),t.isCollapsed()||(i.end=jc(o,e,n,r,!1)),Lo(r)&&(i.isFakeCaret=!0),i}(e,n,t,i)},Xc=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,"&#xFEFF;"):e.create("span",r)},Yc=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:Vc(n,u,a)};var c=$c(r.cloneRange());if(!i){c.collapse(!1);var s=Xc(n,o+"_end",t);Tc(n,c,s);}(r=$c(r)).collapse(!0);var f=Xc(n,o+"_start",t);return Tc(n,r,f),e.moveToBookmark({id:o,keep:!0}),{id:o}},Gc=function(e,t,n){return 2===t?Kc(wo,n,e):3===t?function(e){var t=e.getRng();return {start:Uc(e.dom.getRoot(),Ac.fromRangeStart(t)),end:Uc(e.dom.getRoot(),Ac.fromRangeEnd(t))}}(e):t?function(e){return {rng:e.getRng()}}(e):Yc(e,!1)},Jc=_(Kc,N,!0),Qc=pu.DOM,Zc=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return be(o,e.id).getOr(n)}return r},es=function(e){return e.getParam("content_security_policy","")},ts=function(e){if(e.getParam("force_p_newlines",!1))return "p";var t=e.getParam("forced_root_block","p");return !1===t?"":!0===t?"p":t},ns=function(e){return e.getParam("forced_root_block_attrs",{})},rs=function(e){return e.getParam("automatic_uploads",!0,"boolean")},os=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},is=function(e){return e.getParam("icons","","string")},as=function(e){return e.getParam("images_upload_url","","string")},us=function(e){return e.getParam("images_upload_base_path","","string")},cs=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},ss=function(e){return e.getParam("images_upload_handler",null,"function")},fs=function(e){return e.getParam("content_css_cors",!1,"boolean")},ls=function(e){return e.getParam("referrer_policy","","string")},ds=function(e){return e.getParam("language","en","string")},ms=function(e){return e.getParam("indent_use_margin",!1)},gs=function(e){var t=e.getParam("font_css",[]);return m(t)?t:V(t.split(","),Ue)},ps=function(e){var t=e.getParam("object_resizing");return !1!==t&&!wt.iOS&&(l(t)?t:"table,img,figure.image,div,video,iframe")},hs=function(e){return e.getParam("event_root")},vs=function(e){return e.getParam("theme")},bs=function(e){return e.getParam("validate")},ys=function(e){return !1!==e.getParam("inline_boundaries")},Cs=function(e){return e.getParam("content_css_cors")},xs=function(e){return e.getParam("plugins","","string")},ws=Dn,Ss=Fn,ks=function(e){var t=e.parentNode;t&&t.removeChild(e);},Ns=function(e){var t=wo(e);return {count:e.length-t.length,text:t}},Es=function(e){for(var t;-1!==(t=e.data.lastIndexOf(Co));)e.deleteData(t,1);},_s=function(e,t){return Ts(e),t},As=function(e,t){var n=t.container(),r=function(e,t){var n=z(e,t);return -1===n?I.none():I.some(n)}(ue(n.childNodes),e).map((function(e){return e<t.offset()?Ac(n,t.offset()-1):t})).getOr(t);return Ts(e),r},Rs=function(e,t){return Ss(e)&&t.container()===e?function(e,t){var n=Ns(e.data.substr(0,t.offset())),r=Ns(e.data.substr(t.offset()));return (n.text+r.text).length>0?(Es(e),Ac(e,t.offset()-n.count)):t}(e,t):_s(e,t)},Ds=function(e,t){return Ac.isTextPosition(t)?Rs(e,t):function(e,t){return t.container()===e.parentNode?As(e,t):_s(e,t)}(e,t)},Ts=function(e){ws(e)&&_o(e)&&(Ao(e)?e.removeAttribute("data-mce-caret"):ks(e)),Ss(e)&&(Es(e),0===e.data.length&&ks(e));},Os=mt().browser,Bs=$n,Ps=Kn,Ls=Wn,Is=function(e,t,n){var r,o,i=tc(t.getBoundingClientRect(),n);if("BODY"===e.tagName){var a=e.ownerDocument.documentElement;r=e.scrollLeft||a.scrollLeft,o=e.scrollTop||a.scrollTop;}else {var u=e.getBoundingClientRect();r=e.scrollLeft-u.left,o=e.scrollTop-u.top;}i.left+=r,i.right+=r,i.top+=o,i.bottom+=o,i.width=1;var c=t.offsetWidth-t.clientWidth;return c>0&&(n&&(c*=-1),i.left+=c,i.right+=c),i},Ms=function(e,t,n,r){var o,i,a=Eu(),u=ts(e),c=u.length>0?u:"p",s=function(){!function(e){for(var t=Mu(Rt.fromDom(e),"*[contentEditable=false],video,audio,embed,object"),n=0;n<t.length;n++){var r,o=t[n].dom,i=o.previousSibling;Bo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,Oo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1));}}(t),i&&(Ts(i),i=null),a.on((function(e){cu(e.caret).remove(),a.clear();})),o&&(ro.clearInterval(o),o=void 0);},f=function(){o=ro.setInterval((function(){r()?cu("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden"):cu("div.mce-visual-caret",t).addClass("mce-visual-caret-hidden");}),500);};return {show:function(e,r){var o;if(s(),Ls(r))return null;if(!n(r))return i=function(e,t){var n=e.ownerDocument.createTextNode(Co),r=e.parentNode;if(t){if(o=e.previousSibling,ko(o)){if(_o(o))return o;if(Bo(o))return o.splitText(o.data.length-1)}r.insertBefore(n,e);}else {var o=e.nextSibling;if(ko(o)){if(_o(o))return o;if(Oo(o))return o.splitText(1),o}e.nextSibling?r.insertBefore(n,e.nextSibling):r.appendChild(n);}return n}(r,e),o=r.ownerDocument.createRange(),Us(i.nextSibling)?(o.setStart(i,0),o.setEnd(i,0)):(o.setStart(i,1),o.setEnd(i,1)),o;i=To(c,r,e);var u=Is(t,r,e);cu(i).css("top",u.top);var l=cu('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(Re({},u)).appendTo(t)[0];return a.set({caret:l,element:r,before:e}),e&&cu(l).addClass("mce-visual-caret-before"),f(),(o=r.ownerDocument.createRange()).setStart(i,0),o.setEnd(i,0),o},hide:s,getCss:function(){return ".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){a.on((function(e){var n=Is(t,e.element,e.before);cu(e.caret).css(Re({},n));}));},destroy:function(){return ro.clearInterval(o)}}},Fs=function(){return Os.isIE()||Os.isEdge()||Os.isFirefox()},Us=function(e){return Bs(e)||Ps(e)},zs=function(e){return Us(e)||Ln(e)&&Fs()},Hs=$n,js=Kn,Vs=On("display","block table table-cell table-caption list-item"),qs=_o,$s=No,Ws=Dn,Ks=qo,Xs=function(e){return e>0},Ys=function(e){return e<0},Gs=function(e,t){for(var n;n=e(t);)if(!$s(n))return n;return null},Js=function(e,t,n,r,o){var i=new ao(e,r),a=Hs(e)||$s(e);if(Ys(t)){if(a&&n(e=Gs(i.prev.bind(i),!0)))return e;for(;e=Gs(i.prev.bind(i),o);)if(n(e))return e}if(Xs(t)){if(a&&n(e=Gs(i.next.bind(i),!0)))return e;for(;e=Gs(i.next.bind(i),o);)if(n(e))return e}return null},Qs=function(e,t){for(;e&&e!==t;){if(Vs(e))return e;e=e.parentNode;}return null},Zs=function(e,t,n){return Qs(e.container(),n)===Qs(t.container(),n)},ef=function(e,t){if(!t)return null;var n=t.container(),r=t.offset();return Ws(n)?n.childNodes[r+e]:null},tf=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},nf=function(e,t,n){return Qs(t,e)===Qs(n,e)},rf=function(e,t,n){for(var r=e?"previousSibling":"nextSibling";n&&n!==t;){var o=n[r];if(qs(o)&&(o=o[r]),Hs(o)||js(o)){if(nf(t,o,n))return o;break}if(Ks(o))break;n=n.parentNode;}return null},of=_(tf,!0),af=_(tf,!1),uf=function(e,t,n){var r,o=_(rf,!0,t),i=_(rf,!1,t),a=n.startContainer,u=n.startOffset;if(No(a)){Ws(a)||(a=a.parentNode);var c=a.getAttribute("data-mce-caret");if("before"===c&&(r=a.nextSibling,zs(r)))return of(r);if("after"===c&&(r=a.previousSibling,zs(r)))return af(r)}if(!n.collapsed)return n;if(Fn(a)){if(qs(a)){if(1===e){if(r=i(a))return of(r);if(r=o(a))return af(r)}if(-1===e){if(r=o(a))return af(r);if(r=i(a))return of(r)}return n}if(Bo(a)&&u>=a.data.length-1)return 1===e&&(r=i(a))?of(r):n;if(Oo(a)&&u<=1)return -1===e&&(r=o(a))?af(r):n;if(u===a.data.length)return (r=i(a))?of(r):n;if(0===u)return (r=o(a))?af(r):n}return n},cf=function(e,t){return I.from(ef(e?0:-1,t)).filter(Hs)},sf=function(e,t,n){var r=uf(e,t,n);return -1===e?Ac.fromRangeStart(r):Ac.fromRangeEnd(r)},ff=function(e){return I.from(e.getNode()).map(Rt.fromDom)},lf=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},df=function(e,t){var n=Zs(e,t);return !(n||!jn(e.getNode()))||n};!function(e){e[e.Backwards=-1]="Backwards",e[e.Forwards=1]="Forwards";}(Rc||(Rc={}));var mf,gf=$n,pf=Fn,hf=Dn,vf=jn,bf=qo,yf=function(e){return Ho(e)||function(e){return !!$o(e)&&!0!==Y(ue(e.getElementsByTagName("*")),(function(e,t){return e||Io(t)}),!1)}(e)},Cf=Wo,xf=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},wf=function(e,t){if(Xs(e)){if(bf(t.previousSibling)&&!pf(t.previousSibling))return Ac.before(t);if(pf(t))return Ac(t,0)}if(Ys(e)){if(bf(t.nextSibling)&&!pf(t.nextSibling))return Ac.after(t);if(pf(t))return Ac(t,t.data.length)}return Ys(e)?vf(t)?Ac.before(t):Ac.after(t):Ac.before(t)},Sf=function(e,t,n){var r,o,i,a;if(!hf(n)||!t)return null;if(t.isEqual(Ac.after(n))&&n.lastChild){if(a=Ac.after(n.lastChild),Ys(e)&&bf(n.lastChild)&&hf(n.lastChild))return vf(n.lastChild)?Ac.before(n.lastChild):a}else a=t;var u=a.container(),c=a.offset();if(pf(u)){if(Ys(e)&&c>0)return Ac(u,--c);if(Xs(e)&&c<u.length)return Ac(u,++c);r=u;}else {if(Ys(e)&&c>0&&(o=xf(u,c-1),bf(o)))return !yf(o)&&(i=Js(o,e,Cf,o))?pf(i)?Ac(i,i.data.length):Ac.after(i):pf(o)?Ac(o,o.data.length):Ac.before(o);if(Xs(e)&&c<u.childNodes.length&&(o=xf(u,c),bf(o)))return vf(o)?function(e,t){var n=t.nextSibling;return n&&bf(n)?pf(n)?Ac(n,0):Ac.before(n):Sf(Rc.Forwards,Ac.after(t),e)}(n,o):!yf(o)&&(i=Js(o,e,Cf,o))?pf(i)?Ac(i,0):Ac.before(i):pf(o)?Ac(o,0):Ac.after(o);r=o||a.getNode();}if((Xs(e)&&a.isAtEnd()||Ys(e)&&a.isAtStart())&&(r=Js(r,e,O,n,!0),Cf(r,n)))return wf(e,r);o=Js(r,e,Cf,n);var s=Ae(K(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(u,n),gf));return !s||o&&s.contains(o)?o?wf(e,o):null:a=Xs(e)?Ac.after(s):Ac.before(s)},kf=function(e){return {next:function(t){return Sf(Rc.Forwards,t,e)},prev:function(t){return Sf(Rc.Backwards,t,e)}}},Nf=function(e){return Ac.isTextPosition(e)?0===e.offset():qo(e.getNode())},Ef=function(e){if(Ac.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return qo(e.getNode(!0))},_f=function(e,t){return !Ac.isTextPosition(e)&&!Ac.isTextPosition(t)&&e.getNode()===t.getNode(!0)},Af=function(e,t,n){return e?!_f(t,n)&&(r=t,!(!Ac.isTextPosition(r)&&jn(r.getNode())))&&Ef(t)&&Nf(n):!_f(n,t)&&Nf(t)&&Ef(n);var r;},Rf=function(e,t,n){var r=kf(t);return I.from(e?r.next(n):r.prev(n))},Df=function(e,t,n){return Rf(e,t,n).bind((function(r){return Zs(n,r,t)&&Af(e,n,r)?Rf(e,t,r):I.some(r)}))},Tf=function(e,t,n,r){return Df(e,t,n).bind((function(n){return r(n)?Tf(e,t,n,r):I.some(n)}))},Of=function(e,t){var n,r=e?t.firstChild:t.lastChild;return Fn(r)?I.some(Ac(r,e?0:r.data.length)):r?qo(r)?I.some(e?Ac.before(r):jn(n=r)?Ac.before(n):Ac.after(n)):function(e,t,n){var r=e?Ac.before(n):Ac.after(n);return Rf(e,t,r)}(e,t,r):I.none()},Bf=_(Rf,!0),Pf=_(Rf,!1),Lf=_(Of,!0),If=_(Of,!1),Mf="_mce_caret",Ff=function(e){return Dn(e)&&e.id===Mf},Uf=function(e,t){for(;t&&t!==e;){if(t.id===Mf)return t;t=t.parentNode;}return null},zf=function(e){return _t.isArray(e.start)},Hf=function(e,t){return Dn(t)&&e.isBlock(t)&&!t.innerHTML&&!wt.ie&&(t.innerHTML='<br data-mce-bogus="1" />'),t},jf=function(e,t){return If(e).fold(T,(function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0}))},Vf=function(e,t,n){return !(!function(e){return !1===e.hasChildNodes()}(t)||!Uf(e,t))&&(function(e,t){var n=e.ownerDocument.createTextNode(Co);e.appendChild(n),t.setStart(n,0),t.setEnd(n,0);}(t,n),!0)},qf=function(e,t,n,r){var o,i,a,u,c=n[t?"start":"end"],s=e.getRoot();if(c){for(a=c[0],i=s,o=c.length-1;o>=1;o--){if(u=i.childNodes,Vf(s,i,r))return !0;if(c[o]>u.length-1)return !!Vf(s,i,r)||jf(i,r);i=u[c[o]];}3===i.nodeType&&(a=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(c[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a);}return !0},$f=function(e){return Fn(e)&&e.data.length>0},Wf=function(e,t,n){var r,o,i,a,u,c,s=e.get(n.id+"_"+t),f=n.keep;if(s){if(r=s.parentNode,"start"===t?(f?s.hasChildNodes()?(r=s.firstChild,o=1):$f(s.nextSibling)?(r=s.nextSibling,o=0):$f(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=e.nodeIndex(s)+1):o=e.nodeIndex(s),u=r,c=o):(f?s.hasChildNodes()?(r=s.firstChild,o=1):$f(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=e.nodeIndex(s)):o=e.nodeIndex(s),u=r,c=o),!f){for(a=s.previousSibling,i=s.nextSibling,_t.each(_t.grep(s.childNodes),(function(e){Fn(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""));}));s=e.get(n.id+"_"+t);)e.remove(s,!0);a&&i&&a.nodeType===i.nodeType&&Fn(a)&&!wt.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,c=o);}return I.some(Ac(u,c))}return I.none()},Kf=function(e,t){var n=e.dom;if(t){if(zf(t))return function(e,t){var n=e.createRng();return qf(e,!0,t,n)&&qf(e,!1,t,n)?I.some(n):I.none()}(n,t);if(function(e){return l(e.start)}(t))return I.some(function(e,t){var n,r=e.createRng();return n=zc(e.getRoot(),t.start),r.setStart(n.container(),n.offset()),n=zc(e.getRoot(),t.end),r.setEnd(n.container(),n.offset()),r}(n,t));if(function(e){return ye(e,"id")}(t))return function(e,t){var n=Wf(e,"start",t),r=Wf(e,"end",t);return Yn(n,r.or(n),(function(t,n){var r=e.createRng();return r.setStart(Hf(e,t.container()),t.offset()),r.setEnd(Hf(e,n.container()),n.offset()),r}))}(n,t);if(function(e){return ye(e,"name")}(t))return function(e,t){return I.from(e.select(t.name)[t.index]).map((function(t){var n=e.createRng();return n.selectNode(t),n}))}(n,t);if(function(e){return ye(e,"rng")}(t))return I.some(t.rng)}return I.none()},Xf=function(e,t,n){return Gc(e,t,n)},Yf=function(e,t){Kf(e,t).each((function(t){e.setRng(t);}));},Gf=function(e){return Dn(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Jf=(mf=yo,function(e){return mf===e}),Qf=function(e){return ""!==e&&-1!==" \f\n\r\t\v".indexOf(e)},Zf=function(e){return !Qf(e)&&!Jf(e)},el=function(e){return !!e.nodeType},tl=function(e,t,n){var r=n.startOffset,o=n.startContainer;if((o!==n.endContainer||!function(e){return e&&/^(IMG)$/.test(e.nodeName)}(o.childNodes[r]))&&Dn(o)){var i=o.childNodes,a=void 0;r<i.length?(o=i[r],a=new ao(o,e.getParent(o,e.isBlock))):(o=i[i.length-1],(a=new ao(o,e.getParent(o,e.isBlock))).next(!0));for(var u=a.current();u;u=a.next())if(Fn(u)&&!il(u))return n.setStart(u,0),void t.setRng(n)}},nl=function(e,t,n){if(e){var r=t?"nextSibling":"previousSibling";for(e=n?e:e[r];e;e=e[r])if(Dn(e)||!il(e))return e}},rl=function(e,t){return el(t)&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},ol=function(e,t,n){return e.schema.isValidChild(t,n)},il=function(e,t){if(void 0===t&&(t=!1),b(e)&&Fn(e)){var n=t?e.data.replace(/ /g," "):e.data;return Xo(n)}return !1},al=function(e,t){return y(e)?e=e(t):b(t)&&(e=e.replace(/%(\w+)/g,(function(e,n){return t[n]||e}))),e},ul=function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},cl=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=function(e,t,n){return cl(e,e.getStyle(t,n),n)},fl=function(e,t){var n;return e.getParent(t,(function(t){return (n=e.getStyle(t,"text-decoration"))&&"none"!==n})),n},ll=function(e,t,n){return e.getParents(t,n,e.getRoot())},dl=function(e,t,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(e){return he(e,(function(e,t){return j(r,(function(e){return e===t}))}))};return j(e.formatter.get(t),(function(t){var r=o(t);return j(e.formatter.get(n),(function(e){var t=o(e);return function(e,t,n){return void 0===n&&(n=u),a(n).eq(e,t)}(r,t)}))}))},ml=function(e){return Ce(e,"block")},gl=function(e){return Ce(e,"selector")},pl=function(e){return Ce(e,"inline")},hl=function(e){return gl(e)&&!1!==e.expand&&!pl(e)},vl=Gf,bl=ll,yl=il,Cl=rl,xl=function(e,t){for(var n=t;n;){if(Dn(n)&&e.getContentEditable(n))return "false"===e.getContentEditable(n)?n:t;n=n.parentNode;}return t},wl=function(e,t,n,r){for(var o=t.data,i=n;e?i>=0:i<o.length;e?i--:i++)if(r(o.charAt(i)))return e?i+1:i;return -1},Sl=function(e,t,n){return wl(e,t,n,(function(e){return Jf(e)||Qf(e)}))},kl=function(e,t,n){return wl(e,t,n,Zf)},Nl=function(e,t,n,r,o,i){var a,u=e.getParent(n,e.isBlock)||t,c=function(t,n,r){var i=Qu(e),c=o?i.backwards:i.forwards;return I.from(c(t,n,(function(e,t){return vl(e.parentNode)?-1:(a=e,r(o,e,t))}),u))};return c(n,r,Sl).bind((function(e){return i?c(e.container,e.offset+(o?-1:0),kl):I.some(e)})).orThunk((function(){return a?I.some({container:a,offset:o?0:a.length}):I.none()}))},El=function(e,t,n,r,o){Fn(r)&&Ve(r.data)&&r[o]&&(r=r[o]);for(var i=bl(e,r),a=0;a<i.length;a++)for(var u=0;u<t.length;u++){var c=t[u];if((!b(c.collapsed)||c.collapsed===n.collapsed)&&(gl(c)&&e.is(i[a],c.selector)))return i[a]}return r},_l=function(e,t,n,r){var o=n,i=e.dom,a=i.getRoot(),u=t[0];if(ml(u)&&(o=u.wrapper?null:i.getParent(n,u.block,a)),!o){var c=i.getParent(n,"LI,TD,TH");o=i.getParent(Fn(n)?n.parentNode:n,(function(t){return t!==a&&Cl(e,t)}),c);}if(o&&ml(u)&&u.wrapper&&(o=bl(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!ul(o,"br")););return o||n},Al=function(e,t,n,r){var o=n.parentNode;return !b(n[r])&&(!(o!==t&&!v(o)&&!e.isBlock(o))||Al(e,t,o,r))},Rl=function(e,t,n,r,o){var i,a=n,u=o?"previousSibling":"nextSibling",c=e.getRoot();if(Fn(n)&&!yl(n)&&(o?r>0:r<n.data.length))return n;for(;;){if(!t[0].block_expand&&e.isBlock(a))return a;for(var s=a[u];s;s=s[u]){var f=Fn(s)&&!Al(e,c,s,u);if(!vl(s)&&(!jn(i=s)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!yl(s,f))return a}if(a===c||a.parentNode===c){n=a;break}a=a.parentNode;}return n},Dl=function(e){return vl(e.parentNode)||vl(e)},Tl=function(e,t,n,r){void 0===r&&(r=!1);var o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset,c=e.dom,s=n[0];(Dn(o)&&o.hasChildNodes()&&(o=uc(o,i),Fn(o)&&(i=0)),Dn(a)&&a.hasChildNodes()&&(a=uc(a,t.collapsed?u:u-1),Fn(a)&&(u=a.nodeValue.length)),o=xl(c,o),a=xl(c,a),Dl(o)&&(o=vl(o)?o:o.parentNode,o=t.collapsed?o.previousSibling||o:o.nextSibling||o,Fn(o)&&(i=t.collapsed?o.length:0)),Dl(a)&&(a=vl(a)?a:a.parentNode,a=t.collapsed?a.nextSibling||a:a.previousSibling||a,Fn(a)&&(u=t.collapsed?0:a.length)),t.collapsed)&&(Nl(c,e.getBody(),o,i,!0,r).each((function(e){var t=e.container,n=e.offset;o=t,i=n;})),Nl(c,e.getBody(),a,u,!1,r).each((function(e){var t=e.container,n=e.offset;a=t,u=n;})));return (pl(s)||s.block_expand)&&(pl(s)&&Fn(o)&&0!==i||(o=Rl(c,n,o,i,!0)),pl(s)&&Fn(a)&&u!==a.nodeValue.length||(a=Rl(c,n,a,u,!1))),hl(s)&&(o=El(c,n,t,o,"previousSibling"),a=El(c,n,t,a,"nextSibling")),(ml(s)||gl(s))&&(o=_l(e,n,o,"previousSibling"),a=_l(e,n,a,"nextSibling"),ml(s)&&(c.isBlock(o)||(o=Rl(c,n,o,i,!0)),c.isBlock(a)||(a=Rl(c,n,a,u,!1)))),Dn(o)&&(i=c.nodeIndex(o),o=o.parentNode),Dn(a)&&(u=c.nodeIndex(a)+1,a=a.parentNode),{startContainer:o,startOffset:i,endContainer:a,endOffset:u}},Ol=function(e,t,n){var r=t.startOffset,o=uc(t.startContainer,r),i=t.endOffset,a=uc(t.endContainer,i-1),u=function(e){var t=e[0];Fn(t)&&t===o&&r>=t.data.length&&e.splice(0,1);var n=e[e.length-1];return 0===i&&e.length>0&&n===a&&Fn(n)&&e.splice(e.length-1,1),e},c=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},s=function(t,n){return e.getParent(t,(function(e){return e.parentNode===n}),n)},f=function(e,t,r){for(var o=r?"nextSibling":"previousSibling",i=e,a=i.parentNode;i&&i!==t;i=a){a=i.parentNode;var s=c(i===e?i:i[o],o);s.length&&(r||s.reverse(),n(u(s)));}};if(o===a)return n(u([o]));var l=e.findCommonAncestor(o,a);if(e.isChildOf(o,a))return f(o,l,!0);if(e.isChildOf(a,o))return f(a,l);var d=s(o,l)||o,m=s(a,l)||a;f(o,d,!0);var g=c(d===o?d:d.nextSibling,"nextSibling",m===a?m.nextSibling:m);g.length&&n(u(g)),f(a,m);},Bl=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},Pl=function(e){return K(function(e){return Z(e,(function(e){var t=ac(e);return t?[Rt.fromDom(t)]:[]}))}(e),vo)},Ll=function(e,t){var n=Mu(t,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:Pl(e)},Il=function(e){return Ll(Bl(e.selection.getSel()),Rt.fromDom(e.getBody()))},Ml=function(e,t){return Gr(e,"table",t)},Fl=function(e){return Zt(e).fold(k([e]),(function(t){return [e].concat(Fl(t))}))},Ul=function(e){return en(e).fold(k([e]),(function(t){return "br"===It(t)?Kt(t).map((function(t){return [e].concat(Ul(t))})).getOr([]):[e].concat(Ul(t))}))},zl=function(e,t){return Yn(function(e){var t=e.startContainer,n=e.startOffset;return Fn(t)?0===n?I.some(Rt.fromDom(t)):I.none():I.from(t.childNodes[n]).map(Rt.fromDom)}(t),function(e){var t=e.endContainer,n=e.endOffset;return Fn(t)?n===t.data.length?I.some(Rt.fromDom(t)):I.none():I.from(t.childNodes[n-1]).map(Rt.fromDom)}(t),(function(t,n){var r=J(Fl(e),_(Bt,t)),o=J(Ul(e),_(Bt,n));return r.isSome()&&o.isSome()})).getOr(!1)},Hl=function(e,t,n,r){var o=n,i=new ao(n,o),a=he(e.schema.getMoveCaretBeforeOnEnterElements(),(function(e,t){return !H(["td","th","table"],t.toLowerCase())}));do{if(Fn(n)&&0!==_t.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName])return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length));},jl=function(e){var t=e.selection.getSel();return t&&t.rangeCount>0},Vl=function(e,t){var n=Il(e);n.length>0?q(n,(function(n){var r=n.dom,o=e.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),t(o,!0);})):t(e.selection.getRng(),!1);},ql=function(e,t,n){var r=Yc(e,t);n(r),e.moveToBookmark(r);},$l=function(e,t){var n=function(t){return e(t)?I.from(t.dom.nodeValue):I.none()};return {get:function(r){if(!e(r))throw new Error("Can only get "+t+" value of a "+t+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=r;}}}(zt,"text"),Wl=function(e){return $l.get(e)},Kl=function(e,t,n,r){return Wt(t).fold((function(){return "skipping"}),(function(o){return "br"===r||function(e){return zt(e)&&Wl(e)===Co}(t)?"valid":function(e){return Ut(e)&&Lu(e,Fu())}(t)?"existing":Ff(t.dom)?"caret":ol(e,n,r)&&ol(e,It(o),n)?"valid":"invalid-child"}))},Xl=function(e,t,n,r){var o=t.uid,i=void 0===o?Wu("mce-annotation"):o,a=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"]),u=Rt.fromTag("span",e);Bu(u,Fu()),Qn(u,""+zu(),i),Qn(u,""+Uu(),n);var c=r(i,a),s=c.attributes,f=void 0===s?{}:s,l=c.classes,d=void 0===l?[]:l;return Zn(u,f),function(e,t){q(t,(function(t){Bu(e,t);}));}(u,d),u},Yl=function(e,t,n,r,o){var i=[],a=Xl(e.getDoc(),o,n,r),u=Eu(),c=function(){u.clear();},s=function(e){q(e,f);},f=function(t){switch(Kl(e,t,"span",It(t))){case"invalid-child":c();var n=Jt(t);s(n),c();break;case"valid":var r=u.get().getOrThunk((function(){var e=Yu(a);return i.push(e),u.set(e),e}));!function(e,t){fn(e,t),mn(t,e);}(t,r);}};return Ol(e.dom,t,(function(e){c(),function(e){var t=V(e,Rt.fromDom);s(t);}(e);})),i},Gl=function(e,t,n,r){e.undoManager.transact((function(){var o=e.selection,i=o.getRng(),a=Il(e).length>0;if(i.collapsed&&!a&&function(e,t){var n=Tl(e,t,[{inline:"span"}]);t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t);}(e,i),o.getRng().collapsed&&!a){var u=Xl(e.getDoc(),r,t,n.decorate);Ku(u,yo),o.getRng().insertNode(u.dom),o.select(u.dom);}else ql(o,!1,(function(){Vl(e,(function(o){Yl(e,o,t,n.decorate,r);}));}));}));},Jl=function(e){var t,n=(t={},{register:function(e,n){t[e]={name:e,settings:n};},lookup:function(e){return be(t,e).map((function(e){return e.settings}))}});qu(e,n);var r=Vu(e);return {register:function(e,t){n.register(e,t);},annotate:function(t,r){n.lookup(t).each((function(n){Gl(e,t,n,r);}));},annotationChanged:function(e,t){r.addListener(e,t);},remove:function(t){Hu(e,I.some(t)).each((function(e){var t=e.elements;q(t,vn);}));},getAll:function(t){var n=function(e,t){var n=Rt.fromDom(e.getBody()),r=Mu(n,"["+Uu()+'="'+t+'"]'),o={};return q(r,(function(e){var t=er(e,zu()),n=be(o,t).getOr([]);o[t]=n.concat([e]);})),o}(e,t);return de(n,(function(e){return V(e,(function(e){return e.dom}))}))}}},Ql=function(e){return {getBookmark:_(Xf,e),moveToBookmark:_(Yf,e)}};Ql.isBookmarkNode=Gf;var Zl=function(e,t){for(;t&&t!==e;){if(qn(t)||$n(t))return t;t=t.parentNode;}return null},ed=function(e,t,n){if(n.collapsed)return !1;if(wt.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(Dn(r))return j(r.getClientRects(),(function(n){return ic(n,e,t)}))}return j(n.getClientRects(),(function(n){return ic(n,e,t)}))},td=function(e,t,n){return e.fire(t,n)},nd=function(e,t,n,r){return e.fire("FormatApply",{format:t,node:n,vars:r})},rd=function(e,t,n,r){return e.fire("FormatRemove",{format:t,node:n,vars:r})},od={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||od.metaKeyPressed(e)},metaKeyPressed:function(e){return wt.mac?e.metaKey:e.ctrlKey&&!e.altKey}},id=$n,ad=function(e,t){var n,r,o,i,a,u,c,s,f,l,d,m,g,p,h,v="data-mce-selected",y=t.dom,C=_t.each,x=t.getDoc(),w=document,S=Math.abs,k=Math.round,N=t.getBody(),E={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},_=function(e){return e&&("IMG"===e.nodeName||t.dom.is(e,"figure.image"))},A=function(e){return Kn(e)||y.hasClass(e,"mce-preview-object")},R=function(e){var n=e.target;(function(e,t){if("longpress"===e.type||0===e.type.indexOf("touch")){var n=e.touches[0];return _(e.target)&&!ed(n.clientX,n.clientY,t)}return _(e.target)&&!ed(e.clientX,e.clientY,t)})(e,t.selection.getRng())&&!e.isDefaultPrevented()&&t.selection.select(n);},D=function(e){return y.is(e,"figure.image")?[e.querySelector("img")]:y.hasClass(e,"mce-preview-object")&&b(e.firstElementChild)?[e,e.firstElementChild]:[e]},T=function(e){var n=ps(t);return !!n&&("false"!==e.getAttribute("data-mce-resize")&&(e!==t.getBody()&&(y.hasClass(e,"mce-preview-object")?Tt(Rt.fromDom(e.firstElementChild),n):Tt(Rt.fromDom(e),n))))},O=function(e,n,r){if(b(r)){var o=D(e);q(o,(function(e){e.style[n]||!t.schema.isValid(e.nodeName.toLowerCase(),n)?y.setStyle(e,n,r):y.setAttrib(e,n,""+r);}));}},B=function(e,t,n){O(e,"width",t),O(e,"height",n);},P=function(e){var a,v,b,C,x;a=e.screenX-u,v=e.screenY-c,m=a*i[2]+s,g=v*i[3]+f,m=m<5?5:m,g=g<5?5:g,b=(_(n)||A(n))&&!1!==function(e){return e.getParam("resize_img_proportional",!0,"boolean")}(t)?!od.modifierPressed(e):od.modifierPressed(e),b&&(S(a)>S(v)?(g=k(m*l),m=k(g/l)):(m=k(g/l),g=k(m*l))),B(r,m,g),C=(C=i.startPos.x+a)>0?C:0,x=(x=i.startPos.y+v)>0?x:0,y.setStyles(o,{left:C,top:x,display:"block"}),o.innerHTML=m+" &times; "+g,i[2]<0&&r.clientWidth<=m&&y.setStyle(r,"left",undefined+(s-m)),i[3]<0&&r.clientHeight<=g&&y.setStyle(r,"top",undefined+(f-g)),(a=N.scrollWidth-p)+(v=N.scrollHeight-h)!==0&&y.setStyles(o,{left:C-a,top:x-v}),d||(!function(e,t,n,r,o){e.fire("ObjectResizeStart",{target:t,width:n,height:r,origin:o});}(t,n,s,f,"corner-"+i.name),d=!0);},L=function(){var e=d;d=!1,e&&(O(n,"width",m),O(n,"height",g)),y.unbind(x,"mousemove",P),y.unbind(x,"mouseup",L),w!==x&&(y.unbind(w,"mousemove",P),y.unbind(w,"mouseup",L)),y.remove(r),y.remove(o),y.remove(a),I(n),e&&(!function(e,t,n,r,o){e.fire("ObjectResized",{target:t,width:n,height:r,origin:o});}(t,n,m,g,"corner-"+i.name),y.setAttrib(n,"style",y.getAttrib(n,"style"))),t.nodeChanged();},I=function(e){z();var d=y.getPos(e,N),b=d.x,S=d.y,k=e.getBoundingClientRect(),_=k.width||k.right-k.left,R=k.height||k.bottom-k.top;n!==e&&(M(),n=e,m=g=0);var O=t.fire("ObjectSelected",{target:e}),I=y.getAttrib(n,v,"1");T(e)&&!O.isDefaultPrevented()?C(E,(function(e,t){var d,m=function(d){var m,g=D(n)[0];u=d.screenX,c=d.screenY,s=g.clientWidth,f=g.clientHeight,l=f/s,(i=e).name=t,i.startPos={x:_*e[0]+b,y:R*e[1]+S},p=N.scrollWidth,h=N.scrollHeight,a=y.add(N,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),y.setStyles(a,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),r=A(m=n)?y.create("img",{src:wt.transparentSrc}):m.cloneNode(!0),y.addClass(r,"mce-clonedresizable"),y.setAttrib(r,"data-mce-bogus","all"),r.contentEditable="false",y.setStyles(r,{left:b,top:S,margin:0}),B(r,_,R),r.removeAttribute(v),N.appendChild(r),y.bind(x,"mousemove",P),y.bind(x,"mouseup",L),w!==x&&(y.bind(w,"mousemove",P),y.bind(w,"mouseup",L)),o=y.add(N,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},s+" &times; "+f);};(d=y.get("mceResizeHandle"+t))&&y.remove(d),d=y.add(N,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),11===wt.ie&&(d.contentEditable=!1),y.bind(d,"mousedown",(function(e){e.stopImmediatePropagation(),e.preventDefault(),m(e);})),e.elm=d,y.setStyles(d,{left:_*e[0]+b-d.offsetWidth/2,top:R*e[1]+S-d.offsetHeight/2});})):M(),y.getAttrib(n,v)||n.setAttribute(v,I);},M=function(){z(),n&&n.removeAttribute(v),le(E,(function(e,t){var n=y.get("mceResizeHandle"+t);n&&(y.unbind(n),y.remove(n));}));},F=function(n){var r,o=function(e,t){if(e)do{if(e===t)return !0}while(e=e.parentNode)};d||t.removed||(C(y.select("img[data-mce-selected],hr[data-mce-selected]"),(function(e){e.removeAttribute(v);})),r="mousedown"===n.type?n.target:e.getNode(),o(r=y.$(r).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],N)&&(H(),o(e.getStart(!0),r)&&o(e.getEnd(!0),r))?I(r):M());},U=function(e){return id(Zl(t.getBody(),e))},z=function(){le(E,(function(e){e.elm&&(y.unbind(e.elm),delete e.elm);}));},H=function(){try{t.getDoc().execCommand("enableObjectResizing",!1,"false");}catch(e){}};t.on("init",(function(){if(H(),wt.browser.isIE()||wt.browser.isEdge()){t.on("mousedown click",(function(e){var n=e.target,r=n.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||U(n)||(2!==e.button&&t.selection.select(n,"TABLE"===r),"mousedown"===e.type&&t.nodeChanged());}));var e=function(e){var n=function(e){ro.setEditorTimeout(t,(function(){return t.selection.select(e)}));};if(U(e.target)||Kn(e.target))return e.preventDefault(),void n(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&n(e.target));};y.bind(N,"mscontrolselect",e),t.on("remove",(function(){return y.unbind(N,"mscontrolselect",e)}));}var r=ro.throttle((function(e){t.composing||F(e);}));t.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",r),t.on("keyup compositionend",(function(e){n&&"TABLE"===n.nodeName&&r(e);})),t.on("hide blur",M),t.on("contextmenu longpress",R,!0);})),t.on("remove",z);return {isResizable:T,showResizeRect:I,hideResizeRect:M,updateResizeRect:F,destroy:function(){n=r=a=null;}}},ud=function(e){return qn(e)||$n(e)},cd=function(e,t,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(i.caretRangeFromPoint)r=i.caretRangeFromPoint(e,t);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0);}catch(o){r=function(e,t,n){var r,o=n.elementFromPoint(e,t),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=_t.toArray(i.getClientRects())).sort((function(e,n){return (e=Math.abs(Math.max(e.top-t,e.bottom-t)))-Math.abs(Math.max(n.top-t,n.bottom-t))}))).length>0){t=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(e,t),i.collapse(!0),i}catch(e){}}return null}(e,t,n);}return function(e,t){var n=e&&e.parentElement?e.parentElement():null;return $n(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode;}return null}(n,t,ud))?null:e}(r,n.body)}return r},sd=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},fd=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)},ld=function(e,t,n){return fd(e,t,(function(e){return e.nodeName===n}))},dd=function(e){return e&&"TABLE"===e.nodeName},md=function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)},gd=function(e,t){return _o(e)&&!1===fd(e,t,Ff)},pd=function(e,t,n){for(var r=new ao(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(jn(t))return !0},hd=function(e,t,n,r,o){var i,a,u=e.getRoot(),c=e.schema.getNonEmptyElements(),s=e.getParent(o.parentNode,e.isBlock)||u;if(r&&jn(o)&&t&&e.isEmpty(s))return I.some(Ac(o.parentNode,e.nodeIndex(o)));for(var f=new ao(o,s);a=f[r?"prev":"next"]();){if("false"===e.getContentEditableParent(a)||gd(a,u))return I.none();if(Fn(a)&&a.nodeValue.length>0)return !1===ld(a,u,"A")?I.some(Ac(a,r?a.nodeValue.length:0)):I.none();if(e.isBlock(a)||c[a.nodeName.toLowerCase()])return I.none();i=a;}return n&&i?I.some(Ac(i,0)):I.none()},vd=function(e,t,n,r){var o,i,a,u,c=e.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var f=Dn(o)&&i===o.childNodes.length,l=e.schema.getNonEmptyElements();if(u=n,_o(o))return I.none();if(Dn(o)&&i>o.childNodes.length-1&&(u=!1),zn(o)&&(o=c,i=0),o===c){if(u&&(a=o.childNodes[i>0?i-1:0])){if(_o(a))return I.none();if(l[a.nodeName]||dd(a))return I.none()}if(o.hasChildNodes()){if(i=Math.min(!u&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Fn(o)&&f?o.data.length:0,!t&&o===c.lastChild&&dd(o))return I.none();if(function(e,t){for(;t&&t!==e;){if($n(t))return !0;t=t.parentNode;}return !1}(c,o)||_o(o))return I.none();if(o.hasChildNodes()&&!1===dd(o)){a=o;var d=new ao(o,c);do{if($n(a)||_o(a)){s=!1;break}if(Fn(a)&&a.nodeValue.length>0){i=u?0:a.nodeValue.length,o=a,s=!0;break}if(l[a.nodeName.toLowerCase()]&&!md(a)){i=e.nodeIndex(a),o=a.parentNode,u||i++,s=!0;break}}while(a=u?d.next():d.prev())}}}return t&&(Fn(o)&&0===i&&hd(e,f,t,!0,o).each((function(e){o=e.container(),i=e.offset(),s=!0;})),Dn(o)&&((a=o.childNodes[i])||(a=o.childNodes[i-1]),!a||!jn(a)||function(e,t){return e.previousSibling&&e.previousSibling.nodeName===t}(a,"A")||pd(e,a,!1)||pd(e,a,!0)||hd(e,f,t,!0,a).each((function(e){o=e.container(),i=e.offset(),s=!0;})))),u&&!t&&Fn(o)&&i===o.nodeValue.length&&hd(e,f,t,!1,o).each((function(e){o=e.container(),i=e.offset(),s=!0;})),s?I.some(Ac(o,i)):I.none()},bd=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=Ac.fromRangeStart(t);return vd(e,n,!0,r).each((function(e){n&&Ac.isAbove(o,e)||r.setStart(e.container(),e.offset());})),n||vd(e,n,!1,r).each((function(e){r.setEnd(e.container(),e.offset());})),n&&r.collapse(!0),sd(t,r)?I.none():I.some(r)},yd=function(e,t){return e.splitText(t)},Cd=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Fn(t)?n>0&&n<t.nodeValue.length&&(t=(r=yd(t,n)).previousSibling,o>n?(t=r=yd(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Fn(t)&&n>0&&n<t.nodeValue.length&&(t=yd(t,n),n=0),Fn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=yd(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},xd=function(e){return {walk:function(t,n){return Ol(e,t,n)},split:Cd,normalize:function(t){return bd(e,t).fold(T,(function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0}))}}};xd.compareRanges=sd,xd.getCaretRangeFromPoint=cd,xd.getSelectedNode=ac,xd.getNode=uc;var wd,Sd=function(e,t){var n=function(n){var r=t(n);if(r<=0||null===r){var o=or(n,e);return parseFloat(o)||0}return r},r=function(e,t){return Y(t,(function(t,n){var r=or(e,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?t:t+o}),0)};return {set:function(t,n){if(!C(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);var r=t.dom;Gn(r)&&(r.style[e]=n+"px");},get:n,getOuter:n,aggregate:r,max:function(e,t,n){var o=r(e,n);return t>o?t-o:0}}}("height",(function(e){var t=e.dom;return bn(e)?t.getBoundingClientRect().height:t.offsetHeight})),kd=function(e,t){return e.view(t).fold(k([]),(function(t){var n=e.owner(t),r=kd(e,n);return [t].concat(r)}))},Nd=Object.freeze({__proto__:null,view:function(e){var t;return (e.dom===document?I.none():I.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(Rt.fromDom)},owner:function(e){return qt(e)}}),Ed=function(e){var t=Rt.fromDom(document),n=Sn(t),r=function(e,t){var n=t.owner(e);return kd(t,n)}(e,Nd),o=wn(e),i=X(r,(function(e,t){var n=wn(t);return {left:e.left+n.left,top:e.top+n.top}}),{left:0,top:0});return Cn(i.left+o.left+n.left,i.top+o.top+n.top)},_d=function(e){return "textarea"===It(e)},Ad=function(e,t){var n=function(e){var t=e.dom.ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement;if(n===e.dom)return Cn(n.offsetLeft,n.offsetTop);var i=xn(null==r?void 0:r.pageYOffset,o.scrollTop),a=xn(null==r?void 0:r.pageXOffset,o.scrollLeft),u=xn(o.clientTop,n.clientTop),c=xn(o.clientLeft,n.clientLeft);return wn(e).translate(a-c,i-u)}(e),r=function(e){return Sd.get(e)}(e);return {element:e,bottom:n.top+r,height:r,pos:n,cleanup:t}},Rd=function(e,t){var n=function(e,t){var n=Jt(e);if(0===n.length||_d(e))return {element:e,offset:t};if(t<n.length&&!_d(n[t]))return {element:n[t],offset:0};var r=n[n.length-1];return _d(r)?{element:e,offset:t}:"img"===It(r)?{element:r,offset:1}:zt(r)?{element:r,offset:Wl(r).length}:{element:r,offset:Jt(r).length}}(e,t),r=Rt.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>');return fn(n.element,r),Ad(r,(function(){return hn(r)}))},Dd=function(e,t,n,r){Pd(e,(function(o,i){return Od(e,t,n,r)}),n);},Td=function(e,t,n,r,o){var i={elm:r.element.dom,alignToTop:o};(function(e,t){return e.fire("ScrollIntoView",t).isDefaultPrevented()})(e,i)||(n(t,Sn(t).top,r,o),function(e,t){e.fire("AfterScrollIntoView",t);}(e,i));},Od=function(e,t,n,r){var o=Rt.fromDom(e.getBody()),i=Rt.fromDom(e.getDoc());o.dom.offsetWidth;var a=Rd(Rt.fromDom(n.startContainer),n.startOffset);Td(e,i,t,a,r),a.cleanup();},Bd=function(e,t,n,r){var o=Rt.fromDom(e.getDoc());Td(e,o,n,function(e){return Ad(Rt.fromDom(e),x)}(t),r);},Pd=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(Rt.fromDom(r),Rt.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n);},Ld=function(e,t,n,r){var o=e.pos;if(n)kn(o.left,o.top,r);else {var i=o.top-t+e.height;kn(o.left,i,r);}},Id=function(e,t,n,r,o){var i=n+t,a=r.pos.top,u=r.bottom,c=u-a>=n;if(a<t)Ld(r,n,!1!==o,e);else if(a>i){Ld(r,n,c?!1!==o:!0===o,e);}else u>i&&!c&&Ld(r,n,!0===o,e);},Md=function(e,t,n,r){var o=e.dom.defaultView.innerHeight;Id(e,t,o,n,r);},Fd=function(e,t,n,r){var o=e.dom.defaultView.innerHeight;Id(e,t,o,n,r);var i=Ed(n.element),a=_n(window);i.top<a.y?Nn(n.element,!1!==r):i.top>a.bottom&&Nn(n.element,!0===r);},Ud=function(e,t,n){return Dd(e,Md,t,n)},zd=function(e,t,n){return Bd(e,t,Md,n)},Hd=function(e,t,n){return Dd(e,Fd,t,n)},jd=function(e,t,n){return Bd(e,t,Fd,n)},Vd=function(e,t,n){(e.inline?Ud:Hd)(e,t,n);},qd=function(e){var t=an(e).dom;return e.dom===t.activeElement},$d=function(e){return void 0===e&&(e=Rt.fromDom(document)),I.from(e.dom.activeElement).map(Rt.fromDom)},Wd=function(e,t,n,r){return {start:e,soffset:t,finish:n,foffset:r}},Kd=kr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Xd=(Kd.before,Kd.on,Kd.after,function(e){return e.fold(N,N,N)}),Yd=kr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Gd={domRange:Yd.domRange,relative:Yd.relative,exact:Yd.exact,exactFromRange:function(e){return Yd.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){var t=function(e){return e.match({domRange:function(e){return Rt.fromDom(e.startContainer)},relative:function(e,t){return Xd(e)},exact:function(e,t,n,r){return e}})}(e);return $t(t)},range:Wd},Jd=mt().browser,Qd=function(e,t){var n=zt(t)?Wl(t).length:Jt(t).length+1;return e>n?n:e<0?0:e},Zd=function(e){return Gd.range(e.start,Qd(e.soffset,e.start),e.finish,Qd(e.foffset,e.finish))},em=function(e,t){return !Rn(t.dom)&&(Lt(e,t)||Bt(e,t))},tm=function(e){return function(t){return em(e,t.start)&&em(e,t.finish)}},nm=function(e){return !0===e.inline||Jd.isIE()},rm=function(e){return Gd.range(Rt.fromDom(e.startContainer),e.startOffset,Rt.fromDom(e.endContainer),e.endOffset)},om=function(e){return function(e){var t=e.getSelection();return (t&&0!==t.rangeCount?I.from(t.getRangeAt(0)):I.none()).map(rm)}($t(e).dom).filter(tm(e))},im=function(e){var t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),I.some(t)}catch(e){return I.none()}},am=function(e){var t=nm(e)?om(Rt.fromDom(e.getBody())):I.none();e.bookmark=t.isSome()?t:e.bookmark;},um=function(e){return (e.bookmark?e.bookmark:I.none()).bind((function(t){return function(e,t){return I.from(t).filter(tm(e)).map(Zd)}(Rt.fromDom(e.getBody()),t)})).bind(im)},cm={isEditorUIElement:function(e){var t=e.className.toString();return -1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},sm=function(e,t){mt().browser.isIE()?function(e){e.on("focusout",(function(){am(e);}));}(e):function(e,t){e.on("mouseup touchend",(function(e){t.throttle();}));}(e,t),e.on("keyup NodeChange",(function(t){(function(e){return "nodechange"===e.type&&e.selectionChange})(t)||am(e);}));},fm=function(e){var t=_u((function(){am(e);}),0);e.on("init",(function(){e.inline&&function(e,t){var n=function(){t.throttle();};pu.DOM.bind(document,"mouseup",n),e.on("remove",(function(){pu.DOM.unbind(document,"mouseup",n);}));}(e,t),sm(e,t);})),e.on("remove",(function(){t.cancel();}));},lm=pu.DOM,dm=function(e,t){var n=function(e){return e.getParam("custom_ui_selector","","string")}(e),r=lm.getParent(t,(function(t){return function(e){return cm.isEditorUIElement(e)}(t)||!!n&&e.dom.is(t,n)}));return null!==r},mm=function(e,t){var n=t.editor;fm(n),n.on("focusin",(function(){var t=e.focusedEditor;t!==n&&(t&&t.fire("blur",{focusedEditor:n}),e.setActive(n),e.focusedEditor=n,n.fire("focus",{blurredEditor:t}),n.focus(!0));})),n.on("focusout",(function(){ro.setEditorTimeout(n,(function(){var t=e.focusedEditor;dm(n,function(e){try{var t=an(Rt.fromDom(e.getElement()));return $d(t).fold((function(){return document.body}),(function(e){return e.dom}))}catch(e){return document.body}}(n))||t!==n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null);}));})),wd||(wd=function(t){var n=e.activeEditor;n&&function(e){if(on()&&b(e.target)){var t=Rt.fromDom(e.target);if(Ut(t)&&sn(t)&&e.composed&&e.composedPath){var n=e.composedPath();if(n)return ie(n)}}return I.from(e.target)}(t).each((function(t){t.ownerDocument===document&&(t===document.body||dm(n,t)||e.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null));}));},lm.bind(document,"focusin",wd));},gm=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(lm.unbind(document,"focusin",wd),wd=null);},pm=function(e,t){return function(e){return e.collapsed?I.from(uc(e.startContainer,e.startOffset)).map(Rt.fromDom):I.none()}(t).bind((function(t){return ho(t)?I.some(t):!1===Lt(e,t)?I.some(e):I.none()}))},hm=function(e,t){pm(Rt.fromDom(e.getBody()),t).bind((function(e){return Lf(e.dom)})).fold((function(){e.selection.normalize();}),(function(t){return e.selection.setRng(t.toRange())}));},vm=function(e){if(e.setActive)try{e.setActive();}catch(t){e.focus();}else e.focus();},bm=function(e){return qd(e)||(t=e,$d(an(t)).filter((function(e){return t.dom.contains(e.dom)}))).isSome();var t;},ym=function(e){return e.inline?function(e){var t=e.getBody();return t&&bm(Rt.fromDom(t))}(e):function(e){return e.iframeElement&&qd(Rt.fromDom(e.iframeElement))}(e)},Cm=function(e){return ym(e)||function(e){var t=an(Rt.fromDom(e.getElement()));return $d(t).filter((function(t){return !(void 0!==(n=t.dom.classList)&&(n.contains("tox-edit-area")||n.contains("tox-edit-area__iframe")||n.contains("mce-content-body")))&&dm(e,t.dom);var n;})).isSome()}(e)},xm=function(e){return e.editorManager.setActive(e)},wm=function(e,t){e.removed||(t?xm(e):function(e){var t=e.selection,n=e.getBody(),r=t.getRng();e.quirks.refreshContentEditable(),void 0!==e.bookmark&&!1===ym(e)&&um(e).each((function(t){e.selection.setRng(t),r=t;}));var o=function(e,t){return e.dom.getParent(t,(function(t){return "true"===e.dom.getContentEditable(t)}))}(e,t.getNode());if(e.$.contains(n,o))return vm(o),hm(e,r),void xm(e);e.inline||(wt.opera||vm(n),e.getWin().focus()),(wt.gecko||e.inline)&&(vm(n),hm(e,r)),xm(e);}(e));},Sm=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return I.from(i).map(Rt.fromDom).map((function(e){return r&&t.collapsed?e:Qt(e,o(e,a)).getOr(e)})).bind((function(e){return Ut(e)?I.some(e):Wt(e).filter(Ut)})).map((function(e){return e.dom})).getOr(e)},km=function(e,t,n){return Sm(e,t,!0,n,(function(e,t){return Math.min(tn(e),t)}))},Nm=function(e,t,n){return Sm(e,t,!1,n,(function(e,t){return t>0?t-1:t}))},Em=function(e,t){for(var n=e;e&&Fn(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},_m=function(e,t){return V(t,(function(t){var n=e.fire("GetSelectionRange",{range:t});return n.range!==t?n.range:t}))},Am={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Rm=function(e,t,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(e[r])return e[r];if(e!==t){var i=e[o];if(i)return i;for(var a=e.parent;a&&a!==t;a=a.parent)if(i=a[o])return i}},Dm=function(e){if(!Xo(e.value))return !1;var t=e.parent;return !t||"span"===t.name&&!t.attr("style")||!/^[ ]+$/.test(e.value)},Tm=function(e){var t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t},Om=function(){function e(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={});}return e.create=function(t,n){var r=new e(t,Am[t]||1);return n&&le(n,(function(e,t){r.attr(t,e);})),r},e.prototype.replace=function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},e.prototype.attr=function(e,t){var n,r=this;if("string"!=typeof e)return null!=e&&le(e,(function(e,t){r.attr(t,e);})),r;if(n=r.attributes){if(void 0!==t){if(null===t){if(e in n.map){delete n.map[e];for(var o=n.length;o--;)if(n[o].name===e)return n.splice(o,1),r}return r}if(e in n.map){for(o=n.length;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,r}return n.map[e]}},e.prototype.clone=function(){var t,n=this,r=new e(n.name,n.type);if(t=n.attributes){var o=[];o.map={};for(var i=0,a=t.length;i<a;i++){var u=t[i];"id"!==u.name&&(o[o.length]={name:u.name,value:u.value},o.map[u.name]=u.value);}r.attributes=o;}return r.value=n.value,r.shortEnded=n.shortEnded,r},e.prototype.wrap=function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},e.prototype.unwrap=function(){for(var e=this,t=e.firstChild;t;){var n=t.next;e.insert(t,e,!0),t=n;}e.remove();},e.prototype.remove=function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},e.prototype.append=function(e){var t=this;e.parent&&e.remove();var n=t.lastChild;return n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},e.prototype.insert=function(e,t,n){e.parent&&e.remove();var r=t.parent||this;return n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},e.prototype.getAll=function(e){for(var t=[],n=this.firstChild;n;n=Rm(n,this))n.name===e&&t.push(n);return t},e.prototype.children=function(){for(var e=[],t=this.firstChild;t;t=t.next)e.push(t);return e},e.prototype.empty=function(){var e=this;if(e.firstChild){for(var t=[],n=e.firstChild;n;n=Rm(n,e))t.push(n);for(var r=t.length;r--;){(n=t[r]).parent=n.firstChild=n.lastChild=n.next=n.prev=null;}}return e.firstChild=e.lastChild=null,e},e.prototype.isEmpty=function(e,t,n){void 0===t&&(t={});var r=this,o=r.firstChild;if(Tm(r))return !1;if(o)do{if(1===o.type){if(o.attr("data-mce-bogus"))continue;if(e[o.name])return !1;if(Tm(o))return !1}if(8===o.type)return !1;if(3===o.type&&!Dm(o))return !1;if(3===o.type&&o.parent&&t[o.parent.name]&&Xo(o.value))return !1;if(n&&n(o))return !1}while(o=Rm(o,r));return !0},e.prototype.walk=function(e){return Rm(this,null,e)},e}(),Bm=function(e,t){return e.replace(t.re,(function(e){return be(t.uris,e).getOr(e)}))},Pm=_t.each,Lm=_t.trim,Im="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Mm={ftp:21,http:80,https:443,mailto:25},Fm=["img","video"],Um=function(e,t,n){return !e.allow_html_data_urls&&(/^data:image\//i.test(t)?function(e,t){return b(e)?!e:!b(t)||!H(Fm,t)}(e.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(t):/^data:/i.test(t))},zm=function(){function e(t,n){t=Lm(t),this.settings=n||{};var r=this.settings.base_uri,o=this;if(/^([\w\-]+):([^\/]{2})/i.test(t)||/^\s*#/.test(t))o.source=t;else {var i=0===t.indexOf("//");if(0!==t.indexOf("/")||i||(t=(r&&r.protocol||"http")+"://mce_host"+t),!/^[\w\-]*:?\/\//.test(t)){var a=this.settings.base_uri?this.settings.base_uri.path:new e(document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)t="//mce_host"+o.toAbsPath(a,t);else {var u=/([^#?]*)([#?]?.*)/.exec(t);t=(r&&r.protocol||"http")+"://mce_host"+o.toAbsPath(a,u[1])+u[2];}}t=t.replace(/@@/g,"(mce_at)");var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(t);Pm(Im,(function(e,t){var n=c[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n;})),r&&(o.protocol||(o.protocol=r.protocol),o.userInfo||(o.userInfo=r.userInfo),o.port||"mce_host"!==o.host||(o.port=r.port),o.host&&"mce_host"!==o.host||(o.host=r.host),o.source=""),i&&(o.protocol="");}}return e.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},e.isDomSafe=function(e,t,n){if(void 0===n&&(n={}),n.allow_script_urls)return !0;var r=bi.decode(e).replace(/[\s\u0000-\u001F]+/g,"");try{r=decodeURIComponent(r);}catch(e){r=unescape(r);}return !/((java|vb)script|mhtml):/i.test(r)&&!Um(n,r,t)},e.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},e.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source="",this.getURI();},e.prototype.toRelative=function(t){var n;if("./"===t)return t;var r=new e(t,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},e.prototype.toAbsolute=function(t,n){var r=new e(t,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},e.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return !0;var t=Mm[this.protocol];if(t&&(this.port||t)==(e.port||t))return !0}return !1},e.prototype.toRelPath=function(e,t){var n,r,o=0,i="",a=e.substring(0,e.lastIndexOf("/")).split("/"),u=t.split("/");if(a.length>=u.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||a[n]!==u[n]){o=n+1;break}if(a.length<u.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return t;for(n=0,r=a.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=u.length;n<r;n++)i+=n!==o-1?"/"+u[n]:u[n];return i},e.prototype.toAbsPath=function(e,t){var n,r,o=0,i=[],a=/\/$/.test(t)?"/":"",u=e.split("/"),c=t.split("/");for(Pm(u,(function(e){e&&i.push(e);})),u=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=u.length-o)<=0?te(i).join("/"):u.slice(0,n).join("/")+"/"+te(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},e.prototype.getURI=function(e){var t;return void 0===e&&(e=!1),this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source},e}(),Hm=_t.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),jm=function(e,t,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=e.getShortEndedElements(),a=1,u=n;0!==a;)for(r.lastIndex=u;;){var c=r.exec(t);if(null===c)return u;if("!"===c[1]){u=Me(c[2],"--")?Vm(t,!1,c.index+"!--".length):Vm(t,!0,c.index+1);break}o.lastIndex=r.lastIndex;var s=o.exec(t);if(!g(s)&&s.index===r.lastIndex){"/"===c[1]?a-=1:ye(i,c[2])||(a+=1),u=r.lastIndex+s[0].length;break}}return u},Vm=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(e,t){return /^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(e.substr(t))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return -1!==i?i:r.length}var a=/--!?>/g;a.lastIndex=n;var u=a.exec(e);return u?u.index+u[0].length:r.length},qm=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},$m=function(e,t){var n;void 0===t&&(t=Ai());var r=null!==(n=(e=e||{}).document)&&void 0!==n?n:document,o=r.createElement("form");!1!==e.fix_self_closing&&(e.fix_self_closing=!0);var i=e.comment?e.comment:x,a=e.cdata?e.cdata:x,u=e.text?e.text:x,c=e.start?e.start:x,s=e.end?e.end:x,f=e.pi?e.pi:x,l=e.doctype?e.doctype:x,d=function(n,d){void 0===d&&(d="html");for(var m,g,p,h,v,b,y,C,x,w,S,k,N,E,_,A,R,D,T,O=n.html,B=0,P=[],L=0,I=bi.decode,M=_t.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),F="html"===d?0:1,U=function(e){var t,n;for(t=P.length;t--&&P[t].name!==e;);if(t>=0){for(n=P.length-1;n>=t;n--)(e=P[n]).valid&&s(e.name);P.length=t;}},z=function(e,t){return u(Bm(e,n),t)},H=function(t){""!==t&&(">"===t.charAt(0)&&(t=" "+t),e.allow_conditional_comments||"[if"!==t.substr(0,3).toLowerCase()||(t=" "+t),i(Bm(t,n)));},j=function(e,t){var n=e||"",r=!Me(n,"--"),o=Vm(O,r,t);return e=O.substr(t,o-t),H(r?n+e:e),o+1},V=function(t,i,a,u,c){if(a=function(e){return Bm(e,n)}((i=i.toLowerCase())in X?i:I(a||u||c||"")),Y&&!C&&!1===function(e){return 0===e.indexOf("data-")||0===e.indexOf("aria-")}(i)){var s=E[i];if(!s&&_){for(var f=_.length;f--&&!(s=_[f]).pattern.test(i););-1===f&&(s=null);}if(!s)return;if(s.validValues&&!(a in s.validValues))return}("name"===i||"id"===i)&&t in Hm&&(a in r||a in o)||M[i]&&!zm.isDomSafe(a,t,e)||C&&(i in M||0===i.indexOf("on"))||(h.map[i]=a,h.push({name:i,value:a}));},q=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),$=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,W=t.getShortEndedElements(),K=e.self_closing_elements||t.getSelfClosingElements(),X=t.getBoolAttrs(),Y=e.validate,G=e.remove_internals,J=e.fix_self_closing,Q=t.getSpecialElements(),Z=O+">";m=q.exec(Z);){var ee=m[0];if(B<m.index&&z(I(O.substr(B,m.index-B))),g=m[7])":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),U(g);else if(g=m[8]){if(m.index+ee.length>O.length){z(I(O.substr(m.index))),B=m.index+ee.length;continue}":"===(g=g.toLowerCase()).charAt(0)&&(g=g.substr(1)),x=g in W,J&&K[g]&&P.length>0&&P[P.length-1].name===g&&U(g);var te=qm($,m[9]);if(null!==te){if("all"===te){B=jm(t,O,q.lastIndex),q.lastIndex=B;continue}S=!1;}if(!Y||(w=t.getElementRule(g))){if(S=!0,Y&&(E=w.attributes,_=w.attributePatterns),(N=m[9])?((C=-1!==N.indexOf("data-mce-type"))&&G&&(S=!1),(h=[]).map={},N.replace($,(function(e,t,n,r,o){return V(g,t,n,r,o),""}))):(h=[]).map={},Y&&!C){if(A=w.attributesRequired,R=w.attributesDefault,D=w.attributesForced,w.removeEmptyAttrs&&!h.length&&(S=!1),D)for(v=D.length;v--;)y=(k=D[v]).name,"{$uid}"===(T=k.value)&&(T="mce_"+L++),h.map[y]=T,h.push({name:y,value:T});if(R)for(v=R.length;v--;)(y=(k=R[v]).name)in h.map||("{$uid}"===(T=k.value)&&(T="mce_"+L++),h.map[y]=T,h.push({name:y,value:T}));if(A){for(v=A.length;v--&&!(A[v]in h.map););-1===v&&(S=!1);}if(k=h.map["data-mce-bogus"]){if("all"===k){B=jm(t,O,q.lastIndex),q.lastIndex=B;continue}S=!1;}}S&&c(g,h,x);}else S=!1;if(p=Q[g]){p.lastIndex=B=m.index+ee.length,(m=p.exec(O))?(S&&(b=O.substr(B,m.index-B)),B=m.index+m[0].length):(b=O.substr(B),B=O.length),S&&(b.length>0&&z(b,!0),s(g)),q.lastIndex=B;continue}x||(N&&N.indexOf("/")===N.length-1?S&&s(g):P.push({name:g,valid:S}));}else if(g=m[1])H(g);else if(g=m[2]){if(!(1===F||e.preserve_cdata||P.length>0&&t.isValidChild(P[P.length-1].name,"#cdata"))){B=j("",m.index+2),q.lastIndex=B;continue}a(g);}else if(g=m[3])l(g);else {if((g=m[4])||"<!"===ee){B=j(g,m.index+ee.length),q.lastIndex=B;continue}if(g=m[5]){if(1!==F){B=j("?",m.index+2),q.lastIndex=B;continue}f(g,m[6]);}}B=m.index+ee.length;}for(B<O.length&&z(I(O.substr(B))),v=P.length-1;v>=0;v--)(g=P[v]).valid&&s(g.name);};return {parse:function(e,t){void 0===t&&(t="html"),d(function(e){for(var t,n=/data:[^;]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=Wu("img"),a=0,u=0;t=n.exec(e);){var c=t[0],s=i+"_"+u++;o[s]=c,a<t.index&&r.push(e.substr(a,t.index-a)),r.push(s),a=t.index+c.length;}var f=new RegExp(i+"_[0-9]+","g");return 0===a?{prefix:i,uris:o,html:e,re:f}:(a<e.length&&r.push(e.substr(a)),{prefix:i,uris:o,html:r.join(""),re:f})}(e),t);}}};$m.findEndTag=jm;var Wm=function(e,t){for(var n,r=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,o=e.schema,i=function(e,t){var n=new RegExp(["\\s?("+e.join("|")+')="[^"]+"'].join("|"),"gi");return t.replace(n,"")}(e.getTempAttrs(),t),a=o.getShortEndedElements();n=r.exec(i);){var u=r.lastIndex,c=n[0].length,s=void 0;s=a[n[1]]?u:$m.findEndTag(o,i,u),i=i.substring(0,u-c)+i.substring(s),r.lastIndex=u-c;}return wo(i)},Km=Wm,Xm=function(e,t,n,r){var o,i=function(e,t){return Re(Re({},e),{format:t,get:!0,getInner:!0})}(t,n),a=t.no_events?i:e.fire("BeforeGetContent",i);return o="raw"===a.format?_t.trim(Km(e.serializer,r.innerHTML)):"text"===a.format?e.dom.isEmpty(r)?"":wo(r.innerText||r.textContent):"tree"===a.format?e.serializer.serialize(r,a):function(e,t){var n=ts(e),r=new RegExp("^(<"+n+"[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return t.replace(r,"")}(e,e.serializer.serialize(r,a)),H(["text","tree"],a.format)||bo(Rt.fromDom(r))?a.content=o:a.content=_t.trim(o),a.no_events?a.content:e.fire("GetContent",a).content},Ym=_t.each,Gm=function(e){return {compare:function(t,n){if(t.nodeName!==n.nodeName)return !1;var r=function(t){var n={};return Ym(e.getAttribs(t),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=e.getAttrib(t,o));})),n},o=function(e,t){var n,r;for(r in e)if(ye(e,r)){if(void 0===(n=t[r]))return !1;if(e[r]!==n)return !1;delete t[r];}for(r in t)if(ye(t,r))return !1;return !0};return !!o(r(t),r(n))&&(!!o(e.parseStyle(e.getAttrib(t,"style")),e.parseStyle(e.getAttrib(n,"style")))&&(!Gf(t)&&!Gf(n)))}}},Jm=_t.makeMap,Qm=function(e){var t=[],n=(e=e||{}).indent,r=Jm(e.indent_before||""),o=Jm(e.indent_after||""),i=bi.getEncodeFunc(e.entity_encoding||"raw",e.entities),a="html"===e.element_format;return {start:function(e,u,c){var s,f,l,d;if(n&&r[e]&&t.length>0&&(d=t[t.length-1]).length>0&&"\n"!==d&&t.push("\n"),t.push("<",e),u)for(s=0,f=u.length;s<f;s++)l=u[s],t.push(" ",l.name,'="',i(l.value,!0),'"');t[t.length]=!c||a?">":" />",c&&n&&o[e]&&t.length>0&&(d=t[t.length-1]).length>0&&"\n"!==d&&t.push("\n");},end:function(e){var r;t.push("</",e,">"),n&&o[e]&&t.length>0&&(r=t[t.length-1]).length>0&&"\n"!==r&&t.push("\n");},text:function(e,n){e.length>0&&(t[t.length]=n?e:i(e));},cdata:function(e){t.push("<![CDATA[",e,"]]>");},comment:function(e){t.push("\x3c!--",e,"--\x3e");},pi:function(e,r){r?t.push("<?",e," ",i(r),"?>"):t.push("<?",e,"?>"),n&&t.push("\n");},doctype:function(e){t.push("<!DOCTYPE",e,">",n?"\n":"");},reset:function(){t.length=0;},getContent:function(){return t.join("").replace(/\n$/,"")}}},Zm=function(e,t){void 0===t&&(t=Ai());var n=Qm(e);(e=e||{}).validate=!("validate"in e)||e.validate;return {serialize:function(r){var o=e.validate,i={3:function(e){n.text(e.value,e.raw);},8:function(e){n.comment(e.value);},7:function(e){n.pi(e.name,e.value);},10:function(e){n.doctype(e.value);},4:function(e){n.cdata(e.value);},11:function(e){if(e=e.firstChild)do{a(e);}while(e=e.next)}};n.reset();var a=function(e){var r=i[e.type];if(r)r(e);else {var u=e.name,c=e.shortEnded,s=e.attributes;if(o&&s&&s.length>1){var f=[];f.map={};var l=t.getElementRule(e.name);if(l){for(var d=0,m=l.attributesOrder.length;d<m;d++){if((p=l.attributesOrder[d])in s.map){var g=s.map[p];f.map[p]=g,f.push({name:p,value:g});}}for(d=0,m=s.length;d<m;d++){var p;if(!((p=s[d].name)in f.map)){g=s.map[p];f.map[p]=g,f.push({name:p,value:g});}}s=f;}}if(n.start(e.name,s,c),!c){if(e=e.firstChild)do{a(e);}while(e=e.next);n.end(u);}}};return 1!==r.type||e.inner?i[11](r):a(r),n.getContent()}}},eg=new Set;q(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],(function(e){eg.add(e);}));var tg=["font","text-decoration","text-emphasis"],ng=function(e,t){return se(e.parseStyle(e.getAttrib(t,"style")))},rg=function(e,t){return ee(ng(e,t),(function(e){return !function(e){return eg.has(e)}(e)}))},og=function(e,t,n){var r=ng(e,t),o=ng(e,n),i=function(r){var o=e.getStyle(t,r),i=e.getStyle(n,r);return je(o)&&je(i)&&o!==i};return j(r,(function(e){var t=function(t){return j(t,(function(t){return t===e}))};if(!t(o)&&t(tg)){var n=K(o,(function(e){return j(tg,(function(t){return Me(e,t)}))}));return j(n,i)}return i(e)}))},ig=function(e,t,n){return I.from(n.container()).filter(Fn).exists((function(r){var o=e?0:-1;return t(r.data.charAt(n.offset()+o))}))},ag=_(ig,!0,Qf),ug=_(ig,!1,Qf),cg=function(e){var t=e.container();return Fn(t)&&(0===t.data.length||xo(t.data)&&Ql.isBookmarkNode(t.parentNode))},sg=function(e,t){return function(n){return I.from(ef(e?0:-1,n)).filter(t).isSome()}},fg=function(e){return Vn(e)&&"block"===or(Rt.fromDom(e),"display")},lg=function(e){return $n(e)&&!function(e){return Dn(e)&&"all"===e.getAttribute("data-mce-bogus")}(e)},dg=sg(!0,fg),mg=sg(!1,fg),gg=sg(!0,Kn),pg=sg(!1,Kn),hg=sg(!0,Ln),vg=sg(!1,Ln),bg=sg(!0,lg),yg=sg(!1,lg),Cg=function(e){var t=Mu(e,"br"),n=K(function(e){for(var t=[],n=e.dom;n;)t.push(Rt.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),lo);t.length===n.length&&q(n,hn);},xg=function(e){pn(e),mn(e,Rt.fromHtml('<br data-mce-bogus="1">'));},wg=function(e){en(e).each((function(t){Kt(t).each((function(n){so(e)&&lo(t)&&so(n)&&hn(t);}));}));},Sg=function(e,t,n){return Lt(t,e)?(r=function(e,t){for(var n=y(t)?t:T,r=e.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=Rt.fromDom(i);if(o.push(a),!0===n(a))break;r=i;}return o}(e,(function(e){return n(e)||Bt(e,t)})),r.slice(0,-1)):[];var r;},kg=function(e,t){return Sg(e,t,T)},Ng=function(e,t){return [e].concat(kg(e,t))},Eg=function(e,t,n){return Tf(e,t,n,cg)},_g=function(e,t){return J(Ng(Rt.fromDom(t.container()),e),so)},Ag=function(e,t,n){return Eg(e,t.dom,n).forall((function(e){return _g(t,n).fold((function(){return !1===Zs(e,n,t.dom)}),(function(r){return !1===Zs(e,n,t.dom)&&Lt(r,Rt.fromDom(e.container()))}))}))},Rg=function(e,t,n){return _g(t,n).fold((function(){return Eg(e,t.dom,n).forall((function(e){return !1===Zs(e,n,t.dom)}))}),(function(t){return Eg(e,t.dom,n).isNone()}))},Dg=_(Rg,!1),Tg=_(Rg,!0),Og=_(Ag,!1),Bg=_(Ag,!0),Pg=function(e){return ff(e).exists(lo)},Lg=function(e,t,n){var r=K(Ng(Rt.fromDom(n.container()),t),so),o=ie(r).getOr(t);return Rf(e,o.dom,n).filter(Pg)},Ig=function(e,t){return ff(t).exists(lo)||Lg(!0,e,t).isSome()},Mg=function(e,t){return function(e){return I.from(e.getNode(!0)).map(Rt.fromDom)}(t).exists(lo)||Lg(!1,e,t).isSome()},Fg=_(Lg,!1),Ug=_(Lg,!0),zg=function(e){return Ac.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},Hg=function(e,t){var n=K(Ng(Rt.fromDom(t.container()),e),so);return ie(n).getOr(e)},jg=function(e,t){return zg(t)?ug(t):ug(t)||Pf(Hg(e,t).dom,t).exists(ug)},Vg=function(e,t){return zg(t)?ag(t):ag(t)||Bf(Hg(e,t).dom,t).exists(ag)},qg=function(e){return ff(e).bind((function(e){return Xr(e,Ut)})).exists((function(e){return function(e){return H(["pre","pre-wrap"],e)}(or(e,"white-space"))}))},$g=function(e,t){return function(e,t){return Pf(e.dom,t).isNone()}(e,t)||function(e,t){return Bf(e.dom,t).isNone()}(e,t)||Dg(e,t)||Tg(e,t)||Mg(e,t)||Ig(e,t)},Wg=function(e,t){return !qg(t)&&(Dg(e,t)||Og(e,t)||Mg(e,t)||jg(e,t))},Kg=function(e,t){return !qg(t)&&(Tg(e,t)||Bg(e,t)||Ig(e,t)||Vg(e,t))},Xg=function(e,t){return Wg(e,t)||Kg(e,function(e){var t=e.container(),n=e.offset();return Fn(t)&&n<t.data.length?Ac(t,n+1):e}(t))},Yg=function(e,t){return Jf(e.charAt(t))},Gg=function(e){var t=e.container();return Fn(t)&&Ie(t.data,yo)},Jg=function(e){var t=e.data,n=function(e){var t=e.split("");return V(t,(function(e,n){return Jf(e)&&n>0&&n<t.length-1&&Zf(t[n-1])&&Zf(t[n+1])?" ":e})).join("")}(t);return n!==t&&(e.data=n,!0)},Qg=function(e,t){return I.some(t).filter(Gg).bind((function(t){var n=t.container(),r=function(e,t){var n=t.data,r=Ac(t,0);return !(!Yg(n,0)||Xg(e,r)||(t.data=" "+n.slice(1),0))}(e,n)||Jg(n)||function(e,t){var n=t.data,r=Ac(t,n.length-1);return !(!Yg(n,n.length-1)||Xg(e,r)||(t.data=n.slice(0,-1)+" ",0))}(e,n);return r?I.some(t):I.none()}))},Zg=function(e){var t=Rt.fromDom(e.getBody());e.selection.isCollapsed()&&Qg(t,Ac.fromRangeStart(e.selection.getRng())).each((function(t){e.selection.setRng(t.toRange());}));},ep=function(e,t,n){if(0!==n){var r=Rt.fromDom(e),o=Kr(r,so).getOr(r),i=e.data.slice(t,t+n),a=t+n>=e.data.length&&Kg(o,Ac(e,e.data.length)),u=0===t&&Wg(o,Ac(e,0));e.replaceData(t,n,function(e,t,n){return Y(e,(function(r,o){return Qf(o)||Jf(o)?r.previousCharIsSpace||""===r.str&&t||r.str.length===e.length-1&&n?{previousCharIsSpace:!1,str:r.str+yo}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}}),{previousCharIsSpace:!1,str:""}).str}(i,u,a));}},tp=function(e,t){var n=e.data.slice(t),r=n.length-ze(n).length;ep(e,t,r);},np=function(e,t){var n=e.data.slice(0,t),r=n.length-He(n).length;ep(e,t-r,r);},rp=function(e,t,n,r){void 0===r&&(r=!0);var o=He(e.data).length,i=r?e:t,a=r?t:e;return r?i.appendData(a.data):i.insertData(0,a.data),hn(Rt.fromDom(a)),n&&tp(i,o),i},op=function(e,t){return function(e,t){var n=e.container(),r=e.offset();return !1===Ac.isTextPosition(e)&&n===t.parentNode&&r>Ac.before(t).offset()}(t,e)?Ac(t.container(),t.offset()-1):t},ip=function(e){return qo(e.previousSibling)?I.some((t=e.previousSibling,Fn(t)?Ac(t,t.data.length):Ac.after(t))):e.previousSibling?If(e.previousSibling):I.none();var t;},ap=function(e){return qo(e.nextSibling)?I.some((t=e.nextSibling,Fn(t)?Ac(t,0):Ac.before(t))):e.nextSibling?Lf(e.nextSibling):I.none();var t;},up=function(e,t){return ip(t).orThunk((function(){return ap(t)})).orThunk((function(){return function(e,t){var n=Ac.before(t.previousSibling?t.previousSibling:t.parentNode);return Pf(e,n).fold((function(){return Bf(e,Ac.after(t))}),I.some)}(e,t)}))},cp=function(e,t){return ap(t).orThunk((function(){return ip(t)})).orThunk((function(){return function(e,t){return Bf(e,Ac.after(t)).fold((function(){return Pf(e,Ac.before(t))}),I.some)}(e,t)}))},sp=function(e,t,n){return function(e,t,n){return e?cp(t,n):up(t,n)}(e,t,n).map(_(op,n))},fp=function(e,t,n){n.fold((function(){e.focus();}),(function(n){e.selection.setRng(n.toRange(),t);}));},lp=function(e,t){return t&&ye(e.schema.getBlockElements(),It(t))},dp=function(e){if(ei(e)){var t=Rt.fromHtml('<br data-mce-bogus="1">');return pn(e),mn(e,t),I.some(Ac.before(t.dom))}return I.none()},mp=function(e,t,n){var r,o,i,a,u=Kt(e).filter(zt),c=Xt(e).filter(zt);return hn(e),(r=u,o=c,i=t,a=function(e,t,r){var o=e.dom,i=t.dom,a=o.data.length;return rp(o,i,n),r.container()===i?Ac(o,a):r},r.isSome()&&o.isSome()&&i.isSome()?I.some(a(r.getOrDie(),o.getOrDie(),i.getOrDie())):I.none()).orThunk((function(){return n&&(u.each((function(e){return np(e.dom,e.dom.length)})),c.each((function(e){return tp(e.dom,0)}))),t}))},gp=function(e,t,n,r){void 0===r&&(r=!0);var o,i=sp(t,e.getBody(),n.dom),a=Kr(n,_(lp,e),(o=e.getBody(),function(e){return e.dom===o})),u=mp(n,i,function(e,t){return ye(e.schema.getTextInlineElements(),It(t))}(e,n));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):a.bind(dp).fold((function(){r&&fp(e,t,u);}),(function(n){r&&fp(e,t,I.some(n));}));},pp=function(e){return Mu(e,"td,th")},hp=function(e,t){return {start:e,end:t}},vp=kr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),bp=function(e,t){return Qr(Rt.fromDom(e),"td,th",t)},yp=function(e){return !Bt(e.start,e.end)},Cp=function(e,t){return Ml(e.start,t).bind((function(n){return Ml(e.end,t).bind((function(e){return t=Bt(n,e),r=n,t?I.some(r):I.none();var t,r;}))}))},xp=function(e){return function(t){return Cp(t,e).map((function(e){return function(e,t,n){return {rng:e,table:t,cells:n}}(t,e,pp(e))}))}},wp=function(e,t,n,r){if(n.collapsed||!e.forall(yp))return I.none();if(t.isSameTable){var o=e.bind(xp(r));return I.some({start:o,end:o})}var i=bp(n.startContainer,r),a=bp(n.endContainer,r),u=i.bind(function(e){return function(t){return Ml(t,e).bind((function(e){return ae(pp(e)).map((function(e){return hp(t,e)}))}))}}(r)).bind(xp(r)),c=a.bind(function(e){return function(t){return Ml(t,e).bind((function(e){return ie(pp(e)).map((function(e){return hp(e,t)}))}))}}(r)).bind(xp(r));return I.some({start:u,end:c})},Sp=function(e,t){return Q(e,(function(e){return Bt(e,t)}))},kp=function(e){return Yn(Sp(e.cells,e.rng.start),Sp(e.cells,e.rng.end),(function(t,n){return e.cells.slice(t,n+1)}))},Np=function(e,t,n){return e.exists((function(e){return function(e,t){return !yp(e)&&Cp(e,t).exists((function(e){var t=e.dom.rows;return 1===t.length&&1===t[0].cells.length}))}(e,n)&&zl(e.start,t)}))},Ep=function(e,t){var n=t.startTable,r=t.endTable,o=e.cloneRange();return n.each((function(e){return o.setStartAfter(e.dom)})),r.each((function(e){return o.setEndBefore(e.dom)})),o},_p=function(e,t){var n=function(e){return function(t){return Bt(e,t)}}(e),r=function(e,t){var n=bp(e.startContainer,t),r=bp(e.endContainer,t);return Yn(n,r,hp)}(t,n),o=function(e,t){var n=function(e){return Ml(Rt.fromDom(e),t)},r=n(e.startContainer),o=n(e.endContainer),i=r.isSome(),a=o.isSome(),u=Yn(r,o,Bt).getOr(!1);return {startTable:r,endTable:o,isStartInTable:i,isEndInTable:a,isSameTable:u,isMultiTable:!u&&i&&a}}(t,n);return Np(r,t,n)?r.map((function(e){return vp.singleCellTable(t,e.start)})):o.isMultiTable?function(e,t,n,r){return wp(e,t,n,r).bind((function(e){var r=e.start,o=e.end,i=r.bind(kp).getOr([]),a=o.bind(kp).getOr([]);if(i.length>0&&a.length>0){var u=Ep(n,t);return I.some(vp.multiTable(i,a,u))}return I.none()}))}(r,o,t,n):function(e,t,n,r){return wp(e,t,n,r).bind((function(e){var t=e.start,n=e.end;return t.or(n)})).bind((function(e){var r=t.isSameTable,o=kp(e).getOr([]);if(r&&e.cells.length===o.length)return I.some(vp.fullTable(e.table));if(o.length>0){if(r)return I.some(vp.partialTable(o,I.none()));var i=Ep(n,t);return I.some(vp.partialTable(o,I.some(Re(Re({},t),{rng:i}))))}return I.none()}))}(r,o,t,n)},Ap=function(e){var t;return (8===Mt(t=e)||"#comment"===It(t)?Kt(e):en(e)).bind(Ap).orThunk((function(){return I.some(e)}))},Rp=function(e){return q(e,(function(e){nr(e,"contenteditable"),xg(e);}))},Dp=function(e,t,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(t.dom.lastChild)):(o.setStartBefore(t.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),Pp(e,o,t,!1);},Tp=function(e){var t=Il(e),n=Rt.fromDom(e.selection.getNode());Wn(n.dom)&&ei(n)?e.selection.setCursorLocation(n.dom,0):e.selection.collapse(!0),t.length>1&&j(t,(function(e){return Bt(e,n)}))&&Qn(n,"data-mce-selected","1");},Op=function(e,t,n){var r=e.selection.getRng(),o=n.bind((function(n){var o=n.rng,i=n.isStartInTable,a=function(e,t){return I.from(e.dom.getParent(t,e.dom.isBlock)).map(Rt.fromDom)}(e,i?o.endContainer:o.startContainer);o.deleteContents(),function(e,t,n){n.each((function(n){t?hn(n):(xg(n),e.selection.setCursorLocation(n.dom,0));}));}(e,i,a.filter(ei));var u=i?t[0]:t[t.length-1];return Dp(e,u,r,i),ei(u)?I.none():I.some(i?t.slice(1):t.slice(0,-1))})).getOr(t);return Rp(o),Tp(e),!0},Bp=function(e,t,n,r){var o=e.selection.getRng(),i=t[0],a=n[n.length-1];Dp(e,i,o,!0),Dp(e,a,o,!1);var u=ei(i)?t:t.slice(1),c=ei(a)?n:n.slice(0,-1);return Rp(u.concat(c)),r.deleteContents(),Tp(e),!0},Pp=function(e,t,n,r){void 0===r&&(r=!0),t.deleteContents();var o,i=Ap(n).getOr(n),a=Rt.fromDom(e.dom.getParent(i.dom,e.dom.isBlock));if(ei(a)&&(xg(a),r&&e.selection.setCursorLocation(a.dom,0)),!Bt(n,a)){var u=Xn(Wt(a),n)?[]:Wt(o=a).map(Jt).map((function(e){return K(e,(function(e){return !Bt(o,e)}))})).getOr([]);q(u.concat(Jt(n)),(function(e){Bt(e,a)||Lt(e,a)||!ei(e)||hn(e);}));}return !0},Lp=function(e,t){return gp(e,!1,t),!0},Ip=function(e,t,n,r){return Fp(t,r).fold((function(){return function(e,t,n){return _p(t,n).map((function(t){return t.fold(_(Pp,e),_(Lp,e),_(Op,e),_(Bp,e))}))}(e,t,n)}),(function(t){return function(e,t){return Up(e,t)}(e,t)})).getOr(!1)},Mp=function(e,t){return J(Ng(t,e),vo)},Fp=function(e,t){return J(Ng(t,e),(n="caption",function(e){return Ut(e)&&It(e)===n}));var n;},Up=function(e,t){return xg(t),e.selection.setCursorLocation(t.dom,0),I.some(!0)},zp=function(e,t,n,r,o){return Df(n,e.getBody(),o).bind((function(i){return function(e,t,n,r){return Lf(e.dom).bind((function(o){return If(e.dom).map((function(e){return t?n.isEqual(o)&&r.isEqual(e):n.isEqual(e)&&r.isEqual(o)}))})).getOr(!0)}(r,n,o,i)?function(e,t){return Up(e,t)}(e,r):function(e,t,n){return Fp(e,Rt.fromDom(n.getNode())).map((function(e){return !1===Bt(e,t)}))}(t,r,i)})).or(I.some(!0))},Hp=function(e,t,n,r){var o=Ac.fromRangeStart(e.selection.getRng());return Mp(n,r).bind((function(r){return ei(r)?Up(e,r):function(e,t,n,r,o){return Df(n,e.getBody(),o).bind((function(e){return Mp(t,Rt.fromDom(e.getNode())).map((function(e){return !1===Bt(e,r)}))}))}(e,n,t,r,o)})).getOr(!1)},jp=function(e,t){return e?hg(t):vg(t)},Vp=function(e,t,n){var r=Rt.fromDom(e.getBody());return Fp(r,n).fold((function(){return Hp(e,t,r,n)||function(e,t){var n=Ac.fromRangeStart(e.selection.getRng());return jp(t,n)||Rf(t,e.getBody(),n).exists((function(e){return jp(t,e)}))}(e,t)}),(function(n){return function(e,t,n,r){var o=Ac.fromRangeStart(e.selection.getRng());return ei(r)?Up(e,r):zp(e,n,t,r,o)}(e,t,r,n).getOr(!1)}))},qp=function(e,t){var n=Rt.fromDom(e.selection.getStart(!0)),r=Il(e);return e.selection.isCollapsed()&&0===r.length?Vp(e,t,n):function(e,t,n){var r=Rt.fromDom(e.getBody()),o=e.selection.getRng();return 0!==n.length?Op(e,n,I.none()):Ip(e,r,o,t)}(e,n,r)},$p=function(e){var t=Ac.fromRangeStart(e),n=Ac.fromRangeEnd(e),r=e.commonAncestorContainer;return Rf(!1,r,n).map((function(o){return !Zs(t,n,r)&&Zs(t,o,r)?function(e,t,n,r){var o=document.createRange();return o.setStart(e,t),o.setEnd(n,r),o}(t.container(),t.offset(),o.container(),o.offset()):e})).getOr(e)},Wp=function(e){return e.collapsed?e:$p(e)},Kp=function(e,t){return e.getBlockElements()[t.name]&&function(e){return e.firstChild&&e.firstChild===e.lastChild}(t)&&function(e){return "br"===e.name||e.value===yo}(t.firstChild)},Xp=function(e,t){var n=t.firstChild,r=t.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(e,t){var n=e.getNonEmptyElements();return t&&(t.isEmpty(n)||Kp(e,t))}(e,r)&&(r=r.prev),!(!n||n!==r)&&("ul"===n.name||"ol"===n.name)},Yp=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&function(e){return e.data===yo||jn(e)}(e.firstChild)},Gp=function(e){return e.length>0&&(!(t=e[e.length-1]).firstChild||Yp(t))?e.slice(0,-1):e;var t;},Jp=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Qp=function(e,t){var n=Ac.after(e),r=kf(t).prev(n);return r?r.toRange():null},Zp=function(e,t,n){var r=e.parentNode;return _t.each(t,(function(t){r.insertBefore(t,e);})),function(e,t){var n=Ac.before(e),r=kf(t).next(n);return r?r.toRange():null}(e,n)},eh=function(e,t,n,r){var o,i=function(e,t,n){var r=t.serialize(n);return function(e){var t=e.firstChild,n=e.lastChild;return t&&"META"===t.nodeName&&t.parentNode.removeChild(t),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),e}(e.createFragment(r))}(t,e,r),a=Jp(t,n.startContainer),u=Gp((o=i.firstChild,K(o.childNodes,(function(e){return "LI"===e.nodeName})))),c=t.getRoot(),s=function(e){var r=Ac.fromRangeStart(n),o=kf(t.getRoot()),i=1===e?o.prev(r):o.next(r);return !i||Jp(t,i.getNode())!==a};return s(1)?Zp(a,u,c):s(2)?function(e,t,n,r){return r.insertAfter(t.reverse(),e),Qp(t[0],n)}(a,u,c,t):function(e,t,n,r){var o=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]}(e,r),i=e.parentNode;return i.insertBefore(o[0],e),_t.each(t,(function(t){i.insertBefore(t,e);})),i.insertBefore(o[1],e),i.removeChild(e),Qp(t[t.length-1],n)}(a,u,c,n)},th=Wn,nh=function(e){var t=e.dom,n=Wp(e.selection.getRng());e.selection.setRng(n);var r=t.getParent(n.startContainer,th);!function(e,t,n){return null!==n&&n===e.getParent(t.endContainer,th)&&zl(Rt.fromDom(n),t)}(t,n,r)?e.getDoc().execCommand("Delete",!1,null):Pp(e,n,Rt.fromDom(r));},rh=function(e,t,n){var r,o,i,a=e.selection,u=e.dom;/^ | $/.test(t)&&(t=function(e,t,n){var r=Rt.fromDom(e.getRoot());return n=Wg(r,Ac.fromRangeStart(t))?n.replace(/^ /,"&nbsp;"):n.replace(/^&nbsp;/," "),Kg(r,Ac.fromRangeEnd(t))?n.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):n.replace(/&nbsp;(<br( \/)?>)?$/," ")}(u,a.getRng(),t));var c=e.parser,s=n.merge,f=Zm({validate:bs(e)},e.schema),l='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>',d=e.fire("BeforeSetContent",{content:t,format:"html",selection:!0,paste:n.paste});if(d.isDefaultPrevented())e.fire("SetContent",{content:d.content,format:"html",selection:!0,paste:n.paste});else {-1===(t=d.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,l);var m=(o=a.getRng()).startContainer||(o.parentElement?o.parentElement():null),g=e.getBody();m===g&&a.isCollapsed()&&u.isBlock(g.firstChild)&&function(e,t){return t&&!e.schema.getShortEndedElements()[t.nodeName]}(e,g.firstChild)&&u.isEmpty(g.firstChild)&&((o=u.createRng()).setStart(g.firstChild,0),o.setEnd(g.firstChild,0),a.setRng(o)),a.isCollapsed()||nh(e);var p,h={context:(r=a.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},v=c.parse(t,h);if(!0===n.paste&&Xp(e.schema,v)&&function(e,t){return !!Jp(e,t)}(u,r))return o=eh(f,u,a.getRng(),v),a.setRng(o),void e.fire("SetContent",d);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1");}(v),"mce_marker"===(i=v.lastChild).attr("id")){var y=i;for(i=i.prev;i;i=i.walk(!0))if(3===i.type||!u.isBlock(i.name)){e.schema.isValidChild(i.parent.name,"span")&&i.parent.insert(y,i,"br"===i.name);break}}if(e._selectionOverrides.showBlockCaretContainer(r),h.invalid){e.selection.setContent(l),r=a.getNode();var C=e.getBody();for(9===r.nodeType?r=i=C:i=r;i!==C;)r=i,i=i.parentNode;t=r===C?C.innerHTML:u.getOuterHTML(r),t=f.serialize(c.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return f.serialize(v)})))),r===C?u.setHTML(C,t):u.setOuterHTML(r,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):e.selection.setContent(t);}}(e,t=f.serialize(v),r);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=Gm(r);_t.each(r.select("*[data-mce-fragment]"),(function(e){if(b(n[e.nodeName.toLowerCase()])&&rg(r,e))for(var t=e.parentNode;b(t)&&t!==o&&!og(r,e,t);t=t.parentNode)if(i.compare(t,e)){r.remove(e,!0);break}}));}}(e,s),function(e,t){var n,r=e.dom,o=e.selection;if(t){o.scrollIntoView(t);var i=Zl(e.getBody(),t);if("false"===r.getContentEditable(i))return r.remove(t),void o.select(i);var a=r.createRng(),u=t.previousSibling;if(Fn(u)){if(a.setStart(u,u.nodeValue.length),!wt.ie){var c=t.nextSibling;Fn(c)&&(u.appendData(c.data),c.parentNode.removeChild(c));}}else a.setStartBefore(t),a.setEndBefore(t);var s=r.getParent(t,r.isBlock);r.remove(t),s&&r.isEmpty(s)&&(e.$(s).empty(),a.setStart(s,0),a.setEnd(s,0),th(s)||function(e){return !!e.getAttribute("data-mce-fragment")}(s)||!(n=function(t){var n=Ac.fromRangeStart(t);if(n=kf(e.getBody()).next(n))return n.toRange()}(a))?r.add(s,r.create("br",{"data-mce-bogus":"1"})):(a=n,r.remove(s))),o.setRng(a);}}(e,u.get("mce_marker")),p=e.getBody(),_t.each(p.getElementsByTagName("*"),(function(e){e.removeAttribute("data-mce-fragment");})),function(e,t){I.from(e.getParent(t,"td,th")).map(Rt.fromDom).each(wg);}(u,a.getStart()),e.fire("SetContent",d),e.addVisual();}},oh=function(e,t){t(e),e.firstChild&&oh(e.firstChild,t),e.next&&oh(e.next,t);},ih=function(e,t,n){var r=function(e,t,n){var r={},o={},i=[];for(var a in n.firstChild&&oh(n.firstChild,(function(n){q(e,(function(e){e.name===n.name&&(r[e.name]?r[e.name].nodes.push(n):r[e.name]={filter:e,nodes:[n]});})),q(t,(function(e){"string"==typeof n.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(n):o[e.name]={filter:e,nodes:[n]});}));})),r)ye(r,a)&&i.push(r[a]);for(var u in o)ye(o,u)&&i.push(o[u]);return i}(e,t,n);q(r,(function(e){q(e.filter.callbacks,(function(t){t(e.nodes,e.filter.name,{});}));}));},ah=function(e){return e instanceof Om},uh=function(e,t,n){e.dom.setHTML(e.getBody(),t),!0!==n&&function(e){ym(e)&&Lf(e.getBody()).each((function(t){var n=t.getNode(),r=Ln(n)?Lf(n).getOr(t):t;e.selection.setRng(r.toRange());}));}(e);},ch=function(e,t,n){var r=function(e,t){return Re(Re({format:"html"},e),{set:!0,content:ah(t)?"":t})}(n,t),o=n.no_events?r:e.fire("BeforeSetContent",r);return ah(t)||(t=o.content),I.from(e.getBody()).fold(k(t),(function(n){return ah(t)?function(e,t,n,r){ih(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=Zm({validate:e.validate},e.schema).serialize(n);return r.content=bo(Rt.fromDom(t))?o:_t.trim(o),uh(e,r.content,r.no_selection),r.no_events||e.fire("SetContent",r),n}(e,n,t,o):function(e,t,n,r){if(0===n.length||/^\s+$/.test(n)){var o='<br data-mce-bogus="1">';"TABLE"===t.nodeName?n="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(t.nodeName)&&(n="<li>"+o+"</li>");var i=ts(e);i&&e.schema.isValidChild(t.nodeName.toLowerCase(),i.toLowerCase())?(n=o,n=e.dom.createHTML(i,ns(e),n)):n||(n='<br data-mce-bogus="1">'),uh(e,n,r.no_selection),e.fire("SetContent",r);}else "raw"!==r.format&&(n=Zm({validate:e.validate},e.schema).serialize(e.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=bo(Rt.fromDom(t))?n:_t.trim(n),uh(e,r.content,r.no_selection),r.no_events||e.fire("SetContent",r);return r.content}(e,n,t,o)}))},sh=function(e,t){return function(e,t){var n=e.dom;return n.parentNode?Yr(Rt.fromDom(n.parentNode),(function(n){return !Bt(e,n)&&t(n)})):I.none()}(e,t).isSome()},fh=function(e){return y(e)?e:T},lh=function(e,t,n){var r=t(e),o=fh(n);return r.orThunk((function(){return o(e)?I.none():function(e,t,n){for(var r=e.dom,o=fh(n);r.parentNode;){r=r.parentNode;var i=Rt.fromDom(r),a=t(i);if(a.isSome())return a;if(o(i))break}return I.none()}(e,t,o)}))},dh=ul,mh=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(gl(i)&&!1===i.inherit&&e.dom.is(t,i.selector))return !0}return !1},gh=function(e,t,n,r,o){var i=e.dom.getRoot();return t!==i&&(t=e.dom.getParent(t,(function(t){return !!mh(e,t,n)||(t.parentNode===i||!!vh(e,t,n,r,!0))})),!!vh(e,t,n,r,o))},ph=function(e,t,n){return !!dh(t,n.inline)||(!!dh(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0))},hh=function(e,t,n,r,o,i){var a=n[r];if(y(n.onmatch))return n.onmatch(t,n,r);if(a)if(h(a.length)){for(var u in a)if(ye(a,u)){var c="attributes"===r?e.getAttrib(t,u):sl(e,t,u),s=al(a[u],i),f=v(c)||Ve(c);if(f&&v(s))continue;if(o&&f&&!n.exact)return !1;if((!o||n.exact)&&!dh(c,cl(e,s,u)))return !1}}else for(var l=0;l<a.length;l++)if("attributes"===r?e.getAttrib(t,a[l]):sl(e,t,a[l]))return !0;return !0},vh=function(e,t,n,r,o){var i=e.formatter.get(n),a=e.dom;if(i&&t)for(var u=0;u<i.length;u++){var c=i[u];if(ph(e.dom,t,c)&&hh(a,t,c,"attributes",o,r)&&hh(a,t,c,"styles",o,r)){var s=c.classes;if(s)for(var f=0;f<s.length;f++)if(!e.dom.hasClass(t,al(s[f],r)))return;return c}}},bh=function(e,t,n,r,o){if(r)return gh(e,r,t,n,o);if(r=e.selection.getNode(),gh(e,r,t,n,o))return !0;var i=e.selection.getStart();return !(i===r||!gh(e,i,t,n,o))},yh=function(e,t){var n=function(t){return Bt(t,Rt.fromDom(e.getBody()))};return I.from(e.selection.getStart(!0)).bind((function(r){return lh(Rt.fromDom(r),(function(n){return ce(t,(function(t){return function(t,n){return vh(e,t.dom,n)?I.some(n):I.none()}(n,t)}))}),n)})).getOrNull()},Ch=function(e,t,n){return Y(n,(function(n,r){var o=function(e,t){return j(e.formatter.get(t),(function(e){var t=function(e){return e.length>1&&"%"===e.charAt(0)};return j(["styles","attributes"],(function(n){return be(e,n).exists((function(e){var n=m(e)?e:ve(e);return j(n,t)}))}))}))}(e,r);return e.formatter.matchNode(t,r,{},o)?n.concat([r]):n}),[])},xh=Co,wh="_mce_caret",Sh=function(e){return function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==xh||e.childNodes.length>1)return [];1===e.nodeType&&t.push(e),e=e.firstChild;}return t}(e).length>0},kh=function(e){if(e){var t=new ao(e,e);for(e=t.current();e;e=t.next())if(Fn(e))return e}return null},Nh=function(e){var t=Rt.fromTag("span");return Zn(t,{id:wh,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&mn(t,Rt.fromText(xh)),t},Eh=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(Sh(t))gp(e,!1,Rt.fromDom(t),n);else {var i=o.getRng(),a=r.getParent(t,r.isBlock),u=i.startContainer,c=i.startOffset,s=i.endContainer,f=i.endOffset,l=function(e){var t=kh(e);return t&&t.nodeValue.charAt(0)===xh&&t.deleteData(0,1),t}(t);r.remove(t,!0),u===l&&c>0&&i.setStart(l,c-1),s===l&&f>0&&i.setEnd(l,f-1),a&&r.isEmpty(a)&&xg(Rt.fromDom(a)),o.setRng(i);}},_h=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)Eh(e,t,n);else if(!(t=Uf(e.getBody(),o.getStart())))for(;t=r.get(wh);)Eh(e,t,!1);},Ah=function(e,t){return e.appendChild(t),t},Rh=function(e,t){var n=X(e,(function(e,t){return Ah(e,t.cloneNode(!1))}),t);return Ah(n,n.ownerDocument.createTextNode(xh))},Dh=function(e,t,n,r){var o,i,a,u=e.dom,c=e.selection,s=[],f=c.getRng(),l=f.startContainer,d=f.startOffset;for(i=l,3===l.nodeType&&(d!==l.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(vh(e,i,t,n,r)){a=i;break}i.nextSibling&&(o=!0),s.push(i),i=i.parentNode;}if(a)if(o){var m=c.getBookmark();f.collapse(!0);var g=Tl(e,f,e.formatter.get(t),!0);g=Cd(g),e.formatter.remove(t,n,g,r),c.moveToBookmark(m);}else {var p=Uf(e.getBody(),a),h=Nh(!1).dom;!function(e,t,n){var r=e.dom,o=r.getParent(n,_(rl,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Cg(Rt.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n));}(e,h,null!==p?p:a);var v=function(e,t,n,r,o,i){var a=e.formatter,u=e.dom,c=K(se(a.get()),(function(e){return e!==r&&!Ie(e,"removeformat")})),s=Ch(e,n,c);if(K(s,(function(t){return !dl(e,t,r)})).length>0){var f=n.cloneNode(!1);return u.add(t,f),a.remove(r,o,f,i),u.remove(f),I.some(f)}return I.none()}(e,h,a,t,n,r),b=Rh(s.concat(v.toArray()),h);Eh(e,p,!1),c.setCursorLocation(b,1),u.isEmpty(a)&&u.remove(a);}},Th=function(e){e.on("mouseup keydown",(function(t){!function(e,t){var n=e.selection,r=e.getBody();_h(e,null,!1),8!==t&&46!==t||!n.isCollapsed()||n.getStart().innerHTML!==xh||_h(e,Uf(r,n.getStart())),37!==t&&39!==t||_h(e,Uf(r,n.getStart()));}(e,t.keyCode);}));},Oh=function(e,t){var n=e.schema.getTextInlineElements();return ye(n,It(t))&&!Ff(t.dom)&&!Pn(t.dom)},Bh={},Ph=ke,Lh=we;!function(e,t){Bh[e]||(Bh[e]=[]),Bh[e].push(t);}("pre",(function(e){var t,n=e.selection.getRng(),r=Tn(["pre"]);n.collapsed||(t=e.selection.getSelectedBlocks(),Lh(Ph(Ph(t,r),(function(e){return r(e.previousSibling)&&-1!==Ne(t,e.previousSibling)})),(function(e){var t,n;t=e.previousSibling,cu(n=e).remove(),cu(t).append("<br><br>").append(n.childNodes);})));}));var Ih=_t.each,Mh=function(e){return Dn(e)&&!Gf(e)&&!Ff(e)&&!Pn(e)},Fh=function(e,t){for(var n=e;n;n=n[t]){if(Fn(n)&&je(n.data))return e;if(Dn(n)&&!Gf(n))return n}return e},Uh=function(e,t,n){var r=Gm(e);if(t&&n&&(t=Fh(t,"previousSibling"),n=Fh(n,"nextSibling"),r.compare(t,n))){for(var o=t.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling,t.appendChild(i);}return e.remove(n),_t.each(_t.grep(n.childNodes),(function(e){t.appendChild(e);})),t}return n},zh=function(e,t,n,r){if(r&&!1!==t.merge_siblings){var o=Uh(e,nl(r),r);Uh(e,o,nl(o,!0));}},Hh=function(e,t,n){Ih(e.childNodes,(function(e){Mh(e)&&(t(e)&&n(e),e.hasChildNodes()&&Hh(e,t,n));}));},jh=function(e,t){return function(n){return !(!n||!sl(e,n,t))}},Vh=function(e,t,n){return function(r){e.setStyle(r,t,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0);}(e,r);}},qh=kr([{keep:[]},{rename:["name"]},{removed:[]}]),$h=/^(src|href|style)$/,Wh=_t.each,Kh=ul,Xh=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},Yh=function(e,t,n){var r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"];if(Dn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o];}return Fn(r)&&n&&o>=r.nodeValue.length&&(r=new ao(r,e.getBody()).next()||r),Fn(r)&&!n&&0===o&&(r=new ao(r,e.getBody()).prev()||r),r},Gh=function(e,t){var n=t?"firstChild":"lastChild";if(function(e){return /^(TR|TH|TD)$/.test(e.nodeName)}(e)&&e[n]){var r=e[n];return "TR"===e.nodeName&&r[n]||r}return e},Jh=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Qh=function(e,t,n,r,o){var i=Rt.fromDom(t),a=Rt.fromDom(e.create(r,o)),u=n?Gt(i):Yt(i);return gn(a,u),n?(fn(i,a),dn(a,i)):(ln(i,a),mn(a,i)),a.dom},Zh=function(e,t,n,r){var o=nl(t,n,r);return v(o)||"BR"===o.nodeName||e.isBlock(o)},ev=function(e,t,n){var r,o=t.parentNode,i=e.dom,a=ts(e);ml(n)&&(a?o===i.getRoot()&&(n.list_block&&Kh(t,n.list_block)||q(ue(t.childNodes),(function(t){ol(e,a,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=Jh(i,t,a),i.setAttribs(r,e.settings.forced_root_block_attrs)):r=null;}))):i.isBlock(t)&&!i.isBlock(o)&&(Zh(i,t,!1)||Zh(i,t.firstChild,!0,!0)||t.insertBefore(i.create("br"),t.firstChild),Zh(i,t,!0)||Zh(i,t.lastChild,!1,!0)||t.appendChild(i.create("br")))),function(e){return gl(e)&&pl(e)&&Xn(be(e,"mixed"),!0)}(n)&&!Kh(n.inline,t)||i.remove(t,!0);},tv=function(e,t,n,r,o){var i,a=e.dom;if(!function(e,t,n){return !(!pl(n)||!Kh(t,n.inline))||!(!ml(n)||!Kh(t,n.block))||(gl(n)?Dn(t)&&e.is(t,n.selector):void 0)}(a,r,t)&&!function(e,t){return t.links&&"A"===e.nodeName}(r,t))return qh.keep();var u=r;if(pl(t)&&"all"===t.remove&&m(t.preserve_attributes)){var c=K(a.getAttribs(u),(function(e){return H(t.preserve_attributes,e.name.toLowerCase())}));if(a.removeAllAttribs(u),q(c,(function(e){return a.setAttrib(u,e.name,e.value)})),c.length>0)return qh.rename("span")}if("all"!==t.remove){Wh(t.styles,(function(e,r){e=cl(a,al(e,n),r+""),C(r)&&(r=e,o=null),(t.remove_similar||!o||Kh(sl(a,o,r),e))&&a.setStyle(u,r,""),i=!0;})),i&&""===a.getAttrib(u,"style")&&(u.removeAttribute("style"),u.removeAttribute("data-mce-style")),Wh(t.attributes,(function(e,r){var i;if(e=al(e,n),C(r)&&(r=e,o=null),t.remove_similar||!o||Kh(a.getAttrib(o,r),e)){if("class"===r&&(e=a.getAttrib(u,r))&&(i="",q(e.split(/\s+/),(function(e){/mce\-\w+/.test(e)&&(i+=(i?" ":"")+e);})),i))return void a.setAttrib(u,r,i);if($h.test(r)&&u.removeAttribute("data-mce-"+r),"style"===r&&Tn(["li"])(u)&&"none"===a.getStyle(u,"list-style-type"))return u.removeAttribute(r),void a.setStyle(u,"list-style-type","none");"class"===r&&u.removeAttribute("className"),u.removeAttribute(r);}})),Wh(t.classes,(function(e){e=al(e,n),o&&!a.hasClass(o,e)||a.removeClass(u,e);}));for(var s=a.getAttribs(u),f=0;f<s.length;f++){var l=s[f].nodeName;if(0!==l.indexOf("_")&&0!==l.indexOf("data-"))return qh.keep()}}return "none"!==t.remove?(ev(e,u,t),qh.removed()):qh.keep()},nv=function(e,t,n,r,o){return tv(e,t,n,r,o).fold(T,(function(t){return e.dom.rename(r,t),!0}),O)},rv=function(e,t,n,r){return tv(e,t,n,r,r).fold(k(r),(function(t){return e.dom.createFragment().appendChild(r),e.dom.rename(r,t)}),k(null))},ov=function(e,t,n,r,o){var i=e.formatter.get(t),a=i[0],u=!0,c=e.dom,s=e.selection,f=function(r){var u=function(e,t,n,r,o){var i;return q(ll(e.dom,t.parentNode).reverse(),(function(t){if(!i&&"_start"!==t.id&&"_end"!==t.id){var a=vh(e,t,n,r,o);a&&!1!==a.split&&(i=t);}})),i}(e,r,t,n,o);return function(e,t,n,r,o,i,a,u){var c,s,f,l=e.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=l.clone(m,!1);for(var g=0;g<t.length&&null!==(c=rv(e,t[g],u,c));g++);c&&(s&&c.appendChild(s),f||(f=c),s=c);}!i||a.mixed&&l.isBlock(n)||(r=l.split(n,r)),s&&(o.parentNode.insertBefore(s,o),f.appendChild(o),pl(a)&&zh(l,a,0,s));}return r}(e,i,u,r,r,!0,a,n)},l=function(t){return j(i,(function(r){return nv(e,r,n,t,t)}))},d=function(t){var n=!0,r=!1;Dn(t)&&c.getContentEditable(t)&&(n=u,u="true"===c.getContentEditable(t),r=!0);var o=ue(t.childNodes);if(u&&!r){var i=l(t),s=t.parentNode;!i&&b(s)&&hl(a)&&l(s);}if(a.deep&&o.length){for(var f=0;f<o.length;f++)d(o[f]);r&&(u=n);}q(["underline","line-through","overline"],(function(n){Dn(t)&&e.dom.getStyle(t,"text-decoration")===n&&t.parentNode&&fl(c,t.parentNode)===n&&nv(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,t);}));},m=function(e){var t=c.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return function(e){return Gf(e)&&Dn(e)&&("_start"===e.id||"_end"===e.id)}(n)&&(n=n[e?"firstChild":"lastChild"]),Fn(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),c.remove(t,!0),n},g=function(t){var n,r,o=Tl(e,t,i,t.collapsed);if(a.split){if(o=Cd(o),(n=Yh(e,o,!0))!==(r=Yh(e,o))){if(n=Gh(n,!0),r=Gh(r,!1),Xh(c,n,r)){var u=I.from(n.firstChild).getOr(n);return f(Qh(c,u,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void m(!0)}if(Xh(c,r,n)){u=I.from(r.lastChild).getOr(r);return f(Qh(c,u,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void m(!1)}n=Jh(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=Jh(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),Ol(c,s,(function(e){q(e,(function(e){Gf(e)||Gf(e.parentNode)||f(e);}));})),f(n),f(r),n=m(!0),r=m();}else n=r=f(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1;}Ol(c,o,(function(e){q(e,d);}));};if(r){if(el(r)){var p=c.createRng();p.setStartBefore(r),p.setEndAfter(r),g(p);}else g(r);rd(e,t,r,n);}else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&pl(a)&&!Il(e).length?Dh(e,t,n,o):(ql(s,!0,(function(){Vl(e,g);})),pl(a)&&bh(e,t,n,s.getStart())&&tl(c,s,s.getRng()),e.nodeChanged()),rd(e,t,r,n);else {r=s.getNode();for(var h=0;h<i.length&&(!i[h].ceFalseOverride||!nv(e,i[h],n,r,r));h++);rd(e,t,r,n);}},iv=_t.each,av=function(e,t,n,r){iv(t,(function(t){pl(t)&&iv(e.dom.select(t.inline,r),(function(r){Mh(r)&&nv(e,t,n,r,t.exact?r:null);})),function(e,t,n){if(t.clear_child_styles){var r=t.links?"*:not(a)":"*";Ih(e.select(r,n),(function(n){Mh(n)&&Ih(t.styles,(function(t,r){e.setStyle(n,r,"");}));}));}}(e.dom,t,r);}));},uv=_t.each,cv=function(e){return Dn(e)&&!Gf(e)&&!Ff(e)&&!Pn(e)},sv=function(e,t,n,r){var o=e.formatter.get(t),i=o[0],a=!r&&e.selection.isCollapsed(),u=e.dom,c=e.selection,s=function(e,t){if(void 0===t&&(t=i),y(t.onformat)&&t.onformat(e,t,n,r),uv(t.styles,(function(t,r){u.setStyle(e,r,al(t,n));})),t.styles){var o=u.getAttrib(e,"style");o&&u.setAttrib(e,"data-mce-style",o);}uv(t.attributes,(function(t,r){u.setAttrib(e,r,al(t,n));})),uv(t.classes,(function(t){t=al(t,n),u.hasClass(e,t)||u.addClass(e,t);}));},f=function(e,t){var n=!1;return uv(e,(function(e){return !!gl(e)&&(b(e.collapsed)&&e.collapsed!==a?void 0:u.is(t,e.selector)&&!Ff(t)?(s(t,e),n=!0,!1):void 0)})),n},d=function(e){if(l(e)){var t=u.create(e);return s(t),t}return null},m=function(r,a,u){var c=[],l=!0,m=i.inline||i.block,g=d(m);Ol(r,a,(function(a){var d,p=function(a){var h=!1,v=l,y=a.nodeName.toLowerCase(),C=a.parentNode,x=C.nodeName.toLowerCase();if(Dn(a)&&r.getContentEditable(a)&&(v=l,l="true"===r.getContentEditable(a),h=!0),jn(a)&&!function(e,t,n,r){if(function(e){return e.getParam("format_empty_lines",!1,"boolean")}(e)&&pl(t)){var o=Re(Re({},e.schema.getTextBlockElements()),{td:{},th:{},li:{},dt:{},dd:{},figcaption:{},caption:{},details:{},summary:{}}),i=sh(Rt.fromDom(n),(function(e){return Ff(e.dom)}));return Ce(o,r)&&ei(Rt.fromDom(n.parentNode),!1)&&!i}return !1}(e,i,a,x))return d=null,void(ml(i)&&r.remove(a));if(ml(i)&&i.wrapper&&vh(e,a,t,n))d=null;else {if(l&&!h&&ml(i)&&!i.wrapper&&rl(e,y)&&ol(e,x,m)){var w=r.rename(a,m);return s(w),c.push(w),void(d=null)}if(gl(i)){var S=f(o,a);if(!S&&b(C)&&hl(i)&&(S=f(o,C)),!pl(i)||S)return void(d=null)}!l||h||!ol(e,m,y)||!ol(e,x,m)||!u&&Fn(a)&&xo(a.data)||Ff(a)||pl(i)&&r.isBlock(a)?(d=null,q(ue(a.childNodes),p),h&&(l=v),d=null):(d||(d=r.clone(g,!1),a.parentNode.insertBefore(d,a),c.push(d)),d.appendChild(a));}};q(a,p);})),!0===i.links&&q(c,(function(e){var t=function(e){"A"===e.nodeName&&s(e,i),q(ue(e.childNodes),t);};t(e);})),q(c,(function(a){var u=function(e){var t=0;return q(e.childNodes,(function(e){(function(e){return b(e)&&Fn(e)&&0===e.length})(e)||Gf(e)||t++;})),t}(a);!(c.length>1)&&r.isBlock(a)||0!==u?(pl(i)||ml(i)&&i.wrapper)&&(i.exact||1!==u||(a=function(e){var t=J(e.childNodes,cv).filter((function(e){return ph(r,e,i)}));return t.map((function(t){var n=r.clone(t,!1);return s(n),r.replace(n,e,!0),r.remove(t,!0),n})).getOr(e)}(a)),av(e,o,n,a),function(e,t,n,r,o){vh(e,o.parentNode,n,r)&&nv(e,t,r,o)||t.merge_with_parents&&e.dom.getParent(o.parentNode,(function(i){if(vh(e,i,n,r))return nv(e,t,r,o),!0}));}(e,i,t,n,a),function(e,t,n,r){t.styles&&t.styles.backgroundColor&&Hh(r,jh(e,"fontSize"),Vh(e,"backgroundColor",al(t.styles.backgroundColor,n)));}(r,i,n,a),function(e,t,n,r){var o=function(t){if(1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType){var n=fl(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);}};t.styles&&(t.styles.color||t.styles.textDecoration)&&(_t.walk(r,o,"childNodes"),o(r));}(r,i,0,a),function(e,t,n,r){!pl(t)||"sub"!==t.inline&&"sup"!==t.inline||(Hh(r,jh(e,"fontSize"),Vh(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0));}(r,i,0,a),zh(r,i,0,a)):r.remove(a,!0);}));};if("false"!==u.getContentEditable(c.getNode())){if(i){if(r)if(el(r)){if(!f(o,r)){var g=u.createRng();g.setStartBefore(r),g.setEndAfter(r),m(u,Tl(e,g,o),!0);}}else m(u,r,!0);else if(a&&pl(i)&&!Il(e).length)!function(e,t,n){var r,o,i=e.selection,a=i.getRng(),u=a.startOffset,c=a.startContainer.nodeValue;(r=Uf(e.getBody(),i.getStart()))&&(o=kh(r));var s,f,l=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&u>0&&u<c.length&&l.test(c.charAt(u))&&l.test(c.charAt(u-1))){var d=i.getBookmark();a.collapse(!0);var m=Tl(e,a,e.formatter.get(t));m=Cd(m),e.formatter.apply(t,n,m),i.moveToBookmark(d);}else r&&o.nodeValue===xh||(s=e.getDoc(),f=Nh(!0).dom,o=(r=s.importNode(f,!0)).firstChild,a.insertNode(r),u=1),e.formatter.apply(t,n,r),i.setCursorLocation(o,u);}(e,t,n);else {var p=c.getNode(),h=o[0];e.settings.forced_root_block||!h.defaultBlock||u.getParent(p,u.isBlock)||sv(e,h.defaultBlock),c.setRng(Wp(c.getRng())),ql(c,!0,(function(){Vl(e,(function(t,n){var r=n?t:Tl(e,t,o);m(u,r,!1);}));})),tl(u,c,c.getRng()),e.nodeChanged();}!function(e,t){Lh(Bh[e],(function(e){e(t);}));}(t,e);}nd(e,t,r,n);}else {r=c.getNode();for(var v=0,C=o.length;v<C;v++){var x=o[v];if(x.ceFalseOverride&&gl(x)&&u.is(r,x.selector)){s(r,x);break}}nd(e,t,r,n);}},fv=function(e){return ye(e,"vars")},lv=function(e){return e.selection.getStart()},dv=function(e,t,n,r,o){return G(t,(function(t){var i=e.formatter.matchNode(t,n,null!=o?o:{},r);return !h(i)}),(function(t){return !!mh(e,t,n)||!r&&b(e.formatter.matchNode(t,n,o,!0))}))},mv=function(e,t){var n=null!=t?t:lv(e);return K(ll(e.dom,n),(function(e){return Dn(e)&&!Pn(e)}))},gv=function(e,t,n){var r=mv(e,t);le(n,(function(n,o){var i=function(n){var i=dv(e,r,o,n.similar,fv(n)?n.vars:void 0),a=i.isSome();if(n.state.get()!==a){n.state.set(a);var u=i.getOr(t);fv(n)?n.callback(a,{node:u,format:o,parents:r}):q(n.callbacks,(function(e){return e(a,{node:u,format:o,parents:r})}));}};q([n.withSimilar,n.withoutSimilar],i),q(n.withVars,i);}));},pv=function(e,t,n,r,o,i){return null===t.get()&&function(e,t){e.set({}),t.on("NodeChange",(function(n){gv(t,n.element,e.get());})),t.on("FormatApply FormatRemove",(function(n){var r=I.from(n.node).map((function(e){return el(e)?e:e.startContainer})).bind((function(e){return Dn(e)?I.some(e):I.from(e.parentElement)})).getOrThunk((function(){return lv(t)}));gv(t,r,e.get());}));}(t,e),function(e,t,n,r,o,i){var a=t.get();q(n.split(","),(function(t){var n=be(a,t).getOrThunk((function(){var e={withSimilar:{state:Cu(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Cu(!1),similar:!1,callbacks:[]},withVars:[]};return a[t]=e,e})),u=function(){var n=mv(e);return dv(e,n,t,o,i).isSome()};if(h(i)){var c=o?n.withSimilar:n.withoutSimilar;c.callbacks.push(r),1===c.callbacks.length&&c.state.set(u());}else n.withVars.push({state:Cu(u()),similar:o,vars:i,callback:r});})),t.set(a);}(e,t,n,r,o,i),{unbind:function(){return function(e,t,n){var r=e.get();q(t.split(","),(function(e){return be(r,e).each((function(t){r[e]={withSimilar:Re(Re({},t.withSimilar),{callbacks:K(t.withSimilar.callbacks,(function(e){return e!==n}))}),withoutSimilar:Re(Re({},t.withoutSimilar),{callbacks:K(t.withoutSimilar.callbacks,(function(e){return e!==n}))}),withVars:K(t.withVars,(function(e){return e.callback!==n}))};}))})),e.set(r);}(t,n,r)}}},hv=function(e,t){var n=(t||document).createDocumentFragment();return q(e,(function(e){n.appendChild(e.dom);})),Rt.fromDom(n)},vv=function(e,t,n){return {element:e,width:t,rows:n}},bv=function(e,t){return {element:e,cells:t}},yv=function(e,t){return {x:e,y:t}},Cv=function(e,t){var n=parseInt(er(e,t),10);return isNaN(n)?1:n},xv=function(e,t,n){var r=e.rows;return !!(r[n]?r[n].cells:[])[t]},wv=function(e){return Y(e,(function(e,t){return t.cells.length>e?t.cells.length:e}),0)},Sv=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(Bt(o[i],t))return I.some(yv(i,r));return I.none()},kv=function(e,t,n,r,o){for(var i=[],a=e.rows,u=n;u<=o;u++){var c=a[u].cells,s=t<r?c.slice(t,r+1):c.slice(r,t+1);i.push(bv(a[u].element,s));}return i},Nv=function(e){var t=vv(Yu(e),0,[]);return q(Mu(e,"tr"),(function(e,n){q(Mu(e,"td,th"),(function(r,o){!function(e,t,n,r,o){for(var i=Cv(o,"rowspan"),a=Cv(o,"colspan"),u=e.rows,c=n;c<n+i;c++){u[c]||(u[c]=bv(Gu(r),[]));for(var s=t;s<t+a;s++)u[c].cells[s]=c===n&&s===t?o:Yu(o);}}(t,function(e,t,n){for(;xv(e,t,n);)t++;return t}(t,o,n),n,e,r);}));})),vv(t.element,wv(t.rows),t.rows)},Ev=function(e){return function(e,t){var n=Yu(e.element),r=Rt.fromTag("tbody");return gn(r,t),mn(n,r),n}(e,function(e){return V(e.rows,(function(e){var t=V(e.cells,(function(e){var t=Gu(e);return nr(t,"colspan"),nr(t,"rowspan"),t})),n=Yu(e.element);return gn(n,t),n}))}(e))},_v=function(e,t,n){return Sv(e,t).bind((function(t){return Sv(e,n).map((function(n){return function(e,t,n){var r=t.x,o=t.y,i=n.x,a=n.y,u=o<a?kv(e,r,o,i,a):kv(e,r,a,i,o);return vv(e.element,wv(u),u)}(e,t,n)}))}))},Av=function(e,t){return J(e,(function(e){return "li"===It(e)&&zl(e,t)})).fold(k([]),(function(t){return function(e){return J(e,(function(e){return "ul"===It(e)||"ol"===It(e)}))}(e).map((function(e){var t=Rt.fromTag(It(e)),n=he(ur(e),(function(e,t){return Me(t,"list-style")}));return rr(t,n),[Rt.fromTag("li"),t]})).getOr([])}))},Rv=function(e,t){var n=Rt.fromDom(t.commonAncestorContainer),r=Ng(n,e),o=K(r,(function(e){return fo(e)||co(e)})),i=Av(r,t),a=o.concat(i.length?i:function(e){return po(e)?Wt(e).filter(go).fold(k([]),(function(t){return [e,t]})):go(e)?[e]:[]}(n));return V(a,Yu)},Dv=function(){return hv([])},Tv=function(e,t){return n=Rt.fromDom(t.cloneContents()),r=Rv(e,t),o=Y(r,(function(e,t){return mn(t,e),t}),n),r.length>0?hv([o]):o;var n,r,o;},Ov=function(e,t){return (n=e,r=t[0],Gr(r,"table",_(Bt,n))).bind((function(e){var n=t[0],r=t[t.length-1],o=Nv(e);return _v(o,n,r).map((function(e){return hv([Ev(e)])}))})).getOrThunk(Dv);var n,r;},Bv=function(e,t){var n=Ll(t,e);return n.length>0?Ov(e,n):function(e,t){return t.length>0&&t[0].collapsed?Dv():Tv(e,t[0])}(e,t)},Pv=function(e,t){return t>=0&&t<e.length&&Qf(e.charAt(t))},Lv=function(e,t){var n=wo(e.innerText);return t?function(e){return e.replace(/^[ \f\n\r\t\v]+/,"")}(n):n},Iv=function(e,t,n){void 0===n&&(n={});var r=function(e,t){return Re(Re({},e),{format:t,get:!0,selection:!0})}(n,t),o=e.fire("BeforeGetContent",r);if(o.isDefaultPrevented())return e.fire("GetContent",o),o.content;if("text"===o.format)return function(e){return I.from(e.selection.getRng()).map((function(t){var n=I.from(e.dom.getParent(t.commonAncestorContainer,e.dom.isBlock)),r=e.getBody(),o=function(e){return e.map((function(e){return e.nodeName})).getOr("div").toLowerCase()}(n),i=wt.browser.isIE()&&"pre"!==o,a=e.dom.add(r,o,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},t.cloneContents()),u=Lv(a,i),c=wo(a.textContent);if(e.dom.remove(a),Pv(c,0)||Pv(c,c.length-1)){var s=n.getOr(r),f=Lv(s,i),l=f.indexOf(u);return -1===l?u:(Pv(f,l-1)?" ":"")+u+(Pv(f,l+u.length)?" ":"")}return u})).getOr("")}(e);o.getInner=!0;var i=function(e,t){var n=e.selection.getRng(),r=e.dom.create("body"),o=e.selection.getSel(),i=_m(e,Bl(o)),a=t.contextual?Bv(Rt.fromDom(e.getBody()),i).dom:n.cloneContents();return a&&r.appendChild(a),e.selection.serializer.serialize(r,t)}(e,o);return "tree"===o.format?i:(o.content=e.selection.isCollapsed()?"":i,e.fire("GetContent",o),o.content)},Mv=function(e){return Dn(e)?e.outerHTML:Fn(e)?bi.encodeRaw(e.data,!1):Un(e)?"\x3c!--"+e.data+"--\x3e":""},Fv=function(e,t,n){var r=function(e){var t,n=document.createElement("div"),r=document.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o);}else e.appendChild(r);},Uv=function(e,t){var n,r,o,i,a,u,c,s,f,l=V(ue(t.childNodes),Mv);return function(e,t){var n=0;q(e,(function(e){0===e[0]?n++:1===e[0]?(Fv(t,e[1],n),n++):2===e[0]&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n);}}(t,n);}));}((r=e,o=(n=l).length+r.length+2,i=new Array(o),a=new Array(o),u=function(e,t,o,i,a){var c=s(e,t,o,i);if(null===c||c.start===t&&c.diag===t-i||c.end===e&&c.diag===e-o)for(var f=e,l=o;f<t||l<i;)f<t&&l<i&&n[f]===r[l]?(a.push([0,n[f]]),++f,++l):t-e>i-o?(a.push([2,n[f]]),++f):(a.push([1,r[l]]),++l);else {u(e,c.start,o,c.start-c.diag,a);for(var d=c.start;d<c.end;++d)a.push([0,n[d]]);u(c.end,t,c.end-c.diag,i,a);}},c=function(e,t,o,i){for(var a=e;a-t<i&&a<o&&n[a]===r[a-t];)++a;return function(e,t,n){return {start:e,end:t,diag:n}}(e,a,t)},s=function(e,t,o,u){var s=t-e,f=u-o;if(0===s||0===f)return null;var l,d,m,g,p,h=s-f,v=f+s,b=(v%2==0?v:v+1)/2;for(i[1+b]=e,a[1+b]=t+1,l=0;l<=b;++l){for(d=-l;d<=l;d+=2){for(m=d+b,d===-l||d!==l&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,p=(g=i[m])-e+o-d;g<t&&p<u&&n[g]===r[p];)i[m]=++g,++p;if(h%2!=0&&h-l<=d&&d<=h+l&&a[m-h]<=i[m])return c(a[m-h],d+e-o,t,u)}for(d=h-l;d<=h+l;d+=2){for(m=d+b-h,d===h-l||d!==h+l&&a[m+1]<=a[m-1]?a[m]=a[m+1]-1:a[m]=a[m-1],p=(g=a[m]-1)-e+o-d;g>=e&&p>=o&&n[g]===r[p];)a[m]=g--,p--;if(h%2==0&&-l<=d&&d<=l&&a[m]<=i[m+h])return c(a[m],d+e-o,t,u)}}},f=[],u(0,n.length,0,r.length,f),f),t),t},zv=Te((function(){return document.implementation.createHTMLDocument("undo")})),Hv=function(e){var t,n=(t=e.getBody(),K(V(ue(t.childNodes),Mv),(function(e){return e.length>0}))),r=Z(n,(function(t){var n=Wm(e.serializer,t);return n.length>0?[n]:[]})),o=r.join("");return -1!==o.indexOf("</iframe>")?function(e){return {type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}}(r):function(e){return {type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}}(o)},jv=function(e,t,n){var r=n?t.beforeBookmark:t.bookmark;"fragmented"===t.type?Uv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw",no_selection:!b(r)||!zf(r)||!r.isFakeCaret}),e.selection.moveToBookmark(r);},Vv=function(e){return "fragmented"===e.type?e.fragments.join(""):e.content},qv=function(e){var t=Rt.fromTag("body",zv());return Ku(t,Vv(e)),q(Mu(t,"*[data-mce-bogus]"),vn),t.dom.innerHTML},$v=function(e,t){return !(!e||!t)&&(!!function(e,t){return Vv(e)===Vv(t)}(e,t)||function(e,t){return qv(e)===qv(t)}(e,t))},Wv=function(e){return 0===e.get()},Kv=function(e,t,n){Wv(n)&&(e.typing=t);},Xv=function(e,t){e.typing&&(Kv(e,!1,t),e.add());},Yv=function(e){return {undoManager:{beforeChange:function(t,n){return function(e,t,n){Wv(t)&&n.set(Jc(e.selection));}(e,t,n)},add:function(t,n,r,o,i,a){return function(e,t,n,r,o,i,a){var u=Hv(e);if(i=i||{},i=_t.extend(i,u),!1===Wv(r)||e.removed)return null;var c=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&$v(c,i))return null;t.data[n.get()]&&o.get().each((function(e){t.data[n.get()].beforeBookmark=e;}));var s=function(e){return e.getParam("custom_undo_redo_levels",0,"number")}(e);if(s&&t.data.length>s){for(var f=0;f<t.data.length-1;f++)t.data[f]=t.data[f+1];t.data.length--,n.set(t.data.length);}i.bookmark=Jc(e.selection),n.get()<t.data.length-1&&(t.data.length=n.get()+1),t.data.push(i),n.set(t.data.length-1);var l={level:i,lastLevel:c,originalEvent:a};return n.get()>0?(e.setDirty(!0),e.fire("AddUndo",l),e.fire("change",l)):e.fire("AddUndo",l),i}(e,t,n,r,o,i,a)},undo:function(t,n,r){return function(e,t,n,r){var o;return t.typing&&(t.add(),t.typing=!1,Kv(t,!1,n)),r.get()>0&&(r.set(r.get()-1),o=t.data[r.get()],jv(e,o,!0),e.setDirty(!0),e.fire("Undo",{level:o})),o}(e,t,n,r)},redo:function(t,n){return function(e,t,n){var r;return t.get()<n.length-1&&(t.set(t.get()+1),r=n[t.get()],jv(e,r,!1),e.setDirty(!0),e.fire("Redo",{level:r})),r}(e,t,n)},clear:function(t,n){return function(e,t,n){t.data=[],n.set(0),t.typing=!1,e.fire("ClearUndos");}(e,t,n)},reset:function(e){return function(e){e.clear(),e.add();}(e)},hasUndo:function(t,n){return function(e,t,n){return n.get()>0||t.typing&&t.data[0]&&!$v(Hv(e),t.data[0])}(e,t,n)},hasRedo:function(e,t){return function(e,t){return t.get()<e.data.length-1&&!e.typing}(e,t)},transact:function(e,t,n){return function(e,t,n){return Xv(e,t),e.beforeChange(),e.ignore(n),e.add()}(e,t,n)},ignore:function(e,t){return function(e,t){try{e.set(e.get()+1),t();}finally{e.set(e.get()-1);}}(e,t)},extra:function(t,n,r,o){return function(e,t,n,r,o){if(t.transact(r)){var i=t.data[n.get()].bookmark,a=t.data[n.get()-1];jv(e,a,!0),t.transact(o)&&(t.data[n.get()-1].beforeBookmark=i);}}(e,t,n,r,o)}},formatter:{match:function(t,n,r,o){return bh(e,t,n,r,o)},matchAll:function(t,n){return function(e,t,n){var r=[],o={},i=e.selection.getStart();return e.dom.getParent(i,(function(i){for(var a=0;a<t.length;a++){var u=t[a];!o[u]&&vh(e,i,u,n)&&(o[u]=!0,r.push(u));}}),e.dom.getRoot()),r}(e,t,n)},matchNode:function(t,n,r,o){return vh(e,t,n,r,o)},canApply:function(t){return function(e,t){var n=e.formatter.get(t),r=e.dom;if(n)for(var o=e.selection.getStart(),i=ll(r,o),a=n.length-1;a>=0;a--){var u=n[a];if(!gl(u)||b(u.defaultBlock))return !0;for(var c=i.length-1;c>=0;c--)if(r.is(i[c],u.selector))return !0}return !1}(e,t)},closest:function(t){return yh(e,t)},apply:function(t,n,r){return sv(e,t,n,r)},remove:function(t,n,r,o){return ov(e,t,n,r,o)},toggle:function(t,n,r){return function(e,t,n,r){var o=e.formatter.get(t);!bh(e,t,n,r)||"toggle"in o[0]&&!o[0].toggle?sv(e,t,n,r):ov(e,t,n,r);}(e,t,n,r)},formatChanged:function(t,n,r,o,i){return pv(e,t,n,r,o,i)}},editor:{getContent:function(t,n){return function(e,t,n){return I.from(e.getBody()).fold(k("tree"===t.format?new Om("body",11):""),(function(r){return Xm(e,t,n,r)}))}(e,t,n)},setContent:function(t,n){return ch(e,t,n)},insertContent:function(t,n){return rh(e,t,n)},addVisual:function(t){return function(e,t){var n=e.dom,r=b(t)?t:e.getBody();h(e.hasVisual)&&(e.hasVisual=function(e){return e.getParam("visual",!0,"boolean")}(e)),q(n.select("table,a",r),(function(t){switch(t.nodeName){case"TABLE":var r=function(e){return e.getParam("visual_table_class","mce-item-table","string")}(e),o=n.getAttrib(t,"border");o&&"0"!==o||!e.hasVisual?n.removeClass(t,r):n.addClass(t,r);break;case"A":if(!n.getAttrib(t,"href")){var i=n.getAttrib(t,"name")||t.id,a=function(e){return e.getParam("visual_anchor_class","mce-item-anchor","string")}(e);i&&e.hasVisual?n.addClass(t,a):n.removeClass(t,a);}}})),e.fire("VisualAid",{element:t,hasVisual:e.hasVisual});}(e,t)}},selection:{getContent:function(t,n){return Iv(e,t,n)}},raw:{getModel:function(){return I.none()}}}},Gv=function(e){return ye(e.plugins,"rtc")},Jv=function(e){var t=e;return function(e){return be(e.plugins,"rtc").bind((function(e){return I.from(e.setup)}))}(e).fold((function(){return t.rtcInstance=Yv(e),I.none()}),(function(e){return t.rtcInstance=function(){var e=k(null),t=k("");return {undoManager:{beforeChange:x,add:e,undo:e,redo:e,clear:x,reset:x,hasUndo:T,hasRedo:T,transact:e,ignore:x,extra:x},formatter:{match:T,matchAll:k([]),matchNode:k(void 0),canApply:T,closest:t,apply:x,remove:x,toggle:x,formatChanged:k({unbind:x})},editor:{getContent:t,setContent:t,insertContent:x,addVisual:x},selection:{getContent:t},raw:{getModel:k(I.none())}}}(),I.some((function(){return e().then((function(e){return t.rtcInstance=function(e){var t=function(e){return d(e)?e:{}},n=e.undoManager,r=e.formatter,o=e.editor,i=e.selection,a=e.raw;return {undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:function(e,t,r){return n.transact(r)},ignore:function(e,t){return n.ignore(t)},extra:function(e,t,r,o){return n.extra(r,o)}},formatter:{match:function(e,n,o,i){return r.match(e,t(n),i)},matchAll:r.matchAll,matchNode:r.matchNode,canApply:function(e){return r.canApply(e)},closest:function(e){return r.closest(e)},apply:function(e,n,o){return r.apply(e,t(n))},remove:function(e,n,o,i){return r.remove(e,t(n))},toggle:function(e,n,o){return r.toggle(e,t(n))},formatChanged:function(e,t,n,o,i){return r.formatChanged(t,n,o,i)}},editor:{getContent:function(e,t){return o.getContent(e)},setContent:function(e,t){return o.setContent(e,t)},insertContent:function(e,t){return o.insertContent(e)},addVisual:o.addVisual},selection:{getContent:function(e,t){return i.getContent(t)}},raw:{getModel:function(){return I.some(a.getRawModel())}}}}(e),e.rtc.isRemote}))}))}))},Qv=function(e){return e.rtcInstance?e.rtcInstance:Yv(e)},Zv=function(e){var t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")},eb=function(e,t){return void 0===t&&(t={}),function(e,t,n){return Zv(e).selection.getContent(t,n)}(e,t.format?t.format:"html",t)},tb=function(e){return 0===e.dom.length?(hn(e),I.none()):I.some(e)},nb=function(e,t,n,r){e.bind((function(e){return (r?np:tp)(e.dom,r?e.dom.length:0),t.filter(zt).map((function(t){return function(e,t,n,r){var o=e.dom,i=t.dom,a=r?o.length:i.length;r?(rp(o,i,!1,!r),n.setStart(i,a)):(rp(i,o,!1,!r),n.setEnd(i,a));}(e,t,n,r)}))})).orThunk((function(){var e=function(e,t){return e.filter((function(e){return Ql.isBookmarkNode(e.dom)})).bind(t?Xt:Kt)}(t,r).or(t).filter(zt);return e.map((function(e){return function(e,t){Wt(e).each((function(n){var r=e.dom;t&&Wg(n,Ac(r,0))?tp(r,0):!t&&Kg(n,Ac(r,r.length))&&np(r,r.length);}));}(e,r)}))}));},rb=function(e,t,n){void 0===n&&(n={});var r=function(e,t){return Re(Re({format:"html"},e),{set:!0,selection:!0,content:t})}(n,t),o=r;if(!r.no_events){var i=e.fire("BeforeSetContent",r);if(i.isDefaultPrevented())return void e.fire("SetContent",i);o=i;}o.content=function(e,t){if("raw"!==t.format){var n=e.selection.getRng(),r=e.dom.getParent(n.commonAncestorContainer,e.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=e.parser.parse(t.content,Re(Re({isRootContent:!0,forced_root_block:!1},o),t));return Zm({validate:e.validate},e.schema).serialize(i)}return t.content}(e,o);var a=e.selection.getRng();!function(e,t){var n=I.from(t.firstChild).map(Rt.fromDom),r=I.from(t.lastChild).map(Rt.fromDom);e.deleteContents(),e.insertNode(t);var o=n.bind(Kt).filter(zt).bind(tb),i=r.bind(Xt).filter(zt).bind(tb);nb(o,n,e,!0),nb(i,r,e,!1),e.collapse(!1);}(a,a.createContextualFragment(o.content)),e.selection.setRng(a),Vd(e,a),o.no_events||e.fire("SetContent",o);},ob=function(e,t,n){if(e&&ye(e,t)){var r=K(e[t],(function(e){return e!==n}));0===r.length?delete e[t]:e[t]=r;}};var ib,ab,ub=function(e){return !!e.select},cb=function(e){return !(!e||!e.ownerDocument)&&Lt(Rt.fromDom(e.ownerDocument),Rt.fromDom(e))},sb=function(e,t,n,r){var o,i,a=function(e,t){var n,r,o=function(t,n){return J(n,(function(n){return e.is(n,t)}))},i=function(t){return e.getParents(t,null,e.getRoot())};return {selectorChangedWithUnbind:function(e,a){return n||(n={},r={},t.on("NodeChange",(function(e){var t=e.element,a=i(t),u={};_t.each(n,(function(e,t){o(t,a).each((function(n){r[t]||(q(e,(function(e){e(!0,{node:n,selector:t,parents:a});})),r[t]=e),u[t]=e;}));})),_t.each(r,(function(e,n){u[n]||(delete r[n],_t.each(e,(function(e){e(!1,{node:t,selector:n,parents:a});})));}));}))),n[e]||(n[e]=[]),n[e].push(a),o(e,i(t.selection.getStart())).each((function(){r[e]=n[e];})),{unbind:function(){ob(n,e,a),ob(r,e,a);}}}}}(e,r).selectorChangedWithUnbind,u=function(e,t){return rb(r,e,t)},c=function(e){var t=f();t.collapse(!!e),l(t);},s=function(){return t.getSelection?t.getSelection():t.document.selection},f=function(){var n,a,u,c=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(e){return -1}},f=t.document;if(void 0!==r.bookmark&&!1===ym(r)){var l=um(r);if(l.isSome())return l.map((function(e){return _m(r,[e])[0]})).getOr(f.createRange())}try{(n=s())&&!Rn(n.anchorNode)&&(a=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():f.createRange(),a=_m(r,[a])[0]);}catch(e){}return a||(a=f.createRange?f.createRange():f.body.createTextRange()),a.setStart&&9===a.startContainer.nodeType&&a.collapsed&&(u=e.getRoot(),a.setStart(u,0),a.setEnd(u,0)),o&&i&&(0===c(a.START_TO_START,a,o)&&0===c(a.END_TO_END,a,o)?a=i:(o=null,i=null)),a},l=function(e,t){var n;if(function(e){return !!e&&(!!ub(e)||cb(e.startContainer)&&cb(e.endContainer))}(e)){var a=ub(e)?e:null;if(a){i=null;try{a.select();}catch(e){}}else {var u=s();if(e=r.fire("SetSelectionRange",{range:e,forward:t}).range,u){i=e;try{u.removeAllRanges(),u.addRange(e);}catch(e){}!1===t&&u.extend&&(u.collapse(e.endContainer,e.endOffset),u.extend(e.startContainer,e.startOffset)),o=u.rangeCount>0?u.getRangeAt(0):null;}e.collapsed||e.startContainer!==e.endContainer||!u.setBaseAndExtent||wt.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(n=e.startContainer.childNodes[e.startOffset])&&"IMG"===n.tagName&&(u.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),u.anchorNode===e.startContainer&&u.focusNode===e.endContainer||u.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:e,forward:t});}}},d=function(){var t=s(),n=null==t?void 0:t.anchorNode,r=null==t?void 0:t.focusNode;if(!t||!n||!r||Rn(n)||Rn(r))return !0;var o=e.createRng();o.setStart(n,t.anchorOffset),o.collapse(!0);var i=e.createRng();return i.setStart(r,t.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0},m={bookmarkManager:null,controlSelection:null,dom:e,win:t,serializer:n,editor:r,collapse:c,setCursorLocation:function(t,n){var o=e.createRng();b(t)&&b(n)?(o.setStart(t,n),o.setEnd(t,n),l(o),c(!1)):(Hl(e,o,r.getBody(),!0),l(o));},getContent:function(e){return eb(r,e)},setContent:u,getBookmark:function(e,t){return g.getBookmark(e,t)},moveToBookmark:function(e){return g.moveToBookmark(e)},select:function(t,n){return function(e,t,n){return I.from(t).map((function(t){var r=e.nodeIndex(t),o=e.createRng();return o.setStart(t.parentNode,r),o.setEnd(t.parentNode,r+1),n&&(Hl(e,o,t,!0),Hl(e,o,t,!1)),o}))}(e,t,n).each(l),t},isCollapsed:function(){var e=f(),t=s();return !(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:d,setNode:function(t){return u(e.getOuterHTML(t)),t},getNode:function(){return function(e,t){var n,r,o;if(!t)return e;r=t.startContainer,o=t.endContainer;var i=t.startOffset,a=t.endOffset;return 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?Em(r.nextSibling,!0):r.parentNode,o=0===a?Em(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),f())},getSel:s,setRng:l,getRng:f,getStart:function(e){return km(r.getBody(),f(),e)},getEnd:function(e){return Nm(r.getBody(),f(),e)},getSelectedBlocks:function(t,n){return function(e,t,n,r){var o,i=[],a=e.getRoot();if(n=e.getParent(n||km(a,t,t.collapsed),e.isBlock),r=e.getParent(r||Nm(a,t,t.collapsed),e.isBlock),n&&n!==a&&i.push(n),n&&r&&n!==r){o=n;for(var u=new ao(n,a);(o=u.next())&&o!==r;)e.isBlock(o)&&i.push(o);}return r&&n!==r&&r!==a&&i.push(r),i}(e,f(),t,n)},normalize:function(){var t=f(),n=s();if(!(Bl(n).length>1)&&jl(r)){var o=bd(e,t);return o.each((function(e){l(e,d());})),o.getOr(t)}return t},selectorChanged:function(e,t){return a(e,t),m},selectorChangedWithUnbind:a,getScrollContainer:function(){for(var t,n=e.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){t=n;break}n=n.parentNode;}return t},scrollIntoView:function(e,t){b(e)?function(e,t,n){(e.inline?zd:jd)(e,t,n);}(r,e,t):Vd(r,f(),t);},placeCaretAt:function(e,t){return l(cd(e,t,r.getDoc()))},getBoundingClientRect:function(){var e=f();return e.collapsed?Ac.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){t=o=i=null,p.destroy();}},g=Ql(m),p=ad(m,r);return m.bookmarkManager=g,m.controlSelection=p,m},fb=function(e,t,n){e.addNodeFilter("font",(function(e){q(e,(function(e){var r=t.parse(e.attr("style")),o=e.attr("color"),i=e.attr("face"),a=e.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=n[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",t.serialize(r)),function(e,t){q(t,(function(t){e.attr(t,null);}));}(e,["color","face","size"]);}));}));},lb=function(e,t){var n=Di();t.convert_fonts_to_spans&&fb(e,n,_t.explode(t.font_size_legacy_values)),function(e,t){e.addNodeFilter("strike",(function(e){q(e,(function(e){var n=t.parse(e.attr("style"));n["text-decoration"]="line-through",e.name="span",e.attr("style",t.serialize(n));}));}));}(e,n);},db=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},mb=function(e,t){var n;try{n=atob(t);}catch(e){return I.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return I.some(new Blob([r],{type:e}))},gb=function(e){return 0===e.indexOf("blob:")?function(e){return new Zr((function(t,n){var r=function(){n("Cannot convert "+e+" to Blob. Resource might not exist or is inaccessible.");};try{var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="blob",o.onload=function(){200===o.status?t(o.response):r();},o.onerror=r,o.send();}catch(e){r();}}))}(e):0===e.indexOf("data:")?(t=e,new Zr((function(e){var n=db(t),r=n.type,o=n.data;mb(r,o).fold((function(){return e(new Blob([]))}),e);}))):null;var t;},pb=0,hb=function(e){return (e||"blobid")+pb++},vb=function(e,t,n,r){var o,i;if(0!==t.src.indexOf("blob:")){var a=db(t.src),u=a.data,c=a.type;o=u,(i=e.getByData(o,c))?n({image:t,blobInfo:i}):gb(t.src).then((function(r){i=e.create(hb(),r,o),e.add(i),n({image:t,blobInfo:i});}),(function(e){r(e);}));}else (i=e.getByUri(t.src))?n({image:t,blobInfo:i}):gb(t.src).then((function(r){(function(e){return new Zr((function(t){var n=new FileReader;n.onloadend=function(){t(n.result);},n.readAsDataURL(e);}))})(r).then((function(a){o=db(a).data,i=e.create(hb(),r,o),e.add(i),n({image:t,blobInfo:i});}));}),(function(e){r(e);}));},bb=function(e,t){var n={};return {findAll:function(r,o){o||(o=O);var i=K(function(e){return e?ue(e.getElementsByTagName("img")):[]}(r),(function(t){var n=t.src;return !!wt.fileApi&&(!t.hasAttribute("data-mce-bogus")&&(!t.hasAttribute("data-mce-placeholder")&&(!(!n||n===wt.transparentSrc)&&(0===n.indexOf("blob:")?!e.isUploaded(n)&&o(t):0===n.indexOf("data:")&&o(t)))))})),a=V(i,(function(e){if(void 0!==n[e.src])return new Zr((function(t){n[e.src].then((function(n){if("string"==typeof n)return n;t({image:e,blobInfo:n.blobInfo});}));}));var r=new Zr((function(n,r){vb(t,e,n,r);})).then((function(e){return delete n[e.image.src],e})).catch((function(t){return delete n[e.src],t}));return n[e.src]=r,r}));return Zr.all(a)}}},yb=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new Om("br",1)).shortEnded=!0:r.empty().append(new Om("#text",3)).value=yo;},Cb=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},xb=function(e,t,n,r){return r.isEmpty(t,n,(function(t){return function(e,t){var n=e.getElementRule(t.name);return n&&n.paddEmpty}(e,t)}))},wb=function(e,t){var n=t.blob_cache,r=function(e){var r=e.attr("src");(function(e){return e.attr("src")===wt.transparentSrc||b(e.attr("data-mce-placeholder"))})(e)||function(e){return b(e.attr("data-mce-bogus"))}(e)||function(e){var t=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(e);return t?I.some({type:t[1],data:decodeURIComponent(t[2])}):I.none()}(r).filter((function(){return function(e,t){if(t.images_dataimg_filter){var n=new Image;return n.src=e.attr("src"),le(e.attributes.map,(function(e,t){n.setAttribute(t,e);})),t.images_dataimg_filter(n)}return !0}(e,t)})).bind((function(e){var t=e.type,r=e.data;return I.from(n.getByData(r,t)).orThunk((function(){return mb(t,r).map((function(e){var t=n.create(hb(),e,r);return n.add(t),t}))}))})).each((function(t){e.attr("src",t.blobUri());}));};n&&e.addAttributeFilter("src",(function(e){return q(e,r)}));},Sb=_t.makeMap,kb=_t.each,Nb=_t.explode,Eb=_t.extend,_b=function(e,t){void 0===t&&(t=Ai());var n={},r=[],o={},i={};(e=e||{}).validate=!("validate"in e)||e.validate,e.root_name=e.root_name||"body";var a=function(e){var t=e.name;t in n&&((u=o[t])?u.push(e):o[t]=[e]);for(var a=r.length;a--;){var u,c=r[a].name;if(c in e.attributes.map)(u=i[c])?u.push(e):i[c]=[e];}return e},u={schema:t,addAttributeFilter:function(e,t){kb(Nb(e),(function(e){var n;for(n=0;n<r.length;n++)if(r[n].name===e)return void r[n].callbacks.push(t);r.push({name:e,callbacks:[t]});}));},getAttributeFilters:function(){return [].concat(r)},addNodeFilter:function(e,t){kb(Nb(e),(function(e){var r=n[e];r||(n[e]=r=[]),r.push(t);}));},getNodeFilters:function(){var e=[];for(var t in n)ye(n,t)&&e.push({name:t,callbacks:n[t]});return e},filterNode:a,parse:function(u,c){var s,f,l,d,m,g,p,h,v=[];c=c||{},o={},i={};var b=Eb(Sb("script,style,head,html,body,title,meta,param"),t.getBlockElements()),y=t.getNonEmptyElements(),C=t.children,x=e.validate,w=function(e){return !1===e?"":!0===e?"p":e}("forced_root_block"in c?c.forced_root_block:e.forced_root_block),S=t.getWhiteSpaceElements(),k=/^[ \t\r\n]+/,N=/[ \t\r\n]+$/,E=/[ \t\r\n]+/g,_=/^[ \t\r\n]+$/,A=ye(S,c.context)||ye(S,e.root_name),R=function(e,t){var r,i=new Om(e,t);return e in n&&((r=o[e])?r.push(i):o[e]=[i]),i},D=function(e){for(var n=t.getBlockElements(),r=e.prev;r&&3===r.type;){var o=r.value.replace(N,"");if(o.length>0)return void(r.value=o);var i=r.next;if(i){if(3===i.type&&i.value.length){r=r.prev;continue}if(!n[i.name]&&"script"!==i.name&&"style"!==i.name){r=r.prev;continue}}var a=r.prev;r.remove(),r=a;}},T=$m({validate:x,document:e.document,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_script_urls:e.allow_script_urls,allow_conditional_comments:e.allow_conditional_comments,preserve_cdata:e.preserve_cdata,self_closing_elements:function(e){var t={};for(var n in e)"li"!==n&&"p"!==n&&(t[n]=e[n]);return t}(t.getSelfClosingElements()),cdata:function(e){h.append(R("#cdata",4)).value=e;},text:function(e,t){var n;A||(e=e.replace(E," "),function(e,t){return e&&(ye(t,e.name)||"br"===e.name)}(h.lastChild,b)&&(e=e.replace(k,""))),0!==e.length&&((n=R("#text",3)).raw=!!t,h.append(n).value=e);},comment:function(e){h.append(R("#comment",8)).value=e;},pi:function(e,t){h.append(R(e,7)).value=t,D(h);},doctype:function(e){h.append(R("#doctype",10)).value=e,D(h);},start:function(e,n,o){var a=x?t.getElementRule(e):{};if(a){var u=R(a.outputName||e,1);u.attributes=n,u.shortEnded=o,h.append(u);var c=C[h.name];c&&C[u.name]&&!c[u.name]&&v.push(u);for(var s=r.length;s--;){var f=r[s].name;f in n.map&&((g=i[f])?g.push(u):i[f]=[u]);}b[e]&&D(u),o||(h=u),!A&&S[e]&&(A=!0);}},end:function(n){var r,o,i,a,u=x?t.getElementRule(n):{};if(u){if(b[n]&&!A){if((r=h.firstChild)&&3===r.type)if((o=r.value.replace(k,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||_.test(o))&&(r.remove(),r=i),r=i;if((r=h.lastChild)&&3===r.type)if((o=r.value.replace(N,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||_.test(o))&&(r.remove(),r=i),r=i;}if(A&&S[n]&&(A=!1),u.removeEmpty&&xb(t,y,S,h))return a=h.parent,b[h.name]?h.empty().remove():h.unwrap(),void(h=a);u.paddEmpty&&(function(e){return Cb(e,"#text")&&e.firstChild.value===yo}(h)||xb(t,y,S,h))&&yb(e,c,b,h),h=h.parent;}}},t),O=h=new Om(c.context||e.root_name,11);if(T.parse(u,c.format),x&&v.length&&(c.context?c.invalid=!0:function(e){for(var n=Sb("tr,td,th,tbody,thead,tfoot,table"),r=t.getNonEmptyElements(),o=t.getWhiteSpaceElements(),i=t.getTextBlockElements(),u=t.getSpecialElements(),c=function(e,n){if(void 0===n&&(n=e.parent),u[e.name])e.empty().remove();else {for(var r=0,o=e.children();r<o.length;r++){var i=o[r];t.isValidChild(n.name,i.name)||c(i,n);}e.unwrap();}},s=0;s<e.length;s++){var f=e[s],l=void 0,d=void 0,m=void 0;if(f.parent&&!f.fixed)if(i[f.name]&&"li"===f.parent.name){for(var g=f.next;g&&i[g.name];)g.name="li",g.fixed=!0,f.parent.insert(g,f.parent),g=g.next;f.unwrap();}else {var p=[f];for(l=f.parent;l&&!t.isValidChild(l.name,f.name)&&!n[l.name];l=l.parent)p.push(l);if(l&&p.length>1)if(t.isValidChild(l.name,f.name)){p.reverse();for(var h=d=a(p[0].clone()),v=0;v<p.length-1;v++){t.isValidChild(h.name,p[v].name)?(m=a(p[v].clone()),h.append(m)):m=h;for(var b=p[v].firstChild;b&&b!==p[v+1];){var y=b.next;m.append(b),b=y;}h=m;}xb(t,r,o,d)?l.insert(f,p[0],!0):(l.insert(d,p[0],!0),l.insert(f,d)),l=p[0],(xb(t,r,o,l)||Cb(l,"br"))&&l.empty().remove();}else c(f);else if(f.parent){if("li"===f.name){if((g=f.prev)&&("ul"===g.name||"ol"===g.name)){g.append(f);continue}if((g=f.next)&&("ul"===g.name||"ol"===g.name)){g.insert(f,g.firstChild,!0);continue}f.wrap(a(new Om("ul",1)));continue}t.isValidChild(f.parent.name,"div")&&t.isValidChild("div",f.name)?f.wrap(a(new Om("div",1))):c(f);}}}}(v)),w&&("body"===O.name||c.isRootContent)&&function(){var n=O.firstChild,r=null,o=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(k,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(N,"")));};if(t.isValidChild(O.name,w.toLowerCase())){for(;n;){var i=n.next;3===n.type||1===n.type&&"p"!==n.name&&!b[n.name]&&!n.attr("data-mce-type")?(r||((r=R(w,1)).attr(e.forced_root_block_attrs),O.insert(r,n)),r.append(n)):(o(r),r=null),n=i;}o(r);}}(),!c.invalid){for(p in o)if(ye(o,p)){for(g=n[p],d=(s=o[p]).length;d--;)s[d].parent||s.splice(d,1);for(f=0,l=g.length;f<l;f++)g[f](s,p,c);}for(f=0,l=r.length;f<l;f++)if((g=r[f]).name in i){for(d=(s=i[g.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=g.callbacks.length;d<m;d++)g.callbacks[d](s,g.name,c);}}return O}};return function(e,t){var n=e.schema;t.remove_trailing_brs&&e.addNodeFilter("br",(function(e,r,o){var i,a,u,c,s,f,l,d,m=e.length,g=_t.extend({},n.getBlockElements()),p=n.getNonEmptyElements(),h=n.getWhiteSpaceElements();for(g.body=1,i=0;i<m;i++)if(u=(a=e[i]).parent,g[a.parent.name]&&a===u.lastChild){for(s=a.prev;s;){if("span"!==(f=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===f&&(a=null);break}s=s.prev;}a&&(a.remove(),xb(n,p,h,u)&&(l=n.getElementRule(u.name))&&(l.removeEmpty?u.remove():l.paddEmpty&&yb(t,o,g,u)));}else {for(c=a;u&&u.firstChild===c&&u.lastChild===c&&(c=u,!g[u.name]);)u=u.parent;c===u&&!0!==t.padd_empty_with_br&&((d=new Om("#text",3)).value=yo,a.replace(d));}})),e.addAttributeFilter("href",(function(e){var n,r,o=e.length;if(!t.allow_unsafe_link_target)for(;o--;){var i=e[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(r=void 0,r=(n=i.attr("rel"))?_t.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(e){return e.split(" ").filter((function(e){return e.length>0})).concat(["noopener"]).sort().join(" ")}(r)));}})),t.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")){r=o.parent,t=o.lastChild;do{n=t.prev,r.insert(t,o),t=n;}while(t)}})),t.fix_list_elements&&e.addNodeFilter("ul,ol",(function(e){for(var t,n,r=e.length;r--;)if("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 Om("li",1);o.attr("style","list-style-type: none"),t.wrap(o);}})),t.validate&&n.getValidClasses()&&e.addAttributeFilter("class",(function(e){for(var t=n.getValidClasses(),r=e.length;r--;){for(var o=e[r],i=o.attr("class").split(" "),a="",u=0;u<i.length;u++){var c=i[u],s=!1,f=t["*"];f&&f[c]&&(s=!0),f=t[o.name],!s&&f&&f[c]&&(s=!0),s&&(a&&(a+=" "),a+=c);}a.length||(a=null),o.attr("class",a);}})),wb(e,t);}(u,e),function(e,t){t.inline_styles&&lb(e,t);}(u,e),u},Ab=function(e,t,n){return function(e,t){return e&&e.hasEventListeners("PreProcess")&&!t.no_events}(e,n)?function(e,t,n){var r,o=e.dom,i=t.cloneNode(!0),a=document.implementation;if(a.createHTMLDocument){var u=a.createHTMLDocument("");_t.each("BODY"===i.nodeName?i.childNodes:[i],(function(e){u.body.appendChild(u.importNode(e,!0));})),i="BODY"!==i.nodeName?u.body.firstChild:u.body,r=o.doc,o.doc=u;}return function(e,t){e.fire("PreProcess",t);}(e,Re(Re({},n),{node:i})),r&&(o.doc=r),i}(e,t,n):t},Rb=function(e,t,n){-1===_t.inArray(t,n)&&(e.addAttributeFilter(n,(function(e,t){for(var n=e.length;n--;)e[n].attr(t,null);})),t.push(n));},Db=function(e,t,n,r,o){var i=function(e,t,n){return Zm(e,t).serialize(n)}(t,n,r);return function(e,t,n){if(!t.no_events&&e){var r=function(e,t){return e.fire("PostProcess",t)}(e,Re(Re({},t),{content:n}));return r.content}return n}(e,o,i)},Tb=function(e,t){var n=["data-mce-selected"],r=t&&t.dom?t.dom:pu.DOM,o=t&&t.schema?t.schema:Ai(e);e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs=!("remove_trailing_brs"in e)||e.remove_trailing_brs;var i=_b(e,o);!function(e,t,n){e.addAttributeFilter("data-mce-tabindex",(function(e,t){for(var n=e.length;n--;){var r=e[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(t,null);}})),e.addAttributeFilter("src,href,style",(function(e,r){for(var o="data-mce-"+r,i=t.url_converter,a=t.url_converter_scope,u=e.length;u--;){var c=e[u],s=c.attr(o);void 0!==s?(c.attr(r,s.length>0?s:null),c.attr(o,null)):(s=c.attr(r),"style"===r?s=n.serializeStyle(n.parseStyle(s),c.name):i&&(s=i.call(a,s,r,c.name)),c.attr(r,s.length>0?s:null));}})),e.addAttributeFilter("class",(function(e){for(var t=e.length;t--;){var n=e[t],r=n.attr("class");r&&(r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null));}})),e.addAttributeFilter("data-mce-type",(function(e,t,n){for(var r=e.length;r--;){var o=e[r];if("bookmark"===o.attr("data-mce-type")&&!n.cleanup){var i=I.from(o.firstChild).exists((function(e){return !xo(e.value)}));i?o.unwrap():o.remove();}}})),e.addNodeFilter("noscript",(function(e){for(var t=e.length;t--;){var n=e[t].firstChild;n&&(n.value=bi.decode(n.value));}})),e.addNodeFilter("script,style",(function(e,n){for(var r=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,"")},o=e.length;o--;){var i=e[o],a=i.firstChild?i.firstChild.value:"";if("script"===n){var u=i.attr("type");u&&i.attr("type","mce-no/type"===u?null:u.replace(/^mce\-/,"")),"xhtml"===t.element_format&&a.length>0&&(i.firstChild.value="// <![CDATA[\n"+r(a)+"\n// ]]>");}else "xhtml"===t.element_format&&a.length>0&&(i.firstChild.value="\x3c!--\n"+r(a)+"\n--\x3e");}})),e.addNodeFilter("#comment",(function(e){for(var r=e.length;r--;){var o=e[r];t.preserve_cdata&&0===o.value.indexOf("[CDATA[")?(o.name="#cdata",o.type=4,o.value=n.decode(o.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===o.value.indexOf("mce:protected ")&&(o.name="#text",o.type=3,o.raw=!0,o.value=unescape(o.value).substr(14));}})),e.addNodeFilter("xml:namespace,input",(function(e,t){for(var n=e.length;n--;){var r=e[n];7===r.type?r.remove():1===r.type&&("input"!==t||r.attr("type")||r.attr("type","text"));}})),e.addAttributeFilter("data-mce-type",(function(t){q(t,(function(t){"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(e.schema.getNonEmptyElements())?t.remove():t.unwrap());}));})),e.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(e,t){for(var n=e.length;n--;)e[n].attr(t,null);}));}(i,e,r);return {schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,a){void 0===a&&(a={});var u=Re({format:"html"},a),c=Ab(t,n,u),s=function(e,t,n){var r=wo(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||bo(Rt.fromDom(t))?r:_t.trim(r)}(r,c,u),f=function(e,t,n){var r=n.selection?Re({forced_root_block:!1},n):n,o=e.parse(t,r);return function(e){var t=function(e){return e&&"br"===e.name},n=e.lastChild;if(t(n)){var r=n.prev;t(r)&&(n.remove(),r.remove());}}(o),o}(i,s,u);return "tree"===u.format?f:Db(t,e,o,f,u)},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:_(Rb,i,n),getTempAttrs:k(n),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},Ob=function(e,t){var n=Tb(e,t);return {schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}},Bb=function(e,t){return void 0===t&&(t={}),function(e,t,n){return Qv(e).editor.getContent(t,n)}(e,t,t.format?t.format:"html")},Pb=function(e,t,n){return void 0===n&&(n={}),function(e,t,n){return Qv(e).editor.setContent(t,n)}(e,t,n)},Lb=pu.DOM,Ib=function(e){return I.from(e).each((function(e){return e.destroy()}))},Mb=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&&Lb.remove(o.nextSibling),function(e){e.fire("remove");}(e),e.editorManager.remove(e),!e.inline&&r&&function(e){Lb.setStyle(e.id,"display",e.orgDisplay);}(e),function(e){e.fire("detach");}(e),Lb.remove(e.getContainer()),Ib(t),Ib(n),e.destroy();}},Fb=function(e,t){var n=e.selection,r=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Ib(n),Ib(r)),function(e){var t=e.formElement;t&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,t._mceOldSubmit=null),Lb.unbind(t,"submit reset",e.formEventDelegate));}(e),function(e){e.contentAreaContainer=e.formElement=e.container=e.editorContainer=null,e.bodyElement=e.contentDocument=e.contentWindow=null,e.iframeElement=e.targetElm=null,e.selection&&(e.selection=e.selection.win=e.selection.dom=e.selection.dom.doc=null);}(e),e.destroyed=!0):e.remove());},Ub=(ib=function(e,t){return d(e)&&d(t)?Ub(e,t):t},function(){for(var e=[],t=0;t<arguments.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)ye(o,i)&&(n[i]=ib(n[i],o[i]));}return n}),zb="autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),Hb="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),jb="imagetools,toc".split(","),Vb=function(e){var t=K(zb,(function(t){return ye(e,t)})),n=e.forced_root_block;return !1!==n&&""!==n||t.push("forced_root_block (false only)"),re(t)},qb=function(e){var t=_t.makeMap(e.plugins," "),n=function(e){return ye(t,e)},r=De(De([],K(Hb,n),!0),Z(jb,(function(e){return n(e)?[e+" (moving to premium)"]:[]})),!0);return re(r)},$b=mt().deviceType,Wb=$b.isTouch(),Kb=$b.isPhone(),Xb=$b.isTablet(),Yb=["lists","autolink","autosave"],Gb={table_grid:!1,object_resizing:!1,resize:!1},Jb=function(e){var t=m(e)?e.join(" "):e,n=V(l(t)?t.split(" "):[],Ue);return K(n,(function(e){return e.length>0}))},Qb=function(e,t){var n,r,o=(r={},pe(t,(function(t,n){return H(e,n)}),ge(n={}),ge(r)),{t:n,f:r});return function(e,t){return {sections:k(e),settings:k(t)}}(o.t,o.f)},Zb=function(e,t){return ye(e.sections(),t)},ey=function(e,t){return be(e,"toolbar_mode").orThunk((function(){return be(e,"toolbar_drawer").map((function(e){return !1===e?"wrap":e}))})).getOr(t)},ty=function(e,t){var n={resize:!1,toolbar_mode:ey(e,"scrolling"),toolbar_sticky:!1};return Re(Re(Re({},Gb),n),t?{menubar:!1}:{})},ny=function(e,t){var n=t.external_plugins?t.external_plugins:{};return e&&e.external_plugins?_t.extend({},e.external_plugins,n):n},ry=function(e,t,n,r){return e&&function(e,t,n){var r=e.sections();return Zb(e,t)&&r[t].theme===n}(t,"mobile","mobile")?K(r,_(H,Yb)):e&&Zb(t,"mobile")?r:n},oy=function(e,t,n,r){var o=Jb(n.forced_plugins),i=Jb(r.plugins),a=function(e,t){return Zb(e,t)?e.sections()[t]:{}}(t,"mobile"),u=a.plugins?Jb(a.plugins):i,c=function(e,t){return [].concat(Jb(e)).concat(Jb(t))}(o,ry(e,t,i,u));if(wt.browser.isIE()&&H(c,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return _t.extend(r,{plugins:c.join(" ")})},iy=function(e,t,n,r,o){var i=e?{mobile:ty(o.mobile||{},t)}:{},a=Qb(["mobile"],Ub(i,o)),u=_t.extend(n,r,a.settings(),function(e,t){return e&&Zb(t,"mobile")}(e,a)?function(e,t,n){void 0===n&&(n={});var r=e.sections(),o=be(r,t).getOr({});return _t.extend({},n,o)}(a,"mobile"):{},{validate:!0,external_plugins:ny(r,a.settings())});return oy(e,a,r,u)},ay=function(e,t,n,r,o){var i=function(e,t,n,r,o){var i={id:t,theme:"silver",toolbar_mode:ey(e,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return Re(Re({},i),r?Gb:{})}(o,t,n,Wb,e),a=iy(Kb||Xb,Kb,i,r,o);return !1!==a.deprecation_warnings&&function(e,t){var n=Vb(e),r=qb(t),o=r.length>0,i=n.length>0,a="mobile"===t.theme;if(o||i||a){var u="\n- ",c=a?"\n\nThemes:\n- mobile":"",s=o?"\n\nPlugins:\n- "+r.join(u):"",f=i?"\n\nSettings:\n- "+n.join(u):"";console.warn("The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information."+c+s+f);}}(o,a),a},uy=function(e,t,n){return I.from(t.settings[n]).filter(e)},cy=function(e,t,n,r){var o,i=t in e.settings?e.settings[t]:n;return "hash"===r?function(e){var t={};return "string"==typeof e?q(e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(","),(function(e){var n=e.split("=");n.length>1?t[_t.trim(n[0])]=_t.trim(n[1]):t[_t.trim(n[0])]=_t.trim(n[0]);})):t=e,t}(i):"string"===r?uy(l,e,t).getOr(n):"number"===r?uy(C,e,t).getOr(n):"boolean"===r?uy(p,e,t).getOr(n):"object"===r?uy(d,e,t).getOr(n):"array"===r?uy(m,e,t).getOr(n):"string[]"===r?uy((o=l,function(e){return m(e)&&ee(e,o)}),e,t).getOr(n):"function"===r?uy(y,e,t).getOr(n):i},sy=(ab={},{add:function(e,t){ab[e]=t;},get:function(e){return ab[e]?ab[e]:{icons:{}}},has:function(e){return ye(ab,e)}}),fy=function(e,t){return t.dom[e]},ly=function(e,t){return parseInt(or(t,e),10)},dy=_(fy,"clientWidth"),my=_(fy,"clientHeight"),gy=_(ly,"margin-top"),py=_(ly,"margin-left"),hy=function(e,t,n){var r,o=Rt.fromDom(e.getBody()),i=e.inline?o:(r=o,Rt.fromDom(qt(r).dom.documentElement)),a=function(e,t,n,r){var o=function(e){return e.dom.getBoundingClientRect()}(t);return {x:n-(e?o.left+t.dom.clientLeft+py(t):0),y:r-(e?o.top+t.dom.clientTop+gy(t):0)}}(e.inline,i,t,n);return function(e,t,n){var r=dy(e),o=my(e);return t>=0&&n>=0&&t<=r&&n<=o}(i,a.x,a.y)},vy=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return (t=n,I.from(t).map(Rt.fromDom)).map(bn).getOr(!1)},by=function(e){var t=[],n=function(){var t,n=e.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:t=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:t,reposition:t,getArgs:t}},r=function(){return I.from(t[0])},o=function(){t.length>0&&n().reposition(t);},i=function(e){Q(t,(function(t){return t===e})).each((function(e){t.splice(e,1);}));},a=function(a,u){if(void 0===u&&(u=!0),!e.removed&&vy(e))return u&&e.fire("BeforeOpenNotification",{notification:a}),J(t,(function(e){return t=n().getArgs(e),r=a,!(t.type!==r.type||t.text!==r.text||t.progressBar||t.timeout||r.progressBar||r.timeout);var t,r;})).getOrThunk((function(){e.editorManager.setActive(e);var u=n().open(a,(function(){i(u),o(),r().fold((function(){return e.focus()}),(function(e){return Rt.fromDom(e.getEl()).dom.focus()}));}));return function(e){t.push(e);}(u),o(),e.fire("OpenNotification",{notification:Re({},u)}),u}))},u=k(t);return function(e){e.on("SkinLoaded",(function(){var t=function(e){return e.getParam("service_message")}(e);t&&a({text:t,type:"warning",timeout:0},!1),o();})),e.on("show ResizeEditor ResizeWindow NodeChange",(function(){ro.requestAnimationFrame(o);})),e.on("remove",(function(){q(t.slice(),(function(e){n().close(e);}));}));}(e),{open:a,close:function(){r().each((function(e){n().close(e),i(e),o();}));},getNotifications:u}},yy=Nu.PluginManager,Cy=Nu.ThemeManager;var xy=function(e){var t=[],n=function(){var t,n=e.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:t=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:t,alert:t,confirm:t,close:t,getParams:t,setParams:t}},r=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t?t.apply(e,n):void 0}},o=function(n){t.push(n),function(t){e.fire("OpenWindow",{dialog:t});}(n);},i=function(n){!function(t){e.fire("CloseWindow",{dialog:t});}(n),0===(t=K(t,(function(e){return e!==n}))).length&&e.focus();},a=function(t){e.editorManager.setActive(e),am(e);var n=t();return o(n),n};return e.on("remove",(function(){q(t,(function(e){n().close(e);}));})),{open:function(e,t){return a((function(){return n().open(e,t,i)}))},openUrl:function(e){return a((function(){return n().openUrl(e,i)}))},alert:function(e,t,o){var i=n();i.alert(e,r(o||i,t));},confirm:function(e,t,o){var i=n();i.confirm(e,r(o||i,t));},close:function(){I.from(t[t.length-1]).each((function(e){n().close(e),i(e);}));}}},wy=function(e,t){e.notificationManager.open({type:"error",text:t});},Sy=function(e,t){e._skinLoaded?wy(e,t):e.on("SkinLoaded",(function(){wy(e,t);}));},ky=function(e,t,n){td(e,t,{message:n}),console.error(n);},Ny=function(e,t,n){return n?"Failed to load "+e+": "+n+" from url "+t:"Failed to load "+e+" url: "+t},Ey=function(e,t,n){ky(e,"PluginLoadError",Ny("plugin",t,n));},_y=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,De([e],t,!1)):r.log.apply(r,De([e],t,!1)));},Ay=function(e){return Ry(e,function(e){var t=e.getParam("content_css");return l(t)?V(t.split(","),Ue):m(t)?t:!1===t||e.inline?[]:["default"]}(e))},Ry=function(e,t){var n=e.editorManager.baseURL+"/skins/content",r="content"+e.editorManager.suffix+".css",o=!0===e.inline;return V(t,(function(t){return function(e){return /^[a-z0-9\-]+$/i.test(e)}(t)&&!o?n+"/"+t+"/"+r:e.documentBaseURI.toAbsolute(t)}))},Dy=function(e){e.contentCSS=e.contentCSS.concat(Ay(e),function(e){return Ry(e,gs(e))}(e));},Ty=function(){var e={},t=function(e,t){return {status:e,resultUri:t}},n=function(t){return t in e};return {hasBlobUri:n,getResultUri:function(t){var n=e[t];return n?n.resultUri:null},isPending:function(t){return !!n(t)&&1===e[t].status},isUploaded:function(t){return !!n(t)&&2===e[t].status},markPending:function(n){e[n]=t(1,null);},markUploaded:function(n,r){e[n]=t(2,r);},removeFailed:function(t){delete e[t];},destroy:function(){e={};}}},Oy=0,By=function(e){return e+Oy+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t;},Py=function(e,t){var n={},r=function(e,n,r,o){var i=new XMLHttpRequest;i.open("POST",t.url),i.withCredentials=t.credentials,i.upload.onprogress=function(e){o(e.loaded/e.total*100);},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status);},i.onload=function(){if(i.status<200||i.status>=300)r("HTTP Error: "+i.status);else {var e,o,a=JSON.parse(i.responseText);if(a&&"string"==typeof a.location)n((e=t.basePath,o=a.location,e?e.replace(/\/$/,"")+"/"+o.replace(/^\//,""):o));else r("Invalid JSON: "+i.responseText);}};var a=new FormData;a.append("file",e.blob(),e.filename()),i.send(a);},o=function(e,t){return {url:t,blobInfo:e,status:!0}},i=function(e,t,n){return {url:"",blobInfo:e,status:!1,error:{message:t,options:n}}},a=function(e,t){_t.each(n[e],(function(e){e(t);})),delete n[e];},u=function(r,u){return r=_t.grep(r,(function(t){return !e.isUploaded(t.blobUri())})),Zr.all(_t.map(r,(function(r){return e.isPending(r.blobUri())?function(e){var t=e.blobUri();return new Zr((function(e){n[t]=n[t]||[],n[t].push(e);}))}(r):function(t,n,r){return e.markPending(t.blobUri()),new Zr((function(u){var c;try{var s=function(){c&&c.close();};n(t,(function(n){s(),e.markUploaded(t.blobUri(),n),a(t.blobUri(),o(t,n)),u(o(t,n));}),(function(n,r){var o=r||{};s(),e.removeFailed(t.blobUri()),a(t.blobUri(),i(t,n,o)),u(i(t,n,o));}),(function(e){e<0||e>100||I.from(c).orThunk((function(){return I.from(r).map(R)})).each((function(t){c=t,t.progressBar.value(e);}));}));}catch(e){u(i(t,e.message,{}));}}))}(r,t.handler,u)})))};return !1===y(t.handler)&&(t.handler=r),{upload:function(e,n){return t.url||t.handler!==r?u(e,n):new Zr((function(e){e([]);}))}}},Ly=function(e){return function(){return e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}},Iy=function(e,t){return Py(t,{url:as(e),basePath:us(e),credentials:cs(e),handler:ss(e)})},My=function(e){var t,n,r=function(){var e=[],t=function(e){if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var t,n=e.id||By("blobid"),r=e.name||n,o=e.blob;return {id:k(n),name:k(r),filename:k(e.filename||r+"."+(t=o.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[t.toLowerCase()]||"dat")),blob:k(o),base64:k(e.base64),blobUri:k(e.blobUri||URL.createObjectURL(o)),uri:k(e.uri)}},n=function(t){return J(e,t).getOrUndefined()},r=function(e){return n((function(t){return t.id()===e}))};return {create:function(e,n,r,o,i){if(l(e))return t({id:e,name:o,filename:i,blob:n,base64:r});if(d(e))return t(e);throw new Error("Unknown input type")},add:function(t){r(t.id())||e.push(t);},get:r,getByUri:function(e){return n((function(t){return t.blobUri()===e}))},getByData:function(e,t){return n((function(n){return n.base64()===e&&n.blob().type===t}))},findFirst:n,removeByUri:function(t){e=K(e,(function(e){return e.blobUri()!==t||(URL.revokeObjectURL(e.blobUri()),!1)}));},destroy:function(){q(e,(function(e){URL.revokeObjectURL(e.blobUri());})),e=[];}}}(),o=Ty(),i=[],a=function(e){var t=Cu(null);return e.on("change AddUndo",(function(e){t.set(Re({},e.level));})),{fireIfChanged:function(){var n=e.undoManager.data;ae(n).filter((function(e){return !$v(t.get(),e)})).each((function(t){e.setDirty(!0),e.fire("change",{level:t,lastLevel:oe(n,n.length-2).getOrNull()});}));}}}(e),u=function(t){return function(n){return e.selection?t(n):[]}},c=function(e,t,n){var r=0;do{-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1);}while(-1!==r);return e},s=function(e,t,n){var r='src="'+n+'"'+(n===wt.transparentSrc?' data-mce-placeholder="1"':"");return e=c(e,'src="'+t+'"',r),e=c(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},f=function(t,n){q(e.undoManager.data,(function(e){"fragmented"===e.type?e.fragments=V(e.fragments,(function(e){return s(e,t,n)})):e.content=s(e.content,t,n);}));},m=function(n){return t||(t=Iy(e,o)),h().then(u((function(o){var i=V(o,(function(e){return e.blobInfo}));return t.upload(i,Ly(e)).then(u((function(t){var i=[],u=V(t,(function(t,n){var a=o[n].blobInfo,u=o[n].image;return t.status&&function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")}(e)?(r.removeByUri(u.src),Gv(e)||function(t,n){var r,o=e.convertURL(n,"src");f(t.src,n),e.$(t).attr({src:os(e)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o});}(u,t.url)):t.error&&(t.error.options.remove&&(f(u.getAttribute("src"),wt.transparentSrc),i.push(u)),function(e,t){Sy(e,ku.translate(["Failed to upload image: {0}",t]));}(e,t.error.message)),{element:u,status:t.status,uploadUri:t.url,blobInfo:a}}));return u.length>0&&a.fireIfChanged(),i.length>0&&(Gv(e)?console.error("Removing images on failed uploads is currently unsupported for RTC"):e.undoManager.transact((function(){q(i,(function(t){e.dom.remove(t),r.removeByUri(t.src);}));}))),n&&n(u),u})))})))},g=function(t){if(rs(e))return m(t)},p=function(t){if(!1===ee(i,(function(e){return e(t)})))return !1;if(0===t.getAttribute("src").indexOf("data:")){var n=function(e){return e.getParam("images_dataimg_filter",O,"function")}(e);return n(t)}return !0},h=function(){return n||(n=bb(o,r)),n.findAll(e.getBody(),p).then(u((function(t){return t=K(t,(function(t){return "string"!=typeof t||(Sy(e,t),!1)})),Gv(e)||q(t,(function(e){f(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src");})),t})))},v=function(t){return t.replace(/src="(blob:[^"]+)"/g,(function(t,n){var i=o.getResultUri(n);if(i)return 'src="'+i+'"';var a=r.getByUri(n);return a||(a=Y(e.editorManager.get(),(function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)}),null)),a?'src="data:'+a.blob().type+";base64,"+a.base64()+'"':t}))};return e.on("SetContent",(function(){rs(e)?g():h();})),e.on("RawSaveContent",(function(e){e.content=v(e.content);})),e.on("GetContent",(function(e){e.source_view||"raw"===e.format||"tree"===e.format||(e.content=v(e.content));})),e.on("PostRender",(function(){e.parser.addNodeFilter("img",(function(e){q(e,(function(e){var t=e.attr("src");if(!r.getByUri(t)){var n=o.getResultUri(t);n&&e.attr("src",n);}}));}));})),{blobCache:r,addFilter:function(e){i.push(e);},uploadImages:m,uploadImagesAuto:g,scanForImages:h,destroy:function(){r.destroy(),o.destroy(),n=t=null;}}},Fy=function(e){var t={},n=function(e,r){e&&(l(e)?(m(r)||(r=[r]),q(r,(function(e){h(e.deep)&&(e.deep=!gl(e)),h(e.split)&&(e.split=!gl(e)||pl(e)),h(e.remove)&&gl(e)&&!pl(e)&&(e.remove="none"),gl(e)&&pl(e)&&(e.mixed=!0,e.block_expand=!0),l(e.classes)&&(e.classes=e.classes.split(/\s+/));})),t[e]=r):le(e,(function(e,t){n(t,e);})));};return n(function(e){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(e,t,n){return Dn(e)&&e.hasAttribute("href")},onformat:function(t,n,r){_t.each(r,(function(n,r){e.setAttrib(t,r,n);}));}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(e){var t;return null!==(t=null==e?void 0:e.customValue)&&void 0!==t?t:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return _t.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(function(e){t[e]={block:e,remove:"all"};})),t}(e.dom)),n(function(e){return e.getParam("formats")}(e)),{get:function(e){return b(e)?t[e]:t},has:function(e){return ye(t,e)},register:n,unregister:function(e){return e&&t[e]&&delete t[e],t}}},Uy=_t.each,zy=pu.DOM,Hy=function(e,t){var n,r,o,i=t&&t.schema||Ai({}),a=function(e){r="string"==typeof e?{name:e,classes:[],attrs:{}}:e;var t=zy.create(r.name);return function(e,t){t.classes.length&&zy.addClass(e,t.classes.join(" ")),zy.setAttribs(e,t.attrs);}(t,r),t},u=function(e,t,n){var r,o,c=t.length>0&&t[0],s=c&&c.name,f=function(e,t){var n="string"!=typeof e?e.nodeName.toLowerCase():e,r=i.getElementRule(n),o=r&&r.parentsRequired;return !(!o||!o.length)&&(t&&-1!==_t.inArray(o,t)?t:o[0])}(e,s);if(f)s===f?(o=t[0],t=t.slice(1)):o=f;else if(c)o=t[0],t=t.slice(1);else if(!n)return e;return o&&(r=a(o)).appendChild(e),n&&(r||(r=zy.create("div")).appendChild(e),_t.each(n,(function(t){var n=a(t);r.insertBefore(n,e);}))),u(r,t,o&&o.siblings)};return e&&e.length?(r=e[0],n=a(r),(o=zy.create("div")).appendChild(u(n,e.slice(1),r.siblings)),o):""},jy=function(e){var t,n={classes:[],attrs:{}};return "*"!==(e=n.selector=_t.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(e,t,r,o,i){switch(t){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==_t.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r);}if("["===o){var a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);a&&(n.attrs[a[1]]=a[2]);}return ""}))),n.name=t||"div",n},Vy=function(e,t){var n,r,o,i="",a=function(e){var t=e.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return l(t)?t:""}(e);if(""===a)return "";var u=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof t){if(!(t=e.formatter.get(t)))return;t=t[0];}if("preview"in t){var c=be(t,"preview");if(Xn(c,!1))return "";a=c.getOr(a);}n=t.block||t.inline||"span";var s,f=(s=t.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),_t.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(e){var t=_t.map(e.split(/(?:~\+|~|\+)/),jy),n=t.pop();return t.length&&(n.siblings=t),n})).reverse()):[];f.length?(f[0].name||(f[0].name=n),n=t.selector,r=Hy(f,e)):r=Hy([n],e);var d=zy.select(n,r)[0]||r.firstChild;return Uy(t.styles,(function(e,t){var n=u(e);n&&zy.setStyle(d,t,n);})),Uy(t.attributes,(function(e,t){var n=u(e);n&&zy.setAttrib(d,t,n);})),Uy(t.classes,(function(e){var t=u(e);zy.hasClass(d,t)||zy.addClass(d,t);})),e.fire("PreviewFormats"),zy.setStyles(r,{position:"absolute",left:-65535}),e.getBody().appendChild(r),o=zy.getStyle(e.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,Uy(a.split(" "),(function(t){var n=zy.getStyle(d,t,!0);if(!("background-color"===t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=zy.getStyle(e.getBody(),t,!0),"#ffffff"===zy.toHex(n).toLowerCase())||"color"===t&&"#000000"===zy.toHex(n).toLowerCase())){if("font-size"===t&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px";}"border"===t&&n&&(i+="padding:0 2px;"),i+=t+":"+n+";";}})),e.fire("AfterPreviewFormats"),zy.remove(r),i},qy=function(e){var t=Fy(e),n=Cu(null);return 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"]);}(e),Th(e),{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:function(t,n,r){!function(e,t,n,r){Zv(e).formatter.apply(t,n,r);}(e,t,n,r);},remove:function(t,n,r,o){!function(e,t,n,r,o){Zv(e).formatter.remove(t,n,r,o);}(e,t,n,r,o);},toggle:function(t,n,r){!function(e,t,n,r){Zv(e).formatter.toggle(t,n,r);}(e,t,n,r);},match:function(t,n,r,o){return function(e,t,n,r,o){return Zv(e).formatter.match(t,n,r,o)}(e,t,n,r,o)},closest:function(t){return function(e,t){return Zv(e).formatter.closest(t)}(e,t)},matchAll:function(t,n){return function(e,t,n){return Zv(e).formatter.matchAll(t,n)}(e,t,n)},matchNode:function(t,n,r,o){return function(e,t,n,r,o){return Zv(e).formatter.matchNode(t,n,r,o)}(e,t,n,r,o)},canApply:function(t){return function(e,t){return Zv(e).formatter.canApply(t)}(e,t)},formatChanged:function(t,r,o,i){return function(e,t,n,r,o,i){return Zv(e).formatter.formatChanged(t,n,r,o,i)}(e,n,t,r,o,i)},getCssText:_(Vy,e)}},$y=function(e){switch(e.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return !0;default:return !1}},Wy=function(e){var t=Eu(),n=Cu(0),r=Cu(0),o={data:[],typing:!1,beforeChange:function(){!function(e,t,n){Zv(e).undoManager.beforeChange(t,n);}(e,n,t);},add:function(i,a){return function(e,t,n,r,o,i,a){return Zv(e).undoManager.add(t,n,r,o,i,a)}(e,o,r,n,t,i,a)},undo:function(){return function(e,t,n,r){return Zv(e).undoManager.undo(t,n,r)}(e,o,n,r)},redo:function(){return function(e,t,n){return Zv(e).undoManager.redo(t,n)}(e,r,o.data)},clear:function(){!function(e,t,n){Zv(e).undoManager.clear(t,n);}(e,o,r);},reset:function(){!function(e,t){Zv(e).undoManager.reset(t);}(e,o);},hasUndo:function(){return function(e,t,n){return Zv(e).undoManager.hasUndo(t,n)}(e,o,r)},hasRedo:function(){return function(e,t,n){return Zv(e).undoManager.hasRedo(t,n)}(e,o,r)},transact:function(t){return function(e,t,n,r){return Zv(e).undoManager.transact(t,n,r)}(e,o,n,t)},ignore:function(t){!function(e,t,n){Zv(e).undoManager.ignore(t,n);}(e,n,t);},extra:function(t,n){!function(e,t,n,r,o){Zv(e).undoManager.extra(t,n,r,o);}(e,o,r,t,n);}};return Gv(e)||function(e,t,n){var r=Cu(!1),o=function(e){Kv(t,!1,n),t.add({},e);};e.on("init",(function(){t.add();})),e.on("BeforeExecCommand",(function(e){var r=e.command;$y(r)||(Xv(t,n),t.beforeChange());})),e.on("ExecCommand",(function(e){var t=e.command;$y(t)||o(e);})),e.on("ObjectResizeStart cut",(function(){t.beforeChange();})),e.on("SaveContent ObjectResized blur",o),e.on("dragend",o),e.on("keyup",(function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),e.nodeChanged()),46!==i&&8!==i||e.nodeChanged(),r.get()&&t.typing&&!1===$v(Hv(e),t.data[0])&&(!1===e.isDirty()&&(e.setDirty(!0),e.fire("change",{level:t.data[0],lastLevel:null})),e.fire("TypingUndo"),r.set(!1),e.nodeChanged()));})),e.on("keydown",(function(e){var i=e.keyCode;if(!e.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)t.typing&&o(e);else {var a=e.ctrlKey&&!e.altKey||e.metaKey;!(i<16||i>20)||224===i||91===i||t.typing||a||(t.beforeChange(),Kv(t,!0,n),t.add({},e),r.set(!0));}})),e.on("mousedown",(function(e){t.typing&&o(e);})),e.on("input",(function(e){var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data||function(e){return "insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType}(e))&&o(e);})),e.on("AddUndo Undo Redo ClearUndos",(function(t){t.isDefaultPrevented()||e.nodeChanged();}));}(e,o,n),function(e){e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo");}(e),o},Ky=[9,27,od.HOME,od.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,od.DOWN,od.UP,od.LEFT,od.RIGHT].concat(wt.browser.isFirefox()?[224]:[]),Xy="data-mce-placeholder",Yy=function(e){return "keydown"===e.type||"keyup"===e.type},Gy=function(e){var t=e.keyCode;return t===od.BACKSPACE||t===od.DELETE},Jy=function(e){var t=e.dom,n=ts(e),r=function(e){return e.getParam("placeholder",Qc.getAttrib(e.getElement(),"placeholder"),"string")}(e),o=function(i,a){if(!function(e){if(Yy(e)){var t=e.keyCode;return !Gy(e)&&(od.metaKeyPressed(e)||e.altKey||t>=112&&t<=123||H(Ky,t))}return !1}(i)){var u=e.getBody(),c=!function(e){return Yy(e)&&!(Gy(e)||"keyup"===e.type&&229===e.keyCode)}(i)&&function(e,t,n){if(ei(Rt.fromDom(t),!1)){var r=""===n,o=t.firstElementChild;return !o||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&(r?!e.isBlock(o):n===o.nodeName.toLowerCase())}return !1}(t,u,n);(""!==t.getAttrib(u,Xy)!==c||a)&&(t.setAttrib(u,Xy,c?r:null),t.setAttrib(u,"aria-placeholder",c?r:null),function(e,t){e.fire("PlaceholderToggle",{state:t});}(e,c),e.on(c?"keydown":"keyup",o),e.off(c?"keyup":"keydown",o));}};r&&e.on("init",(function(t){o(t,!0),e.on("change SetContent ExecCommand",o),e.on("paste",(function(t){return ro.setEditorTimeout(e,(function(){return o(t)}))}));}));},Qy=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Zy=function(e,t){return Tt(Rt.fromDom(t),function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(e))},eC=function(e){return "rtl"===pu.DOM.getStyle(e,"direction",!0)||(t=e.textContent,Qy.test(t));var t;},tC=function(e,t,n){var r=function(e,t,n){return K(pu.DOM.getParents(n.container(),"*",t),e)}(e,t,n);return I.from(r[r.length-1])},nC=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Eo(n)?Fn(n.nextSibling)?Ac(n.nextSibling,0):Ac.after(n):Ro(t)?Ac(n,r+1):t:Eo(n)?Fn(n.previousSibling)?Ac(n.previousSibling,n.previousSibling.data.length):Ac.before(n):Do(t)?Ac(n,r-1):t},rC=_(nC,!0),oC=_(nC,!1),iC=function(e){return mo(e)||po(e)},aC=function(e,t){return Lt(e,t)?Xr(t,iC,function(e){return function(t){return Bt(e,Rt.fromDom(t.dom.parentNode))}}(e)):I.none()},uC=function(e){e.dom.isEmpty(e.getBody())&&(e.setContent(""),function(e){var t=e.getBody(),n=t.firstChild&&e.dom.isBlock(t.firstChild)?t.firstChild:t;e.selection.setCursorLocation(n,0);}(e));},cC=function(e,t){return {from:e,to:t}},sC=function(e,t){var n=Rt.fromDom(e),r=Rt.fromDom(t.container());return aC(n,r).map((function(e){return function(e,t){return {block:e,position:t}}(e,t)}))},fC=function(e,t,n){var r=sC(e,Ac.fromRangeStart(n)),o=r.bind((function(n){return Rf(t,e,n.position).bind((function(n){return sC(e,n).map((function(n){return function(e,t,n){return jn(n.position.getNode())&&!1===ei(n.block)?Of(!1,n.block.dom).bind((function(r){return r.isEqual(n.position)?Rf(t,e,r).bind((function(t){return sC(e,t)})):I.some(n)})).getOr(n):n}(e,t,n)}))}))}));return Yn(r,o,cC).filter((function(e){return function(e){return !1===Bt(e.from.block,e.to.block)}(e)&&function(e){return Wt(e.from.block).bind((function(t){return Wt(e.to.block).filter((function(e){return Bt(t,e)}))})).isSome()}(e)&&function(e){return !1===$n(e.from.block.dom)&&!1===$n(e.to.block.dom)}(e)}))},lC=function(e){var t=Jt(e);return Q(t,so).fold(k(t),(function(e){return t.slice(0,e)}))},dC=function(e){var t=lC(e);return q(t,hn),t},mC=function(e,t){var n=Ng(t,e);return J(n.reverse(),(function(e){return ei(e)})).each(hn)},gC=function(e,t,n,r){if(ei(n))return xg(n),Lf(n.dom);0===K(Yt(r),(function(e){return !ei(e)})).length&&ei(t)&&fn(r,Rt.fromTag("br"));var o=Pf(n.dom,Ac.before(r.dom));return q(dC(t),(function(e){fn(r,e);})),mC(e,t),o},pC=function(e,t,n){if(ei(n))return hn(n),ei(t)&&xg(t),Lf(t.dom);var r=If(n.dom);return q(dC(t),(function(e){mn(n,e);})),mC(e,t),r},hC=function(e,t){return Lt(t,e)?function(e,t){var n=Ng(t,e);return I.from(n[n.length-1])}(t,e):I.none()},vC=function(e,t){Of(e,t.dom).map((function(e){return e.getNode()})).map(Rt.fromDom).filter(lo).each(hn);},bC=function(e,t,n){return vC(!0,t),vC(!1,n),hC(t,n).fold(_(pC,e,t,n),_(gC,e,t,n))},yC=function(e,t,n,r){return t?bC(e,r,n):bC(e,n,r)},CC=function(e,t){var n=Rt.fromDom(e.getBody()),r=function(e,t,n){return n.collapsed?fC(e,t,n):I.none()}(n.dom,t,e.selection.getRng()).bind((function(e){return yC(n,t,e.from.block,e.to.block)}));return r.each((function(t){e.selection.setRng(t.toRange());})),r.isSome()},xC=function(e,t){var n=Rt.fromDom(t),r=_(Bt,e);return Kr(n,vo,r).isSome()},wC=function(e,t){var n=Pf(e.dom,Ac.fromRangeStart(t)).isNone(),r=Bf(e.dom,Ac.fromRangeEnd(t)).isNone();return !function(e,t){return xC(e,t.startContainer)||xC(e,t.endContainer)}(e,t)&&n&&r},SC=function(e){var t=Rt.fromDom(e.getBody()),n=e.selection.getRng();return wC(t,n)?function(e){return e.setContent(""),e.selection.setCursorLocation(),!0}(e):function(e,t){var n=t.getRng();return Yn(aC(e,Rt.fromDom(n.startContainer)),aC(e,Rt.fromDom(n.endContainer)),(function(r,o){return !1===Bt(r,o)&&(n.deleteContents(),yC(e,!0,r,o).each((function(e){t.setRng(e.toRange());})),!0)})).getOr(!1)}(t,e.selection)},kC=function(e,t){return !e.selection.isCollapsed()&&SC(e)},NC=qn,EC=$n,_C=function(e,t,n,r,o){return I.from(t._selectionOverrides.showCaret(e,n,r,o))},AC=function(e,t){return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?I.none():I.some(function(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}(t))},RC=function(e,t,n){var r=uf(1,e.getBody(),t),o=Ac.fromRangeStart(r),i=o.getNode();if(Us(i))return _C(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(Us(a))return _C(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),(function(e){return EC(e)||NC(e)}));return Us(u)?_C(1,e,u,!1,n):I.none()},DC=function(e,t,n){return t.collapsed?RC(e,t,n).getOr(t):t},TC=function(e){return bg(e)||gg(e)},OC=function(e){return yg(e)||pg(e)},BC=function(e,t,n,r,o,i){return _C(r,e,i.getNode(!o),o,!0).each((function(n){if(t.collapsed){var r=t.cloneRange();o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents();}else t.deleteContents();e.selection.setRng(n);})),function(e,t){Fn(t)&&0===t.data.length&&e.remove(t);}(e.dom,n),!0},PC=function(e,t){return function(e,t){var n=e.selection.getRng();if(!Fn(n.commonAncestorContainer))return !1;var r=t?Rc.Forwards:Rc.Backwards,o=kf(e.getBody()),i=_(lf,t?o.next:o.prev),a=t?TC:OC,u=sf(r,e.getBody(),n),c=nC(t,i(u));if(!c||!df(u,c))return !1;if(a(c))return BC(e,n,u.getNode(),r,t,c);var s=i(c);return !!(s&&a(s)&&df(c,s))&&BC(e,n,u.getNode(),r,t,s)}(e,t)},LC=kr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),IC=function(e,t,n,r){var o=r.getNode(!1===t);return aC(Rt.fromDom(e),Rt.fromDom(n.getNode())).map((function(e){return ei(e)?LC.remove(e.dom):LC.moveToElement(o)})).orThunk((function(){return I.some(LC.moveToElement(o))}))},MC=function(e,t,n){return Rf(t,e,n).bind((function(r){return o=r.getNode(),vo(Rt.fromDom(o))||po(Rt.fromDom(o))||function(e,t,n,r){var o=function(t){return fo(Rt.fromDom(t))&&!Zs(n,r,e)};return cf(!t,n).fold((function(){return cf(t,r).fold(T,o)}),o)}(e,t,n,r)?I.none():t&&$n(r.getNode())||!1===t&&$n(r.getNode(!0))?IC(e,t,n,r):t&&yg(n)||!1===t&&bg(n)?I.some(LC.moveToPosition(r)):I.none();var o;}))},FC=function(e,t,n){return function(e,t){var n=t.getNode(!1===e),r=e?"after":"before";return Dn(n)&&n.getAttribute("data-mce-caret")===r}(t,n)?function(e,t){return e&&$n(t.nextSibling)?I.some(LC.moveToElement(t.nextSibling)):!1===e&&$n(t.previousSibling)?I.some(LC.moveToElement(t.previousSibling)):I.none()}(t,n.getNode(!1===t)).fold((function(){return MC(e,t,n)}),I.some):MC(e,t,n).bind((function(t){return function(e,t,n){return n.fold((function(e){return I.some(LC.remove(e))}),(function(e){return I.some(LC.moveToElement(e))}),(function(n){return Zs(t,n,e)?I.none():I.some(LC.moveToPosition(n))}))}(e,n,t)}))},UC=function(e,t){return I.from(Zl(e.getBody(),t))},zC=function(e,t){var n=e.selection.getNode();return UC(e,n).filter($n).fold((function(){return function(e,t,n){var r=uf(t?1:-1,e,n),o=Ac.fromRangeStart(r),i=Rt.fromDom(e);return !1===t&&yg(o)?I.some(LC.remove(o.getNode(!0))):t&&bg(o)?I.some(LC.remove(o.getNode())):!1===t&&bg(o)&&Mg(i,o)?Fg(i,o).map((function(e){return LC.remove(e.getNode())})):t&&yg(o)&&Ig(i,o)?Ug(i,o).map((function(e){return LC.remove(e.getNode())})):FC(e,t,o)}(e.getBody(),t,e.selection.getRng()).exists((function(n){return n.fold(function(e,t){return function(n){return e._selectionOverrides.hideFakeCaret(),gp(e,t,Rt.fromDom(n)),!0}}(e,t),function(e,t){return function(n){var r=t?Ac.before(n):Ac.after(n);return e.selection.setRng(r.toRange()),!0}}(e,t),function(e){return function(t){return e.selection.setRng(t.toRange()),!0}}(e))}))}),O)},HC=function(e,t){var n=e.selection.getNode();return !(!$n(n)||Wn(n))&&UC(e,n.parentNode).filter($n).fold((function(){var n;return n=Rt.fromDom(e.getBody()),q(Mu(n,".mce-offscreen-selection"),hn),gp(e,t,Rt.fromDom(e.selection.getNode())),uC(e),!0}),O)},jC=function(e){var t=e.dom,n=e.selection,r=Zl(e.getBody(),n.getNode());if(qn(r)&&t.isBlock(r)&&t.isEmpty(r)){var o=t.create("br",{"data-mce-bogus":"1"});t.setHTML(r,""),r.appendChild(o),n.setRng(Ac.before(o).toRange());}return !0},VC=function(e,t){return e.selection.isCollapsed()?zC(e,t):HC(e,t)},qC=function(e,t){return !!e.selection.isCollapsed()&&function(e,t){var n=Ac.fromRangeStart(e.selection.getRng());return Rf(t,e.getBody(),n).filter((function(e){return t?dg(e):mg(e)})).bind((function(e){return I.from(ef(t?0:-1,e))})).exists((function(t){return e.selection.select(t),!0}))}(e,t)},$C=Fn,WC=function(e){return $C(e)&&e.data[0]===Co},KC=function(e){return $C(e)&&e.data[e.data.length-1]===Co},XC=function(e){return e.ownerDocument.createTextNode(Co)},YC=function(e,t){return e?function(e){if($C(e.previousSibling))return KC(e.previousSibling)||e.previousSibling.appendData(Co),e.previousSibling;if($C(e))return WC(e)||e.insertData(0,Co),e;var t=XC(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if($C(e.nextSibling))return WC(e.nextSibling)||e.nextSibling.insertData(0,Co),e.nextSibling;if($C(e))return KC(e)||e.appendData(Co),e;var t=XC(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},GC=_(YC,!0),JC=_(YC,!1),QC=function(e,t){return Fn(e.container())?YC(t,e.container()):YC(t,e.getNode())},ZC=function(e,t){var n=t.get();return n&&e.container()===n&&Eo(n)},ex=function(e,t){return t.fold((function(t){Ts(e.get());var n=GC(t);return e.set(n),I.some(Ac(n,n.length-1))}),(function(t){return Lf(t).map((function(t){if(ZC(t,e))return Ac(e.get(),1);Ts(e.get());var n=QC(t,!0);return e.set(n),Ac(n,1)}))}),(function(t){return If(t).map((function(t){if(ZC(t,e))return Ac(e.get(),e.get().length-1);Ts(e.get());var n=QC(t,!1);return e.set(n),Ac(n,n.length-1)}))}),(function(t){Ts(e.get());var n=JC(t);return e.set(n),I.some(Ac(n,1))}))},tx=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return I.none()},nx=kr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),rx=function(e,t){var n=Qs(t,e);return n||e},ox=function(e,t,n){var r=rC(n),o=rx(t,r.container());return tC(e,o,r).fold((function(){return Bf(o,r).bind(_(tC,e,o)).map((function(e){return nx.before(e)}))}),I.none)},ix=function(e,t){return null===Uf(e,t)},ax=function(e,t,n){return tC(e,t,n).filter(_(ix,t))},ux=function(e,t,n){var r=oC(n);return ax(e,t,r).bind((function(e){return Pf(e,r).isNone()?I.some(nx.start(e)):I.none()}))},cx=function(e,t,n){var r=rC(n);return ax(e,t,r).bind((function(e){return Bf(e,r).isNone()?I.some(nx.end(e)):I.none()}))},sx=function(e,t,n){var r=oC(n),o=rx(t,r.container());return tC(e,o,r).fold((function(){return Pf(o,r).bind(_(tC,e,o)).map((function(e){return nx.after(e)}))}),I.none)},fx=function(e){return !1===eC(dx(e))},lx=function(e,t,n){return tx([ox,ux,cx,sx],[e,t,n]).filter(fx)},dx=function(e){return e.fold(N,N,N,N)},mx=function(e){return e.fold(k("before"),k("start"),k("end"),k("after"))},gx=function(e){return e.fold(nx.before,nx.before,nx.after,nx.after)},px=function(e){return e.fold(nx.start,nx.start,nx.end,nx.end)},hx=function(e,t,n,r,o,i){return Yn(tC(t,n,r),tC(t,n,o),(function(t,r){return t!==r&&function(e,t,n){var r=Qs(t,e),o=Qs(n,e);return r&&r===o}(n,t,r)?nx.after(e?t:r):i})).getOr(i)},vx=function(e,t){return e.fold(O,(function(e){return r=t,!(mx(n=e)===mx(r)&&dx(n)===dx(r));var n,r;}))},bx=function(e,t){return e?t.fold(w(I.some,nx.start),I.none,w(I.some,nx.after),I.none):t.fold(I.none,w(I.some,nx.before),I.none,w(I.some,nx.end))},yx=function(e,t,n,r){var o=nC(e,r),i=lx(t,n,o);return lx(t,n,o).bind(_(bx,e)).orThunk((function(){return function(e,t,n,r,o){var i=nC(e,o);return Rf(e,n,i).map(_(nC,e)).fold((function(){return r.map(gx)}),(function(o){return lx(t,n,o).map(_(hx,e,t,n,i,o)).filter(_(vx,r))})).filter(fx)}(e,t,n,i,r)}))};_(yx,!1),_(yx,!0);var Cx,xx=function(e,t,n){var r=e?1:-1;return t.setRng(Ac(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},wx=function(e,t){var n=t.selection.getRng(),r=e?Ac.fromRangeEnd(n):Ac.fromRangeStart(n);return !!function(e){return y(e.selection.getSel().modify)}(t)&&(e&&Ro(r)?xx(!0,t.selection,r):!(e||!Do(r))&&xx(!1,t.selection,r))};!function(e){e[e.Br=0]="Br",e[e.Block=1]="Block",e[e.Wrap=2]="Wrap",e[e.Eol=3]="Eol";}(Cx||(Cx={}));var Sx,kx=function(e,t){return e===Rc.Backwards?te(t):t},Nx=function(e,t,n){return e===Rc.Forwards?t.next(n):t.prev(n)},Ex=function(e,t,n,r){return jn(r.getNode(t===Rc.Forwards))?Cx.Br:!1===Zs(n,r)?Cx.Block:Cx.Wrap},_x=function(e,t,n,r){for(var o=kf(n),i=r,a=[];i;){var u=Nx(t,o,i);if(!u)break;if(jn(u.getNode(!1)))return t===Rc.Forwards?{positions:kx(t,a).concat([u]),breakType:Cx.Br,breakAt:I.some(u)}:{positions:kx(t,a),breakType:Cx.Br,breakAt:I.some(u)};if(u.isVisible()){if(e(i,u)){var c=Ex(0,t,i,u);return {positions:kx(t,a),breakType:c,breakAt:I.some(u)}}a.push(u),i=u;}else i=u;}return {positions:kx(t,a),breakType:Cx.Eol,breakAt:I.none()}},Ax=function(e,t,n,r){return t(n,r).breakAt.map((function(r){var o=t(n,r).positions;return e===Rc.Backwards?o.concat(r):[r].concat(o)})).getOr([])},Rx=function(e,t){return Y(e,(function(e,n){return e.fold((function(){return I.some(n)}),(function(r){return Yn(ie(r.getClientRects()),ie(n.getClientRects()),(function(e,o){var i=Math.abs(t-e.left);return Math.abs(t-o.left)<=i?n:r})).or(e)}))}),I.none())},Dx=function(e,t){return ie(t.getClientRects()).bind((function(t){return Rx(e,t.left)}))},Tx=_(_x,Ac.isAbove,-1),Ox=_(_x,Ac.isBelow,1),Bx=_(Ax,-1,Tx),Px=_(Ax,1,Ox),Lx=function(e){var t=function(t){return V(t,(function(t){var n=ec(t);return n.node=e,n}))};if(Dn(e))return t(e.getClientRects());if(Fn(e)){var n=e.ownerDocument.createRange();return n.setStart(e,0),n.setEnd(e,e.data.length),t(n.getClientRects())}},Ix=function(e){return Z(e,Lx)};!function(e){e[e.Up=-1]="Up",e[e.Down=1]="Down";}(Sx||(Sx={}));var Mx,Fx,Ux=function(e,t,n,r,o,i){var a=0,u=[],c=function(r){var i=Ix([r]);-1===e&&(i=i.reverse());for(var c=0;c<i.length;c++){var f=i[c];if(!n(f,s)){if(u.length>0&&t(f,Ae(u))&&a++,f.line=a,o(f))return !0;u.push(f);}}},s=Ae(i.getClientRects());if(!s)return u;var f=i.getNode();return c(f),function(e,t,n,r){for(;r=Js(r,e,Wo,t);)if(n(r))return}(e,r,c,f),u},zx=_(Ux,Sx.Up,rc,oc),Hx=_(Ux,Sx.Down,oc,rc),jx=function(e){return function(t){return function(e,t){return t.line>e}(e,t)}},Vx=function(e){return function(t){return function(e,t){return t.line===e}(e,t)}},qx=$n,$x=Js,Wx=function(e,t){return Math.abs(e.left-t)},Kx=function(e,t){return Math.abs(e.right-t)},Xx=function(e,t){return e>=t.left&&e<=t.right},Yx=function(e,t){return e>=t.top&&e<=t.bottom},Gx=function(e,t,n){return void 0===n&&(n=O),Ee(e,(function(e,r){if(Xx(t,r))return n(r)?r:e;if(Xx(t,e))return n(e)?e:r;var o=Math.min(Wx(e,t),Kx(e,t)),i=Math.min(Wx(r,t),Kx(r,t));return i===o&&Ce(r,"node")&&qx(r.node)||i<o?r:e}))},Jx=function(e,t,n,r,o){var i=$x(r,e,Wo,t,!o);do{if(!i||n(i))return}while(i=$x(i,e,Wo,t))},Qx=function(e,t,n){var r=Ix(function(e){return K(ue(e.getElementsByTagName("*")),zs)}(e)),o=K(r,_(Yx,n)),i=function(e){return !Ln(e.node)&&!Kn(e.node)},a=Gx(o,t,i);if(a){var u=i(a);if(a=Gx(function(e,t,n){void 0===n&&(n=!0);var r=[],o=function(e,n){var o=K(Ix([n]),(function(n){return !e(n,t)}));return r=r.concat(o),0===o.length};return r.push(t),Jx(Sx.Up,e,_(o,rc),t.node,n),Jx(Sx.Down,e,_(o,oc),t.node,n),r}(e,a,u),t,i),a&&zs(a.node))return function(e,t){return {node:e.node,before:Wx(e,t)<Kx(e,t)}}(a,t)}return null},Zx=function(e,t){e.selection.setRng(t),Vd(e,e.selection.getRng());},ew=function(e,t,n){return I.some(DC(e,t,n))},tw=function(e,t,n,r,o,i){var a=t===Rc.Forwards,u=kf(e.getBody()),c=_(lf,a?u.next:u.prev),s=a?r:o;if(!n.collapsed){var f=ac(n);if(i(f))return _C(t,e,f,t===Rc.Backwards,!1)}var l=sf(t,e.getBody(),n);if(s(l))return AC(e,l.getNode(!a));var d=nC(a,c(l)),m=Lo(n);if(!d)return m?I.some(n):I.none();if(s(d))return _C(t,e,d.getNode(!a),a,!1);var g=c(d);return g&&s(g)&&df(d,g)?_C(t,e,g.getNode(!a),a,!1):m?ew(e,d.toRange(),!1):I.none()},nw=function(e,t,n,r,o,i){var a=sf(t,e.getBody(),n),u=Ae(a.getClientRects()),c=t===Sx.Down;if(!u)return I.none();var s,f=(c?Hx:zx)(e.getBody(),jx(1),a),l=K(f,Vx(1)),d=u.left,m=Gx(l,d);if(m&&i(m.node)){var g=Math.abs(d-m.left),p=Math.abs(d-m.right);return _C(t,e,m.node,g<p,!1)}if(s=r(a)?a.getNode():o(a)?a.getNode(!0):ac(n)){var h=function(e,t,n,r){var o,i,a,u,c=kf(t),s=[],f=0,l=function(e){return Ae(e.getClientRects())};1===e?(o=c.next,i=oc,a=rc,u=Ac.after(r)):(o=c.prev,i=rc,a=oc,u=Ac.before(r));var d=l(u);do{if(u.isVisible()){var m=l(u);if(!a(m,d)){s.length>0&&i(m,Ae(s))&&f++;var g=ec(m);if(g.position=u,g.line=f,n(g))return s;s.push(g);}}}while(u=o(u));return s}(t,e.getBody(),jx(1),s),v=Gx(K(h,Vx(1)),d);if(v)return ew(e,v.position.toRange(),!1);if(v=Ae(K(h,Vx(0))))return ew(e,v.position.toRange(),!1)}return 0===l.length?rw(e,c).filter(c?o:r).map((function(t){return DC(e,t.toRange(),!1)})):I.none()},rw=function(e,t){var n=e.selection.getRng(),r=e.getBody();if(t){var o=Ac.fromRangeEnd(n),i=Ox(r,o);return ae(i.positions)}o=Ac.fromRangeStart(n),i=Tx(r,o);return ie(i.positions)},ow=function(e,t,n){return rw(e,t).filter(n).exists((function(t){return e.selection.setRng(t.toRange()),!0}))},iw=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n);},aw=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected");},uw=function(e,t,n){return ex(t,n).map((function(t){return iw(e,t),n}))},cw=function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=Ac.fromRangeStart(e.selection.getRng());Ac.isTextPosition(n)&&!1===function(e){return Ro(e)||Do(e)}(n)&&(iw(e,Ds(t.get(),n)),t.set(null));}},sw=function(e,t,n){return !!ys(e)&&function(e,t,n){var r=e.getBody(),o=Ac.fromRangeStart(e.selection.getRng()),i=_(Zy,e);return yx(n,i,r,o).bind((function(n){return uw(e,t,n)}))}(e,t,n).isSome()},fw=function(e,t,n){return !!ys(t)&&wx(e,t)},lw=function(e){var t=Cu(null),n=_(Zy,e);return e.on("NodeChange",(function(r){!ys(e)||wt.browser.isIE()&&r.initial||(function(e,t,n){var r=V(Mu(Rt.fromDom(t.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(e){return e.dom})),o=K(r,e),i=K(n,e);q(ne(o,i),_(aw,!1)),q(ne(i,o),_(aw,!0));}(n,e.dom,r.parents),cw(e,t),function(e,t,n,r){if(t.selection.isCollapsed()){var o=K(r,e);q(o,(function(r){var o=Ac.fromRangeStart(t.selection.getRng());lx(e,t.getBody(),o).bind((function(e){return uw(t,n,e)}));}));}}(n,e,t,r.parents));})),t},dw=_(fw,!0),mw=_(fw,!1),gw=function(e,t,n){if(ys(e)){var r=rw(e,t).getOrThunk((function(){var n=e.selection.getRng();return t?Ac.fromRangeEnd(n):Ac.fromRangeStart(n)}));return lx(_(Zy,e),e.getBody(),r).exists((function(t){var r=gx(t);return ex(n,r).exists((function(t){return iw(e,t),!0}))}))}return !1},pw=function(e,t){return function(n){return ex(t,n).exists((function(t){return iw(e,t),!0}))}},hw=function(e,t,n,r){var o=e.getBody(),i=_(Zy,e);e.undoManager.ignore((function(){e.selection.setRng(function(e,t){var n=document.createRange();return n.setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n}(n,r)),e.execCommand("Delete"),lx(i,o,Ac.fromRangeStart(e.selection.getRng())).map(px).map(pw(e,t));})),e.nodeChanged();},vw=function(e,t,n,r){var o=function(e,t){return Qs(t,e)||e}(e.getBody(),r.container()),i=_(Zy,e),a=lx(i,o,r);return a.bind((function(e){return n?e.fold(k(I.some(px(e))),I.none,k(I.some(gx(e))),I.none):e.fold(I.none,k(I.some(gx(e))),I.none,k(I.some(px(e))))})).map(pw(e,t)).getOrThunk((function(){var u=Df(n,o,r),c=u.bind((function(e){return lx(i,o,e)}));return Yn(a,c,(function(){return tC(i,o,r).exists((function(t){return !!function(e){return Yn(Lf(e),If(e),(function(t,n){var r=nC(!0,t),o=nC(!1,n);return Bf(e,r).forall((function(e){return e.isEqual(o)}))})).getOr(!0)}(t)&&(gp(e,n,Rt.fromDom(t)),!0)}))})).orThunk((function(){return c.bind((function(o){return u.map((function(o){return n?hw(e,t,r,o):hw(e,t,o,r),!0}))}))})).getOr(!1)}))},bw=function(e,t,n){if(e.selection.isCollapsed()&&ys(e)){var r=Ac.fromRangeStart(e.selection.getRng());return vw(e,t,n,r)}return !1},yw=function(e){return 1===tn(e)},Cw=function(e,t,n,r){var o=_(Oh,t),i=V(K(r,o),(function(e){return e.dom}));if(0===i.length)gp(t,e,n);else {var a=function(e,t){var n=Nh(!1),r=Rh(t,n.dom);return fn(Rt.fromDom(e),n),hn(Rt.fromDom(e)),Ac(r,0)}(n.dom,i);t.selection.setRng(a.toRange());}},xw=function(e,t){var n=Rt.fromDom(e.getBody()),r=Rt.fromDom(e.selection.getStart()),o=K(function(e,t){var n=Ng(t,e);return Q(n,so).fold(k(n),(function(e){return n.slice(0,e)}))}(n,r),yw);return ae(o).exists((function(n){var r,i=Ac.fromRangeStart(e.selection.getRng());return !(!function(e,t,n){return Yn(Lf(n),If(n),(function(r,o){var i=nC(!0,r),a=nC(!1,o),u=nC(!1,t);return e?Bf(n,u).exists((function(e){return e.isEqual(a)&&t.isEqual(i)})):Pf(n,u).exists((function(e){return e.isEqual(i)&&t.isEqual(a)}))})).getOr(!0)}(t,i,n.dom)||(r=n,Ff(r.dom)&&Sh(r.dom)))&&(Cw(t,e,n,o),!0)}))},ww=function(e,t){return !!e.selection.isCollapsed()&&xw(e,t)},Sw=function(e,t,n){return e._selectionOverrides.hideFakeCaret(),gp(e,t,Rt.fromDom(n)),!0},kw=function(e,t){return e.selection.isCollapsed()?function(e,t){var n=t?gg:pg,r=t?Rc.Forwards:Rc.Backwards,o=sf(r,e.getBody(),e.selection.getRng());return n(o)?Sw(e,t,o.getNode(!t)):I.from(nC(t,o)).filter((function(e){return n(e)&&df(o,e)})).exists((function(n){return Sw(e,t,n.getNode(!t))}))}(e,t):function(e,t){var n=e.selection.getNode();return !!Kn(n)&&Sw(e,t,n)}(e,t)},Nw=function(e){var t=parseInt(e,10);return isNaN(t)?0:t},Ew=function(e,t){return (e||"table"===It(t)?"margin":"padding")+("rtl"===or(t,"direction")?"-right":"-left")},_w=function(e){var t=Rw(e);return !e.mode.isReadOnly()&&(t.length>1||function(e,t){return ee(t,(function(t){var n=Ew(ms(e),t),r=ar(t,n).map(Nw).getOr(0);return "false"!==e.dom.getContentEditable(t.dom)&&r>0}))}(e,t))},Aw=function(e){return go(e)||po(e)},Rw=function(e){return K((t=e.selection.getSelectedBlocks(),V(t,Rt.fromDom)),(function(e){return !Aw(e)&&!function(e){return Wt(e).exists(Aw)}(e)&&Xr(e,(function(e){return qn(e.dom)||$n(e.dom)})).exists((function(e){return qn(e.dom)}))}));var t;},Dw=function(e,t){var n=e.dom,r=e.selection,o=e.formatter,i=function(e){return e.getParam("indentation","40px","string")}(e),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),c=ms(e),s=ts(e);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),q(Rw(e),(function(e){!function(e,t,n,r,o,i){var a=Ew(n,Rt.fromDom(i));if("outdent"===t){var u=Math.max(0,Nw(i.style[a])-r);e.setStyle(i,a,u?u+o:"");}else u=Nw(i.style[a])+r+o,e.setStyle(i,a,u);}(n,t,c,u,a,e.dom);}));},Tw=function(e,t){if(e.selection.isCollapsed()&&_w(e)){var n=e.dom,r=e.selection.getRng(),o=Ac.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Dg(Rt.fromDom(i),o))return Dw(e,"outdent"),!0}return !1},Ow=function(e,t){e.getDoc().execCommand(t,!1,null);},Bw=function(e,t){e.addCommand("delete",(function(){!function(e,t){Tw(e)||VC(e,!1)||PC(e,!1)||bw(e,t,!1)||CC(e,!1)||qp(e)||qC(e,!1)||kw(e,!1)||kC(e)||ww(e,!1)||(Ow(e,"Delete"),uC(e));}(e,t);})),e.addCommand("forwardDelete",(function(){!function(e,t){VC(e,!0)||PC(e,!0)||bw(e,t,!0)||CC(e,!0)||qp(e)||qC(e,!0)||kw(e,!0)||kC(e)||ww(e,!0)||Ow(e,"ForwardDelete");}(e,t);}));},Pw=function(e){return void 0===e.touches||1!==e.touches.length?I.none():I.some(e.touches[0])},Lw=function(e){var t=Eu(),n=Cu(!1),r=Au((function(t){e.fire("longpress",Re(Re({},t),{type:"longpress"})),n.set(!0);}),400);e.on("touchstart",(function(e){Pw(e).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:e.target};r.throttle(e),n.set(!1),t.set(i);}));}),!0),e.on("touchmove",(function(o){r.cancel(),Pw(o).each((function(r){t.on((function(o){(function(e,t){var n=Math.abs(e.clientX-t.x),r=Math.abs(e.clientY-t.y);return n>5||r>5})(r,o)&&(t.clear(),n.set(!1),e.fire("longpresscancel"));}));}));}),!0),e.on("touchend touchcancel",(function(o){r.cancel(),"touchcancel"!==o.type&&t.get().filter((function(e){return e.target.isEqualNode(o.target)})).each((function(){n.get()?o.preventDefault():e.fire("tap",Re(Re({},o),{type:"tap"}));}));}),!0);},Iw=function(e,t){return ye(e,t.nodeName)},Mw=function(e,t){return !!Fn(t)||!!Dn(t)&&(!Iw(e,t)&&!Gf(t))},Fw=function(e,t){if(Fn(t)){if(0===t.nodeValue.length)return !0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||Iw(e,t.nextSibling)))return !0}return !1},Uw=function(e){var t,n,r,o=e.dom,i=e.selection,a=e.schema,u=a.getBlockElements(),c=i.getStart(),s=e.getBody(),f=ts(e);if(c&&Dn(c)&&f){var l=s.nodeName.toLowerCase();if(a.isValidChild(l,f.toLowerCase())&&!function(e,t,n){return j(kg(Rt.fromDom(n),Rt.fromDom(t)),(function(t){return Iw(e,t.dom)}))}(u,s,c)){var d=i.getRng(),m=d.startContainer,g=d.startOffset,p=d.endContainer,h=d.endOffset,v=ym(e);for(c=s.firstChild;c;)if(Mw(u,c)){if(Fw(u,c)){n=c,c=c.nextSibling,o.remove(n);continue}t||(t=o.create(f,ns(e)),c.parentNode.insertBefore(t,c),r=!0),n=c,c=c.nextSibling,t.appendChild(n);}else t=null,c=c.nextSibling;r&&v&&(d.setStart(m,g),d.setEnd(p,h),i.setRng(d),e.nodeChanged());}}},zw=function(e,t){t.hasAttribute("data-mce-caret")&&(Po(t),function(e){e.selection.setRng(e.selection.getRng());}(e),e.selection.scrollIntoView(t));},Hw=function(e,t){var n=function(e){return Jr(Rt.fromDom(e.getBody()),"*[data-mce-caret]").map((function(e){return e.dom})).getOrNull()}(e);if(n)return "compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void zw(e,n)):void(Ao(n)&&(zw(e,n),e.undoManager.add()))},jw=$n,Vw=function(e,t,n){var r=kf(e.getBody()),o=_(lf,1===t?r.next:r.prev);if(n.collapsed&&function(e){return ""!==ts(e)}(e)){var i=e.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(Ac.fromRangeStart(n))){var a=function(e){var t=e.dom.create(ts(e));return (!wt.ie||wt.ie>=11)&&(t.innerHTML='<br data-mce-bogus="1">'),t}(e);1===t?e.$(i).after(a):e.$(i).before(a),e.selection.select(a,!0),e.selection.collapse();}}},qw=function(e,t){var n=t?Rc.Forwards:Rc.Backwards,r=e.selection.getRng();return function(e,t,n){return tw(t,e,n,bg,yg,jw)}(n,e,r).orThunk((function(){return Vw(e,n,r),I.none()}))},$w=function(e,t){var n=t?1:-1,r=e.selection.getRng();return function(e,t,n){return nw(t,e,n,(function(e){return bg(e)||hg(e)}),(function(e){return yg(e)||vg(e)}),jw)}(n,e,r).orThunk((function(){return Vw(e,n,r),I.none()}))},Ww=function(e,t){return qw(e,t).exists((function(t){return Zx(e,t),!0}))},Kw=function(e,t){return $w(e,t).exists((function(t){return Zx(e,t),!0}))},Xw=function(e,t){return ow(e,t,t?yg:bg)},Yw=function(e){return H(["figcaption"],It(e))},Gw=function(e){var t=document.createRange();return t.setStartBefore(e.dom),t.setEndBefore(e.dom),t},Jw=function(e,t,n){n?mn(e,t):dn(e,t);},Qw=function(e,t,n,r){return ""===t?function(e,t){var n=Rt.fromTag("br");return Jw(e,n,t),Gw(n)}(e,r):function(e,t,n,r){var o=Rt.fromTag(n),i=Rt.fromTag("br");return Zn(o,r),mn(o,i),Jw(e,o,t),Gw(i)}(e,r,t,n)},Zw=function(e,t,n){return t?function(e,t){return Ox(e,t).breakAt.isNone()}(e.dom,n):function(e,t){return Tx(e,t).breakAt.isNone()}(e.dom,n)},eS=function(e,t){var n=Rt.fromDom(e.getBody()),r=Ac.fromRangeStart(e.selection.getRng()),o=ts(e),i=ns(e);return function(e,t){var n=_(Bt,t);return Xr(Rt.fromDom(e.container()),so,n).filter(Yw)}(r,n).exists((function(){if(Zw(n,t,r)){var a=Qw(n,o,i,t);return e.selection.setRng(a),!0}return !1}))},tS=function(e,t){return !!e.selection.isCollapsed()&&eS(e,t)},nS=function(e,t){return Z(function(e){return V(e,(function(e){return Re({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:x},e)}))}(e),(function(e){return function(e,t){return t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey}(e,t)?[e]:[]}))},rS=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(null,t)}},oS=function(e,t){return J(nS(e,t),(function(e){return e.action()}))},iS=function(e,t){var n=t?Rc.Forwards:Rc.Backwards,r=e.selection.getRng();return tw(e,n,r,gg,pg,Kn).exists((function(t){return Zx(e,t),!0}))},aS=function(e,t){var n=t?1:-1,r=e.selection.getRng();return nw(e,n,r,gg,pg,Kn).exists((function(t){return Zx(e,t),!0}))},uS=function(e,t){return ow(e,t,t?pg:gg)},cS=function(e,t,n,r,o){var i=Mu(Rt.fromDom(n),"td,th,caption").map((function(e){return e.dom})),a=K(function(e,t){return Z(t,(function(t){var n=function(e,t){return {left:e.left-t,top:e.top-t,right:e.right+2*t,bottom:e.bottom+2*t,width:e.width+t,height:e.height+t}}(ec(t.getBoundingClientRect()),-1);return [{x:n.left,y:e(n),cell:t},{x:n.right,y:e(n),cell:t}]}))}(e,i),(function(e){return t(e,o)}));return function(e,t,n){return Y(e,(function(e,r){return e.fold((function(){return I.some(r)}),(function(e){var o=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-n)),i=Math.sqrt(Math.abs(r.x-t)+Math.abs(r.y-n));return I.some(i<o?r:e)}))}),I.none())}(a,r,o).map((function(e){return e.cell}))},sS=_(cS,(function(e){return e.bottom}),(function(e,t){return e.y<t})),fS=_(cS,(function(e){return e.top}),(function(e,t){return e.y>t})),lS=function(e,t){return ie(t.getClientRects()).bind((function(t){return sS(e,t.left,t.top)})).bind((function(e){return Dx(If(n=e).map((function(e){return Tx(n,e).positions.concat(e)})).getOr([]),t);var n;}))},dS=function(e,t){return ae(t.getClientRects()).bind((function(t){return fS(e,t.left,t.top)})).bind((function(e){return Dx(Lf(n=e).map((function(e){return [e].concat(Ox(n,e).positions)})).getOr([]),t);var n;}))},mS=function(e,t,n){var r=e(t,n);return function(e){return e.breakType===Cx.Wrap&&0===e.positions.length}(r)||!jn(n.getNode())&&function(e){return e.breakType===Cx.Br&&1===e.positions.length}(r)?!function(e,t,n){return n.breakAt.exists((function(n){return e(t,n).breakAt.isSome()}))}(e,t,r):r.breakAt.isNone()},gS=_(mS,Tx),pS=_(mS,Ox),hS=function(e,t,n,r){var o=e.selection.getRng(),i=t?1:-1;return !(!Fs()||!function(e,t,n){var r=Ac.fromRangeStart(t);return Of(!e,n).exists((function(e){return e.isEqual(r)}))}(t,o,n))&&(_C(i,e,n,!t,!1).each((function(t){Zx(e,t);})),!0)},vS=function(e,t){var n=t.getNode(e);return Dn(n)&&"TABLE"===n.nodeName?I.some(n):I.none()},bS=function(e,t,n){var r=vS(!!t,n),o=!1===t;r.fold((function(){return Zx(e,n.toRange())}),(function(r){return Of(o,e.getBody()).filter((function(e){return e.isEqual(n)})).fold((function(){return Zx(e,n.toRange())}),(function(o){return function(e,t,n,r){var o=ts(t);o?t.undoManager.transact((function(){var r=Rt.fromTag(o);Zn(r,ns(t)),mn(r,Rt.fromTag("br")),e?ln(Rt.fromDom(n),r):fn(Rt.fromDom(n),r);var i=t.dom.createRng();i.setStart(r.dom,0),i.setEnd(r.dom,0),Zx(t,i);})):Zx(t,r.toRange());}(t,e,r,n)}))}));},yS=function(e,t,n,r){var o=e.selection.getRng(),i=Ac.fromRangeStart(o),a=e.getBody();if(!t&&gS(r,i)){var u=function(e,t,n){return lS(t,n).orThunk((function(){return ie(n.getClientRects()).bind((function(n){return Rx(Bx(e,Ac.before(t)),n.left)}))})).getOr(Ac.before(t))}(a,n,i);return bS(e,t,u),!0}if(t&&pS(r,i)){u=function(e,t,n){return dS(t,n).orThunk((function(){return ie(n.getClientRects()).bind((function(n){return Rx(Px(e,Ac.after(t)),n.left)}))})).getOr(Ac.after(t))}(a,n,i);return bS(e,t,u),!0}return !1},CS=function(e,t,n){return I.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind((function(r){return I.from(e.dom.getParent(r,"table")).map((function(o){return n(e,t,o,r)}))})).getOr(!1)},xS=function(e,t){return CS(e,t,hS)},wS=function(e,t){return CS(e,t,yS)},SS=function(e,t){e.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(e,t,n){var r=mt().os;oS([{keyCode:od.RIGHT,action:rS(Ww,e,!0)},{keyCode:od.LEFT,action:rS(Ww,e,!1)},{keyCode:od.UP,action:rS(Kw,e,!1)},{keyCode:od.DOWN,action:rS(Kw,e,!0)},{keyCode:od.RIGHT,action:rS(xS,e,!0)},{keyCode:od.LEFT,action:rS(xS,e,!1)},{keyCode:od.UP,action:rS(wS,e,!1)},{keyCode:od.DOWN,action:rS(wS,e,!0)},{keyCode:od.RIGHT,action:rS(iS,e,!0)},{keyCode:od.LEFT,action:rS(iS,e,!1)},{keyCode:od.UP,action:rS(aS,e,!1)},{keyCode:od.DOWN,action:rS(aS,e,!0)},{keyCode:od.RIGHT,action:rS(sw,e,t,!0)},{keyCode:od.LEFT,action:rS(sw,e,t,!1)},{keyCode:od.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:rS(dw,e,t)},{keyCode:od.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:rS(mw,e,t)},{keyCode:od.UP,action:rS(tS,e,!1)},{keyCode:od.DOWN,action:rS(tS,e,!0)}],n).each((function(e){n.preventDefault();}));}(e,t,n);}));},kS=function(e,t){e.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(e,t,n){oS([{keyCode:od.BACKSPACE,action:rS(Tw,e,!1)},{keyCode:od.BACKSPACE,action:rS(VC,e,!1)},{keyCode:od.DELETE,action:rS(VC,e,!0)},{keyCode:od.BACKSPACE,action:rS(PC,e,!1)},{keyCode:od.DELETE,action:rS(PC,e,!0)},{keyCode:od.BACKSPACE,action:rS(bw,e,t,!1)},{keyCode:od.DELETE,action:rS(bw,e,t,!0)},{keyCode:od.BACKSPACE,action:rS(qp,e,!1)},{keyCode:od.DELETE,action:rS(qp,e,!0)},{keyCode:od.BACKSPACE,action:rS(qC,e,!1)},{keyCode:od.DELETE,action:rS(qC,e,!0)},{keyCode:od.BACKSPACE,action:rS(kw,e,!1)},{keyCode:od.DELETE,action:rS(kw,e,!0)},{keyCode:od.BACKSPACE,action:rS(kC,e,!1)},{keyCode:od.DELETE,action:rS(kC,e,!0)},{keyCode:od.BACKSPACE,action:rS(CC,e,!1)},{keyCode:od.DELETE,action:rS(CC,e,!0)},{keyCode:od.BACKSPACE,action:rS(ww,e,!1)},{keyCode:od.DELETE,action:rS(ww,e,!0)}],n).each((function(e){n.preventDefault();}));}(e,t,n);})),e.on("keyup",(function(t){!1===t.isDefaultPrevented()&&function(e,t){oS([{keyCode:od.BACKSPACE,action:rS(jC,e)},{keyCode:od.DELETE,action:rS(jC,e)}],t);}(e,t);}));},NS=function(e,t){var n,r=t,o=e.dom,i=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var a=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);a&&/^(UL|OL|DL)$/.test(a.nodeName)&&t.insertBefore(o.doc.createTextNode(yo),t.firstChild);}var u=o.createRng();if(t.normalize(),t.hasChildNodes()){for(var c=new ao(t,t);n=c.current();){if(Fn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}r=n,n=c.next();}n||(u.setStart(r,0),u.setEnd(r,0));}else jn(t)?t.nextSibling&&o.isBlock(t.nextSibling)?(u.setStartBefore(t),u.setEndBefore(t)):(u.setStartAfter(t),u.setEndAfter(t)):(u.setStart(t,0),u.setEnd(t,0));e.selection.setRng(u),Vd(e,u);}},ES=function(e){return I.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},_S=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},AS=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},RS=function(e){var t=e.parentNode;return /^(LI|DT|DD)$/.test(t.nodeName)?t:e},DS=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Dn(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},TS=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;AS(u=n)&&AS(u.parentNode)&&(o="LI");var c=o?t(o):i.create("BR");if(DS(n,r,!0)&&DS(n,r,!1))if(_S(n,"LI")){var s=RS(n);i.insertAfter(c,s),!function(e){var t;return (null===(t=e.parentNode)||void 0===t?void 0:t.firstChild)===e}(n)?i.remove(n):i.remove(s);}else i.replace(c,n);else if(DS(n,r,!0))_S(n,"LI")?(i.insertAfter(c,RS(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n),i.remove(r);else if(DS(n,r,!1))i.insertAfter(c,RS(n)),i.remove(r);else {n=RS(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var l=f.extractContents();"LI"===o&&function(e,t){return e.firstChild&&e.firstChild.nodeName===t}(l,"LI")?(c=l.firstChild,i.insertAfter(l,n)):(i.insertAfter(l,n),i.insertAfter(c,n)),i.remove(r);}NS(e,c);}},OS=function(e,t){return t&&"A"===t.nodeName&&e.isEmpty(t)},BS=function(e){e.innerHTML='<br data-mce-bogus="1">';},PS=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},LS=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)},IS=function(e,t,n){return !1===Fn(t)?n:e?1===n&&t.data.charAt(n-1)===Co?0:n:n===t.data.length-1&&t.data.charAt(n)===Co?t.data.length:n},MS=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},FS=function(e,t){var n=ts(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&function(e,t,n){var r=e.dom;I.from(n.style).map(r.parseStyle).each((function(e){var n=ur(Rt.fromDom(t)),o=Re(Re({},n),e);r.setStyles(t,o);}));var o=I.from(n.class).map((function(e){return e.split(/\s+/)})),i=I.from(t.className).map((function(e){return K(e.split(/\s+/),(function(e){return ""!==e}))}));Yn(o,i,(function(e,n){var o=K(n,(function(t){return !H(e,t)})),i=De(De([],e,!0),o,!0);r.setAttrib(t,"class",i.join(" "));}));var a=["style","class"],u=he(n,(function(e,t){return !H(a,t)}));r.setAttribs(t,u);}(e,t,ns(e));},US=function(e,t){var n,r,o,i,a,u,c,s,f,l,d=e.dom,m=e.schema,g=m.getNonEmptyElements(),p=e.selection.getRng(),h=function(t){var n,o,a,u=r,c=m.getTextInlineElements();if(a=n=t||"TABLE"===s||"HR"===s?d.create(t||f):i.cloneNode(!1),!1===function(e){return e.getParam("keep_styles",!0)}(e))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[u.nodeName]){if(Ff(u)||Gf(u))continue;o=u.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(a=o,n.appendChild(o));}}while((u=u.parentNode)&&u!==x);return FS(e,n),BS(a),n},v=function(e){var t,n,a=IS(e,r,o);if(Fn(r)&&(e?a>0:a<r.nodeValue.length))return !1;if(r.parentNode===i&&l&&!e)return !0;if(e&&Dn(r)&&r===i.firstChild)return !0;if(PS(r,"TABLE")||PS(r,"HR"))return l&&!e||!l&&e;var u=new ao(r,i);for(Fn(r)&&(e&&0===a?u.prev():e||a!==r.nodeValue.length||u.next());t=u.current();){if(Dn(t)){if(!t.getAttribute("data-mce-bogus")&&(n=t.nodeName.toLowerCase(),g[n]&&"br"!==n))return !1}else if(Fn(t)&&!Xo(t.nodeValue))return !1;e?u.prev():u.next();}return !0},b=function(){a=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==w?h(f):h(),function(e){return e.getParam("end_container_on_empty_block",!1)}(e)&&LS(d,c)&&d.isEmpty(i)?a=d.split(c,i):d.insertAfter(a,i),NS(e,a);};bd(d,p).each((function(e){p.setStart(e.startContainer,e.startOffset),p.setEnd(e.endContainer,e.endOffset);})),r=p.startContainer,o=p.startOffset,f=ts(e);var y=!(!t||!t.shiftKey),C=!(!t||!t.ctrlKey);Dn(r)&&r.hasChildNodes()&&(l=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=l&&Fn(r)?r.nodeValue.length:0);var x=MS(d,r);if(x){(f&&!y||!f&&y)&&(r=function(e,t,n,r,o){var i,a,u,c,s,f,l=t||"P",d=e.dom,m=MS(d,r);if(!(a=d.getParent(r,d.isBlock))||!LS(d,a)){if(f=(a=a||m)===e.getBody()||function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}(a)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=d.create(l),FS(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==a;)c=c.parentNode;for(;c&&!d.isBlock(c);)u=c,c=c.previousSibling;if(u&&e.schema.isValidChild(f,l.toLowerCase())){for(i=d.create(l),FS(e,i),u.parentNode.insertBefore(i,u),c=u;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o);}}return r}(e,f,p,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var w=c?c.nodeName.toUpperCase():"";"LI"!==w||C||(i=c,c=c.parentNode,s=w),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?TS(e,h,c,i,f):f&&i===e.getBody()||(f=f||"P",No(i)?(a=Po(i),d.isEmpty(i)&&BS(i),FS(e,a),NS(e,a)):v()?b():v(!0)?(a=i.parentNode.insertBefore(h(),i),NS(e,PS(i,"HR")?a:i)):(n=function(e){var t=e.cloneRange();return t.setStart(e.startContainer,IS(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,IS(!1,e.endContainer,e.endOffset)),t}(p).cloneRange(),n.setEndAfter(i),function(e){q(Iu(Rt.fromDom(e),zt),(function(e){var t=e.dom;t.nodeValue=wo(t.nodeValue);}));}(u=n.extractContents()),function(e){do{Fn(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;}while(e)}(u),a=u.firstChild,d.insertAfter(u,i),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Dn(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o);}for(r=i.length;r--;)(!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||OS(e,o))&&e.remove(o);}}(d,g,a),function(e,t){t.normalize();var n=t.lastChild;n&&!/^(left|right)$/gi.test(e.getStyle(n,"float",!0))||e.add(t,"br");}(d,i),d.isEmpty(i)&&BS(i),a.normalize(),d.isEmpty(a)?(d.remove(a),b()):(FS(e,a),NS(e,a))),d.setAttrib(a,"id",""),e.fire("NewBlock",{newBlock:a}));}},zS=function(e,t,n){var r=e.dom.createRng();n?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)),e.selection.setRng(r),Vd(e,r);},HS=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();bd(i,a).each((function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset);}));var u=a.startOffset,c=a.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=u>c.childNodes.length-1;c=c.childNodes[Math.min(u,c.childNodes.length-1)]||c,u=s&&3===c.nodeType?c.nodeValue.length:0;}var f=i.getParent(c,i.isBlock),l=f?i.getParent(f.parentNode,i.isBlock):null,d=l?l.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(f=l),c&&3===c.nodeType&&u>=c.nodeValue.length&&(function(e,t,n){for(var r,o=new ao(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return !0}(e.schema,c,f)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Tc(i,a,n),zS(e,n,r),e.undoManager.add();},jS=function(e,t){var n=Rt.fromTag("br");fn(Rt.fromDom(t),n),e.undoManager.add();},VS=function(e,t){qS(e.getBody(),t)||ln(Rt.fromDom(t),Rt.fromTag("br"));var n=Rt.fromTag("br");ln(Rt.fromDom(t),n),zS(e,n.dom,!1),e.undoManager.add();},qS=function(e,t){return n=Ac.after(t),!!jn(n.getNode())||Bf(e,Ac.after(t)).map((function(e){return jn(e.getNode())})).getOr(!1);var n;},$S=function(e){return e&&"A"===e.nodeName&&"href"in e},WS=function(e){return e.fold(T,$S,$S,T)},KS=function(e,t){t.fold(x,_(jS,e),_(VS,e),x);},XS=function(e,t){var n=function(e){var t=_(Zy,e),n=Ac.fromRangeStart(e.selection.getRng());return lx(t,e.getBody(),n).filter(WS)}(e);n.isSome()?n.each(_(KS,e)):HS(e,t);},YS=function(e,t){return ES(e).filter((function(e){return t.length>0&&Tt(Rt.fromDom(e),t)})).isSome()},GS=kr([{br:[]},{block:[]},{none:[]}]),JS=function(e,t){return function(e){return YS(e,function(e){return e.getParam("no_newline_selector","")}(e))}(e)},QS=function(e){return function(t,n){return ""===ts(t)===e}},ZS=function(e){return function(t,n){return function(e){return ES(e).filter((function(e){return po(Rt.fromDom(e))})).isSome()}(t)===e}},ek=function(e,t){return function(n,r){var o=function(e){return ES(e).fold(k(""),(function(e){return e.nodeName.toUpperCase()}))}(n)===e.toUpperCase();return o===t}},tk=function(e){return ek("pre",e)},nk=function(e){return function(t,n){return function(e){return e.getParam("br_in_pre",!0)}(t)===e}},rk=function(e,t){return function(e){return YS(e,function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(e))}(e)},ok=function(e,t){return t},ik=function(e){var t=ts(e),n=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}(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},ak=function(e,t){return function(n,r){return Y(e,(function(e,t){return e&&t(n,r)}),!0)?I.some(t):I.none()}},uk=function(e,t){(function(e,t){return tx([ak([JS],GS.none()),ak([ek("summary",!0)],GS.br()),ak([tk(!0),nk(!1),ok],GS.br()),ak([tk(!0),nk(!1)],GS.block()),ak([tk(!0),nk(!0),ok],GS.block()),ak([tk(!0),nk(!0)],GS.br()),ak([ZS(!0),ok],GS.br()),ak([ZS(!0)],GS.block()),ak([QS(!0),ok,ik],GS.block()),ak([QS(!0)],GS.br()),ak([rk],GS.br()),ak([QS(!1),ok],GS.br()),ak([ik],GS.block())],[e,!(!t||!t.shiftKey)]).getOr(GS.none())})(e,t).fold((function(){XS(e,t);}),(function(){US(e,t);}),x);},ck=function(e){e.on("keydown",(function(t){t.keyCode===od.ENTER&&function(e,t){var n;t.isDefaultPrevented()||(t.preventDefault(),(n=e.undoManager).typing&&(n.typing=!1,n.add()),e.undoManager.transact((function(){!1===e.selection.isCollapsed()&&e.execCommand("Delete"),uk(e,t);})));}(e,t);}));},sk=function(e,t){e.on("keydown",(function(n){!1===n.isDefaultPrevented()&&function(e,t,n){oS([{keyCode:od.END,action:rS(Xw,e,!0)},{keyCode:od.HOME,action:rS(Xw,e,!1)},{keyCode:od.END,action:rS(uS,e,!0)},{keyCode:od.HOME,action:rS(uS,e,!1)},{keyCode:od.END,action:rS(gw,e,!0,t)},{keyCode:od.HOME,action:rS(gw,e,!1,t)}],n).each((function(e){n.preventDefault();}));}(e,t,n);}));},fk=mt().browser,lk=function(e){!function(e){var t=_u((function(){e.composing||Zg(e);}),0);fk.isIE()&&(e.on("keypress",(function(e){t.throttle();})),e.on("remove",(function(e){t.cancel();})));}(e),e.on("input",(function(t){!1===t.isComposing&&Zg(e);}));},dk=mt(),mk=function(e){return e.stopImmediatePropagation()},gk=function(e){return e.keyCode===od.PAGE_UP||e.keyCode===od.PAGE_DOWN},pk=function(e,t,n){n&&!e.get()?t.on("NodeChange",mk,!0):!n&&e.get()&&t.off("NodeChange",mk),e.set(n);},hk=function(e,t){if(!dk.os.isOSX()){var n=Cu(!1);e.on("keydown",(function(t){gk(t)&&pk(n,e,!0);})),e.on("keyup",(function(r){!1===r.isDefaultPrevented()&&function(e,t,n){oS([{keyCode:od.PAGE_UP,action:rS(gw,e,!1,t)},{keyCode:od.PAGE_DOWN,action:rS(gw,e,!0,t)}],n);}(e,t,r),gk(r)&&n.get()&&(pk(n,e,!1),e.nodeChanged());}));}},vk=function(e,t){var n=t.container(),r=t.offset();return Fn(n)?(n.insertData(r,e),I.some(Ac(n,r+e.length))):ff(t).map((function(n){var r=Rt.fromText(e);return t.isAtEnd()?ln(n,r):fn(n,r),Ac(r.dom,e.length)}))},bk=_(vk,yo),yk=_(vk," "),Ck=function(e,t){return function(n){return function(e,t){return !qg(t)&&($g(e,t)||jg(e,t)||Vg(e,t))}(e,n)?bk(t):yk(t)}},xk=function(e){var t=Ac.fromRangeStart(e.selection.getRng()),n=Rt.fromDom(e.getBody());if(e.selection.isCollapsed()){var r=_(Zy,e),o=Ac.fromRangeStart(e.selection.getRng());return lx(r,e.getBody(),o).bind(function(e){return function(t){return t.fold((function(t){return Pf(e.dom,Ac.before(t))}),(function(e){return Lf(e)}),(function(e){return If(e)}),(function(t){return Bf(e.dom,Ac.after(t))}))}}(n)).bind(Ck(n,t)).exists(function(e){return function(t){return e.selection.setRng(t.toRange()),e.nodeChanged(),!0}}(e))}return !1},wk=function(e){e.on("keydown",(function(t){!1===t.isDefaultPrevented()&&function(e,t){oS([{keyCode:od.SPACEBAR,action:rS(xk,e)}],t).each((function(e){t.preventDefault();}));}(e,t);}));},Sk=function(e){var t=lw(e);return function(e){e.on("keyup compositionstart",_(Hw,e));}(e),SS(e,t),kS(e,t),ck(e),wk(e),lk(e),sk(e,t),hk(e,t),t},kk=function(){function e(e){var t;this.lastPath=[],this.editor=e;var n=this;"onselectionchange"in e.getDoc()||e.on("NodeChange click mouseup keyup focus",(function(n){var r=e.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&sd(o,t)||e.fire("SelectionChange"),t=o;})),e.on("contextmenu",(function(){e.fire("SelectionChange");})),e.on("SelectionChange",(function(){var t=e.selection.getStart(!0);!t||!wt.range&&e.selection.isCollapsed()||jl(e)&&!n.isSameElementPath(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0});})),e.on("mouseup",(function(t){!t.isDefaultPrevented()&&jl(e)&&("IMG"===e.selection.getNode().nodeName?ro.setEditorTimeout(e,(function(){e.nodeChanged();})):e.nodeChanged());}));}return e.prototype.nodeChanged=function(e){var t,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(t=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(t,r)||(t=r),n=[],this.editor.dom.getParent(t,(function(e){if(e===r)return !0;n.push(e);})),(e=e||{}).element=t,e.parents=n,this.editor.fire("NodeChange",e));},e.prototype.isSameElementPath=function(e){var t,n=this.editor.$(e).parentsUntil(this.editor.getBody()).add(e);if(n.length===this.lastPath.length){for(t=n.length;t>=0&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1},e}(),Nk=function(e){!function(e){e.on("click",(function(t){e.dom.getParent(t.target,"details")&&t.preventDefault();}));}(e),function(e){e.parser.addNodeFilter("details",(function(e){q(e,(function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open");}));})),e.serializer.addNodeFilter("details",(function(e){q(e,(function(e){var t=e.attr("data-mce-open");e.attr("open",l(t)?t:null),e.attr("data-mce-open",null);}));}));}(e);},Ek=function(e){return Dn(e)&&mo(Rt.fromDom(e))},_k=function(e){e.on("click",(function(t){t.detail>=3&&function(e){var t=e.selection.getRng(),n=Ac.fromRangeStart(t),r=Ac.fromRangeEnd(t);if(Ac.isElementPosition(n)){var o=n.container();Ek(o)&&Lf(o).each((function(e){return t.setStart(e.container(),e.offset())}));}Ac.isElementPosition(r)&&(o=n.container(),Ek(o)&&If(o).each((function(e){return t.setEnd(e.container(),e.offset())})));e.selection.setRng(Wp(t));}(e);}));},Ak=function(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.documentElement,o=n.defaultView;return {top:t.top+o.pageYOffset-r.clientTop,left:t.left+o.pageXOffset-r.clientLeft}},Rk=function(e,t){return n=function(e){return e.inline?Ak(e.getBody()):{left:0,top:0}}(e),r=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}}(e),o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=Ak(e.getContentAreaContainer()),r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},o={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:o}(e);return {left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}return {left:t.pageX,top:t.pageY}}(e,t),{pageX:o.left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o;},Dk=$n,Tk=qn,Ok=function(e,t,n,r){var o=e.dom,i=t.cloneNode(!0);o.setStyles(i,{width:n,height:r}),o.setAttrib(i,"data-mce-selected",null);var a=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(a,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),o.setStyles(i,{margin:0,boxSizing:"border-box"}),a.appendChild(i),a},Bk=function(e){e&&e.parentNode&&e.parentNode.removeChild(e);},Pk=function(e,t){return function(n){if(function(e){return 0===e.button}(n)){var r=J(t.dom.getParents(n.target),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){for(var n=0;n<e.length;n++)if(e[n](t))return !0;return !1}}(Dk,Tk)).getOr(null);if(u=t.getBody(),Dk(c=r)&&c!==u){var o=t.dom.getPos(r),i=t.getBody(),a=t.getDoc().documentElement;e.set({element:r,dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(t.inline?i.scrollWidth:a.offsetWidth)-2,maxY:(t.inline?i.scrollHeight:a.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:r.offsetWidth,height:r.offsetHeight,ghost:Ok(t,r,r.offsetWidth,r.offsetHeight)});}}var u,c;}},Lk=function(e,t){return function(n){e.on((function(e){if(e.dragging){if(function(e,t,n){return t!==n&&!e.dom.isChildOf(t,n)&&!Dk(t)}(t,(a=t.selection,3===(u=a.getSel().getRangeAt(0).startContainer).nodeType?u.parentNode:u),e.element)){var r=(o=e.element,(i=o.cloneNode(!0)).removeAttribute("data-mce-selected"),i);t.fire("drop",{clientX:n.clientX,clientY:n.clientY}).isDefaultPrevented()||t.undoManager.transact((function(){Bk(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret();}));}t.fire("dragend");}var o,i,a,u;})),Ik(e);}},Ik=function(e){e.on((function(e){Bk(e.ghost);})),e.clear();},Mk=function(e){var t=Eu(),n=pu.DOM,r=document,o=Pk(t,e),i=function(e,t){var n=ro.throttle((function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n);}),0);return t.on("remove",n.stop),function(r){return e.on((function(e){var o,i,a=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(!e.dragging&&a>10){if(t.fire("dragstart",{target:e.element}).isDefaultPrevented())return;e.dragging=!0,t.focus();}if(e.dragging){var u=function(e,t){return {pageX:t.pageX-e.relX,pageY:t.pageY+5}}(e,Rk(t,r));o=e.ghost,i=t.getBody(),o.parentNode!==i&&i.appendChild(o),function(e,t,n,r,o,i){var a=0,u=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>o&&(a=t.pageX+n-o),t.pageY+r>i&&(u=t.pageY+r-i),e.style.width=n-a+"px",e.style.height=r-u+"px";}(e.ghost,u,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY);}}))}}(t,e),a=Lk(t,e),u=function(e,t){return function(){e.on((function(e){e.dragging&&t.fire("dragend");})),Ik(e);}}(t,e);e.on("mousedown",o),e.on("mousemove",i),e.on("mouseup",a),n.bind(r,"mousemove",i),n.bind(r,"mouseup",u),e.on("remove",(function(){n.unbind(r,"mousemove",i),n.unbind(r,"mouseup",u);})),e.on("keydown",(function(e){e.keyCode===od.ESC&&u();}));},Fk=function(e){Mk(e),function(e){e.on("drop",(function(t){var n=void 0!==t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(Dk(n)||"false"===e.dom.getContentEditableParent(n))&&t.preventDefault();}));}(e),function(e){return e.getParam("block_unsupported_drop",!0,"boolean")}(e)&&function(e){var t=function(t){if(!t.isDefaultPrevented()){var n=t.dataTransfer;n&&(H(n.types,"Files")||n.files.length>0)&&(t.preventDefault(),"drop"===t.type&&Sy(e,"Dropped file type is not supported"));}},n=function(n){dm(e,n.target)&&t(n);},r=function(){var r=pu.DOM,o=e.dom,i=document,a=e.inline?e.getBody():e.getDoc(),u=["drop","dragover"];q(u,(function(e){r.bind(i,e,n),o.bind(a,e,t);})),e.on("remove",(function(){q(u,(function(e){r.unbind(i,e,n),o.unbind(a,e,t);}));}));};e.on("init",(function(){ro.setEditorTimeout(e,r,0);}));}(e);},Uk=qn,zk=$n,Hk=function(e,t){return Zl(e.getBody(),t)},jk=function(e){var t,n=e.selection,r=e.dom,o=r.isBlock,i=e.getBody(),a=Ms(e,i,o,(function(){return ym(e)})),u="sel-"+r.uniqueId(),c="data-mce-selected",s=function(e){return e!==i&&(zk(e)||Kn(e))&&r.isChildOf(e,i)},f=function(e){return bg(e)||yg(e)||gg(e)||pg(e)},l=function(e){e&&n.setRng(e);},d=n.getRng,m=function(t,r,o,i){return void 0===i&&(i=!0),e.fire("ShowCaret",{target:r,direction:t,before:o}).isDefaultPrevented()?null:(i&&n.scrollIntoView(r,-1===t),a.show(o,r))},g=function(e){return _o(e)||Oo(e)||Bo(e)},p=function(e){return g(e.startContainer)||g(e.endContainer)},h=function(t){var n=e.schema.getShortEndedElements(),o=r.createRng(),i=t.startContainer,a=t.startOffset,u=t.endContainer,c=t.endOffset;return ye(n,i.nodeName.toLowerCase())?0===a?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,a),ye(n,u.nodeName.toLowerCase())?0===c?o.setEndBefore(u):o.setEndAfter(u):o.setEnd(u,c),o},b=function(o){var i=o.cloneNode(!0),a=e.fire("ObjectSelected",{target:o,targetClone:i});if(a.isDefaultPrevented())return null;var s=function(t,o,i){var a=e.$,c=Jr(Rt.fromDom(e.getBody()),"#"+u).fold((function(){return a([])}),(function(e){return a([e.dom])}));0===c.length&&(c=a('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",u)).appendTo(e.getBody());var s=r.createRng();o===i&&wt.ie?(c.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(o),s.setStartAfter(c[0].firstChild.firstChild),s.setEndAfter(o)):(c.empty().append(yo).append(o).append(yo),s.setStart(c[0].firstChild,1),s.setEnd(c[0].lastChild,0)),c.css({top:r.getPos(t,e.getBody()).y}),c[0].focus();var f=n.getSel();return f.removeAllRanges(),f.addRange(s),s}(o,a.targetClone,i),f=Rt.fromDom(o);return q(Mu(Rt.fromDom(e.getBody()),"*[data-mce-selected]"),(function(e){Bt(f,e)||nr(e,c);})),r.getAttrib(o,c)||o.setAttribute(c,"1"),t=o,x(),s},y=function(e,t){if(!e)return null;if(e.collapsed){if(!p(e)){var n=t?1:-1,o=sf(n,i,e),a=o.getNode(!t);if(zs(a))return m(n,a,!!t&&!o.isAtEnd(),!1);var u=o.getNode(t);if(zs(u))return m(n,u,!t&&!o.isAtEnd(),!1)}return null}var c=e.startContainer,f=e.startOffset,l=e.endOffset;if(3===c.nodeType&&0===f&&zk(c.parentNode)&&(c=c.parentNode,f=r.nodeIndex(c),c=c.parentNode),1!==c.nodeType)return null;if(l===f+1&&c===e.endContainer){var d=c.childNodes[f];if(s(d))return b(d)}return null},C=function(){t&&t.removeAttribute(c),Jr(Rt.fromDom(e.getBody()),"#"+u).each(hn),t=null;},x=function(){a.hide();};return wt.ceFalse&&!Gv(e)&&function(){e.on("mouseup",(function(t){var n=d();n.collapsed&&hy(e,t.clientX,t.clientY)&&RC(e,n,!1).each(l);})),e.on("click",(function(t){var o=Hk(e,t.target);o&&(zk(o)&&(t.preventDefault(),e.focus()),Uk(o)&&r.isChildOf(o,n.getNode())&&C());})),e.on("blur NewBlock",C),e.on("ResizeWindow FullscreenStateChanged",a.reposition);var c=function(t,n){var i,a,u=r.getParent(t,o),c=r.getParent(n,o);return !v(u)&&(!(t===c||!r.isChildOf(u,c)||!1!==zk(Hk(e,u)))||!r.isChildOf(c,u)&&(i=u,a=c,!(r.getParent(i,o)===r.getParent(a,o)))&&function(e){var t=e.firstChild;if(v(t))return !1;var n=Ac.before(t);if(jn(n.getNode())&&1===e.childNodes.length)return !f(n);var r=kf(e).next(n);return r&&!f(r)}(u))};e.on("tap",(function(t){var n=t.target,r=Hk(e,n);zk(r)?(t.preventDefault(),AC(e,r).each(y)):s(n)&&AC(e,n).each(y);}),!0),e.on("mousedown",(function(t){var o=t.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==hy(e,t.clientX,t.clientY)){var a=Hk(e,o);if(a)zk(a)?(t.preventDefault(),AC(e,a).each(y)):(C(),Uk(a)&&t.shiftKey||ed(t.clientX,t.clientY,n.getRng())||(x(),n.placeCaretAt(t.clientX,t.clientY)));else if(s(o))AC(e,o).each(y);else if(!1===zs(o)){C(),x();var u=Qx(i,t.clientX,t.clientY);if(u&&!c(o,u.node)){t.preventDefault();var f=m(1,u.node,u.before,!1);l(f),e.getBody().focus();}}}})),e.on("keypress",(function(e){od.modifierPressed(e)||zk(n.getNode())&&e.preventDefault();})),e.on("GetSelectionRange",(function(e){var n=e.range;if(t){if(!t.parentNode)return void(t=null);(n=n.cloneRange()).selectNode(t),e.range=n;}})),e.on("SetSelectionRange",(function(e){e.range=h(e.range);var t=y(e.range,e.forward);t&&(e.range=t);})),e.on("AfterSetSelectionRange",(function(e){var t,n=e.range,o=n.startContainer.parentNode;p(n)||"mcepastebin"===o.id||x(),t=o,r.hasClass(t,"mce-offscreen-selection")||C();})),e.on("copy",(function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!wt.ie){var o=(t=r.get(u))?t.getElementsByTagName("*")[0]:t;o&&(e.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText));}})),Fk(e),function(e){var t=_u((function(){if(!e.removed&&e.getBody().contains(document.activeElement)){var t=e.selection.getRng();if(t.collapsed){var n=DC(e,t,!1);e.selection.setRng(n);}}}),0);e.on("focus",(function(){t.throttle();})),e.on("blur",(function(){t.cancel();}));}(e),function(e){e.on("init",(function(){e.on("focusin",(function(t){var n=t.target;if(Kn(n)){var r=Zl(e.getBody(),n),o=$n(r)?r:n;e.selection.getNode()!==o&&AC(e,o).each((function(t){return e.selection.setRng(t)}));}}));}));}(e);}(),{showCaret:m,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Po(e),l(d()),n.scrollIntoView(e));},hideFakeCaret:x,destroy:function(){a.destroy(),t=null;}}},Vk=function(e){var t,n,r=_t.each,o=od.BACKSPACE,i=od.DELETE,a=e.dom,u=e.selection,c=e.parser,s=wt.gecko,f=wt.ie,l=wt.webkit,d="data:text/mce-internal,",m=f?"Text":"URL",g=function(t,n){try{e.getDoc().execCommand(t,!1,n);}catch(e){}},p=function(e){return e.isDefaultPrevented()},h=function(){var t=function(e){var t=a.create("body"),n=e.cloneContents();return t.appendChild(n),u.serializer.serialize(t,{format:"html"})};e.on("keydown",(function(n){var r,u,c=n.keyCode;if(!p(n)&&(c===i||c===o)){if(r=e.selection.isCollapsed(),u=e.getBody(),r&&!a.isEmpty(u))return;if(!r&&!function(n){var r=t(n),o=a.createRng();return o.selectNode(e.getBody()),r===t(o)}(e.selection.getRng()))return;n.preventDefault(),e.setContent(""),u.firstChild&&a.isBlock(u.firstChild)?e.selection.setCursorLocation(u.firstChild,0):e.selection.setCursorLocation(u,0),e.nodeChanged();}}));},v=function(){e.shortcuts.add("meta+a",null,"SelectAll");},b=function(){e.inline||a.bind(e.getDoc(),"mousedown mouseup",(function(t){var n;if(t.target===e.getDoc().documentElement)if(n=u.getRng(),e.getBody().focus(),"mousedown"===t.type){if(_o(n.startContainer))return;u.placeCaretAt(t.clientX,t.clientY);}else u.setRng(n);}));},y=function(){Range.prototype.getClientRects||e.on("mousedown",(function(t){if(!p(t)&&"HTML"===t.target.nodeName){var n=e.getBody();n.blur(),ro.setEditorTimeout(e,(function(){n.focus();}));}}));},C=function(){e.on("click",(function(t){var n=t.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(t.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(t.preventDefault(),u.select(n));}));},w=function(){e.on("keydown",(function(e){if(!p(e)&&e.keyCode===o&&u.isCollapsed()&&0===u.getRng().startOffset){var t=u.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}}));},S=function(){(function(e){return e.getParam("readonly")})(e)||e.on("BeforeExecCommand mousedown",(function(){g("StyleWithCSS",!1),g("enableInlineTableEditing",!1),ps(e)||g("enableObjectResizing",!1);}));},k=function(){e.on("SetContent ExecCommand",(function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||r(a.select("a"),(function(e){var t=e.parentNode,n=a.getRoot();if(t.lastChild===e){for(;t&&!a.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode;}a.add(t,"br",{"data-mce-bogus":1});}}));}));},N=function(){e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}");},E=function(){e.inline||e.on("keydown",(function(){document.activeElement===document.body&&e.getWin().focus();}));},_=function(){e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",(function(t){var n;if("HTML"===t.target.nodeName){if(wt.ie>11)return void e.getBody().focus();n=e.selection.getRng(),e.getBody().focus(),e.selection.setRng(n),e.selection.normalize(),e.nodeChanged();}})));},A=function(){wt.mac&&e.on("keydown",(function(t){!od.metaKeyPressed(t)||t.shiftKey||37!==t.keyCode&&39!==t.keyCode||(t.preventDefault(),e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary"));}));},R=function(){e.on("click",(function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)})),e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}");},D=function(){e.on("init",(function(){e.dom.bind(e.getBody(),"submit",(function(e){e.preventDefault();}));}));},T=function(){e.on("dragstart",(function(t){!function(t){var n,r;t.dataTransfer&&(e.selection.isCollapsed()&&"IMG"===t.target.tagName&&u.select(t.target),(n=e.selection.getContent()).length>0&&(r=d+escape(e.id)+","+escape(n),t.dataTransfer.setData(m,r)));}(t);})),e.on("drop",(function(t){if(!p(t)){var n=function(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(m))&&t.indexOf(d)>=0?(t=t.substr(d.length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}(t);if(n&&n.id!==e.id){t.preventDefault();var r=cd(t.x,t.y,e.getDoc());u.setRng(r),o=n.html,i=!0,e.queryCommandSupported("mceInsertClipboardContent")?e.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):e.execCommand("mceInsertContent",!1,o);}}var o,i;}));},O=x;return Gv(e)?(l&&(b(),C(),D(),v(),wt.iOS&&(E(),_(),R())),s&&(y(),S(),N(),A())):(e.on("keydown",(function(t){var n,r;if(!p(t)&&t.keyCode===od.BACKSPACE){var o=(n=u.getRng()).startContainer,i=n.startOffset,c=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==c;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(e.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),u.setRng(n));}}})),h(),wt.windowsPhone||e.on("keyup focusin mouseup",(function(e){od.modifierPressed(e)||u.normalize();}),!0),l&&(b(),C(),ts(e)&&e.on("init",(function(){g("DefaultParagraphSeparator",ts(e));})),D(),w(),c.addNodeFilter("br",(function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove();})),wt.iOS?(E(),_(),R()):v()),wt.ie>=11&&(_(),w()),wt.ie&&(v(),g("AutoUrlDetect",!1),T()),s&&(e.on("keydown",(function(t){if(!p(t)&&t.keyCode===o){if(!e.getBody().getElementsByTagName("hr").length)return;if(u.isCollapsed()&&0===u.getRng().startOffset){var n=u.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void t.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),t.preventDefault());}}})),y(),t=function(){var t=a.getAttribs(u.getStart().cloneNode(!1));return function(){var n=u.getStart();n!==e.getBody()&&(a.setAttrib(n,"style",null),r(t,(function(e){n.setAttributeNode(e.cloneNode(!0));})));}},n=function(){return !u.isCollapsed()&&a.getParent(u.getStart(),a.isBlock)!==a.getParent(u.getEnd(),a.isBlock)},e.on("keypress",(function(r){var o;if(!p(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=t(),e.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),a.bind(e.getDoc(),"cut",(function(r){var o;!p(r)&&n()&&(o=t(),ro.setEditorTimeout(e,(function(){o();})));})),S(),k(),N(),A(),w())),{refreshContentEditable:O,isHidden:function(){if(!s||e.removed)return !1;var t=e.selection.getSel();return !t||!t.rangeCount||0===t.rangeCount}}},qk=pu.DOM,$k=function(e){return e.inline?e.getElement().nodeName.toLowerCase():void 0},Wk=function(e){return he(e,(function(e){return !1===h(e)}))},Kk=function(e){var t=e.settings,n=e.editorUpload.blobCache;return Wk({allow_conditional_comments:t.allow_conditional_comments,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_html_in_named_anchor:t.allow_html_in_named_anchor,allow_script_urls:t.allow_script_urls,allow_unsafe_link_target:t.allow_unsafe_link_target,convert_fonts_to_spans:t.convert_fonts_to_spans,fix_list_elements:t.fix_list_elements,font_size_legacy_values:t.font_size_legacy_values,forced_root_block:t.forced_root_block,forced_root_block_attrs:t.forced_root_block_attrs,padd_empty_with_br:t.padd_empty_with_br,preserve_cdata:t.preserve_cdata,remove_trailing_brs:t.remove_trailing_brs,inline_styles:t.inline_styles,root_name:$k(e),validate:!0,blob_cache:n,document:e.getDoc(),images_dataimg_filter:t.images_dataimg_filter})},Xk=function(e){var t=e.dom.getRoot();e.inline||jl(e)&&e.selection.getStart(!0)!==t||Lf(t).each((function(t){var n=t.getNode(),r=Ln(n)?Lf(n).getOr(t):t;wt.browser.isIE()?function(e,t){var n=Rt.fromDom(e.getBody()),r=(nm(e)?I.from(t):I.none()).map(rm).filter(tm(n));e.bookmark=r.isSome()?r:e.bookmark;}(e,r.toRange()):e.selection.setRng(r.toRange());}));},Yk=function(e){e.bindPendingEventDelegates(),e.initialized=!0,function(e){e.fire("Init");}(e),e.focus(!0),Xk(e),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),function(e){e.settings.auto_focus&&ro.setEditorTimeout(e,(function(){var t;(t=!0===e.settings.auto_focus?e:e.editorManager.get(e.settings.auto_focus)).destroyed||t.focus();}),100);}(e);},Gk=function(e){return e.inline?e.ui.styleSheetLoader:e.dom.styleSheetLoader},Jk=function(e){var t=Gk(e),n=gs(e),r=e.contentCSS,o=function(){t.unloadAll(r),e.inline||e.ui.styleSheetLoader.unloadAll(n);},i=function(){e.removed?o():e.on("remove",o);};if(e.contentStyles.length>0){var a="";_t.each(e.contentStyles,(function(e){a+=e+"\r\n";})),e.dom.addStyle(a);}var u=Zr.all(function(e,t,n){var r=[new Zr((function(n,r){return Gk(e).loadAll(t,n,r)}))];return e.inline?r:r.concat([new Zr((function(t,r){return e.ui.styleSheetLoader.loadAll(n,t,r)}))])}(e,r,n)).then(i).catch(i);return e.settings.content_style&&function(e,t){var n=Rt.fromDom(e.getBody()),r=un(an(n)),o=Rt.fromTag("style");Qn(o,"type","text/css"),mn(o,Rt.fromText(t)),mn(r,o),e.on("remove",(function(){hn(o);}));}(e,e.settings.content_style),u},Qk=function(e){var t=e.settings,n=e.getDoc(),r=e.getBody();!function(e){e.fire("PreInit");}(e),t.browser_spellcheck||t.gecko_spellcheck||(n.body.spellcheck=!1,qk.setAttrib(r,"spellcheck","false")),e.quirks=Vk(e),function(e){e.fire("PostRender");}(e);var o=function(e){return e.getParam("directionality",ku.isRtl()?"rtl":void 0)}(e);void 0!==o&&(r.dir=o),t.protect&&e.on("BeforeSetContent",(function(e){_t.each(t.protect,(function(t){e.content=e.content.replace(t,(function(e){return "\x3c!--mce:protected "+escape(e)+"--\x3e"}));}));})),e.on("SetContent",(function(){e.addVisual(e.getBody());})),e.on("compositionstart compositionend",(function(t){e.composing="compositionstart"===t.type;}));},Zk=function(e){!0!==e.removed&&(!function(e){Gv(e)||e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"});}(e),Yk(e));},eN=function(e,t){var n=e.settings,r=e.getElement(),o=e.getDoc();n.inline||(e.getElement().style.visibility=e.orgVisibility),t||e.inline||(o.open(),o.write(e.iframeHTML),o.close()),e.inline&&(qk.addClass(r,"mce-content-body"),e.contentDocument=o=document,e.contentWindow=window,e.bodyElement=r,e.contentAreaContainer=r);var i=e.getBody();i.disabled=!0,e.readonly=!!n.readonly,e.readonly||(e.inline&&"static"===qk.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=e.getParam("content_editable_state",!0)),i.disabled=!1,e.editorUpload=My(e),e.schema=Ai(n),e.dom=pu(o,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:e.inline?e.getBody():null,collect:function(){return e.inline},schema:e.schema,contentCssCors:fs(e),referrerPolicy:ls(e),onSetAttrib:function(t){e.fire("SetAttrib",t);}}),e.parser=function(e){var t=_b(Kk(e),e.schema);return t.addAttributeFilter("src,href,style,tabindex",(function(t,n){for(var r,o,i=t.length,a=e.dom,u="data-mce-"+n;i--;)if((o=(r=t[i]).attr(n))&&!r.attr(u)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(u,o),r.attr(n,o)):"tabindex"===n?(r.attr(u,o),r.attr(n,null)):r.attr(u,e.convertURL(o,n,r.name));}})),t.addNodeFilter("script",(function(e){for(var t=e.length;t--;){var n=e[t],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r);}})),e.settings.preserve_cdata&&t.addNodeFilter("#cdata",(function(t){for(var n=t.length;n--;){var r=t[n];r.type=8,r.name="#comment",r.value="[CDATA["+e.dom.encode(r.value)+"]]";}})),t.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(t){for(var n=t.length,r=e.schema.getNonEmptyElements();n--;){var o=t[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Om("br",1)).shortEnded=!0);}})),t}(e),e.serializer=Ob(function(e){var t=e.settings;return Re(Re({},Kk(e)),Wk({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope,element_format:t.element_format,entities:t.entities,entity_encoding:t.entity_encoding,indent:t.indent,indent_after:t.indent_after,indent_before:t.indent_before,block_elements:t.block_elements,boolean_attributes:t.boolean_attributes,custom_elements:t.custom_elements,extended_valid_elements:t.extended_valid_elements,invalid_elements:t.invalid_elements,invalid_styles:t.invalid_styles,move_caret_before_on_enter_elements:t.move_caret_before_on_enter_elements,non_empty_elements:t.non_empty_elements,schema:t.schema,self_closing_elements:t.self_closing_elements,short_ended_elements:t.short_ended_elements,special:t.special,text_block_elements:t.text_block_elements,text_inline_elements:t.text_inline_elements,valid_children:t.valid_children,valid_classes:t.valid_classes,valid_elements:t.valid_elements,valid_styles:t.valid_styles,verify_html:t.verify_html,whitespace_elements:t.whitespace_elements}))}(e),e),e.selection=sb(e.dom,e.getWin(),e.serializer,e),e.annotator=Jl(e),e.formatter=qy(e),e.undoManager=Wy(e),e._nodeChangeDispatcher=new kk(e),e._selectionOverrides=jk(e),Lw(e),Nk(e),Gv(e)||_k(e);var a=function(e){return Gv(e)?Cu(null):Sk(e)}(e);Bw(e,a),function(e){ts(e)&&e.on("NodeChange",_(Uw,e));}(e),Jy(e);var u=Jv(e);Qk(e),u.fold((function(){Jk(e).then((function(){return Zk(e)}));}),(function(t){e.setProgressState(!0),Jk(e).then((function(){t().then((function(t){e.setProgressState(!1),Zk(e);}),(function(t){e.notificationManager.open({type:"error",text:String(t)}),Zk(e);}));}));}));},tN=pu.DOM,nN=function(e){var t=function(e){return e.getParam("doctype","<!DOCTYPE html>")}(e)+"<html><head>";((function(e){return e.getParam("document_base_url","")}))(e)!==e.documentBaseUrl&&(t+='<base href="'+e.documentBaseURI.getURI()+'" />'),t+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(e){return Zc(e,"body_id","tinymce")}(e),r=function(e){return Zc(e,"body_class","")}(e),o=e.translate(function(e){return e.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string")}(e));return es(e)&&(t+='<meta http-equiv="Content-Security-Policy" content="'+es(e)+'" />'),t+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+e.id+'" aria-label="'+o+'"><br></body></html>'},rN=function(e,t){var n,r,o,i,a=e.translate("Rich Text Area"),u=(n=e.id,r=a,t.height,o=function(e){return e.getParam("iframe_attrs",{})}(e),i=Rt.fromTag("iframe"),Zn(i,o),Zn(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Bu(i,"tox-edit-area__iframe"),i).dom;u.onload=function(){u.onload=null,e.fire("load");};var c=function(e,t){if(document.domain!==window.location.hostname&&wt.browser.isIE()){var n=By("mce");e[n]=function(){eN(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 tN.setAttrib(t,"src",r),!0}return !1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=nN(e),tN.add(t.iframeContainer,u),c},oN=pu.DOM,iN=function(e,t,n){var r=yy.get(n),o=yy.urls[n]||e.documentBaseUrl.replace(/\/$/,"");if(n=_t.trim(n),r&&-1===_t.inArray(t,n)){if(_t.each(yy.dependencies(n),(function(n){iN(e,t,n);})),e.plugins[n])return;try{var i=new r(e,o,e.$);e.plugins[n]=i,i.init&&(i.init(e,o),t.push(n));}catch(t){!function(e,t,n){var r=ku.translate(["Failed to initialize plugin: {0}",t]);td(e,"PluginLoadError",{message:r}),_y(r,n),Sy(e,r);}(e,n,t);}}},aN=function(e){return e.replace(/^\-/,"")},uN=function(e){return {editorContainer:e,iframeContainer:e,api:{}}},cN=function(e){var t=e.getElement();return e.inline?uN(null):function(e){var t=oN.create("div");return oN.insertAfter(t,e),uN(t)}(t)},sN=function(e){var t=e.getElement();return e.orgDisplay=t.style.display,l(vs(e))?function(e){return e.theme.renderUI()}(e):y(vs(e))?function(e){var t=e.getElement(),n=vs(e)(e,t);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||e.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||e.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:t.offsetHeight,n}(e):cN(e)},fN=function(e){e.fire("ScriptsLoaded"),function(e){var t=_t.trim(is(e)),n=e.ui.registry.getAll().icons,r=Re(Re({},sy.get("default").icons),sy.get(t).icons);le(r,(function(t,r){ye(n,r)||e.ui.registry.addIcon(r,t);}));}(e),function(e){var t=vs(e);if(l(t)){e.settings.theme=aN(t);var n=Cy.get(t);e.theme=new n(e,Cy.urls[t]),e.theme.init&&e.theme.init(e,Cy.urls[t]||e.documentBaseUrl.replace(/\/$/,""),e.$);}else e.theme={};}(e),function(e){var t=[];_t.each(xs(e).split(/[ ,]/),(function(n){iN(e,t,aN(n));}));}(e);var t=sN(e);!function(e,t){var n={show:I.from(t.show).getOr(x),hide:I.from(t.hide).getOr(x),disable:I.from(t.disable).getOr(x),isDisabled:I.from(t.isDisabled).getOr(T),enable:function(){e.mode.isReadOnly()||I.from(t.enable).map(D);}};e.ui=Re(Re({},e.ui),n);}(e,I.from(t.api).getOr({}));var n={editorContainer:t.editorContainer,iframeContainer:t.iframeContainer};return e.editorContainer=n.editorContainer?n.editorContainer:null,Dy(e),e.inline?eN(e):function(e,t){var n=rN(e,t);t.editorContainer&&(tN.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=tN.isHidden(t.editorContainer)),e.getElement().style.display="none",tN.setAttrib(e.id,"aria-hidden","true"),n||eN(e);}(e,n)},lN=pu.DOM,dN=function(e){return "-"===e.charAt(0)},mN=function(e,t){var n=ds(t),r=function(e){return e.getParam("language_url","","string")}(t);if(!1===ku.hasCode(n)&&"en"!==n){var o=""!==r?r:t.editorManager.baseURL+"/langs/"+n+".js";e.add(o,x,void 0,(function(){!function(e,t,n){ky(e,"LanguageLoadError",Ny("language",t,n));}(t,o,n);}));}},gN=function(e,t,n){return I.from(t).filter((function(e){return e.length>0&&!sy.has(e)})).map((function(t){return {url:e.editorManager.baseURL+"/icons/"+t+"/icons"+n+".js",name:I.some(t)}}))},pN=function(e,t,n){var r=gN(t,"default",n),o=function(e){return I.from(function(e){return e.getParam("icons_url","","string")}(e)).filter((function(e){return e.length>0})).map((function(e){return {url:e,name:I.none()}}))}(t).orThunk((function(){return gN(t,is(t),"")}));q(function(e){for(var t=[],n=function(e){t.push(e);},r=0;r<e.length;r++)e[r].each(n);return t}([r,o]),(function(n){e.add(n.url,x,void 0,(function(){!function(e,t,n){ky(e,"IconsLoadError",Ny("icons",t,n));}(t,n.url,n.name.getOrUndefined());}));}));},hN=function(e,t){var n=yu.ScriptLoader;!function(e,t,n,r){var o=vs(t);if(l(o)){if(!dN(o)&&!ye(Cy.urls,o)){var i=function(e){return e.getParam("theme_url")}(t);i?Cy.load(o,t.documentBaseURI.toAbsolute(i)):Cy.load(o,"themes/"+o+"/theme"+n+".js");}e.loadQueue((function(){Cy.waitFor(o,r);}));}else r();}(n,e,t,(function(){mN(n,e),pN(n,e,t),function(e,t){_t.each(function(e){return e.getParam("external_plugins")}(e),(function(t,n){yy.load(n,t,x,void 0,(function(){Ey(e,t,n);})),e.settings.plugins+=" "+n;})),_t.each(xs(e).split(/[ ,]/),(function(n){if((n=_t.trim(n))&&!yy.urls[n])if(dN(n)){n=n.substr(1,n.length);var r=yy.dependencies(n);_t.each(r,(function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+t+".js"},o=yy.createUrl(r,n);yy.load(o.resource,o,x,void 0,(function(){Ey(e,o.prefix+o.resource+o.suffix,o.resource);}));}));}else {var o={prefix:"plugins/",resource:n,suffix:"/plugin"+t+".js"};yy.load(n,o,x,void 0,(function(){Ey(e,o.prefix+o.resource+o.suffix,n);}));}}));}(e,t),n.loadQueue((function(){e.removed||fN(e);}),e,(function(){e.removed||fN(e);}));}));},vN=function(e){var t=e.id;ku.setCode(ds(e));var n=function(){lN.unbind(window,"ready",n),e.render();};if(Ui.Event.domLoaded){if(e.getElement()&&wt.contentEditable){var r=Rt.fromDom(e.getElement()),o=function(e){return Y(e.dom.attributes,(function(e,t){return e[t.name]=t.value,e}),{})}(r);e.on("remove",(function(){$(r.dom.attributes,(function(e){return nr(r,e.name)})),Zn(r,o);})),e.ui.styleSheetLoader=function(e,t){return io.forElement(e,{contentCssCors:Cs(t),referrerPolicy:ls(t)})}(r,e),!function(e){return e.getParam("inline")}(e)?(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden"):e.inline=!0;var i=e.getElement().form||lN.getParent(t,"form");i&&(e.formElement=i,function(e){return e.getParam("hidden_input")}(e)&&!Mn(e.getElement())&&(lN.insertAfter(lN.create("input",{type:"hidden",name:t}),t),e.hasHiddenInput=!0),e.formEventDelegate=function(t){e.fire(t.type,t);},lN.bind(i,"submit reset",e.formEventDelegate),e.on("reset",(function(){e.resetContent();})),!function(e){return e.getParam("submit_patch")}(e)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return e.editorManager.triggerSave(),e.setDirty(!1),i._mceOldSubmit(i)})),e.windowManager=xy(e),e.notificationManager=by(e),function(e){return "xml"===e.getParam("encoding")}(e)&&e.on("GetContent",(function(e){e.save&&(e.content=lN.encode(e.content));})),function(e){return e.getParam("add_form_submit_trigger")}(e)&&e.on("submit",(function(){e.initialized&&e.save();})),function(e){return e.getParam("add_unload_trigger")}(e)&&(e._beforeUnload=function(){!e.initialized||e.destroyed||e.isHidden()||e.save({format:"raw",no_events:!0,set_dirty:!1});},e.editorManager.on("BeforeUnload",e._beforeUnload)),e.editorManager.add(e),hN(e,e.suffix);}}else lN.bind(window,"ready",n);},bN=function(e,t){return function(e,t){return Zv(e).editor.addVisual(t)}(e,t)},yN={"font-size":"size","font-family":"face"},CN=function(e,t,n){return lh(Rt.fromDom(n),(function(t){return function(t){return ar(t,e).orThunk((function(){return "font"===It(t)?be(yN,e).bind((function(e){return tr(t,e)})):I.none()}))}(t)}),(function(e){return Bt(Rt.fromDom(t),e)}))},xN=function(e){return function(t,n){return I.from(n).map(Rt.fromDom).filter(Ut).bind((function(n){return CN(e,t,n.dom).or(function(e,t){return I.from(pu.DOM.getStyle(t,e,!0))}(e,n.dom))})).getOr("")}},wN=xN("font-size"),SN=w((function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),xN("font-family")),kN=function(e){return Lf(e.getBody()).map((function(e){var t=e.container();return Fn(t)?t.parentNode:t}))},NN=function(e,t){return function(e){return I.from(e.selection.getRng()).bind((function(t){var n=e.getBody();return t.startContainer===n&&0===t.startOffset?I.none():I.from(e.selection.getStart(!0))}))}(e).orThunk(_(kN,e)).map(Rt.fromDom).filter(Ut).bind(t)},EN=function(e,t){return NN(e,S(I.some,t))},_N=function(e,t){if(/^[0-9.]+$/.test(t)){var n=parseInt(t,10);if(n>=1&&n<=7){var r=function(e){return _t.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(e),o=function(e){return _t.explode(e.getParam("font_size_classes",""))}(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},AN=function(e){var t=e.split(/\s*,\s*/);return V(t,(function(e){return -1===e.indexOf(" ")||Me(e,'"')||Me(e,"'")?e:"'"+e+"'"})).join(",")},RN=function(e,t){var n=function(e){if("string"!=typeof e){var t=_t.extend({paste:e.paste,data:{paste:e.paste}},e);return {content:e.content,details:t}}return {content:e,details:{}}}(t);!function(e,t,n){Qv(e).editor.insertContent(t,n);}(e,n.content,n.details);},DN=_t.each,TN=_t.map,ON=_t.inArray,BN=function(){function e(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e);}return e.prototype.execCommand=function(e,t,n,r){var o,i=!1,a=this;if(!a.editor.removed){var u;if("mcefocus"!==e.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus?(u=a.editor,um(u).each((function(e){return u.selection.setRng(e)}))):a.editor.focus()),(r=a.editor.fire("BeforeExecCommand",{command:e,ui:t,value:n})).isDefaultPrevented())return !1;var c=e.toLowerCase();if(o=a.commands.exec[c])return o(c,t,n),a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0;if(DN(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(e,t,n))return a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),i=!0,!1})),i)return i;if(a.editor.theme&&a.editor.theme.execCommand&&a.editor.theme.execCommand(e,t,n))return a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0;try{i=a.editor.getDoc().execCommand(e,t,n);}catch(e){}return !!i&&(a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0)}},e.prototype.queryCommandState=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.state[e])return t(e);try{return this.editor.getDoc().queryCommandState(e)}catch(e){}return !1}},e.prototype.queryCommandValue=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.value[e])return t(e);try{return this.editor.getDoc().queryCommandValue(e)}catch(e){}}},e.prototype.addCommands=function(e,t){void 0===t&&(t="exec");var n=this;DN(e,(function(e,r){DN(r.toLowerCase().split(","),(function(r){n.commands[t][r]=e;}));}));},e.prototype.addCommand=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.exec[e]=function(e,o,i,a){return t.call(n||r.editor,o,i,a)};},e.prototype.queryCommandSupported=function(e){if(e=e.toLowerCase(),this.commands.exec[e])return !0;try{return this.editor.getDoc().queryCommandSupported(e)}catch(e){}return !1},e.prototype.addQueryStateHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.state[e]=function(){return t.call(n||r.editor)};},e.prototype.addQueryValueHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.value[e]=function(){return t.call(n||r.editor)};},e.prototype.hasCustomCommand=function(e){return e=e.toLowerCase(),!!this.commands.exec[e]},e.prototype.execNativeCommand=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(e,t,n)},e.prototype.isFormatMatch=function(e){return this.editor.formatter.match(e)},e.prototype.toggleFormat=function(e,t){this.editor.formatter.toggle(e,t),this.editor.nodeChanged();},e.prototype.storeSelection=function(e){this.selectionBookmark=this.editor.selection.getBookmark(e);},e.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark);},e.prototype.setupCommands=function(e){var t=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":x,"mceEndUndoLevel,mceAddUndoLevel":function(){e.undoManager.add();},mceFocus:function(t,n,r){wm(e,r);},"Cut,Copy,Paste":function(n){var r,o=e.getDoc();try{t.execNativeCommand(n);}catch(e){r=!0;}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");wt.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:i,type:"error"});}},unlink:function(){if(e.selection.isCollapsed()){var t=e.dom.getParent(e.selection.getStart(),"a");t&&e.dom.remove(t,!0);}else e.formatter.remove("link");},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),DN("left,center,right,justify".split(","),(function(t){r!==t&&e.formatter.remove("align"+t);})),"none"!==r&&t.toggleFormat("align"+r);},"InsertUnorderedList,InsertOrderedList":function(n){var r;t.execNativeCommand(n);var o=e.dom.getParent(e.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(t.storeSelection(),e.dom.split(r,o),t.restoreSelection()));},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){t.toggleFormat(e);},"ForeColor,HiliteColor":function(e,n,r){t.toggleFormat(e,{value:r});},FontName:function(t,n,r){!function(e,t){var n=_N(e,t);e.formatter.toggle("fontname",{value:AN(n)}),e.nodeChanged();}(e,r);},FontSize:function(t,n,r){!function(e,t){e.formatter.toggle("fontsize",{value:_N(e,t)}),e.nodeChanged();}(e,r);},LineHeight:function(t,n,r){!function(e,t){e.formatter.toggle("lineheight",{value:String(t)}),e.nodeChanged();}(e,r);},Lang:function(e,n,r){t.toggleFormat(e,{value:r.code,customValue:r.customCode});},RemoveFormat:function(t){e.formatter.remove(t);},mceBlockQuote:function(){t.toggleFormat("blockquote");},FormatBlock:function(e,n,r){return t.toggleFormat(r||"p")},mceCleanup:function(){var t=e.selection.getBookmark();e.setContent(e.getContent()),e.selection.moveToBookmark(t);},mceRemoveNode:function(n,r,o){var i=o||e.selection.getNode();i!==e.getBody()&&(t.storeSelection(),e.dom.remove(i,!0),t.restoreSelection());},mceSelectNodeDepth:function(t,n,r){var o=0;e.dom.getParent(e.selection.getNode(),(function(t){if(1===t.nodeType&&o++===r)return e.selection.select(t),!1}),e.getBody());},mceSelectNode:function(t,n,r){e.selection.select(r);},mceInsertContent:function(t,n,r){RN(e,r);},mceInsertRawHTML:function(t,n,r){e.selection.setContent("tiny_mce_marker");var o=e.getContent();e.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})));},mceInsertNewLine:function(t,n,r){uk(e,r);},mceToggleFormat:function(e,n,r){t.toggleFormat(r);},mceSetContent:function(t,n,r){e.setContent(r);},"Indent,Outdent":function(t){Dw(e,t);},mceRepaint:x,InsertHorizontalRule:function(){e.execCommand("mceInsertContent",!1,"<hr />");},mceToggleVisualAid:function(){e.hasVisual=!e.hasVisual,e.addVisual();},mceReplaceContent:function(t,n,r){e.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,e.selection.getContent({format:"text"})));},mceInsertLink:function(t,n,r){"string"==typeof r&&(r={href:r});var o=e.dom.getParent(e.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||e.formatter.remove("link"),r.href&&e.formatter.apply("link",r,o);},selectAll:function(){var t=e.dom.getParent(e.selection.getStart(),qn);if(t){var n=e.dom.createRng();n.selectNodeContents(t),e.selection.setRng(n);}},mceNewDocument:function(){e.setContent("");},InsertLineBreak:function(t,n,r){return XS(e,r),!0}});var n=function(t){return function(){var n=e.selection,r=n.isCollapsed()?[e.dom.getParent(n.getNode(),e.dom.isBlock)]:n.getSelectedBlocks(),o=TN(r,(function(n){return !!e.formatter.matchNode(n,t)}));return -1!==ON(o,!0)}};t.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return t.isFormatMatch(e)},mceBlockQuote:function(){return t.isFormatMatch("blockquote")},Outdent:function(){return _w(e)},"InsertUnorderedList,InsertOrderedList":function(t){var n=e.dom.getParent(e.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===t&&"UL"===n.tagName||"insertorderedlist"===t&&"OL"===n.tagName)}},"state"),t.addCommands({Undo:function(){e.undoManager.undo();},Redo:function(){e.undoManager.redo();}}),t.addQueryValueHandler("FontName",(function(){return function(e){return EN(e,(function(t){return SN(e.getBody(),t.dom)})).getOr("")}(e)}),this),t.addQueryValueHandler("FontSize",(function(){return function(e){return EN(e,(function(t){return wN(e.getBody(),t.dom)})).getOr("")}(e)}),this),t.addQueryValueHandler("LineHeight",(function(){return function(e){return EN(e,(function(t){var n=Rt.fromDom(e.getBody()),r=lh(t,(function(e){return ar(e,"line-height")}),_(Bt,n));return r.getOrThunk((function(){var e=parseFloat(or(t,"line-height")),n=parseFloat(or(t,"font-size"));return String(e/n)}))})).getOr("")}(e)}),this);},e}(),PN="data-mce-contenteditable",LN=function(e,t,n){var r,o;Lu(e,t)&&!1===n?(o=t,Du(r=e)?r.dom.classList.remove(o):Ou(r,o),Pu(r)):n&&Bu(e,t);},IN=function(e,t,n){try{e.getDoc().execCommand(t,!1,String(n));}catch(e){}},MN=function(e,t){e.dom.contentEditable=t?"true":"false";},FN=function(e,t){var n=Rt.fromDom(e.getBody());LN(n,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),function(e){I.from(e.selection.getNode()).each((function(e){e.removeAttribute("data-mce-selected");}));}(e),e.readonly=!0,MN(n,!1),q(Mu(n,'*[contenteditable="true"]'),(function(e){Qn(e,PN,"true"),MN(e,!1);}))):(e.readonly=!1,MN(n,!0),function(e){q(Mu(e,'*[data-mce-contenteditable="true"]'),(function(e){nr(e,PN),MN(e,!0);}));}(n),IN(e,"StyleWithCSS",!1),IN(e,"enableInlineTableEditing",!1),IN(e,"enableObjectResizing",!1),Cm(e)&&e.focus(),function(e){e.selection.setRng(e.selection.getRng());}(e),e.nodeChanged());},UN=function(e){return e.readonly},zN=function(e){e.parser.addAttributeFilter("contenteditable",(function(t){UN(e)&&q(t,(function(e){e.attr(PN,e.attr("contenteditable")),e.attr("contenteditable","false");}));})),e.serializer.addAttributeFilter(PN,(function(t){UN(e)&&q(t,(function(e){e.attr("contenteditable",e.attr(PN));}));})),e.serializer.addTempAttr(PN);},HN=function(e,t){if(function(e){return "click"===e.type}(t)&&!od.metaKeyPressed(t)){var n=Rt.fromDom(t.target);(function(e,t){return Qr(t,"a",(function(t){return Bt(t,Rt.fromDom(e.getBody()))})).bind((function(e){return tr(e,"href")}))})(e,n).each((function(n){if(t.preventDefault(),/^#/.test(n)){var r=e.dom.select(n+',[name="'+((Me(o=n,i="#")?function(e,t){return e.substring(t)}(o,i.length):o)+'"]'));r.length&&e.selection.scrollIntoView(r[0],!0);}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var o,i;}));}},jN=_t.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),VN=function(){function e(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||T;}return e.isNative=function(e){return !!jN[e.toLowerCase()]},e.prototype.fire=function(e,t){var n=e.toLowerCase(),r=Bi(n,t||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i<a;i++){var u=o[i];if(!u.removed){if(u.once&&this.off(n,u.func),r.isImmediatePropagationStopped())return r;if(!1===u.func.call(this.scope,r))return r.preventDefault(),r}}return r},e.prototype.on=function(e,t,n,r){if(!1===t&&(t=T),t){var o={func:t,removed:!1};r&&_t.extend(o,r);for(var i=e.toLowerCase().split(" "),a=i.length;a--;){var u=i[a],c=this.bindings[u];c||(c=[],this.toggleEvent(u,!0)),c=n?De([o],c,!0):De(De([],c,!0),[o],!1),this.bindings[u]=c;}}return this},e.prototype.off=function(e,t){var n=this;if(e)for(var r=e.toLowerCase().split(" "),o=r.length;o--;){var i=r[o],a=this.bindings[i];if(!i)return le(this.bindings,(function(e,t){n.toggleEvent(t,!1),delete n.bindings[t];})),this;if(a){if(t){var u=W(a,(function(e){return e.func===t}));a=u.fail,this.bindings[i]=a,q(u.pass,(function(e){e.removed=!0;}));}else a.length=0;a.length||(this.toggleEvent(e,!1),delete this.bindings[i]);}}else le(this.bindings,(function(e,t){n.toggleEvent(t,!1);})),this.bindings={};return this},e.prototype.once=function(e,t,n){return this.on(e,t,n,{once:!0})},e.prototype.has=function(e){return e=e.toLowerCase(),!(!this.bindings[e]||0===this.bindings[e].length)},e}(),qN=function(e){return e._eventDispatcher||(e._eventDispatcher=new VN({scope:e,toggleEvent:function(t,n){VN.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,n);}})),e._eventDispatcher},$N={fire:function(e,t,n){var r=this;if(r.removed&&"remove"!==e&&"detach"!==e)return t;var o=qN(r).fire(e,t);if(!1!==n&&r.parent)for(var i=r.parent();i&&!o.isPropagationStopped();)i.fire(e,o,!1),i=i.parent();return o},on:function(e,t,n){return qN(this).on(e,t,n)},off:function(e,t){return qN(this).off(e,t)},once:function(e,t){return qN(this).once(e,t)},hasEventListeners:function(e){return qN(this).has(e)}},WN=pu.DOM,KN=function(e,t){if("selectionchange"===t)return e.getDoc();if(!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t))return e.getDoc().documentElement;var n=hs(e);return n?(e.eventRoot||(e.eventRoot=WN.select(n)[0]),e.eventRoot):e.getBody()},XN=function(e,t,n){!function(e){return !e.hidden&&!UN(e)}(e)?UN(e)&&HN(e,n):e.fire(t,n);},YN=function(e,t){var n;if(e.delegates||(e.delegates={}),!e.delegates[t]&&!e.removed){var r=KN(e,t);if(hs(e)){if(Mx||(Mx={},e.editorManager.on("removeEditor",(function(){e.editorManager.activeEditor||Mx&&(le(Mx,(function(t,n){e.dom.unbind(KN(e,n));})),Mx=null);}))),Mx[t])return;n=function(n){for(var r=n.target,o=e.editorManager.get(),i=o.length;i--;){var a=o[i].getBody();(a===r||WN.isChildOf(r,a))&&XN(o[i],t,n);}},Mx[t]=n,WN.bind(r,t,n);}else n=function(n){XN(e,t,n);},WN.bind(r,t,n),e.delegates[t]=n;}},GN=Re(Re({},$N),{bindPendingEventDelegates:function(){var e=this;_t.each(e._pendingNativeEvents,(function(t){YN(e,t);}));},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(n.removed||(t?n.initialized?YN(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(KN(n,e),e,n.delegates[e]),delete n.delegates[e])));},unbindAllNativeEvents:function(){var e=this,t=e.getBody(),n=e.dom;e.delegates&&(le(e.delegates,(function(t,n){e.dom.unbind(KN(e,n),n,t);})),delete e.delegates),!e.inline&&t&&n&&(t.onload=null,n.unbind(e.getWin()),n.unbind(e.getDoc())),n&&(n.unbind(t),n.unbind(e.getContainer()));}}),JN=["design","readonly"],QN=function(e,t,n,r){var o=n[t.get()],i=n[r];try{i.activate();}catch(e){return void console.error("problem while activating editor mode "+r+":",e)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&FN(e,i.editorReadOnly),t.set(r),function(e,t){e.fire("SwitchMode",{mode:t});}(e,r);},ZN=function(e){var t=Cu("design"),n=Cu({design:{activate:x,deactivate:x,editorReadOnly:!1},readonly:{activate:x,deactivate:x,editorReadOnly:!0}});return function(e){e.serializer?zN(e):e.on("PreInit",(function(){zN(e);}));}(e),function(e){e.on("ShowCaret",(function(t){UN(e)&&t.preventDefault();})),e.on("ObjectSelected",(function(t){UN(e)&&t.preventDefault();}));}(e),{isReadOnly:function(){return UN(e)},set:function(r){return function(e,t,n,r){if(r!==n.get()){if(!ye(t,r))throw new Error("Editor mode '"+r+"' is invalid");e.initialized?QN(e,n,t,r):e.on("init",(function(){return QN(e,n,t,r)}));}}(e,n.get(),t,r)},get:function(){return t.get()},register:function(e,t){n.set(function(e,t,n){var r;if(H(JN,t))throw new Error("Cannot override default mode "+t);return Re(Re({},e),((r={})[t]=Re(Re({},n),{deactivate:function(){try{n.deactivate();}catch(e){console.error("problem while deactivating editor mode "+t+":",e);}}}),r))}(n.get(),e,t));}}},eE=_t.each,tE=_t.explode,nE={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},rE=_t.makeMap("alt,ctrl,shift,meta,access"),oE=function(e){var t,n={};eE(tE(e.toLowerCase(),"+"),(function(e){e in rE?n[e]=!0:/^[0-9]{2,}$/.test(e)?n.keyCode=parseInt(e,10):(n.charCode=e.charCodeAt(0),n.keyCode=nE[e]||e.toUpperCase().charCodeAt(0));}));var r=[n.keyCode];for(t in rE)n[t]?r.push(t):n[t]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,wt.mac?n.ctrl=!0:n.shift=!0),n.meta&&(wt.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},iE=function(){function e(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var t=this;e.on("keyup keypress keydown",(function(e){!t.hasModifier(e)&&!t.isFunctionKey(e)||e.isDefaultPrevented()||(eE(t.shortcuts,(function(n){if(t.matchShortcut(e,n))return t.pendingPatterns=n.subpatterns.slice(0),"keydown"===e.type&&t.executeShortcutAction(n),!0})),t.matchShortcut(e,t.pendingPatterns[0])&&(1===t.pendingPatterns.length&&"keydown"===e.type&&t.executeShortcutAction(t.pendingPatterns[0]),t.pendingPatterns.shift()));}));}return e.prototype.add=function(e,t,n,r){var o=this,i=o.normalizeCommandFunc(n);return eE(tE(_t.trim(e)),(function(e){var n=o.createShortcut(e,t,i,r);o.shortcuts[n.id]=n;})),!0},e.prototype.remove=function(e){var t=this.createShortcut(e);return !!this.shortcuts[t.id]&&(delete this.shortcuts[t.id],!0)},e.prototype.normalizeCommandFunc=function(e){var t=this,n=e;return "string"==typeof n?function(){t.editor.execCommand(n,!1,null);}:_t.isArray(n)?function(){t.editor.execCommand(n[0],n[1],n[2]);}:n},e.prototype.createShortcut=function(e,t,n,r){var o=_t.map(tE(e,">"),oE);return o[o.length-1]=_t.extend(o[o.length-1],{func:n,scope:r||this.editor}),_t.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},e.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},e.prototype.isFunctionKey=function(e){return "keydown"===e.type&&e.keyCode>=112&&e.keyCode<=123},e.prototype.matchShortcut=function(e,t){return !!t&&(t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&(t.alt===e.altKey&&t.shift===e.shiftKey&&(!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0))))},e.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},e}(),aE=function(){var e=function(){var e={},t={},n={},r={},o={},i={},a={},u=function(e,t){return function(n,r){return e[n.toLowerCase()]=Re(Re({},r),{type:t})}};return {addButton:u(e,"button"),addGroupToolbarButton:u(e,"grouptoolbarbutton"),addToggleButton:u(e,"togglebutton"),addMenuButton:u(e,"menubutton"),addSplitButton:u(e,"splitbutton"),addMenuItem:u(t,"menuitem"),addNestedMenuItem:u(t,"nestedmenuitem"),addToggleMenuItem:u(t,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(e,t){return r[e.toLowerCase()]=t},getAll:function(){return {buttons:e,menuItems:t,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}}}();return {addAutocompleter:e.addAutocompleter,addButton:e.addButton,addContextForm:e.addContextForm,addContextMenu:e.addContextMenu,addContextToolbar:e.addContextToolbar,addIcon:e.addIcon,addMenuButton:e.addMenuButton,addMenuItem:e.addMenuItem,addNestedMenuItem:e.addNestedMenuItem,addSidebar:e.addSidebar,addSplitButton:e.addSplitButton,addToggleButton:e.addToggleButton,addGroupToolbarButton:e.addGroupToolbarButton,addToggleMenuItem:e.addToggleMenuItem,getAll:e.getAll}},uE=pu.DOM,cE=_t.extend,sE=_t.each,fE=_t.resolve,lE=wt.ie,dE=function(){function e(e,t,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,cE(this,GN),this.settings=ay(this,e,this.documentBaseUrl,n.defaultSettings,t),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(yu.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),pu.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),Nu.languageLoad=this.settings.language_load,Nu.baseURL=n.baseURL,this.id=e,this.setDirty(!1),this.documentBaseURI=new zm(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new iE(this),this.editorCommands=new BN(this),this.settings.cache_suffix&&(wt.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:aE(),styleSheetLoader:void 0,show:x,hide:x,enable:x,disable:x,isDisabled:T};var o=ZN(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=cu.overrideDefaults((function(){return {context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}}));}return e.prototype.render=function(){vN(this);},e.prototype.focus=function(e){this.execCommand("mceFocus",!1,e);},e.prototype.hasFocus=function(){return ym(this)},e.prototype.execCallback=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this,i=o.settings[e];if(i)return o.callbackLookup&&(r=o.callbackLookup[e])&&(i=r.func,r=r.scope),"string"==typeof i&&(r=(r=i.replace(/\.\w+$/,""))?fE(r):0,i=fE(i),o.callbackLookup=o.callbackLookup||{},o.callbackLookup[e]={func:i,scope:r}),i.apply(r||o,t)},e.prototype.translate=function(e){return ku.translate(e)},e.prototype.getParam=function(e,t,n){return cy(this,e,t,n)},e.prototype.hasPlugin=function(e,t){return !!H(xs(this).split(/[ ,]/),e)&&(!t||void 0!==yy.get(e))},e.prototype.nodeChanged=function(e){this._nodeChangeDispatcher.nodeChanged(e);},e.prototype.addCommand=function(e,t,n){this.editorCommands.addCommand(e,t,n);},e.prototype.addQueryStateHandler=function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n);},e.prototype.addQueryValueHandler=function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n);},e.prototype.addShortcut=function(e,t,n,r){this.shortcuts.add(e,t,n,r);},e.prototype.execCommand=function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},e.prototype.queryCommandState=function(e){return this.editorCommands.queryCommandState(e)},e.prototype.queryCommandValue=function(e){return this.editorCommands.queryCommandValue(e)},e.prototype.queryCommandSupported=function(e){return this.editorCommands.queryCommandSupported(e)},e.prototype.show=function(){var e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable="true":(uE.show(e.getContainer()),uE.hide(e.id)),e.load(),e.fire("show"));},e.prototype.hide=function(){var e=this,t=e.getDoc();e.hidden||(lE&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable="false",e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(uE.hide(e.getContainer()),uE.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"));},e.prototype.isHidden=function(){return !!this.hidden},e.prototype.setProgressState=function(e,t){this.fire("ProgressState",{state:e,time:t});},e.prototype.load=function(e){var t,n=this,r=n.getElement();if(n.removed)return "";if(r){(e=e||{}).load=!0;var o=Mn(r)?r.value:r.innerHTML;return t=n.setContent(o,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,t}},e.prototype.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,Mn(o)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=uE.getParent(r.id,"form"))&&sE(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},e.prototype.setContent=function(e,t){return Pb(this,e,t)},e.prototype.getContent=function(e){return Bb(this,e)},e.prototype.insertContent=function(e,t){t&&(e=cE({content:e},t)),this.execCommand("mceInsertContent",!1,e);},e.prototype.resetContent=function(e){void 0===e?Pb(this,this.startContent,{format:"raw"}):Pb(this,e),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged();},e.prototype.isDirty=function(){return !this.isNotDirty},e.prototype.setDirty=function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty");},e.prototype.getContainer=function(){var e=this;return e.container||(e.container=uE.get(e.editorContainer||e.id+"_parent")),e.container},e.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},e.prototype.getElement=function(){return this.targetElm||(this.targetElm=uE.get(this.id)),this.targetElm},e.prototype.getWin=function(){var e,t=this;return t.contentWindow||(e=t.iframeElement)&&(t.contentWindow=e.contentWindow),t.contentWindow},e.prototype.getDoc=function(){var e,t=this;return t.contentDocument||(e=t.getWin())&&(t.contentDocument=e.document),t.contentDocument},e.prototype.getBody=function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},e.prototype.convertURL=function(e,t,n){var r=this,o=r.settings;return o.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!o.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:o.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,o.remove_script_host)},e.prototype.addVisual=function(e){bN(this,e);},e.prototype.remove=function(){Mb(this);},e.prototype.destroy=function(e){Fb(this,e);},e.prototype.uploadImages=function(e){return this.editorUpload.uploadImages(e)},e.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},e.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},e.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},e.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},e.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},e}(),mE=pu.DOM,gE=_t.explode,pE=_t.each,hE=_t.extend,vE=0,bE=!1,yE=[],CE=[],xE=function(e){var t=e.type;pE(NE.get(),(function(n){switch(t){case"scroll":n.fire("ScrollWindow",e);break;case"resize":n.fire("ResizeWindow",e);}}));},wE=function(e){e!==bE&&(e?cu(window).on("resize scroll",xE):cu(window).off("resize scroll",xE),bE=e);},SE=function(e){var t=CE;delete yE[e.id];for(var n=0;n<yE.length;n++)if(yE[n]===e){yE.splice(n,1);break}return CE=K(CE,(function(t){return e!==t})),NE.activeEditor===e&&(NE.activeEditor=CE.length>0?CE[0]:null),NE.focusedEditor===e&&(NE.focusedEditor=null),t.length!==CE.length},kE="CSS1Compat"!==document.compatMode,NE=Re(Re({},$N),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:cu,majorVersion:"5",minorVersion:"10.2",releaseDate:"2021-11-17",editors:yE,i18n:ku,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var e,t,n=this,r="";t=zm.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)e=i.base||i.baseURL,r=i.suffix;else {for(var a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c;if(""!==(c=a[u].src||"")){var s=c.substring(c.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!==s.indexOf(".min")&&(r=".min"),e=c.substring(0,c.lastIndexOf("/"));break}}}if(!e&&document.currentScript)-1!==(c=document.currentScript.src).indexOf(".min")&&(r=".min"),e=c.substring(0,c.lastIndexOf("/"));}n.baseURL=new zm(t).toAbsolute(e),n.documentBaseURL=t,n.baseURI=new zm(n.baseURL),n.suffix=r,(o=n).on("AddEditor",_(mm,o)),o.on("RemoveEditor",_(gm,o));},overrideDefaults:function(e){var t=e.base_url;t&&this._setBaseUrl(t);var n=e.suffix;e.suffix&&(this.suffix=n),this.defaultSettings=e;var r=e.plugin_base_urls;void 0!==r&&le(r,(function(e,t){Nu.PluginManager.urls[t]=e;}));},init:function(e){var t,n=this,r=_t.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),o=function(e){var t=e.id;return t||(t=be(e,"name").filter((function(e){return !mE.get(e)})).getOrThunk(mE.uniqueId),e.setAttribute("id",t)),t},i=function(e,t){return t.constructor===RegExp?t.test(e.className):mE.hasClass(e,t)},a=function(e){t=e;},u=function(){var t,c=0,s=[],f=function(e,r,o){var i=new dE(e,r,n);s.push(i),i.on("init",(function(){++c===t.length&&a(s);})),i.targetElm=i.targetElm||o,i.render();};mE.unbind(window,"ready",u),function(t){var r=e[t];if(r)r.apply(n,[]);}("onpageload"),t=cu.unique(function(e){var t=[];if(wt.browser.isIE()&&wt.browser.version.major<11)return _y("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(kE)return _y("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(e.types)return pE(e.types,(function(e){t=t.concat(mE.select(e.selector));})),t;if(e.selector)return mE.select(e.selector);if(e.target)return [e.target];switch(e.mode){case"exact":var n=e.elements||"";n.length>0&&pE(gE(n),(function(e){var n=mE.get(e);n?t.push(n):pE(document.forms,(function(n){pE(n.elements,(function(n){n.name===e&&(e="mce_editor_"+vE++,mE.setAttrib(n,"id",e),t.push(n));}));}));}));break;case"textareas":case"specific_textareas":pE(mE.select("textarea"),(function(n){e.editor_deselector&&i(n,e.editor_deselector)||e.editor_selector&&!i(n,e.editor_selector)||t.push(n);}));}return t}(e)),e.types?pE(e.types,(function(n){_t.each(t,(function(t){return !mE.is(t,n.selector)||(f(o(t),hE({},e,n),t),!1)}));})):(_t.each(t,(function(e){var t;(t=n.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(SE(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null);})),0===(t=_t.grep(t,(function(e){return !n.get(e.id)}))).length?a([]):pE(t,(function(t){!function(e,t){return e.inline&&t.tagName.toLowerCase()in r}(e,t)?f(o(t),e,t):_y("Could not initialize inline editor on invalid inline target element",t);})));};return n.settings=e,mE.bind(window,"ready",u),new Zr((function(e){t?e(t):a=function(t){e(t);};}))},get:function(e){return 0===arguments.length?CE.slice(0):l(e)?J(CE,(function(t){return t.id===e})).getOr(null):C(e)&&CE[e]?CE[e]:null},add:function(e){var t=this;return yE[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(yE[e.id]=e),yE.push(e),CE.push(e)),wE(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),Fx||(Fx=function(e){var n=t.fire("BeforeUnload");if(n.returnValue)return e.preventDefault(),e.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",Fx))),e},createEditor:function(e,t){return this.add(new dE(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!l(e))return n=e,g(r.get(n.id))?null:(SE(n)&&r.fire("RemoveEditor",{editor:n}),0===CE.length&&window.removeEventListener("beforeunload",Fx),n.remove(),wE(CE.length>0),n);pE(mE.select(e),(function(e){(n=r.get(e.id))&&r.remove(n);}));}else for(t=CE.length-1;t>=0;t--)r.remove(CE[t]);},execCommand:function(e,t,n){var r=this,o=r.get(n);switch(e){case"mceAddEditor":return r.get(n)||new dE(n,r.settings,r).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(r.execCommand("mceAddEditor",!1,n),!0)}return !!r.activeEditor&&r.activeEditor.execCommand(e,t,n)},triggerSave:function(){pE(CE,(function(e){e.save();}));},addI18n:function(e,t){ku.add(e,t);},translate:function(e){return ku.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e;},_setBaseUrl:function(e){this.baseURL=new zm(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new zm(this.baseURL);}});NE.setup();var EE,_E,AE,RE,DE=Math.min,TE=Math.max,OE=Math.round,BE=function(e,t,n){var r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,c=t.h,s=(n||"").split("");return "b"===s[0]&&(o+=c),"r"===s[1]&&(r+=u),"c"===s[0]&&(o+=OE(c/2)),"c"===s[1]&&(r+=OE(u/2)),"b"===s[3]&&(o-=a),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=OE(a/2)),"c"===s[4]&&(r-=OE(i/2)),PE(r,o,i,a)},PE=function(e,t,n,r){return {x:e,y:t,w:n,h:r}},LE={inflate:function(e,t,n){return PE(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:BE,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=BE(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=TE(e.x,t.x),r=TE(e.y,t.y),o=DE(e.x+e.w,t.x+t.w),i=DE(e.y+e.h,t.y+t.h);return o-n<0||i-r<0?null:PE(n,r,o-n,i-r)},clamp:function(e,t,n){var r=e.x,o=e.y,i=e.x+e.w,a=e.y+e.h,u=t.x+t.w,c=t.y+t.h,s=TE(0,t.x-r),f=TE(0,t.y-o),l=TE(0,i-u),d=TE(0,a-c);return r+=s,o+=f,n&&(i+=s,a+=f,r-=l,o-=d),PE(r,o,(i-=l)-r,(a-=d)-o)},create:PE,fromClientRect:function(e){return PE(e.left,e.top,e.width,e.height)}},IE=(EE={},_E={},{load:function(e,t){var n='Script at URL "'+t+'" failed to load',r='Script at URL "'+t+"\" did not call `tinymce.Resource.add('"+e+"', data)` within 1 second";if(void 0!==EE[e])return EE[e];var o=new Zr((function(o,i){var a=function(e,t,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r||(r=!0,null!==o&&(clearTimeout(o),o=null),e.apply(null,t));}},a=i(e),u=i(t);return {start:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r||null!==o||(o=setTimeout((function(){return u.apply(null,e)}),n));},resolve:a,reject:u}}(o,i);_E[e]=a.resolve,yu.ScriptLoader.loadScript(t,(function(){return a.start(r)}),(function(){return a.reject(n)}));}));return EE[e]=o,o},add:function(e,t){void 0!==_E[e]&&(_E[e](t),delete _E[e]),EE[e]=Zr.resolve(t);}}),ME=_t.each,FE=_t.extend,UE=function(){};UE.extend=AE=function(e){var t=this.prototype,n=function(){var e,t,n,r=this;if(!RE&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(r,arguments);},r=function(){return this};RE=!0;var o=new this;return RE=!1,e.Mixins&&(ME(e.Mixins,(function(t){for(var n in t)"init"!==n&&(e[n]=t[n]);})),t.Mixins&&(e.Mixins=t.Mixins.concat(e.Mixins))),e.Methods&&ME(e.Methods.split(","),(function(t){e[t]=r;})),e.Properties&&ME(e.Properties.split(","),(function(t){var n="_"+t;e[t]=function(e){var t=this;return void 0!==e?(t[n]=e,t):t[n]};})),e.Statics&&ME(e.Statics,(function(e,t){n[t]=e;})),e.Defaults&&t.Defaults&&(e.Defaults=FE({},t.Defaults,e.Defaults)),le(e,(function(e,n){"function"==typeof e&&t[n]?o[n]=function(e,n){return function(){var r=this,o=r._super;r._super=t[e];var i=n.apply(r,arguments);return r._super=o,i}}(n,e):o[n]=e;})),n.prototype=o,n.constructor=n,n.extend=AE,n};var zE,HE=Math.min,jE=Math.max,VE=Math.round,qE={serialize:function(e){var t=JSON.stringify(e);return l(t)?t.replace(/[\u0080-\uFFFF]/g,(function(e){var t=e.charCodeAt(0).toString(16);return "\\u"+"0000".substring(t.length)+t})):t},parse:function(e){try{return JSON.parse(e)}catch(e){}}},$E={callbacks:{},count:0,send:function(e){var t=this,n=pu.DOM,r=void 0!==e.count?e.count:t.count,o="tinymce_jsonp_"+r;t.callbacks[r]=function(i){n.remove(o),delete t.callbacks[r],e.callback(i);},n.add(n.doc.body,"script",{id:o,src:e.url,type:"text/javascript"}),t.count++;}},WE=Re(Re({},$N),{send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||n++>1e4?(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,n>1e4?"TIMED_OUT":"GENERAL",t,e),t=null):ro.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||"",WE.fire("beforeInitialize",{settings:e}),(t=new XMLHttpRequest).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&&_t.each(e.requestheaders,(function(e){t.setRequestHeader(e.key,e.value);})),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=WE.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();ro.setTimeout(r,10);}}),KE=_t.extend,XE=function(){function e(e){this.settings=KE({},e),this.count=0;}return e.sendRPC=function(t){return (new e).send(t)},e.prototype.send=function(e){var t=e.error,n=e.success,r=KE(this.settings,e);r.success=function(e,o){void 0===(e=qE.parse(e))&&(e={error:"JSON Parse error."}),e.error?t.call(r.error_scope||r.scope,e.error,o):n.call(r.success_scope||r.scope,e.result);},r.error=function(e,n){t&&t.call(r.error_scope||r.scope,e,n);},r.data=qE.serialize({id:e.id||"c"+this.count++,method:e.method,params:e.params}),r.content_type="application/json",WE.send(r);},e}();try{var YE="__storage_test__";(zE=window.localStorage).setItem(YE,YE),zE.removeItem(YE);}catch(e){zE=function(){var e={},t=[],n={getItem:function(t){return e[t]||null},setItem:function(n,r){t.push(n),e[n]=String(r);},key:function(e){return t[e]},removeItem:function(n){t=t.filter((function(e){return e===n})),delete e[n];},clear:function(){t=[],e={};},length:0};return Object.defineProperty(n,"length",{get:function(){return t.length},configurable:!1,enumerable:!1}),n}();}var GE={geom:{Rect:LE},util:{Promise:Zr,Delay:ro,Tools:_t,VK:od,URI:zm,Class:UE,EventDispatcher:VN,Observable:$N,I18n:ku,XHR:WE,JSON:qE,JSONRequest:XE,JSONP:$E,LocalStorage:zE,Color:function(e){var t={},n=0,r=0,o=0,i=function(e){var i;return "object"==typeof e?"r"in e?(n=e.r,r=e.g,o=e.b):"v"in e&&function(e,t,i){if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,i=parseInt(i,10)/100,t=jE(0,HE(t,1)),i=jE(0,HE(i,1)),0!==t){var a=e/60,u=i*t,c=u*(1-Math.abs(a%2-1)),s=i-u;switch(Math.floor(a)){case 0:n=u,r=c,o=0;break;case 1:n=c,r=u,o=0;break;case 2:n=0,r=u,o=c;break;case 3:n=0,r=c,o=u;break;case 4:n=c,r=0,o=u;break;case 5:n=u,r=0,o=c;break;default:n=r=o=0;}n=VE(255*(n+s)),r=VE(255*(r+s)),o=VE(255*(o+s));}else n=r=o=VE(255*i);}(e.h,e.s,e.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,t};return e&&i(e),t.toRgb=function(){return {r:n,g:r,b:o}},t.toHsv=function(){return function(e,t,n){var r,o;o=0;var i=HE(e/=255,HE(t/=255,n/=255)),a=jE(e,jE(t,n));return i===a?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,o=a,{h:VE(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/(a-i))),s:VE(100*r),v:VE(100*o)})}(n,r,o)},t.toHex=function(){var e=function(e){return (e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return "#"+e(n)+e(r)+e(o)},t.parse=i,t},ImageUploader:function(e){var t=Ty(),n=Iy(e,t);return {upload:function(t,r){return void 0===r&&(r=!0),n.upload(t,r?Ly(e):void 0)}}}},dom:{EventUtils:Ui,Sizzle:wa,DomQuery:cu,TreeWalker:ao,TextSeeker:Qu,DOMUtils:pu,ScriptLoader:yu,RangeUtils:xd,Serializer:Ob,StyleSheetLoader:oo,ControlSelection:ad,BookmarkManager:Ql,Selection:sb,Event:Ui.Event},html:{Styles:Di,Entities:bi,Node:Om,Schema:Ai,SaxParser:$m,DomParser:_b,Writer:Qm,Serializer:Zm},Env:wt,AddOnManager:Nu,Annotator:Jl,Formatter:qy,UndoManager:Wy,EditorCommands:BN,WindowManager:xy,NotificationManager:by,EditorObservable:GN,Shortcuts:iE,Editor:dE,FocusManager:cm,EditorManager:NE,DOM:pu.DOM,ScriptLoader:yu.ScriptLoader,PluginManager:yy,ThemeManager:Cy,IconManager:sy,Resource:IE,trim:_t.trim,isArray:_t.isArray,is:_t.is,toArray:_t.toArray,makeMap:_t.makeMap,each:_t.each,map:_t.map,grep:_t.grep,inArray:_t.inArray,extend:_t.extend,create:_t.create,walk:_t.walk,createNS:_t.createNS,resolve:_t.resolve,explode:_t.explode,_addCacheSuffix:_t._addCacheSuffix,isOpera:wt.opera,isWebKit:wt.webkit,isIE:wt.ie,isGecko:wt.gecko,isMac:wt.mac},JE=_t.extend(NE,GE);!function(e){window.tinymce=e,window.tinyMCE=e;}(JE),function(t){try{e.exports=t;}catch(e){}}(JE);}();}(tinymce);
27
+ var Validator=function(){function t(t,i){if(this.options={errorAlert:"There are errors on the form, please check your answers and try again.",useAjax:!0},this.element=t,this.element){this.options.serializationFunction=function(){return $(this.element).serialize()}.bind(this),this.options=__assign(__assign({},this.options),i),this.element.addEventListener("submit",function(t){t.preventDefault(),t.stopImmediatePropagation(),this.submitForm();}.bind(this));var e='[data-submit="#'+this.element.id+'"]',n=$(e);n&&n.on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),$(t.currentTarget).data("exit")&&($(this.element).find("input#exit").remove(),$("<input id='exit' />").attr("type","hidden").attr("name","exit").attr("value","true").appendTo(this.element)),this.submitForm();}.bind(this));}}return t.prototype.submitForm=function(){var t;if(this.element.classList.add("was-validated"),this.element.checkValidity()){this.element.classList.add("loading");var i=this.element.querySelector("input[type=checkbox]");if(i&&Array.prototype.slice.call(i).forEach((function(t){$(this).is(":checked")&&$(this).val("true");})),this.options.onSubmit&&this.options.onSubmit(this),this.options.useAjax){var e=this.options.serializationFunction();$.post(this.element.action,e,function(t){this.options.onComplete&&this.options.onComplete(t,this);}.bind(this)).fail(null!==(t=this.options.onError)&&void 0!==t?t:Inline.handleError);}else this.element.submit();}else this.options.errorAlert&&Alerts.error(this.options.errorAlert,null,5e3);},t}();var Handlers=function(){function t(){}return t.prototype.initDefaultHandlers=function(){this.checkboxToCsvInput(),this.iconSelector(),this.initSelectValues(),this.scrollHandlers(),this.selectText(),this.setValueOnClick(),this.submitOnChange();},t.prototype.initSelectValues=function(t){void 0===t&&(t="body"),$(t).find("select[data-selected]").each(this.initSelectValuesHandler);},t.prototype.initSelectValuesHandler=function(t,e){var o=$(this).data("selected");if("undefined"!==o&&""!==o){var a=String(o);$(this).val(a);}},t.prototype.iconSelector=function(t){void 0===t&&(t="body"),$(t).find("[data-hood-icon]").each(this.iconSelectorHandler);},t.prototype.iconSelectorHandler=function(t,e){var o=$(this),a=o.find("input[data-hood-icon-input]"),n=o.find("[data-hood-icon-display]"),i=o.find(".collapse");o.find("[data-hood-icon-key][data-hood-icon-value]").on("click",(function(){o.find("[data-hood-icon-key][data-hood-icon-value]").removeClass("active"),$(this).addClass("active");var t=$(this).data("hoodIconKey"),e=$(this).data("hoodIconValue");$(this),n.html(e),a.val(t),i&&i.removeClass("show");}));},t.prototype.selectText=function(t){void 0===t&&(t="body"),$(t).on("click",".select-text",this.selectTextHandler);},t.prototype.selectTextHandler=function(){var t=$(this);t.select(),t.mouseup((function(){return t.unbind("mouseup"),!1}));},t.prototype.scrollHandlers=function(t){void 0===t&&(t="body"),$(t).on("click",".scroll-top, .scroll-to-top",this.scrollTop),$(t).on("click",".scroll-target, .scroll-to-target",this.scrollTarget),$(t).on("click",".scroll-target-direct, .scroll-to-target-direct",this.scrollTargetDirect);},t.prototype.scrollTop=function(t){return t&&t.preventDefault(),$("html, body").animate({scrollTop:0},800),!1},t.prototype.scrollTarget=function(t){t&&t.preventDefault();var e=$(this).attr("href").split("#")[0];if(e===window.location.pathname||""===e){var o=this.hash,a=$(o),n=$("header.header"),i=0;n&&(i=n.height()),$(this).data("offset")?$("html, body").stop().animate({scrollTop:a.offset().top-$(this).data("offset")},900,"swing"):$("html, body").stop().animate({scrollTop:a.offset().top-i},900,"swing");}},t.prototype.scrollTargetDirect=function(){var t=$("body").scrollTop(),e=$($(this).attr("href")).offset().top;return $("html, body").animate({scrollTop:e},Math.abs(e-t)),!1},t.prototype.checkboxToCsvInput=function(t){void 0===t&&(t="body"),$(t).on("change","input[type=checkbox][data-hood-csv-input]",this.checkboxToCsvInputHandler);},t.prototype.checkboxToCsvInputHandler=function(t){t&&t.preventDefault();var e=new Array;$('input[data-hood-csv-input="'+$(this).data("hoodCsvInput")+'"]').each((function(){$(this).is(":checked")&&e.push($(this).val());}));var o="#"+$(this).data("input"),a=JSON.stringify(e);$(o).val(a);},t.prototype.submitOnChange=function(t){void 0===t&&(t="body"),$(t).on("change",".submit-on-change",this.submitOnChangeHandler);},t.prototype.submitOnChangeHandler=function(t){t&&t.preventDefault(),$(this).parents("form").submit();},t.prototype.setValueOnClick=function(t){void 0===t&&(t="body"),$(t).on("click",".click-select[data-target][data-value]",this.setValueOnClickHandler);},t.prototype.setValueOnClickHandler=function(){var t=$(this),e="#"+t.data("target");$(e).val(t.data("value")),$(e).trigger("change"),$('.click-select.clean[data-target="'+t.data("target")+'"]').each((function(){$(this).removeClass("active");})),$('.click-select.clean[data-target="'+t.data("target")+'"][data-value="'+t.data("value")+'"]').each((function(){$(this).addClass("active");}));},t}();var Uploader=function(){function e(){($(".image-uploader").length||$(".gallery-uploader").length)&&($(".upload-progress-bar").hide(),$(".image-uploader").each(this.singleImage),$(".gallery-uploader").each(this.gallery));}return e.prototype.refreshImage=function(e,r){$(e.data("preview")).css({"background-image":"url("+r.media.smallUrl+")"}),$(e.data("preview")).find("img").attr("src",r.media.smallUrl);},e.prototype.singleImage=function(){var e="#"+$(this).attr("id"),r=$(e),a="#"+$(this).attr("json"),l=null;r.dropzone({url:r.data("url"),maxFiles:1,paramName:"file",parallelUploads:1,acceptedFiles:r.data("types")||".png,.jpg,.jpeg,.gif",autoProcessQueue:!0,previewsContainer:!1,clickable:e,init:function(){l=this;}}),l.on("addedfile",(function(){})),l.on("totaluploadprogress",(function(r){$(".upload-progress-bar."+e.replace("#","")+" .progress-bar").css({width:r+"%"});})),l.on("sending",(function(a){$(".upload-progress-bar."+e.replace("#","")).show(),$(r.data("preview")).addClass("loading");})),l.on("queuecomplete",(function(r){$(".upload-progress-bar."+e.replace("#","")).hide();})),l.on("success",(function(e,o){o.success?(o.media&&($(a).val(JSON.stringify(o.media)),$(r.data("preview")).css({"background-image":"url("+o.media.smallUrl+")"}),$(r.data("preview")).find("img").attr("src",o.media.smallUrl)),Alerts.success("New image added!")):Alerts.error("There was a problem adding the image: "+o.error),l.removeFile(e),$(r.data("preview")).removeClass("loading");}));},e.prototype.gallery=function(){var e="#"+$(this).attr("id"),r=$(e),a=document.querySelector(e+"-template");a.id="";var l=a.parentNode.innerHTML;a.parentNode.removeChild(a);var o=null;r.dropzone({url:r.data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:l,paramName:"files",acceptedFiles:r.data("types")||".png,.jpg,.jpeg,.gif",autoProcessQueue:!0,previewsContainer:"#previews",clickable:".fileinput-button",init:function(){o=this;}}),$(e+" .cancel").hide(),o.on("addedfile",(function(r){$(r.previewElement.querySelector(".complete")).hide(),$(r.previewElement.querySelector(".cancel")).show(),$(e+" .cancel").show();})),o.on("totaluploadprogress",(function(e,r,a){document.querySelector("#total-progress .progress-bar").style.width=e+"%";})),o.on("sending",(function(e){document.querySelector("#total-progress").style.opacity="1";})),o.on("complete",(function(e){$(e.previewElement.querySelector(".cancel")).hide(),$(e.previewElement.querySelector(".progress")).hide(),$(e.previewElement.querySelector(".complete")).show(),console.error("Uploader.Gallery.Dropzone.OnComplete - Inline.Refresh('.gallery') is not implemented.");})),o.on("queuecomplete",(function(r){document.querySelector("#total-progress").style.opacity="0",$(e+" .cancel").hide();})),o.on("success",(function(e,r){console.error("Uploader.Gallery.Dropzone.OnSuccess - Inline.Refresh('.gallery') is not implemented."),r.success?Alerts.success("New images added!"):Alerts.error("There was a problem adding the profile image: "+r.error);})),$(".actions .cancel").click((function(){o.removeAllFiles(!0);}));},e}();var HoodApi=function(){function t(){this.alerts=new Alerts,this.handlers=new Handlers,this.uploader=new Uploader;}return t.prototype.initialise=function(){this.setupLoaders(),this.handlers.initDefaultHandlers(),this.initContactForms();},t.prototype.setupLoaders=function(){$("body").on("loader-show",(function(){document.body.classList.add("loading");})),$("body").on("loader-hide",(function(){document.body.classList.remove("loading");}));},t.prototype.initGoogleMaps=function(t){void 0===t&&(t=".google-map"),$(t).each((function(){var t=new google.maps.LatLng($(this).data("lat"),$(this).data("long"));console.log("Loading map at: "+$(this).data("lat")+", "+$(this).data("long"));var o=new google.maps.Map(this,{zoom:$(this).data("zoom")||15,center:t,scrollwheel:!1});new google.maps.Marker({position:t,map:o,title:$(this).data("marker")});$(window).on("resize",(function(){google.maps.event.trigger(o,"resize");})),google.maps.event.trigger(o,"resize");}));},t.prototype.initContactForms=function(t){void 0===t&&(t=".contact-form");var o=$(t);o.find(".thank-you").hide(),o.find(".form-content").show();var e=$(t)[0];new Validator(e,{onComplete:function(t){t.success?(o.attr("data-redirect")&&(window.location.href=o.attr("data-redirect")),o.attr("data-alert-message")&&Alerts.success(o.attr("data-alert-message")),o.find(".form").hide(),o.find(".thank-you").show()):o.attr("data-alert-error")?Alerts.error(o.attr("data-alert-error")):(console.error(t.errors),Alerts.error("There are errors on the form, please check your answers and try again."));}.bind(this)});},t}();var Loader=function(){function e(){new CustomEvent("loader-show"),new CustomEvent("loader-hide");}return e.show=function(){$("body").trigger("loader-show");},e.hide=function(){$("body").trigger("loader-hide");},e}();new Loader;$.fn.exists=function(){return $(this).length},$.fn.restrictToSlug=function(t){void 0===t&&(t=/[^0-9a-zA-Z]*/g);var n=$(this),e=function(){var n=$(this).val(),e=n.replace(t,"");n!==e&&$(this).val(e);};n.on("keyup",e),n.on("paste",e),n.on("change",e);},$.fn.restrictToPageSlug=function(t){void 0===t&&(t=/[^0-9a-zA-Z-//]*/g);var n=$(this),e=function(){var n=$(this).val(),e=n.replace(t,"");if((e.match(new RegExp("/","g"))||[]).length>4){var a=e.lastIndexOf("/");e=e.substring(0,a)+e.substring(a+1),Alerts.warning("You can only have up to 4 '/' characters in a url slug.");}n!==e&&$(this).val(e);};n.on("keyup",e),n.on("paste",e),n.on("change",e);},$.fn.restrictToMetaSlug=function(t){void 0===t&&(t=/[^0-9a-zA-Z.]*/g);var n=$(this),e=function(){var n=$(this).val(),e=n.replace(t,"");if((e.match(new RegExp(".","g"))||[]).length>1){var a=e.lastIndexOf(".");e=e.substring(0,a)+e.substring(a+1),Alerts.warning("You can only have up to 1 '.' characters in a meta slug.");}n!==e&&$(this).val(e);};n.on("keyup",e),n.on("paste",e),n.on("change",e);},$.fn.characterCounter=function(){var t=$(this),n=function(){var t=$(this).data("counter"),n=Number($(this).attr("maxlength")),e=$(this).val().length;$(t).text(n-e);var a="text-success";n-e<n/10&&(a="text-danger"),$(t).parent().removeClass("text-success").removeClass("text-danger").addClass(a);};t.on("keyup",n),t.on("paste",n),t.on("change",n);},$.fn.warningAlert=function(){$(this).on("click",(function(t){t.preventDefault();return Alerts.confirm({title:$(t.currentTarget).data("title"),html:$(t.currentTarget).data("warning"),footer:$(t.currentTarget).data("footer"),icon:"warning"},(function(n){if(n.isConfirmed){var e=$(t.currentTarget).attr("href");window.location.href=e;}})),!1}));};
28
+ Number.prototype.formatCurrency=function(t){return t+" "+this.toFixed(2).replace(/./g,(function(t,e,r){return e>0&&"."!==t&&(r.length-e)%3==0?","+t:t}))},Number.prototype.formatKilobytes=function(){return (this/1024).toFixed(0).replace(/./g,(function(t,e,r){return e>0&&"."!==t&&(r.length-e)%3==0?","+t:t}))+"Kb"},Number.prototype.formatMegabytes=function(){var t=this/1024;return (t/=1024).toFixed(0).replace(/./g,(function(t,e,r){return e>0&&"."!==t&&(r.length-e)%3==0?","+t:t}))+"Mb"};String.prototype.htmlEncode=function(){return $("<div/>").text(this).html()},String.prototype.htmlDecode=function(){return $("<div/>").html(this).text()},String.prototype.contains=function(t){return -1!==this.indexOf(t)},String.prototype.pick=function(t,r){var o,n="";o=void 0===r?t:t+Math.floor(Math.random()*(r-t));for(var e=0;e<o;e++)n+=this.charAt(Math.floor(Math.random()*this.length));return n},String.prototype.shuffle=function(){var t,r,o=this.split(""),n=o.length;if(n)for(;--n;)t=o[r=Math.floor(Math.random()*(n+1))],o[r]=o[n],o[n]=t;return o.join("")},String.prototype.toSeoUrl=function(){var t=this.replace(/[^a-zA-Z0-9]/g," ").replace(/\s+/g,"-").toLowerCase();"-"===t.charAt(0)&&(t=t.substring(1));var r=t.length-1;return "-"===t.charAt(r)&&(t=t.substring(0,r)),t};var App=function(i){function o(){var o=i.call(this)||this;return o.initialise(),o}return __extends(o,i),o}(HoodApi);window.hood=new App;exports.App=App;Object.defineProperty(exports,'__esModule',{value:true});}));
29
+ if (typeof this !== 'undefined' && this.hood){ this.hoodCMS = this.Hood = this.hoodCMS = this.HoodCMS = this.hood }