/*
@license
dhtmlxRichtext v.1.1.1 GPL
This software is covered by GPL license.
To use it in non-GPL project, you need obtain Commercial or Enterprise license
Please contact sales@dhtmlx.com. Usage without proper license is prohibited.
(c) Dinamenta, UAB.
*/
if(window.dhx&&(window.dhx_legacy=dhx,delete window.dhx),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.dhx=e():t.dhx=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/codebase/",n(n.s=36)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(39);e.el=i.defineElement,e.sv=i.defineSvgElement,e.view=i.defineView,e.create=i.createView,e.inject=i.injectView,e.disableHelp=function(){i.DEVMODE.mutations=!1,i.DEVMODE.warnings=!1,i.DEVMODE.verbose=!1,i.DEVMODE.UNKEYED_INPUT=!1},e.resizer=function(t){var n=window.ResizeObserver,i=function(e){var n=e.el.offsetHeight,i=e.el.offsetWidth;t(i,n)};return n?e.el("div.dhx-resize-observer",{_hooks:{didInsert:function(t){new n(function(){return i(t)}).observe(t.el)}}}):e.el("iframe.dhx-resize-observer",{_hooks:{didInsert:function(t){t.el.contentWindow.onresize=function(){return i(t)},i(t)}}})}},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n-1)return e[n[l]](i,o);r=r.parentNode}return!0}},e.locate=function(t,e){void 0===e&&(e="dhx_id");var n=o(t,e);return n?n.getAttribute(e):""},e.locateNode=o,e.getBox=function(t){var e=t.getBoundingClientRect(),n=document.body,i=window.pageYOffset||n.scrollTop,o=window.pageXOffset||n.scrollLeft;return{top:e.top+i,left:e.left+o,right:n.offsetWidth-e.right,bottom:n.offsetHeight-e.bottom,width:e.right-e.left,height:e.bottom-e.top}};var r,s=-1;function a(t){var e=t.getBoundingClientRect();return{left:e.left+window.pageXOffset,right:e.right+window.pageXOffset,top:e.top+window.pageYOffset,bottom:e.bottom+window.pageYOffset}}function l(t,e){var n=e.mode===r.bottom||e.mode===r.top?function(t,e){var n,o,s=c(),a=s.rightBorder,l=s.bottomBorder-t.bottom-e.height,d=t.top-e.height;e.mode===r.bottom?l>=0?o=t.bottom:d>=0&&(o=d):d>=0?o=d:l>=0&&(o=t.bottom);if(l<0&&d<0){if(e.auto)return u(t,i({},e,{mode:r.right,auto:!1}));o=l>d?t.bottom:d}if(e.centering)n=function(t,e,n){var i=t.right-t.left,o=(e-i)/2,r=t.left-o,s=t.right+o;if(r>=0&&s<=n)return r;if(r<0)return 0;return n-e}(t,e.width,a);else{var h=a-t.left-e.width,f=t.right-e.width;n=h>=0?t.left:f>=0?f:f>h?t.left:f}return{left:n,top:o}}(t,e):u(t,e);return{left:n.left+"px",top:n.top+"px",minWidth:e.width+"px",position:"absolute"}}function c(){return{rightBorder:window.pageXOffset+window.innerWidth,bottomBorder:window.pageYOffset+window.innerHeight}}function u(t,e){var n,o,s=c(),a=s.rightBorder,l=s.bottomBorder,d=a-t.right-e.width,h=t.left-e.width;if(e.mode===r.right?d>=0?n=t.right:h>=0&&(n=h):h>=0?n=h:d>=0&&(n=t.right),h<0&&d<0){if(e.auto)return u(t,i({},e,{mode:r.bottom,auto:!1}));n=h>d?h:t.right}if(e.centering)o=function(t,e,n){var i=(e-(t.bottom-t.top))/2,o=t.top-i,r=t.bottom+i;return o>=0&&r<=n?o:o<0?0:n-e}(t,e.width,a);else{var f=t.bottom-e.height,p=l-t.top-e.height;o=p>=0?t.top:f>0?f:f>p?f:t.top}return{left:n,top:o}}e.getScrollbarWidth=function(){if(s>-1)return s;var t=document.createElement("div");return document.body.appendChild(t),t.style.cssText="position: absolute;left: -99999px;overflow:scroll;width: 100px;height: 100px;",s=t.offsetWidth-t.clientWidth,document.body.removeChild(t),s},e.fitPosition=function(t,e){return l(a(t),e)},e.isIE=function(){var t=window.navigator.userAgent;return t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1},e.getRealPosition=a,function(t){t.left="left",t.right="right",t.bottom="bottom",t.top="top"}(r=e.Position||(e.Position={})),e.calculatePosition=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.none=0]="none",t.style="style",t.align="align",t.blockquote="blockquote",t.bold="bold",t.italic="italic",t.strike="strike",t.fontSize="font-size",t.fontFamily="font-family",t.underline="underline",t.color="color",t.background="background",t.link="link"}(e.Modifier||(e.Modifier={})),function(t){t.add="add",t.innerAdd="innerAdd",t.remove="remove",t.update="update",t.undo="undo",t.paste="paste",t.copy="copy",t.cut="cut",t.redo="redo",t.clear="clear",t.parse="parse",t.selectAll="selectAll"}(e.Action||(e.Action={})),function(t){t.default="default",t.undo="undo",t.style="style",t.decoration="decoration",t.color="colors",t.align="align",t.link="link",t.clear="clear",t.fullscreen="fullscreen",t.stats="stats"}(e.RTEToolbarBlock||(e.RTEToolbarBlock={})),function(t){t.change="change",t.action="action",t.selectionChange="selectionchange",t.selectionRefresh="selectionrefresh",t.showLinkEditor="showlinkeditor",t.compositionStart="compositionstart",t.compositionUpdate="compositionupdate",t.compositionEnd="compositionend"}(e.RichTextEvents||(e.RichTextEvents={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=(new Date).valueOf();e.uid=function(){return"u"+i++},e.extend=function t(e,n,i){if(void 0===i&&(i=!0),n)for(var o in n){var r=n[o],s=e[o];!i||"object"!=typeof s||s instanceof Date||s instanceof Array?e[o]=r:t(s,r)}return e},e.copy=function(t){var e={};for(var n in t)e[n]=t[n];return e},e.naturalSort=function(t){return t.sort(function(t,e){return"string"==typeof t?t.localeCompare(e):t-e})},e.findIndex=function(t,e){for(var n=t.length,i=0;ie.length)return!1;for(var n=0;n'},e.textSelectColor=function(t){return''},e.isEqual=function t(e,n,o){void 0===o&&(o=!1);var r=Object.keys(e),s=Object.keys(n);if(r.length!==s.length)return!1;for(var a=0,l=r;a99?"99+":t.count)},e.icon=function(t,e){return void 0===t&&(t=""),"dxi"===t.slice(0,3)&&(t="dxi "+t),i.el("span",{class:"dhx_"+e+"__icon "+t})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){this.events={},this.context=t||this}return t.prototype.on=function(t,e,n){var i=t.toLowerCase();this.events[i]=this.events[i]||[],this.events[i].push({callback:e,context:n||this.context})},t.prototype.detach=function(t,e){var n=t.toLowerCase(),i=this.events[n];if(e)for(var o=i.length-1;o>=0;o--)i[o].context===e&&i.splice(o,1);else this.events[n]=[]},t.prototype.fire=function(t,e){void 0===e&&(e=[]);var n=t.toLowerCase();return!this.events[n]||this.events[n].map(function(t){return t.callback.apply(t.context,e)}).indexOf(!1)<0},t}();e.EventSystem=i,e.EventsMixin=function(t){var e=new i(t=t||{});t.detachEvent=e.detach.bind(e),t.attachEvent=e.on.bind(e),t.callEvent=e.fire.bind(e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=n(1),r=function(){function t(t,e){this._uid=i.uid(),this.config=e||{}}return t.prototype.mount=function(t,e){e&&(this._view=e),t&&this._view&&this._view.mount&&(this._container=o.toNode(t),this._container.tagName?this._view.mount(this._container):this._container.attach&&this._container.attach(this))},t.prototype.getRootView=function(){return this._view},t.prototype.paint=function(){this._view&&(this._view.node||this._container)&&(this._doNotRepaint=!1,this._view.redraw())},t}();e.View=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(12);e.DataEvents=i.DataEvents,e.DragBehaviour=i.DragBehaviour,e.DragMode=i.DragMode,function(t){t[t.all=1]="all",t[t.specific=2]="specific",t[t.leafs=3]="leafs"}(e.TreeFilterType||(e.TreeFilterType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(15),o=n(24),r=n(25);e.isEqualObj=function(t,e){for(var n in t)if(t[n]!==e[n])return!1;return!0},e.naturalCompare=function(t,e){var n=[],i=[];for(t.replace(/(\d+)|(\D+)/g,function(t,e,i){n.push([e||1/0,i||""])}),e.replace(/(\d+)|(\D+)/g,function(t,e,n){i.push([e||1/0,n||""])});n.length&&i.length;){var o=n.shift(),r=i.shift(),s=o[0]-r[0]||o[1].localeCompare(r[1]);if(s)return s}return n.length-i.length},e.findByConf=function(t,e){if("function"==typeof e){if(e.call(this,t))return t}else if(e.by&&e.match&&t[e.by]===e.match)return t},e.isDebug=function(){var t=window.dhx;if(void 0!==t)return void 0!==t.debug&&t.debug},e.dhxWarning=function(t){console.warn(t)},e.dhxError=function(t){throw new Error(t)},e.toProxy=function(t){var e=typeof t;return"string"===e?new i.DataProxy(t):"object"===e?t:void 0},e.toDataDriver=function(t){if("string"==typeof t)switch(t){case"csv":return new o.CsvDriver;case"json":return new r.JsonDriver;default:console.warn("incorrect driver type",t)}else if("object"==typeof t)return t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={apply:"Apply",undo:"Undo",redo:"Redo",selectFontFamily:"Font",selectFontSize:"Font size",selectFormat:"Style",selectTextColor:"Text color",selectTextBackground:"Background color",markBold:"Bold",markItalic:"Italic",markStrike:"Strike",markUnderline:"Underline",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",addLink:"Add link",clearFormat:"Clear formatting",fullscreen:"Fullscreen",stats:"Statistics",removeLink:"Remove link",edit:"Edit",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",p:"Normal text",blockquote:"Block quote",chars:"chars",charsExlSpace:"Characters without spaces",words:"words"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.afterAdd="afteradd",t.beforeAdd="beforeadd",t.removeAll="removeall",t.beforeRemove="beforeremove",t.afterRemove="afterremove",t.change="change",t.load="load"}(e.DataEvents||(e.DataEvents={})),function(t){t.beforeDrag="beforedrag",t.beforeDrop="beforeDrop",t.dragStart="dragstart",t.dragEnd="dragend",t.canDrop="candrop",t.cancelDrop="canceldrop",t.dropComplete="dropcomplete",t.dragOut="dragOut",t.dragIn="dragIn"}(e.DragEvents||(e.DragEvents={})),function(t){t.target="target",t.both="both",t.source="source"}(e.DragMode||(e.DragMode={})),function(t){t.child="child",t.sibling="sibling",t.complex="complex"}(e.DragBehaviour||(e.DragBehaviour={})),function(t){t.beforeUnSelect="beforeunselect",t.afterUnSelect="afterunselect",t.beforeSelect="beforeselect",t.afterSelect="afterselect"}(e.SelectionEvents||(e.SelectionEvents={}))},function(t,e,n){(function(e,n){!function(){var i=1,o={},r=!1;function s(t){e.setImmediate?n(t):e.importScripts?setTimeout(t):(o[++i]=t,e.postMessage(i,"*"))}function a(t){"use strict";if("function"!=typeof t&&void 0!=t)throw TypeError();if("object"!=typeof this||this&&this.then)throw TypeError();var e,n,i=this,o=0,r=0,l=[];i.promise=i,i.resolve=function(t){return e=i.fn,n=i.er,o||(r=t,o=1,s(d)),i},i.reject=function(t){return e=i.fn,n=i.er,o||(r=t,o=2,s(d)),i},i._d=1,i.then=function(t,e){if(1!=this._d)throw TypeError();var n=new a;return n.fn=t,n.er=e,3==o?n.resolve(r):4==o?n.reject(r):l.push(n),n},i.catch=function(t){return i.then(null,t)};var c=function(t){o=t||4,l.map(function(t){3==o&&t.resolve(r)||t.reject(r)})};try{"function"==typeof t&&t(i.resolve,i.reject)}catch(t){i.reject(t)}return i;function u(t,e,n,i){if(2==o)return i();if("object"!=typeof r&&"function"!=typeof r||"function"!=typeof t)i();else try{var s=0;t.call(r,function(t){s++||(r=t,e())},function(t){s++||(r=t,n())})}catch(t){r=t,n()}}function d(){var t;try{t=r&&r.then}catch(t){return r=t,o=2,d()}u(t,function(){o=1,d()},function(){o=2,d()},function(){try{1==o&&"function"==typeof e?r=e(r):2==o&&"function"==typeof n&&(r=n(r),o=1)}catch(t){return r=t,c()}r==i?(r=TypeError(),c()):u(t,function(){c(3)},c,function(){c(1==o&&3)})})}}(e=this).setImmediate||e.addEventListener("message",function(t){if(t.source==e)if(r)s(o[t.data]);else{r=!0;try{o[t.data]()}catch(t){}delete o[t.data],r=!1}}),a.resolve=function(t){if(1!=this._d)throw TypeError();return t instanceof a?t:new a(function(e){e(t)})},a.reject=function(t){if(1!=this._d)throw TypeError();return new a(function(e,n){n(t)})},a.all=function(t){if(1!=this._d)throw TypeError();if(!(t instanceof Array))return a.reject(TypeError());var e=new a;return function n(i,o){return o?e.resolve(o):i?e.reject(i):(0==t.reduce(function(t,e){return e&&e.then?t+1:t},0)&&e.resolve(t),void t.map(function(e,i){e&&e.then&&e.then(function(e){return t[i]=e,n(),e},n)}))}(),e},a.race=function(t){if(1!=this._d)throw TypeError();if(!(t instanceof Array))return a.reject(TypeError());if(0==t.length)return new a;var e=new a;return function n(i,o){return o?e.resolve(o):i?e.reject(i):(0==t.reduce(function(t,e){return e&&e.then?t+1:t},0)&&e.resolve(t),void t.map(function(t,e){t&&t.then&&t.then(function(t){n(null,t)},n)}))}(),e},a._d=1,t.exports=a}()}).call(this,n(14),n(49).setImmediate)},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function e(t){this.url=t}return e.prototype.load=function(){return this._ajax(this.url)},e.prototype.save=function(t,e){return this._ajax(this.url,t,{insert:"POST",delete:"DELETE",update:"POST"}[e]||"POST")},e.prototype._ajax=function(e,n,i){return void 0===i&&(i="GET"),new t(function(t,o){var r=new XMLHttpRequest;switch(r.onload=function(){r.status>=200&&r.status<300?t(r.response||r.responseText):o({status:r.status,statusText:r.statusText})},r.onerror=function(){o({status:r.status,statusText:r.statusText})},r.open(i,e),r.setRequestHeader("Content-Type","application/json"),i){case"POST":case"DELETE":case"PUT":r.send(JSON.stringify(n));break;case"GET":default:r.send()}})},e}();e.DataProxy=n}).call(this,n(13))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(12);e.DataEvents=i.DataEvents,function(t){t.button="button",t.dhxButton="dhxButton",t.imageButton="imageButton",t.selectButton="selectButton",t.input="input",t.separator="separator",t.text="text",t.spacer="spacer",t.menuItem="menuItem",t.block="block",t.customHTMLButton="customButton"}(e.ItemType||(e.ItemType={})),function(t){t.inputCreated="inputcreated",t.click="click",t.openMenu="openmenu"}(e.NavigationBarEvents||(e.NavigationBarEvents={})),function(t){t.pointer="pointer",t.click="click"}(e.NavigationType||(e.NavigationType={}))},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n50&&(r-=55),o=setTimeout(s,r)},a=function(){clearTimeout(o),document.removeEventListener("mouseup",a)};s(),document.addEventListener("mouseup",a)}}}}},e.prototype._initEvents=function(){var t=this,e=null;this.data.events.on(f.DataEvents.change,function(){t.paint(),e&&clearTimeout(e),e=setTimeout(function(){t._normalizeData(),t._resetHotkeys(),e=null,t.paint()},100)}),this.events.on(f.NavigationBarEvents.click,function(e){var n=t.data.getItem(e),i=t.data.getItem(n.parent);if(i&&i.type===f.ItemType.selectButton&&t.data.update(n.parent,{value:n.value,icon:n.icon}),n.group){var o=t._groups[n.group];o.active&&t.data.update(o.active,{active:!1}),o.active=n.id,t.data.update(n.id,{active:!0})}})},e.prototype._drawPopups=function(){var t=this,e=this._activeMenu;if(!this._isContextMenu&&!e)return null;var n=this._currentRoot;return this._isContextMenu&&!this._activePosition?null:this._getParents(e,n).map(function(e){if(!t.data.haveItems(e))return null;var i=t.data.getItem(e)||t._rootItem;return s.el("ul",{class:"dhx_menu",_key:e,_hooks:{didInsert:function(o){var r=o.el.getBoundingClientRect(),s=r.width,a=r.height,c=t._isContextMenu&&t._activePosition&&e===n?t._activePosition:i.$position,u=t._getMode(i,n,c===t._activePosition),d=l.calculatePosition(c,{mode:u,width:s,height:a});i.$style=d,o.patch({style:d})}},tabindex:0,style:i.$style||{position:"absolute"}},t._drawMenuItems(e))}).reverse()},e.prototype._onMenuItemClick=function(t,e){var n=this.data.getItem(t);n.$disabled||(n.twoState&&this.data.update(n.id,{active:!n.active}),this.events.fire(f.NavigationBarEvents.click,[t,e]),this._close())},e.prototype._activeItemChange=function(t){var e=this;t&&!this._documentHaveListener&&this._listenOuterClick(),t&&this.data.haveItems(t)?(this.events.fire(f.NavigationBarEvents.openMenu),this._activeMenu=t,clearTimeout(this._currentTimeout),this.paint()):(this._activeMenu=t,clearTimeout(this._currentTimeout),this._currentTimeout=setTimeout(function(){return e.paint()},400))},e.prototype._resetHotkeys=function(){var t=this;c.keyManager.removeHotKey(null,this),this.data.map(function(e){e.hotkey&&c.keyManager.addHotKey(e.hotkey,function(){return t._onMenuItemClick(e.id,null)},t)})},e.prototype._listenOuterClick=function(){document.addEventListener("click",this._documentClick),this._documentHaveListener=!0},e.prototype._getMode=function(t,e,n){return void 0===n&&(n=!1),t.parent===e?"bottom":"right"},e.prototype._drawMenuItems=function(t){var e=this;return this.data.map(function(t){return e._factory(t,e.events)},t,!1)},e.prototype._normalizeData=function(){var t=this,e=this.data.getRoot(),n={};this.data.eachChild(e,function(e){t.data.haveItems(e.id)&&e.parent!==t.data.getRoot()&&(e.$openIcon="right"),e.group&&function(t,e){t[e.group]?(e.active&&(t[e.group].active=e.id),t[e.group].elements.push(e.id)):t[e.group]={active:e.active?e.id:null,elements:[e.id]}}(n,e)},!0),this._groups=n},e.prototype._setRoot=function(t){},e.prototype._getParents=function(t,e){var n=[],i=!1,o=this.data.getItem(t),r=o&&o.$disabled;return this.data.eachParent(t,function(t){t.id===e?(n.push(t.id),i=!0):i||n.push(t.id)},!r),this._isContextMenu&&this._activePosition&&n.push(e),n},e.prototype._setProp=function(t,e,n){var i,o=this;Array.isArray(t)?t.forEach(function(t){var i;return o.data.update(t,((i={})[e]=n,i))}):this.data.update(t,((i={})[e]=n,i))},e}(u.View);e.MenuBase=p},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(71)),i(n(30))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(5),r=n(2);e.calcTextNodeStyle=function(t){var e={};for(var n in t)if(t[n])switch(n){case r.Modifier.bold:e["font-weight"]="bold";break;case r.Modifier.italic:e["font-style"]="italic";break;case r.Modifier.underline:e["text-decoration"]?e["text-decoration"]+=" underline":e["text-decoration"]="underline";break;case r.Modifier.strike:e["text-decoration"]?e["text-decoration"]+=" line-through":e["text-decoration"]="line-through";break;case r.Modifier.color:e.color=t[n];break;case r.Modifier.background:e.background=t[n];break;case r.Modifier.fontFamily:e["font-family"]=t[n];break;case r.Modifier.fontSize:e["font-size"]=t[n]}return e},e.calcBlockStyle=function(t){var e={};for(var n in t)if(t[n])switch(n){case r.Modifier.align:e["text-align"]=t[n]}return e},e.blockStyleToTag=function(t){return t[r.Modifier.style]?t[r.Modifier.style]:"p"},e.blockquoteWrapper=function(t,e){return t[r.Modifier.blockquote]?function(){for(var t=[],n=0;n=0?e:-1},t.prototype.getId=function(t){if(this._order[t])return this._order[t].id},t.prototype.getLength=function(){return this._order.length},t.prototype.filter=function(t,e){var n=this;if((e=u.extend({add:!1,multiple:!0},e)).add||(this._order=this._initOrder||this._order,this._initOrder=null),this._filters=this._filters||{},e.multiple&&t||(this._filters={}),t){if("function"==typeof t){this._filters._={match:"_",compare:t}}else t.match?(t.compare=t.compare||function(t,e){return t===e},this._filters[t.by]=t):delete this._filters[t.by];var i=this._order.filter(function(t){return Object.keys(n._filters).every(function(e){return t[e]?n._filters[e].compare(t[e],n._filters[e].match,t):n._filters[e].compare(t)})});this._initOrder||(this._initOrder=this._order,this._order=i)}this.events.fire(c.DataEvents.change)},t.prototype.find=function(t){for(var e in this._pull){var n=l.findByConf(this._pull[e],t);if(n)return n}return null},t.prototype.findAll=function(t){var e=[];for(var n in this._pull){var i=l.findByConf(this._pull[n],t);i&&e.push(i)}return e},t.prototype.sort=function(t){this._sort.sort(this._order,t),this._initOrder&&this._initOrder.length&&this._sort.sort(this._initOrder,t),this.events.fire(c.DataEvents.change)},t.prototype.copy=function(t,e,n,o){if(!this.exists(t))return null;var r=u.uid();return n?o?void n.add(i({},this.getItem(t)),e,o):n.exists(t)?(n.add(i({},this.getItem(t),{id:r}),e),r):(n.add(this.getItem(t),e),t):(this.add(i({},this.getItem(t),{id:r}),e),r)},t.prototype.move=function(t,e,n,i){if(n&&n!==this&&this.exists(t)){var o=this.getItem(t);return n.exists(t)&&(o.id=u.uid()),i&&(o.parent=i),n.add(o,e),this.remove(o.id),o.id}if(this.getIndex(t)===e)return null;var r=this._order.splice(this.getIndex(t),1)[0];return-1===e&&(e=this._order.length),this._order.splice(e,0,r),this.events.fire(c.DataEvents.change),t},t.prototype.load=function(t,e){return"string"==typeof t&&(t=new a.DataProxy(t)),this._loader.load(t,e)},t.prototype.parse=function(t,e){return this._removeAll(),this._loader.parse(t,e)},t.prototype.$parse=function(t){var e=this.config.approximate;e&&(t=this._approximate(t,e.value,e.maxNum)),this._parse_data(t),this.events.fire(c.DataEvents.change),this.events.fire(c.DataEvents.load)},t.prototype.save=function(t){this._loader.save(t)},t.prototype.isSaved=function(){return!this._changes.order.length},t.prototype.map=function(t){for(var e=[],n=0;nthis._order.length-1&&(e=this._order.length-1);for(var i=[],o=t;o<=e;o++)i.push(n.call(this,this._order[o],o));return i},t.prototype.reduce=function(t,e){for(var n=0;n=0&&(this._order=this._order.filter(function(e){return e.id!==t}),delete this._pull[t]),this._initOrder&&this._initOrder.length&&(this._initOrder=this._initOrder.filter(function(e){return e.id!==t}))},t.prototype._parse_data=function(t){var e=this._order.length;this.config.prep&&(t=this.config.prep(t));for(var n=0,i=t;n=0&&t[n]?(this._pull[e.id]=e,t.splice(n,0,e)):(this._pull[e.id]=e,t.push(e))},t}();e.DataCollection=d},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n'+t.text+'\n\t';var n=t.node?i.toNode(t.node):document.body;if("static"===getComputedStyle(n).position&&(n.style.position="relative"),!r.has(n)){var a=document.createElement("div");a.className="dhx-message-container "+(t.position?"dhx-message-container--"+t.position:"dhx-message-container--top-right")+(n===document.body?" dhx-message-container--in-body":""),r.set(n,{stack:[],container:a})}var l=r.get(n),c=l.stack,u=l.container;if(0===c.length&&n.appendChild(u),c.push(e),u.appendChild(e),t.expire){var d=setTimeout(function(){return s(e)},t.expire);o.set(e,d)}e.onclick=function(){return s(e,!0)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.beforeHide="beforehide",t.beforeShow="beforeshow",t.afterHide="afterhide",t.afterShow="aftershow"}(e.PopupEvents||(e.PopupEvents={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,o=n(2);!function(t){t[t.backspace=8]="backspace",t[t.enter=13]="enter",t[t.tab=9]="tab",t[t.esc=27]="esc",t[t.space=32]="space",t[t.left=37]="left",t[t.up=38]="up",t[t.right=39]="right",t[t.down=40]="down",t[t.insert=45]="insert",t[t.del=46]="del",t[t.ctrl=17]="ctrl",t[t.a=65]="a",t[t.b=66]="b",t[t.c=67]="c",t[t.s=83]="s",t[t.u=85]="u",t[t.v=86]="v",t[t.x=88]="x",t[t.y=89]="y",t[t.z=90]="z",t[t.i=73]="i"}(i=e.Key||(e.Key={})),e.keyToOperation=function(t){if(t.shiftKey&&t.which===i.enter)return t.preventDefault(),{action:o.Action.add,data:"\n"};switch(t.which){case i.insert:return void t.preventDefault();case i.left:case i.right:case i.down:case i.up:return;case i.backspace:return t.preventDefault(),{action:o.Action.remove,data:!0};case i.del:return t.preventDefault(),{action:o.Action.remove,data:!1};case i.space:return t.preventDefault(),{action:o.Action.add,data:" "};case i.enter:return t.preventDefault(),{action:o.Action.add,data:{newBlock:!0}}}if(t.ctrlKey||t.metaKey)return function(t){switch(t.which){case i.z:return{action:t.shiftKey?o.Action.redo:o.Action.undo};case i.y:return{action:o.Action.redo};case i.a:return{action:o.Action.selectAll};case i.v:case i.x:case i.c:return;case i.u:case i.i:case i.b:return void t.preventDefault()}}(t);var e=t.key;return e.length>1||t.altKey?void 0:(t.preventDefault(),{action:o.Action.add,data:e})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(11);var r={words:function(t){return t.split(/[\n !.?,:;]+/g).filter(function(t){return t.length>0}).length},chars:function(t){return t.replace(/[\n]/g,"").length},charsExlSpace:function(t){return t.replace(/[\n ]/g,"").length}};e.getStats=function(t,e){if(e){for(var n={},i=0,o=e;i=n.text.length)return i.offsetEnd;var o=n.text.slice(0,e),r=n.text.slice(e),a=new s.TextNode(r,n.style);return n.text=o,this.textNodes.splice(t+1,0,a),i.complete},t.prototype.removeNodes=function(t,e){return e?0===t||(this.textNodes=this.textNodes.slice(0,t),!1):t===this.textNodes.length-1||(this.textNodes=this.textNodes.slice(t+1),!1)},t.prototype.offsetToNodePosition=function(t){if(0===t)return{textIndex:0,offset:0};for(var e=this.textNodes,n=0;n":"<"+n+">")},"")+n+t.reduceRight(function(t,e){return t+""+e+">"},"")}function a(t){return t.replace(//g,">").replace(/\n/g,"
").replace(/[ ]{2,}/g,function(t){return" "+function(t,e){for(var n="";e--;)n+=t;return n}(" ",t.length-1)})}e.serializer=function(t){return t.reduce(function(t,e){return t+function(t){var e="",n=t.style,r=t.textNodes,a=[];t.style[i.Modifier.blockquote]&&a.push("blockquote"),a.push(n[i.Modifier.style]||"p");var l=n[i.Modifier.align]?"text-align: "+n[i.Modifier.align]+";":"";if(1===r.length&&!r[0].style[i.Modifier.link]){var c=o(r[0],!0);a.push.apply(a,c.tags);var u=c.inline;return(u||l)&&(e=' style="'+u+l+'"'),s(a,e,c.text)}return l&&(e=' style="'+l+'"'),s(a,e,function(t){for(var e,n="",i="",r="",a=0,l=t;a0&&n[i-1].type===e?(n[i-1].body+=o.body,n.splice(i--,1)):j(o,t,i,null):j(o,t,i,null))}}(t)}}var L={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,order:!0,lineClamp:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function z(t,e){return isNaN(e)||L[t]?e:e+"px"}function F(t,e){var n=(t.attrs||a).style,i=e?(e.attrs||a).style:null;if(null==n||f(n))t.el.style.cssText=n;else{for(var o in n){var r=n[o];(null==i||null!=r&&r!==i[o])&&(t.el.style[o]=z(o,r))}if(i)for(var s in i)null==n[s]&&(t.el.style[s]="")}}var V=[];function H(t,e,n,i,o){if(null!=t){var r=n.hooks[e];if(r){if("d"!==e[0]||"i"!==e[1]||"d"!==e[2])return r(n,i);o?w(n.parent)&&r(n,i):V.push([r,n,i])}}}function $(t){var e;if(V.length)for(w(t.node);e=V.shift();)e[0](e[1],e[2])}var q=r?document:null;function U(t){return t.nextSibling}function W(t,e,n){var i=e._node,o=i.vm;if(c(i.body))if((i.flags&P)===P)for(var r=0;r>1]===t)return n;e[n]0&&(i[r]=o[e-1]),o[e]=r)}}for(e=o.length,n=o[e-1];e-- >0;)o[e]=n,n=i[n];return o}(r).map(function(t){return r[t]}),c=0;cu&&(y=null,_=!1):k=!0,u>100&&k&&++b%10==0))for(;w1){var r=1;d(i[1])&&(n=i[1],r=2),e=o===r+1&&(f(i[r])||c(i[r])||n&&(n._flags&A)===A)?i[r]:v(i,r)}return B(t,n,e)}return S.patch=function(t,e){!function(t,e,n){if(null!=e.type){if(null!=t.vm)return;j(e,t.parent,t.idx,null),t.parent.body[t.idx]=e,bt(e,t),n&&w(e),$(M(e))}else{var i=Object.create(t);i.attrs=_({},t.attrs);var o=_(t.attrs,e);if(null!=t._class){var r=o.class;o.class=null!=r&&""!==r?t._class+" "+r:t._class}st(t,i),n&&w(t)}}(this,t,e)},wt.emit=function(t){var e=this,n=e,i=v(arguments,1).concat(n,n.data);do{var o=e.onemit,r=o?o[t]:null;if(r){r.apply(e,i);break}}while(e=e.parent());J[t]&&J[t].apply(e,i)},wt.onemit=null,wt.body=function(){return function t(e,n){var i=e.body;if(c(i))for(var o=0;oe.size&&(i=e.size-e.resizerLength),e.mode){case r.pixels:t.config[o]=i-e.resizerLength/2+"px",e.nextCell.config[o]=e.size-i-e.resizerLength/2+"px";break;case r.mixedpx1:t.config[o]=i-e.resizerLength/2+"px";break;case r.mixedpx2:e.nextCell.config[o]=e.size-i-e.resizerLength/2+"px";break;case r.percents:t.config[o]=i/e.size*e.percentsum+"%",e.nextCell.config[o]=(e.size-i)/e.size*e.percentsum+"%";break;case r.mixedperc1:t.config[o]=i/e.size*e.percentsum+"%";break;case r.mixedperc2:e.nextCell.config[o]=(e.size-i)/e.size*e.percentsum+"%"}t.paint()}};this._handlers={collapse:function(){t.config.canCollapse&&(t.config.collapsed=!t.config.collapsed,t.paint())}},this._resizerHandlers={onmousedown:function(o){if(3!==o.which){e.isActive&&n(),document.body.classList.add("dhx_no-select");var s=t.getCellView(),a=t._getNextCell(),l=a.getCellView(),c=t._getResizerView(),u=s.el.getBoundingClientRect(),d=c.el.getBoundingClientRect(),h=l.el.getBoundingClientRect();if(e.xLayout=t._isXDirection(),e.left=u.left+window.pageXOffset,e.top=u.top+window.pageYOffset,e.range=function(t,e,n){return void 0===n&&(n=!0),n?{min:t.left+window.pageXOffset,max:e.right+window.pageXOffset}:{min:t.top+window.pageYOffset,max:e.bottom+window.pageYOffset}}(u,h,e.xLayout),e.size=e.range.max-e.range.min,e.isActive=!0,e.nextCell=a,e.resizerLength=e.xLayout?d.width:d.height,e.mode=function(t,e,n){var i=t?"width":"height",o=e[i]&&-1!==e[i].indexOf("%"),s=n[i]&&-1!==n[i].indexOf("%"),a=e[i]&&-1!==e[i].indexOf("px"),l=n[i]&&-1!==n[i].indexOf("px");return o&&s?r.percents:a&&l?r.pixels:a&&!l?r.mixedpx1:l&&!a?r.mixedpx2:o?r.mixedperc1:s?r.mixedperc2:r.unknown}(e.xLayout,t.config,a.config),e.mode===r.percents){var f=e.xLayout?"width":"height";e.percentsum=parseFloat(t.config[f])+parseFloat(a.config[f])}if(e.mode===r.mixedperc1){f=e.xLayout?"width":"height";e.percentsum=1/(u[f]/(e.size-e.resizerLength))*parseFloat(t.config[f])}if(e.mode===r.mixedperc2){f=e.xLayout?"width":"height";e.percentsum=1/(h[f]/(e.size-e.resizerLength))*parseFloat(a.config[f])}document.addEventListener("mouseup",n),document.addEventListener("mousemove",i)}},ondragstart:function(t){return t.preventDefault()}}},e.prototype._isLastCell=function(){var t=this._parent;return t&&t._cells.indexOf(this)===t._cells.length-1},e.prototype._getNextCell=function(){var t=this._parent,e=t._cells.indexOf(this);return t._cells[e+1]},e.prototype._getResizerView=function(){return this._parent.getRefs("resizer_"+this._uid)},e.prototype._isXDirection=function(){return this._parent&&this._parent._xLayout},e.prototype._calculateStyle=function(){var t=this.config,e={};return this._isXDirection()?(void 0!==this.config.width&&(e.flexBasis=t.width),void 0!==t.height&&(e.height=t.height)):(void 0!==this.config.height&&(e.flexBasis=t.height),void 0!==t.width&&(e.width=t.width)),e},e}(l.View);e.Cell=c},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),r=n(0),s=n(1),a=n(22),l=n(28);var c=function(t){function e(e,n){var i=t.call(this,e,o.extend({navigationType:"click"},n))||this;i._listeners={input:function(t){var e=s.locate(t);i.data.update(e,{value:t.target.value})},tooltip:function(t){var e=s.locateNode(t);if(e){var n=e.getAttribute("dhx_id"),o=i.data.getItem(n);o.tooltip&&l.tooltip(o.tooltip,{node:e,position:l.Position.bottom})}}},i._currentRoot=null,i._factory=a.createFactory(a.ItemType.button);return i.mount(e,r.create({render:function(){return i._draw()}})),i}return i(e,t),e.prototype.getValues=function(){var t={};for(var e in this.data.eachChild(this.data.getRoot(),function(e){e.twoState?t[e.id]=e.active:e.type===a.ItemType.input&&(t[e.id]=e.value)},!1),this._groups)this._groups[e].active&&(t[e]=this._groups[e].active);return t},e.prototype.setValues=function(t){for(var e in t){if(this._groups[e])this._groups[e].active&&(this.data.update(this._groups[e].active,{active:!1}),this._groups[e].active=t[e],this.data.update(t[e],{active:!0}));else this.data.getItem(e).type===a.ItemType.input?this.data.update(e,{value:t[e]}):this.data.update(e,{active:t[e]})}},e.prototype._draw=function(){var t=this;return r.el("nav.dhx_toolbar.dhx_widget"+(this.config.css?"."+this.config.css:""),[r.el("ul.dhx_toolbar__list",{dhx_widget_id:this._uid,tabindex:0,onclick:this._handlers.onclick,onmousedown:this._handlers.onmousedown,oninput:this._listeners.input,onmouseover:this._listeners.tooltip,_hooks:{didInsert:function(e){e.el.addEventListener("keyup",function(e){if(9===e.which){var n=s.locateNode(document.activeElement);if(n){var i=n.getAttribute("dhx_id"),o=t.data.getItem(i);o.tooltip&&l.tooltip(o.tooltip,{node:n,position:l.Position.bottom,force:!0})}}},!0)}}},this.data.map(function(e){return t._factory(e,t.events)},this.data.getRoot(),!1))])},e.prototype._getMode=function(t,e){return t.id===e?"bottom":"right"},e.prototype._close=function(){this._activePosition=null,this._currentRoot=null,t.prototype._close.call(this)},e.prototype._normalizeData=function(){var t=this,e=this.data.getRoot(),n={};this.data.eachChild(e,function(i){i.type===a.ItemType.separator&&(i.$menuSeparator=i.parent!==t.data.getRoot()),t.data.haveItems(i.id)&&(t.data.eachChild(i.id,function(t){return t.type=t.type||a.ItemType.menuItem},!1),i.parent!==e?i.$openIcon="right":i.$openIcon="bot"),i.group&&function(t,e){t[e.group]?(e.active&&(t[e.group].active=e.id),t[e.group].elements.push(e.id)):t[e.group]={active:e.active?e.id:null,elements:[e.id]}}(n,i)},!0),this._groups=n},e.prototype._setRoot=function(t){this.data.getParent(t)===this.data.getRoot()&&(this._currentRoot=t)},e}(a.MenuBase);e.Toolbar=c},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._isContextMenu=!0,e}return i(e,t),e.prototype.showAt=function(t,e){if(void 0===e&&(e="bottom"),t instanceof MouseEvent)this._changeActivePosition({left:window.pageXOffset+t.x+1,right:window.pageXOffset+t.x+1,top:window.pageYOffset+t.y,bottom:window.pageYOffset+t.y},e);else{var n=o.toNode(t);this._changeActivePosition(o.getRealPosition(n),e)}},e.prototype._close=function(){this._activeMenu=null,this._changeActivePosition(null,null)},e.prototype._normalizeData=function(){var t=this,e=this.data.getRoot();this.data.eachChild(e,function(e){t.data.haveItems(e.id)&&(e.$openIcon="right")},!0)},e.prototype._getMode=function(t,e,n){return n?this._mode:"right"},e.prototype._changeActivePosition=function(t,e){this._activePosition=t,this._mode=e,this._listenOuterClick(),this.paint()},e}(n(17).MenuBase);e.ContextMenu=r},function(t,e,n){"use strict";function i(t){for(var e=t.toLowerCase().match(/\w+/g),n=0,i="",o=0;o=48&&e.which<=57||e.which>=65&&e.which<=90?String.fromCharCode(e.which):e.key).toLowerCase(),i=t._keysStorage[n];if(i)for(var o=0;o=0;s--)n[o].splice(r[s],1)}},t.prototype.exist=function(t){var e=i(t);return!!this._keysStorage[e]},t}();e.keyManager=new o,e.addHotkeys=function(t,n){var i=new Date,o=function(t){return function(e){n&&!1===n()||t(e)}};for(var r in t)e.keyManager.addHotKey(r,o(t[r]),i);return function(){return e.keyManager.removeHotKey(void 0,i)}}},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(9)),i(n(23)),i(n(26)),i(n(53)),i(n(15)),i(n(10)),i(n(24)),i(n(25)),i(n(55))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),o=function(){function e(t,e){this._parent=t,this._changes=e}return e.prototype.load=function(t,e){var n=this;return this._parent.loadData=t.load().then(function(t){n._parent.removeAll(),n.parse(t,e)})},e.prototype.parse=function(t,e){void 0===e&&(e="json"),t=(e=i.toDataDriver(e)).toJsonArray(t),this._parent.$parse(t)},e.prototype.save=function(e){for(var n=this,o=function(o){if(o.saving||o.pending)i.dhxWarning("item is saving");else{var s=r._findPrevState(o.id);if(s&&s.saving){var a=new t(function(t,r){s.promise.then(function(){o.pending=!1,t(n._setPromise(o,e))}).catch(function(t){n._removeFromOrder(s),n._setPromise(o,e),i.dhxWarning(t),r(t)})});r._addToChain(a),o.pending=!0}else r._setPromise(o,e)}},r=this,s=0,a=this._changes.order;s=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(50),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(14))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,o=1,r={},s=!1,a=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick(function(){u(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&u(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),i=function(n){t.postMessage(e+n,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){u(t.data)},i=function(e){t.port2.postMessage(e)}}():a&&"onreadystatechange"in a.createElement("script")?function(){var t=a.documentElement;i=function(e){var n=a.createElement("script");n.onreadystatechange=function(){u(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():i=function(t){setTimeout(u,0,t)},l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n=.75?i.bot:i.in}else if(this._lastId===u&&this._lastCollectionId===f)return;if(u&&f||!this._canMove)if(d=[h={id:this._transferData.id,target:this._transferData.target},{id:u,target:s.collectionStore.getItem(f)}],h.target.events.fire(r.DragEvents.dragOut,d),f!==this._transferData.targetId||!(h.target.data instanceof a.TreeCollection)||h.target.data instanceof a.TreeCollection&&h.target.data.canCopy(h.id,u))this._cancelCanDrop(),this._lastId=u,this._lastCollectionId=f,d.push(this._transferData.dropPosition),h.target.events.fire(r.DragEvents.dragIn,d)&&this._canDrop();else this._cancelCanDrop();else this._cancelCanDrop()}else this._cancelCanDrop()},t.prototype._move=function(t,e){var n=t.target.data,o=e.target.data,r=0,s=e.id;switch(this._transferData.dragConfig.behaviour){case l.DragBehaviour.child:break;case l.DragBehaviour.sibling:s=o.getParent(s),r=o.getIndex(e.id)+1;break;case l.DragBehaviour.complex:var a=this._transferData.dropPosition;a===i.top?(s=o.getParent(s),r=o.getIndex(e.id)):a===i.bot&&(s=o.getParent(s),r=o.getIndex(e.id)+1)}this._transferData.dragConfig.copy?n.copy(t.id,r,o,s):n.move(t.id,r,o,s)},t.prototype._endDrop=function(){this._toggleTextSelection(!1),this._transferData.target&&this._transferData.target.events.fire(r.DragEvents.dragEnd),this._cancelCanDrop(),this._canMove=!0,this._transferData={},this._lastId=null,this._lastCollectionId=null},t.prototype._cancelCanDrop=function(){this._canMove=!1;var t=s.collectionStore.getItem(this._lastCollectionId);t&&this._lastId&&t.events.fire(r.DragEvents.cancelDrop,[this._lastId])},t.prototype._canDrop=function(){this._canMove=!0;var t=s.collectionStore.getItem(this._lastCollectionId);t&&this._lastId&&t.events.fire(r.DragEvents.canDrop,[this._lastId,this._transferData.dropPosition])},t.prototype._toggleTextSelection=function(t){t?document.body.classList.add("dhx_no-select"):document.body.classList.remove("dhx_no-select")},t}();e.dragManager=new c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this._store={}}return t.prototype.setItem=function(t,e,n){this._store[t]={target:e,config:n}},t.prototype.getItem=function(t){return this._store[t]?this._store[t].target:null},t.prototype.getItemConfig=function(t){return this._store[t]?this._store[t].config:null},t}();e.collectionStore=new i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(7),o=n(12),r=n(9),s=function(){function t(t,e,n){var o=this;this.events=n||new i.EventSystem,this._data=e,this._data.events.on(r.DataEvents.removeAll,function(){o._selected=null}),this._data.events.on(r.DataEvents.change,function(){if(o._selected){var t=o._data.getNearId(o._selected);t!==o._selected&&(o._selected=null,t&&o.add(t))}})}return t.prototype.getId=function(){return this._selected},t.prototype.getItem=function(){return this._selected?this._data.getItem(this._selected):null},t.prototype.remove=function(t){return!(t=t||this._selected)||!!this.events.fire(o.SelectionEvents.beforeUnSelect,[t])&&(this._data.update(t,{$selected:!1}),this._selected=null,this.events.fire(o.SelectionEvents.afterUnSelect,[t]),!0)},t.prototype.add=function(t){this._selected!==t&&(this.remove(),this.events.fire(o.SelectionEvents.beforeSelect,[t])&&(this._selected=t,this._data.update(t,{$selected:!0}),this.events.fire(o.SelectionEvents.afterSelect,[t])))},t}();e.Selection=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(6);e.button=function(t){return i.el("li.dhx_toolbar__item",[i.el("button",{class:"dhx_toolbar-button dhx_button dhx_toolbar__button "+o.getIconButtonClass(t)+o.getCss(t),dhx_id:t.id,disabled:t.$disabled},[o.counter(t),t.icon?o.icon(t.icon,"button"):null,i.el("span.dhx_button__text",t.value),t.$openIcon?i.el("span.dhx_button__icon.dhx_button__icon--menu-down.dxi.dxi-menu-down"):null])])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(6);e.customHTMLButton=function(t){return i.el("li.dhx_toolbar__item",[i.el("button",{class:"dhx_button dhx_toolbar__button--custom_html"+o.getCss(t),dhx_id:t.id},[o.counter(t),i.el(".dhx_toolbar-button__html-wrapper",{".innerHTML":t.html}),t.value?i.el("span.dhx_button__text",t.value):null])])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(6);e.dhxButton=function(t){return i.el("li.dhx_toolbar__item",[i.el("button",{class:"dhx_button dhx_toolbar__button"+o.getCss(t)+(!t.value&&t.icon?" dhx_button--icon":""),dhx_id:t.id,disabled:t.$disabled},[o.counter(t),t.icon?o.icon(t.icon,"button"):null,t.value?i.el("span.dhx_button__text",t.value):null,t.$openIcon?i.el("span.dhx_button__icon.dhx_button__icon--menu-down.dxi.dxi-menu-down"):null])])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(6);e.imageButton=function(t){return i.el("li.dhx_toolbar__item",[i.el("button",{class:"dhx_button dhx_toolbar__button dhx_toolbar-img-button"+o.getCss(t),dhx_id:t.id},[o.counter(t),i.el("div.dhx_toolbar-img-button__text",t.value),i.el("img.dhx_toolbar-img-button__image",{src:t.src})])])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(16),r=n(6);e.input=function(t,e){return i.el("li.dhx_toolbar__item",{},[i.el(".dhx_form-group.dhx_form-group--no-message-holder.dhx_form-group--label_sr",{class:r.getCss(t)+t.icon},[i.el("input.dhx_input",{placeholder:t.placeholder,value:t.value,dhx_id:t.id,style:{width:t.width?t.width:null},_hooks:{didInsert:function(n){e&&e.fire(o.NavigationBarEvents.inputCreated,[t.id,n.el])}},_key:t.id}),i.el("label.dhx_label",{for:t.id},t.label),i.el(".input-animation")])])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(6);e.menuItem=function(t){return i.el("li.dhx_menu__item",[i.el("button",{class:"dhx_menu__button dhx_button dhx_button--type_link dhx_button--color_secondary dhx_button--width_full"+o.getCss(t),dhx_id:t.id},[t.icon?o.icon(t.icon,"menu"):null,t.value?i.el("span.dhx_menu__text",t.value):null,t.$openIcon?i.el("span.dhx_menu__icon.dhx_menu__icon--submenu.dxi.dxi-menu-right"):null,t.hotkey?i.el("span.span.dhx_menu__hotkey",t.hotkey):null])])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0);e.separator=function(t){var e=t.$menuSeparator?"dhx_menu__item dhx_menu__separator":"dhx_toolbar__item dhx_toolbar__separator";return i.el("li",{class:e,"aria-hidden":"true"})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0);e.spacer=function(t){return i.el("li",{class:"dhx_toolbar__item dhx_toolbar__spacer","aria-hidden":"true"})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(6);e.text=function(t){return i.el("li.dhx_toolbar__item",[i.el("span",{class:"dhx_toolbar__text"+o.getCss(t)},t.value)])}},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n
"+c(t.message+"",!0)+"
";throw t}}_.exec=_,y.options=y.setOptions=function(t){return v(y.defaults,t),y},y.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new s,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},y.defaults=y.getDefaults(),y.Parser=l,y.parser=l.parse,y.Renderer=s,y.TextRenderer=a,y.Lexer=i,y.lexer=i.lex,y.InlineLexer=r,y.inlineLexer=r.output,y.parse=y,t.exports=y}(this||"undefined"!=typeof window&&window)}).call(this,n(14))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(85),o=n(2),r=function(){function t(t){this._editor=t,this.clearChanges(),this._buffer=new i.TextBuffer(this._editor)}return t.prototype.execute=function(t){var e,n=this;switch(this._inactionTimer&&(clearTimeout(this._inactionTimer),this._inactionTimer=null),this._inactionTimer=setTimeout(function(){n._editor.selection.isActive()&&n._editor.balance(),n._inactionTimer=null},5e3),t.action){case o.Action.parse:return e=this._editor.parse(t.data.value,t.data.mode),this.clearChanges(),!0;case o.Action.add:e=this._editor.add(t.data);break;case o.Action.innerAdd:if("string"==typeof t.data)e=this._editor.add(t.data);else{var i=t.data,r=i.data;switch(i.type){case"text":e=this._editor.add(r);break;case"full":e=this._editor.paste(JSON.stringify(r),"inner");break;case"textnode":e=this._editor.paste(JSON.stringify([{textNodes:[r],style:{}}]),"inner")}}break;case o.Action.remove:e=this._editor.remove(t.data);break;case o.Action.update:e=this._editor.update(t.data);break;case o.Action.clear:e=this._editor.clearStyles();break;case o.Action.paste:e=this._buffer.paste(t.data);break;case o.Action.cut:e=this._buffer.cut(t.data);break;case o.Action.copy:return this._buffer.copy(t.data),!0;case o.Action.selectAll:}return e?(this._change(),!0):t.action===o.Action.undo?this.undo():t.action===o.Action.redo&&this.redo()},t.prototype.canUndo=function(){return null!==this._changes.prev},t.prototype.canRedo=function(){return null!==this._changes.next},t.prototype.undo=function(){var t=this._changes.prev;return!!t&&(this._editor.setState(t.state),this._changes=t,!0)},t.prototype.redo=function(){var t=this._changes.next;return!!t&&(this._editor.setState(t.state),this._changes=t,!0)},t.prototype.clearChanges=function(){this._changes={prev:null,next:null,state:this._editor.getState()}},t.prototype._change=function(){var t={prev:this._changes,next:null,state:this._editor.getState()};this._changes.next=t,this._changes=t},t}();e.Manager=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(35),o=function(){function t(t){this._editor=t}return t.prototype.copy=function(t){t.preventDefault();var e=this._editor.copy();return this._setBuffer(t,e)},t.prototype.cut=function(t){t.preventDefault();var e=this._editor.cut();return this._setBuffer(t,e)},t.prototype.paste=function(t){var e;if(t.preventDefault(),(e=t.clipboardData?t.clipboardData.getData("text/plain"):window.clipboardData.getData("text"))===this._rawText)return this._editor.paste(this._editorContent,"inner");var n=function(t){if(!t.clipboardData)return;if(-1!==t.clipboardData.types.indexOf("text/html"))return t.clipboardData.getData("text/html")}(t);return n?this._editor.paste(n,"html"):this._editor.paste(e,"text")},t.prototype._setBuffer=function(t,e){return!!e&&(this._rawText=e.raw,this._editorContent=JSON.stringify(e.content),t.clipboardData?(t.clipboardData.setData("text/plain",e.raw),t.clipboardData.setData("text/html",i.serializer(e.content))):window.clipboardData.setData("text",e.raw),!0)},t}();e.TextBuffer=o},function(t,e,n){"use strict";(function(t){var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n0?(t=s.getRangeAt(0),s.removeAllRanges()):t=document.createRange();var l,c=this._editor.getTextElement(i.blockIndex,i.textIndex);if(!c)return!1;if(t.setStart(c,Math.min(i.offset,c.length)),r){if(!(l=this._editor.getTextElement(o.blockIndex,o.textIndex)))return!1;t.setEnd(l,Math.min(o.offset,l.length))}else t.setEnd(c,Math.min(i.offset,c.length));return s.addRange(t),this._waitUpdate=!1,this._events.fire(a.RichTextEvents.selectionRefresh,[]),!0},e.prototype._initEvents=function(){document.addEventListener("selectionchange",this._selectionChange)},e.prototype._createRange=function(t){var e=t.left,n=t.right,i=document.createRange(),o=this._editor.getTextElement(e.blockIndex,e.textIndex);if(i.setStart(o,e.offset),t.range){var r=this._editor.getTextElement(n.blockIndex,n.textIndex);i.setEnd(r,n.offset)}else i.setEnd(o,e.offset);return i},e}();function c(t){var e={},n=t.getBoundingClientRect();return 0===n.height&&(n=t.getClientRects()[0]),e.xStart=n.left+window.pageXOffset,e.yStart=n.top+window.pageYOffset,t.collapse(!1),n=t.getClientRects()[0],e.xEnd=n.left+window.pageXOffset,e.yEnd=n.top+window.pageYOffset,e}e.SelectionHelper=l}).call(this,n(13))},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n