jodit 4.14.2 → 4.14.3
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/CHANGELOG.md +21 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +7 -7
- package/es2015/jodit.js +469 -313
- package/es2015/jodit.min.js +5 -5
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.js +7 -7
- package/es2018/jodit.min.js +5 -5
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +9 -9
- package/es2021/jodit.js +456 -304
- package/es2021/jodit.min.js +6 -6
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +5 -5
- package/es2021.en/jodit.js +395 -251
- package/es2021.en/jodit.min.js +5 -5
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +701 -381
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/selection/helpers/index.js +5 -2
- package/esm/core/selection/selection.d.ts +8 -5
- package/esm/core/selection/selection.js +267 -159
- package/esm/core/selection/style/api/extract.js +1 -3
- package/esm/core/selection/style/api/is-same-attributes.js +5 -2
- package/esm/core/selection/style/api/toggle-attributes.js +27 -10
- package/esm/core/selection/style/api/unwrap-children.js +39 -33
- package/esm/core/selection/style/apply-style.js +23 -25
- package/esm/core/selection/style/commit-style.js +3 -0
- package/esm/core/selection/style/transactions.js +2 -1
- package/esm/langs/az.d.ts +223 -0
- package/esm/langs/az.js +240 -0
- package/esm/languages.js +2 -0
- package/esm/modules/history/snapshot.js +45 -20
- package/esm/types/style.d.ts +2 -2
- package/esm/types/types.d.ts +3 -0
- package/package.json +1 -1
- package/types/core/selection/selection.d.ts +8 -5
- package/types/langs/az.d.ts +223 -0
- package/types/types/style.d.ts +2 -2
- package/types/types/types.d.ts +3 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.14.
|
|
4
|
+
* Version: v4.14.3
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
8
8
|
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("{}"));else if("function"==typeof define&&define.amd)define(["{}"],e);else{var i="object"==typeof exports?e(require("{}")):e(t["{}"]);for(var o in i)("object"==typeof exports?exports:t)[o]=i[o]}}(self,function(t){var e={5266:function(t,e,i){"use strict";i.d(e,{Config:function(){return r}});var o=i(25045),s=i(81937);let n={};class r{static get defaultOptions(){return r.__defaultOptions||(r.__defaultOptions=new r),r.__defaultOptions}constructor(){(0,o._)(this,"cache",!0),(0,o._)(this,"defaultTimeout",100),(0,o._)(this,"namespace",""),(0,o._)(this,"safeMode",!1),(0,o._)(this,"width","auto"),(0,o._)(this,"height","auto"),(0,o._)(this,"safePluginsList",["about","enter","backspace","size","bold","hotkeys"]),(0,o._)(this,"commandToHotkeys",void 0),(0,o._)(this,"license",""),(0,o._)(this,"preset","custom"),(0,o._)(this,"presets",{inline:{inline:!0,toolbar:!1,toolbarInline:!0,toolbarInlineForSelection:!0,showXPathInStatusbar:!1,showCharsCounter:!1,showWordsCounter:!1,showPlaceholder:!1}}),(0,o._)(this,"ownerDocument",s.globalDocument),(0,o._)(this,"ownerWindow",s.globalWindow),(0,o._)(this,"shadowRoot",null),(0,o._)(this,"nonce",""),(0,o._)(this,"zIndex",0),(0,o._)(this,"readonly",!1),(0,o._)(this,"disabled",!1),(0,o._)(this,"activeButtonsInReadOnly",["source","fullsize","print","about","dots","selectall"]),(0,o._)(this,"allowCommandsInReadOnly",["selectall","preview","print"]),(0,o._)(this,"toolbarButtonSize","middle"),(0,o._)(this,"allowTabNavigation",!1),(0,o._)(this,"inline",!1),(0,o._)(this,"theme","default"),(0,o._)(this,"saveModeInStorage",!1),(0,o._)(this,"asyncStorage",{}),(0,o._)(this,"editorClassName",!1),(0,o._)(this,"className",!1),(0,o._)(this,"style",!1),(0,o._)(this,"containerStyle",!1),(0,o._)(this,"styleValues",{}),(0,o._)(this,"triggerChangeEvent",!0),(0,o._)(this,"direction",""),(0,o._)(this,"language","auto"),(0,o._)(this,"debugLanguage",!1),(0,o._)(this,"i18n",!1),(0,o._)(this,"tabIndex",-1),(0,o._)(this,"toolbar",!0),(0,o._)(this,"statusbar",!0),(0,o._)(this,"showTooltip",!0),(0,o._)(this,"showTooltipDelay",200),(0,o._)(this,"useNativeTooltip",!1),(0,o._)(this,"defaultActionOnPaste",s.INSERT_AS_HTML),(0,o._)(this,"enter",s.PARAGRAPH),(0,o._)(this,"iframe",!1),(0,o._)(this,"editHTMLDocumentMode",!1),(0,o._)(this,"enterBlock","br"!==this.enter?this.enter:s.PARAGRAPH),(0,o._)(this,"defaultMode",s.MODE_WYSIWYG),(0,o._)(this,"useSplitMode",!1),(0,o._)(this,"colors",{greyscale:["#000000","#434343","#666666","#999999","#B7B7B7","#CCCCCC","#D9D9D9","#EFEFEF","#F3F3F3","#FFFFFF"],palette:["#980000","#FF0000","#FF9900","#FFFF00","#00F0F0","#00FFFF","#4A86E8","#0000FF","#9900FF","#FF00FF"],full:["#E6B8AF","#F4CCCC","#FCE5CD","#FFF2CC","#D9EAD3","#D0E0E3","#C9DAF8","#CFE2F3","#D9D2E9","#EAD1DC","#DD7E6B","#EA9999","#F9CB9C","#FFE599","#B6D7A8","#A2C4C9","#A4C2F4","#9FC5E8","#B4A7D6","#D5A6BD","#CC4125","#E06666","#F6B26B","#FFD966","#93C47D","#76A5AF","#6D9EEB","#6FA8DC","#8E7CC3","#C27BA0","#A61C00","#CC0000","#E69138","#F1C232","#6AA84F","#45818E","#3C78D8","#3D85C6","#674EA7","#A64D79","#85200C","#990000","#B45F06","#BF9000","#38761D","#134F5C","#1155CC","#0B5394","#351C75","#733554","#5B0F00","#660000","#783F04","#7F6000","#274E13","#0C343D","#1C4587","#073763","#20124D","#4C1130"]}),(0,o._)(this,"colorPickerDefaultTab","background"),(0,o._)(this,"imageDefaultWidth",300),(0,o._)(this,"removeButtons",[]),(0,o._)(this,"disablePlugins",[]),(0,o._)(this,"extraPlugins",[]),(0,o._)(this,"basePath",void 0),(0,o._)(this,"extraButtons",[]),(0,o._)(this,"extraIcons",{}),(0,o._)(this,"createAttributes",{table:{style:"border-collapse:collapse;width: 100%;"}}),(0,o._)(this,"sizeLG",900),(0,o._)(this,"sizeMD",700),(0,o._)(this,"sizeSM",400),(0,o._)(this,"buttons",[{group:"font-style",buttons:[]},{group:"list",buttons:[]},{group:"font",buttons:[]},"---",{group:"script",buttons:[]},{group:"media",buttons:[]},`
|
|
9
|
-
`,{group:"state",buttons:[]},{group:"clipboard",buttons:[]},{group:"insert",buttons:[]},{group:"indent",buttons:[]},{group:"color",buttons:[]},{group:"form",buttons:[]},"---",{group:"history",buttons:[]},{group:"search",buttons:[]},{group:"source",buttons:[]},{group:"other",buttons:[]},{group:"info",buttons:[]}]),(0,o._)(this,"controls",void 0),(0,o._)(this,"events",{}),(0,o._)(this,"textIcons",!1),(0,o._)(this,"popupRoot",null),(0,o._)(this,"showBrowserColorPicker",!0),Object.assign(this,n)}}(0,o._)(r,"__defaultOptions",void 0),n=r.prototype,r.prototype.controls={}},24735:function(t,e,i){"use strict";i.d(e,{Async:function(){return f}});var o=i(25045),s=i(81937),n=i(61077),r=i(72068),a=i(91565),l=i(72412),c=i(62101),u=i(52100),h=i(85932),d=i(18303),p=i(28712),m=i(14228);class f{delay(t){return this.promise(e=>this.setTimeout(e,t))}setTimeout(t,e,...i){if(this.isDestructed)return 0;let o={};(0,d.isVoid)(e)&&(e=0),(0,l.isNumber)(e)||(e=(o=e).timeout||0),o.label&&this.clearLabel(o.label);let s=(0,n.setTimeout)(t,e,...i),r=o.label||s;return this.timers.set(r,s),this.__callbacks.set(r,t),s}updateTimeout(t,e){if((0,p.assert)(t&&this.timers.has(t),"Label does not exist"),!t||!this.timers.has(t))return null;let i=this.__callbacks.get(t);return(0,p.assert)((0,a.isFunction)(i),"Callback is not a function"),this.setTimeout(i,{label:t,timeout:e})}clearLabel(t){t&&this.timers.has(t)&&((0,n.clearTimeout)(this.timers.get(t)),this.timers.delete(t),this.__callbacks.delete(t))}clearTimeout(t){if((0,h.isString)(t))return this.clearLabel(t);(0,n.clearTimeout)(t),this.timers.delete(t),this.__callbacks.delete(t)}debounce(t,e,i=!1){let o=0,s=!1,l=[],h=(...e)=>{if(!s){o=0;let i=t(...e);if(s=!0,l.length){let t=()=>{l.forEach(t=>t()),l.length=0};(0,u.isPromise)(i)?i.finally(t):t()}}},d=(...r)=>{s=!1,e?(!o&&i&&h(...r),(0,n.clearTimeout)(o),o=this.setTimeout(()=>h(...r),(0,a.isFunction)(e)?e():e),this.timers.set(t,o)):h(...r)};return(0,c.isPlainObject)(e)&&e.promisify?(...t)=>{let e=this.promise(t=>{l.push(t)}).catch(t=>{if((0,r.isAbortError)(t))return null;throw t});return d(...t),e}:d}microDebounce(t,e=!1){let i,o=!1,s=!0;return(...n)=>{if(i=n,o){s=!0;return}s=!0,e&&(s=!1,t(...i)),o=!0,this.__queueMicrotaskNative(()=>{o=!1,!this.isDestructed&&s&&t(...i)})}}throttle(t,e,i=!1){let o=null,s,n,r;return(...i)=>{(s=!0,r=i,e)?o||(n=()=>{s?(t(...r),s=!1,o=this.setTimeout(n,(0,a.isFunction)(e)?e():e),this.timers.set(n,o)):o=null})():t(...r)}}promise(t){let e=()=>{},i=new Promise((i,o)=>{e=()=>o((0,m.abort)("Abort async")),this.promisesRejections.add(e),t(i,o)});return!i.finally&&"u">typeof process&&!s.IS_ES_NEXT&&(i.finally=t=>(i.then(t).catch(t),i)),i.finally(()=>{this.promisesRejections.delete(e)}).catch(()=>null),i.rejectCallback=e,i}promiseState(t){if(t.status)return t.status;if(!Promise.race)return new Promise(e=>{t.then(t=>(e("fulfilled"),t),t=>{throw e("rejected"),t}),this.setTimeout(()=>{e("pending")},100)});let e={};return Promise.race([t,e]).then(t=>t===e?"pending":"fulfilled",()=>"rejected")}requestIdleCallback(t,e={timeout:100}){let i=this.__requestIdleCallbackNative(t,e);return this.__requestsIdle.add(i),i}requestIdlePromise(t){return this.promise(e=>{let i=this.requestIdleCallback(()=>e(i),t)})}schedulerPostTask(t,e={delay:0,priority:"user-visible"}){let i=new AbortController;if(e.signal&&e.signal.addEventListener("abort",()=>i.abort()),this.__controllers.add(i),void 0!==globalThis.scheduler){let o=globalThis.scheduler.postTask(t,{...e,signal:i.signal});return o.finally(()=>{this.__controllers.delete(i)}).catch(()=>null),o}return this.promise((o,s)=>{let n=this.setTimeout(()=>{try{o(t())}catch(t){s(t)}this.__controllers.delete(i)},e.delay||1);i.signal.addEventListener("abort",()=>{this.clearTimeout(n),this.__controllers.delete(i),s((0,m.abort)())})})}schedulerYield(){return this.schedulerPostTask(()=>{},{priority:"user-visible"})}cancelIdleCallback(t){return this.__requestsIdle.delete(t),this.__cancelIdleCallbackNative(t)}requestAnimationFrame(t){let e=requestAnimationFrame(t);return this.__requestsRaf.add(e),e}cancelAnimationFrame(t){this.__requestsRaf.delete(t),cancelAnimationFrame(t)}clear(){this.__requestsIdle.forEach(t=>this.cancelIdleCallback(t)),this.__requestsRaf.forEach(t=>this.cancelAnimationFrame(t)),this.__controllers.forEach(t=>t.abort()),this.timers.forEach(t=>(0,n.clearTimeout)(this.timers.get(t))),this.timers.clear(),this.promisesRejections.forEach(t=>t()),this.promisesRejections.clear()}destruct(){this.clear(),this.isDestructed=!0}constructor(){(0,o._)(this,"timers",new Map),(0,o._)(this,"__callbacks",new Map),(0,o._)(this,"__queueMicrotaskNative",queueMicrotask?.bind(window)??Promise.resolve().then.bind(Promise.resolve())),(0,o._)(this,"promisesRejections",new Set),(0,o._)(this,"__requestsIdle",new Set),(0,o._)(this,"__controllers",new Set),(0,o._)(this,"__requestsRaf",new Set),(0,o._)(this,"__requestIdleCallbackNative",window.requestIdleCallback?.bind(window)??((t,e)=>{let i=Date.now();return this.setTimeout(()=>{t({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-i))})},e?.timeout??1)})),(0,o._)(this,"__cancelIdleCallbackNative",window.cancelIdleCallback?.bind(window)??(t=>{this.clearTimeout(t)})),(0,o._)(this,"isDestructed",!1)}}},91231:function(t,e,i){"use strict";i.d(e,{Async:function(){return o.Async}});var o=i(24735)},80251:function(t,e,i){"use strict";i.d(e,{Component:function(){return c}});var o=i(25045),s=i(91231),n=i(69364),r=i(28077),a=i(65946);let l=new Map;class c{get componentName(){return this.__componentName||(this.__componentName="jodit-"+(0,a.kebabCase)(((0,a.isFunction)(this.className)?this.className():"")||(0,a.getClassName)(this))),this.__componentName}getFullElName(t,e,i){let o=[this.componentName];return t&&o.push("__"+(t=t.replace(/[^a-z0-9-]/gi,"-"))),e&&(o.push("_",e),o.push("_",(0,a.isVoid)(i)?"true":i.toString())),o.join("")}get ownerDocument(){return this.ow.document}get od(){return this.ownerDocument}get ow(){return this.ownerWindow}get(t,e){return(0,a.get)(t,e||this)}get isReady(){return this.componentStatus===n.STATUSES.ready}get isDestructed(){return this.componentStatus===n.STATUSES.destructed}get isInDestruct(){return n.STATUSES.beforeDestruct===this.componentStatus||n.STATUSES.destructed===this.componentStatus}bindDestruct(t){return t.hookStatus(n.STATUSES.beforeDestruct,()=>!this.isInDestruct&&this.destruct()),this}destruct(){this.setStatus(n.STATUSES.destructed),this.async&&(this.async.destruct(),this.async=void 0),l.get(this)&&l.delete(this),this.ownerWindow=void 0}get componentStatus(){return this.__componentStatus}set componentStatus(t){this.setStatus(t)}setStatus(t){return this.setStatusComponent(t,this)}setStatusComponent(t,e){if(t===this.__componentStatus)return;e===this&&(this.__componentStatus=t);let i=Object.getPrototypeOf(this);i&&(0,a.isFunction)(i.setStatusComponent)&&i.setStatusComponent(t,e);let o=l.get(this),s=o?.[t];s&&s.length&&s.forEach(t=>t(e))}hookStatus(t,e){let i=l.get(this);i||(i={},l.set(this,i)),i[t]||(i[t]=[]),i[t].push(e)}static isInstanceOf(t,e){return t instanceof e}constructor(){(0,o._)(this,"__componentName",void 0),(0,o._)(this,"async",new s.Async),(0,o._)(this,"uid",void 0),(0,o._)(this,"ownerWindow",window),(0,o._)(this,"__componentStatus",n.STATUSES.beforeInit),this.uid="jodit-uid-"+(0,r.uniqueUid)()}}(0,o._)(c,"STATUSES",n.STATUSES)},16964:function(t,e,i){"use strict";i.d(e,{Component:function(){return o.Component},STATUSES:function(){return s.STATUSES},ViewComponent:function(){return n.ViewComponent}});var o=i(80251),s=i(69364),n=i(59609)},69364:function(t,e,i){"use strict";i.d(e,["STATUSES",0,{beforeInit:"beforeInit",ready:"ready",beforeDestruct:"beforeDestruct",destructed:"destructed"}])},59609:function(t,e,i){"use strict";i.d(e,{ViewComponent:function(){return n}});var o=i(25045),s=i(80251);class n extends s.Component{get j(){return this.jodit}get defaultTimeout(){return this.j.defaultTimeout}i18n(t,...e){return this.j.i18n(t,...e)}setParentView(t){return this.jodit=t,t.ow&&(this.ownerWindow=t.ow),t.components.add(this),this}destruct(){return this.j.components.delete(this),super.destruct()}constructor(t){super(),(0,o._)(this,"jodit",void 0),this.setParentView(t)}}},81937:function(t,e,i){"use strict";i.r(e),i.d(e,{IS_TEST:function(){return o}});let o=!1,s="u">typeof window?window:void 0,n="u">typeof document?document:void 0,r=new Set(["ul","ol"]),a=["img","video","svg","iframe","script","input","textarea","link","jodit","jodit-media"],l=new Set([...a,"br","hr"]),c=new Set(a),u="Meta",h="Backspace",d="Enter",p="Escape",m="ArrowLeft",f="ArrowUp",g="ArrowRight",_="ArrowDown",v="Delete",b=[u,h,v,f,_,g,m,d,p,"F3","Tab"],y="u">typeof navigator&&(-1!==navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)),w=void 0!==s&&/Mac|iPod|iPhone|iPad/.test(s.navigator.platform),S=t=>{let e=t.split("/");return/\.js/.test(e[e.length-1])?{basePath:e.slice(0,e.length-1).join("/")+"/",isMin:!0}:{basePath:t,isMin:!0}},{basePath:C,isMin:E}=(()=>{if("u"<typeof document)return{basePath:"",isMin:!0};let t=n.currentScript;if(t)return S(t.src);let e=n.querySelectorAll("script[src]");return e&&e.length?S(e[e.length-1].src):S(s.location.href)})(),I=new Set(["touchstart","touchend","scroll","mousewheel","mousemove","touchmove"]);i.d(e,["ACCURACY",0,10,"APP_VERSION",0,"4.14.2","BASE_PATH",0,C,"BASE_PATH_IS_MIN",0,E,"BR",0,"br","CLIPBOARD_ID",0,"clipboard","COMMAND_KEYS",0,b,"EMULATE_DBLCLICK_TIMEOUT",0,300,"ES",0,"es2021","FAT_MODE",0,!0,"HOMEPAGE",0,"https://xdsoft.net/jodit/","INSEPARABLE_TAGS",0,l,"INSERT_AS_HTML",0,"insert_as_html","INSERT_AS_TEXT",0,"insert_as_text","INSERT_CLEAR_HTML",0,"insert_clear_html","INSERT_ONLY_TEXT",0,"insert_only_text","INVISIBLE_SPACE",0,"\uFEFF","INVISIBLE_SPACE_REG_EXP",0,()=>/[\uFEFF]/g,"INVISIBLE_SPACE_REG_EXP_END",0,()=>/[\uFEFF]+$/g,"INVISIBLE_SPACE_REG_EXP_START",0,()=>/^[\uFEFF]+/g,"IS_BLOCK",0,/^(ADDRESS|ARTICLE|ASIDE|BLOCKQUOTE|CANVAS|DD|DFN|DIV|DL|DT|FIELDSET|FIGCAPTION|FIGURE|FOOTER|FORM|H[1-6]|HEADER|HGROUP|HR|LI|MAIN|NAV|NOSCRIPT|OUTPUT|P|PRE|RUBY|SCRIPT|STYLE|OBJECT|OL|SECTION|IFRAME|JODIT|JODIT-MEDIA|UL|TR|TD|TH|TBODY|THEAD|TFOOT|TABLE|BODY|HTML|VIDEO)$/i,"IS_ES_MODERN",0,!0,"IS_ES_NEXT",0,!0,"IS_IE",0,y,"IS_INLINE",0,/^(STRONG|SPAN|I|EM|B|SUP|SUB|A|U)$/i,"IS_MAC",0,w,"IS_PROD",0,!0,"KEY_ALIASES",0,{add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:w?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:"space",spacebar:"space",up:"arrowup",win:"meta",windows:"meta"},"KEY_ALT",0,"Alt","KEY_BACKSPACE",0,h,"KEY_DELETE",0,v,"KEY_DOWN",0,_,"KEY_ENTER",0,d,"KEY_ESC",0,p,"KEY_F3",0,"F3","KEY_LEFT",0,m,"KEY_META",0,u,"KEY_RIGHT",0,g,"KEY_SPACE",0,"Space","KEY_TAB",0,"Tab","KEY_UP",0,f,"LIST_TAGS",0,r,"MARKER_CLASS",0,"jodit-selection_marker","MODE_SOURCE",0,2,"MODE_SPLIT",0,3,"MODE_WYSIWYG",0,1,"NBSP_SPACE",0," ","NEARBY",0,5,"NO_EMPTY_TAGS",0,c,"PARAGRAPH",0,"p","PASSIVE_EVENTS",0,I,"SAFE_COUNT_CHANGE_CALL",0,10,"SET_TEST",0,()=>o=!0,"SOURCE_CONSUMER",0,"source-consumer","SPACE_REG_EXP",0,()=>/[\s\n\t\r\uFEFF\u200b]+/g,"SPACE_REG_EXP_END",0,()=>/[\s\n\t\r\uFEFF\u200b]+$/g,"SPACE_REG_EXP_START",0,()=>/^[\s\n\t\r\uFEFF\u200b]+/g,"TEMP_ATTR",0,"data-jodit-temp","TEXT_HTML",0,y?"html":"text/html","TEXT_PLAIN",0,y?"text":"text/plain","TEXT_RTF",0,y?"rtf":"text/rtf","TOKENS",0,{},"globalDocument",0,n,"globalWindow",0,s,"lang",0,{}])},76517:function(t,e,i){"use strict";i.d(e,{Create:function(){return l}});var o=i(25045),s=i(81937),n=i(23211),r=i(65946),a=i(28712);class l{get doc(){return(0,r.isFunction)(this.document)?this.document():this.document}element(t,e,i){let o=this.doc.createElement(t.toLowerCase());return this.applyCreateAttributes(o),e&&((0,r.isPlainObject)(e)?(0,r.attr)(o,e):i=e),i&&(0,r.asArray)(i).forEach(t=>n.Dom.append(o,(0,r.isString)(t)?this.fromHTML(t):t)),o}div(t,e,i){let o=this.element("div",e,i);return t&&(o.className=t),o}sandbox(){let t=this.element("iframe",{sandbox:"allow-same-origin"});n.Dom.append(this.doc.body,t);let e=t.contentWindow?.document;if((0,a.assert)(e,"iframe.contentWindow.document"),!e)throw Error("Iframe error");return e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),[e.body,t]}span(t,e,i){let o=this.element("span",e,i);return t&&(o.className=t),o}a(t,e,i){let o=this.element("a",e,i);return t&&(o.className=t),o}text(t){return this.doc.createTextNode(t)}fake(){return this.text(s.INVISIBLE_SPACE)}fragment(){return this.doc.createDocumentFragment()}fromHTML(t,e){let i=this.div();i.innerHTML=t.toString();let o=i.firstChild===i.lastChild&&i.firstChild?i.firstChild:i;if(n.Dom.safeRemove(o),e){let t=(0,r.refs)(o);Object.keys(e).forEach(i=>{let o=t[i];o&&!1===e[i]&&n.Dom.hide(o)})}return o}applyCreateAttributes(t){if(this.createAttributes){let e=this.createAttributes;if(e&&e[t.tagName.toLowerCase()]){let i=e[t.tagName.toLowerCase()];(0,r.isFunction)(i)?i(t):(0,r.isPlainObject)(i)&&(0,r.attr)(t,i)}}}constructor(t,e){(0,o._)(this,"document",void 0),(0,o._)(this,"createAttributes",void 0),this.document=t,this.createAttributes=e}}},79821:function(t,e,i){"use strict";i.d(e,{Create:function(){return o.Create}});var o=i(76517)},49574:function(t,e,i){"use strict";i.d(e,{autobind:function(){return s}});var o=i(91565);function s(t,e,i){if(!(0,o.isFunction)(i.value))throw TypeError(`@autobind can only be applied to methods, but "${e}" is not a function`);let s=i.value;return{configurable:!0,get(){let t=s.bind(this);return Object.defineProperty(this,e,{value:t,configurable:!0,writable:!0}),t}}}},51676:function(t,e,i){"use strict";i.d(e,{cache:function(){return l},cacheHTML:function(){return c},cached:function(){return a}});var o=i(69364),s=i(23211),n=i(28686),r=i(38027);function a(t,e){let i=Object.getOwnPropertyDescriptor(t,e);return!i||(0,n.isFunction)(i.get)?null:i.value}function l(t,e,i){let o=i.get;if(!o)throw(0,r.error)("Getter property descriptor expected");i.get=function(){let t=o.call(this);return t&&!0===t.noCache||Object.defineProperty(this,e,{configurable:i.configurable,enumerable:i.enumerable,writable:!1,value:t}),t}}function c(t,e,i){let a=i.value;if(!(0,n.isFunction)(a))throw(0,r.error)("Handler must be a Function");let l=!0,c=new WeakMap;i.value=function(...t){let e=this.od??document,i=c.get(e);if(l&&i?.has(this.constructor))return i.get(this.constructor)?.cloneNode(!0);let o=a.apply(this,t);return l&&s.Dom.isElement(o)&&(i?i.set(this.constructor,o):c.set(e,new WeakMap([[this.constructor,o]]))),l?o.cloneNode(!0):o},t.hookStatus(o.STATUSES.ready,t=>{l=!!((0,n.isViewObject)(t)?t:t.jodit).options.cache})}},91672:function(t,e,i){"use strict";i.d(e,{component:function(){return r},getComponentClass:function(){return a}});var o=i(81937),s=i(421);let n=new Map;function r(t){class e extends t{constructor(...t){super(...t),this.constructor===e&&(this instanceof e||Object.setPrototypeOf(this,e.prototype),this.setStatus("ready"))}}let i=(0,s.getClassName)(t.prototype);if(n.has(i)&&!o.IS_PROD)throw Error(`Component with name "${i}" is already registered`);return n.set(i,e),e}function a(t){return n.get(t)}},55184:function(t,e,i){"use strict";i.d(e,{debounce:function(){return a},throttle:function(){return l}});var o=i(16964),s=i(28686),n=i(28712),r=i(33201);function a(t,e=!1,i="debounce"){return(a,l)=>{let c=a[l];if(!(0,s.isFunction)(c))throw(0,r.error)("Handler must be a Function");return a.hookStatus(o.STATUSES.ready,o=>{let{async:r}=o;(0,n.assert)(null!=r,`Component ${o.componentName||o.constructor.name} should have "async:IAsync" field`);let a=(0,s.isFunction)(t)?t(o):t,c=(0,s.isNumber)(a)||(0,s.isPlainObject)(a)?a:o.defaultTimeout;Object.defineProperty(o,l,{configurable:!0,value:r[i](o[l].bind(o),c,e)})}),{configurable:!0,get(){return c.bind(this)}}}}function l(t,e=!1){return a(t,e,"throttle")}},24968:function(t,e,i){"use strict";i.d(e,{derive:function(){return s}});var o=i(91565);function s(...t){return e=>{let i=e.prototype;for(let e=0;e<t.length;e++){let s=t[e],n=Object.getOwnPropertyNames(s.prototype);for(let t=0;t<n.length;t++){let e=n[t],r=Object.getOwnPropertyDescriptor(s.prototype,e);null!=r&&(0,o.isFunction)(r.value)&&!(0,o.isFunction)(i[e])&&Object.defineProperty(i,e,{enumerable:!0,configurable:!0,writable:!0,value:function(...t){return r.value.call(this,...t)}})}}}}},29200:function(t,e,i){"use strict";i.d(e,{hook:function(){return n}});var o=i(91565),s=i(33201);function n(t){return(e,i)=>{if(!(0,o.isFunction)(e[i]))throw(0,s.error)("Handler must be a Function");e.hookStatus(t,t=>{t[i].call(t)})}}},35718:function(t,e,i){"use strict";i.d(e,{idle:function(){return r}});var o=i(16964),s=i(91565),n=i(33201);function r(){return(t,e)=>{if(!(0,s.isFunction)(t[e]))throw(0,n.error)("Handler must be a Function");t.hookStatus(o.STATUSES.ready,t=>{let{async:i}=t,o=t[e];t[e]=(...e)=>i.requestIdleCallback(o.bind(t,...e))})}}},84839:function(t,e,i){"use strict";i.r(e),i.d(e,{autobind:function(){return o.autobind},cache:function(){return s.cache},cacheHTML:function(){return s.cacheHTML},cached:function(){return s.cached},component:function(){return n.component},debounce:function(){return r.debounce},derive:function(){return a.derive},getComponentClass:function(){return n.getComponentClass},hook:function(){return l.hook},idle:function(){return c.idle},nonenumerable:function(){return u.nonenumerable},persistent:function(){return h.persistent},throttle:function(){return r.throttle},wait:function(){return d.wait},watch:function(){return p.watch}});var o=i(49574),s=i(51676),n=i(91672),r=i(55184),a=i(24968),l=i(29200),c=i(35718),u=i(41360),h=i(77036),d=i(80840),p=i(68616)},41360:function(t,e,i){"use strict";i.d(e,["nonenumerable",0,(t,e)=>{!1!==(Object.getOwnPropertyDescriptor(t,e)||{}).enumerable&&Object.defineProperty(t,e,{enumerable:!1,set(t){Object.defineProperty(this,e,{enumerable:!1,writable:!0,value:t})}})}])},77036:function(t,e,i){"use strict";i.d(e,{persistent:function(){return n}});var o=i(69364),s=i(31534);function n(t,e){t.hookStatus(o.STATUSES.ready,t=>{let i=(0,s.isViewObject)(t)?t:t.jodit,o=`${i.options.namespace}${t.componentName}_prop_${e}`,n=t[e];Object.defineProperty(t,e,{get:()=>i.storage.get(o)??n,set(t){i.storage.set(o,t)}})})}},80840:function(t,e,i){"use strict";i.d(e,{wait:function(){return r}});var o=i(69364),s=i(91565),n=i(33201);function r(t){return(e,i)=>{let r=e[i];if(!(0,s.isFunction)(r))throw(0,n.error)("Handler must be a Function");e.hookStatus(o.STATUSES.ready,e=>{let{async:o}=e,s=e[i],n=0;Object.defineProperty(e,i,{configurable:!0,value:function i(...r){o.clearTimeout(n),t(e)?s.apply(e,r):n=o.setTimeout(()=>i(...r),10)}})})}}},68616:function(t,e,i){"use strict";i.d(e,{watch:function(){return h}});var o=i(69364),s=i(70535),n=i(32328),r=i(91565),a=i(62101),l=i(31534),c=i(33201),u=i(71125);function h(t,e){return(i,h)=>{if(!(0,r.isFunction)(i[h]))throw(0,c.error)("Handler must be a Function");let d=e?.immediately??!0,p=e?.context,m=e=>{let o=(0,l.isViewObject)(e)?e:e.jodit,c=(t,...i)=>{if(!e.isInDestruct)return e[h](t,...i)};d||(c=e.async.microDebounce(c,!0)),(0,n.splitArray)(t).forEach(t=>{if(/:/.test(t)){let[i,s]=t.split(":"),n=p;i.length&&(n=e.get(i)),(0,r.isFunction)(n)&&(n=n(e)),o.events.on(n||e,s,c),n||o.events.on(s,c),e.hookStatus("beforeDestruct",()=>{o.events.off(n||e,s,c).off(s,c)});return}let n=t.split("."),[l]=n,h=n.slice(1),d=e[l];(0,a.isPlainObject)(d)&&(0,s.observable)(d).on("change."+h.join("."),c);let m=(0,u.getPropertyDescriptor)(i,l);Object.defineProperty(e,l,{configurable:!0,set(t){let i=d;i!==t&&(d=t,m&&m.set&&m.set.call(e,t),(0,a.isPlainObject)(d)&&(d=(0,s.observable)(d)).on("change."+h.join("."),c),c(l,i,d))},get:()=>m&&m.get?m.get.call(e):d})})};(0,r.isFunction)(i.hookStatus)?i.hookStatus(o.STATUSES.ready,m):m(i)}}},23211:function(t,e,i){"use strict";i.d(e,{Dom:function(){return b}});var o=i(81937),s=i(88475),n=i(17312),r=i(91565),a=i(46248),l=i(3213),c=i(85932),u=i(18303),h=i(4040),d=i(28712),p=i(7909),m=i(80991),f=i(36400),g=i(33201),_=i(71125);let v=RegExp(`<([a-z]+)[^>]+${o.TEMP_ATTR}[^>]*>(.+?)</\\1>`,"gi");class b{static detach(t){for(;t&&t.firstChild;)t.removeChild(t.firstChild)}static wrapNextInline(t,e,i){let o,s=t;i.s.save();let n=!1;do n=!1,(o=s.nextSibling)&&!b.isBlock(o)&&!b.isTag(o,"br")&&(n=!0,s=o);while(n)return b.__wrapElements(e,i,t,s)}static __wrapElements(t,e,i,o){let s=(0,c.isString)(t)?e.createInside.element(t):t;i.parentNode&&i.parentNode.insertBefore(s,i);let n=i;for(;n&&(n=i.nextSibling,s.appendChild(i),i!==o&&n);)i=n;return e.s.restore(),s}static wrapInline(t,e,i){let o,s=t,n=t;i.s.save();let r=!1;do r=!1,(o=s.previousSibling)&&!b.isBlock(o)&&(r=!0,s=o);while(r)do r=!1,(o=n.nextSibling)&&!b.isBlock(o)&&(r=!0,n=o);while(r)return b.__wrapElements(e,i,s,n)}static wrap(t,e,i){let o=(0,c.isString)(e)?i.element(e):e;if(b.isNode(t)){if(!t.parentNode)throw(0,g.error)("Element should be in DOM");t.parentNode.insertBefore(o,t),o.appendChild(t)}else{let e=t.extractContents();t.insertNode(o),o.appendChild(e)}return o}static unwrap(t){let e=t.parentNode;if(e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);b.safeRemove(t)}}static between(t,e,i){let o=t;for(;o&&o!==e&&!(t!==o&&i(o));){let t=o.firstChild||o.nextSibling;if(!t){for(;o&&!o.nextSibling;)if((o=o.parentNode)===e)return;t=o?.nextSibling}o=t}}static replace(t,e,i,o=!1,n=!1){let r;if((0,a.isHTML)(e)&&((0,d.assert)(i,"Need create instance for new tag"),e=i.fromHTML(e)),(0,c.isString)(e)?((0,d.assert)(i,"Need create instance for new tag"),r=i.element(e)):r=e,!n)for(;t.firstChild;)r.appendChild(t.firstChild);return o&&b.isElement(t)&&b.isElement(r)&&(0,s.toArray)(t.attributes).forEach(t=>{r.setAttribute(t.name,t.value)}),t.parentNode&&t.parentNode.replaceChild(r,t),r}static isEmptyTextNode(t){return b.isText(t)&&(!t.nodeValue||0===t.nodeValue.replace(o.INVISIBLE_SPACE_REG_EXP(),"").trim().length)}static isEmptyContent(t){return b.each(t,t=>b.isEmptyTextNode(t))}static isContentEditable(t,e){return b.isNode(t)&&!b.closest(t,t=>b.isElement(t)&&"false"===t.getAttribute("contenteditable"),e)}static isEmpty(t,e=o.NO_EMPTY_TAGS){let i;if(!t)return!0;i=(0,r.isFunction)(e)?e:t=>e.has(t.nodeName.toLowerCase());let s=t=>null==t.nodeValue||0===(0,h.trim)(t.nodeValue).length;return b.isText(t)?s(t):!(b.isElement(t)&&i(t))&&b.each(t,t=>{if(b.isText(t)&&!s(t)||b.isElement(t)&&i(t))return!1})}static isNode(t){return!!(t&&(0,c.isString)(t.nodeName)&&"number"==typeof t.nodeType&&t.childNodes&&(0,r.isFunction)(t.appendChild))}static isCell(t){return b.isNode(t)&&("TD"===t.nodeName||"TH"===t.nodeName)}static isList(t){return b.isTag(t,o.LIST_TAGS)}static isLeaf(t){return b.isTag(t,"li")}static isImage(t){return b.isNode(t)&&/^(img|svg|picture|canvas)$/i.test(t.nodeName)}static isBlock(t){return!(0,u.isVoid)(t)&&"object"==typeof t&&b.isNode(t)&&o.IS_BLOCK.test(t.nodeName)}static isText(t){return!!(t&&t.nodeType===Node.TEXT_NODE)}static isComment(t){return!!(t&&t.nodeType===Node.COMMENT_NODE)}static isElement(t){return!!b.isNode(t)&&t.nodeType===Node.ELEMENT_NODE}static isFragment(t){return!!b.isNode(t)&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}static isHTMLElement(t){if(!b.isNode(t))return!1;let e=t.ownerDocument?.defaultView;return t instanceof(e?e.HTMLElement:HTMLElement)}static isInlineBlock(t){return b.isElement(t)&&!/^(BR|HR)$/i.test(t.tagName)&&-1!==["inline","inline-block"].indexOf((0,m.css)(t,"display").toString())}static canSplitBlock(t){return!(0,u.isVoid)(t)&&b.isHTMLElement(t)&&b.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&void 0!==t.style&&!/^(fixed|absolute)/i.test(t.style.position)}static first(t,e){return b.__deepMost(t,e,!1)}static last(t,e){return b.__deepMost(t,e,!0)}static __deepMost(t,e,i){let o=i?"lastChild":"firstChild",s=i?"previousSibling":"nextSibling",n=t?.[o];if(!n)return null;do{if(e(n))return n;let i=n[o]||n[s];if(!i&&n.parentNode!==t){do n=n.parentNode;while(n&&!n[s]&&n.parentNode!==t)i=n?.[s]}n=i}while(n)return null}static prev(t,e,i,o=!0){return b.find(t,e,i,!1,o)}static next(t,e,i,o=!0){return b.find(t,e,i,!0,o)}static prevWithClass(t,e){return b.__siblingWithClass(t,e,!0)}static nextWithClass(t,e){return b.__siblingWithClass(t,e,!1)}static __siblingWithClass(t,e,i){let o=t=>b.isElement(t)&&t.classList.contains(e),s=t.parentNode;return i?b.prev(t,o,s):b.next(t,o,s)}static find(t,e,i,o=!0,s=!0){let n=this.nextGen(t,i,o,s),r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}return null}static*nextGen(t,e,i=!0,o=!0){let s=[],n=t;do{let e=i?n.nextSibling:n.previousSibling;for(;e;)s.push(e),e=i?e.nextSibling:e.previousSibling;s.reverse(),yield*this.runInStack(t,s,i,o),n=n.parentNode}while(n&&n!==e)return null}static each(t,e,i=!0){let o=this.eachGen(t,i),s=o.next();for(;!s.done;){if(!1===e(s.value))return!1;s=o.next()}return!0}static eachGen(t,e=!0){return this.runInStack(t,[t],e)}static*runInStack(t,e,i,o=!0){for(;e.length;){let s=e.pop();if(o){let t=i?s.lastChild:s.firstChild;for(;t;)e.push(t),t=i?t.previousSibling:t.nextSibling}t!==s&&(yield s)}}static findWithCurrent(t,e,i,o="nextSibling",s="firstChild"){let n=t;do{if(e(n))return n||null;if(s&&n&&n[s]){let t=b.findWithCurrent(n[s],e,n,o,s);if(t)return t}for(;n&&!n[o]&&n!==i;)n=n.parentNode;n&&n[o]&&n!==i&&(n=n[o])}while(n&&n!==i)return null}static findSibling(t,e=!0,i=t=>!b.isEmptyTextNode(t)){let o=b.sibling(t,e);for(;o&&!i(o);)o=b.sibling(o,e);return o&&i(o)?o:null}static findNotEmptySibling(t,e){return b.findSibling(t,e,t=>!b.isEmptyTextNode(t)&&!!(!b.isText(t)||t.nodeValue?.length&&(0,h.trim)(t.nodeValue)))}static findNotEmptyNeighbor(t,e,i){return(0,_.call)(e?b.prev:b.next,t,t=>!!(t&&(!(b.isText(t)||b.isComment(t))||(0,h.trim)(t?.nodeValue||"").length)),i)}static sibling(t,e){return e?t.previousSibling:t.nextSibling}static up(t,e,i,o=!1){let s=t;if(!s)return null;do{if(e(s))return s;if(s===i||!s.parentNode)break;s=s.parentNode}while(s&&s!==i)return s===i&&o&&e(s)?s:null}static closest(t,e,i){let o,s=t=>t.toLowerCase();if((0,r.isFunction)(e))o=e;else if((0,n.isArray)(e)||(0,l.isSet)(e)){let t=(0,l.isSet)(e)?e:new Set(e.map(s));o=e=>!!(e&&t.has(s(e.nodeName)))}else o=t=>!!(t&&s(e)===s(t.nodeName));return b.up(t,o,i)}static furthest(t,e,i){let o=null,s=t?.parentElement;for(;s&&s!==i;)e(s)&&(o=s),s=s?.parentElement;return o}static appendChildFirst(t,e){t.firstChild!==e&&b.prepend(t,e)}static after(t,e){t.parentNode?.insertBefore(e,t.nextSibling)}static before(t,e){t.parentNode?.insertBefore(e,t)}static prepend(t,e){t.insertBefore(e,t.firstChild)}static append(t,e){(0,n.isArray)(e)?e.forEach(e=>{this.append(t,e)}):t.appendChild(e)}static moveContent(t,e,i=!1,n=()=>!0){let r=(t.ownerDocument||o.globalDocument).createDocumentFragment();(0,s.toArray)(t.childNodes).filter(t=>!!n(t)||(b.safeRemove(t),!1)).forEach(t=>{r.appendChild(t)}),e.insertBefore(r,i?e.firstChild:null)}static isOrContains(t,e,i=!1){return t===e?!i:!!(e&&t&&this.up(e,e=>e===t,t,!0))}static safeRemove(...t){t.forEach(t=>b.isNode(t)&&t.parentNode&&t.parentNode.removeChild(t))}static safeInsertNode(t,e){t.collapsed||t.deleteContents();let i=b.isFragment(e)?e.lastChild:e;t.startContainer===t.endContainer&&t.collapsed&&b.isTag(t.startContainer,o.INSEPARABLE_TAGS)?b.after(t.startContainer,e):(t.insertNode(e),i&&t.setStartBefore(i)),t.collapse(!0),[e.nextSibling,e.previousSibling].forEach(t=>b.isText(t)&&!t.nodeValue&&b.safeRemove(t))}static hide(t){t&&((0,f.dataBind)(t,"__old_display",t.style.getPropertyValue("display")),t.style.setProperty("display","none"))}static show(t){if(!t)return;let e=(0,f.dataBind)(t,"__old_display");"none"===t.style.getPropertyValue("display")&&t.style.setProperty("display",e||null)}static isTag(t,e){if(Array.isArray(e))throw TypeError("Dom.isTag does not support array");if(!this.isElement(t))return!1;let i=t.tagName.toLowerCase();return e instanceof Set?e.has(i)||e.has(t.tagName.toUpperCase()):i===e||t.tagName.toUpperCase()===e}static markTemporary(t,e){return e&&(0,p.attr)(t,e),(0,p.attr)(t,o.TEMP_ATTR,!0),t}static isTemporary(t){return!!b.isElement(t)&&(b.isMarker(t)||"true"===(0,p.attr)(t,o.TEMP_ATTR))}static isMarker(t){return b.isNode(t)&&b.isTag(t,"span")&&t.hasAttribute("data-"+o.MARKER_CLASS)}static replaceTemporaryFromString(t){return t.replace(v,"$2")}static temporaryList(t){let e=[];return b.each(t,t=>{b.isHTMLElement(t)&&t.hasAttribute(o.TEMP_ATTR)&&e.push(t)}),e}constructor(){throw Error("Dom is static module")}}},27795:function(t,e,i){"use strict";i.d(e,{Dom:function(){return o.Dom},LazyWalker:function(){return s.LazyWalker}});var o=i(23211),s=i(1080)},1080:function(t,e,i){"use strict";i.d(e,{LazyWalker:function(){return l}});var o=i(25045),s=i(31635),n=i(49574),r=i(23211),a=i(60216);class l extends a.Eventify{setWork(t){return this.isWorked?this.break():this.stop(),this.workNodes=r.Dom.eachGen(t,!this.options.reverse),this.isFinished=!1,this.hadAffect=!1,this._requestStarting(),this}_requestStarting(){this.__schedulerController=new AbortController,this.async.schedulerPostTask(this.__workPerform,{delay:this.options.timeout,signal:this.__schedulerController.signal}).catch(()=>null)}break(t){this.isWorked&&(this.stop(),this.emit("break",t))}end(){this.isWorked&&(this.stop(),this.emit("end",this.hadAffect),this.hadAffect=!1)}stop(){this.isWorked=!1,this.isFinished=!0,this.workNodes=null,this.__schedulerController?.abort(),this.__schedulerController=null}destruct(){super.destruct(),this.stop()}__workPerform(){if(this.workNodes){this.isWorked=!0;let t=0,e=this.options.timeoutChunkSize??50;for(;!this.isFinished&&t<e;){let e=this.workNodes.next();if(t+=1,this.visitNode(e.value)&&(this.hadAffect=!0),e.done)return void this.end()}}else this.end();this.isFinished||this._requestStarting()}visitNode(t){return!!t&&(void 0===this.options.whatToShow||t.nodeType===this.options.whatToShow)&&(this.emit("visit",t)??!1)}constructor(t,e={}){super(),(0,o._)(this,"async",void 0),(0,o._)(this,"options",void 0),(0,o._)(this,"workNodes",void 0),(0,o._)(this,"hadAffect",void 0),(0,o._)(this,"isWorked",void 0),(0,o._)(this,"isFinished",void 0),(0,o._)(this,"__schedulerController",void 0),this.async=t,this.options=e,this.workNodes=null,this.hadAffect=!1,this.isWorked=!1,this.isFinished=!1,this.__schedulerController=null}}(0,s.__decorate)([n.autobind],l.prototype,"__workPerform",null)},93747:function(t,e,i){"use strict";i.d(e,{EventEmitter:function(){return h}});var o=i(25045),s=i(81937),n=i(32328),r=i(17312),a=i(91565),l=i(85932),c=i(33201),u=i(18869);class h{mute(t){return this.__mutedEvents.add(t??"*"),this}isMuted(t){return!!(t&&this.__mutedEvents.has(t))||this.__mutedEvents.has("*")}unmute(t){return this.__mutedEvents.delete(t??"*"),this}__eachEvent(t,e){(0,n.splitArray)(t).map(t=>t.trim()).forEach(t=>{let i=t.split("."),o=i[1]||u.defaultNameSpace;e.call(this,i[0],o)})}__getStore(t){if(!t)throw(0,c.error)("Need subject");if(void 0===t[this.__key]){let e=new u.EventHandlersStore;Object.defineProperty(t,this.__key,{enumerable:!1,configurable:!0,writable:!0,value:e})}return t[this.__key]}__removeStoreFromSubject(t){void 0!==t[this.__key]&&delete t[this.__key]}__triggerNativeEvent(t,e){let i=this.__doc.createEvent("HTMLEvents");(0,l.isString)(e)?i.initEvent(e,!0,!0):(i.initEvent(e.type,e.bubbles,e.cancelable),["screenX","screenY","clientX","clientY","target","srcElement","currentTarget","timeStamp","which","keyCode"].forEach(t=>{Object.defineProperty(i,t,{value:e[t],enumerable:!0})}),Object.defineProperty(i,"originalEvent",{value:e,enumerable:!0})),t.dispatchEvent(i)}get current(){return this.currents[this.currents.length-1]}on(t,e,i,o){let n,u,h,p;if((0,l.isString)(t)||(0,l.isStringArray)(t)?(n=this,u=t,h=e,p=i):(n=t,u=e,h=i,p=o),!((0,l.isString)(u)||(0,l.isStringArray)(u))||0===u.length)throw(0,c.error)("Need events names");if(!(0,a.isFunction)(h))throw(0,c.error)("Need event handler");if((0,r.isArray)(n))return n.forEach(t=>{this.on(t,u,h,p)}),this;let m=n,f=this.__getStore(m),g=this,_=function(t,...e){if(!g.isMuted(t))return h&&h.call(this,...e)};return d(m)&&(_=function(t){if(!g.isMuted(t.type)&&(g.__prepareEvent(t),h&&!1===h.call(this,t)))return t.preventDefault(),t.stopImmediatePropagation(),!1}),this.__eachEvent(u,(t,e)=>{if(0===t.length)throw(0,c.error)("Need event name");if(!1===f.indexOf(t,e,h)){let i={event:t,originalCallback:h,syntheticCallback:_};if(f.set(t,e,i,p?.top),d(m)){let e=s.PASSIVE_EVENTS.has(t)?{passive:!0,capture:p?.capture??!1}:p?.capture??!1;_.options=e,m.addEventListener(t,_,e),this.__memoryDOMSubjectToHandler(m,_)}}}),this}__memoryDOMSubjectToHandler(t,e){let i=this.__domEventsMap.get(t)||new Set;i.add(e),this.__domEventsMap.set(t,i)}__unmemoryDOMSubjectToHandler(t,e){let i=this.__domEventsMap,o=i.get(t)||new Set;o.delete(e),o.size?i.set(t,o):i.delete(t)}one(t,e,i,o){let s,n,r,a;(0,l.isString)(t)||(0,l.isStringArray)(t)?(s=this,n=t,r=e,a=i):(s=t,n=e,r=i,a=o);let c=(...t)=>(this.off(s,n,c),r(...t));return this.on(s,n,c,a),this}off(t,e,i){let o,s,n;if((0,l.isString)(t)||(0,l.isStringArray)(t)?(o=this,s=t,n=e):(o=t,s=e,n=i),(0,r.isArray)(o))return o.forEach(t=>{this.off(t,s,n)}),this;let c=o,h=this.__getStore(c);if(!((0,l.isString)(s)||(0,l.isStringArray)(s))||0===s.length)return h.namespaces().forEach(t=>{this.off(c,"."+t)}),this.__removeStoreFromSubject(c),this;let p=t=>{d(c)&&(c.removeEventListener(t.event,t.syntheticCallback,t.syntheticCallback.options??!1),this.__unmemoryDOMSubjectToHandler(c,t.syntheticCallback))},m=(t,e)=>{if(""===t)return void h.events(e).forEach(t=>{""!==t&&m(t,e)});let i=h.get(t,e);if(i&&i.length)if((0,a.isFunction)(n)){let o=h.indexOf(t,e,n);!1!==o&&(p(i[o]),i.splice(o,1),i.length||h.clearEvents(e,t))}else i.forEach(p),i.length=0,h.clearEvents(e,t)};return this.__eachEvent(s,(t,e)=>{e===u.defaultNameSpace?h.namespaces().forEach(e=>{m(t,e)}):m(t,e)}),h.isEmpty()&&this.__removeStoreFromSubject(c),this}stopPropagation(t,e){let i=(0,l.isString)(t)?this:t,o=(0,l.isString)(t)?t:e;if("string"!=typeof o)throw(0,c.error)("Need event names");let s=this.__getStore(i);this.__eachEvent(o,(t,e)=>{let o=s.get(t,e);o&&this.__stopped.push(o),e===u.defaultNameSpace&&s.namespaces(!0).forEach(e=>this.stopPropagation(i,t+"."+e))})}__removeStop(t){if(t){let e=this.__stopped.indexOf(t);-1!==e&&this.__stopped.splice(0,e+1)}}__isStopped(t){return void 0!==t&&-1!==this.__stopped.indexOf(t)}fire(t,e,...i){let o,s,n=(0,l.isString)(t)?this:t,r=(0,l.isString)(t)?t:e,a=(0,l.isString)(t)?[e,...i]:i;if(!d(n)&&!(0,l.isString)(r))throw(0,c.error)("Need events names");let h=this.__getStore(n);return!(0,l.isString)(r)&&d(n)?this.__triggerNativeEvent(n,e):this.__eachEvent(r,(t,e)=>{if(d(n))this.__triggerNativeEvent(n,t);else{let i=h.get(t,e);if(i)try{[...i].every(e=>!this.__isStopped(i)&&(this.currents.push(t),s=e.syntheticCallback.call(n,t,...a),this.currents.pop(),void 0!==s&&(o=s),!0))}finally{this.__removeStop(i)}e!==u.defaultNameSpace||d(n)||h.namespaces().filter(t=>t!==e).forEach(e=>{let i=this.fire.apply(this,[n,t+"."+e,...a]);void 0!==i&&(o=i)})}}),o}destruct(){this.__isDestructed||(this.__isDestructed=!0,this.__domEventsMap.forEach((t,e)=>{this.off(e)}),this.__domEventsMap.clear(),this.__mutedEvents.clear(),this.currents.length=0,this.__stopped.length=0,this.off(this),this.__getStore(this).clear(),this.__removeStoreFromSubject(this))}constructor(t){(0,o._)(this,"__domEventsMap",new Map),(0,o._)(this,"__mutedEvents",new Set),(0,o._)(this,"__key","__JoditEventEmitterNamespaces"),(0,o._)(this,"__doc",s.globalDocument),(0,o._)(this,"__prepareEvent",t=>{!t.cancelBubble&&(t.composed&&(0,a.isFunction)(t.composedPath)&&t.composedPath()[0]&&Object.defineProperty(t,"target",{value:t.composedPath()[0],configurable:!0,enumerable:!0}),t.type.match(/^touch/)&&t.changedTouches&&t.changedTouches.length&&["clientX","clientY","pageX","pageY"].forEach(e=>{Object.defineProperty(t,e,{value:t.changedTouches[0][e],configurable:!0,enumerable:!0})}),t.originalEvent||(t.originalEvent=t),"paste"===t.type&&void 0===t.clipboardData&&this.__doc.defaultView.clipboardData&&Object.defineProperty(t,"clipboardData",{get:()=>this.__doc.defaultView.clipboardData,configurable:!0,enumerable:!0}))}),(0,o._)(this,"currents",[]),(0,o._)(this,"__stopped",[]),(0,o._)(this,"__isDestructed",!1),t&&(this.__doc=t),this.__key+=new Date().getTime()}}function d(t){return t&&(0,a.isFunction)(t.addEventListener)}},60216:function(t,e,i){"use strict";i.d(e,{Eventify:function(){return s}});var o=i(25045);class s{on(t,e){return this.__map.has(t)||this.__map.set(t,new Set),this.__map.get(t)?.add(e),this}off(t,e){return this.__map.has(t)&&this.__map.get(t)?.delete(e),this}destruct(){this.__map.clear()}emit(t,...e){let i;return this.__map.has(t)&&this.__map.get(t)?.forEach(t=>{i=t(...e)}),i}constructor(){(0,o._)(this,"__map",new Map)}}},42689:function(t,e,i){"use strict";let o=new(i(93747)).EventEmitter;i.d(e,["eventEmitter",0,o])},1496:function(t,e,i){"use strict";i.d(e,{EventEmitter:function(){return o.EventEmitter},EventHandlersStore:function(){return r.EventHandlersStore},Eventify:function(){return s.Eventify},defaultNameSpace:function(){return r.defaultNameSpace},observable:function(){return n.observable}});var o=i(93747),s=i(60216),n=i(70535),r=i(18869)},70535:function(t,e,i){"use strict";i.d(e,{observable:function(){return c}});var o=i(17312),s=i(94013),n=i(62101),r=i(71125);let a=Symbol("observable-object");function l(t){return void 0!==t[a]}function c(t){if(l(t))return t;let e={},i={},c=(e,s)=>((0,o.isArray)(e)?e.map(t=>c(t,s)):(i[e]||(i[e]=[]),i[e].push(s)),t),u=(s,...n)=>{if((0,o.isArray)(s))return void s.map(t=>u(t,...n));try{!e[s]&&i[s]&&(e[s]=!0,i[s].forEach(e=>e.call(t,...n)))}finally{e[s]=!1}},h=(e,i=[])=>{let o={};l(e)||(Object.defineProperty(e,a,{enumerable:!1,value:!0}),Object.keys(e).forEach(a=>{let l=i.concat(a).filter(t=>t.length);o[a]=e[a];let c=(0,r.getPropertyDescriptor)(e,a);Object.defineProperty(e,a,{set(e){let i=o[a];if(!(0,s.isFastEqual)(o[a],e)){u(["beforeChange","beforeChange."+l.join(".")],a,e),(0,n.isPlainObject)(e)&&h(e,l),c&&c.set?c.set.call(t,e):o[a]=e;let s=[];u(["change",...l.reduce((t,e)=>(s.push(e),t.push("change."+s.join(".")),t),[])],l.join("."),i,e?.valueOf?e.valueOf():e)}},get:()=>c&&c.get?c.get.call(t):o[a],enumerable:!0,configurable:!0}),(0,n.isPlainObject)(o[a])&&h(o[a],l)}),Object.defineProperty(t,"on",{value:c}))};return h(t),t}},18869:function(t,e,i){"use strict";i.d(e,{EventHandlersStore:function(){return a}});var o=i(25045),s=i(88475),n=i(28712);let r="JoditEventDefaultNamespace";class a{get(t,e){if(this.__store.has(e)){let i=this.__store.get(e);return(0,n.assert)(i,"-"),i[t]}}indexOf(t,e,i){let o=this.get(t,e);if(o){for(let t=0;t<o.length;t+=1)if(o[t].originalCallback===i)return t}return!1}namespaces(t=!1){let e=(0,s.toArray)(this.__store.keys());return t?e.filter(t=>t!==r):e}events(t){let e=this.__store.get(t);return e?Object.keys(e):[]}set(t,e,i,o=!1){let s=this.__store.get(e);s||(s={},this.__store.set(e,s)),void 0===s[t]&&(s[t]=[]),o?s[t].unshift(i):s[t].push(i)}clear(){this.__store.clear()}clearEvents(t,e){let i=this.__store.get(t);i&&i[e]&&(delete i[e],Object.keys(i).length||this.__store.delete(t))}isEmpty(){return 0===this.__store.size}constructor(){(0,o._)(this,"__store",new Map)}}i.d(e,["defaultNameSpace",0,r])},28077:function(t,e,i){"use strict";i.d(e,{getContainer:function(){return b},getPopupViewRoot:function(){return y},uniqueUid:function(){return g}});var o=i(24497),s=i(85932),n=i(31534),r=i(74264),a=i(7909),l=i(80991),c=i(421),u=i(85305),h=i(42689),d=i(81937),p=i(27795);let m=1,f=new Set;function g(){function t(){return Math.round(m+=10*(Math.random()+1)).toString(16)}let e=t();for(;f.has(e);)e=t();return f.add(e),e}let _=new u.PluginSystem({getContainer:b}),v=new WeakMap;function b(t,e,i="div",l=!1){let u=(0,s.isString)(e)?e:e?(0,c.getClassName)(e.prototype):"jodit-utils",h=v.get(t)||{},d=u+i,m=(0,n.isViewObject)(t)?t:t.j,f=null;if(!h[d]){let e=m.c;if(f=y(m.o,m.container,t.od.body),l&&(0,o.isJoditObject)(t)&&t.od!==t.ed){e=t.createInside;let s="style"===i?t.ed.head:t.ed.body;f=(0,o.isJoditObject)(t)&&t.o.shadowRoot?t.o.shadowRoot:s}let s=e.element(i,{className:`jodit jodit-${(0,r.kebabCase)(u)}-container jodit-box`});m.o.nonce&&("style"===i||"script"===i)&&(0,a.attr)(s,"nonce",m.o.nonce),s.classList.add("jodit_theme_"+(m.o.theme||"default")),p.Dom.append(f,s),h[d]=s,t.hookStatus("beforeDestruct",()=>{m.events.off(s),p.Dom.safeRemove(s),delete h[d],Object.keys(h).length&&v.delete(t)}),v.set(t,h),m.events.fire("getContainer",s)}return h[d].classList.remove("jodit_theme_default","jodit_theme_dark"),h[d].classList.add("jodit_theme_"+(m.o.theme||"default")),h[d]}function y(t,e,i){return t.popupRoot??t.shadowRoot??p.Dom.closest(e,t=>p.Dom.isHTMLElement(t)&&(p.Dom.isTag(t,"dialog")||["fixed","absolute"].includes((0,l.css)(t,"position"))),i)??i}let w=h.eventEmitter;i.d(e,["eventEmitter",0,w,"extendLang",0,t=>{Object.keys(t).forEach(e=>{d.lang[e]?Object.assign(d.lang[e],t[e]):d.lang[e]=t[e]})},"instances",0,{},"modules",0,{},"pluginSystem",0,_])},78982:function(t,e,i){"use strict";var o=i(17312);i.d(e,["asArray",0,t=>(0,o.isArray)(t)?t:[t]])},45664:function(t,e,i){"use strict";i.d(e,{asArray:function(){return o.asArray},splitArray:function(){return s.splitArray},toArray:function(){return n.toArray}});var o=i(78982),s=i(32328),n=i(88475)},32328:function(t,e,i){"use strict";function o(t){return Array.isArray(t)?t:t.split(/[,\s]+/)}i.d(e,{splitArray:function(){return o}})},88475:function(t,e,i){"use strict";var o=i(23283),s=i(43379);i.d(e,["toArray",0,function(...t){return((0,o.isNativeFunction)(Array.from)?Array.from:(0,s.reset)("Array.from")??Array.from).apply(Array,t)}])},61077:function(t,e,i){"use strict";i.d(e,{clearTimeout:function(){return o.clearTimeout},setTimeout:function(){return o.setTimeout}});var o=i(79947)},79947:function(t,e,i){"use strict";i.d(e,{clearTimeout:function(){return n},setTimeout:function(){return s}});var o=i(81937);function s(t,e,...i){return e?o.globalWindow.setTimeout(t,e,...i):(t.call(null,...i),0)}function n(t){o.globalWindow.clearTimeout(t)}},98740:function(t,e,i){"use strict";i.d(e,{hasBrowserColorPicker:function(){return s}});var o=i(81937);function s(){let t=!0;try{let e=o.globalDocument.createElement("input");e.type="color",e.value="!",t="color"===e.type&&"!"!==e.value}catch(e){t=!1}return t}},28686:function(t,e,i){"use strict";i.d(e,{hasBrowserColorPicker:function(){return o.hasBrowserColorPicker},hasContainer:function(){return h.hasContainer},isAbortError:function(){return s.isAbortError},isArray:function(){return n.isArray},isBoolean:function(){return r.isBoolean},isDestructable:function(){return h.isDestructable},isEqual:function(){return a.isEqual},isFastEqual:function(){return a.isFastEqual},isFunction:function(){return l.isFunction},isHTML:function(){return c.isHTML},isHtmlFromWord:function(){return u.isHtmlFromWord},isInitable:function(){return h.isInitable},isInt:function(){return d.isInt},isJoditObject:function(){return p.isJoditObject},isLicense:function(){return m.isLicense},isMarker:function(){return f.isMarker},isNativeFunction:function(){return g.isNativeFunction},isNumber:function(){return _.isNumber},isNumeric:function(){return v.isNumeric},isPlainObject:function(){return b.isPlainObject},isPromise:function(){return y.isPromise},isSet:function(){return w.isSet},isString:function(){return S.isString},isStringArray:function(){return S.isStringArray},isURL:function(){return C.isURL},isValidName:function(){return E.isValidName},isViewObject:function(){return I.isViewObject},isVoid:function(){return D.isVoid},isWindow:function(){return T.isWindow}});var o=i(98740),s=i(72068),n=i(17312),r=i(22289),a=i(94013),l=i(91565),c=i(46248),u=i(82166),h=i(52433),d=i(99732),p=i(24497),m=i(44998),f=i(23175),g=i(23283),_=i(72412),v=i(70222),b=i(62101),y=i(52100),w=i(3213),S=i(85932),C=i(91764),E=i(50083),I=i(31534),D=i(18303),T=i(3513)},72068:function(t,e,i){"use strict";function o(t){return!!t&&t instanceof DOMException&&"AbortError"===t.name}i.d(e,{isAbortError:function(){return o}})},17312:function(t,e,i){"use strict";function o(t){return Array.isArray(t)}i.d(e,{isArray:function(){return o}})},22289:function(t,e,i){"use strict";function o(t){return"boolean"==typeof t}i.d(e,{isBoolean:function(){return o}})},94013:function(t,e,i){"use strict";i.d(e,{isEqual:function(){return s},isFastEqual:function(){return n}});var o=i(3347);function s(t,e){return t===e||(0,o.stringify)(t)===(0,o.stringify)(e)}function n(t,e){return t===e}},91565:function(t,e,i){"use strict";function o(t){return"function"==typeof t}i.d(e,{isFunction:function(){return o}})},82166:function(t,e,i){"use strict";function o(t){return -1!==t.search(/<meta.*?Microsoft Excel\s[\d].*?>/)||-1!==t.search(/<meta.*?Microsoft Word\s[\d].*?>/)||-1!==t.search(/<meta[^>]*?ProgId[^>]*?(Word|Excel)\./i)||-1!==t.search(/<meta[^>]*?(LibreOffice|OpenOffice)/i)||-1!==t.search(/urn:schemas-microsoft-com:office:(word|excel)/)||-1!==t.search(/<\w[^>]*\sclass=("|')?Mso/)||-1!==t.search(/style='[^']*mso-/)||-1!==t.search(/style="[^"]*mso-/)&&-1!==t.search(/<font/)}i.d(e,{isHtmlFromWord:function(){return o}})},46248:function(t,e,i){"use strict";var o=i(85932);i.d(e,["isHTML",0,t=>(0,o.isString)(t)&&/<([A-Za-z][A-Za-z0-9]*)\b[^>]*>(.*?)<\/\1>/m.test(t.replace(/[\r\n]/g,""))])},52433:function(t,e,i){"use strict";i.d(e,{hasContainer:function(){return l},isDestructable:function(){return a},isInitable:function(){return r}});var o=i(23211),s=i(91565),n=i(18303);function r(t){return!(0,n.isVoid)(t)&&(0,s.isFunction)(t.init)}function a(t){return!(0,n.isVoid)(t)&&(0,s.isFunction)(t.destruct)}function l(t){return!(0,n.isVoid)(t)&&o.Dom.isElement(t.container)}},99732:function(t,e,i){"use strict";i.d(e,{isInt:function(){return n}});var o=i(70222),s=i(85932);function n(t){return(0,s.isString)(t)&&(0,o.isNumeric)(t)&&(t=parseFloat(t)),"number"==typeof t&&Number.isFinite(t)&&!(t%1)}},24497:function(t,e,i){"use strict";i.d(e,{isJoditObject:function(){return s}});var o=i(91565);function s(t){return!!(t&&t instanceof Object&&(0,o.isFunction)(t.constructor)&&("u">typeof Jodit&&t instanceof Jodit||t.isJodit))}},44998:function(t,e,i){"use strict";var o=i(85932);i.d(e,["isLicense",0,t=>(0,o.isString)(t)&&23===t.length&&/^[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{5}$/i.test(t)])},23175:function(t,e,i){"use strict";i.d(e,{isMarker:function(){return s}});var o=i(23211);function s(t){return o.Dom.isMarker(t)}},23283:function(t,e,i){"use strict";function o(t){return!!t&&"function"===(typeof t).toLowerCase()&&(t===Function.prototype||/^\s*function\s*(\b[a-z$_][a-z0-9$_]*\b)*\s*\((|([a-z$_][a-z0-9$_]*)(\s*,[a-z$_][a-z0-9$_]*)*)\)\s*{\s*\[native code]\s*}\s*$/i.test(t+""))}i.d(e,{isNativeFunction:function(){return o}})},72412:function(t,e,i){"use strict";function o(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}i.d(e,{isNumber:function(){return o}})},70222:function(t,e,i){"use strict";i.d(e,{isNumeric:function(){return s}});var o=i(85932);function s(t){if((0,o.isString)(t)){if(!t.match(/^([+-])?[0-9]+(\.?)([0-9]+)?(e[0-9]+)?$/))return!1;t=parseFloat(t)}return"number"==typeof t&&!isNaN(t)&&isFinite(t)}},62101:function(t,e,i){"use strict";i.d(e,{isPlainObject:function(){return s}});var o=i(3513);function s(t){return!(!t||"object"!=typeof t||t.nodeType||(0,o.isWindow)(t))&&!(t.constructor&&!({}).hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))}},52100:function(t,e,i){"use strict";function o(t){return t&&"function"==typeof t.then}i.d(e,{isPromise:function(){return o}})},3213:function(t,e,i){"use strict";i.d(e,{isSet:function(){return s}});var o=i(91565);function s(t){return!!t&&(0,o.isFunction)(t.has)&&(0,o.isFunction)(t.add)&&(0,o.isFunction)(t.delete)}},85932:function(t,e,i){"use strict";i.d(e,{isString:function(){return s},isStringArray:function(){return n}});var o=i(17312);function s(t){return"string"==typeof t}function n(t){return(0,o.isArray)(t)&&s(t[0])}},91764:function(t,e,i){"use strict";i.d(e,{isURL:function(){return s}});var o=i(81937);function s(t){if(t.includes(" "))return!1;if("u">typeof URL)try{let e=new URL(t);return["https:","http:","ftp:","file:","rtmp:"].includes(e.protocol)}catch(t){return!1}let e=o.globalDocument.createElement("a");return e.href=t,!!e.hostname}},50083:function(t,e,i){"use strict";function o(t){return!!t.length&&!/[^0-9A-Za-zа-яА-ЯЁё\w\-_. ]/.test(t)&&t.trim().length>0}i.d(e,{isValidName:function(){return o}})},31534:function(t,e,i){"use strict";i.d(e,{isViewObject:function(){return s}});var o=i(91565);function s(t){return!!(t&&t instanceof Object&&(0,o.isFunction)(t.constructor)&&t.isView)}},18303:function(t,e,i){"use strict";function o(t){return null==t}i.d(e,{isVoid:function(){return o}})},3513:function(t,e,i){"use strict";function o(t){return null!=t&&t===t.window}i.d(e,{isWindow:function(){return o}})},93387:function(t,e,i){"use strict";i.d(e,["colorToHex",0,t=>{if("rgba(0, 0, 0, 0)"===t||""===t)return!1;if(!t)return"#000000";if("#"===t.substr(0,1))return t;let e=/([\s\n\t\r]*?)rgb\((\d+), (\d+), (\d+)\)/.exec(t)||/([\s\n\t\r]*?)rgba\((\d+), (\d+), (\d+), ([\d.]+)\)/.exec(t);if(!e)return"#000000";let i=parseInt(e[2],10),o=parseInt(e[3],10),s=(parseInt(e[4],10)|o<<8|i<<16).toString(16).toUpperCase();for(;s.length<6;)s="0"+s;return e[1]+"#"+s}])},30893:function(t,e,i){"use strict";i.d(e,{applyStyles:function(){return u}});var o=i(81937),s=i(23211),n=i(4040),r=i(7909),a=i(80991),l=i(28723);function c(t){return t.replace(/mso-[a-z-]+:[\s]*[^;]+;/gi,"").replace(/mso-[a-z-]+:[\s]*[^";']+$/gi,"").replace(/border[a-z-]*:[\s]*[^;]+;/gi,"").replace(/([0-9.]+)(pt|cm)/gi,(t,e,i)=>{switch(i.toLowerCase()){case"pt":return(1.328*parseFloat(e)).toFixed(0)+"px";case"cm":return(.02645833*parseFloat(e)).toFixed(0)+"px"}return t})}function u(t){let e=/<html(?:\s[^>]*)?>/i.exec(t);if(!e)return t;let i=(t=t.substring(e.index)).toLowerCase().lastIndexOf("</html>");-1!==i&&(t=t.substring(0,i+7));let u=o.globalDocument.createElement("iframe");(0,a.css)(u,"display","none"),s.Dom.append(o.globalDocument.body,u);let h="";try{let e=u.contentDocument||(u.contentWindow?u.contentWindow.document:null);if(e){e.open(),e.write(t),e.close(),s.Dom.each(e.body,t=>{s.Dom.isElement(t)&&/mso-list:\s*ignore/i.test((0,r.attr)(t,"style")||"")&&s.Dom.safeRemove(t)});try{for(let t=0;t<e.styleSheets.length;t+=1){let i=e.styleSheets[t].cssRules;for(let t=0;t<i.length;t+=1)""!==i[t].selectorText&&(0,l.$$)(i[t].selectorText,e.body).forEach(e=>{e.style.cssText=c(i[t].style.cssText+";"+e.style.cssText)})}}catch(t){if(!o.IS_PROD)throw t}s.Dom.each(e.body,t=>{if(s.Dom.isElement(t)){let e=(0,r.attr)(t,"style");e&&(t.style.cssText=c(e)),(0,r.attr)(t,"style")||(0,r.attr)(t,"style",null)}}),h=e.firstChild?(0,n.trim)(e.body.innerHTML):""}}catch{}finally{s.Dom.safeRemove(u)}return h&&(t=h),(0,n.trim)(t.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g,"").replace(/<!--[^>]*>/g,""))}},1277:function(t,e,i){"use strict";i.d(e,{cleanFromWord:function(){return l}});var o=i(81937),s=i(23211),n=i(88475),r=i(4040),a=i(7909);function l(t){-1!==t.indexOf("<html ")&&(t=(t=t.substring(t.indexOf("<html "),t.length)).substring(0,t.lastIndexOf("</html>")+7));let e="";try{let i=o.globalDocument.createElement("div");i.innerHTML=t;let r=[];i.firstChild&&s.Dom.each(i,t=>{if(t)switch(t.nodeType){case Node.ELEMENT_NODE:switch(t.nodeName){case"STYLE":case"LINK":case"META":r.push(t);break;case"W:SDT":case"W:SDTPR":case"FONT":s.Dom.unwrap(t);break;default:if(/mso-list:\s*ignore/i.test((0,a.attr)(t,"style")||"")){r.push(t);break}(0,n.toArray)(t.attributes).forEach(e=>{-1===["src","href","rel","content"].indexOf(e.name.toLowerCase())&&(0,a.attrRaw)(t,e.name,null)})}break;case Node.TEXT_NODE:break;default:r.push(t)}}),s.Dom.safeRemove.apply(null,r),e=i.innerHTML}catch(t){}return e&&(t=e),(t=t.split(/(\n)/).filter(r.trim).join(`
|
|
9
|
+
`,{group:"state",buttons:[]},{group:"clipboard",buttons:[]},{group:"insert",buttons:[]},{group:"indent",buttons:[]},{group:"color",buttons:[]},{group:"form",buttons:[]},"---",{group:"history",buttons:[]},{group:"search",buttons:[]},{group:"source",buttons:[]},{group:"other",buttons:[]},{group:"info",buttons:[]}]),(0,o._)(this,"controls",void 0),(0,o._)(this,"events",{}),(0,o._)(this,"textIcons",!1),(0,o._)(this,"popupRoot",null),(0,o._)(this,"showBrowserColorPicker",!0),Object.assign(this,n)}}(0,o._)(r,"__defaultOptions",void 0),n=r.prototype,r.prototype.controls={}},24735:function(t,e,i){"use strict";i.d(e,{Async:function(){return f}});var o=i(25045),s=i(81937),n=i(61077),r=i(72068),a=i(91565),l=i(72412),c=i(62101),u=i(52100),h=i(85932),d=i(18303),p=i(28712),m=i(14228);class f{delay(t){return this.promise(e=>this.setTimeout(e,t))}setTimeout(t,e,...i){if(this.isDestructed)return 0;let o={};(0,d.isVoid)(e)&&(e=0),(0,l.isNumber)(e)||(e=(o=e).timeout||0),o.label&&this.clearLabel(o.label);let s=(0,n.setTimeout)(t,e,...i),r=o.label||s;return this.timers.set(r,s),this.__callbacks.set(r,t),s}updateTimeout(t,e){if((0,p.assert)(t&&this.timers.has(t),"Label does not exist"),!t||!this.timers.has(t))return null;let i=this.__callbacks.get(t);return(0,p.assert)((0,a.isFunction)(i),"Callback is not a function"),this.setTimeout(i,{label:t,timeout:e})}clearLabel(t){t&&this.timers.has(t)&&((0,n.clearTimeout)(this.timers.get(t)),this.timers.delete(t),this.__callbacks.delete(t))}clearTimeout(t){if((0,h.isString)(t))return this.clearLabel(t);(0,n.clearTimeout)(t),this.timers.delete(t),this.__callbacks.delete(t)}debounce(t,e,i=!1){let o=0,s=!1,l=[],h=(...e)=>{if(!s){o=0;let i=t(...e);if(s=!0,l.length){let t=()=>{l.forEach(t=>t()),l.length=0};(0,u.isPromise)(i)?i.finally(t):t()}}},d=(...r)=>{s=!1,e?(!o&&i&&h(...r),(0,n.clearTimeout)(o),o=this.setTimeout(()=>h(...r),(0,a.isFunction)(e)?e():e),this.timers.set(t,o)):h(...r)};return(0,c.isPlainObject)(e)&&e.promisify?(...t)=>{let e=this.promise(t=>{l.push(t)}).catch(t=>{if((0,r.isAbortError)(t))return null;throw t});return d(...t),e}:d}microDebounce(t,e=!1){let i,o=!1,s=!0;return(...n)=>{if(i=n,o){s=!0;return}s=!0,e&&(s=!1,t(...i)),o=!0,this.__queueMicrotaskNative(()=>{o=!1,!this.isDestructed&&s&&t(...i)})}}throttle(t,e,i=!1){let o=null,s,n,r;return(...i)=>{(s=!0,r=i,e)?o||(n=()=>{s?(t(...r),s=!1,o=this.setTimeout(n,(0,a.isFunction)(e)?e():e),this.timers.set(n,o)):o=null})():t(...r)}}promise(t){let e=()=>{},i=new Promise((i,o)=>{e=()=>o((0,m.abort)("Abort async")),this.promisesRejections.add(e),t(i,o)});return!i.finally&&"u">typeof process&&!s.IS_ES_NEXT&&(i.finally=t=>(i.then(t).catch(t),i)),i.finally(()=>{this.promisesRejections.delete(e)}).catch(()=>null),i.rejectCallback=e,i}promiseState(t){if(t.status)return t.status;if(!Promise.race)return new Promise(e=>{t.then(t=>(e("fulfilled"),t),t=>{throw e("rejected"),t}),this.setTimeout(()=>{e("pending")},100)});let e={};return Promise.race([t,e]).then(t=>t===e?"pending":"fulfilled",()=>"rejected")}requestIdleCallback(t,e={timeout:100}){let i=this.__requestIdleCallbackNative(t,e);return this.__requestsIdle.add(i),i}requestIdlePromise(t){return this.promise(e=>{let i=this.requestIdleCallback(()=>e(i),t)})}schedulerPostTask(t,e={delay:0,priority:"user-visible"}){let i=new AbortController;if(e.signal&&e.signal.addEventListener("abort",()=>i.abort()),this.__controllers.add(i),void 0!==globalThis.scheduler){let o=globalThis.scheduler.postTask(t,{...e,signal:i.signal});return o.finally(()=>{this.__controllers.delete(i)}).catch(()=>null),o}return this.promise((o,s)=>{let n=this.setTimeout(()=>{try{o(t())}catch(t){s(t)}this.__controllers.delete(i)},e.delay||1);i.signal.addEventListener("abort",()=>{this.clearTimeout(n),this.__controllers.delete(i),s((0,m.abort)())})})}schedulerYield(){return this.schedulerPostTask(()=>{},{priority:"user-visible"})}cancelIdleCallback(t){return this.__requestsIdle.delete(t),this.__cancelIdleCallbackNative(t)}requestAnimationFrame(t){let e=requestAnimationFrame(t);return this.__requestsRaf.add(e),e}cancelAnimationFrame(t){this.__requestsRaf.delete(t),cancelAnimationFrame(t)}clear(){this.__requestsIdle.forEach(t=>this.cancelIdleCallback(t)),this.__requestsRaf.forEach(t=>this.cancelAnimationFrame(t)),this.__controllers.forEach(t=>t.abort()),this.timers.forEach(t=>(0,n.clearTimeout)(this.timers.get(t))),this.timers.clear(),this.promisesRejections.forEach(t=>t()),this.promisesRejections.clear()}destruct(){this.clear(),this.isDestructed=!0}constructor(){(0,o._)(this,"timers",new Map),(0,o._)(this,"__callbacks",new Map),(0,o._)(this,"__queueMicrotaskNative",queueMicrotask?.bind(window)??Promise.resolve().then.bind(Promise.resolve())),(0,o._)(this,"promisesRejections",new Set),(0,o._)(this,"__requestsIdle",new Set),(0,o._)(this,"__controllers",new Set),(0,o._)(this,"__requestsRaf",new Set),(0,o._)(this,"__requestIdleCallbackNative",window.requestIdleCallback?.bind(window)??((t,e)=>{let i=Date.now();return this.setTimeout(()=>{t({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-i))})},e?.timeout??1)})),(0,o._)(this,"__cancelIdleCallbackNative",window.cancelIdleCallback?.bind(window)??(t=>{this.clearTimeout(t)})),(0,o._)(this,"isDestructed",!1)}}},91231:function(t,e,i){"use strict";i.d(e,{Async:function(){return o.Async}});var o=i(24735)},80251:function(t,e,i){"use strict";i.d(e,{Component:function(){return c}});var o=i(25045),s=i(91231),n=i(69364),r=i(28077),a=i(65946);let l=new Map;class c{get componentName(){return this.__componentName||(this.__componentName="jodit-"+(0,a.kebabCase)(((0,a.isFunction)(this.className)?this.className():"")||(0,a.getClassName)(this))),this.__componentName}getFullElName(t,e,i){let o=[this.componentName];return t&&o.push("__"+(t=t.replace(/[^a-z0-9-]/gi,"-"))),e&&(o.push("_",e),o.push("_",(0,a.isVoid)(i)?"true":i.toString())),o.join("")}get ownerDocument(){return this.ow.document}get od(){return this.ownerDocument}get ow(){return this.ownerWindow}get(t,e){return(0,a.get)(t,e||this)}get isReady(){return this.componentStatus===n.STATUSES.ready}get isDestructed(){return this.componentStatus===n.STATUSES.destructed}get isInDestruct(){return n.STATUSES.beforeDestruct===this.componentStatus||n.STATUSES.destructed===this.componentStatus}bindDestruct(t){return t.hookStatus(n.STATUSES.beforeDestruct,()=>!this.isInDestruct&&this.destruct()),this}destruct(){this.setStatus(n.STATUSES.destructed),this.async&&(this.async.destruct(),this.async=void 0),l.get(this)&&l.delete(this),this.ownerWindow=void 0}get componentStatus(){return this.__componentStatus}set componentStatus(t){this.setStatus(t)}setStatus(t){return this.setStatusComponent(t,this)}setStatusComponent(t,e){if(t===this.__componentStatus)return;e===this&&(this.__componentStatus=t);let i=Object.getPrototypeOf(this);i&&(0,a.isFunction)(i.setStatusComponent)&&i.setStatusComponent(t,e);let o=l.get(this),s=o?.[t];s&&s.length&&s.forEach(t=>t(e))}hookStatus(t,e){let i=l.get(this);i||(i={},l.set(this,i)),i[t]||(i[t]=[]),i[t].push(e)}static isInstanceOf(t,e){return t instanceof e}constructor(){(0,o._)(this,"__componentName",void 0),(0,o._)(this,"async",new s.Async),(0,o._)(this,"uid",void 0),(0,o._)(this,"ownerWindow",window),(0,o._)(this,"__componentStatus",n.STATUSES.beforeInit),this.uid="jodit-uid-"+(0,r.uniqueUid)()}}(0,o._)(c,"STATUSES",n.STATUSES)},16964:function(t,e,i){"use strict";i.d(e,{Component:function(){return o.Component},STATUSES:function(){return s.STATUSES},ViewComponent:function(){return n.ViewComponent}});var o=i(80251),s=i(69364),n=i(59609)},69364:function(t,e,i){"use strict";i.d(e,["STATUSES",0,{beforeInit:"beforeInit",ready:"ready",beforeDestruct:"beforeDestruct",destructed:"destructed"}])},59609:function(t,e,i){"use strict";i.d(e,{ViewComponent:function(){return n}});var o=i(25045),s=i(80251);class n extends s.Component{get j(){return this.jodit}get defaultTimeout(){return this.j.defaultTimeout}i18n(t,...e){return this.j.i18n(t,...e)}setParentView(t){return this.jodit=t,t.ow&&(this.ownerWindow=t.ow),t.components.add(this),this}destruct(){return this.j.components.delete(this),super.destruct()}constructor(t){super(),(0,o._)(this,"jodit",void 0),this.setParentView(t)}}},81937:function(t,e,i){"use strict";i.r(e),i.d(e,{IS_TEST:function(){return o}});let o=!1,s="u">typeof window?window:void 0,n="u">typeof document?document:void 0,r=new Set(["ul","ol"]),a=["img","video","svg","iframe","script","input","textarea","link","jodit","jodit-media"],l=new Set([...a,"br","hr"]),c=new Set(a),u="Meta",h="Backspace",d="Enter",p="Escape",m="ArrowLeft",f="ArrowUp",g="ArrowRight",_="ArrowDown",v="Delete",b=[u,h,v,f,_,g,m,d,p,"F3","Tab"],y="u">typeof navigator&&(-1!==navigator.userAgent.indexOf("MSIE")||/rv:11.0/i.test(navigator.userAgent)),w=void 0!==s&&/Mac|iPod|iPhone|iPad/.test(s.navigator.platform),S=t=>{let e=t.split("/");return/\.js/.test(e[e.length-1])?{basePath:e.slice(0,e.length-1).join("/")+"/",isMin:!0}:{basePath:t,isMin:!0}},{basePath:C,isMin:E}=(()=>{if("u"<typeof document)return{basePath:"",isMin:!0};let t=n.currentScript;if(t)return S(t.src);let e=n.querySelectorAll("script[src]");return e&&e.length?S(e[e.length-1].src):S(s.location.href)})(),I=new Set(["touchstart","touchend","scroll","mousewheel","mousemove","touchmove"]);i.d(e,["ACCURACY",0,10,"APP_VERSION",0,"4.14.3","BASE_PATH",0,C,"BASE_PATH_IS_MIN",0,E,"BR",0,"br","CLIPBOARD_ID",0,"clipboard","COMMAND_KEYS",0,b,"EMULATE_DBLCLICK_TIMEOUT",0,300,"ES",0,"es2021","FAT_MODE",0,!0,"HOMEPAGE",0,"https://xdsoft.net/jodit/","INSEPARABLE_TAGS",0,l,"INSERT_AS_HTML",0,"insert_as_html","INSERT_AS_TEXT",0,"insert_as_text","INSERT_CLEAR_HTML",0,"insert_clear_html","INSERT_ONLY_TEXT",0,"insert_only_text","INVISIBLE_SPACE",0,"\uFEFF","INVISIBLE_SPACE_REG_EXP",0,()=>/[\uFEFF]/g,"INVISIBLE_SPACE_REG_EXP_END",0,()=>/[\uFEFF]+$/g,"INVISIBLE_SPACE_REG_EXP_START",0,()=>/^[\uFEFF]+/g,"IS_BLOCK",0,/^(ADDRESS|ARTICLE|ASIDE|BLOCKQUOTE|CANVAS|DD|DFN|DIV|DL|DT|FIELDSET|FIGCAPTION|FIGURE|FOOTER|FORM|H[1-6]|HEADER|HGROUP|HR|LI|MAIN|NAV|NOSCRIPT|OUTPUT|P|PRE|RUBY|SCRIPT|STYLE|OBJECT|OL|SECTION|IFRAME|JODIT|JODIT-MEDIA|UL|TR|TD|TH|TBODY|THEAD|TFOOT|TABLE|BODY|HTML|VIDEO)$/i,"IS_ES_MODERN",0,!0,"IS_ES_NEXT",0,!0,"IS_IE",0,y,"IS_INLINE",0,/^(STRONG|SPAN|I|EM|B|SUP|SUB|A|U)$/i,"IS_MAC",0,w,"IS_PROD",0,!0,"KEY_ALIASES",0,{add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:w?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:"space",spacebar:"space",up:"arrowup",win:"meta",windows:"meta"},"KEY_ALT",0,"Alt","KEY_BACKSPACE",0,h,"KEY_DELETE",0,v,"KEY_DOWN",0,_,"KEY_ENTER",0,d,"KEY_ESC",0,p,"KEY_F3",0,"F3","KEY_LEFT",0,m,"KEY_META",0,u,"KEY_RIGHT",0,g,"KEY_SPACE",0,"Space","KEY_TAB",0,"Tab","KEY_UP",0,f,"LIST_TAGS",0,r,"MARKER_CLASS",0,"jodit-selection_marker","MODE_SOURCE",0,2,"MODE_SPLIT",0,3,"MODE_WYSIWYG",0,1,"NBSP_SPACE",0," ","NEARBY",0,5,"NO_EMPTY_TAGS",0,c,"PARAGRAPH",0,"p","PASSIVE_EVENTS",0,I,"SAFE_COUNT_CHANGE_CALL",0,10,"SET_TEST",0,()=>o=!0,"SOURCE_CONSUMER",0,"source-consumer","SPACE_REG_EXP",0,()=>/[\s\n\t\r\uFEFF\u200b]+/g,"SPACE_REG_EXP_END",0,()=>/[\s\n\t\r\uFEFF\u200b]+$/g,"SPACE_REG_EXP_START",0,()=>/^[\s\n\t\r\uFEFF\u200b]+/g,"TEMP_ATTR",0,"data-jodit-temp","TEXT_HTML",0,y?"html":"text/html","TEXT_PLAIN",0,y?"text":"text/plain","TEXT_RTF",0,y?"rtf":"text/rtf","TOKENS",0,{},"globalDocument",0,n,"globalWindow",0,s,"lang",0,{}])},76517:function(t,e,i){"use strict";i.d(e,{Create:function(){return l}});var o=i(25045),s=i(81937),n=i(23211),r=i(65946),a=i(28712);class l{get doc(){return(0,r.isFunction)(this.document)?this.document():this.document}element(t,e,i){let o=this.doc.createElement(t.toLowerCase());return this.applyCreateAttributes(o),e&&((0,r.isPlainObject)(e)?(0,r.attr)(o,e):i=e),i&&(0,r.asArray)(i).forEach(t=>n.Dom.append(o,(0,r.isString)(t)?this.fromHTML(t):t)),o}div(t,e,i){let o=this.element("div",e,i);return t&&(o.className=t),o}sandbox(){let t=this.element("iframe",{sandbox:"allow-same-origin"});n.Dom.append(this.doc.body,t);let e=t.contentWindow?.document;if((0,a.assert)(e,"iframe.contentWindow.document"),!e)throw Error("Iframe error");return e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),[e.body,t]}span(t,e,i){let o=this.element("span",e,i);return t&&(o.className=t),o}a(t,e,i){let o=this.element("a",e,i);return t&&(o.className=t),o}text(t){return this.doc.createTextNode(t)}fake(){return this.text(s.INVISIBLE_SPACE)}fragment(){return this.doc.createDocumentFragment()}fromHTML(t,e){let i=this.div();i.innerHTML=t.toString();let o=i.firstChild===i.lastChild&&i.firstChild?i.firstChild:i;if(n.Dom.safeRemove(o),e){let t=(0,r.refs)(o);Object.keys(e).forEach(i=>{let o=t[i];o&&!1===e[i]&&n.Dom.hide(o)})}return o}applyCreateAttributes(t){if(this.createAttributes){let e=this.createAttributes;if(e&&e[t.tagName.toLowerCase()]){let i=e[t.tagName.toLowerCase()];(0,r.isFunction)(i)?i(t):(0,r.isPlainObject)(i)&&(0,r.attr)(t,i)}}}constructor(t,e){(0,o._)(this,"document",void 0),(0,o._)(this,"createAttributes",void 0),this.document=t,this.createAttributes=e}}},79821:function(t,e,i){"use strict";i.d(e,{Create:function(){return o.Create}});var o=i(76517)},49574:function(t,e,i){"use strict";i.d(e,{autobind:function(){return s}});var o=i(91565);function s(t,e,i){if(!(0,o.isFunction)(i.value))throw TypeError(`@autobind can only be applied to methods, but "${e}" is not a function`);let s=i.value;return{configurable:!0,get(){let t=s.bind(this);return Object.defineProperty(this,e,{value:t,configurable:!0,writable:!0}),t}}}},51676:function(t,e,i){"use strict";i.d(e,{cache:function(){return l},cacheHTML:function(){return c},cached:function(){return a}});var o=i(69364),s=i(23211),n=i(28686),r=i(38027);function a(t,e){let i=Object.getOwnPropertyDescriptor(t,e);return!i||(0,n.isFunction)(i.get)?null:i.value}function l(t,e,i){let o=i.get;if(!o)throw(0,r.error)("Getter property descriptor expected");i.get=function(){let t=o.call(this);return t&&!0===t.noCache||Object.defineProperty(this,e,{configurable:i.configurable,enumerable:i.enumerable,writable:!1,value:t}),t}}function c(t,e,i){let a=i.value;if(!(0,n.isFunction)(a))throw(0,r.error)("Handler must be a Function");let l=!0,c=new WeakMap;i.value=function(...t){let e=this.od??document,i=c.get(e);if(l&&i?.has(this.constructor))return i.get(this.constructor)?.cloneNode(!0);let o=a.apply(this,t);return l&&s.Dom.isElement(o)&&(i?i.set(this.constructor,o):c.set(e,new WeakMap([[this.constructor,o]]))),l?o.cloneNode(!0):o},t.hookStatus(o.STATUSES.ready,t=>{l=!!((0,n.isViewObject)(t)?t:t.jodit).options.cache})}},91672:function(t,e,i){"use strict";i.d(e,{component:function(){return r},getComponentClass:function(){return a}});var o=i(81937),s=i(421);let n=new Map;function r(t){class e extends t{constructor(...t){super(...t),this.constructor===e&&(this instanceof e||Object.setPrototypeOf(this,e.prototype),this.setStatus("ready"))}}let i=(0,s.getClassName)(t.prototype);if(n.has(i)&&!o.IS_PROD)throw Error(`Component with name "${i}" is already registered`);return n.set(i,e),e}function a(t){return n.get(t)}},55184:function(t,e,i){"use strict";i.d(e,{debounce:function(){return a},throttle:function(){return l}});var o=i(16964),s=i(28686),n=i(28712),r=i(33201);function a(t,e=!1,i="debounce"){return(a,l)=>{let c=a[l];if(!(0,s.isFunction)(c))throw(0,r.error)("Handler must be a Function");return a.hookStatus(o.STATUSES.ready,o=>{let{async:r}=o;(0,n.assert)(null!=r,`Component ${o.componentName||o.constructor.name} should have "async:IAsync" field`);let a=(0,s.isFunction)(t)?t(o):t,c=(0,s.isNumber)(a)||(0,s.isPlainObject)(a)?a:o.defaultTimeout;Object.defineProperty(o,l,{configurable:!0,value:r[i](o[l].bind(o),c,e)})}),{configurable:!0,get(){return c.bind(this)}}}}function l(t,e=!1){return a(t,e,"throttle")}},24968:function(t,e,i){"use strict";i.d(e,{derive:function(){return s}});var o=i(91565);function s(...t){return e=>{let i=e.prototype;for(let e=0;e<t.length;e++){let s=t[e],n=Object.getOwnPropertyNames(s.prototype);for(let t=0;t<n.length;t++){let e=n[t],r=Object.getOwnPropertyDescriptor(s.prototype,e);null!=r&&(0,o.isFunction)(r.value)&&!(0,o.isFunction)(i[e])&&Object.defineProperty(i,e,{enumerable:!0,configurable:!0,writable:!0,value:function(...t){return r.value.call(this,...t)}})}}}}},29200:function(t,e,i){"use strict";i.d(e,{hook:function(){return n}});var o=i(91565),s=i(33201);function n(t){return(e,i)=>{if(!(0,o.isFunction)(e[i]))throw(0,s.error)("Handler must be a Function");e.hookStatus(t,t=>{t[i].call(t)})}}},35718:function(t,e,i){"use strict";i.d(e,{idle:function(){return r}});var o=i(16964),s=i(91565),n=i(33201);function r(){return(t,e)=>{if(!(0,s.isFunction)(t[e]))throw(0,n.error)("Handler must be a Function");t.hookStatus(o.STATUSES.ready,t=>{let{async:i}=t,o=t[e];t[e]=(...e)=>i.requestIdleCallback(o.bind(t,...e))})}}},84839:function(t,e,i){"use strict";i.r(e),i.d(e,{autobind:function(){return o.autobind},cache:function(){return s.cache},cacheHTML:function(){return s.cacheHTML},cached:function(){return s.cached},component:function(){return n.component},debounce:function(){return r.debounce},derive:function(){return a.derive},getComponentClass:function(){return n.getComponentClass},hook:function(){return l.hook},idle:function(){return c.idle},nonenumerable:function(){return u.nonenumerable},persistent:function(){return h.persistent},throttle:function(){return r.throttle},wait:function(){return d.wait},watch:function(){return p.watch}});var o=i(49574),s=i(51676),n=i(91672),r=i(55184),a=i(24968),l=i(29200),c=i(35718),u=i(41360),h=i(77036),d=i(80840),p=i(68616)},41360:function(t,e,i){"use strict";i.d(e,["nonenumerable",0,(t,e)=>{!1!==(Object.getOwnPropertyDescriptor(t,e)||{}).enumerable&&Object.defineProperty(t,e,{enumerable:!1,set(t){Object.defineProperty(this,e,{enumerable:!1,writable:!0,value:t})}})}])},77036:function(t,e,i){"use strict";i.d(e,{persistent:function(){return n}});var o=i(69364),s=i(31534);function n(t,e){t.hookStatus(o.STATUSES.ready,t=>{let i=(0,s.isViewObject)(t)?t:t.jodit,o=`${i.options.namespace}${t.componentName}_prop_${e}`,n=t[e];Object.defineProperty(t,e,{get:()=>i.storage.get(o)??n,set(t){i.storage.set(o,t)}})})}},80840:function(t,e,i){"use strict";i.d(e,{wait:function(){return r}});var o=i(69364),s=i(91565),n=i(33201);function r(t){return(e,i)=>{let r=e[i];if(!(0,s.isFunction)(r))throw(0,n.error)("Handler must be a Function");e.hookStatus(o.STATUSES.ready,e=>{let{async:o}=e,s=e[i],n=0;Object.defineProperty(e,i,{configurable:!0,value:function i(...r){o.clearTimeout(n),t(e)?s.apply(e,r):n=o.setTimeout(()=>i(...r),10)}})})}}},68616:function(t,e,i){"use strict";i.d(e,{watch:function(){return h}});var o=i(69364),s=i(70535),n=i(32328),r=i(91565),a=i(62101),l=i(31534),c=i(33201),u=i(71125);function h(t,e){return(i,h)=>{if(!(0,r.isFunction)(i[h]))throw(0,c.error)("Handler must be a Function");let d=e?.immediately??!0,p=e?.context,m=e=>{let o=(0,l.isViewObject)(e)?e:e.jodit,c=(t,...i)=>{if(!e.isInDestruct)return e[h](t,...i)};d||(c=e.async.microDebounce(c,!0)),(0,n.splitArray)(t).forEach(t=>{if(/:/.test(t)){let[i,s]=t.split(":"),n=p;i.length&&(n=e.get(i)),(0,r.isFunction)(n)&&(n=n(e)),o.events.on(n||e,s,c),n||o.events.on(s,c),e.hookStatus("beforeDestruct",()=>{o.events.off(n||e,s,c).off(s,c)});return}let n=t.split("."),[l]=n,h=n.slice(1),d=e[l];(0,a.isPlainObject)(d)&&(0,s.observable)(d).on("change."+h.join("."),c);let m=(0,u.getPropertyDescriptor)(i,l);Object.defineProperty(e,l,{configurable:!0,set(t){let i=d;i!==t&&(d=t,m&&m.set&&m.set.call(e,t),(0,a.isPlainObject)(d)&&(d=(0,s.observable)(d)).on("change."+h.join("."),c),c(l,i,d))},get:()=>m&&m.get?m.get.call(e):d})})};(0,r.isFunction)(i.hookStatus)?i.hookStatus(o.STATUSES.ready,m):m(i)}}},23211:function(t,e,i){"use strict";i.d(e,{Dom:function(){return b}});var o=i(81937),s=i(88475),n=i(17312),r=i(91565),a=i(46248),l=i(3213),c=i(85932),u=i(18303),h=i(4040),d=i(28712),p=i(7909),m=i(80991),f=i(36400),g=i(33201),_=i(71125);let v=RegExp(`<([a-z]+)[^>]+${o.TEMP_ATTR}[^>]*>(.+?)</\\1>`,"gi");class b{static detach(t){for(;t&&t.firstChild;)t.removeChild(t.firstChild)}static wrapNextInline(t,e,i){let o,s=t;i.s.save();let n=!1;do n=!1,(o=s.nextSibling)&&!b.isBlock(o)&&!b.isTag(o,"br")&&(n=!0,s=o);while(n)return b.__wrapElements(e,i,t,s)}static __wrapElements(t,e,i,o){let s=(0,c.isString)(t)?e.createInside.element(t):t;i.parentNode&&i.parentNode.insertBefore(s,i);let n=i;for(;n&&(n=i.nextSibling,s.appendChild(i),i!==o&&n);)i=n;return e.s.restore(),s}static wrapInline(t,e,i){let o,s=t,n=t;i.s.save();let r=!1;do r=!1,(o=s.previousSibling)&&!b.isBlock(o)&&(r=!0,s=o);while(r)do r=!1,(o=n.nextSibling)&&!b.isBlock(o)&&(r=!0,n=o);while(r)return b.__wrapElements(e,i,s,n)}static wrap(t,e,i){let o=(0,c.isString)(e)?i.element(e):e;if(b.isNode(t)){if(!t.parentNode)throw(0,g.error)("Element should be in DOM");t.parentNode.insertBefore(o,t),o.appendChild(t)}else{let e=t.extractContents();t.insertNode(o),o.appendChild(e)}return o}static unwrap(t){let e=t.parentNode;if(e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);b.safeRemove(t)}}static between(t,e,i){let o=t;for(;o&&o!==e&&!(t!==o&&i(o));){let t=o.firstChild||o.nextSibling;if(!t){for(;o&&!o.nextSibling;)if((o=o.parentNode)===e)return;t=o?.nextSibling}o=t}}static replace(t,e,i,o=!1,n=!1){let r;if((0,a.isHTML)(e)&&((0,d.assert)(i,"Need create instance for new tag"),e=i.fromHTML(e)),(0,c.isString)(e)?((0,d.assert)(i,"Need create instance for new tag"),r=i.element(e)):r=e,!n)for(;t.firstChild;)r.appendChild(t.firstChild);return o&&b.isElement(t)&&b.isElement(r)&&(0,s.toArray)(t.attributes).forEach(t=>{r.setAttribute(t.name,t.value)}),t.parentNode&&t.parentNode.replaceChild(r,t),r}static isEmptyTextNode(t){return b.isText(t)&&(!t.nodeValue||0===t.nodeValue.replace(o.INVISIBLE_SPACE_REG_EXP(),"").trim().length)}static isEmptyContent(t){return b.each(t,t=>b.isEmptyTextNode(t))}static isContentEditable(t,e){return b.isNode(t)&&!b.closest(t,t=>b.isElement(t)&&"false"===t.getAttribute("contenteditable"),e)}static isEmpty(t,e=o.NO_EMPTY_TAGS){let i;if(!t)return!0;i=(0,r.isFunction)(e)?e:t=>e.has(t.nodeName.toLowerCase());let s=t=>null==t.nodeValue||0===(0,h.trim)(t.nodeValue).length;return b.isText(t)?s(t):!(b.isElement(t)&&i(t))&&b.each(t,t=>{if(b.isText(t)&&!s(t)||b.isElement(t)&&i(t))return!1})}static isNode(t){return!!(t&&(0,c.isString)(t.nodeName)&&"number"==typeof t.nodeType&&t.childNodes&&(0,r.isFunction)(t.appendChild))}static isCell(t){return b.isNode(t)&&("TD"===t.nodeName||"TH"===t.nodeName)}static isList(t){return b.isTag(t,o.LIST_TAGS)}static isLeaf(t){return b.isTag(t,"li")}static isImage(t){return b.isNode(t)&&/^(img|svg|picture|canvas)$/i.test(t.nodeName)}static isBlock(t){return!(0,u.isVoid)(t)&&"object"==typeof t&&b.isNode(t)&&o.IS_BLOCK.test(t.nodeName)}static isText(t){return!!(t&&t.nodeType===Node.TEXT_NODE)}static isComment(t){return!!(t&&t.nodeType===Node.COMMENT_NODE)}static isElement(t){return!!b.isNode(t)&&t.nodeType===Node.ELEMENT_NODE}static isFragment(t){return!!b.isNode(t)&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}static isHTMLElement(t){if(!b.isNode(t))return!1;let e=t.ownerDocument?.defaultView;return t instanceof(e?e.HTMLElement:HTMLElement)}static isInlineBlock(t){return b.isElement(t)&&!/^(BR|HR)$/i.test(t.tagName)&&-1!==["inline","inline-block"].indexOf((0,m.css)(t,"display").toString())}static canSplitBlock(t){return!(0,u.isVoid)(t)&&b.isHTMLElement(t)&&b.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&void 0!==t.style&&!/^(fixed|absolute)/i.test(t.style.position)}static first(t,e){return b.__deepMost(t,e,!1)}static last(t,e){return b.__deepMost(t,e,!0)}static __deepMost(t,e,i){let o=i?"lastChild":"firstChild",s=i?"previousSibling":"nextSibling",n=t?.[o];if(!n)return null;do{if(e(n))return n;let i=n[o]||n[s];if(!i&&n.parentNode!==t){do n=n.parentNode;while(n&&!n[s]&&n.parentNode!==t)i=n?.[s]}n=i}while(n)return null}static prev(t,e,i,o=!0){return b.find(t,e,i,!1,o)}static next(t,e,i,o=!0){return b.find(t,e,i,!0,o)}static prevWithClass(t,e){return b.__siblingWithClass(t,e,!0)}static nextWithClass(t,e){return b.__siblingWithClass(t,e,!1)}static __siblingWithClass(t,e,i){let o=t=>b.isElement(t)&&t.classList.contains(e),s=t.parentNode;return i?b.prev(t,o,s):b.next(t,o,s)}static find(t,e,i,o=!0,s=!0){let n=this.nextGen(t,i,o,s),r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}return null}static*nextGen(t,e,i=!0,o=!0){let s=[],n=t;do{let e=i?n.nextSibling:n.previousSibling;for(;e;)s.push(e),e=i?e.nextSibling:e.previousSibling;s.reverse(),yield*this.runInStack(t,s,i,o),n=n.parentNode}while(n&&n!==e)return null}static each(t,e,i=!0){let o=this.eachGen(t,i),s=o.next();for(;!s.done;){if(!1===e(s.value))return!1;s=o.next()}return!0}static eachGen(t,e=!0){return this.runInStack(t,[t],e)}static*runInStack(t,e,i,o=!0){for(;e.length;){let s=e.pop();if(o){let t=i?s.lastChild:s.firstChild;for(;t;)e.push(t),t=i?t.previousSibling:t.nextSibling}t!==s&&(yield s)}}static findWithCurrent(t,e,i,o="nextSibling",s="firstChild"){let n=t;do{if(e(n))return n||null;if(s&&n&&n[s]){let t=b.findWithCurrent(n[s],e,n,o,s);if(t)return t}for(;n&&!n[o]&&n!==i;)n=n.parentNode;n&&n[o]&&n!==i&&(n=n[o])}while(n&&n!==i)return null}static findSibling(t,e=!0,i=t=>!b.isEmptyTextNode(t)){let o=b.sibling(t,e);for(;o&&!i(o);)o=b.sibling(o,e);return o&&i(o)?o:null}static findNotEmptySibling(t,e){return b.findSibling(t,e,t=>!b.isEmptyTextNode(t)&&!!(!b.isText(t)||t.nodeValue?.length&&(0,h.trim)(t.nodeValue)))}static findNotEmptyNeighbor(t,e,i){return(0,_.call)(e?b.prev:b.next,t,t=>!!(t&&(!(b.isText(t)||b.isComment(t))||(0,h.trim)(t?.nodeValue||"").length)),i)}static sibling(t,e){return e?t.previousSibling:t.nextSibling}static up(t,e,i,o=!1){let s=t;if(!s)return null;do{if(e(s))return s;if(s===i||!s.parentNode)break;s=s.parentNode}while(s&&s!==i)return s===i&&o&&e(s)?s:null}static closest(t,e,i){let o,s=t=>t.toLowerCase();if((0,r.isFunction)(e))o=e;else if((0,n.isArray)(e)||(0,l.isSet)(e)){let t=(0,l.isSet)(e)?e:new Set(e.map(s));o=e=>!!(e&&t.has(s(e.nodeName)))}else o=t=>!!(t&&s(e)===s(t.nodeName));return b.up(t,o,i)}static furthest(t,e,i){let o=null,s=t?.parentElement;for(;s&&s!==i;)e(s)&&(o=s),s=s?.parentElement;return o}static appendChildFirst(t,e){t.firstChild!==e&&b.prepend(t,e)}static after(t,e){t.parentNode?.insertBefore(e,t.nextSibling)}static before(t,e){t.parentNode?.insertBefore(e,t)}static prepend(t,e){t.insertBefore(e,t.firstChild)}static append(t,e){(0,n.isArray)(e)?e.forEach(e=>{this.append(t,e)}):t.appendChild(e)}static moveContent(t,e,i=!1,n=()=>!0){let r=(t.ownerDocument||o.globalDocument).createDocumentFragment();(0,s.toArray)(t.childNodes).filter(t=>!!n(t)||(b.safeRemove(t),!1)).forEach(t=>{r.appendChild(t)}),e.insertBefore(r,i?e.firstChild:null)}static isOrContains(t,e,i=!1){return t===e?!i:!!(e&&t&&this.up(e,e=>e===t,t,!0))}static safeRemove(...t){t.forEach(t=>b.isNode(t)&&t.parentNode&&t.parentNode.removeChild(t))}static safeInsertNode(t,e){t.collapsed||t.deleteContents();let i=b.isFragment(e)?e.lastChild:e;t.startContainer===t.endContainer&&t.collapsed&&b.isTag(t.startContainer,o.INSEPARABLE_TAGS)?b.after(t.startContainer,e):(t.insertNode(e),i&&t.setStartBefore(i)),t.collapse(!0),[e.nextSibling,e.previousSibling].forEach(t=>b.isText(t)&&!t.nodeValue&&b.safeRemove(t))}static hide(t){t&&((0,f.dataBind)(t,"__old_display",t.style.getPropertyValue("display")),t.style.setProperty("display","none"))}static show(t){if(!t)return;let e=(0,f.dataBind)(t,"__old_display");"none"===t.style.getPropertyValue("display")&&t.style.setProperty("display",e||null)}static isTag(t,e){if(Array.isArray(e))throw TypeError("Dom.isTag does not support array");if(!this.isElement(t))return!1;let i=t.tagName.toLowerCase();return e instanceof Set?e.has(i)||e.has(t.tagName.toUpperCase()):i===e||t.tagName.toUpperCase()===e}static markTemporary(t,e){return e&&(0,p.attr)(t,e),(0,p.attr)(t,o.TEMP_ATTR,!0),t}static isTemporary(t){return!!b.isElement(t)&&(b.isMarker(t)||"true"===(0,p.attr)(t,o.TEMP_ATTR))}static isMarker(t){return b.isNode(t)&&b.isTag(t,"span")&&t.hasAttribute("data-"+o.MARKER_CLASS)}static replaceTemporaryFromString(t){return t.replace(v,"$2")}static temporaryList(t){let e=[];return b.each(t,t=>{b.isHTMLElement(t)&&t.hasAttribute(o.TEMP_ATTR)&&e.push(t)}),e}constructor(){throw Error("Dom is static module")}}},27795:function(t,e,i){"use strict";i.d(e,{Dom:function(){return o.Dom},LazyWalker:function(){return s.LazyWalker}});var o=i(23211),s=i(1080)},1080:function(t,e,i){"use strict";i.d(e,{LazyWalker:function(){return l}});var o=i(25045),s=i(31635),n=i(49574),r=i(23211),a=i(60216);class l extends a.Eventify{setWork(t){return this.isWorked?this.break():this.stop(),this.workNodes=r.Dom.eachGen(t,!this.options.reverse),this.isFinished=!1,this.hadAffect=!1,this._requestStarting(),this}_requestStarting(){this.__schedulerController=new AbortController,this.async.schedulerPostTask(this.__workPerform,{delay:this.options.timeout,signal:this.__schedulerController.signal}).catch(()=>null)}break(t){this.isWorked&&(this.stop(),this.emit("break",t))}end(){this.isWorked&&(this.stop(),this.emit("end",this.hadAffect),this.hadAffect=!1)}stop(){this.isWorked=!1,this.isFinished=!0,this.workNodes=null,this.__schedulerController?.abort(),this.__schedulerController=null}destruct(){super.destruct(),this.stop()}__workPerform(){if(this.workNodes){this.isWorked=!0;let t=0,e=this.options.timeoutChunkSize??50;for(;!this.isFinished&&t<e;){let e=this.workNodes.next();if(t+=1,this.visitNode(e.value)&&(this.hadAffect=!0),e.done)return void this.end()}}else this.end();this.isFinished||this._requestStarting()}visitNode(t){return!!t&&(void 0===this.options.whatToShow||t.nodeType===this.options.whatToShow)&&(this.emit("visit",t)??!1)}constructor(t,e={}){super(),(0,o._)(this,"async",void 0),(0,o._)(this,"options",void 0),(0,o._)(this,"workNodes",void 0),(0,o._)(this,"hadAffect",void 0),(0,o._)(this,"isWorked",void 0),(0,o._)(this,"isFinished",void 0),(0,o._)(this,"__schedulerController",void 0),this.async=t,this.options=e,this.workNodes=null,this.hadAffect=!1,this.isWorked=!1,this.isFinished=!1,this.__schedulerController=null}}(0,s.__decorate)([n.autobind],l.prototype,"__workPerform",null)},93747:function(t,e,i){"use strict";i.d(e,{EventEmitter:function(){return h}});var o=i(25045),s=i(81937),n=i(32328),r=i(17312),a=i(91565),l=i(85932),c=i(33201),u=i(18869);class h{mute(t){return this.__mutedEvents.add(t??"*"),this}isMuted(t){return!!(t&&this.__mutedEvents.has(t))||this.__mutedEvents.has("*")}unmute(t){return this.__mutedEvents.delete(t??"*"),this}__eachEvent(t,e){(0,n.splitArray)(t).map(t=>t.trim()).forEach(t=>{let i=t.split("."),o=i[1]||u.defaultNameSpace;e.call(this,i[0],o)})}__getStore(t){if(!t)throw(0,c.error)("Need subject");if(void 0===t[this.__key]){let e=new u.EventHandlersStore;Object.defineProperty(t,this.__key,{enumerable:!1,configurable:!0,writable:!0,value:e})}return t[this.__key]}__removeStoreFromSubject(t){void 0!==t[this.__key]&&delete t[this.__key]}__triggerNativeEvent(t,e){let i=this.__doc.createEvent("HTMLEvents");(0,l.isString)(e)?i.initEvent(e,!0,!0):(i.initEvent(e.type,e.bubbles,e.cancelable),["screenX","screenY","clientX","clientY","target","srcElement","currentTarget","timeStamp","which","keyCode"].forEach(t=>{Object.defineProperty(i,t,{value:e[t],enumerable:!0})}),Object.defineProperty(i,"originalEvent",{value:e,enumerable:!0})),t.dispatchEvent(i)}get current(){return this.currents[this.currents.length-1]}on(t,e,i,o){let n,u,h,p;if((0,l.isString)(t)||(0,l.isStringArray)(t)?(n=this,u=t,h=e,p=i):(n=t,u=e,h=i,p=o),!((0,l.isString)(u)||(0,l.isStringArray)(u))||0===u.length)throw(0,c.error)("Need events names");if(!(0,a.isFunction)(h))throw(0,c.error)("Need event handler");if((0,r.isArray)(n))return n.forEach(t=>{this.on(t,u,h,p)}),this;let m=n,f=this.__getStore(m),g=this,_=function(t,...e){if(!g.isMuted(t))return h&&h.call(this,...e)};return d(m)&&(_=function(t){if(!g.isMuted(t.type)&&(g.__prepareEvent(t),h&&!1===h.call(this,t)))return t.preventDefault(),t.stopImmediatePropagation(),!1}),this.__eachEvent(u,(t,e)=>{if(0===t.length)throw(0,c.error)("Need event name");if(!1===f.indexOf(t,e,h)){let i={event:t,originalCallback:h,syntheticCallback:_};if(f.set(t,e,i,p?.top),d(m)){let e=s.PASSIVE_EVENTS.has(t)?{passive:!0,capture:p?.capture??!1}:p?.capture??!1;_.options=e,m.addEventListener(t,_,e),this.__memoryDOMSubjectToHandler(m,_)}}}),this}__memoryDOMSubjectToHandler(t,e){let i=this.__domEventsMap.get(t)||new Set;i.add(e),this.__domEventsMap.set(t,i)}__unmemoryDOMSubjectToHandler(t,e){let i=this.__domEventsMap,o=i.get(t)||new Set;o.delete(e),o.size?i.set(t,o):i.delete(t)}one(t,e,i,o){let s,n,r,a;(0,l.isString)(t)||(0,l.isStringArray)(t)?(s=this,n=t,r=e,a=i):(s=t,n=e,r=i,a=o);let c=(...t)=>(this.off(s,n,c),r(...t));return this.on(s,n,c,a),this}off(t,e,i){let o,s,n;if((0,l.isString)(t)||(0,l.isStringArray)(t)?(o=this,s=t,n=e):(o=t,s=e,n=i),(0,r.isArray)(o))return o.forEach(t=>{this.off(t,s,n)}),this;let c=o,h=this.__getStore(c);if(!((0,l.isString)(s)||(0,l.isStringArray)(s))||0===s.length)return h.namespaces().forEach(t=>{this.off(c,"."+t)}),this.__removeStoreFromSubject(c),this;let p=t=>{d(c)&&(c.removeEventListener(t.event,t.syntheticCallback,t.syntheticCallback.options??!1),this.__unmemoryDOMSubjectToHandler(c,t.syntheticCallback))},m=(t,e)=>{if(""===t)return void h.events(e).forEach(t=>{""!==t&&m(t,e)});let i=h.get(t,e);if(i&&i.length)if((0,a.isFunction)(n)){let o=h.indexOf(t,e,n);!1!==o&&(p(i[o]),i.splice(o,1),i.length||h.clearEvents(e,t))}else i.forEach(p),i.length=0,h.clearEvents(e,t)};return this.__eachEvent(s,(t,e)=>{e===u.defaultNameSpace?h.namespaces().forEach(e=>{m(t,e)}):m(t,e)}),h.isEmpty()&&this.__removeStoreFromSubject(c),this}stopPropagation(t,e){let i=(0,l.isString)(t)?this:t,o=(0,l.isString)(t)?t:e;if("string"!=typeof o)throw(0,c.error)("Need event names");let s=this.__getStore(i);this.__eachEvent(o,(t,e)=>{let o=s.get(t,e);o&&this.__stopped.push(o),e===u.defaultNameSpace&&s.namespaces(!0).forEach(e=>this.stopPropagation(i,t+"."+e))})}__removeStop(t){if(t){let e=this.__stopped.indexOf(t);-1!==e&&this.__stopped.splice(0,e+1)}}__isStopped(t){return void 0!==t&&-1!==this.__stopped.indexOf(t)}fire(t,e,...i){let o,s,n=(0,l.isString)(t)?this:t,r=(0,l.isString)(t)?t:e,a=(0,l.isString)(t)?[e,...i]:i;if(!d(n)&&!(0,l.isString)(r))throw(0,c.error)("Need events names");let h=this.__getStore(n);return!(0,l.isString)(r)&&d(n)?this.__triggerNativeEvent(n,e):this.__eachEvent(r,(t,e)=>{if(d(n))this.__triggerNativeEvent(n,t);else{let i=h.get(t,e);if(i)try{[...i].every(e=>!this.__isStopped(i)&&(this.currents.push(t),s=e.syntheticCallback.call(n,t,...a),this.currents.pop(),void 0!==s&&(o=s),!0))}finally{this.__removeStop(i)}e!==u.defaultNameSpace||d(n)||h.namespaces().filter(t=>t!==e).forEach(e=>{let i=this.fire.apply(this,[n,t+"."+e,...a]);void 0!==i&&(o=i)})}}),o}destruct(){this.__isDestructed||(this.__isDestructed=!0,this.__domEventsMap.forEach((t,e)=>{this.off(e)}),this.__domEventsMap.clear(),this.__mutedEvents.clear(),this.currents.length=0,this.__stopped.length=0,this.off(this),this.__getStore(this).clear(),this.__removeStoreFromSubject(this))}constructor(t){(0,o._)(this,"__domEventsMap",new Map),(0,o._)(this,"__mutedEvents",new Set),(0,o._)(this,"__key","__JoditEventEmitterNamespaces"),(0,o._)(this,"__doc",s.globalDocument),(0,o._)(this,"__prepareEvent",t=>{!t.cancelBubble&&(t.composed&&(0,a.isFunction)(t.composedPath)&&t.composedPath()[0]&&Object.defineProperty(t,"target",{value:t.composedPath()[0],configurable:!0,enumerable:!0}),t.type.match(/^touch/)&&t.changedTouches&&t.changedTouches.length&&["clientX","clientY","pageX","pageY"].forEach(e=>{Object.defineProperty(t,e,{value:t.changedTouches[0][e],configurable:!0,enumerable:!0})}),t.originalEvent||(t.originalEvent=t),"paste"===t.type&&void 0===t.clipboardData&&this.__doc.defaultView.clipboardData&&Object.defineProperty(t,"clipboardData",{get:()=>this.__doc.defaultView.clipboardData,configurable:!0,enumerable:!0}))}),(0,o._)(this,"currents",[]),(0,o._)(this,"__stopped",[]),(0,o._)(this,"__isDestructed",!1),t&&(this.__doc=t),this.__key+=new Date().getTime()}}function d(t){return t&&(0,a.isFunction)(t.addEventListener)}},60216:function(t,e,i){"use strict";i.d(e,{Eventify:function(){return s}});var o=i(25045);class s{on(t,e){return this.__map.has(t)||this.__map.set(t,new Set),this.__map.get(t)?.add(e),this}off(t,e){return this.__map.has(t)&&this.__map.get(t)?.delete(e),this}destruct(){this.__map.clear()}emit(t,...e){let i;return this.__map.has(t)&&this.__map.get(t)?.forEach(t=>{i=t(...e)}),i}constructor(){(0,o._)(this,"__map",new Map)}}},42689:function(t,e,i){"use strict";let o=new(i(93747)).EventEmitter;i.d(e,["eventEmitter",0,o])},1496:function(t,e,i){"use strict";i.d(e,{EventEmitter:function(){return o.EventEmitter},EventHandlersStore:function(){return r.EventHandlersStore},Eventify:function(){return s.Eventify},defaultNameSpace:function(){return r.defaultNameSpace},observable:function(){return n.observable}});var o=i(93747),s=i(60216),n=i(70535),r=i(18869)},70535:function(t,e,i){"use strict";i.d(e,{observable:function(){return c}});var o=i(17312),s=i(94013),n=i(62101),r=i(71125);let a=Symbol("observable-object");function l(t){return void 0!==t[a]}function c(t){if(l(t))return t;let e={},i={},c=(e,s)=>((0,o.isArray)(e)?e.map(t=>c(t,s)):(i[e]||(i[e]=[]),i[e].push(s)),t),u=(s,...n)=>{if((0,o.isArray)(s))return void s.map(t=>u(t,...n));try{!e[s]&&i[s]&&(e[s]=!0,i[s].forEach(e=>e.call(t,...n)))}finally{e[s]=!1}},h=(e,i=[])=>{let o={};l(e)||(Object.defineProperty(e,a,{enumerable:!1,value:!0}),Object.keys(e).forEach(a=>{let l=i.concat(a).filter(t=>t.length);o[a]=e[a];let c=(0,r.getPropertyDescriptor)(e,a);Object.defineProperty(e,a,{set(e){let i=o[a];if(!(0,s.isFastEqual)(o[a],e)){u(["beforeChange","beforeChange."+l.join(".")],a,e),(0,n.isPlainObject)(e)&&h(e,l),c&&c.set?c.set.call(t,e):o[a]=e;let s=[];u(["change",...l.reduce((t,e)=>(s.push(e),t.push("change."+s.join(".")),t),[])],l.join("."),i,e?.valueOf?e.valueOf():e)}},get:()=>c&&c.get?c.get.call(t):o[a],enumerable:!0,configurable:!0}),(0,n.isPlainObject)(o[a])&&h(o[a],l)}),Object.defineProperty(t,"on",{value:c}))};return h(t),t}},18869:function(t,e,i){"use strict";i.d(e,{EventHandlersStore:function(){return a}});var o=i(25045),s=i(88475),n=i(28712);let r="JoditEventDefaultNamespace";class a{get(t,e){if(this.__store.has(e)){let i=this.__store.get(e);return(0,n.assert)(i,"-"),i[t]}}indexOf(t,e,i){let o=this.get(t,e);if(o){for(let t=0;t<o.length;t+=1)if(o[t].originalCallback===i)return t}return!1}namespaces(t=!1){let e=(0,s.toArray)(this.__store.keys());return t?e.filter(t=>t!==r):e}events(t){let e=this.__store.get(t);return e?Object.keys(e):[]}set(t,e,i,o=!1){let s=this.__store.get(e);s||(s={},this.__store.set(e,s)),void 0===s[t]&&(s[t]=[]),o?s[t].unshift(i):s[t].push(i)}clear(){this.__store.clear()}clearEvents(t,e){let i=this.__store.get(t);i&&i[e]&&(delete i[e],Object.keys(i).length||this.__store.delete(t))}isEmpty(){return 0===this.__store.size}constructor(){(0,o._)(this,"__store",new Map)}}i.d(e,["defaultNameSpace",0,r])},28077:function(t,e,i){"use strict";i.d(e,{getContainer:function(){return b},getPopupViewRoot:function(){return y},uniqueUid:function(){return g}});var o=i(24497),s=i(85932),n=i(31534),r=i(74264),a=i(7909),l=i(80991),c=i(421),u=i(85305),h=i(42689),d=i(81937),p=i(27795);let m=1,f=new Set;function g(){function t(){return Math.round(m+=10*(Math.random()+1)).toString(16)}let e=t();for(;f.has(e);)e=t();return f.add(e),e}let _=new u.PluginSystem({getContainer:b}),v=new WeakMap;function b(t,e,i="div",l=!1){let u=(0,s.isString)(e)?e:e?(0,c.getClassName)(e.prototype):"jodit-utils",h=v.get(t)||{},d=u+i,m=(0,n.isViewObject)(t)?t:t.j,f=null;if(!h[d]){let e=m.c;if(f=y(m.o,m.container,t.od.body),l&&(0,o.isJoditObject)(t)&&t.od!==t.ed){e=t.createInside;let s="style"===i?t.ed.head:t.ed.body;f=(0,o.isJoditObject)(t)&&t.o.shadowRoot?t.o.shadowRoot:s}let s=e.element(i,{className:`jodit jodit-${(0,r.kebabCase)(u)}-container jodit-box`});m.o.nonce&&("style"===i||"script"===i)&&(0,a.attr)(s,"nonce",m.o.nonce),s.classList.add("jodit_theme_"+(m.o.theme||"default")),p.Dom.append(f,s),h[d]=s,t.hookStatus("beforeDestruct",()=>{m.events.off(s),p.Dom.safeRemove(s),delete h[d],Object.keys(h).length&&v.delete(t)}),v.set(t,h),m.events.fire("getContainer",s)}return h[d].classList.remove("jodit_theme_default","jodit_theme_dark"),h[d].classList.add("jodit_theme_"+(m.o.theme||"default")),h[d]}function y(t,e,i){return t.popupRoot??t.shadowRoot??p.Dom.closest(e,t=>p.Dom.isHTMLElement(t)&&(p.Dom.isTag(t,"dialog")||["fixed","absolute"].includes((0,l.css)(t,"position"))),i)??i}let w=h.eventEmitter;i.d(e,["eventEmitter",0,w,"extendLang",0,t=>{Object.keys(t).forEach(e=>{d.lang[e]?Object.assign(d.lang[e],t[e]):d.lang[e]=t[e]})},"instances",0,{},"modules",0,{},"pluginSystem",0,_])},78982:function(t,e,i){"use strict";var o=i(17312);i.d(e,["asArray",0,t=>(0,o.isArray)(t)?t:[t]])},45664:function(t,e,i){"use strict";i.d(e,{asArray:function(){return o.asArray},splitArray:function(){return s.splitArray},toArray:function(){return n.toArray}});var o=i(78982),s=i(32328),n=i(88475)},32328:function(t,e,i){"use strict";function o(t){return Array.isArray(t)?t:t.split(/[,\s]+/)}i.d(e,{splitArray:function(){return o}})},88475:function(t,e,i){"use strict";var o=i(23283),s=i(43379);i.d(e,["toArray",0,function(...t){return((0,o.isNativeFunction)(Array.from)?Array.from:(0,s.reset)("Array.from")??Array.from).apply(Array,t)}])},61077:function(t,e,i){"use strict";i.d(e,{clearTimeout:function(){return o.clearTimeout},setTimeout:function(){return o.setTimeout}});var o=i(79947)},79947:function(t,e,i){"use strict";i.d(e,{clearTimeout:function(){return n},setTimeout:function(){return s}});var o=i(81937);function s(t,e,...i){return e?o.globalWindow.setTimeout(t,e,...i):(t.call(null,...i),0)}function n(t){o.globalWindow.clearTimeout(t)}},98740:function(t,e,i){"use strict";i.d(e,{hasBrowserColorPicker:function(){return s}});var o=i(81937);function s(){let t=!0;try{let e=o.globalDocument.createElement("input");e.type="color",e.value="!",t="color"===e.type&&"!"!==e.value}catch(e){t=!1}return t}},28686:function(t,e,i){"use strict";i.d(e,{hasBrowserColorPicker:function(){return o.hasBrowserColorPicker},hasContainer:function(){return h.hasContainer},isAbortError:function(){return s.isAbortError},isArray:function(){return n.isArray},isBoolean:function(){return r.isBoolean},isDestructable:function(){return h.isDestructable},isEqual:function(){return a.isEqual},isFastEqual:function(){return a.isFastEqual},isFunction:function(){return l.isFunction},isHTML:function(){return c.isHTML},isHtmlFromWord:function(){return u.isHtmlFromWord},isInitable:function(){return h.isInitable},isInt:function(){return d.isInt},isJoditObject:function(){return p.isJoditObject},isLicense:function(){return m.isLicense},isMarker:function(){return f.isMarker},isNativeFunction:function(){return g.isNativeFunction},isNumber:function(){return _.isNumber},isNumeric:function(){return v.isNumeric},isPlainObject:function(){return b.isPlainObject},isPromise:function(){return y.isPromise},isSet:function(){return w.isSet},isString:function(){return S.isString},isStringArray:function(){return S.isStringArray},isURL:function(){return C.isURL},isValidName:function(){return E.isValidName},isViewObject:function(){return I.isViewObject},isVoid:function(){return D.isVoid},isWindow:function(){return T.isWindow}});var o=i(98740),s=i(72068),n=i(17312),r=i(22289),a=i(94013),l=i(91565),c=i(46248),u=i(82166),h=i(52433),d=i(99732),p=i(24497),m=i(44998),f=i(23175),g=i(23283),_=i(72412),v=i(70222),b=i(62101),y=i(52100),w=i(3213),S=i(85932),C=i(91764),E=i(50083),I=i(31534),D=i(18303),T=i(3513)},72068:function(t,e,i){"use strict";function o(t){return!!t&&t instanceof DOMException&&"AbortError"===t.name}i.d(e,{isAbortError:function(){return o}})},17312:function(t,e,i){"use strict";function o(t){return Array.isArray(t)}i.d(e,{isArray:function(){return o}})},22289:function(t,e,i){"use strict";function o(t){return"boolean"==typeof t}i.d(e,{isBoolean:function(){return o}})},94013:function(t,e,i){"use strict";i.d(e,{isEqual:function(){return s},isFastEqual:function(){return n}});var o=i(3347);function s(t,e){return t===e||(0,o.stringify)(t)===(0,o.stringify)(e)}function n(t,e){return t===e}},91565:function(t,e,i){"use strict";function o(t){return"function"==typeof t}i.d(e,{isFunction:function(){return o}})},82166:function(t,e,i){"use strict";function o(t){return -1!==t.search(/<meta.*?Microsoft Excel\s[\d].*?>/)||-1!==t.search(/<meta.*?Microsoft Word\s[\d].*?>/)||-1!==t.search(/<meta[^>]*?ProgId[^>]*?(Word|Excel)\./i)||-1!==t.search(/<meta[^>]*?(LibreOffice|OpenOffice)/i)||-1!==t.search(/urn:schemas-microsoft-com:office:(word|excel)/)||-1!==t.search(/<\w[^>]*\sclass=("|')?Mso/)||-1!==t.search(/style='[^']*mso-/)||-1!==t.search(/style="[^"]*mso-/)&&-1!==t.search(/<font/)}i.d(e,{isHtmlFromWord:function(){return o}})},46248:function(t,e,i){"use strict";var o=i(85932);i.d(e,["isHTML",0,t=>(0,o.isString)(t)&&/<([A-Za-z][A-Za-z0-9]*)\b[^>]*>(.*?)<\/\1>/m.test(t.replace(/[\r\n]/g,""))])},52433:function(t,e,i){"use strict";i.d(e,{hasContainer:function(){return l},isDestructable:function(){return a},isInitable:function(){return r}});var o=i(23211),s=i(91565),n=i(18303);function r(t){return!(0,n.isVoid)(t)&&(0,s.isFunction)(t.init)}function a(t){return!(0,n.isVoid)(t)&&(0,s.isFunction)(t.destruct)}function l(t){return!(0,n.isVoid)(t)&&o.Dom.isElement(t.container)}},99732:function(t,e,i){"use strict";i.d(e,{isInt:function(){return n}});var o=i(70222),s=i(85932);function n(t){return(0,s.isString)(t)&&(0,o.isNumeric)(t)&&(t=parseFloat(t)),"number"==typeof t&&Number.isFinite(t)&&!(t%1)}},24497:function(t,e,i){"use strict";i.d(e,{isJoditObject:function(){return s}});var o=i(91565);function s(t){return!!(t&&t instanceof Object&&(0,o.isFunction)(t.constructor)&&("u">typeof Jodit&&t instanceof Jodit||t.isJodit))}},44998:function(t,e,i){"use strict";var o=i(85932);i.d(e,["isLicense",0,t=>(0,o.isString)(t)&&23===t.length&&/^[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{5}$/i.test(t)])},23175:function(t,e,i){"use strict";i.d(e,{isMarker:function(){return s}});var o=i(23211);function s(t){return o.Dom.isMarker(t)}},23283:function(t,e,i){"use strict";function o(t){return!!t&&"function"===(typeof t).toLowerCase()&&(t===Function.prototype||/^\s*function\s*(\b[a-z$_][a-z0-9$_]*\b)*\s*\((|([a-z$_][a-z0-9$_]*)(\s*,[a-z$_][a-z0-9$_]*)*)\)\s*{\s*\[native code]\s*}\s*$/i.test(t+""))}i.d(e,{isNativeFunction:function(){return o}})},72412:function(t,e,i){"use strict";function o(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}i.d(e,{isNumber:function(){return o}})},70222:function(t,e,i){"use strict";i.d(e,{isNumeric:function(){return s}});var o=i(85932);function s(t){if((0,o.isString)(t)){if(!t.match(/^([+-])?[0-9]+(\.?)([0-9]+)?(e[0-9]+)?$/))return!1;t=parseFloat(t)}return"number"==typeof t&&!isNaN(t)&&isFinite(t)}},62101:function(t,e,i){"use strict";i.d(e,{isPlainObject:function(){return s}});var o=i(3513);function s(t){return!(!t||"object"!=typeof t||t.nodeType||(0,o.isWindow)(t))&&!(t.constructor&&!({}).hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))}},52100:function(t,e,i){"use strict";function o(t){return t&&"function"==typeof t.then}i.d(e,{isPromise:function(){return o}})},3213:function(t,e,i){"use strict";i.d(e,{isSet:function(){return s}});var o=i(91565);function s(t){return!!t&&(0,o.isFunction)(t.has)&&(0,o.isFunction)(t.add)&&(0,o.isFunction)(t.delete)}},85932:function(t,e,i){"use strict";i.d(e,{isString:function(){return s},isStringArray:function(){return n}});var o=i(17312);function s(t){return"string"==typeof t}function n(t){return(0,o.isArray)(t)&&s(t[0])}},91764:function(t,e,i){"use strict";i.d(e,{isURL:function(){return s}});var o=i(81937);function s(t){if(t.includes(" "))return!1;if("u">typeof URL)try{let e=new URL(t);return["https:","http:","ftp:","file:","rtmp:"].includes(e.protocol)}catch(t){return!1}let e=o.globalDocument.createElement("a");return e.href=t,!!e.hostname}},50083:function(t,e,i){"use strict";function o(t){return!!t.length&&!/[^0-9A-Za-zа-яА-ЯЁё\w\-_. ]/.test(t)&&t.trim().length>0}i.d(e,{isValidName:function(){return o}})},31534:function(t,e,i){"use strict";i.d(e,{isViewObject:function(){return s}});var o=i(91565);function s(t){return!!(t&&t instanceof Object&&(0,o.isFunction)(t.constructor)&&t.isView)}},18303:function(t,e,i){"use strict";function o(t){return null==t}i.d(e,{isVoid:function(){return o}})},3513:function(t,e,i){"use strict";function o(t){return null!=t&&t===t.window}i.d(e,{isWindow:function(){return o}})},93387:function(t,e,i){"use strict";i.d(e,["colorToHex",0,t=>{if("rgba(0, 0, 0, 0)"===t||""===t)return!1;if(!t)return"#000000";if("#"===t.substr(0,1))return t;let e=/([\s\n\t\r]*?)rgb\((\d+), (\d+), (\d+)\)/.exec(t)||/([\s\n\t\r]*?)rgba\((\d+), (\d+), (\d+), ([\d.]+)\)/.exec(t);if(!e)return"#000000";let i=parseInt(e[2],10),o=parseInt(e[3],10),s=(parseInt(e[4],10)|o<<8|i<<16).toString(16).toUpperCase();for(;s.length<6;)s="0"+s;return e[1]+"#"+s}])},30893:function(t,e,i){"use strict";i.d(e,{applyStyles:function(){return u}});var o=i(81937),s=i(23211),n=i(4040),r=i(7909),a=i(80991),l=i(28723);function c(t){return t.replace(/mso-[a-z-]+:[\s]*[^;]+;/gi,"").replace(/mso-[a-z-]+:[\s]*[^";']+$/gi,"").replace(/border[a-z-]*:[\s]*[^;]+;/gi,"").replace(/([0-9.]+)(pt|cm)/gi,(t,e,i)=>{switch(i.toLowerCase()){case"pt":return(1.328*parseFloat(e)).toFixed(0)+"px";case"cm":return(.02645833*parseFloat(e)).toFixed(0)+"px"}return t})}function u(t){let e=/<html(?:\s[^>]*)?>/i.exec(t);if(!e)return t;let i=(t=t.substring(e.index)).toLowerCase().lastIndexOf("</html>");-1!==i&&(t=t.substring(0,i+7));let u=o.globalDocument.createElement("iframe");(0,a.css)(u,"display","none"),s.Dom.append(o.globalDocument.body,u);let h="";try{let e=u.contentDocument||(u.contentWindow?u.contentWindow.document:null);if(e){e.open(),e.write(t),e.close(),s.Dom.each(e.body,t=>{s.Dom.isElement(t)&&/mso-list:\s*ignore/i.test((0,r.attr)(t,"style")||"")&&s.Dom.safeRemove(t)});try{for(let t=0;t<e.styleSheets.length;t+=1){let i=e.styleSheets[t].cssRules;for(let t=0;t<i.length;t+=1)""!==i[t].selectorText&&(0,l.$$)(i[t].selectorText,e.body).forEach(e=>{e.style.cssText=c(i[t].style.cssText+";"+e.style.cssText)})}}catch(t){if(!o.IS_PROD)throw t}s.Dom.each(e.body,t=>{if(s.Dom.isElement(t)){let e=(0,r.attr)(t,"style");e&&(t.style.cssText=c(e)),(0,r.attr)(t,"style")||(0,r.attr)(t,"style",null)}}),h=e.firstChild?(0,n.trim)(e.body.innerHTML):""}}catch{}finally{s.Dom.safeRemove(u)}return h&&(t=h),(0,n.trim)(t.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g,"").replace(/<!--[^>]*>/g,""))}},1277:function(t,e,i){"use strict";i.d(e,{cleanFromWord:function(){return l}});var o=i(81937),s=i(23211),n=i(88475),r=i(4040),a=i(7909);function l(t){-1!==t.indexOf("<html ")&&(t=(t=t.substring(t.indexOf("<html "),t.length)).substring(0,t.lastIndexOf("</html>")+7));let e="";try{let i=o.globalDocument.createElement("div");i.innerHTML=t;let r=[];i.firstChild&&s.Dom.each(i,t=>{if(t)switch(t.nodeType){case Node.ELEMENT_NODE:switch(t.nodeName){case"STYLE":case"LINK":case"META":r.push(t);break;case"W:SDT":case"W:SDTPR":case"FONT":s.Dom.unwrap(t);break;default:if(/mso-list:\s*ignore/i.test((0,a.attr)(t,"style")||"")){r.push(t);break}(0,n.toArray)(t.attributes).forEach(e=>{-1===["src","href","rel","content"].indexOf(e.name.toLowerCase())&&(0,a.attrRaw)(t,e.name,null)})}break;case Node.TEXT_NODE:break;default:r.push(t)}}),s.Dom.safeRemove.apply(null,r),e=i.innerHTML}catch(t){}return e&&(t=e),(t=t.split(/(\n)/).filter(r.trim).join(`
|
|
10
10
|
`)).replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g,"").replace(/<!--[^>]*>/g,"")}},6609:function(t,e,i){"use strict";i.d(e,{htmlspecialchars:function(){return s}});var o=i(81937);function s(t){let e=o.globalDocument.createElement("div");return e.textContent=t,e.innerHTML}},82658:function(t,e,i){"use strict";i.d(e,{applyStyles:function(){return o.applyStyles},cleanFromWord:function(){return s.cleanFromWord},htmlspecialchars:function(){return n.htmlspecialchars},nl2br:function(){return r.nl2br},safeHTML:function(){return a.safeHTML},sanitizeHTMLElement:function(){return a.sanitizeHTMLElement},stripTags:function(){return l.stripTags}});var o=i(30893),s=i(1277),n=i(6609),r=i(48838),a=i(48155),l=i(22852)},48838:function(t,e,i){"use strict";function o(t){return t.replace(/\r\n|\r|\n/g,"<br/>")}i.d(e,{nl2br:function(){return o}})},48155:function(t,e,i){"use strict";i.d(e,{safeHTML:function(){return l},sanitizeHTMLElement:function(){return d}});var o=i(23211),s=i(93640),n=i(7909);let r=new Set(["foreignobject","annotation-xml","desc","title"]),a=t=>!!(t&&/^(math|svg)$/i.test(t.nodeName));function l(t,e){if(!o.Dom.isElement(t)&&!o.Dom.isFragment(t))return;let i=[];for(let e of(o.Dom.each(t,t=>{o.Dom.isElement(t)&&o.Dom.up(t.parentNode,a)&&i.push(t)}),i))o.Dom.isOrContains(t,e)&&function(t){if("http://www.w3.org/1999/xhtml"!==t.namespaceURI||null==o.Dom.up(t,a))return!1;for(let e=t.parentElement;e;e=e.parentElement){let t=e.nodeName.toLowerCase();if("math"===t||"svg"===t)break;if(r.has(t))return!1}return!0}(e)&&o.Dom.safeRemove(e);let l=e.removeEventAttributes??e.removeOnError,c=t=>{if(o.Dom.isElement(t)&&(l&&function(t){if(!o.Dom.isElement(t))return;let e=[];for(let i=0;i<t.attributes.length;i++)t.attributes[i].name.toLowerCase().startsWith("on")&&e.push(t.attributes[i].name);for(let i of e)(0,n.attrRaw)(t,i,null)}(t),d(t,e),e.safeLinksTarget&&"A"===t.nodeName&&"_blank"===(0,s.attr)(t,"target"))){let e=((0,s.attr)(t,"rel")||"").split(/\s+/).filter(Boolean);e.includes("noopener")||e.push("noopener"),e.includes("noreferrer")||e.push("noreferrer"),(0,s.attr)(t,"rel",e.join(" "))}};c(t),o.Dom.each(t,c)}let c=["src","data","action","formaction","poster","background","xlink:href"],u=new Set(["iframe","frame","object","embed"]);function h(t,e){let i=t.replace(/[\u0000-\u0020]+/g,"").toLowerCase();return!!(/^(?:javascript|vbscript|livescript|mocha):/.test(i)||/^data:(?:text\/html|application\/xhtml)/.test(i))||/^data:image\/svg/.test(i)&&u.has(e)}function d(t,{safeJavaScriptLink:e,removeOnError:i}={safeJavaScriptLink:!0,removeOnError:!0}){if(!o.Dom.isElement(t))return!1;let r=!1;i&&t.hasAttribute("onerror")&&((0,s.attr)(t,"onerror",null),r=!0);let a=t.nodeName.toLowerCase(),l=(0,s.attr)(t,"href");if(e&&l&&h(l,a)){let e="u">typeof location?location.protocol:"http:";(0,s.attr)(t,"href",e+"//"+l),r=!0}if(e)for(let e of(t.hasAttribute("srcdoc")&&((0,s.attr)(t,"srcdoc",null),r=!0),c)){let i=(0,n.attrRaw)(t,e);i&&h(i,a)&&((0,s.attr)(t,e,null),r=!0)}return r}},22852:function(t,e,i){"use strict";i.d(e,{stripTags:function(){return function t(e,i=document,c=null,u=!1){let h=i.createElement("div");(0,s.isString)(e)?h.innerHTML=e:o.Dom.append(h,e);let d=[];return o.Dom.each(h,t=>{o.Dom.isElement(t)&&d.push(t)}),d.forEach(e=>{if(!e.parentNode)return;if(c&&o.Dom.isTag(e,c)){let s=e.nodeName.toLowerCase(),n=o.Dom.isTag(e,l)?`%%%jodit-single-${s}%%%`:`%%%jodit-${s}%%%${t(e.innerHTML,i,c,u)}%%%/jodit-${s}%%%`;o.Dom.before(e,i.createTextNode(n)),o.Dom.safeRemove(e);return}if(o.Dom.isTag(e,a))return void o.Dom.safeRemove(e);if(!o.Dom.isTag(e,r))return;let s=e.nextSibling;!(o.Dom.isText(s)&&/^\s/.test(s.nodeValue||""))&&s&&o.Dom.before(s,i.createTextNode(u?"%%%jodit-single-br%%%":" "))}),(0,n.trim)(h.innerText).replace(/%%%(\/)?jodit(-single)?-([\w\n]+)%%%/g,(t,e,i,o)=>`<${e?"/":""}${o}>`)}}});var o=i(23211),s=i(85932),n=i(4040);let r=new Set(["div","p","br","h1","h2","h3","h4","h5","h6","hr"]),a=new Set(["script","style"]),l=new Set(["br","hr","input"])},65946:function(t,e,i){"use strict";i.r(e),i.d(e,{CamelCaseToKebabCase:function(){return u.CamelCaseToKebabCase},NUMBER_FIELDS_REG:function(){return l.NUMBER_FIELDS_REG},applyStyles:function(){return a.applyStyles},asArray:function(){return o.asArray},camelCase:function(){return u.camelCase},cleanFromWord:function(){return a.cleanFromWord},clearTimeout:function(){return s.clearTimeout},colorToHex:function(){return r.colorToHex},fuzzySearchIndex:function(){return u.fuzzySearchIndex},getContentWidth:function(){return c.getContentWidth},getFixedPositionOffset:function(){return c.getFixedPositionOffset},getScrollParent:function(){return c.getScrollParent},hasBrowserColorPicker:function(){return n.hasBrowserColorPicker},hasContainer:function(){return n.hasContainer},htmlspecialchars:function(){return a.htmlspecialchars},i18n:function(){return u.i18n},innerWidth:function(){return c.innerWidth},isAbortError:function(){return n.isAbortError},isArray:function(){return n.isArray},isBoolean:function(){return n.isBoolean},isDestructable:function(){return n.isDestructable},isEqual:function(){return n.isEqual},isFastEqual:function(){return n.isFastEqual},isFunction:function(){return n.isFunction},isHTML:function(){return n.isHTML},isHtmlFromWord:function(){return n.isHtmlFromWord},isInitable:function(){return n.isInitable},isInt:function(){return n.isInt},isJoditObject:function(){return n.isJoditObject},isLicense:function(){return n.isLicense},isMarker:function(){return n.isMarker},isNativeFunction:function(){return n.isNativeFunction},isNumber:function(){return n.isNumber},isNumeric:function(){return n.isNumeric},isPlainObject:function(){return n.isPlainObject},isPromise:function(){return n.isPromise},isSet:function(){return n.isSet},isString:function(){return n.isString},isStringArray:function(){return n.isStringArray},isURL:function(){return n.isURL},isValidName:function(){return n.isValidName},isViewObject:function(){return n.isViewObject},isVoid:function(){return n.isVoid},isWindow:function(){return n.isWindow},kebabCase:function(){return u.kebabCase},nl2br:function(){return a.nl2br},normalizeColor:function(){return l.normalizeColor},normalizeCssNumericValue:function(){return l.normalizeCssNumericValue},normalizeCssValue:function(){return l.normalizeCssValue},normalizeKeyAliases:function(){return l.normalizeKeyAliases},normalizeLicense:function(){return l.normalizeLicense},normalizePath:function(){return l.normalizePath},normalizeRelativePath:function(){return l.normalizeRelativePath},normalizeSize:function(){return l.normalizeSize},normalizeUrl:function(){return l.normalizeUrl},offset:function(){return c.offset},position:function(){return c.position},safeHTML:function(){return a.safeHTML},sanitizeHTMLElement:function(){return a.sanitizeHTMLElement},setTimeout:function(){return s.setTimeout},size:function(){return c.size},splitArray:function(){return o.splitArray},sprintf:function(){return u.sprintf},stringify:function(){return u.stringify},stripTags:function(){return a.stripTags},toArray:function(){return o.toArray},trim:function(){return u.trim},trimChars:function(){return u.trimChars},trimInv:function(){return u.trimInv},ucfirst:function(){return u.ucfirst}});var o=i(45664),s=i(61077),n=i(28686),r=i(93387),a=i(82658),l=i(97022),c=i(86878),u=i(97642),h=i(93640),d={};for(var p in h)0>["default","asArray","splitArray","toArray","clearTimeout","setTimeout","hasBrowserColorPicker","hasContainer","isAbortError","isArray","isBoolean","isDestructable","isEqual","isFastEqual","isFunction","isHTML","isHtmlFromWord","isInitable","isInt","isJoditObject","isLicense","isMarker","isNativeFunction","isNumber","isNumeric","isPlainObject","isPromise","isSet","isString","isStringArray","isURL","isValidName","isViewObject","isVoid","isWindow","colorToHex","applyStyles","cleanFromWord","htmlspecialchars","nl2br","safeHTML","sanitizeHTMLElement","stripTags","NUMBER_FIELDS_REG","normalizeColor","normalizeCssNumericValue","normalizeCssValue","normalizeKeyAliases","normalizeLicense","normalizePath","normalizeRelativePath","normalizeSize","normalizeUrl","getContentWidth","getFixedPositionOffset","getScrollParent","innerWidth","offset","position","size","CamelCaseToKebabCase","camelCase","fuzzySearchIndex","i18n","kebabCase","sprintf","stringify","trim","trimChars","trimInv","ucfirst"].indexOf(p)&&(d[p]=(function(t){return h[t]}).bind(0,p));i.d(e,d)},97022:function(t,e,i){"use strict";i.d(e,{NUMBER_FIELDS_REG:function(){return s.NUMBER_FIELDS_REG},normalizeColor:function(){return o.normalizeColor},normalizeCssNumericValue:function(){return s.normalizeCssNumericValue},normalizeCssValue:function(){return s.normalizeCssValue},normalizeKeyAliases:function(){return n.normalizeKeyAliases},normalizeLicense:function(){return r.normalizeLicense},normalizePath:function(){return a.normalizePath},normalizeRelativePath:function(){return l.normalizeRelativePath},normalizeSize:function(){return c.normalizeSize},normalizeUrl:function(){return u.normalizeUrl}});var o=i(77367),s=i(19147),n=i(27978),r=i(49663),a=i(18377),l=i(96340),c=i(98831),u=i(48009)},77367:function(t,e,i){"use strict";var o=i(93387),s=i(4040);i.d(e,["normalizeColor",0,t=>{let e=["#"],i=(0,o.colorToHex)(t);if(!i)return!1;if(3===(i=(i=(0,s.trim)(i.toUpperCase())).substring(1)).length){for(let t=0;t<3;t+=1)e.push(i[t]),e.push(i[t]);return e.join("")}return i.length>6&&(i=i.slice(0,6)),"#"+i}])},19147:function(t,e,i){"use strict";i.d(e,{normalizeCssNumericValue:function(){return l},normalizeCssValue:function(){return c}});var o=i(70222),s=i(18303),n=i(93387),r=i(74264);let a=/^(left|top|bottom|right|width|min|max|height|margin|padding|fontsize|font-size)/i;function l(t,e){return!(0,s.isVoid)(e)&&a.test(t)&&(0,o.isNumeric)(e.toString())?parseInt(e.toString(),10)+"px":e}function c(t,e){if("font-weight"===(0,r.kebabCase)(t)){switch(e.toString().toLowerCase()){case"700":case"bold":return 700;case"400":case"normal":return 400;case"900":case"heavy":return 900}return(0,o.isNumeric)(e)?Number(e):e}return/color/i.test(t)&&/^rgb/i.test(e.toString())&&(0,n.colorToHex)(e.toString())||e}i.d(e,["NUMBER_FIELDS_REG",0,a])},27978:function(t,e,i){"use strict";i.d(e,{normalizeKeyAliases:function(){return n}});var o=i(81937),s=i(4040);function n(t){let e={},i={meta:1,ctrl:2,control:2,alt:3,shift:4,space:5};return t.replace(/\+\+/g,"+add").split(/[\s]*\+[\s]*/).map(t=>(0,s.trim)(t.toLowerCase())).map(t=>o.KEY_ALIASES[t]||t).sort((t,e)=>i[t]&&!i[e]?-1:!i[t]&&i[e]?1:i[t]&&i[e]?i[t]-i[e]:t>e?1:-1).filter(t=>!e[t]&&""!==t&&(e[t]=!0)).join("+")}},49663:function(t,e,i){"use strict";i.d(e,["normalizeLicense",0,(t,e=8)=>{let i=[];for(;t.length;)i.push(t.substr(0,e)),t=t.substr(e);return i[1]=i[1].replace(/./g,"*"),i[2]=i[2].replace(/./g,"*"),i.join("-")}])},18377:function(t,e,i){"use strict";var o=i(4040);i.d(e,["normalizePath",0,(...t)=>t.filter(t=>(0,o.trim)(t).length).map((e,i)=>(e=e.replace(/([^:])[\\/]+/g,"$1/"),i&&(e=e.replace(/^\//,"")),i!==t.length-1&&(e=e.replace(/\/$/,"")),e)).join("/")])},96340:function(t,e,i){"use strict";i.d(e,["normalizeRelativePath",0,t=>t.split("/").reduce((t,e)=>{switch(e){case"":case".":break;case"..":t.pop();break;default:t.push(e)}return t},[]).join("/")+(t.endsWith("/")?"/":"")])},98831:function(t,e,i){"use strict";i.d(e,["normalizeSize",0,(t,e)=>/^[0-9]+$/.test(t.toString())?t+e:t.toString()])},48009:function(t,e,i){"use strict";i.d(e,["normalizeUrl",0,(...t)=>t.filter(t=>t.length).map(t=>t.replace(/\/$/,"")).join("/").replace(/([^:])[\\/]+/g,"$1/")])},54447:function(t,e,i){"use strict";i.d(e,["getContentWidth",0,(t,e)=>{let i=e.getComputedStyle(t);return t.offsetWidth-parseInt(i.getPropertyValue("padding-left")||"0",10)-parseInt(i.getPropertyValue("padding-right")||"0",10)}])},2373:function(t,e,i){"use strict";function o(t){let e=t.ownerDocument?.defaultView,i=t.parentElement;for(;e&&i;){var o;if(""!==(o=e.getComputedStyle(i)).transform&&"none"!==o.transform||""!==o.perspective&&"none"!==o.perspective||""!==o.filter&&"none"!==o.filter||"transform"===o.willChange||"perspective"===o.willChange||"filter"===o.willChange||"paint"===o.contain||"layout"===o.contain||"strict"===o.contain||"content"===o.contain){let t=i.getBoundingClientRect();return{x:t.left,y:t.top}}i=i.parentElement}return{x:0,y:0}}i.d(e,{getFixedPositionOffset:function(){return o}})},34027:function(t,e,i){"use strict";i.d(e,{getScrollParent:function(){return function t(e){if(!e)return null;let i=s.Dom.isHTMLElement(e),r=i&&(0,n.css)(e,"overflowY");return i&&"visible"!==r&&"hidden"!==r&&e.scrollHeight>=e.clientHeight?e:t(e.parentNode)||o.globalDocument.scrollingElement||o.globalDocument.body}}});var o=i(81937),s=i(23211),n=i(93640)},86878:function(t,e,i){"use strict";i.d(e,{getContentWidth:function(){return o.getContentWidth},getFixedPositionOffset:function(){return s.getFixedPositionOffset},getScrollParent:function(){return n.getScrollParent},innerWidth:function(){return r.innerWidth},offset:function(){return l.offset},position:function(){return c.position},size:function(){return a.size}});var o=i(54447),s=i(2373),n=i(34027),r=i(83215),a=i(18073),l=i(69143),c=i(23599)},83215:function(t,e,i){"use strict";i.d(e,["innerWidth",0,(t,e)=>{let i=e.getComputedStyle(t);return t.clientWidth-(parseFloat(i.paddingLeft||"0")+parseFloat(i.paddingRight||"0"))}])},18073:function(t,e,i){"use strict";i.d(e,{size:function(){return s}});var o=i(28686);function s(t){return(0,o.isString)(t)||(0,o.isArray)(t)?t.length:(0,o.isPlainObject)(t)?Object.keys(t).length:0}},69143:function(t,e,i){"use strict";let o=(t,e,i,s=!1)=>{let n,r,a;try{n=t.getBoundingClientRect()}catch(t){n={top:0,bottom:0,left:0,right:0,width:0,height:0}}let l=i.body,c=i.documentElement||{clientTop:0,clientLeft:0,scrollTop:0,scrollLeft:0},u=i.defaultView||i.parentWindow,h=u.pageYOffset||c.scrollTop||l.scrollTop,d=u.pageXOffset||c.scrollLeft||l.scrollLeft,p=c.clientTop||l.clientTop||0,m=c.clientLeft||l.clientLeft||0,f=e.iframe;if(!s&&e&&e.options&&e.o.iframe&&f){let{top:t,left:i}=o(f,e,e.od,!0);r=n.top+t,a=n.left+i}else r=n.top+h-p,a=n.left+d-m;return{top:Math.round(r),left:Math.round(a),width:n.width,height:n.height}};i.d(e,["offset",0,o])},23599:function(t,e,i){"use strict";i.d(e,{position:function(){return function t(e,i,s=!1){let n=e.getBoundingClientRect(),r=n.left,a=n.top;if((0,o.isJoditObject)(i)&&i.iframe&&i.ed.body.contains(e)&&!s){let{left:e,top:o}=t(i.iframe,i,!0);r+=e,a+=o}return{left:Math.round(r),top:Math.round(a),width:Math.round(e.offsetWidth??n.width),height:Math.round(e.offsetHeight??n.height)}}}});var o=i(24497)},57821:function(t,e,i){"use strict";i.d(e,["camelCase",0,t=>t.replace(/([-_])(.)/g,(t,e,i)=>i.toUpperCase())])},57626:function(t,e,i){"use strict";i.d(e,{fuzzySearchIndex:function(){return s}});var o=i(81937);function s(t,e,i=0,n=1){let r=0,a=0,l=-1,c=0,u=0;for(a=i;r<t.length&&a<e.length;)t[r].toLowerCase()===e[a].toLowerCase()?(r++,c++,u=0,-1===l&&(l=a)):r>0&&(u>=n&&e[a]!==o.INVISIBLE_SPACE?(r=0,l=-1,c=0,u=0,a--):(u++,c++)),a++;return r===t.length?[l,c]:[-1,0]}},18080:function(t,e,i){"use strict";i.d(e,{i18n:function(){return c}});var o=i(81937),s=i(85932),n=i(99436),r=i(93640),a=i(5266);let l=(t,e)=>{if(!e||!e.length)return t;let i=/%([sd])/g,o=i.exec(t),s=t,n=0;for(;o&&void 0!==e[n];)s=s.replace(o[0],e[n].toString()),n+=1,o=i.exec(t);return s};function c(t,e,i){if(!(0,s.isString)(t))throw(0,r.error)("i18n: Need string in first argument");if(!t.length)return t;let c=!!i?.debugLanguage,u={},h=t=>e&&e.length?l(t,e):t,d=(0,r.defaultLanguage)(a.Config.defaultOptions.language,a.Config.defaultOptions.language),p=(0,r.defaultLanguage)(i?.language,d),m=e=>{if(!e)return;if((0,s.isString)(e[t]))return h(e[t]);let i=t.toLowerCase();if((0,s.isString)(e[i]))return h(e[i]);let o=(0,n.ucfirst)(t);if((0,s.isString)(e[o]))return h(e[o])};void 0!==o.lang[p]?u=o.lang[p]:c||(u=void 0!==o.lang[d]?o.lang[d]:o.lang.en);let f=i?.i18n;if(f&&f[p]){let t=m(f[p]);if(t)return t}return m(u)||(!c&&o.lang.en&&(0,s.isString)(o.lang.en[t])&&o.lang.en[t]?h(o.lang.en[t]):c?"{"+t+"}":(o.IS_PROD,h(t)))}i.d(e,["sprintf",0,l])},97642:function(t,e,i){"use strict";i.d(e,{CamelCaseToKebabCase:function(){return r.CamelCaseToKebabCase},camelCase:function(){return o.camelCase},fuzzySearchIndex:function(){return s.fuzzySearchIndex},i18n:function(){return n.i18n},kebabCase:function(){return r.kebabCase},sprintf:function(){return n.sprintf},stringify:function(){return a.stringify},trim:function(){return l.trim},trimChars:function(){return l.trimChars},trimInv:function(){return l.trimInv},ucfirst:function(){return c.ucfirst}});var o=i(57821),s=i(57626),n=i(18080),r=i(74264),a=i(3347),l=i(4040),c=i(99436)},74264:function(t,e,i){"use strict";i.d(e,["CamelCaseToKebabCase",0,t=>t.replace(/([A-Z])([A-Z])([a-z])/g,"$1-$2$3").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),"kebabCase",0,t=>t.replace(/([A-Z])([A-Z])([a-z])/g,"$1-$2$3").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()])},3347:function(t,e,i){"use strict";function o(t,e={}){if("object"!=typeof t)return t+"";let i=new Set(e.excludeKeys),s=new WeakMap;return JSON.stringify(t,(t,e)=>{if(!i.has(t)){if("object"==typeof e&&null!=e){if(s.get(e))return"[refObject]";s.set(e,!0)}return e}},e.prettify)}i.d(e,{stringify:function(){return o}})},4040:function(t,e,i){"use strict";i.d(e,{trim:function(){return s},trimChars:function(){return n},trimInv:function(){return r}});var o=i(81937);function s(t){return t.replace((0,o.SPACE_REG_EXP_END)(),"").replace((0,o.SPACE_REG_EXP_START)(),"")}function n(t,e){return t.replace(RegExp(`[${e}]+$`),"").replace(RegExp(`^[${e}]+`),"")}function r(t){return t.replace((0,o.INVISIBLE_SPACE_REG_EXP_END)(),"").replace((0,o.INVISIBLE_SPACE_REG_EXP_START)(),"")}},99436:function(t,e,i){"use strict";function o(t){return t.length?t[0].toUpperCase()+t.substring(1):""}i.d(e,{ucfirst:function(){return o}})},16849:function(t,e,i){"use strict";i.d(e,{alignElement:function(){return c},clearAlign:function(){return a},hAlignElement:function(){return r}});var o=i(27795),s=i(7909),n=i(80991);function r(t,e){e&&"normal"!==e?"center"!==e?((0,n.css)(t,"float",e),(0,n.clearCenterAlign)(t)):(0,n.css)(t,{float:"",display:"block",marginLeft:"auto",marginRight:"auto"}):((0,n.css)(t,"float")&&-1!==["right","left"].indexOf((0,n.css)(t,"float").toString().toLowerCase())&&(0,n.css)(t,"float",""),(0,n.clearCenterAlign)(t))}function a(t){o.Dom.each(t,t=>{o.Dom.isHTMLElement(t)&&(0,n.cssInline)(t,"textAlign")&&((0,n.css)(t,"textAlign",""),((0,s.attr)(t,"style")||"").trim().length||(0,s.attr)(t,"style",null))})}let l=new Map([["justifyfull","justify"],["justifyright","right"],["justifyleft","left"],["justifycenter","center"]]);function c(t,e){if(o.Dom.isNode(e)&&o.Dom.isElement(e)){a(e);let i=l.get(t.toLowerCase());i&&(0,n.css)(e,"textAlign",i)}}},47760:function(t,e,i){"use strict";i.d(e,{loadNext:function(){return function t(e,i,o=0){return(0,s.isString)(i[o])?c(e,i[o]).then(()=>t(e,i,o+1)):Promise.resolve()}},loadNextStyle:function(){return function t(e,i,o=0){return(0,s.isString)(i[o])?u(e,i[o]).then(()=>t(e,i,o+1)):Promise.resolve()}}});var o=i(23211),s=i(85932),n=i(7909),r=i(91321);let a=new Map,l=t=>(e,i)=>{if(a.has(i))return a.get(i);let o=t(e,i);return a.set(i,o),o},c=l((t,e)=>t.async.promise((i,s)=>{if(t.isInDestruct)return s();let a=t.c.element("script",{type:"text/javascript",crossorigin:"anonymous",referrerpolicy:"no-referrer",async:!0,src:(0,r.completeUrl)(e)});t.o.nonce&&(0,n.attr)(a,"nonce",t.o.nonce),t.e.one(a,"error",s).one(a,"load",i),o.Dom.append(t.od.body,a)})),u=l((t,e)=>t.async.promise((i,s)=>{if(t.isInDestruct)return s();let a=t.c.element("link",{rel:"stylesheet",media:"all",crossorigin:"anonymous"});t.o.nonce&&(0,n.attr)(a,"nonce",t.o.nonce),t.isInDestruct||t.e.on(a,"load",()=>i(a)).on(a,"error",s),(0,n.attr)(a,"href",(0,r.completeUrl)(e)),t.o.shadowRoot?o.Dom.append(t.o.shadowRoot,a):o.Dom.append(t.od.body,a)}));i.d(e,["alreadyLoadedList",0,a,"appendScriptAsync",0,c,"appendStyleAsync",0,u])},7909:function(t,e,i){"use strict";i.d(e,{attr:function(){return function t(e,i,l){if(!e||!(0,o.isFunction)(e.getAttribute))return null;if(!(0,n.isString)(i))return Object.keys(i).forEach(o=>{let n=i[o];(0,s.isPlainObject)(n)&&"style"===o?(0,a.css)(e,n):("className"===o&&(o="class"),t(e,o,n))}),null;let c=(0,r.CamelCaseToKebabCase)(i);if(/^-/.test(c)){let i=t(e,"data"+c);if(i)return i;c=c.substr(1)}if(void 0!==l)if(null==l)e.hasAttribute(c)&&e.removeAttribute(c);else{let t=l.toString();return"IMG"===e.nodeName&&("width"===c||"height"===c)&&(t=t.replace("px","")),e.setAttribute(c,t),t}return e.getAttribute(c)}},attrRaw:function(){return l}});var o=i(91565),s=i(62101),n=i(85932),r=i(74264),a=i(80991);function l(t,e,i){if(void 0===i)return t.getAttribute(e);if(null==i){t.hasAttribute(e)&&t.removeAttribute(e);return}t.setAttribute(e,i)}},26136:function(t,e,i){"use strict";i.d(e,["browser",0,t=>{let e=navigator.userAgent.toLowerCase(),i=/(firefox)[\s/]([\w.]+)/.exec(e)||/(chrome)[\s/]([\w.]+)/.exec(e)||/(webkit)[\s/]([\w.]+)/.exec(e)||/(opera)(?:.*version)[\s/]([\w.]+)/.exec(e)||/(msie)[\s]([\w.]+)/.exec(e)||/(trident)\/([\w.]+)/.exec(e)||0>e.indexOf("compatible")||[];return"version"===t?i[2]:"webkit"===t?"chrome"===i[1]||"webkit"===i[1]:"ff"===t?"firefox"===i[1]:"msie"===t?"trident"===i[1]||"msie"===i[1]:i[1]===t}])},36833:function(t,e,i){"use strict";var o=i(62101);let s=(t,e)=>{let i=[],n=encodeURIComponent;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let a=e?e+"["+r+"]":r,l=t[r];i.push((0,o.isPlainObject)(l)?s(l,a):n(a)+"="+n(l))}return i.join("&")};i.d(e,["buildQuery",0,s])},91321:function(t,e,i){"use strict";var o=i(81937);i.d(e,["completeUrl",0,t=>("file:"===o.globalWindow.location.protocol&&/^\/\//.test(t)&&(t="https:"+t),t)])},77483:function(t,e,i){"use strict";i.d(e,{ConfigDeepFlatten:function(){return function t(e){return(0,u.keys)(e,!1).reduce((i,o)=>(i[o]=(0,s.isPlainObject)(e[o])?t(e[o]):e[o],i),{})}},ConfigFlatten:function(){return h},ConfigMerge:function(){return function t(e,i){Object.keys(i).forEach(o=>{if((0,c.isUnsafeProtoKey)(o))return;let n=i[o],r=e[o];(0,s.isPlainObject)(n)&&(0,s.isPlainObject)(r)&&!(0,l.isAtom)(n)?t(r,n):e[o]=n})}},ConfigProto:function(){return function t(e,i,u=0){if(Object.getPrototypeOf(e)!==Object.prototype)return e;let h=a.Config.defaultOptions;if((0,n.isString)(e.preset)){if(void 0!==h.presets[e.preset]){let t=h.presets[e.preset];Object.keys(t).forEach(i=>{(0,r.isVoid)(e[i])&&(e[i]=t[i])})}delete e.preset}let d={};return Object.keys(e).forEach(n=>{if((0,c.isUnsafeProtoKey)(n))return;let r=e[n],a=i?i[n]:null;if((0,s.isPlainObject)(r)&&(0,s.isPlainObject)(a)&&!(0,l.isAtom)(r)){d[n]=t(r,a,u+1);return}if(0!==u&&(0,o.isArray)(r)&&!(0,l.isAtom)(r)&&(0,o.isArray)(a)){d[n]=[...r,...a.slice(r.length)];return}d[n]=r}),Object.setPrototypeOf(d,i),d}}});var o=i(17312),s=i(62101),n=i(85932),r=i(18303),a=i(5266),l=i(54794),c=i(78048),u=i(71125);function h(t){return(0,u.keys)(t,!1).reduce((e,i)=>(e[i]=t[i],e),{})}},3856:function(t,e,i){"use strict";var o=i(81937),s=i(91764),n=i(36310);i.d(e,["convertMediaUrlToVideoEmbed",0,(t,{width:e=400,height:i=345}={})=>{if(!(0,s.isURL)(t))return t;let r=o.globalDocument.createElement("a");r.href=t,e||(e=400),i||(i=345);let a=r.protocol||"";switch(r.hostname){case"www.vimeo.com":case"vimeo.com":{let o=r.pathname.split("/").filter(Boolean),s=o.findIndex(t=>/^\d+$/.test(t));if(-1===s)return t;let n=o[s],l=o[s+1];return l&&0===s&&(n+="/"+l),'<iframe width="'+e+'" height="'+i+'" src="'+a+"//player.vimeo.com/video/"+n+'" frameborder="0" allowfullscreen></iframe>'}case"youtube.com":case"www.youtube.com":case"m.youtube.com":case"music.youtube.com":case"youtu.be":case"www.youtu.be":{let o=(r.search?(0,n.parseQuery)(r.search):{}).v||r.pathname.substring(1);return(o=o.replace(/^(watch|embed|shorts|live|v)\//,"").replace(/\/$/,""))?'<iframe width="'+e+'" height="'+i+'" src="'+a+"//www.youtube.com/embed/"+o+'" frameborder="0" allowfullscreen></iframe>':t}}return t}])},80991:function(t,e,i){"use strict";i.d(e,{css:function(){return l},cssInline:function(){return c}});var o=i(22289),s=i(62101),n=i(19147),r=i(57821),a=i(74264);function l(t,e,i,c=!1){if((0,o.isBoolean)(i)&&(c=i,i=void 0),(0,s.isPlainObject)(e)||void 0!==i){let o=(t,e,i)=>{void 0!==(i=(0,n.normalizeCssNumericValue)(e,i))&&(null==i||l(t,e,!0)!==(0,n.normalizeCssValue)(e,i))&&(t.style[e]=i)};if((0,s.isPlainObject)(e)){let i=Object.keys(e);for(let s=0;s<i.length;s+=1)o(t,(0,r.camelCase)(i[s]),e[i[s]])}else o(t,(0,r.camelCase)(e),i);return""}let u=(0,a.kebabCase)(e),h=t.ownerDocument||document,d=!!h&&(h.defaultView||h.parentWindow),p=t.style[e],m="";return void 0!==p&&""!==p?m=p:d&&!c&&(m=d.getComputedStyle(t).getPropertyValue(u)),n.NUMBER_FIELDS_REG.test(e)&&/^[-+]?[0-9.]+px$/.test(m.toString())&&(m=parseInt(m.toString(),10)),(0,n.normalizeCssValue)(e,m)}function c(t,e){return t.style.getPropertyValue((0,a.kebabCase)(e))}i.d(e,["clearCenterAlign",0,t=>{"block"===l(t,"display")&&l(t,"display","");let{style:e}=t;"auto"===e.marginLeft&&"auto"===e.marginRight&&(e.marginLeft="",e.marginRight="")}])},77213:function(t,e,i){"use strict";i.d(e,["ctrlKey",0,t=>{if("u">typeof navigator&&-1!==navigator.userAgent.indexOf("Mac OS X")){if(t.metaKey&&!t.altKey)return!0}else if(t.ctrlKey&&!t.altKey)return!0;return!1}])},36400:function(t,e,i){"use strict";var o=i(31534);let s=new WeakMap;i.d(e,["dataBind",0,(t,e,i)=>{let n=s.get(t);if(!n){n={},s.set(t,n);let e=null;(0,o.isViewObject)(t.j)&&(e=t.j.e),(0,o.isViewObject)(t)&&(e=t.e),e&&e.on("beforeDestruct",()=>{s.delete(t)})}return void 0===i?n[e]:(n[e]=i,i)}])},97228:function(t,e,i){"use strict";var o=i(81937),s=i(85932);i.d(e,["defaultLanguage",0,(t,e="en")=>"auto"!==t&&(0,s.isString)(t)?t:o.globalDocument.documentElement&&o.globalDocument.documentElement.lang?o.globalDocument.documentElement.lang:navigator.language?navigator.language.substring(0,2):e])},38027:function(t,e,i){"use strict";i.d(e,{connection:function(){return n},error:function(){return s},options:function(){return r}});var o=i(29953);function s(t){return TypeError(t)}function n(t){return new o.ConnectionError(t)}function r(t){return new o.OptionsError(t)}},14228:function(t,e,i){"use strict";function o(t="Aborted"){return new DOMException(t,"AbortError")}i.d(e,{abort:function(){return o}})},58250:function(t,e,i){"use strict";i.d(e,{ConnectionError:function(){return o}});class o extends Error{constructor(t){super(t),Object.setPrototypeOf(this,o.prototype)}}},29953:function(t,e,i){"use strict";i.d(e,{ConnectionError:function(){return s.ConnectionError},OptionsError:function(){return n.OptionsError},abort:function(){return o.abort}});var o=i(14228),s=i(58250),n=i(11080)},11080:function(t,e,i){"use strict";i.d(e,{OptionsError:function(){return o}});class o extends TypeError{constructor(t){super(t),Object.setPrototypeOf(this,o.prototype)}}},33201:function(t,e,i){"use strict";i.d(e,{ConnectionError:function(){return s.ConnectionError},OptionsError:function(){return s.OptionsError},abort:function(){return s.abort},connection:function(){return o.connection},error:function(){return o.error},options:function(){return o.options}});var o=i(38027),s=i(29953)},54794:function(t,e,i){"use strict";i.d(e,{fastClone:function(){return r},isAtom:function(){return s},markAsAtomic:function(){return n}});var o=i(3347);function s(t){return t&&t.isAtom}function n(t){return Object.defineProperty(t,"isAtom",{enumerable:!1,value:!0,configurable:!1}),t}function r(t){return JSON.parse((0,o.stringify)(t))}},421:function(t,e,i){"use strict";var o=i(91565);let s=new Map;i.d(e,["getClassName",0,t=>{if((0,o.isFunction)(t.className))return t.className();let e=t.constructor?.originalConstructor||t.constructor;if(s.has(e))return s.get(e);if(e.name)return e.name;let i=new RegExp(/^\s*function\s*(\S*)\s*\(/),n=e.toString().match(i);return n?n[1]:""},"keepNames",0,s])},89308:function(t,e,i){"use strict";i.d(e,{get:function(){return n}});var o=i(85932),s=i(18303);function n(t,e){if(!(0,o.isString)(t)||!t.length)return null;let i=t.split("."),n=e;try{for(let t of i){if((0,s.isVoid)(n[t]))return null;n=n[t]}}catch{return null}return(0,s.isVoid)(n)?null:n}},37427:function(t,e,i){"use strict";i.d(e,["humanSizeToBytes",0,t=>{if(/^[0-9.]+$/.test(t.toString()))return parseFloat(t);let e=t.substr(-2,2).toUpperCase(),i=["KB","MB","GB","TB"],o=parseFloat(t.substr(0,t.length-2));return -1!==i.indexOf(e)?o*Math.pow(1024,i.indexOf(e)+1):parseInt(t,10)}])},93640:function(t,e,i){"use strict";i.r(e),i.d(e,{$$:function(){return k.$$},ConfigDeepFlatten:function(){return d.ConfigDeepFlatten},ConfigFlatten:function(){return d.ConfigFlatten},ConfigMerge:function(){return d.ConfigMerge},ConfigProto:function(){return d.ConfigProto},ConnectionError:function(){return v.ConnectionError},LimitedStack:function(){return L.LimitedStack},OptionsError:function(){return v.OptionsError},UNSAFE_PROTO_KEYS:function(){return C.UNSAFE_PROTO_KEYS},abort:function(){return v.abort},alignElement:function(){return o.alignElement},alreadyLoadedList:function(){return s.alreadyLoadedList},appendScriptAsync:function(){return s.appendScriptAsync},appendStyleAsync:function(){return s.appendStyleAsync},attr:function(){return l.attr},attrRaw:function(){return l.attrRaw},browser:function(){return c.browser},buildQuery:function(){return u.buildQuery},call:function(){return P.call},callPromise:function(){return P.callPromise},callThis:function(){return P.callThis},clearAlign:function(){return o.clearAlign},clearCenterAlign:function(){return m.clearCenterAlign},cns:function(){return E.cns},completeUrl:function(){return h.completeUrl},connection:function(){return v.connection},convertMediaUrlToVideoEmbed:function(){return p.convertMediaUrlToVideoEmbed},css:function(){return m.css},cssInline:function(){return m.cssInline},cssPath:function(){return k.cssPath},ctrlKey:function(){return f.ctrlKey},dataBind:function(){return g.dataBind},defaultLanguage:function(){return _.defaultLanguage},error:function(){return v.error},fastClone:function(){return b.fastClone},get:function(){return y.get},getClassName:function(){return w.getClassName},getDataTransfer:function(){return P.getDataTransfer},getPropertyDescriptor:function(){return P.getPropertyDescriptor},getXPathByElement:function(){return k.getXPathByElement},hAlignElement:function(){return o.hAlignElement},humanSizeToBytes:function(){return S.humanSizeToBytes},inView:function(){return x.inView},isAtom:function(){return b.isAtom},isUnsafeProtoKey:function(){return C.isUnsafeProtoKey},keepNames:function(){return w.keepNames},keys:function(){return P.keys},loadImage:function(){return P.loadImage},loadNext:function(){return s.loadNext},loadNextStyle:function(){return s.loadNextStyle},markAsAtomic:function(){return b.markAsAtomic},markDeprecated:function(){return E.markDeprecated},markOwner:function(){return P.markOwner},memorizeExec:function(){return P.memorizeExec},options:function(){return v.options},parseQuery:function(){return I.parseQuery},previewBox:function(){return D.previewBox},refs:function(){return k.refs},reset:function(){return T.reset},resolveElement:function(){return k.resolveElement},scrollIntoViewIfNeeded:function(){return x.scrollIntoViewIfNeeded},set:function(){return j.set}});var o=i(16849),s=i(47760),n=i(28712),r={};for(var a in n)0>["default","alignElement","clearAlign","hAlignElement","alreadyLoadedList","appendScriptAsync","appendStyleAsync","loadNext","loadNextStyle"].indexOf(a)&&(r[a]=(function(t){return n[t]}).bind(0,a));i.d(e,r);var l=i(7909),c=i(26136),u=i(36833),h=i(91321),d=i(77483),p=i(3856),m=i(80991),f=i(77213),g=i(36400),_=i(97228),v=i(33201),b=i(54794),y=i(89308),w=i(421),S=i(37427),C=i(78048),E=i(49385),I=i(36310),D=i(57075),T=i(43379),x=i(60898),k=i(28723),j=i(52144),L=i(42820),P=i(71125)},78048:function(t,e,i){"use strict";i.d(e,{isUnsafeProtoKey:function(){return s}});let o=["__proto__","constructor","prototype"];function s(t){return -1!==o.indexOf(t)}i.d(e,["UNSAFE_PROTO_KEYS",0,o])},49385:function(t,e,i){"use strict";i.d(e,{markDeprecated:function(){return s}});let o=console;function s(t,e=[""],i=null){return(...s)=>(o.warn(`Method "${e[0]}" deprecated.`+(e[1]?` Use "${e[1]}" instead`:"")),t.call(i,...s))}i.d(e,["cns",0,o])},36310:function(t,e,i){"use strict";i.d(e,["parseQuery",0,t=>{let e={},i=t.substring(1).split("&");for(let t=0;t<i.length;t+=1){let o=i[t].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1]||"")}return e}])},57075:function(t,e,i){"use strict";i.d(e,{previewBox:function(){return a}});var o=i(23211),s=i(85932),n=i(7909),r=i(80991);function a(t,e,i="px",l=null){let c=[],u=function(t,e){let i=[],s=[];o.Dom.each(t.editor,t=>{o.Dom.isTag(t,"img")&&s.push(t)});try{s.forEach(s=>{let r=[(0,n.attr)(s,"width"),(0,n.attr)(s,"height"),(0,n.attr)(s,"src")];(0,n.attr)(s,{width:s.offsetWidth+e,height:s.offsetHeight+e});let a=t.createInside.a();o.Dom.append(t.ed.body,a),(0,n.attr)(a,"href",(0,n.attr)(s,"src")||""),(0,n.attr)(s,"src",a.href),o.Dom.safeRemove(a),i.push(()=>{(0,n.attr)(s,{src:r[2],width:r[0]||null,height:r[1]||null})})})}catch(t){throw i.forEach(t=>t()),i.length=0,t}return i}(t,i);try{let a=t.e.fire("beforePreviewBox",e,i);if(null!=a)return a;let u=t.c.div("jodit__preview-box jodit-context");l&&o.Dom.append(l,u),(0,r.css)(u,{position:"relative",padding:16});let h=t.value||`<div style='position: absolute;left:50%;top:50%;transform: translateX(-50%) translateY(-50%);color:#ccc;'>${t.i18n("Empty")}</div>`;if(t.iframe){let e=t.create.element("iframe");(0,r.css)(e,{minWidth:800,minHeight:600,border:0}),o.Dom.append(u,e);let i=e.contentWindow;if(i&&(t.e.fire("generateDocumentStructure.iframe",i.document,t),u=i.document.body,"function"==typeof ResizeObserver)){let o=!1,s=i.document.body,n=new ResizeObserver(t.async.debounce(()=>{n.unobserve(s),(0,r.css)(e,"height",s.offsetHeight+20),t.async.requestAnimationFrame(()=>{o||n.observe(s)})},100)),a=()=>{o=!0,n.unobserve(s),n.disconnect(),t.e.off("beforeDestruct",a)};c.push(a),t.e.on("beforeDestruct",a)}}else(0,r.css)(u,{minWidth:1024,minHeight:600,border:0});let d=(e,i)=>{let r=(0,s.isString)(i)?t.c.div():i;(0,s.isString)(i)&&(r.innerHTML=i);for(let t=0;t<r.childNodes.length;t+=1){let i=r.childNodes[t];if(o.Dom.isElement(i)){let t=e.ownerDocument.createElement(i.nodeName);for(let e=0;e<i.attributes.length;e+=1)(0,n.attr)(t,i.attributes[e].name,i.attributes[e].value);0===i.childNodes.length||o.Dom.isTag(i,"table")?"SCRIPT"===i.nodeName?i.textContent&&(t.textContent=i.textContent):i.innerHTML&&(t.innerHTML=i.innerHTML):d(t,i);try{o.Dom.append(e,t)}catch{}}else try{o.Dom.append(e,i.cloneNode(!0))}catch{}}};return d(u,h),t.e.fire("afterPreviewBox",u),[u,()=>{c.forEach(t=>t())}]}finally{u.forEach(t=>t())}}},43379:function(t,e,i){"use strict";i.d(e,{reset:function(){return a}});var o=i(81937),s=i(91565),n=i(89308);let r={};function a(t){if(!(t in r)){let e=o.globalDocument.createElement("iframe");try{if(e.src="about:blank",o.globalDocument.body.appendChild(e),!e.contentWindow)return null;let i=(0,n.get)(t,e.contentWindow),a=(0,n.get)(t.split(".").slice(0,-1).join("."),e.contentWindow);(0,s.isFunction)(i)&&(r[t]=i.bind(a))}catch(t){if(!o.IS_PROD)throw t}finally{e.parentNode?.removeChild(e)}}return r[t]??null}},60898:function(t,e,i){"use strict";i.d(e,{inView:function(){return s},scrollIntoViewIfNeeded:function(){return n}});var o=i(23211);function s(t,e,i){let o=t.getBoundingClientRect(),s=t,n=o.top,r=o.height;for(;s&&s!==e&&s.parentNode;)if(n+r>(o=(s=s.parentNode).getBoundingClientRect()).bottom+1&&n>o.top||n+r<=o.top)return!1;return(n+r<=(i.documentElement&&i.documentElement.clientHeight||0)+1||n<=0)&&n+r>=0}function n(t,e,i){if(o.Dom.isHTMLElement(t)&&!s(t,e,i)){if(e.clientHeight!==e.scrollHeight){let i=t.offsetTop+t.offsetHeight-e.clientHeight;e.scrollTop=e.scrollTop<i?i:t.offsetTop}s(t,e,i)||t.scrollIntoView({block:"nearest"})}}},28723:function(t,e,i){"use strict";i.d(e,{$$:function(){return h},resolveElement:function(){return p}});var o=i(81937),s=i(23211),n=i(88475),r=i(85932),a=i(57821),l=i(7909),c=i(33201);let u=1;function h(t,e){let i;if(!o.IS_ES_NEXT&&/:scope/.test(t)&&o.IS_IE&&!(e&&e.nodeType===Node.DOCUMENT_NODE)){let o=e.id,s=o||"_selector_id_"+(Math.random()+"").slice(2)+ ++u;t=t.replace(/:scope/g,"#"+s),o||e.setAttribute("id",s),i=e.parentNode.querySelectorAll(t),o||e.removeAttribute("id")}else i=e.querySelectorAll(t);return[].slice.call(i)}let d=(t,e)=>{if(!t||t.nodeType!==Node.ELEMENT_NODE||!t.parentNode||e===t)return"";if(t.id)return"//*[@id='"+t.id+"']";let i=[].filter.call(t.parentNode.childNodes,e=>e.nodeName===t.nodeName);return d(t.parentNode,e)+"/"+t.nodeName.toLowerCase()+(i.length>1?"["+((0,n.toArray)(i).indexOf(t)+1)+"]":"")};function p(t,e){let i=t;if((0,r.isString)(t))try{i=e.querySelector(t)}catch{throw(0,c.error)('String "'+t+'" should be valid HTML selector')}if(!i||"object"!=typeof i||!s.Dom.isElement(i)||!i.cloneNode)throw(0,c.error)('Element "'+t+'" should be string or HTMLElement instance');return i}i.d(e,["cssPath",0,t=>{if(!s.Dom.isElement(t))return null;let e=[],i=t;for(;i&&i.nodeType===Node.ELEMENT_NODE;){let t=i.nodeName.toLowerCase();if(i.id){t+="#"+i.id,e.unshift(t);break}{let e=i,o=1;do(e=e.previousElementSibling)&&e.nodeName.toLowerCase()===t&&o++;while(e)t+=":nth-of-type("+o+")"}e.unshift(t),i=i.parentNode}return e.join(" > ")},"getXPathByElement",0,d,"refs",0,t=>{"container"in t&&(t=t.container);let e={};return s.Dom.each(t,t=>{if(s.Dom.isElement(t)&&(t.hasAttribute("ref")||t.hasAttribute("data-ref"))){let i=(0,l.attr)(t,"-ref");i&&(0,r.isString)(i)&&(e[(0,a.camelCase)(i)]=t,e[i]=t)}}),e}])},52144:function(t,e,i){"use strict";i.d(e,{set:function(){return l}});var o=i(17312),s=i(70222),n=i(62101),r=i(85932),a=i(78048);function l(t,e,i){if(!(0,r.isString)(t)||!t.length)return;let l=t.split(".");if(l.some(a.isUnsafeProtoKey))return;let c=i,u=l[0];for(let t=0;t<l.length-1;t+=1)u=l[t],(0,o.isArray)(c[u])||(0,n.isPlainObject)(c[u])||(c[u]=(0,s.isNumeric)(l[t+1])?[]:{}),c=c[u];c&&(c[l[l.length-1]]=e)}},42820:function(t,e,i){"use strict";i.d(e,{LimitedStack:function(){return s}});var o=i(25045);class s{push(t){return this.stack.push(t),this.stack.length>this.limit&&this.stack.shift(),this}pop(){return this.stack.pop()}find(t){return this.stack.find(t)}constructor(t){(0,o._)(this,"limit",void 0),(0,o._)(this,"stack",void 0),this.limit=t,this.stack=[]}}},71125:function(t,e,i){"use strict";i.d(e,{call:function(){return a},callPromise:function(){return u},callThis:function(){return l},getPropertyDescriptor:function(){return h},markOwner:function(){return c}});var o=i(52100),s=i(18303),n=i(7909),r=i(36400);function a(t,...e){return t(...e)}function l(t,e,...i){return t.apply(e,i)}function c(t,e){(0,n.attr)(e,"data-editor_id",t.id),e.component||Object.defineProperty(e,"jodit",{value:t})}function u(t,e){return(0,o.isPromise)(t)?t.then(t=>t,()=>null).finally(e):e?.()}function h(t,e){let i;do i=Object.getOwnPropertyDescriptor(t,e),t=Object.getPrototypeOf(t);while(!i&&t)return i}i.d(e,["getDataTransfer",0,t=>{if(t.clipboardData)return t.clipboardData;try{return t.dataTransfer||new DataTransfer}catch{return null}},"keys",0,(t,e=!0)=>{if(e)return Object.keys(t);let i=[];for(let e in t)i.push(e);return i},"loadImage",0,(t,e)=>e.async.promise((i,o)=>{let s=new Image,n=()=>{e.e.off(s),o?.()},r=()=>{e.e.off(s),i(s)};e.e.one(s,"load",r).one(s,"error",n).one(s,"abort",n),s.src=t,s.complete&&r()}),"memorizeExec",0,(t,e,{control:i},o)=>{let n="button"+i.command,a=(i.args&&i.args[0])??(0,r.dataBind)(t,n);if((0,s.isVoid)(a))return!1;(0,r.dataBind)(t,n,a),o&&(a=o(a)),t.execCommand(i.command,!1,a??void 0)}])},55810:function(t,e,i){"use strict";i.d(e,{init:function(){return r}});var o=i(81937),s=i(52433),n=i(3050);function r(t,e,i,r,a,l,c){if((0,s.isInitable)(r))try{r.init(t)}catch(t){if(!o.IS_PROD)throw t}a.set(e,r),l.delete(e),r.hasStyle&&(0,n.loadStyle)(t,e).catch(t=>{o.IS_PROD}),r.styles&&(c(t,e,"style").innerHTML=r.styles)}},3050:function(t,e,i){"use strict";i.d(e,{loadExtras:function(){return u},loadStyle:function(){return l}});var o=i(81937),s=i(74264),n=i(47760),r=i(86189);let a=new Set;async function l(t,e){let i=c(t,e,!1);if(!a.has(i))return a.add(i),(0,n.appendStyleAsync)(t,i)}function c(t,e,i){e=(0,s.kebabCase)(e);let o=t.minified?".min":"";return t.basePath+"plugins/"+e+"/"+e+o+"."+(i?"js":"css")}function u(t,e,i,s){try{let o=i.filter(e=>!t.has((0,r.normalizeName)(e.name)));o.length&&o.map(t=>{let i=t.url||c(e,t.name,!0);return(0,n.appendScriptAsync)(e,i).then(s).catch(()=>null)})}catch(t){if(!o.IS_PROD)throw t}}},25974:function(t,e,i){"use strict";i.d(e,{makeInstance:function(){return n}});var o=i(81937),s=i(91565);function n(t,e){try{try{return(0,s.isFunction)(e)?new e(t):e}catch(i){if((0,s.isFunction)(e)&&!e.prototype)return e(t)}}catch(t){if(!o.IS_PROD)throw t}return null}},86189:function(t,e,i){"use strict";i.d(e,{normalizeName:function(){return s}});var o=i(74264);function s(t){return(0,o.kebabCase)(t).toLowerCase()}},91206:function(t,e,i){"use strict";i.d(e,{Plugin:function(){return o.Plugin}});var o=i(18855);i(85305)},85305:function(t,e,i){"use strict";i.d(e,{PluginSystem:function(){return m}});var o=i(25045),s=i(81937),n=i(42689),r=i(32328),a=i(17312),l=i(52433),c=i(85932),u=i(55810),h=i(3050),d=i(25974),p=i(86189);class m{get size(){return this.__items.size}add(t,e){this.__items.set((0,p.normalizeName)(t),e),n.eventEmitter.fire(`plugin:${t}:ready`)}get(t){return this.__items.get((0,p.normalizeName)(t))}remove(t){this.__items.delete((0,p.normalizeName)(t))}__getFullPluginsList(t){let e=[];return this.__items.forEach((i,o)=>{(!t||t.has(o))&&e.push([o,i])}),e}__init(t){let{extraList:e,disableList:i,filter:o}={extraList:t.o.extraPlugins.map(t=>(0,c.isString)(t)?{name:t}:t),disableList:new Set((0,r.splitArray)(t.o.disablePlugins).map(p.normalizeName)),filter:t.o.safeMode?new Set(t.o.safePluginsList):null},n=new Map,m={},f=new Set;t.__plugins=m;let g=()=>{if(t.isInDestruct)return;let e=!1;this.__getFullPluginsList(o).forEach(([o,s])=>{if(i.has(o)||n.has(o))return;let r=s?.requires;if(r&&(0,a.isArray)(r)&&r.length){if(r.some(t=>i.has(t)))return;if(!r.every(t=>n.has(t)))return void f.add(o)}e=!0;let l=(0,d.makeInstance)(t,s);if(!l){n.set(o,null),f.delete(o);return}(0,u.init)(t,o,s,l,n,f,this.opts.getContainer),m[o]=l}),e&&(t.e.fire("updatePlugins"),g())};e&&e.length&&(0,h.loadExtras)(this.__items,t,e,g),g(),t.e.on("beforeDestruct",()=>{Object.keys(m).forEach(e=>{let i=m[e];(0,l.isDestructable)(i)&&i.destruct(t),delete m[e]}),delete t.__plugins}),s.IS_PROD||f.size}wait(t){return new Promise(e=>{if(this.get(t))return e();let i=()=>{e(),n.eventEmitter.off(`plugin:${t}:ready`,i)};n.eventEmitter.on(`plugin:${t}:ready`,i)})}constructor(t){(0,o._)(this,"opts",void 0),(0,o._)(this,"__items",void 0),this.opts=t,this.__items=new Map}}},18855:function(t,e,i){"use strict";i.d(e,{Plugin:function(){return l}});var o=i(25045),s=i(31635),n=i(16964),r=i(84839),a=i(24497);class l extends n.ViewComponent{className(){return"Plugin"}__afterPluginSystemInit(){let{j:t,buttons:e}=this;e&&(0,a.isJoditObject)(t)&&e.forEach(e=>{t.registerButton(e)})}__afterInit(){this.__inited=!0,this.setStatus(n.STATUSES.ready),this.afterInit(this.jodit)}init(t){this.jodit.isReady&&(this.afterInit(this.jodit),this.__afterPluginSystemInit(),this.jodit.e.fire("rebuildToolbar"))}__beforeDestruct(){if(this.isInDestruct)return;let{j:t}=this;if(t.e.off("afterPluginSystemInit",this.__afterPluginSystemInit).off("afterInit",this.__afterInit).off("beforeDestruct",this.destruct),this.setStatus(n.STATUSES.beforeDestruct),!this.__inited)return super.destruct();(0,a.isJoditObject)(t)&&this.buttons?.forEach(e=>{t?.unregisterButton(e)}),this.beforeDestruct(this.j),super.destruct()}constructor(t){super(t),(0,o._)(this,"buttons",[]),(0,o._)(this,"hasStyle",!1),(0,o._)(this,"styles",void 0),(0,o._)(this,"__inited",!1),t.e.on("afterPluginSystemInit",this.__afterPluginSystemInit).on("afterInit",this.__afterInit).on("beforeDestruct",this.__beforeDestruct)}}(0,o._)(l,"requires",[]),(0,s.__decorate)([r.autobind],l.prototype,"__afterPluginSystemInit",null),(0,s.__decorate)([r.autobind],l.prototype,"__afterInit",null),(0,s.__decorate)([r.autobind],l.prototype,"__beforeDestruct",null)},17338:function(t,e,i){"use strict";i.d(e,{Ajax:function(){return d}});var o=i(25045),s=i(31635),n=i(91231),r=i(81937),a=i(49574),l=i(65946),c=i(33201),u=i(5266);i(37102);var h=i(32855);class d{className(){return"Ajax"}__buildParams(t,e){return(0,l.isPlainObject)(t)&&this.options.contentType&&this.options.contentType.includes("application/json")?JSON.stringify(t):(0,l.isFunction)(this.o.queryBuild)?this.o.queryBuild.call(this,t,e):(0,l.isString)(t)||t instanceof r.globalWindow.FormData||"object"==typeof t&&null!=t&&(0,l.isFunction)(t.append)?t:(0,l.buildQuery)(t)}get o(){return this.options}abort(){if(this.__isFulfilled)return this;try{this.__isFulfilled=!0,this.xhr.abort()}catch{}return this}send(){this.__activated=!0;let{xhr:t,o:e}=this,i=this.prepareRequest();return this.__async.promise(async(o,s)=>{let n=()=>{this.__isFulfilled=!0,s(c.connection("Connection error"))},r=()=>{this.__isFulfilled=!0,o(new h.Response(i,t.status,t.statusText,!t.responseType?t.responseText:t.response))};t.onload=r,t.onabort=()=>{this.__isFulfilled=!0,s(c.abort("Abort connection"))},t.onerror=n,t.ontimeout=n,e.responseType&&(t.responseType=e.responseType),t.onprogress=t=>{let e=0;t.lengthComputable&&(e=t.loaded/t.total*100),this.options.onProgress?.(e)},t.onreadystatechange=()=>{this.options.onProgress?.(10),t.readyState===XMLHttpRequest.DONE&&(e.successStatuses.includes(t.status)?r():t.statusText&&(this.__isFulfilled=!0,s(c.connection(t.statusText))))},t.withCredentials=e.withCredentials??!1;let{url:a,data:u,method:d}=i;t.open(d,a,!0),e.contentType&&t.setRequestHeader&&t.setRequestHeader("Content-type",e.contentType);let{headers:p}=e;(0,l.isFunction)(p)&&(p=await p.call(this)),p&&t.setRequestHeader&&Object.keys(p).forEach(e=>{t.setRequestHeader(e,p[e])}),this.__async.setTimeout(()=>{t.send(u?this.__buildParams(u):void 0)},0)})}async *stream(){this.__activated=!0;let{xhr:t,o:e}=this,i=this.prepareRequest(),o=0,s="",n=[],r=null,a=!1,u=null,h=()=>{if(r){let t=r;r=null,t()}},d=e=>{let i=t.responseText;s+=i.substring(o),o=i.length;let r=s.split(`
|
|
11
11
|
|
|
12
12
|
`);for(let t of(s=e?"":r.pop()??"",r)){let e=t.trim();if(!e)continue;let i=[];for(let t of e.split(`
|
|
13
13
|
`))t.startsWith("data: ")?i.push(t.slice(6)):t.startsWith("data:")&&i.push(t.slice(5));i.length&&n.push(i.join(`
|
|
14
|
-
`))}h()};t.onprogress=()=>d(!1),t.onload=()=>{d(!0),a=!0,this.__isFulfilled=!0,h()},t.onerror=()=>{u=c.connection("Connection error"),a=!0,this.__isFulfilled=!0,h()},t.onabort=()=>{u=c.abort("Abort connection"),a=!0,this.__isFulfilled=!0,h()},t.withCredentials=e.withCredentials??!1;let{url:p,data:m,method:f}=i;t.open(f,p,!0),e.contentType&&t.setRequestHeader&&t.setRequestHeader("Content-type",e.contentType);let{headers:g}=e;(0,l.isFunction)(g)&&(g=await g.call(this)),g&&t.setRequestHeader&&Object.keys(g).forEach(e=>{t.setRequestHeader(e,g[e])}),t.send(m?this.__buildParams(m):void 0);try{for(;;)if(n.length>0)yield n.shift();else if(a)break;else await new Promise(t=>{r=t})}finally{this.__isFulfilled||this.abort()}if(u)throw u}prepareRequest(){if(!this.o.url)throw c.error("Need URL for AJAX request");let t=this.o.url,e=this.o.data,i=(this.o.method||"get").toLowerCase();if("get"===i&&e&&(0,l.isPlainObject)(e)){let i=t.indexOf("?");if(-1!==i){let o=(0,l.parseQuery)(t.substring(i));t=t.substring(0,i)+"?"+(0,l.buildQuery)({...o,...e})}else t+="?"+(0,l.buildQuery)(this.o.data)}let o={url:t,method:i,data:e};return d.log.splice(100),d.log.push(o),o}destruct(){this.__isDestructed||(this.__isDestructed=!0,this.__activated&&!this.__isFulfilled&&(this.abort(),this.__isFulfilled=!0),this.__async.destruct())}constructor(t,e=u.Config.prototype.defaultAjaxOptions){(0,o._)(this,"__async",new n.Async),(0,o._)(this,"xhr",void 0),(0,o._)(this,"options",void 0),(0,o._)(this,"__isFulfilled",!1),(0,o._)(this,"__activated",!1),(0,o._)(this,"__isDestructed",!1),this.options=(0,l.ConfigProto)(t||{},e),this.xhr=this.o.xhr?this.o.xhr():new XMLHttpRequest}}(0,o._)(d,"log",[]),(0,s.__decorate)([a.autobind],d.prototype,"destruct",null)},37102:function(t,e,i){"use strict";i(5266).Config.prototype.defaultAjaxOptions={successStatuses:[200,201,202],method:"GET",url:"",data:null,contentType:"application/x-www-form-urlencoded; charset=UTF-8",headers:{"X-REQUESTED-WITH":"XMLHttpRequest"},withCredentials:!1,xhr:()=>new XMLHttpRequest}},73714:function(t,e,i){"use strict";i.d(e,{Ajax:function(){return o.Ajax},Response:function(){return s.Response}});var o=i(17338),s=i(32855)},32855:function(t,e,i){"use strict";i.d(e,{Response:function(){return s}});var o=i(25045);class s{get url(){return this.request.url}async json(){return JSON.parse(this.body)}text(){return Promise.resolve(this.body)}async blob(){return this.body}constructor(t,e,i,s){(0,o._)(this,"status",void 0),(0,o._)(this,"statusText",void 0),(0,o._)(this,"request",void 0),(0,o._)(this,"body",void 0),this.request=t,this.status=e,this.statusText=i,this.body=s}}},42259:function(t,e,i){"use strict";i.d(e,{cursorInTheEdgeOfString:function(){return r},findCorrectCurrentNode:function(){return a},moveNodeInsideStart:function(){return n.moveNodeInsideStart}});var o=i(81937),s=i(23211),n=i(89817);function r(t,e,i,s){let n=t.nodeValue?.length?t.nodeValue:"";if(s&&n.replace((0,o.INVISIBLE_SPACE_REG_EXP_END)(),"").length>e)return!0;let r=(0,o.INVISIBLE_SPACE_REG_EXP_START)().exec(n);return i&&(r&&r[0].length<e||!r&&e>0)}function a(t,e,i,o,n,r){if((t=e.startContainer.childNodes[e.startOffset])||(t=e.startContainer.childNodes[e.startOffset-1],i=!0),t&&o&&!s.Dom.isText(t)){if(!i&&s.Dom.isText(t.previousSibling))t=t.previousSibling;else if(n){let e=r(t);for(;e;){if(e&&s.Dom.isText(e)){t=e;break}e=r(e)}}}if(t&&!o&&!s.Dom.isText(t)){let e=t,i=t;do e=e.firstChild,i=i.lastChild;while(e&&i&&!s.Dom.isText(e))e===i&&e&&s.Dom.isText(e)&&(t=e)}return{node:t,rightMode:i}}i(7470)},89817:function(t,e,i){"use strict";i.d(e,{moveNodeInsideStart:function(){return n}});var o=i(81937),s=i(23211);function n(t,e,i){let n=s.Dom.findSibling(e,i),r=s.Dom.findSibling(e,!i);for(;s.Dom.isElement(n)&&!s.Dom.isTag(n,o.INSEPARABLE_TAGS)&&s.Dom.isContentEditable(n,t.editor)&&(!r||!s.Dom.closest(e,s.Dom.isElement,t.editor));)i||!n.firstChild?s.Dom.append(n,e):s.Dom.before(n.firstChild,e),n=s.Dom.sibling(e,i),r=s.Dom.sibling(e,!i)}},7470:function(t,e,i){"use strict";i.d(e,{moveTheNodeAlongTheEdgeOutward:function(){return s}});var o=i(23211);function s(t,e,i){let s=t;for(;s&&s!==i&&!(o.Dom.findSibling(s,e)||o.Dom.isBlock(s.parentElement));)(s=s.parentElement)&&s!==i&&(e?o.Dom.before(s,t):o.Dom.after(s,t))}},59841:function(t,e,i){"use strict";i.d(e,{CommitStyle:function(){return s.CommitStyle},Selection:function(){return o.Selection}});var o=i(98595),s=i(84578)},98595:function(t,e,i){"use strict";i.d(e,{Selection:function(){return m}});var o=i(25045),s=i(31635),n=i(81937),r=i(84839),a=i(23211),l=i(65946),c=i(28686),u=i(28712),h=i(7470),d=i(84578),p=i(42259);class m{get j(){return this.jodit}errorNode(t){if(!a.Dom.isNode(t))throw(0,l.error)("Parameter node must be instance of Node")}get area(){return this.j.editor}get win(){return this.j.ew}get doc(){return this.j.ed}get sel(){return this.j.o.shadowRoot&&(0,c.isFunction)(this.j.o.shadowRoot.getSelection)?this.j.o.shadowRoot.getSelection():this.win.getSelection()}get range(){let t=this.sel;return t&&t.rangeCount?t.getRangeAt(0):this.createRange()}get isInsideArea(){let{sel:t}=this,e=t?.rangeCount?t.getRangeAt(0):null;return!(!e||!a.Dom.isOrContains(this.area,e.startContainer))}createRange(t=!1){let e=this.doc.createRange();return t&&this.selectRange(e),e}remove(){let t=this.sel,e=this.current();if(t&&e)for(let e=0;e<t.rangeCount;e+=1)t.getRangeAt(e).deleteContents(),t.getRangeAt(e).collapse(!0)}clear(){this.sel?.rangeCount&&this.sel?.removeAllRanges()}removeNode(t){if(!a.Dom.isOrContains(this.j.editor,t,!0))throw(0,l.error)("Selection.removeNode can remove only editor's children");a.Dom.safeRemove(t),this.j.e.fire("afterRemoveNode",t)}insertCursorAtPoint(t,e){this.removeMarkers();try{let i=this.createRange();return(()=>{if(this.doc.caretPositionFromPoint){let o=this.doc.caretPositionFromPoint(t,e);if(o)return i.setStart(o.offsetNode,o.offset)}if(this.doc.caretRangeFromPoint){let o=this.doc.caretRangeFromPoint(t,e);(0,u.assert)(o,"Incorrect caretRangeFromPoint behaviour"),i.setStart(o.startContainer,o.startOffset)}})(),i.collapse(!0),this.selectRange(i),!0}catch{}return!1}get hasMarkers(){return!!this.markers.length}get markers(){return(0,l.$$)("span[data-"+n.MARKER_CLASS+"]",this.area)}removeMarkers(){a.Dom.safeRemove(...this.markers)}marker(t=!1,e){let i=null;e&&(i=e.cloneRange()).collapse(t);let o=this.j.createInside.span();return o.id=n.MARKER_CLASS+"_"+Number(new Date)+"_"+(Math.random()+"").slice(2),(0,l.css)(o,{lineHeight:"0",display:"none"}),a.Dom.markTemporary(o),(0,l.attr)(o,"data-"+n.MARKER_CLASS,t?"start":"end"),a.Dom.append(o,this.j.createInside.text(n.INVISIBLE_SPACE)),i&&a.Dom.isOrContains(this.area,t?i.startContainer:i.endContainer)&&i.insertNode(o),o}restore(){let t=!1,e=t=>e=>a.Dom.isMarker(e)&&(0,l.attr)(e,"data-"+n.MARKER_CLASS)===(t?"start":"end"),i=a.Dom.first(this.area,e(!0)),o=a.Dom.first(this.area,e(!1));if(i){if(t=this.createRange(),o)t.setStartAfter(i),a.Dom.safeRemove(i),t.setEndBefore(o),a.Dom.safeRemove(o);else{let e=i.previousSibling;a.Dom.isText(e)?t.setStart(e,e.nodeValue?e.nodeValue.length:0):t.setStartBefore(i),a.Dom.safeRemove(i),t.collapse(!0)}t&&this.selectRange(t)}}fakes(){let t=this.sel;if(!t||!t.rangeCount)return[];let e=t.getRangeAt(0);(0,u.assert)(e,"Range is null");let i=e.cloneRange();i.collapse(!0);let o=this.j.createInside.fake();a.Dom.safeInsertNode(i,o),e.setStartBefore(o);let s=[o];if(!e.collapsed){let t=e.cloneRange();t.collapse(!1);let i=this.j.createInside.fake();a.Dom.safeInsertNode(t,i),e.setEndAfter(i),s.push(i)}return this.selectRange(e),s}restoreFakes(t){let e=t.filter(t=>t.isConnected);if(!e.length)return;let[i,o]=e,s=this.createRange();s.setStartAfter(i),o&&s.setEndBefore(o),this.selectRange(s),i.parentNode?.firstChild!==i.parentNode?.lastChild&&a.Dom.safeRemove(i),o?.parentNode?.firstChild!==o?.parentNode?.lastChild&&a.Dom.safeRemove(o)}save(t=!1){if(this.hasMarkers)return[];let e=this.sel;if(!e||!e.rangeCount)return[];let i=[],o=e.rangeCount,s=[];for(let t=0;o>t;t+=1)if(s[t]=e.getRangeAt(t),s[t].collapsed){let e=this.marker(!0,s[t]);i[t]={startId:e.id,collapsed:!0,startMarker:e.outerHTML}}else{let e=this.marker(!0,s[t]),o=this.marker(!1,s[t]);i[t]={startId:e.id,endId:o.id,collapsed:!1,startMarker:e.outerHTML,endMarker:o.outerHTML}}if(!t){e.removeAllRanges();for(let t=o-1;t>=0;--t){let o=this.doc.getElementById(i[t].startId);if(o){if(i[t].collapsed)s[t].setStartAfter(o),s[t].collapse(!0);else if(s[t].setStartBefore(o),i[t].endId){let e=this.doc.getElementById(i[t].endId);e&&s[t].setEndAfter(e)}try{e.addRange(s[t].cloneRange())}catch{}}}}return i}focus(t={preventScroll:!0}){if(!this.isFocused()){let e=(0,l.getScrollParent)(this.j.container),i=e?.scrollTop;this.j.iframe&&"complete"===this.doc.readyState&&this.j.iframe.focus(t),this.win.focus(),this.area.focus(t),i&&e?.scrollTo&&e.scrollTo(0,i);let o=this.sel,s=o?.rangeCount?o?.getRangeAt(0):null;if(!s||!a.Dom.isOrContains(this.area,s.startContainer)){let t=this.createRange();t.setStart(this.area,0),t.collapse(!0),this.selectRange(t,!1)}return this.j.editorIsActive||this.j?.events?.fire("focus"),!0}return!1}isCollapsed(){let t=this.sel;for(let e=0;t&&e<t.rangeCount;e+=1)if(!t.getRangeAt(e).collapsed)return!1;return!0}isFocused(){return this.doc.hasFocus&&this.doc.hasFocus()&&this.area===this.doc.activeElement}current(t=!0){if(this.j.getRealMode()!==n.MODE_WYSIWYG)return null;let e=this.sel;if(!e||0===e.rangeCount)return null;let i=e.getRangeAt(0),o=i.startContainer,s=!1;if(a.Dom.isTag(o,"br")&&e.isCollapsed)return o;if(!a.Dom.isText(o)){let n=(0,p.findCorrectCurrentNode)(o,i,s,e.isCollapsed,t,t=>s?t.lastChild:t.firstChild);o=n.node,s=n.rightMode}return o&&a.Dom.isOrContains(this.area,o)?o:null}insertNode(t,e=!0,i=!0){this.errorNode(t);let o=a.Dom.isFragment(t)?t.lastChild:t;this.j.e.fire("safeHTML",t),!this.isFocused()&&this.j.isEditorMode()&&(this.focus(),this.restore());let s=this.sel;this.j.history.snapshot.transaction(()=>{if(this.isCollapsed()||this.j.execCommand("Delete"),this.j.e.fire("beforeInsertNode",t),s&&s.rangeCount){let e=s.getRangeAt(0),{firstChild:i}=t;a.Dom.isOrContains(this.area,e.commonAncestorContainer)?a.Dom.safeInsertNode(e,t):a.Dom.append(this.area,t),[()=>i?.previousSibling,()=>i?.previousSibling,()=>i?.previousSibling?.lastChild].forEach(t=>{let e=t();e&&a.Dom.isEmptyTextNode(e)&&a.Dom.safeRemove(e)})}else a.Dom.append(this.area,t);let i=t=>{if(a.Dom.isBlock(t)){let e=t.lastChild;if(e)return i(e)}this.setCursorAfter(t)};e&&(a.Dom.isFragment(t)?o&&i(o):i(t)),this.j.o.scrollToPastedContent&&(0,l.scrollIntoViewIfNeeded)(o??t,this.j.editor,this.doc)}),i&&this.j.events&&this.j.__imdSynchronizeValues(),this.j.events&&this.j.e.fire("afterInsertNode",a.Dom.isFragment(t)?o:t)}insertHTML(t,e=!0){if(""===t)return;let i=this.j.createInside.div(),o=this.j.createInside.fragment();!this.isFocused()&&this.j.isEditorMode()&&(this.focus(),this.restore()),a.Dom.isNode(t)?a.Dom.append(i,t):i.innerHTML=t.toString(),!this.j.isEditorMode()&&!1===this.j.e.fire("insertHTML",i.innerHTML)||i.lastChild&&(a.Dom.moveContent(i,o),this.insertNode(o,e,!1),this.j.__imdSynchronizeValues())}insertImage(t,e=null,i=null){let o=(0,c.isString)(t)?this.j.createInside.element("img"):t;if((0,c.isString)(t)&&(0,l.attr)(o,"src",t),null!=i){let t=i.toString();t&&"auto"!==t&&0>(t+"").indexOf("px")&&0>(t+"").indexOf("%")&&(t+="px"),(0,l.attr)(o,"width",t)}e&&"object"==typeof e&&(0,l.css)(o,e);let s=()=>{(o.naturalHeight<o.offsetHeight||o.naturalWidth<o.offsetWidth)&&(0,l.css)(o,{width:"",height:""}),o.removeEventListener("load",s)};this.j.e.on(o,"load",s),o.complete&&s(),this.insertNode(o),this.j.e.fire("afterInsertImage",o)}eachSelection(t){let e=this.sel;if(!e||!e.rangeCount)return;let i=e.getRangeAt(0),o=i.commonAncestorContainer;a.Dom.isHTMLElement(o)||(o=o.parentElement);let s=[],r=i.startOffset,u=o.childNodes.length,h=i.startContainer===this.area?o.childNodes[r<u?r:u-1]:i.startContainer,d=i.endContainer===this.area?o.childNodes[i.endOffset-1]:i.endContainer;a.Dom.isText(h)&&h===i.startContainer&&i.startOffset===h.nodeValue?.length&&h.nextSibling&&(h=h.nextSibling),a.Dom.isText(d)&&d===i.endContainer&&0===i.endOffset&&d.previousSibling&&(d=d.previousSibling);let p=t=>{!t||t===o||a.Dom.isEmptyTextNode(t)||(0,c.isMarker)(t)||s.push(t)};p(h),h!==d&&a.Dom.isOrContains(o,h,!0)&&a.Dom.find(h,t=>(p(t),t===d||t&&t.contains&&t.contains(d)),o,!0,!1);let m=e=>{if(a.Dom.isOrContains(this.j.editor,e,!0)){if(e.nodeName.match(/^(UL|OL)$/))return(0,l.toArray)(e.childNodes).forEach(m);if(a.Dom.isTag(e,"li"))if(e.firstChild)e=e.firstChild;else{let t=this.j.createInside.text(n.INVISIBLE_SPACE);a.Dom.append(e,t),e=t}t(e)}};0===s.length&&(a.Dom.isEmptyTextNode(h)&&s.push(h),h?.firstChild&&s.push(h.firstChild)),s.forEach(m)}cursorInTheEdge(t,e,i=null){let o=!t,s=this.sel,n=s?.rangeCount?s.getRangeAt(0):null;if(i??=this.current(!1),!n||!i||!a.Dom.isOrContains(e,i,!0))return null;let r=t?n.startContainer:n.endContainer,c=t?n.startOffset:n.endOffset,u=t=>!!(t&&!a.Dom.isTag(t,"br")&&!a.Dom.isEmptyTextNode(t)&&!a.Dom.isTemporary(t)&&!(a.Dom.isElement(t)&&!0===this.j.e.fire("isInvisibleForCursor",t)));if(a.Dom.isText(r)){if((0,p.cursorInTheEdgeOfString)(r,c,t,o))return!1}else{let t=(0,l.toArray)(r.childNodes);if(o){if(t.slice(c).some(u))return!1}else if(t.slice(0,c).some(u))return!1}let h=i;for(;h&&h!==e;){let e=a.Dom.sibling(h,t);if(!e){h=h.parentNode;continue}if((h=e)&&u(h))return!1}return!0}cursorOnTheLeft(t,e){return this.cursorInTheEdge(!0,t,e)}cursorOnTheRight(t,e){return this.cursorInTheEdge(!1,t,e)}setCursorAfter(t){return this.setCursorNearWith(t,!1)}setCursorBefore(t){return this.setCursorNearWith(t,!0)}setCursorNearWith(t,e){if(this.errorNode(t),!a.Dom.up(t,t=>t===this.area||t&&t.parentNode===this.area,this.area))throw(0,l.error)("Node element must be in editor");let i=this.createRange(),o=null;return a.Dom.isText(t)?e?i.setStart(t,0):i.setEnd(t,t.nodeValue?.length??0):(o=this.j.createInside.fake(),e?i.setStartBefore(t):i.setEndAfter(t),i.collapse(e),a.Dom.safeInsertNode(i,o),i.selectNode(o)),i.collapse(e),this.selectRange(i),o}setCursorIn(t,e=!1){if(this.errorNode(t),!a.Dom.up(t,t=>t===this.area||t&&t.parentNode===this.area,this.area))throw(0,l.error)("Node element must be in editor");let i=this.createRange(),o=t,s=t;do{if(a.Dom.isText(o)||a.Dom.isTag(o,n.INSEPARABLE_TAGS))break;s=o,o=e?o.firstChild:o.lastChild}while(o)if(!o){let t=this.j.createInside.text(n.INVISIBLE_SPACE);a.Dom.isTag(s,n.INSEPARABLE_TAGS)?o=s:(a.Dom.append(s,t),s=t)}let r=o||s;return a.Dom.isTag(r,n.INSEPARABLE_TAGS)?e||a.Dom.isTag(r,"br")?i.setStartBefore(r):i.setEndAfter(r):i.selectNodeContents(r),i.collapse(e),this.selectRange(i),s}selectRange(t,e=!0){let i=this.sel;return e&&!this.isFocused()&&"focus"!==this.j.e.current&&this.focus(),i&&(i.removeAllRanges(),i.addRange(t)),this.j.e.fire("changeSelection"),this}select(t,e=!1){if(this.errorNode(t),!a.Dom.up(t,t=>t===this.area||t&&t.parentNode===this.area,this.area))throw(0,l.error)("Node element must be in editor");let i=this.createRange();return i[e?"selectNodeContents":"selectNode"](t),this.selectRange(i)}get html(){let t=this.sel;if(t&&t.rangeCount>0){let e=t.getRangeAt(0).cloneContents(),i=this.j.createInside.div();return a.Dom.append(i,e),i.innerHTML}return""}__wrapSelectionFragments(){let t=this.range;this.__splitSelectionBoundaries(t);let e=t.commonAncestorContainer;return(a.Dom.isText(e)&&(e=e.parentNode),e)?this.__wrapSelectionRuns(this.__collectContainedNodes(e,t)):[]}__splitSelectionBoundaries(t){let{startContainer:e,endContainer:i}=t,{startOffset:o,endOffset:s}=t;if(a.Dom.isText(i)&&s>0&&s<(i.nodeValue?.length??0)&&(i.splitText(s),s=i.nodeValue?.length??s),a.Dom.isText(e)&&o>0&&o<(e.nodeValue?.length??0)){let t=e.splitText(o);e===i&&(i=t,s=t.nodeValue?.length??0),e=t,o=0}t.setStart(e,o),t.setEnd(i,s),this.__normalizeRangeBoundary(t,!0),this.__normalizeRangeBoundary(t,!1)}__normalizeRangeBoundary(t,e){let i=e?t.startContainer:t.endContainer;if(!a.Dom.isText(i))return;let o=e?t.startOffset:t.endOffset,s=i.nodeValue?.length??0;0===o?e?t.setStartBefore(i):t.setEndBefore(i):o>=s&&(e?t.setStartAfter(i):t.setEndAfter(i))}__collectContainedNodes(t,e){let i=[];return(0,l.toArray)(t.childNodes).forEach(t=>{this.__isFullyContained(e,t)?i.push(t):t.childNodes.length&&e.intersectsNode(t)&&i.push(...this.__collectContainedNodes(t,e))}),i}__isFullyContained(t,e){let i=this.createRange();return i.selectNode(e),0>=t.compareBoundaryPoints(Range.START_TO_START,i)&&t.compareBoundaryPoints(Range.END_TO_END,i)>=0}__wrapSelectionRuns(t){let e=[],i=[],o=()=>{i.length&&(e.push(this.__wrapRunInFont(i)),i=[])};return t.forEach(t=>{a.Dom.isElement(t)&&this.__isOrContainsBlock(t)?(o(),e.push(...this.__wrapSelectionRuns((0,l.toArray)(t.childNodes)))):(i.length&&i[i.length-1].parentNode!==t.parentNode&&o(),i.push(t))}),o(),e}__isOrContainsBlock(t){return!!a.Dom.isBlock(t)||(0,l.toArray)(t.childNodes).some(t=>this.__isOrContainsBlock(t))}__wrapRunInFont(t){let e=this.j.createInside.element("font"),[i]=t;return a.Dom.before(i,e),t.forEach(t=>a.Dom.append(e,t)),e}*wrapInTagGen(t){if(this.isCollapsed()){let e=this.jodit.createInside.element("font",n.INVISIBLE_SPACE);this.insertNode(e,!1,!1),t&&t[0]&&a.Dom.append(e,t[0]),yield e,a.Dom.unwrap(e);return}for(let t of this.__wrapSelectionFragments()){let{firstChild:e,lastChild:i}=t;if(e&&e===i&&(0,c.isMarker)(e)){a.Dom.unwrap(t);continue}e&&(0,c.isMarker)(e)&&a.Dom.before(t,e),i&&(0,c.isMarker)(i)&&a.Dom.after(t,i),yield t,a.Dom.unwrap(t)}}wrapInTag(t){let e=[];for(let i of this.wrapInTagGen())try{if(i.firstChild&&i.firstChild===i.lastChild&&(0,c.isMarker)(i.firstChild))continue;(0,c.isFunction)(t)?t(i):e.push(a.Dom.replace(i,t,this.j.createInside))}finally{let t=i.parentNode;t&&(a.Dom.unwrap(i),a.Dom.isEmpty(t)&&a.Dom.unwrap(t))}return e}commitStyle(t){(0,u.assert)((0,l.size)(t)>0,"Need to pass at least one option"),new d.CommitStyle(t).apply(this.j)}splitSelection(t,e){if(!this.isCollapsed())return null;let i=this.createRange(),o=this.range;i.setStartBefore(t);let s=this.cursorOnTheRight(t,e),r=this.cursorOnTheLeft(t,e),l=this.j.createInside.element("br"),c=this.j.createInside.fake(),h=c.cloneNode();try{if(s||r){e?a.Dom.before(e,l):a.Dom.safeInsertNode(o,l);let t=(t,e)=>{let i=e(t);for(;i;){let t=e(i);if(i&&(a.Dom.isTag(i,"br")||a.Dom.isEmptyTextNode(i)))a.Dom.safeRemove(i);else break;i=t}};t(l,t=>t.nextSibling),t(l,t=>t.previousSibling),a.Dom.after(l,h),a.Dom.before(l,c),s?(i.setEndBefore(l),o.setEndBefore(l)):(i.setEndAfter(l),o.setEndAfter(l))}else i.setEnd(o.startContainer,o.startOffset);let d=i.extractContents(),p=t=>a.Dom.each(t,t=>a.Dom.isEmptyTextNode(t)&&a.Dom.safeRemove(t));(0,u.assert)(t.parentNode,"Splitting fails");try{if(p(d),p(t),a.Dom.before(t,d),!e&&s&&l?.parentNode){let t=this.createRange();t.setStartBefore(l),this.selectRange(t)}}catch(t){if(!n.IS_PROD)throw t}let m=t=>{let e=t?.parentNode;e&&e.firstChild===e.lastChild&&a.Dom.append(e,l.cloneNode())};m(c),m(h)}finally{a.Dom.safeRemove(c),a.Dom.safeRemove(h)}return t.previousElementSibling}expandSelection(){if(this.isCollapsed())return this;let{range:t}=this,e=t.cloneRange();if(!a.Dom.isOrContains(this.j.editor,t.commonAncestorContainer,!0))return this;let i=e=>{let i=this.j.createInside.fake(),o=t.cloneRange();return o.collapse(e),a.Dom.safeInsertNode(o,i),(0,h.moveTheNodeAlongTheEdgeOutward)(i,e,this.j.editor),i},o=i(!0),s=i(!1);e.setStartAfter(o),e.setEndBefore(s);let n=a.Dom.findSibling(o,!1),r=a.Dom.findSibling(s,!0);if(n!==r){let t=a.Dom.isElement(n)&&a.Dom.isOrContains(n,s),i=!t&&a.Dom.isElement(r)&&a.Dom.isOrContains(r,o);if(t||i){let i=t?n:r,l=i;for(;a.Dom.isElement(i);)(i=t?i.firstElementChild:i.lastElementChild)&&(t?a.Dom.isOrContains(i,s):a.Dom.isOrContains(i,o))&&(l=i);t?e.setStart(l,0):e.setEnd(l,l.childNodes.length)}}if(this.selectRange(e),a.Dom.safeRemove(o,s),this.isCollapsed())throw(0,l.error)("Selection is collapsed");return this}constructor(t){(0,o._)(this,"jodit",void 0),this.jodit=t,t.e.on("removeMarkers",()=>{this.removeMarkers()})}}(0,s.__decorate)([r.autobind],m.prototype,"createRange",null),(0,s.__decorate)([r.autobind],m.prototype,"focus",null),(0,s.__decorate)([r.autobind],m.prototype,"setCursorAfter",null),(0,s.__decorate)([r.autobind],m.prototype,"setCursorBefore",null),(0,s.__decorate)([r.autobind],m.prototype,"setCursorIn",null)},17481:function(t,e,i){"use strict";i.d(e,{extractSelectedPart:function(){return a}});var o=i(23211),s=i(23175),n=i(4040),r=i(71125);function a(t,e,i){let o=i.s.createRange(),n=(0,s.isMarker)(e.previousSibling)?e.previousSibling:e;o.setStartBefore(t),o.setEndBefore(n),l(t,o,!0);let r=(0,s.isMarker)(e.nextSibling)?e.nextSibling:e;o.setStartAfter(r),o.setEndAfter(t),l(t,o,!1)}function l(t,e,i){let s=e.extractContents();s.textContent&&(0,n.trim)(s.textContent).length||!s.firstChild||o.Dom.unwrap(s.firstChild),t.parentNode&&(0,r.call)(i?o.Dom.before:o.Dom.after,t,s)}},48729:function(t,e,i){"use strict";i.d(e,{FiniteStateMachine:function(){return a}});var o=i(25045),s=i(81937),n=i(85932),r=i(28712);class a{setState(t){(0,r.assert)(!this.__previewsStates.has(t),"Circled states"),this.__previewsStates.add(t),this.__state=t}getState(){return this.__state}disableSilent(){this.silent=!1}dispatch(t,e){let i=this.transitions[this.getState()][t];if(i){let t=i.call(this,e);return(0,r.assert)(t&&t!==e,"Action should return new value"),(0,r.assert)((0,n.isString)(t.next),"Value should contain the next state"),(0,r.assert)(t.next!==this.getState(),"The new state should not be equal to the old one."),this.setState(t.next),s.IS_PROD||this.silent,t}throw Error(`invalid action: ${this.getState()}.${t.toString()}`)}constructor(t,e){(0,o._)(this,"transitions",void 0),(0,o._)(this,"__state",void 0),(0,o._)(this,"silent",void 0),(0,o._)(this,"__previewsStates",void 0),this.transitions=e,this.silent=!0,this.__previewsStates=new Set,this.setState(t)}}},10171:function(t,e,i){"use strict";i.d(e,{getSuitChild:function(){return r}});var o=i(23211),s=i(83653),n=i(73019);function r(t,e){let{firstChild:i}=e;for(;i&&!(0,s.isNormalNode)(i);)if(!(i=i.nextSibling))return null;return i&&!o.Dom.next(i,s.isNormalNode,e)&&(0,n.isSuitElement)(t,i,!1)?i:null}},19549:function(t,e,i){"use strict";i.d(e,{getSuitParent:function(){return function t(e,i,r){let{parentNode:a}=i;return a===r||!o.Dom.isHTMLElement(a)||o.Dom.next(i,s.isNormalNode,a)||o.Dom.prev(i,s.isNormalNode,a)?null:e.isElementCommit&&e.elementIsBlock&&!o.Dom.isBlock(a)?t(e,a,r):o.Dom.isTag(a,"li")&&!e.isElementCommit&&e.options.attributes?.style||(0,n.isSuitElement)(e,a,!1)&&(!o.Dom.isBlock(a)||e.elementIsBlock)?a:e.isElementCommit&&!o.Dom.isBlock(a)?t(e,a,r):null}}});var o=i(23211),s=i(83653),n=i(73019)},9703:function(t,e,i){"use strict";i.d(e,{hasSameStyle:function(){return c},hasSameStyleKeys:function(){return u}});var o=i(81937),s=i(23211),n=i(18303),r=i(19147),a=i(28712),l=i(80991);function c(t,e){return!!(!s.Dom.isTag(t,"font")&&s.Dom.isHTMLElement(t)&&Object.keys(e).every(i=>{let o=(0,l.css)(t,i,!0);return""===o&&(""===e[i]||null==e[i])||!(0,n.isVoid)(o)&&""!==o&&!(0,n.isVoid)(e[i])&&(0,r.normalizeCssValue)(i,e[i]).toString().toLowerCase()===o.toString().toLowerCase()}))}if(o.globalDocument){let t=o.globalDocument.createElement("div");t.style.color="red",(0,a.assert)(c(t,{color:"red"}),"Style test"),(0,a.assert)(c(t,{fontSize:null}),"Style test"),(0,a.assert)(c(t,{fontSize:""}),"Style test")}function u(t,e){return!!(!s.Dom.isTag(t,"font")&&s.Dom.isHTMLElement(t)&&Object.keys(e).every(e=>""!==(0,l.css)(t,e,!0)))}if(o.globalDocument){let t=o.globalDocument.createElement("div");t.style.color="red",(0,a.assert)(u(t,{color:"red"}),"Style test"),(0,a.assert)(!u(t,{font:"Arial",color:"red"}),"Style test"),(0,a.assert)(!u(t,{border:"1px solid #ccc"}),"Style test")}},51640:function(t,e,i){"use strict";i.d(e,{FiniteStateMachine:function(){return s.FiniteStateMachine},WRAP_NODES:function(){return d.WRAP_NODES},extractSelectedPart:function(){return o.extractSelectedPart},getSuitChild:function(){return n.getSuitChild},getSuitParent:function(){return r.getSuitParent},isInsideInvisibleElement:function(){return a.isInsideInvisibleElement},suitableClosest:function(){return l.suitableClosest},toggleAttributes:function(){return u.toggleAttributes},toggleOrderedList:function(){return c.toggleOrderedList},unwrapChildren:function(){return h.unwrapChildren},wrap:function(){return d.wrap}});var o=i(17481),s=i(48729),n=i(10171),r=i(19549);i(9703);var a=i(39608);i(83653),i(95971);var l=i(73019),c=i(34582);i(97110);var u=i(82794),h=i(89081),d=i(73154);i(83335)},39608:function(t,e,i){"use strict";i.d(e,{isInsideInvisibleElement:function(){return s}});var o=i(23211);function s(t,e){return!!o.Dom.closest(t,["style","script"],e)}},83653:function(t,e,i){"use strict";i.d(e,{isNormalNode:function(){return n}});var o=i(23211),s=i(23175);function n(t){return!!(t&&!o.Dom.isEmptyTextNode(t)&&!o.Dom.isTemporary(t)&&!(0,s.isMarker)(t))}},95971:function(t,e,i){"use strict";i.d(e,{elementsEqualAttributes:function(){return c},isSameAttributes:function(){return l}});var o=i(18073),s=i(93640),n=i(28712),r=i(7909),a=i(9703);function l(t,e){return!(0,o.size)(e)||((0,n.assert)(e,"Attrs must be a non-empty object"),Object.keys(e).every(i=>"class"===i||"className"===i?t.classList.contains(e[i]):"style"===i?(0,a.hasSameStyle)(t,e[i]):(0,s.attr)(t,i)===e[i]))}function c(t,e){return t.attributes.length===e.attributes.length&&Array.from(t.attributes).every(t=>(0,r.attrRaw)(e,t.name)===t.value)}},73019:function(t,e,i){"use strict";i.d(e,{isSameStyleChild:function(){return l},isSuitElement:function(){return r},suitableClosest:function(){return a}});var o=i(23211),s=i(9703),n=i(83653);function r(t,e,i,a=!0){if(!e||!(0,n.isNormalNode)(e))return!1;let{element:l,elementIsDefault:c,options:u}=t;if(o.Dom.isList(e)&&t.elementIsList)return!0;let h=o.Dom.isTag(e,l);return!!(h&&!(c&&i)||u.attributes?.style&&(a?(0,s.hasSameStyle)(e,u.attributes.style):(0,s.hasSameStyleKeys)(e,u.attributes.style))&&!t.elementIsList)||!h&&!i&&c&&o.Dom.isInlineBlock(e)}function a(t,e,i){return o.Dom.closest(e,e=>r(t,e,!0,!1),i)}function l(t,e){let{element:i,options:o}=t;if(!e||!(0,n.isNormalNode)(e))return!1;let r=e.nodeName.toLowerCase()===i,a=!!(o.attributes?.style&&(0,s.hasSameStyleKeys)(e,o.attributes?.style));return r&&a}},34582:function(t,e,i){"use strict";i.d(e,{toggleOrderedList:function(){return c}});var o=i(23211),s=i(28712),n=i(17481),r=i(82794),a=i(98394),l=i(97110);function c(t,e,i,o){if(!e)return o;let s=e.parentElement;if(!s)return o;let n=i.e.fire(`${a._PREFIX}BeforeToggleList`,o,t,s);if(void 0!==n)return n;let c=i.e.fire.bind(i.e,`${a._PREFIX}AfterToggleList`);if("unwrap"!==o){let n="change"===(0,r.toggleAttributes)(t,e.parentElement,i,a.INITIAL,!0);if(o===a.REPLACE||n||s.tagName.toLowerCase()!==t.element){let o=u(a.REPLACE,s,e,i,t),n=(0,l.wrapList)(t,o,i);return c(a.REPLACE,n,t),a.REPLACE}}return c("unwrap",u("unwrap",s,e,i,t),t),"unwrap"}function u(t,e,i,r,l){let c=r.e.fire(`${a._PREFIX}BeforeUnwrapList`,t,e,l);return c?((0,s.assert)(o.Dom.isHTMLElement(c),`${a._PREFIX}BeforeUnwrapList hook must return HTMLElement`),c):((0,n.extractSelectedPart)(e,i,r),(0,s.assert)(o.Dom.isHTMLElement(i.parentElement),"Element should be inside the list"),o.Dom.unwrap(i.parentElement),t===a.REPLACE)?i:o.Dom.replace(i,"br"!==r.o.enter.toLowerCase()?r.o.enter:r.createInside.fragment(),r.createInside)}},97110:function(t,e,i){"use strict";i.d(e,{wrapList:function(){return a}});var o=i(23211),s=i(95971),n=i(82794),r=i(98394);function a(t,e,i){let a=i.e.fire(`${r._PREFIX}BeforeWrapList`,r.REPLACE,e,t)??o.Dom.replace(e,"li",i.createInside),l=a.previousElementSibling,c=a.nextElementSibling,u=o.Dom.isTag(l,t.element)?l:null;return u??=o.Dom.isTag(c,t.element)?c:null,o.Dom.isList(u)&&(0,s.isSameAttributes)(u,t.options.attributes)||(u=i.createInside.element(t.element),(0,n.toggleAttributes)(t,u,i,r.INITIAL),o.Dom.before(a,u)),l===u?o.Dom.append(u,a):o.Dom.prepend(u,a),o.Dom.isTag(u.nextElementSibling,t.element)&&(0,s.elementsEqualAttributes)(u,u.nextElementSibling)&&(o.Dom.append(u,Array.from(u.nextElementSibling.childNodes)),o.Dom.safeRemove(u.nextElementSibling)),i.e.fire(`${r._PREFIX}AfterWrapList`,"wrap",u,t),u}},82794:function(t,e,i){"use strict";i.d(e,{toggleAttributes:function(){return m}});var o=i(81937),s=i(23211),n=i(28077),r=i(28686),a=i(19147),l=i(18073),c=i(93640),u=i(80991),h=i(36400),d=i(98394);let p="toggleAttributes";function m(t,e,i,g,_=!1){if(!_&&t.isApplied(e,p))return g;_||t.setApplied(e,p);let{attributes:v}=t.options;return v&&(0,l.size)(v)>0&&Object.keys(v).forEach(p=>{var m,b,y;let w=v[p];switch(p){case"style":m=g,(0,c.assert)((0,r.isPlainObject)(w)&&(0,l.size)(w),"Style must be an object"),Object.keys(w).forEach(r=>{let l=(0,u.cssInline)(e,r),d=w[r];if(""!==l||null!=d){let p,g,v,b;if(p=function(t){if(void 0!==(0,h.dataBind)(t,"shadowRoot"))return(0,h.dataBind)(t,"shadowRoot");let e=(0,n.getContainer)(t),i=o.globalDocument.createElement("iframe");(0,u.css)(i,{width:0,height:0,position:"absolute",border:0}),(0,c.attr)(i,"src","about:blank"),s.Dom.append(e,i);let r=i.contentWindow?.document,a=r?r.body:t.od.body;return(0,h.dataBind)(t,"shadowRoot",a),a}(i),g=i.create.element("div"),(0,u.css)(g,"color",(0,u.css)(i.editor,"color")),v=i.create.element(e.tagName.toLowerCase()),(0,c.attr)(v,"style",(0,c.attr)(e,"style")),s.Dom.append(g,v),s.Dom.append(p,g),b=(0,u.css)(v,r),s.Dom.safeRemove(g),b===(0,a.normalizeCssValue)(r,d)){if(!l)return;_||(0,u.css)(e,r,null),m=f(t,e,m="unset");return}m="change",_||((0,u.css)(e,r,d),m=f(t,e,m))}}),g=m;break;case"className":case"class":let S;b=g,(0,c.assert)((0,r.isString)(w),"Class name must be a string"),S=i.e.fire.bind(i.e,`${d._PREFIX}AfterToggleAttribute`),e.classList.contains(w.toString())?(b="unset",_||(e.classList.remove(w),0===e.classList.length&&((0,c.attr)(e,"class",null),S(b,e,"class",null)))):(b="change",_||(e.classList.add(w),S(b,e,"class",w))),g=b;break;default:let C;y=g,(0,c.assert)((0,r.isString)(w)||(0,r.isNumber)(w)||(0,r.isBoolean)(w)||null==w,"Attribute value must be a string or number or boolean or null"),C=i.e.fire.bind(i.e,`${d._PREFIX}AfterToggleAttribute`),(0,c.attr)(e,p)===(null==w?w:w+"")?(_||(0,c.attr)(e,p,null),y="unset",_||C(y,e,p,w)):(y="change",_||((0,c.attr)(e,p,w),C(y,e,p,w))),g=y}}),g}function f(t,e,i){return(0,c.attr)(e,"style")||((0,c.attr)(e,"style",null),e.tagName.toLowerCase()===t.defaultTag&&(s.Dom.unwrap(e),i="unwrap")),i}},89081:function(t,e,i){"use strict";i.d(e,{unwrapChildren:function(){return a}});var o=i(23211),s=i(93640),n=i(9703),r=i(73019);function a(t,e){let i,a=[],l=[],c=t.options.attributes?.style;if(e.firstChild){let u=o.Dom.eachGen(e),h=u.next();for(;!h.done;){let e=h.value;(0,r.isSuitElement)(t,e,!0)&&(!c||(0,n.hasSameStyleKeys)(e,c))?(void 0===i&&(i=!0),a.push(e)):c&&(0,r.isSameStyleChild)(t,e)?(void 0===i&&(i=!1),l.push(()=>{(0,s.css)(e,Object.keys(c).reduce((t,e)=>(t[e]=null,t),{})),(0,s.attr)(e,"style")||(0,s.attr)(e,"style",null),(0,s.attr)(e,"style")||e.nodeName.toLowerCase()!==t.element||a.push(e)})):o.Dom.isEmptyTextNode(e)||void 0!==i||(i=!1),h=u.next()}}return l.forEach(t=>t()),a.forEach(o.Dom.unwrap),!!i}},83335:function(t,e,i){"use strict";i.d(e,{wrapUnwrappedText:function(){return n}});var o=i(23211),s=i(23175);function n(t,e,i){let n=i.editor,r=i.createInside,a=(t,e="previousSibling")=>{let r=t,a=t;for(;a&&!(0,s.isMarker)(a)&&!o.Dom.isTag(a,i.o.enter)&&(r=a,a=a[e]?a[e]:a.parentNode&&!o.Dom.isBlock(a.parentNode)&&a.parentNode!==n?a.parentNode:null,!o.Dom.isBlock(a)););return r},l=a(e),c=a(e,"nextSibling"),u=i.s.createRange();u.setStartBefore(l),u.setEndAfter(c);let h=u.extractContents(),d=r.element(t.element);return o.Dom.append(d,h),o.Dom.safeInsertNode(u,d),t.elementIsBlock&&o.Dom.isEmpty(d)&&!o.Dom.isTag(d.firstElementChild,"br")&&o.Dom.append(d,r.element("br")),d}},73154:function(t,e,i){"use strict";i.d(e,{wrap:function(){return l}});var o=i(27795),s=i(7909),n=i(80991),r=i(97110),a=i(83335);function l(t,e,i){var l,u,h;let d=(l=t,u=e,h=i,l.elementIsBlock?o.Dom.up(u,t=>o.Dom.isBlock(t)&&!o.Dom.isTag(t,c)&&!Array.from(t.childNodes).some(t=>o.Dom.isBlock(t)),h.editor)||(0,a.wrapUnwrappedText)(l,u,h):((0,s.attr)(u,"size",null),u));if(t.elementIsList)return(0,r.wrapList)(t,d,i);let p=o.Dom.replace(d,t.element,i.createInside,!0);return t.elementIsBlock&&((0,n.css)(p,"fontSize",null),(0,n.css)(p,"fontWeight",null),(0,s.attr)(p,"style")||(0,s.attr)(p,"style",null)),p}let c=new Set(["td","th","tr","tbody","table","li","ul","ol"]);i.d(e,["WRAP_NODES",0,c])},96127:function(t,e,i){"use strict";i.d(e,{ApplyStyle:function(){return r}});var o=i(51640),s=i(98394),n=i(78462);function r(t,e){let{s:i,editor:r}=t;r.firstChild?.normalize();let a=i.fakes(),l=t.s.wrapInTagGen(a),c=l.next();if(c.done)return;let u={collapsed:i.isCollapsed(),mode:s.INITIAL,element:c.value,next:n.states.START,jodit:t,style:e};for(;c&&!c.done;){let t=new o.FiniteStateMachine(n.states.START,n.transactions);for(u.element=c.value;t.getState()!==n.states.END;)u=t.dispatch("exec",u);c=l.next()}i.restoreFakes(a)}},84578:function(t,e,i){"use strict";i.d(e,{CommitStyle:function(){return l}});var o=i(25045),s=i(81937),n=i(57821),r=i(98394),a=i(96127);class l{isApplied(t,e){let i=this.__applyMap.get(t);return!!i&&!!i[e]}setApplied(t,e){let i=this.__applyMap.get(t)??{};i[e]=!0,this.__applyMap.set(t,i)}get elementIsList(){return!!(this.options.element&&s.LIST_TAGS.has(this.options.element))}get element(){return this.options.element||this.defaultTag}get elementIsBlock(){return!!(this.options.element&&s.IS_BLOCK.test(this.options.element))}get isElementCommit(){return!!(this.options.element&&this.options.element!==this.options.defaultTag)}get defaultTag(){return this.options.defaultTag?this.options.defaultTag:this.elementIsBlock?"p":"span"}get elementIsDefault(){return this.element===this.defaultTag}apply(t){let{hooks:e}=this.options,i=e?Object.keys(e):[];try{i.forEach(i=>{t.e.on((0,n.camelCase)(r._PREFIX+"_"+i),e[i])}),(0,a.ApplyStyle)(t,this)}finally{i.forEach(i=>{t.e.off((0,n.camelCase)(r._PREFIX+"_"+i),e[i])}),this.__applyMap=new WeakMap}t.synchronizeValues(),t.e.fire("afterCommitStyle",this)}constructor(t){(0,o._)(this,"options",void 0),(0,o._)(this,"__applyMap",void 0),this.options=t,this.__applyMap=new WeakMap}}},98394:function(t,e,i){"use strict";i.d(e,["INITIAL",0,"initial","REPLACE",0,"replace","_PREFIX",0,"commitStyle"])},78462:function(t,e,i){"use strict";var o=i(81937),s=i(23211),n=i(28712),r=i(51640),a=i(98394);let l={START:"START",ELEMENT:"ELEMENT",UNWRAP:"UNWRAP",UNWRAP_CHILDREN:"UNWRAP_CHILDREN",CHANGE:"CHANGE",REPLACE_DEFAULT:"REPLACE_DEFAULT",LIST:"LIST",TOGGLE_LIST:"TOGGLE_LIST",WRAP:"WRAP",EXTRACT:"EXTRACT",END:"END"},c={[l.START]:{exec(t){let{element:e,jodit:i,style:o,mode:n,collapsed:a}=t;if((0,r.isInsideInvisibleElement)(e,i.editor)||!a&&s.Dom.isEmptyContent(e))return{...t,next:l.END};let c=(0,r.getSuitParent)(o,e,i.editor)||(0,r.getSuitChild)(o,e);if(c)return{...t,next:l.ELEMENT,element:c};let u=(0,r.suitableClosest)(o,e,i.editor);return o.elementIsList&&s.Dom.isList(u)?{...t,next:l.LIST}:u?{...t,next:l.EXTRACT}:{...t,next:"unwrap"!==n?l.UNWRAP_CHILDREN:l.END}}},[l.LIST]:{exec(t){let{element:e,jodit:i,mode:n}=t;if(n!==a.INITIAL&&"unwrap"!==n&&n!==a.REPLACE)return{...t,next:l.END};let r=s.Dom.closest(e,"li",i.editor);return r&&s.Dom.closest(e,o.LIST_TAGS,i.editor)?{...t,element:r,next:l.TOGGLE_LIST}:{...t,next:l.END}}},[l.TOGGLE_LIST]:{exec:t=>({...t,mode:(0,r.toggleOrderedList)(t.style,t.element,t.jodit,t.mode),next:l.END})},[l.EXTRACT]:{exec(t){let{element:e,jodit:i,style:o}=t,a=(0,r.suitableClosest)(o,e,i.editor);return((0,n.assert)(a,"This place should have an element"),!o.elementIsBlock&&o.options.attributes?.style&&s.Dom.isBlock(a))?{...t,next:l.WRAP}:(o.elementIsBlock||(0,r.extractSelectedPart)(a,e,i),{...t,element:a,next:l.ELEMENT})}},[l.UNWRAP_CHILDREN]:{exec(t){let{element:e,style:i}=t;return(0,r.unwrapChildren)(i,e)?{...t,mode:"unwrap",next:l.END}:{...t,next:l.WRAP}}},[l.WRAP]:{exec(t){let{element:e,jodit:i,style:o}=t,s=(0,r.wrap)(o,e,i);return{...t,next:o.elementIsList?l.END:l.CHANGE,mode:"wrap",element:s}}},[l.ELEMENT]:{exec(t){let{style:e,element:i,jodit:o}=t;return(0,r.toggleAttributes)(e,i,o,a.INITIAL,!0)!==a.INITIAL?{...t,next:l.CHANGE}:s.Dom.isTag(i,e.element)?{...t,next:l.UNWRAP}:{...t,next:l.END}}},[l.CHANGE]:{exec(t){let{style:e,element:i,jodit:o,mode:n}=t,a=(0,r.toggleAttributes)(e,i,o,t.mode);return"wrap"!==n&&"unset"===a&&!i.attributes.length&&s.Dom.isTag(i,e.element)?{...t,next:l.UNWRAP}:{...t,mode:a,next:l.END}}},[l.UNWRAP]:{exec(t){let{element:e,style:i,jodit:o}=t;if(e.attributes.length&&s.Dom.isTag(e,i.element))return{...t,next:l.REPLACE_DEFAULT};let n=e.parentElement;return i.elementIsBlock&&!i.elementIsDefault&&n&&n!==o.editor&&s.Dom.isBlock(n)&&!s.Dom.isTag(n,r.WRAP_NODES)?{...t,next:l.REPLACE_DEFAULT}:(s.Dom.unwrap(e),{...t,mode:"unwrap",next:l.END})}},[l.REPLACE_DEFAULT]:{exec:t=>(s.Dom.replace(t.element,t.style.defaultTag,t.jodit.createInside,!0),{...t,mode:a.REPLACE,next:l.END})},[l.END]:{exec:t=>t}};i.d(e,["states",0,l,"transactions",0,c])},8006:function(t,e,i){"use strict";i.d(e,{AsyncStorage:function(){return l}});var o=i(25045),s=i(57821),n=i(91162),r=i(59807),a=i(9505);class l{async set(t,e){let i=await this.provider;return await i.set((0,s.camelCase)(this.prefix+t),e),this}async delete(t){let e=await this.provider;return await e.delete((0,s.camelCase)(this.prefix+t)),this}async get(t){return(await this.provider).get((0,s.camelCase)(this.prefix+t))}async exists(t){return(await this.provider).exists((0,s.camelCase)(this.prefix+t))}async clear(){let t=await this.provider;return await t.clear(),this}async close(){let t=await this.provider;"close"in t&&"function"==typeof t.close&&await t.close()}static makeStorage(t=!1,e,i){let o,s=i?.defaultProvider;return null!=s?new l(Promise.resolve(o="local"===s?(0,r.canUsePersistentStorage)("localStorage")?new r.LocalStorageProvider("Jodit_"+(e||"")):new a.MemoryStorageProvider:"memory"===s?new a.MemoryStorageProvider:s),e):("localStorage"===t||"sessionStorage"===t?(0,r.canUsePersistentStorage)(t)&&(o=new r.LocalStorageProvider("Jodit_"+(e||""),t)):("indexedDB"===t||!0===t)&&(o=(0,n.canUseIndexedDB)().then(t=>t?new n.IndexedDBProvider("Jodit_"+(e||""),"keyValueStore"):new a.MemoryStorageProvider)),o||(o=new a.MemoryStorageProvider),new l(Promise.resolve(o),e))}constructor(t,e){(0,o._)(this,"provider",void 0),(0,o._)(this,"prefix",void 0),this.provider=t,this.prefix="Jodit_",e&&(this.prefix+=e)}}},91162:function(t,e,i){"use strict";i.d(e,{IndexedDBProvider:function(){return n},canUseIndexedDB:function(){return l},clearUseIndexedDBCache:function(){return a}});var o=i(25045),s=i(81937);class n{getDB(){return this.dbPromise||(this.dbPromise=new Promise((t,e)=>{let i=indexedDB.open(this.dbName,this.DB_VERSION);i.onerror=()=>{e(i.error)},i.onsuccess=()=>{t(i.result)},i.onupgradeneeded=t=>{let e=t.target.result;e.objectStoreNames.contains(this.storeName)||e.createObjectStore(this.storeName)}})),this.dbPromise}async performTransaction(t,e){try{let i=(await this.getDB()).transaction([this.storeName],t).objectStore(this.storeName),o=e(i);return new Promise((t,e)=>{o.onsuccess=()=>{t(o.result)},o.onerror=()=>{e(o.error)}})}catch(t){return Promise.reject(t)}}async set(t,e){try{await this.performTransaction("readwrite",i=>i.put(e,t))}catch(t){s.IS_PROD}return this}async delete(t){try{await this.performTransaction("readwrite",e=>e.delete(t))}catch{}return this}async get(t){try{return await this.performTransaction("readonly",e=>e.get(t))}catch{return}}async exists(t){try{let e=await this.performTransaction("readonly",e=>e.get(t));return void 0!==e}catch{return!1}}async clear(){try{await this.performTransaction("readwrite",t=>t.clear())}catch{}return this}async close(){if(this.dbPromise){try{(await this.dbPromise).close()}catch{}this.dbPromise=null}}async keys(){try{let t=await this.performTransaction("readonly",t=>t.getAllKeys());return t&&"object"==typeof t&&"then"in t&&(t=await t),t.map(t=>t+"")}catch{return[]}}async values(){try{let t=await this.performTransaction("readonly",t=>t.getAll());return t&&"object"==typeof t&&"then"in t&&(t=await t),t}catch{return[]}}async entries(){try{let[t,e]=await Promise.all([this.keys(),this.values()]);return t.map((t,i)=>[t,e[i]])}catch{return[]}}constructor(t="JoditDB",e="keyValueStore"){(0,o._)(this,"dbName",void 0),(0,o._)(this,"dbPromise",void 0),(0,o._)(this,"DB_VERSION",void 0),(0,o._)(this,"storeName",void 0),this.dbName=t,this.dbPromise=null,this.DB_VERSION=1,this.storeName=e}}let r=null;function a(){r=null}async function l(){if(null!=r)return r;try{if("u"<typeof indexedDB)return r=!1,!1;let t="___Jodit___"+Math.random().toString(),e=indexedDB.open(t);return r=await new Promise(i=>{e.onerror=()=>{i(!1)},e.onsuccess=()=>{indexedDB.deleteDatabase(t),i(!0)}})}catch{return r=!1,!1}}},59807:function(t,e,i){"use strict";i.d(e,{LocalStorageProvider:function(){return s}});var o=i(25045);class s{get storage(){return"sessionStorage"===this.strategy?sessionStorage:localStorage}set(t,e){try{let i=this.storage.getItem(this.rootKey),o=i?JSON.parse(i):{};o[t]=e,this.storage.setItem(this.rootKey,JSON.stringify(o))}catch{}return this}delete(t){try{let e=this.storage.getItem(this.rootKey);if(e){let i=JSON.parse(e);delete i[t],this.storage.setItem(this.rootKey,JSON.stringify(i))}}catch{}return this}get(t){try{let e=this.storage.getItem(this.rootKey),i=e?JSON.parse(e):{};return void 0!==i[t]?i[t]:void 0}catch{}}exists(t){return null!=this.get(t)}clear(){try{this.storage.removeItem(this.rootKey)}catch{}return this}constructor(t,e="localStorage"){(0,o._)(this,"rootKey",void 0),(0,o._)(this,"strategy",void 0),this.rootKey=t,this.strategy=e}}i.d(e,["canUsePersistentStorage",0,(t="localStorage")=>{let e=new Map;if(e.has(t))return e.get(t);let i="___Jodit___"+Math.random().toString(),o="sessionStorage"===t?sessionStorage:localStorage;try{o.setItem(i,"1");let s="1"===o.getItem(i);return o.removeItem(i),e.set(t,s),s}catch{}return e.set(t,!1),!1}])},9505:function(t,e,i){"use strict";i.d(e,{MemoryStorageProvider:function(){return s}});var o=i(25045);class s{set(t,e){return this.data.set(t,e),this}delete(t){return this.data.delete(t),this}get(t){return this.data.get(t)}exists(t){return this.data.has(t)}clear(){return this.data.clear(),this}constructor(){(0,o._)(this,"data",new Map)}}},25222:function(t,e,i){"use strict";i.d(e,{AsyncStorage:function(){return o.AsyncStorage},IndexedDBProvider:function(){return s.IndexedDBProvider},LocalStorageProvider:function(){return n.LocalStorageProvider},MemoryStorageProvider:function(){return r.MemoryStorageProvider},Storage:function(){return a.Storage},StorageKey:function(){return"Jodit_"},canUseIndexedDB:function(){return s.canUseIndexedDB},canUsePersistentStorage:function(){return n.canUsePersistentStorage},clearUseIndexedDBCache:function(){return s.clearUseIndexedDBCache}});var o=i(8006),s=i(91162),n=i(59807),r=i(9505),a=i(24475)},24475:function(t,e,i){"use strict";i.d(e,{Storage:function(){return l}});var o=i(25045),s=i(57821),n=i(59807),r=i(9505);let a="Jodit_";class l{set(t,e){return this.provider.set((0,s.camelCase)(this.prefix+t),e),this}delete(t){return this.provider.delete((0,s.camelCase)(this.prefix+t)),this}get(t){return this.provider.get((0,s.camelCase)(this.prefix+t))}exists(t){return this.provider.exists((0,s.camelCase)(this.prefix+t))}clear(){return this.provider.clear(),this}static makeStorage(t=!1,e){let i;return"localStorage"===t||"sessionStorage"===t?(0,n.canUsePersistentStorage)(t)&&(i=new n.LocalStorageProvider(a+(e||""),t)):!0===t&&(0,n.canUsePersistentStorage)("localStorage")&&(i=new n.LocalStorageProvider(a+(e||""))),i||(i=new r.MemoryStorageProvider),new l(i,e)}constructor(t,e){(0,o._)(this,"provider",void 0),(0,o._)(this,"prefix",void 0),this.provider=t,this.prefix=a,e&&(this.prefix+=e)}}},80512:function(t,e,i){"use strict";i.d(e,{Dlgs:function(){return a}});var o=i(28077),s=i(28686),n=i(71125),r=i(37333);class a{dlg(t){let e=(0,o.getPopupViewRoot)(this.o,this.container,this.od.body),i=new r.Dialog({language:this.o.language,shadowRoot:this.o.shadowRoot,popupRoot:e,ownerWindow:this.o.ownerWindow,defaultTimeout:this.o.defaultTimeout,direction:this.o.direction,theme:this.o.theme,globalFullSize:this.o.globalFullSize,...t});return(0,n.markOwner)(this,i.container),i.parent=this,i.bindDestruct(this)}confirm(t,e,i){return t=l(t,this),e=l(e,this),r.Confirm.call(this.dlg({closeOnClickOverlay:!0}),t,e,i)}prompt(t,e,i,o,s){return t=l(t,this),e=l(e,this),o=l(o,this),r.Prompt.call(this.dlg({closeOnClickOverlay:!0}),t,e,i,o,s)}alert(t,e,i,o){return t=l(t,this),e=l(e,this),r.Alert.call(this.dlg({closeOnClickOverlay:!0}),t,e,i,o)}}function l(t,e){return(0,s.isString)(t)&&!(0,s.isHTML)(t)&&(t=e.i18n(t)),t}},23183:function(t,e,i){"use strict";i.d(e,{Elms:function(){return s}});var o=i(23211);class s{getElm(t){let e=this.getFullElName(t);return o.Dom.first(this.container,t=>o.Dom.isHTMLElement(t)&&t.classList.contains(e))}getElms(t){let e=this.getFullElName(t),i=[];return o.Dom.each(this.container,t=>{o.Dom.isHTMLElement(t)&&t.classList.contains(e)&&i.push(t)}),i}}},81987:function(t,e,i){"use strict";i.d(e,{Mods:function(){return s}});var o=i(18303);class s{afterSetMod(t,e){}setMod(t,e,i){t=t.toLowerCase();let s=this.mods[t];if(s===e)return this;let n=`${this.componentName}_${t}_`,r=(i||this.container).classList;return null!=s&&r.remove(`${n}${s.toString().toLowerCase()}`),(0,o.isVoid)(e)||""===e||r.add(`${n}${e.toString().toLowerCase()}`),this.mods[t]=e,this.afterSetMod(t,e),this}getMod(t){return this.mods[t]??null}}},53681:function(t,e,i){"use strict";i.d(e,{Button:function(){return v},UIButton:function(){return _}});var o=i(25045),s=i(31635),n=i(69364),r=i(51676),a=i(91672),l=i(68616),c=i(23211),u=i(91565),h=i(85932),d=i(28712),p=i(7909),m=i(96007),f=i(29434);let g=()=>({size:"middle",type:"button",role:"button",name:"",value:"",variant:"initial",disabled:!1,activated:!1,icon:{name:"empty",fill:"",iconURL:"",scale:void 0},tooltip:"",text:"",tabIndex:void 0});class _ extends m.UIElement{className(){return"UIButton"}setState(t){return Object.assign(this.state,t),this}get text(){let t=this.getElm("text");return(0,d.assert)(t,"Text element not found"),t}get icon(){let t=this.getElm("icon");return(0,d.assert)(t,"Icon element not found"),t}onChangeSize(){this.setMod("size",this.state.size)}onChangeType(){(0,p.attr)(this.container,"type",this.state.type)}onChangeRole(){(0,p.attr)(this.container,"role",this.state.role)}updateSize(){let t=(0,a.getComponentClass)("UIList"),e=this.closest(t);if(e){this.state.size=e.buttonSize;return}}onChangeStatus(){this.setMod("variant",this.state.variant)}onChangeText(){this.text.textContent=this.jodit.i18n(this.state.text),this.updateAriaLabel()}onChangeTextSetMode(){this.setMod("text-icons",!!this.state.text.trim().length)}onChangeDisabled(){(0,p.attr)(this.container,"disabled",this.state.disabled||null)}onChangeActivated(){(0,p.attr)(this.container,"aria-pressed",this.state.activated)}onChangeName(){this.container.classList.add(`${this.componentName}_${this.clearName(this.state.name)}`),this.name=this.state.name,(0,p.attr)(this.container,"data-ref",this.state.name),(0,p.attr)(this.container,"ref",this.state.name)}onChangeTooltip(){let t=this.state.tooltip?this.jodit.i18n(this.state.tooltip):null;this.get("j.o.useNativeTooltip")&&(0,p.attr)(this.container,"title",t),(0,p.attr)(this.container,"aria-label",t),this.updateAriaLabel()}updateAriaLabel(){let t=this.state.text.trim().length>0,e=this.state.tooltip?this.jodit.i18n(this.state.tooltip):null;(0,p.attr)(this.container,"aria-label",e),(0,p.attr)(this.button,"aria-label",t?null:e)}onChangeTabIndex(){(0,p.attr)(this.container,"tabindex",this.state.tabIndex)}onChangeIcon(){let t=this.get("j.o.textIcons");if(!0===t||(0,u.isFunction)(t)&&t(this.state.name))return;c.Dom.detach(this.icon);let e=f.Icon.makeIcon(this.j,this.state.icon);e&&c.Dom.append(this.icon,e)}focus(){this.container.focus()}isFocused(){let{activeElement:t}=this.od;return!!(t&&c.Dom.isOrContains(this.container,t))}createContainer(){let t=this.componentName,e=this.j.c.element("button",{class:t,type:"button",role:"button",ariaPressed:!1}),i=this.j.c.span(t+"__icon"),o=this.j.c.span(t+"__text");return c.Dom.append(e,i),c.Dom.append(e,o),e}destruct(){return this.j.e.off(this),this.j.e.off(this.container),super.destruct()}onAction(t){return this.actionHandlers.push(t),this}__onActionFire(t){t.buffer={actionTrigger:this},this.actionHandlers.forEach(e=>e.call(this,t)),this.j.e.fire(this,"click",t)}constructor(t,e){super(t),(0,o._)(this,"isButton",!0),(0,o._)(this,"state",g()),(0,o._)(this,"button",void 0),(0,o._)(this,"actionHandlers",[]),this.button=this.container,this.updateSize(),this.onChangeSize(),this.onChangeStatus(),e&&this.hookStatus(n.STATUSES.ready,()=>{this.setState(e)})}}function v(t,e,i,o){let s=new _(t);return s.state.tabIndex=t.o.allowTabNavigation?0:-1,(0,h.isString)(e)?(s.state.icon.name=e,s.state.name=e,o&&(s.state.variant=o),i&&(s.state.text=i)):s.setState(e),s}(0,s.__decorate)([r.cache],_.prototype,"text",null),(0,s.__decorate)([r.cache],_.prototype,"icon",null),(0,s.__decorate)([(0,l.watch)("state.size",{immediately:!1})],_.prototype,"onChangeSize",null),(0,s.__decorate)([(0,l.watch)("state.type",{immediately:!1})],_.prototype,"onChangeType",null),(0,s.__decorate)([(0,l.watch)("state.role",{immediately:!1})],_.prototype,"onChangeRole",null),(0,s.__decorate)([(0,l.watch)("parentElement")],_.prototype,"updateSize",null),(0,s.__decorate)([(0,l.watch)("state.variant",{immediately:!1})],_.prototype,"onChangeStatus",null),(0,s.__decorate)([(0,l.watch)("state.text",{immediately:!1})],_.prototype,"onChangeText",null),(0,s.__decorate)([(0,l.watch)("state.text",{immediately:!1})],_.prototype,"onChangeTextSetMode",null),(0,s.__decorate)([(0,l.watch)("state.disabled")],_.prototype,"onChangeDisabled",null),(0,s.__decorate)([(0,l.watch)("state.activated")],_.prototype,"onChangeActivated",null),(0,s.__decorate)([(0,l.watch)("state.name",{immediately:!1})],_.prototype,"onChangeName",null),(0,s.__decorate)([(0,l.watch)("state.tooltip",{immediately:!1})],_.prototype,"onChangeTooltip",null),(0,s.__decorate)([(0,l.watch)("state.tabIndex",{immediately:!1})],_.prototype,"onChangeTabIndex",null),(0,s.__decorate)([(0,l.watch)("state.icon",{immediately:!1})],_.prototype,"onChangeIcon",null),(0,s.__decorate)([r.cacheHTML],_.prototype,"createContainer",null),(0,s.__decorate)([(0,l.watch)("button:click")],_.prototype,"__onActionFire",null),_=(0,s.__decorate)([a.component],_),i.d(e,["UIButtonState",0,g])},15367:function(t,e,i){"use strict";i.d(e,{UIButtonGroup:function(){return u}});var o=i(25045),s=i(31635),n=i(91672),r=i(23211),a=i(28712),l=i(53681),c=i(63468);class u extends c.UIGroup{className(){return"UIButtonGroup"}render(t){return`<div>
|
|
14
|
+
`))}h()};t.onprogress=()=>d(!1),t.onload=()=>{d(!0),a=!0,this.__isFulfilled=!0,h()},t.onerror=()=>{u=c.connection("Connection error"),a=!0,this.__isFulfilled=!0,h()},t.onabort=()=>{u=c.abort("Abort connection"),a=!0,this.__isFulfilled=!0,h()},t.withCredentials=e.withCredentials??!1;let{url:p,data:m,method:f}=i;t.open(f,p,!0),e.contentType&&t.setRequestHeader&&t.setRequestHeader("Content-type",e.contentType);let{headers:g}=e;(0,l.isFunction)(g)&&(g=await g.call(this)),g&&t.setRequestHeader&&Object.keys(g).forEach(e=>{t.setRequestHeader(e,g[e])}),t.send(m?this.__buildParams(m):void 0);try{for(;;)if(n.length>0)yield n.shift();else if(a)break;else await new Promise(t=>{r=t})}finally{this.__isFulfilled||this.abort()}if(u)throw u}prepareRequest(){if(!this.o.url)throw c.error("Need URL for AJAX request");let t=this.o.url,e=this.o.data,i=(this.o.method||"get").toLowerCase();if("get"===i&&e&&(0,l.isPlainObject)(e)){let i=t.indexOf("?");if(-1!==i){let o=(0,l.parseQuery)(t.substring(i));t=t.substring(0,i)+"?"+(0,l.buildQuery)({...o,...e})}else t+="?"+(0,l.buildQuery)(this.o.data)}let o={url:t,method:i,data:e};return d.log.splice(100),d.log.push(o),o}destruct(){this.__isDestructed||(this.__isDestructed=!0,this.__activated&&!this.__isFulfilled&&(this.abort(),this.__isFulfilled=!0),this.__async.destruct())}constructor(t,e=u.Config.prototype.defaultAjaxOptions){(0,o._)(this,"__async",new n.Async),(0,o._)(this,"xhr",void 0),(0,o._)(this,"options",void 0),(0,o._)(this,"__isFulfilled",!1),(0,o._)(this,"__activated",!1),(0,o._)(this,"__isDestructed",!1),this.options=(0,l.ConfigProto)(t||{},e),this.xhr=this.o.xhr?this.o.xhr():new XMLHttpRequest}}(0,o._)(d,"log",[]),(0,s.__decorate)([a.autobind],d.prototype,"destruct",null)},37102:function(t,e,i){"use strict";i(5266).Config.prototype.defaultAjaxOptions={successStatuses:[200,201,202],method:"GET",url:"",data:null,contentType:"application/x-www-form-urlencoded; charset=UTF-8",headers:{"X-REQUESTED-WITH":"XMLHttpRequest"},withCredentials:!1,xhr:()=>new XMLHttpRequest}},73714:function(t,e,i){"use strict";i.d(e,{Ajax:function(){return o.Ajax},Response:function(){return s.Response}});var o=i(17338),s=i(32855)},32855:function(t,e,i){"use strict";i.d(e,{Response:function(){return s}});var o=i(25045);class s{get url(){return this.request.url}async json(){return JSON.parse(this.body)}text(){return Promise.resolve(this.body)}async blob(){return this.body}constructor(t,e,i,s){(0,o._)(this,"status",void 0),(0,o._)(this,"statusText",void 0),(0,o._)(this,"request",void 0),(0,o._)(this,"body",void 0),this.request=t,this.status=e,this.statusText=i,this.body=s}}},42259:function(t,e,i){"use strict";i.d(e,{cursorInTheEdgeOfString:function(){return r},findCorrectCurrentNode:function(){return a},moveNodeInsideStart:function(){return n.moveNodeInsideStart}});var o=i(81937),s=i(23211),n=i(89817);function r(t,e,i,s){let n=t.nodeValue?.length?t.nodeValue:"";if(s&&n.replace((0,o.INVISIBLE_SPACE_REG_EXP_END)(),"").length>e)return!0;let r=(0,o.INVISIBLE_SPACE_REG_EXP_START)().exec(n);return i&&(r&&r[0].length<e||!r&&e>0)}function a(t,e,i,o,n,r){if((t=e.startContainer.childNodes[e.startOffset])||(t=e.startContainer.childNodes[e.startOffset-1],i=!0),t&&o&&!s.Dom.isText(t)){if(!i&&s.Dom.isText(t.previousSibling))t=t.previousSibling;else if(n){let e=t=>i?t.lastChild:r(t),o=e(t);for(;o;){if(o&&s.Dom.isText(o)){t=o;break}o=e(o)}}}if(t&&!o&&!s.Dom.isText(t)){let e=t,i=t;do e=e.firstChild,i=i.lastChild;while(e&&i&&!s.Dom.isText(e))e===i&&e&&s.Dom.isText(e)&&(t=e)}return{node:t,rightMode:i}}i(7470)},89817:function(t,e,i){"use strict";i.d(e,{moveNodeInsideStart:function(){return n}});var o=i(81937),s=i(23211);function n(t,e,i){let n=s.Dom.findSibling(e,i),r=s.Dom.findSibling(e,!i);for(;s.Dom.isElement(n)&&!s.Dom.isTag(n,o.INSEPARABLE_TAGS)&&s.Dom.isContentEditable(n,t.editor)&&(!r||!s.Dom.closest(e,s.Dom.isElement,t.editor));)i||!n.firstChild?s.Dom.append(n,e):s.Dom.before(n.firstChild,e),n=s.Dom.sibling(e,i),r=s.Dom.sibling(e,!i)}},7470:function(t,e,i){"use strict";i.d(e,{moveTheNodeAlongTheEdgeOutward:function(){return s}});var o=i(23211);function s(t,e,i){let s=t;for(;s&&s!==i&&!(o.Dom.findSibling(s,e)||o.Dom.isBlock(s.parentElement));)(s=s.parentElement)&&s!==i&&(e?o.Dom.before(s,t):o.Dom.after(s,t))}},59841:function(t,e,i){"use strict";i.d(e,{CommitStyle:function(){return s.CommitStyle},Selection:function(){return o.Selection}});var o=i(98595),s=i(84578)},98595:function(t,e,i){"use strict";i.d(e,{Selection:function(){return m}});var o=i(25045),s=i(31635),n=i(81937),r=i(84839),a=i(23211),l=i(65946),c=i(28686),u=i(28712),h=i(7470),d=i(84578),p=i(42259);class m{get j(){return this.jodit}errorNode(t){if(!a.Dom.isNode(t))throw(0,l.error)("Parameter node must be instance of Node")}get area(){return this.j.editor}get win(){return this.j.ew}get doc(){return this.j.ed}get sel(){return this.j.o.shadowRoot&&(0,c.isFunction)(this.j.o.shadowRoot.getSelection)?this.j.o.shadowRoot.getSelection():this.win.getSelection()}get range(){let t=this.sel;return t&&t.rangeCount?t.getRangeAt(0):this.createRange()}get isInsideArea(){let{sel:t}=this;if(!t?.rangeCount)return!1;for(let e=0;e<t.rangeCount;e+=1)if(!a.Dom.isOrContains(this.area,t.getRangeAt(e).commonAncestorContainer))return!1;return!0}createRange(t=!1){let e=this.doc.createRange();return t&&this.selectRange(e),e}remove(){let t=this.sel,e=this.current();if(t&&e)for(let e=0;e<t.rangeCount;e+=1){let i=t.getRangeAt(e);a.Dom.isOrContains(this.area,i.commonAncestorContainer)&&(i.deleteContents(),i.collapse(!0))}}clear(){this.sel?.rangeCount&&this.sel?.removeAllRanges()}removeNode(t){if(!a.Dom.isOrContains(this.j.editor,t,!0))throw(0,l.error)("Selection.removeNode can remove only editor's children");a.Dom.safeRemove(t),this.j.e.fire("afterRemoveNode",t)}insertCursorAtPoint(t,e){try{let i=this.createRange(),o=this.doc.caretPositionFromPoint?.(t,e),s=o?null:this.doc.caretRangeFromPoint?.(t,e);if(o)i.setStart(o.offsetNode,o.offset);else{if(!s)return!1;i.setStart(s.startContainer,s.startOffset)}if(!a.Dom.isOrContains(this.area,i.startContainer))return!1;return i.collapse(!0),this.removeMarkers(),this.selectRange(i),!0}catch{}return!1}get hasMarkers(){return!!this.markers.length}get markers(){return(0,l.$$)("span[data-"+n.MARKER_CLASS+"]",this.area)}removeMarkers(){a.Dom.safeRemove(...this.markers)}marker(t=!1,e){let i=null;e&&(i=e.cloneRange()).collapse(t);let o=this.j.createInside.span();return o.id=n.MARKER_CLASS+"_"+Number(new Date)+"_"+(Math.random()+"").slice(2),(0,l.css)(o,{lineHeight:"0",display:"none"}),a.Dom.markTemporary(o),(0,l.attr)(o,"data-"+n.MARKER_CLASS,t?"start":"end"),a.Dom.append(o,this.j.createInside.text(n.INVISIBLE_SPACE)),i&&a.Dom.isOrContains(this.area,t?i.startContainer:i.endContainer)&&i.insertNode(o),o}restore(){let t=this.markers,e=new Map(t.map(t=>[t.id,t])),i=[],o=!1;for(let s=0;s<t.length;s+=1){let r=t[s];if("start"!==(0,l.attr)(r,"data-"+n.MARKER_CLASS))continue;o||="true"===(0,l.attr)(r,"data-selection-backward");let c=(0,l.attr)(r,"data-selection-end"),u=c?e.get(c):void 0;!c&&t[s+1]&&"end"===(0,l.attr)(t[s+1],"data-"+n.MARKER_CLASS)&&(u=t[s+1]);let h=this.createRange();if(u)h.setStartAfter(r),h.setEndBefore(u);else{let t=r.previousSibling;a.Dom.isText(t)?h.setStart(t,t.nodeValue?.length??0):h.setStartBefore(r),h.collapse(!0)}i.push(h)}a.Dom.safeRemove(...t),i.length&&this.__selectRanges(i,o)}__isBackward(){let t=this.sel;return!!(t&&1===t.rangeCount&&!t.isCollapsed&&t.anchorNode===t.getRangeAt(0).endContainer&&t.anchorOffset===t.getRangeAt(0).endOffset)}__ranges(){let t=this.sel;return t?Array.from({length:t.rangeCount},(e,i)=>t.getRangeAt(i).cloneRange()):[]}fakes(){if(!this.isInsideArea)return[];let t=this.__isBackward(),e=this.__ranges(),i=e.map(t=>{let e=t.collapsed,i=t.cloneRange();i.collapse(!0);let o=this.j.createInside.fake();a.Dom.safeInsertNode(i,o),t.setStartBefore(o);let s=[o];if(e)t.collapse(!0);else{let e=t.cloneRange();e.collapse(!1);let i=this.j.createInside.fake();a.Dom.safeInsertNode(e,i),t.setEndAfter(i),s.push(i)}return s});return this.__fakeSelections.set(i[0][0],{pairs:i,backward:t}),this.__selectRanges(e,t),i[0]}restoreFakes(t){if(!t.length)return;let e=this.__fakeSelections.get(t[0]);if(this.__fakeSelections.delete(t[0]),this.j.isInDestruct)return;let i=[];for(let o of e?.pairs??[t]){let t=o.filter(t=>t.isConnected&&a.Dom.isOrContains(this.area,t,!0));if(!t.length)continue;let[e,s]=t,n=this.createRange();for(let i of(n.setStartAfter(e),s?n.setEndBefore(s):n.collapse(!0),t))i.parentNode?.firstChild!==i.parentNode?.lastChild&&a.Dom.safeRemove(i);i.push(n)}i.length&&this.__selectRanges(i,e?.backward)}save(t=!1){if(this.hasMarkers)return[];let e=this.sel;if(!e||!e.rangeCount)return[];let i=this.__isBackward(),o=[],s=e.rangeCount,n=[];for(let t=0;s>t;t+=1)if(n[t]=e.getRangeAt(t),!a.Dom.isOrContains(this.area,n[t].commonAncestorContainer))return[];for(let t=0;s>t;t+=1)if(n[t].collapsed){let e=this.marker(!0,n[t]);o[t]={startId:e.id,collapsed:!0,startMarker:e.outerHTML}}else{let e=this.marker(!0,n[t]),r=this.marker(!1,n[t]);s>1&&(0,l.attr)(e,"data-selection-end",r.id),i&&(0,l.attr)(e,"data-selection-backward","true"),o[t]={startId:e.id,endId:r.id,collapsed:!1,startMarker:e.outerHTML,endMarker:r.outerHTML}}if(!t){e.removeAllRanges();for(let t=s-1;t>=0;--t){let i=this.area.querySelector("#"+o[t].startId);if(i){if(o[t].collapsed)n[t].setStartAfter(i),n[t].collapse(!0);else if(n[t].setStartBefore(i),o[t].endId){let e=this.area.querySelector("#"+o[t].endId);e&&n[t].setEndAfter(e)}try{e.addRange(n[t].cloneRange())}catch{}}}}return o}focus(t={preventScroll:!0}){if(!this.isFocused()){let e=(0,l.getScrollParent)(this.j.container),i=e?.scrollTop;this.j.iframe&&"complete"===this.doc.readyState&&this.j.iframe.focus(t),this.win.focus(),this.area.focus(t),i&&e?.scrollTo&&e.scrollTo(0,i);let o=this.sel,s=o?.rangeCount?o?.getRangeAt(0):null;if(!s||!a.Dom.isOrContains(this.area,s.startContainer)){let t=this.createRange();t.setStart(this.area,0),t.collapse(!0),this.selectRange(t,!1)}return this.j.editorIsActive||this.j?.events?.fire("focus"),!0}return!1}isCollapsed(){let t=this.sel;for(let e=0;t&&e<t.rangeCount;e+=1)if(!t.getRangeAt(e).collapsed)return!1;return!0}isFocused(){return this.doc.hasFocus&&this.doc.hasFocus()&&this.area===this.doc.activeElement}current(t=!0){if(this.j.getRealMode()!==n.MODE_WYSIWYG)return null;let e=this.sel;if(!e||0===e.rangeCount)return null;let i=e.getRangeAt(0),o=i.startContainer,s=!1;if(!a.Dom.isOrContains(this.area,o))return null;if(a.Dom.isTag(o,"br")&&e.isCollapsed)return o;if(!a.Dom.isText(o)){let n=(0,p.findCorrectCurrentNode)(o,i,s,e.isCollapsed,t,t=>s?t.lastChild:t.firstChild);o=n.node,s=n.rightMode}return o&&a.Dom.isOrContains(this.area,o)?o:null}insertNode(t,e=!0,i=!0){this.errorNode(t),this.j.e.fire("safeHTML",t);let o=a.Dom.isFragment(t)?t.lastChild:t;if(!o||this.j.isInDestruct)return;!this.isFocused()&&this.j.isEditorMode()&&(this.focus(),this.restore());let s=this.sel;this.j.history.snapshot.transaction(()=>{if(this.isCollapsed()||this.j.execCommand("Delete"),this.j.e.fire("beforeInsertNode",t),!(o=a.Dom.isFragment(t)?t.lastChild:t)||this.j.isInDestruct)return;if(s&&s.rangeCount){let e=s.getRangeAt(0),{firstChild:i}=t;a.Dom.isOrContains(this.area,e.commonAncestorContainer)?a.Dom.safeInsertNode(e,t):a.Dom.append(this.area,t),[()=>i?.previousSibling,()=>i?.previousSibling,()=>i?.previousSibling?.lastChild].forEach(t=>{let e=t();e&&a.Dom.isEmptyTextNode(e)&&a.Dom.safeRemove(e)})}else a.Dom.append(this.area,t);let i=t=>{if(a.Dom.isBlock(t)){let e=t.lastChild;if(e)return i(e)}this.setCursorAfter(t)};e&&(a.Dom.isFragment(t)?o&&i(o):i(t)),this.j.o.scrollToPastedContent&&(0,l.scrollIntoViewIfNeeded)(o??t,this.j.editor,this.doc)}),i&&this.j.events&&this.j.__imdSynchronizeValues(),this.j.events&&this.j.e.fire("afterInsertNode",a.Dom.isFragment(t)?o:t)}insertHTML(t,e=!0){if(""===t)return;let i=this.j.createInside.div(),o=this.j.createInside.fragment();!this.isFocused()&&this.j.isEditorMode()&&(this.focus(),this.restore()),a.Dom.isNode(t)?a.Dom.append(i,t):i.innerHTML=t.toString(),!this.j.isEditorMode()&&!1===this.j.e.fire("insertHTML",i.innerHTML)||i.lastChild&&(a.Dom.moveContent(i,o),this.insertNode(o,e,!1),this.j.__imdSynchronizeValues())}insertImage(t,e=null,i=null){let o=(0,c.isString)(t)?this.j.createInside.element("img"):t;if((0,c.isString)(t)&&(0,l.attr)(o,"src",t),null!=i){let t=i.toString();t&&"auto"!==t&&0>(t+"").indexOf("px")&&0>(t+"").indexOf("%")&&(t+="px"),(0,l.attr)(o,"width",t)}e&&"object"==typeof e&&(0,l.css)(o,e);let s=()=>{(o.naturalHeight<o.offsetHeight||o.naturalWidth<o.offsetWidth)&&(0,l.css)(o,{width:"",height:""}),o.removeEventListener("load",s)};this.j.e.on(o,"load",s),o.complete&&s(),this.insertNode(o),this.j.e.fire("afterInsertImage",o)}eachSelection(t){let e=new Set;for(let i of this.__ranges())a.Dom.isOrContains(this.area,i.commonAncestorContainer)&&this.__eachRange(i,i=>{e.has(i)||(e.add(i),t(i))})}__eachRange(t,e){let i=t.commonAncestorContainer;a.Dom.isHTMLElement(i)||(i=i.parentElement);let o=[],s=t.startOffset,r=i.childNodes.length,u=t.startContainer===this.area?i.childNodes[s<r?s:r-1]:t.startContainer,h=t.endContainer===this.area?i.childNodes[t.endOffset-1]:t.endContainer;a.Dom.isText(u)&&u===t.startContainer&&t.startOffset===u.nodeValue?.length&&u.nextSibling&&(u=u.nextSibling),a.Dom.isText(h)&&h===t.endContainer&&0===t.endOffset&&h.previousSibling&&(h=h.previousSibling);let d=t=>{!t||t===i||a.Dom.isEmptyTextNode(t)||(0,c.isMarker)(t)||o.push(t)};d(u),u!==h&&a.Dom.isOrContains(i,u,!0)&&a.Dom.find(u,t=>(d(t),t===h||t&&t.contains&&t.contains(h)),i,!0,!1);let p=t=>{if(a.Dom.isOrContains(this.j.editor,t,!0)){if(t.nodeName.match(/^(UL|OL)$/))return(0,l.toArray)(t.childNodes).forEach(p);if(a.Dom.isTag(t,"li"))if(t.firstChild)t=t.firstChild;else{let e=this.j.createInside.text(n.INVISIBLE_SPACE);a.Dom.append(t,e),t=e}e(t)}};0===o.length&&(a.Dom.isEmptyTextNode(u)&&o.push(u),u?.firstChild&&o.push(u.firstChild)),o.forEach(p)}cursorInTheEdge(t,e,i=null){let o=!t,s=this.sel,n=s?.rangeCount?s.getRangeAt(0):null;if(!n)return null;let r=t?n.startContainer:n.endContainer,l=t?n.startOffset:n.endOffset;if(i??=r,!a.Dom.isOrContains(e,r)||!a.Dom.isOrContains(e,i))return null;let c=t=>!!(t&&!a.Dom.isTag(t,"br")&&!a.Dom.isEmptyTextNode(t)&&!a.Dom.isTemporary(t)&&!(a.Dom.isElement(t)&&!0===this.j.e.fire("isInvisibleForCursor",t)));if(a.Dom.isText(r)){if((0,p.cursorInTheEdgeOfString)(r,l,t,o))return!1}else{let t=r.childNodes,e=o?t.length:l;for(let i=o?l:0;e>i;i+=1)if(c(t[i]))return!1}let u=i;for(;u&&u!==e;){let e=a.Dom.sibling(u,t);if(!e){u=u.parentNode;continue}if(c(u=e))return!1}return!0}cursorOnTheLeft(t,e){return this.cursorInTheEdge(!0,t,e)}cursorOnTheRight(t,e){return this.cursorInTheEdge(!1,t,e)}setCursorAfter(t){return this.setCursorNearWith(t,!1)}setCursorBefore(t){return this.setCursorNearWith(t,!0)}setCursorNearWith(t,e){if(this.errorNode(t),!a.Dom.isOrContains(this.area,t,!0))throw(0,l.error)("Node element must be in editor");let i=this.createRange(),o=null;return a.Dom.isText(t)?e?i.setStart(t,0):i.setEnd(t,t.nodeValue?.length??0):(o=this.j.createInside.fake(),e?i.setStartBefore(t):i.setEndAfter(t),i.collapse(e),a.Dom.safeInsertNode(i,o),i.selectNode(o)),i.collapse(e),this.selectRange(i),o}setCursorIn(t,e=!1){if(this.errorNode(t),!a.Dom.up(t,t=>t===this.area||t&&t.parentNode===this.area,this.area))throw(0,l.error)("Node element must be in editor");let i=this.createRange(),o=t,s=t;do{if(a.Dom.isText(o)||a.Dom.isTag(o,n.INSEPARABLE_TAGS))break;s=o,o=e?o.firstChild:o.lastChild}while(o)if(!o){let t=this.j.createInside.text(n.INVISIBLE_SPACE);a.Dom.isTag(s,n.INSEPARABLE_TAGS)?o=s:(a.Dom.append(s,t),s=t)}let r=o||s;return a.Dom.isTag(r,n.INSEPARABLE_TAGS)?e||a.Dom.isTag(r,"br")?i.setStartBefore(r):i.setEndAfter(r):i.selectNodeContents(r),i.collapse(e),this.selectRange(i),s}selectRange(t,e=!0){return this.__selectRanges([t],!1,e)}__selectRanges(t,e=!1,i=!0){let o=this.sel;if(i&&!this.isFocused()&&"focus"!==this.j.e.current&&this.focus(),o&&(o.removeAllRanges(),t.forEach(t=>o.addRange(t)),e&&1===t.length)){let e=t[0];o.setBaseAndExtent(e.endContainer,e.endOffset,e.startContainer,e.startOffset)}return this.j.e.fire("changeSelection"),this}select(t,e=!1){if(this.errorNode(t),!a.Dom.up(t,t=>t===this.area||t&&t.parentNode===this.area,this.area))throw(0,l.error)("Node element must be in editor");let i=this.createRange();return i[e||t===this.area?"selectNodeContents":"selectNode"](t),this.selectRange(i)}get html(){let t=this.sel;if(t&&t.rangeCount>0){let t=this.j.createInside.div();return this.__ranges().forEach(e=>a.Dom.append(t,e.cloneContents())),t.innerHTML}return""}__wrapSelectionFragments(t){this.__splitSelectionBoundaries(t);let e=t.commonAncestorContainer;return(a.Dom.isText(e)&&(e=e.parentNode),e)?this.__wrapSelectionRuns(this.__collectContainedNodes(e,t)):[]}__splitSelectionBoundaries(t){let{endContainer:e,endOffset:i}=t;a.Dom.isText(e)&&i>0&&i<(e.nodeValue?.length??0)&&e.splitText(i);let{startContainer:o,startOffset:s}=t;if(a.Dom.isText(o)&&s>0&&s<(o.nodeValue?.length??0)){let e=o.splitText(s);t.setStart(e,0)}this.__normalizeRangeBoundary(t,!0),this.__normalizeRangeBoundary(t,!1)}__normalizeRangeBoundary(t,e){let i=e?t.startContainer:t.endContainer;if(!a.Dom.isText(i))return;let o=e?t.startOffset:t.endOffset,s=i.nodeValue?.length??0;0===o?e?t.setStartBefore(i):t.setEndBefore(i):o>=s&&(e?t.setStartAfter(i):t.setEndAfter(i))}__collectContainedNodes(t,e,i=this.createRange()){let o=[];return(0,l.toArray)(t.childNodes).forEach(t=>{this.__isFullyContained(e,t,i)?o.push(t):t.childNodes.length&&e.intersectsNode(t)&&o.push(...this.__collectContainedNodes(t,e,i))}),o}__isFullyContained(t,e,i){return i.selectNode(e),0>=t.compareBoundaryPoints(Range.START_TO_START,i)&&t.compareBoundaryPoints(Range.END_TO_END,i)>=0}__wrapSelectionRuns(t){let e=[],i=[],o=()=>{i.length&&(e.push(this.__wrapRunInFont(i)),i=[])};return t.forEach(t=>{a.Dom.isElement(t)&&this.__isOrContainsBlock(t)?(o(),e.push(...this.__wrapSelectionRuns((0,l.toArray)(t.childNodes)))):(i.length&&i[i.length-1].parentNode!==t.parentNode&&o(),i.push(t))}),o(),e}__isOrContainsBlock(t){return!!a.Dom.isBlock(t)||(0,l.toArray)(t.childNodes).some(t=>this.__isOrContainsBlock(t))}__wrapRunInFont(t){let e=this.j.createInside.element("font"),[i]=t;return a.Dom.before(i,e),t.forEach(t=>a.Dom.append(e,t)),e}*wrapInTagGen(t){if(this.sel?.rangeCount&&!this.isInsideArea)return;if(this.isCollapsed()){let e=this.jodit.createInside.element("font",n.INVISIBLE_SPACE);this.insertNode(e,!1,!1),t&&t[0]&&a.Dom.append(e,t[0]);try{yield e}finally{a.Dom.unwrap(e)}return}let e=this.__ranges().flatMap(t=>this.__wrapSelectionFragments(t));try{for(let t of e){if(this.j.isInDestruct||!a.Dom.isOrContains(this.area,t,!0))continue;let{firstChild:e,lastChild:i}=t;if(e&&e===i&&(0,c.isMarker)(e)){a.Dom.unwrap(t);continue}e&&(0,c.isMarker)(e)&&a.Dom.before(t,e),i&&(0,c.isMarker)(i)&&a.Dom.after(t,i),yield t,a.Dom.unwrap(t)}}finally{e.forEach(t=>a.Dom.unwrap(t))}}wrapInTag(t){let e=[];for(let i of this.wrapInTagGen())try{if(i.firstChild&&i.firstChild===i.lastChild&&(0,c.isMarker)(i.firstChild))continue;(0,c.isFunction)(t)?t(i):e.push(a.Dom.replace(i,t,this.j.createInside))}finally{let t=i.parentNode;t&&(a.Dom.unwrap(i),a.Dom.isEmpty(t)&&a.Dom.unwrap(t))}return e}commitStyle(t){(0,u.assert)((0,l.size)(t)>0,"Need to pass at least one option"),new d.CommitStyle(t).apply(this.j)}splitSelection(t,e){if(!this.isCollapsed()||!this.isInsideArea||!a.Dom.isOrContains(this.area,t,!0)||!a.Dom.isOrContains(t,this.range.startContainer)||e&&!a.Dom.isOrContains(t,e,!0))return null;let i=this.createRange(),o=this.range;i.setStartBefore(t);let s=this.cursorOnTheRight(t,e),r=this.cursorOnTheLeft(t,e),l=this.j.createInside.element("br"),c=this.j.createInside.fake(),h=c.cloneNode();try{if(s||r){e?a.Dom.before(e,l):a.Dom.safeInsertNode(o,l);let t=(t,e)=>{let i=e(t);for(;i;){let t=e(i);if(i&&(a.Dom.isTag(i,"br")||a.Dom.isEmptyTextNode(i)))a.Dom.safeRemove(i);else break;i=t}};t(l,t=>t.nextSibling),t(l,t=>t.previousSibling),a.Dom.after(l,h),a.Dom.before(l,c),s?(i.setEndBefore(l),o.setEndBefore(l)):(i.setEndAfter(l),o.setEndAfter(l))}else i.setEnd(o.startContainer,o.startOffset);let d=i.extractContents(),p=t=>a.Dom.each(t,t=>a.Dom.isEmptyTextNode(t)&&a.Dom.safeRemove(t));(0,u.assert)(t.parentNode,"Splitting fails");try{if(p(d),p(t),a.Dom.before(t,d),!e&&s&&l?.parentNode){let t=this.createRange();t.setStartBefore(l),this.selectRange(t)}}catch(t){if(!n.IS_PROD)throw t}let m=t=>{let e=t?.parentNode;e&&e.firstChild===e.lastChild&&a.Dom.append(e,l.cloneNode())};m(c),m(h)}finally{a.Dom.safeRemove(c),a.Dom.safeRemove(h)}return t.previousElementSibling}expandSelection(){if(this.isCollapsed()||!this.isInsideArea)return this;let t=this.__isBackward(),e=this.__ranges().map(t=>this.__expandRange(t));return this.__selectRanges(e,t),this}__expandRange(t){let e=t.cloneRange();if(!a.Dom.isOrContains(this.j.editor,t.commonAncestorContainer,!0))return t;let i=e=>{let i=this.j.createInside.fake(),o=t.cloneRange();return o.collapse(e),a.Dom.safeInsertNode(o,i),(0,h.moveTheNodeAlongTheEdgeOutward)(i,e,this.j.editor),i},o=i(!0),s=i(!1);e.setStartAfter(o),e.setEndBefore(s);let n=a.Dom.findSibling(o,!1),r=a.Dom.findSibling(s,!0);if(n!==r){let t=a.Dom.isElement(n)&&a.Dom.isOrContains(n,s),i=!t&&a.Dom.isElement(r)&&a.Dom.isOrContains(r,o);if(t||i){let i=t?n:r,l=i;for(;a.Dom.isElement(i);)(i=t?i.firstElementChild:i.lastElementChild)&&(t?a.Dom.isOrContains(i,s):a.Dom.isOrContains(i,o))&&(l=i);t?e.setStart(l,0):e.setEnd(l,l.childNodes.length)}}if(a.Dom.safeRemove(o,s),e.collapsed)throw(0,l.error)("Selection is collapsed");return e}constructor(t){(0,o._)(this,"jodit",void 0),(0,o._)(this,"__fakeSelections",void 0),this.jodit=t,this.__fakeSelections=new WeakMap,t.e.on("removeMarkers",()=>{this.removeMarkers()})}}(0,s.__decorate)([r.autobind],m.prototype,"createRange",null),(0,s.__decorate)([r.autobind],m.prototype,"focus",null),(0,s.__decorate)([r.autobind],m.prototype,"setCursorAfter",null),(0,s.__decorate)([r.autobind],m.prototype,"setCursorBefore",null),(0,s.__decorate)([r.autobind],m.prototype,"setCursorIn",null)},17481:function(t,e,i){"use strict";i.d(e,{extractSelectedPart:function(){return r}});var o=i(23211),s=i(23175),n=i(71125);function r(t,e,i){let o=i.s.createRange(),n=(0,s.isMarker)(e.previousSibling)?e.previousSibling:e;o.setStartBefore(t),o.setEndBefore(n),a(t,o,!0);let r=(0,s.isMarker)(e.nextSibling)?e.nextSibling:e;o.setStartAfter(r),o.setEndAfter(t),a(t,o,!1)}function a(t,e,i){let s=e.extractContents();o.Dom.isEmpty(s)&&s.firstChild&&o.Dom.unwrap(s.firstChild),t.parentNode&&(0,n.call)(i?o.Dom.before:o.Dom.after,t,s)}},48729:function(t,e,i){"use strict";i.d(e,{FiniteStateMachine:function(){return a}});var o=i(25045),s=i(81937),n=i(85932),r=i(28712);class a{setState(t){(0,r.assert)(!this.__previewsStates.has(t),"Circled states"),this.__previewsStates.add(t),this.__state=t}getState(){return this.__state}disableSilent(){this.silent=!1}dispatch(t,e){let i=this.transitions[this.getState()][t];if(i){let t=i.call(this,e);return(0,r.assert)(t&&t!==e,"Action should return new value"),(0,r.assert)((0,n.isString)(t.next),"Value should contain the next state"),(0,r.assert)(t.next!==this.getState(),"The new state should not be equal to the old one."),this.setState(t.next),s.IS_PROD||this.silent,t}throw Error(`invalid action: ${this.getState()}.${t.toString()}`)}constructor(t,e){(0,o._)(this,"transitions",void 0),(0,o._)(this,"__state",void 0),(0,o._)(this,"silent",void 0),(0,o._)(this,"__previewsStates",void 0),this.transitions=e,this.silent=!0,this.__previewsStates=new Set,this.setState(t)}}},10171:function(t,e,i){"use strict";i.d(e,{getSuitChild:function(){return r}});var o=i(23211),s=i(83653),n=i(73019);function r(t,e){let{firstChild:i}=e;for(;i&&!(0,s.isNormalNode)(i);)if(!(i=i.nextSibling))return null;return i&&!o.Dom.next(i,s.isNormalNode,e)&&(0,n.isSuitElement)(t,i,!1)?i:null}},19549:function(t,e,i){"use strict";i.d(e,{getSuitParent:function(){return function t(e,i,r){let{parentNode:a}=i;return a===r||!o.Dom.isHTMLElement(a)||o.Dom.next(i,s.isNormalNode,a)||o.Dom.prev(i,s.isNormalNode,a)?null:e.isElementCommit&&e.elementIsBlock&&!o.Dom.isBlock(a)?t(e,a,r):o.Dom.isTag(a,"li")&&!e.isElementCommit&&e.options.attributes?.style||(0,n.isSuitElement)(e,a,!1)&&(!o.Dom.isBlock(a)||e.elementIsBlock)?a:e.isElementCommit&&!o.Dom.isBlock(a)?t(e,a,r):null}}});var o=i(23211),s=i(83653),n=i(73019)},9703:function(t,e,i){"use strict";i.d(e,{hasSameStyle:function(){return c},hasSameStyleKeys:function(){return u}});var o=i(81937),s=i(23211),n=i(18303),r=i(19147),a=i(28712),l=i(80991);function c(t,e){return!!(!s.Dom.isTag(t,"font")&&s.Dom.isHTMLElement(t)&&Object.keys(e).every(i=>{let o=(0,l.css)(t,i,!0);return""===o&&(""===e[i]||null==e[i])||!(0,n.isVoid)(o)&&""!==o&&!(0,n.isVoid)(e[i])&&(0,r.normalizeCssValue)(i,e[i]).toString().toLowerCase()===o.toString().toLowerCase()}))}if(o.globalDocument){let t=o.globalDocument.createElement("div");t.style.color="red",(0,a.assert)(c(t,{color:"red"}),"Style test"),(0,a.assert)(c(t,{fontSize:null}),"Style test"),(0,a.assert)(c(t,{fontSize:""}),"Style test")}function u(t,e){return!!(!s.Dom.isTag(t,"font")&&s.Dom.isHTMLElement(t)&&Object.keys(e).every(e=>""!==(0,l.css)(t,e,!0)))}if(o.globalDocument){let t=o.globalDocument.createElement("div");t.style.color="red",(0,a.assert)(u(t,{color:"red"}),"Style test"),(0,a.assert)(!u(t,{font:"Arial",color:"red"}),"Style test"),(0,a.assert)(!u(t,{border:"1px solid #ccc"}),"Style test")}},51640:function(t,e,i){"use strict";i.d(e,{FiniteStateMachine:function(){return s.FiniteStateMachine},WRAP_NODES:function(){return d.WRAP_NODES},extractSelectedPart:function(){return o.extractSelectedPart},getSuitChild:function(){return n.getSuitChild},getSuitParent:function(){return r.getSuitParent},isInsideInvisibleElement:function(){return a.isInsideInvisibleElement},suitableClosest:function(){return l.suitableClosest},toggleAttributes:function(){return u.toggleAttributes},toggleOrderedList:function(){return c.toggleOrderedList},unwrapChildren:function(){return h.unwrapChildren},wrap:function(){return d.wrap}});var o=i(17481),s=i(48729),n=i(10171),r=i(19549);i(9703);var a=i(39608);i(83653),i(95971);var l=i(73019),c=i(34582);i(97110);var u=i(82794),h=i(89081),d=i(73154);i(83335)},39608:function(t,e,i){"use strict";i.d(e,{isInsideInvisibleElement:function(){return s}});var o=i(23211);function s(t,e){return!!o.Dom.closest(t,["style","script"],e)}},83653:function(t,e,i){"use strict";i.d(e,{isNormalNode:function(){return n}});var o=i(23211),s=i(23175);function n(t){return!!(t&&!o.Dom.isEmptyTextNode(t)&&!o.Dom.isTemporary(t)&&!(0,s.isMarker)(t))}},95971:function(t,e,i){"use strict";i.d(e,{elementsEqualAttributes:function(){return c},isSameAttributes:function(){return l}});var o=i(18073),s=i(93640),n=i(28712),r=i(7909),a=i(9703);function l(t,e){return!(0,o.size)(e)||((0,n.assert)(e,"Attrs must be a non-empty object"),Object.keys(e).every(i=>{if("class"===i||"className"===i)return((e[i]+"").match(/[^\t\n\f\r ]+/g)??[]).every(e=>t.classList.contains(e));if("style"===i)return(0,a.hasSameStyle)(t,e[i]);let o=e[i];return(0,s.attr)(t,i)===(null==o?o:o+"")}))}function c(t,e){return t.attributes.length===e.attributes.length&&Array.from(t.attributes).every(t=>(0,r.attrRaw)(e,t.name)===t.value)}},73019:function(t,e,i){"use strict";i.d(e,{isSuitElement:function(){return r},suitableClosest:function(){return a}});var o=i(23211),s=i(9703),n=i(83653);function r(t,e,i,a=!0){if(!e||!(0,n.isNormalNode)(e))return!1;let{element:l,elementIsDefault:c,options:u}=t;if(o.Dom.isList(e)&&t.elementIsList)return!0;let h=o.Dom.isTag(e,l);return!!(h&&!(c&&i)||u.attributes?.style&&(a?(0,s.hasSameStyle)(e,u.attributes.style):(0,s.hasSameStyleKeys)(e,u.attributes.style))&&!t.elementIsList)||!h&&!i&&c&&o.Dom.isInlineBlock(e)}function a(t,e,i){return o.Dom.closest(e,e=>r(t,e,!0,!1),i)}},34582:function(t,e,i){"use strict";i.d(e,{toggleOrderedList:function(){return c}});var o=i(23211),s=i(28712),n=i(17481),r=i(82794),a=i(98394),l=i(97110);function c(t,e,i,o){if(!e)return o;let s=e.parentElement;if(!s)return o;let n=i.e.fire(`${a._PREFIX}BeforeToggleList`,o,t,s);if(void 0!==n)return n;let c=i.e.fire.bind(i.e,`${a._PREFIX}AfterToggleList`);if("unwrap"!==o){let n="change"===(0,r.toggleAttributes)(t,e.parentElement,i,a.INITIAL,!0);if(o===a.REPLACE||n||s.tagName.toLowerCase()!==t.element){let o=u(a.REPLACE,s,e,i,t),n=(0,l.wrapList)(t,o,i);return c(a.REPLACE,n,t),a.REPLACE}}return c("unwrap",u("unwrap",s,e,i,t),t),"unwrap"}function u(t,e,i,r,l){let c=r.e.fire(`${a._PREFIX}BeforeUnwrapList`,t,e,l);return c?((0,s.assert)(o.Dom.isHTMLElement(c),`${a._PREFIX}BeforeUnwrapList hook must return HTMLElement`),c):((0,n.extractSelectedPart)(e,i,r),(0,s.assert)(o.Dom.isHTMLElement(i.parentElement),"Element should be inside the list"),o.Dom.unwrap(i.parentElement),t===a.REPLACE)?i:o.Dom.replace(i,"br"!==r.o.enter.toLowerCase()?r.o.enter:r.createInside.fragment(),r.createInside)}},97110:function(t,e,i){"use strict";i.d(e,{wrapList:function(){return a}});var o=i(23211),s=i(95971),n=i(82794),r=i(98394);function a(t,e,i){let a=i.e.fire(`${r._PREFIX}BeforeWrapList`,r.REPLACE,e,t)??o.Dom.replace(e,"li",i.createInside),l=a.previousElementSibling,c=a.nextElementSibling,u=o.Dom.isTag(l,t.element)?l:null;return u??=o.Dom.isTag(c,t.element)?c:null,o.Dom.isList(u)&&(0,s.isSameAttributes)(u,t.options.attributes)||(u=i.createInside.element(t.element),(0,n.toggleAttributes)(t,u,i,r.INITIAL),o.Dom.before(a,u)),l===u?o.Dom.append(u,a):o.Dom.prepend(u,a),o.Dom.isTag(u.nextElementSibling,t.element)&&(0,s.elementsEqualAttributes)(u,u.nextElementSibling)&&(o.Dom.append(u,Array.from(u.nextElementSibling.childNodes)),o.Dom.safeRemove(u.nextElementSibling)),i.e.fire(`${r._PREFIX}AfterWrapList`,"wrap",u,t),u}},82794:function(t,e,i){"use strict";i.d(e,{toggleAttributes:function(){return m}});var o=i(81937),s=i(23211),n=i(28077),r=i(28686),a=i(19147),l=i(18073),c=i(93640),u=i(80991),h=i(36400),d=i(98394);let p="toggleAttributes";function m(t,e,i,f,g=!1){var _;if(!g&&t.isApplied(e,p))return f;g||t.setApplied(e,p);let{attributes:v}=t.options;return v&&(0,l.size)(v)>0&&Object.keys(v).forEach(t=>{var p,m;let _=v[t];switch(t){case"style":p=f,(0,c.assert)((0,r.isPlainObject)(_)&&(0,l.size)(_),"Style must be an object"),Object.keys(_).forEach(t=>{let r=(0,u.cssInline)(e,t),l=_[t];if(""!==r||null!=l){let d,m,f,_;if(null==l||""===l){r&&(g||(0,u.css)(e,t,null),p="change");return}if(d=function(t){if(void 0!==(0,h.dataBind)(t,"shadowRoot"))return(0,h.dataBind)(t,"shadowRoot");let e=(0,n.getContainer)(t),i=o.globalDocument.createElement("iframe");(0,u.css)(i,{width:0,height:0,position:"absolute",border:0}),(0,c.attr)(i,"src","about:blank"),s.Dom.append(e,i);let r=i.contentWindow?.document,a=r?r.body:t.od.body;return(0,h.dataBind)(t,"shadowRoot",a),a}(i),m=i.create.element("div"),(0,u.css)(m,"color",(0,u.css)(i.editor,"color")),f=i.create.element(e.tagName.toLowerCase()),(0,c.attr)(f,"style",(0,c.attr)(e,"style")),s.Dom.append(m,f),s.Dom.append(d,m),_=(0,u.css)(f,t),s.Dom.safeRemove(m),_===(0,a.normalizeCssValue)(t,l)){if(!r)return;g||(0,u.css)(e,t,null),p="unset";return}p="change",g||(0,u.css)(e,t,l)}}),f=p;break;case"className":case"class":f=function(t,e,i,o,s){(0,c.assert)((0,r.isString)(e),"Class name must be a string");let n=e.match(/[^\t\n\f\r ]+/g)??[];if(!n.length)return o;let a=t.e.fire.bind(t.e,`${d._PREFIX}AfterToggleAttribute`);return n.every(t=>i.classList.contains(t))?(o="unset",s||(i.classList.remove(...n),0===i.classList.length&&(0,c.attr)(i,"class",null),a(o,i,"class",(0,c.attr)(i,"class")))):(o="change",s||(i.classList.add(...n),a(o,i,"class",e))),o}(i,_,e,f,g);break;default:let b;m=f,(0,c.assert)((0,r.isString)(_)||(0,r.isNumber)(_)||(0,r.isBoolean)(_)||null==_,"Attribute value must be a string or number or boolean or null"),b=i.e.fire.bind(i.e,`${d._PREFIX}AfterToggleAttribute`),(0,c.attr)(e,t)===(null==_?_:_+"")?(g||(0,c.attr)(e,t,null),m="unset",g||b(m,e,t,_)):(m="change",g||((0,c.attr)(e,t,_),b(m,e,t,_))),f=m}}),!g&&v?.style?(_=f,!(0,c.attr)(e,"style")&&((0,c.attr)(e,"style",null),e.attributes.length||e.tagName.toLowerCase()!==t.defaultTag||(s.Dom.unwrap(e),_="unwrap")),_):f}},89081:function(t,e,i){"use strict";i.d(e,{unwrapChildren:function(){return a}});var o=i(23211),s=i(93640),n=i(9703),r=i(73019);function a(t,e){let i,a=[],l=[],c=t.options.attributes?.style,u=Object.keys(c??{}),h={};u.forEach(t=>{h[t]=null});let d=e=>{(0,s.css)(e,h),(0,s.attr)(e,"style")||(0,s.attr)(e,"style",null),!e.attributes.length&&o.Dom.isTag(e,t.element)&&a.push(e)};for(let h of o.Dom.eachGen(e))o.Dom.isContentEditable(h,e)&&((0,r.isSuitElement)(t,h,!0)&&(!c||(0,n.hasSameStyleKeys)(h,c))?(void 0===i&&(i=!0),c?l.push(()=>d(h)):a.push(h)):c&&o.Dom.isHTMLElement(h)&&u.some(t=>""!==(0,s.css)(h,t,!0))?(void 0===i&&(i=!1),l.push(()=>d(h))):o.Dom.isEmptyTextNode(h)||void 0!==i||(i=!1));return l.forEach(t=>t()),a.forEach(o.Dom.unwrap),!!i}},83335:function(t,e,i){"use strict";i.d(e,{wrapUnwrappedText:function(){return n}});var o=i(23211),s=i(23175);function n(t,e,i){let n=i.editor,r=i.createInside,a=(t,e="previousSibling")=>{let r=t,a=t;for(;a&&!(0,s.isMarker)(a)&&!o.Dom.isTag(a,i.o.enter)&&(r=a,a=a[e]?a[e]:a.parentNode&&!o.Dom.isBlock(a.parentNode)&&a.parentNode!==n?a.parentNode:null,!o.Dom.isBlock(a)););return r},l=a(e),c=a(e,"nextSibling"),u=i.s.createRange();u.setStartBefore(l),u.setEndAfter(c);let h=u.extractContents(),d=r.element(t.element);return o.Dom.append(d,h),o.Dom.safeInsertNode(u,d),t.elementIsBlock&&o.Dom.isEmpty(d)&&!o.Dom.isTag(d.firstElementChild,"br")&&o.Dom.append(d,r.element("br")),d}},73154:function(t,e,i){"use strict";i.d(e,{wrap:function(){return l}});var o=i(27795),s=i(7909),n=i(80991),r=i(97110),a=i(83335);function l(t,e,i){var l,u,h;let d=(l=t,u=e,h=i,l.elementIsBlock?o.Dom.up(u,t=>o.Dom.isBlock(t)&&!o.Dom.isTag(t,c)&&!Array.from(t.childNodes).some(t=>o.Dom.isBlock(t)),h.editor)||(0,a.wrapUnwrappedText)(l,u,h):((0,s.attr)(u,"size",null),u));if(t.elementIsList)return(0,r.wrapList)(t,d,i);let p=o.Dom.replace(d,t.element,i.createInside,!0);return t.elementIsBlock&&((0,n.css)(p,"fontSize",null),(0,n.css)(p,"fontWeight",null),(0,s.attr)(p,"style")||(0,s.attr)(p,"style",null)),p}let c=new Set(["td","th","tr","tbody","table","li","ul","ol"]);i.d(e,["WRAP_NODES",0,c])},96127:function(t,e,i){"use strict";i.d(e,{ApplyStyle:function(){return r}});var o=i(51640),s=i(98394),n=i(78462);function r(t,e){let{s:i,editor:r}=t;r.firstChild?.normalize();let a=i.fakes(),l=i.isCollapsed(),c=s.INITIAL;try{for(let s of i.wrapInTagGen(a)){let i={collapsed:l,mode:c,element:s,next:n.states.START,jodit:t,style:e},r=new o.FiniteStateMachine(n.states.START,n.transactions);for(;!t.isInDestruct&&r.getState()!==n.states.END;)i=r.dispatch("exec",i);c=i.mode}}finally{i.restoreFakes(a)}}},84578:function(t,e,i){"use strict";i.d(e,{CommitStyle:function(){return l}});var o=i(25045),s=i(81937),n=i(57821),r=i(98394),a=i(96127);class l{isApplied(t,e){let i=this.__applyMap.get(t);return!!i&&!!i[e]}setApplied(t,e){let i=this.__applyMap.get(t)??{};i[e]=!0,this.__applyMap.set(t,i)}get elementIsList(){return!!(this.options.element&&s.LIST_TAGS.has(this.options.element))}get element(){return this.options.element||this.defaultTag}get elementIsBlock(){return!!(this.options.element&&s.IS_BLOCK.test(this.options.element))}get isElementCommit(){return!!(this.options.element&&this.options.element!==this.options.defaultTag)}get defaultTag(){return this.options.defaultTag?this.options.defaultTag:this.elementIsBlock?"p":"span"}get elementIsDefault(){return this.element===this.defaultTag}apply(t){let{hooks:e}=this.options,i=e?Object.keys(e):[];try{i.forEach(i=>{t.e.on((0,n.camelCase)(r._PREFIX+"_"+i),e[i])}),(0,a.ApplyStyle)(t,this)}finally{i.forEach(i=>{t.e.off((0,n.camelCase)(r._PREFIX+"_"+i),e[i])}),this.__applyMap=new WeakMap}t.isInDestruct||(t.synchronizeValues(),t.e.fire("afterCommitStyle",this))}constructor(t){(0,o._)(this,"options",void 0),(0,o._)(this,"__applyMap",void 0),this.options=t,this.__applyMap=new WeakMap}}},98394:function(t,e,i){"use strict";i.d(e,["INITIAL",0,"initial","REPLACE",0,"replace","_PREFIX",0,"commitStyle"])},78462:function(t,e,i){"use strict";var o=i(81937),s=i(23211),n=i(28712),r=i(51640),a=i(98394);let l={START:"START",ELEMENT:"ELEMENT",UNWRAP:"UNWRAP",UNWRAP_CHILDREN:"UNWRAP_CHILDREN",CHANGE:"CHANGE",REPLACE_DEFAULT:"REPLACE_DEFAULT",LIST:"LIST",TOGGLE_LIST:"TOGGLE_LIST",WRAP:"WRAP",EXTRACT:"EXTRACT",END:"END"},c={[l.START]:{exec(t){let{element:e,jodit:i,style:o,mode:n,collapsed:a}=t;if(!s.Dom.isContentEditable(e,i.editor)||(0,r.isInsideInvisibleElement)(e,i.editor)||!a&&s.Dom.isEmptyContent(e))return{...t,next:l.END};let c=(0,r.getSuitParent)(o,e,i.editor)||(0,r.getSuitChild)(o,e);if(c)return{...t,next:l.ELEMENT,element:c};let u=(0,r.suitableClosest)(o,e,i.editor);return o.elementIsList&&s.Dom.isList(u)?{...t,next:l.LIST}:u?{...t,next:l.EXTRACT}:{...t,next:"unwrap"!==n?l.UNWRAP_CHILDREN:l.END}}},[l.LIST]:{exec(t){let{element:e,jodit:i,mode:n}=t;if(n!==a.INITIAL&&"unwrap"!==n&&n!==a.REPLACE)return{...t,next:l.END};let r=s.Dom.closest(e,"li",i.editor);return r&&s.Dom.closest(e,o.LIST_TAGS,i.editor)?{...t,element:r,next:l.TOGGLE_LIST}:{...t,next:l.END}}},[l.TOGGLE_LIST]:{exec:t=>({...t,mode:(0,r.toggleOrderedList)(t.style,t.element,t.jodit,t.mode),next:l.END})},[l.EXTRACT]:{exec(t){let{element:e,jodit:i,style:o}=t,a=(0,r.suitableClosest)(o,e,i.editor);return((0,n.assert)(a,"This place should have an element"),!o.elementIsBlock&&o.options.attributes?.style&&s.Dom.isBlock(a))?{...t,next:l.WRAP}:(o.elementIsBlock||(0,r.extractSelectedPart)(a,e,i),{...t,element:a,next:l.ELEMENT})}},[l.UNWRAP_CHILDREN]:{exec(t){let{element:e,style:i}=t;return(0,r.unwrapChildren)(i,e)?{...t,mode:"unwrap",next:l.END}:{...t,next:l.WRAP}}},[l.WRAP]:{exec(t){let{element:e,jodit:i,style:o}=t,s=(0,r.wrap)(o,e,i);return{...t,next:o.elementIsList?l.END:l.CHANGE,mode:"wrap",element:s}}},[l.ELEMENT]:{exec(t){let{style:e,element:i,jodit:o}=t;return(0,r.toggleAttributes)(e,i,o,a.INITIAL,!0)!==a.INITIAL?{...t,next:l.CHANGE}:s.Dom.isTag(i,e.element)?{...t,next:l.UNWRAP}:{...t,next:l.END}}},[l.CHANGE]:{exec(t){let{style:e,element:i,jodit:o,mode:n}=t,a=(0,r.toggleAttributes)(e,i,o,t.mode);return"wrap"!==n&&"unset"===a&&!i.attributes.length&&s.Dom.isTag(i,e.element)?{...t,next:l.UNWRAP}:{...t,mode:a,next:l.END}}},[l.UNWRAP]:{exec(t){let{element:e,style:i,jodit:o}=t;if(e.attributes.length&&s.Dom.isTag(e,i.element))return{...t,next:l.REPLACE_DEFAULT};let n=e.parentElement;return i.elementIsBlock&&!i.elementIsDefault&&n&&n!==o.editor&&s.Dom.isBlock(n)&&!s.Dom.isTag(n,r.WRAP_NODES)?{...t,next:l.REPLACE_DEFAULT}:(s.Dom.unwrap(e),{...t,mode:"unwrap",next:l.END})}},[l.REPLACE_DEFAULT]:{exec:t=>(s.Dom.replace(t.element,t.style.defaultTag,t.jodit.createInside,!0),{...t,mode:a.REPLACE,next:l.END})},[l.END]:{exec:t=>t}};i.d(e,["states",0,l,"transactions",0,c])},8006:function(t,e,i){"use strict";i.d(e,{AsyncStorage:function(){return l}});var o=i(25045),s=i(57821),n=i(91162),r=i(59807),a=i(9505);class l{async set(t,e){let i=await this.provider;return await i.set((0,s.camelCase)(this.prefix+t),e),this}async delete(t){let e=await this.provider;return await e.delete((0,s.camelCase)(this.prefix+t)),this}async get(t){return(await this.provider).get((0,s.camelCase)(this.prefix+t))}async exists(t){return(await this.provider).exists((0,s.camelCase)(this.prefix+t))}async clear(){let t=await this.provider;return await t.clear(),this}async close(){let t=await this.provider;"close"in t&&"function"==typeof t.close&&await t.close()}static makeStorage(t=!1,e,i){let o,s=i?.defaultProvider;return null!=s?new l(Promise.resolve(o="local"===s?(0,r.canUsePersistentStorage)("localStorage")?new r.LocalStorageProvider("Jodit_"+(e||"")):new a.MemoryStorageProvider:"memory"===s?new a.MemoryStorageProvider:s),e):("localStorage"===t||"sessionStorage"===t?(0,r.canUsePersistentStorage)(t)&&(o=new r.LocalStorageProvider("Jodit_"+(e||""),t)):("indexedDB"===t||!0===t)&&(o=(0,n.canUseIndexedDB)().then(t=>t?new n.IndexedDBProvider("Jodit_"+(e||""),"keyValueStore"):new a.MemoryStorageProvider)),o||(o=new a.MemoryStorageProvider),new l(Promise.resolve(o),e))}constructor(t,e){(0,o._)(this,"provider",void 0),(0,o._)(this,"prefix",void 0),this.provider=t,this.prefix="Jodit_",e&&(this.prefix+=e)}}},91162:function(t,e,i){"use strict";i.d(e,{IndexedDBProvider:function(){return n},canUseIndexedDB:function(){return l},clearUseIndexedDBCache:function(){return a}});var o=i(25045),s=i(81937);class n{getDB(){return this.dbPromise||(this.dbPromise=new Promise((t,e)=>{let i=indexedDB.open(this.dbName,this.DB_VERSION);i.onerror=()=>{e(i.error)},i.onsuccess=()=>{t(i.result)},i.onupgradeneeded=t=>{let e=t.target.result;e.objectStoreNames.contains(this.storeName)||e.createObjectStore(this.storeName)}})),this.dbPromise}async performTransaction(t,e){try{let i=(await this.getDB()).transaction([this.storeName],t).objectStore(this.storeName),o=e(i);return new Promise((t,e)=>{o.onsuccess=()=>{t(o.result)},o.onerror=()=>{e(o.error)}})}catch(t){return Promise.reject(t)}}async set(t,e){try{await this.performTransaction("readwrite",i=>i.put(e,t))}catch(t){s.IS_PROD}return this}async delete(t){try{await this.performTransaction("readwrite",e=>e.delete(t))}catch{}return this}async get(t){try{return await this.performTransaction("readonly",e=>e.get(t))}catch{return}}async exists(t){try{let e=await this.performTransaction("readonly",e=>e.get(t));return void 0!==e}catch{return!1}}async clear(){try{await this.performTransaction("readwrite",t=>t.clear())}catch{}return this}async close(){if(this.dbPromise){try{(await this.dbPromise).close()}catch{}this.dbPromise=null}}async keys(){try{let t=await this.performTransaction("readonly",t=>t.getAllKeys());return t&&"object"==typeof t&&"then"in t&&(t=await t),t.map(t=>t+"")}catch{return[]}}async values(){try{let t=await this.performTransaction("readonly",t=>t.getAll());return t&&"object"==typeof t&&"then"in t&&(t=await t),t}catch{return[]}}async entries(){try{let[t,e]=await Promise.all([this.keys(),this.values()]);return t.map((t,i)=>[t,e[i]])}catch{return[]}}constructor(t="JoditDB",e="keyValueStore"){(0,o._)(this,"dbName",void 0),(0,o._)(this,"dbPromise",void 0),(0,o._)(this,"DB_VERSION",void 0),(0,o._)(this,"storeName",void 0),this.dbName=t,this.dbPromise=null,this.DB_VERSION=1,this.storeName=e}}let r=null;function a(){r=null}async function l(){if(null!=r)return r;try{if("u"<typeof indexedDB)return r=!1,!1;let t="___Jodit___"+Math.random().toString(),e=indexedDB.open(t);return r=await new Promise(i=>{e.onerror=()=>{i(!1)},e.onsuccess=()=>{indexedDB.deleteDatabase(t),i(!0)}})}catch{return r=!1,!1}}},59807:function(t,e,i){"use strict";i.d(e,{LocalStorageProvider:function(){return s}});var o=i(25045);class s{get storage(){return"sessionStorage"===this.strategy?sessionStorage:localStorage}set(t,e){try{let i=this.storage.getItem(this.rootKey),o=i?JSON.parse(i):{};o[t]=e,this.storage.setItem(this.rootKey,JSON.stringify(o))}catch{}return this}delete(t){try{let e=this.storage.getItem(this.rootKey);if(e){let i=JSON.parse(e);delete i[t],this.storage.setItem(this.rootKey,JSON.stringify(i))}}catch{}return this}get(t){try{let e=this.storage.getItem(this.rootKey),i=e?JSON.parse(e):{};return void 0!==i[t]?i[t]:void 0}catch{}}exists(t){return null!=this.get(t)}clear(){try{this.storage.removeItem(this.rootKey)}catch{}return this}constructor(t,e="localStorage"){(0,o._)(this,"rootKey",void 0),(0,o._)(this,"strategy",void 0),this.rootKey=t,this.strategy=e}}i.d(e,["canUsePersistentStorage",0,(t="localStorage")=>{let e=new Map;if(e.has(t))return e.get(t);let i="___Jodit___"+Math.random().toString(),o="sessionStorage"===t?sessionStorage:localStorage;try{o.setItem(i,"1");let s="1"===o.getItem(i);return o.removeItem(i),e.set(t,s),s}catch{}return e.set(t,!1),!1}])},9505:function(t,e,i){"use strict";i.d(e,{MemoryStorageProvider:function(){return s}});var o=i(25045);class s{set(t,e){return this.data.set(t,e),this}delete(t){return this.data.delete(t),this}get(t){return this.data.get(t)}exists(t){return this.data.has(t)}clear(){return this.data.clear(),this}constructor(){(0,o._)(this,"data",new Map)}}},25222:function(t,e,i){"use strict";i.d(e,{AsyncStorage:function(){return o.AsyncStorage},IndexedDBProvider:function(){return s.IndexedDBProvider},LocalStorageProvider:function(){return n.LocalStorageProvider},MemoryStorageProvider:function(){return r.MemoryStorageProvider},Storage:function(){return a.Storage},StorageKey:function(){return"Jodit_"},canUseIndexedDB:function(){return s.canUseIndexedDB},canUsePersistentStorage:function(){return n.canUsePersistentStorage},clearUseIndexedDBCache:function(){return s.clearUseIndexedDBCache}});var o=i(8006),s=i(91162),n=i(59807),r=i(9505),a=i(24475)},24475:function(t,e,i){"use strict";i.d(e,{Storage:function(){return l}});var o=i(25045),s=i(57821),n=i(59807),r=i(9505);let a="Jodit_";class l{set(t,e){return this.provider.set((0,s.camelCase)(this.prefix+t),e),this}delete(t){return this.provider.delete((0,s.camelCase)(this.prefix+t)),this}get(t){return this.provider.get((0,s.camelCase)(this.prefix+t))}exists(t){return this.provider.exists((0,s.camelCase)(this.prefix+t))}clear(){return this.provider.clear(),this}static makeStorage(t=!1,e){let i;return"localStorage"===t||"sessionStorage"===t?(0,n.canUsePersistentStorage)(t)&&(i=new n.LocalStorageProvider(a+(e||""),t)):!0===t&&(0,n.canUsePersistentStorage)("localStorage")&&(i=new n.LocalStorageProvider(a+(e||""))),i||(i=new r.MemoryStorageProvider),new l(i,e)}constructor(t,e){(0,o._)(this,"provider",void 0),(0,o._)(this,"prefix",void 0),this.provider=t,this.prefix=a,e&&(this.prefix+=e)}}},80512:function(t,e,i){"use strict";i.d(e,{Dlgs:function(){return a}});var o=i(28077),s=i(28686),n=i(71125),r=i(37333);class a{dlg(t){let e=(0,o.getPopupViewRoot)(this.o,this.container,this.od.body),i=new r.Dialog({language:this.o.language,shadowRoot:this.o.shadowRoot,popupRoot:e,ownerWindow:this.o.ownerWindow,defaultTimeout:this.o.defaultTimeout,direction:this.o.direction,theme:this.o.theme,globalFullSize:this.o.globalFullSize,...t});return(0,n.markOwner)(this,i.container),i.parent=this,i.bindDestruct(this)}confirm(t,e,i){return t=l(t,this),e=l(e,this),r.Confirm.call(this.dlg({closeOnClickOverlay:!0}),t,e,i)}prompt(t,e,i,o,s){return t=l(t,this),e=l(e,this),o=l(o,this),r.Prompt.call(this.dlg({closeOnClickOverlay:!0}),t,e,i,o,s)}alert(t,e,i,o){return t=l(t,this),e=l(e,this),r.Alert.call(this.dlg({closeOnClickOverlay:!0}),t,e,i,o)}}function l(t,e){return(0,s.isString)(t)&&!(0,s.isHTML)(t)&&(t=e.i18n(t)),t}},23183:function(t,e,i){"use strict";i.d(e,{Elms:function(){return s}});var o=i(23211);class s{getElm(t){let e=this.getFullElName(t);return o.Dom.first(this.container,t=>o.Dom.isHTMLElement(t)&&t.classList.contains(e))}getElms(t){let e=this.getFullElName(t),i=[];return o.Dom.each(this.container,t=>{o.Dom.isHTMLElement(t)&&t.classList.contains(e)&&i.push(t)}),i}}},81987:function(t,e,i){"use strict";i.d(e,{Mods:function(){return s}});var o=i(18303);class s{afterSetMod(t,e){}setMod(t,e,i){t=t.toLowerCase();let s=this.mods[t];if(s===e)return this;let n=`${this.componentName}_${t}_`,r=(i||this.container).classList;return null!=s&&r.remove(`${n}${s.toString().toLowerCase()}`),(0,o.isVoid)(e)||""===e||r.add(`${n}${e.toString().toLowerCase()}`),this.mods[t]=e,this.afterSetMod(t,e),this}getMod(t){return this.mods[t]??null}}},53681:function(t,e,i){"use strict";i.d(e,{Button:function(){return v},UIButton:function(){return _}});var o=i(25045),s=i(31635),n=i(69364),r=i(51676),a=i(91672),l=i(68616),c=i(23211),u=i(91565),h=i(85932),d=i(28712),p=i(7909),m=i(96007),f=i(29434);let g=()=>({size:"middle",type:"button",role:"button",name:"",value:"",variant:"initial",disabled:!1,activated:!1,icon:{name:"empty",fill:"",iconURL:"",scale:void 0},tooltip:"",text:"",tabIndex:void 0});class _ extends m.UIElement{className(){return"UIButton"}setState(t){return Object.assign(this.state,t),this}get text(){let t=this.getElm("text");return(0,d.assert)(t,"Text element not found"),t}get icon(){let t=this.getElm("icon");return(0,d.assert)(t,"Icon element not found"),t}onChangeSize(){this.setMod("size",this.state.size)}onChangeType(){(0,p.attr)(this.container,"type",this.state.type)}onChangeRole(){(0,p.attr)(this.container,"role",this.state.role)}updateSize(){let t=(0,a.getComponentClass)("UIList"),e=this.closest(t);if(e){this.state.size=e.buttonSize;return}}onChangeStatus(){this.setMod("variant",this.state.variant)}onChangeText(){this.text.textContent=this.jodit.i18n(this.state.text),this.updateAriaLabel()}onChangeTextSetMode(){this.setMod("text-icons",!!this.state.text.trim().length)}onChangeDisabled(){(0,p.attr)(this.container,"disabled",this.state.disabled||null)}onChangeActivated(){(0,p.attr)(this.container,"aria-pressed",this.state.activated)}onChangeName(){this.container.classList.add(`${this.componentName}_${this.clearName(this.state.name)}`),this.name=this.state.name,(0,p.attr)(this.container,"data-ref",this.state.name),(0,p.attr)(this.container,"ref",this.state.name)}onChangeTooltip(){let t=this.state.tooltip?this.jodit.i18n(this.state.tooltip):null;this.get("j.o.useNativeTooltip")&&(0,p.attr)(this.container,"title",t),(0,p.attr)(this.container,"aria-label",t),this.updateAriaLabel()}updateAriaLabel(){let t=this.state.text.trim().length>0,e=this.state.tooltip?this.jodit.i18n(this.state.tooltip):null;(0,p.attr)(this.container,"aria-label",e),(0,p.attr)(this.button,"aria-label",t?null:e)}onChangeTabIndex(){(0,p.attr)(this.container,"tabindex",this.state.tabIndex)}onChangeIcon(){let t=this.get("j.o.textIcons");if(!0===t||(0,u.isFunction)(t)&&t(this.state.name))return;c.Dom.detach(this.icon);let e=f.Icon.makeIcon(this.j,this.state.icon);e&&c.Dom.append(this.icon,e)}focus(){this.container.focus()}isFocused(){let{activeElement:t}=this.od;return!!(t&&c.Dom.isOrContains(this.container,t))}createContainer(){let t=this.componentName,e=this.j.c.element("button",{class:t,type:"button",role:"button",ariaPressed:!1}),i=this.j.c.span(t+"__icon"),o=this.j.c.span(t+"__text");return c.Dom.append(e,i),c.Dom.append(e,o),e}destruct(){return this.j.e.off(this),this.j.e.off(this.container),super.destruct()}onAction(t){return this.actionHandlers.push(t),this}__onActionFire(t){t.buffer={actionTrigger:this},this.actionHandlers.forEach(e=>e.call(this,t)),this.j.e.fire(this,"click",t)}constructor(t,e){super(t),(0,o._)(this,"isButton",!0),(0,o._)(this,"state",g()),(0,o._)(this,"button",void 0),(0,o._)(this,"actionHandlers",[]),this.button=this.container,this.updateSize(),this.onChangeSize(),this.onChangeStatus(),e&&this.hookStatus(n.STATUSES.ready,()=>{this.setState(e)})}}function v(t,e,i,o){let s=new _(t);return s.state.tabIndex=t.o.allowTabNavigation?0:-1,(0,h.isString)(e)?(s.state.icon.name=e,s.state.name=e,o&&(s.state.variant=o),i&&(s.state.text=i)):s.setState(e),s}(0,s.__decorate)([r.cache],_.prototype,"text",null),(0,s.__decorate)([r.cache],_.prototype,"icon",null),(0,s.__decorate)([(0,l.watch)("state.size",{immediately:!1})],_.prototype,"onChangeSize",null),(0,s.__decorate)([(0,l.watch)("state.type",{immediately:!1})],_.prototype,"onChangeType",null),(0,s.__decorate)([(0,l.watch)("state.role",{immediately:!1})],_.prototype,"onChangeRole",null),(0,s.__decorate)([(0,l.watch)("parentElement")],_.prototype,"updateSize",null),(0,s.__decorate)([(0,l.watch)("state.variant",{immediately:!1})],_.prototype,"onChangeStatus",null),(0,s.__decorate)([(0,l.watch)("state.text",{immediately:!1})],_.prototype,"onChangeText",null),(0,s.__decorate)([(0,l.watch)("state.text",{immediately:!1})],_.prototype,"onChangeTextSetMode",null),(0,s.__decorate)([(0,l.watch)("state.disabled")],_.prototype,"onChangeDisabled",null),(0,s.__decorate)([(0,l.watch)("state.activated")],_.prototype,"onChangeActivated",null),(0,s.__decorate)([(0,l.watch)("state.name",{immediately:!1})],_.prototype,"onChangeName",null),(0,s.__decorate)([(0,l.watch)("state.tooltip",{immediately:!1})],_.prototype,"onChangeTooltip",null),(0,s.__decorate)([(0,l.watch)("state.tabIndex",{immediately:!1})],_.prototype,"onChangeTabIndex",null),(0,s.__decorate)([(0,l.watch)("state.icon",{immediately:!1})],_.prototype,"onChangeIcon",null),(0,s.__decorate)([r.cacheHTML],_.prototype,"createContainer",null),(0,s.__decorate)([(0,l.watch)("button:click")],_.prototype,"__onActionFire",null),_=(0,s.__decorate)([a.component],_),i.d(e,["UIButtonState",0,g])},15367:function(t,e,i){"use strict";i.d(e,{UIButtonGroup:function(){return u}});var o=i(25045),s=i(31635),n=i(91672),r=i(23211),a=i(28712),l=i(53681),c=i(63468);class u extends c.UIGroup{className(){return"UIButtonGroup"}render(t){return`<div>
|
|
15
15
|
<div class="&__label">~${t.label}~</div>
|
|
16
16
|
<div class="&__options"></div>
|
|
17
17
|
</div>`}appendChildToContainer(t){let e=this.getElm("options");(0,a.assert)(null!=e,"Options does not exist"),r.Dom.append(e,t)}select(t){this.elements.forEach((e,i)=>{i===t||e.state.value===t?e.state.activated=!0:this.options.radio&&(e.state.activated=!1)});let e=this.elements.filter(t=>t.state.activated).map(t=>({text:t.state.text,value:t.state.value}));this.jodit.e.fire(this,"select",e),this.options.onChange?.(e)}constructor(t,e={radio:!0}){super(t,e.options?.map(e=>{let i=new l.UIButton(t,{text:e.text,value:e.value,variant:"primary"});return i.onAction(()=>{this.select(e.value)}),i}),e),(0,o._)(this,"options",void 0),this.options=e,this.select(e.value??0)}}u=(0,s.__decorate)([n.component],u)},59400:function(t,e,i){"use strict";i.d(e,{Button:function(){return o.Button},UIButton:function(){return o.UIButton},UIButtonGroup:function(){return s.UIButtonGroup},UIButtonState:function(){return o.UIButtonState},UITooltip:function(){return n.UITooltip}});var o=i(53681),s=i(15367),n=i(95399)},95399:function(t,e,i){"use strict";i.d(e,{UITooltip:function(){return f}});var o=i(25045),s=i(31635),n=i(16964),r=i(84839),a=i(27795),l=i(28077),c=i(2373),u=i(23599),h=i(93640),d=i(96007);let p=["scroll.tooltip","joditCloseDialog","mouseleave.tooltip"],m=["escape.tooltip","change.tooltip","changePlace.tooltip","afterOpenPopup.tooltip","hidePopup.tooltip","beforePopupClose.tooltip","closeAllPopups.tooltip"];class f extends d.UIElement{className(){return"UITooltip"}render(){return'<div><div class="&__content"></div></div>'}__onAttach(t){a.Dom.append((0,l.getContainer)(this.j,f),this.container),this.__attachedContainers.add(t),this.__attachedContainers.add(this.j.container),this.j.e.on(t,"mouseenter.tooltip",this.__onMouseEnter,{capture:!0}).on(t,"mouseleave.tooltip",this.__onMouseLeave,{capture:!0}).on(this.j.container,"mouseleave.tooltip",this.__onMouseLeave,{capture:!0})}__addListenersOnEnter(){if(this.__listenClose)return;this.__listenClose=!0;let t=this.j;t.e.on(t.ow,p,this.__hide).on(m,this.__hide)}__removeListenersOnLeave(){if(!this.__listenClose)return;this.__listenClose=!1;let t=this.j;t.e.off(t.ow,p,this.__hide).off(m,this.__hide)}__onMouseLeave(t){this.__currentTarget===t.target&&(this.__hideDelay(),this.__currentTarget=null)}__onMouseEnter(t){if(!a.Dom.isHTMLElement(t.target))return;let e=(0,h.attr)(t.target,"aria-label");if(!e||(0,h.attr)(t.target,"disabled")||!t.target.className.includes("jodit"))return;this.__currentTarget=t.target;let i=t.target;this.__open(()=>{let t=(0,u.position)(i);return{x:t.left+t.width/2,y:t.top+t.height}},e)}__open(t,e){this.__addListenersOnEnter(),this.__isOpened=!0,this.j.async.clearTimeout(this.__hideTimeout),this.j.async.clearTimeout(this.__delayShowTimeout);let i=this.j.o.showTooltipDelay||this.j.defaultTimeout;i?this.__delayShowTimeout=this.j.async.setTimeout(()=>this.__show(t,e),i):this.__show(t,e)}__show(t,e){this.setMod("visible",!0),this.setMod("above",!1),this.getElm("content").innerHTML=e;let i=t(),o=(0,c.getFixedPositionOffset)(this.container);(0,h.css)(this.container,{left:i.x-o.x,top:i.y-o.y});let s=(0,u.position)(this.container),n=this.j.ow.innerHeight;if(s.top+s.height>n){let t=(0,u.position)(this.__currentTarget);this.setMod("above",!0),(0,h.css)(this.container,{top:t.top-s.height-o.y})}}__hide(){this.j.async.clearTimeout(this.__delayShowTimeout),this.j.async.clearTimeout(this.__hideTimeout),this.__removeListenersOnLeave(),this.__isOpened&&(this.__isOpened=!1,this.setMod("visible",!1),a.Dom.detach(this.getElm("content")),(0,h.css)(this.container,{left:-5e3}))}__hideDelay(){this.j.async.clearTimeout(this.__delayShowTimeout),this.j.async.clearTimeout(this.__hideTimeout),this.__isOpened&&(this.__hideTimeout=this.async.setTimeout(this.__hide,this.j.defaultTimeout))}destruct(){this.__attachedContainers.forEach(t=>{this.j.e.off(t,"mouseenter.tooltip",this.__onMouseEnter).off(t,"mouseleave.tooltip",this.__onMouseLeave)}),this.__hide(),super.destruct()}constructor(t){super(t),(0,o._)(this,"__isOpened",!1),(0,o._)(this,"__attachedContainers",new Set),(0,o._)(this,"__listenClose",!1),(0,o._)(this,"__currentTarget",null),(0,o._)(this,"__delayShowTimeout",0),(0,o._)(this,"__hideTimeout",0),t.o.textIcons||!t.o.showTooltip||t.o.useNativeTooltip||(this.j.e.on("getContainer",t=>{this.__onAttach(t)}),t.hookStatus(n.STATUSES.ready,()=>{this.__onAttach(this.j.container)}))}}(0,s.__decorate)([r.autobind],f.prototype,"__onMouseLeave",null),(0,s.__decorate)([r.autobind],f.prototype,"__onMouseEnter",null),(0,s.__decorate)([r.autobind],f.prototype,"__hide",null),(0,s.__decorate)([r.autobind],f.prototype,"__hideDelay",null),f=(0,s.__decorate)([r.component],f)},96007:function(t,e,i){"use strict";i.d(e,{UIElement:function(){return p}});var o=i(25045),s=i(31635),n=i(16964),r=i(24968),a=i(23211),l=i(85932),c=i(7909),u=i(23183),h=i(81987),d=i(29434);class p extends n.ViewComponent{getRole(){return this.options?.role||""}get parentElement(){return this.__parentElement}set parentElement(t){this.__parentElement=t,t&&t.hookStatus("beforeDestruct",()=>this.destruct()),this.updateParentElement(this)}bubble(t){let e=this.parentElement;for(;e;)t(e),e=e.parentElement;return this}updateParentElement(t){return this.__parentElement?.updateParentElement(t),this}get(t,e){return super.get(t,e)||this.getElm(t)}closest(t){let e="object"==typeof t?e=>e===t:e=>n.Component.isInstanceOf(e,t),i=this.__parentElement;for(;i;){if(e(i))return i;i=!i.parentElement&&i.container.parentElement?p.closestElement(i.container.parentElement,p):i.parentElement}return null}static closestElement(t,e){let i=a.Dom.up(t,t=>{if(t){let{component:i}=t;return i&&n.Component.isInstanceOf(i,e)}return!1});return i?i?.component:null}update(){}appendTo(t){return a.Dom.append(t,this.container),this}clearName(t){return t.replace(/[^a-zA-Z0-9]/g,"_")}render(t){return this.j.c.div(this.componentName)}createContainer(t){let e=this.render(t);if((0,l.isString)(e)){let t=this.parseTemplate(e);return t.classList.add(this.componentName),t}return e}parseTemplate(t){return this.j.c.fromHTML(t.replace(/\*([^*]+?)\*/g,(t,e)=>d.Icon.get(e)||"").replace(/&_/g,this.componentName+"_").replace(/~([^~]+?)~/g,(t,e)=>this.i18n(e)))}destruct(){return a.Dom.safeRemove(this.container),this.parentElement=null,super.destruct()}constructor(t,e){super(t),(0,o._)(this,"container",void 0),(0,o._)(this,"name",""),(0,o._)(this,"options",void 0),(0,o._)(this,"__parentElement",null),(0,o._)(this,"mods",{}),this.options=e,this.container=this.createContainer(e);const i=this.getRole();i&&(0,c.attr)(this.container,"role",i),Object.defineProperty(this.container,"component",{value:this,configurable:!0})}}p=(0,s.__decorate)([(0,r.derive)(h.Mods,u.Elms)],p)},4561:function(t,e,i){"use strict";i.d(e,{UIBlock:function(){return l}});var o=i(25045),s=i(31635),n=i(91672),r=i(93640),a=i(63468);class l extends a.UIGroup{className(){return"UIBlock"}constructor(t,e,i={align:"left"}){super(t,e),(0,o._)(this,"options",void 0),this.options=i,this.setMod("align",this.options.align||"left"),this.setMod("width",this.options.width||""),this.options.mod&&this.setMod(this.options.mod,!0),this.options.className&&this.container.classList.add(this.options.className),(0,r.attr)(this.container,"data-ref",i.ref),(0,r.attr)(this.container,"ref",i.ref)}}l=(0,s.__decorate)([n.component],l)},98838:function(t,e,i){"use strict";i.d(e,{UIForm:function(){return u}});var o=i(31635),s=i(80251),n=i(91672),r=i(93640),a=i(65273),l=i(49999),c=i(63468);class u extends c.UIGroup{className(){return"UIForm"}submit(){this.j.e.fire(this.container,"submit")}validate(){for(let t of this.allChildren.filter(t=>s.Component.isInstanceOf(t,a.UIInput)))if(!t.validate())return!1;for(let t of this.allChildren.filter(t=>s.Component.isInstanceOf(t,l.UISelect)))if(!t.validate())return!1;return!0}onSubmit(t){return this.j.e.on(this.container,"submit",()=>{let e=this.allChildren.filter(t=>s.Component.isInstanceOf(t,a.UIInput));return!!this.validate()&&(t(e.reduce((t,e)=>(t[e.state.name]=e.value,t),{})),!1)}),this}createContainer(){let t=this.j.c.element("form");return t.classList.add(this.componentName),(0,r.attr)(t,"dir",this.j.o.direction||"auto"),(0,r.attr)(t,"novalidate",""),t}constructor(...t){super(...t),this.options?.className&&this.container.classList.add(this.options?.className)}}u=(0,o.__decorate)([n.component],u)},5658:function(t,e,i){"use strict";i.d(e,{UIBlock:function(){return o.UIBlock},UICheckbox:function(){return n.UICheckbox},UIFileInput:function(){return n.UIFileInput},UIForm:function(){return s.UIForm},UIInput:function(){return n.UIInput},UISelect:function(){return n.UISelect},UITextArea:function(){return n.UITextArea}});var o=i(4561),s=i(98838),n=i(2602)},87329:function(t,e,i){"use strict";i.d(e,{UITextArea:function(){return c}});var o=i(25045),s=i(31635),n=i(84839),r=i(91672),a=i(80991),l=i(65273);class c extends l.UIInput{className(){return"UITextArea"}createNativeInput(t){return this.j.create.element("textarea")}onChangeStateSize(){let{size:t,resizable:e}=this.state;(0,a.css)(this.nativeInput,"resize",e?"auto":"none"),this.nativeInput.rows=t??5}constructor(t,e){super(t,e),(0,o._)(this,"state",{...c.defaultState}),Object.assign(this.state,e),!1===this.state.resizable&&(0,a.css)(this.nativeInput,"resize","none")}}(0,o._)(c,"defaultState",{...l.UIInput.defaultState,size:5,resizable:!0}),(0,s.__decorate)([(0,n.watch)(["state.size","state.resizable"])],c.prototype,"onChangeStateSize",null),c=(0,s.__decorate)([r.component],c)},24641:function(t,e,i){"use strict";i.d(e,{UICheckbox:function(){return l}});var o=i(25045),s=i(31635),n=i(84839),r=i(23211),a=i(65273);class l extends a.UIInput{className(){return"UICheckbox"}render(){return this.j.c.element("label",{className:this.componentName})}onChangeChecked(){this.value=this.state.checked.toString(),this.nativeInput.checked=this.state.checked,this.setMod("checked",this.state.checked)}onChangeNativeCheckBox(){this.state.checked=this.nativeInput.checked}onChangeSwitch(){this.setMod("switch",this.state.switch);let t=this.getElm("switch-slider");this.state.switch?(t||(t=this.j.c.div(this.getFullElName("switch-slider"))),r.Dom.after(this.nativeInput,t)):r.Dom.safeRemove(t)}constructor(t,e){super(t,{...e,type:"checkbox"}),(0,o._)(this,"state",{...l.defaultState}),Object.assign(this.state,e)}}(0,o._)(l,"defaultState",{...a.UIInput.defaultState,checked:!1,switch:!1}),(0,s.__decorate)([(0,n.watch)("state.checked"),(0,n.hook)("ready")],l.prototype,"onChangeChecked",null),(0,s.__decorate)([(0,n.watch)("nativeInput:change")],l.prototype,"onChangeNativeCheckBox",null),(0,s.__decorate)([(0,n.watch)("state.switch"),(0,n.hook)("ready")],l.prototype,"onChangeSwitch",null),l=(0,s.__decorate)([n.component],l)},75587:function(t,e,i){"use strict";i.d(e,{UIFileInput:function(){return c}});var o=i(25045),s=i(31635),n=i(91672),r=i(23211),a=i(53681),l=i(65273);class c extends l.UIInput{className(){return"UIFileInput"}createContainer(t){this.button=new a.UIButton(this.j,{tooltip:t.tooltip,icon:{name:"plus"}});let{container:e}=this.button;this.nativeInput||(this.nativeInput=this.createNativeInput(t));let{nativeInput:i}=this;return i.classList.add(this.getFullElName("input")),e.classList.add(this.componentName),r.Dom.append(e,i),e}createNativeInput(t){return this.j.create.fromHTML(`<input
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
/>`)}constructor(t,e){super(t,{type:"file",...e}),(0,o._)(this,"state",{...l.UIInput.defaultState,type:"file",onlyImages:!0})}}c=(0,s.__decorate)([n.component],c)},2602:function(t,e,i){"use strict";i.d(e,{UICheckbox:function(){return s.UICheckbox},UIFileInput:function(){return n.UIFileInput},UIInput:function(){return r.UIInput},UISelect:function(){return a.UISelect},UITextArea:function(){return o.UITextArea}});var o=i(87329),s=i(24641),n=i(75587),r=i(65273),a=i(49999)},65273:function(t,e,i){"use strict";i.d(e,{UIInput:function(){return d}});var o=i(25045),s=i(31635),n=i(84839),r=i(23211),a=i(88475),l=i(93640),c=i(96007),u=i(81488),h=i(29434);class d extends c.UIElement{className(){return"UIInput"}onChangeClear(){this.state.clearButton?r.Dom.after(this.nativeInput,this.clearButton):r.Dom.safeRemove(this.clearButton)}onChangeClassName(t,e){e&&this.container.classList.remove(e),this.state.className&&this.container.classList.add(this.state.className)}onChangeState(){this.name=this.state.name;let t=this.nativeInput,{name:e,icon:i,type:o,ref:s,required:n,placeholder:a,autocomplete:c,label:u}=this.state;(0,l.attr)(t,"name",e),(0,l.attr)(t,"type",o),(0,l.attr)(t,"data-ref",s||e),(0,l.attr)(t,"ref",s||e),(0,l.attr)(t,"required",n||null),(0,l.attr)(t,"autocomplete",c?null:"off"),(0,l.attr)(t,"placeholder",a?this.j.i18n(a):""),i&&h.Icon.exists(i)?(r.Dom.before(t,this.icon),this.icon.innerHTML=h.Icon.get(i)):r.Dom.safeRemove(this.icon),u?(r.Dom.before(this.wrapper,this.label),this.label.innerText=this.j.i18n(u)):r.Dom.safeRemove(this.label),this.updateValidators()}updateValidators(){this.validators.clear(),this.state.required&&this.validators.add(u.inputValidators.required),this.state.validators?.forEach(t=>{let e=u.inputValidators[t];e&&this.validators.add(e)})}set error(t){this.setMod("has-error",!!t),t?(this.__errorBox.innerText=this.j.i18n(t,this.j.i18n(this.state.label||"")),r.Dom.append(this.container,this.__errorBox)):r.Dom.safeRemove(this.__errorBox)}get value(){return this.nativeInput.value}set value(t){this.value!==t&&(this.nativeInput.value=t,this.onChangeValue())}onChangeStateValue(){let t=this.state.value.toString();t!==this.value&&(this.value=t)}onChangeValue(){let{value:t}=this;this.state.value!==t&&(this.state.value=t,this.j.e.fire(this,"change",t),this.state.onChange?.(t))}validate(){this.error="";let t=(0,a.toArray)(this.validators).every(t=>t(this));return this.__markInputInvalid(),t}__markInputInvalid(){this.error?((0,l.attr)(this.nativeInput,"aria-invalid","true"),this.nativeInput.setCustomValidity?.(this.error)):((0,l.attr)(this.nativeInput,"aria-invalid",null),this.nativeInput.setCustomValidity?.(""))}createContainer(t){let e=super.createContainer();this.wrapper=this.j.c.div(this.getFullElName("wrapper")),this.nativeInput||(this.nativeInput=this.createNativeInput());let{nativeInput:i}=this;return i.classList.add(this.getFullElName("input")),r.Dom.append(this.wrapper,i),r.Dom.append(e,this.wrapper),(0,l.attr)(i,"dir",this.j.o.direction||"auto"),e}createNativeInput(t){return this.j.create.element("input")}focus(){this.nativeInput.focus()}get isFocused(){return this.nativeInput===this.j.od.activeElement}onChangeFocus(){this.setMod("focused",this.isFocused)}constructor(t,e){super(t,e),(0,o._)(this,"label",this.j.c.span(this.getFullElName("label"))),(0,o._)(this,"icon",this.j.c.span(this.getFullElName("icon"))),(0,o._)(this,"clearButton",this.j.c.span(this.getFullElName("clear"),h.Icon.get("cancel"))),(0,o._)(this,"state",{...d.defaultState}),(0,o._)(this,"__errorBox",this.j.c.span(this.getFullElName("error"))),(0,o._)(this,"validators",new Set([])),e?.value!==void 0&&(e.value=e.value.toString()),Object.assign(this.state,e),void 0!==this.state.clearButton&&(this.j.e.on(this.clearButton,"click",t=>{t.preventDefault(),this.nativeInput.value="",this.j.e.fire(this.nativeInput,"input"),this.focus()}).on(this.nativeInput,"input",()=>{this.state.clearButton=!!this.value.length}),this.state.clearButton=!!this.value.length),this.j.e.on(this.nativeInput,"focus blur",()=>{this.onChangeFocus()}).on(this.nativeInput,"input change",this.onChangeValue),this.onChangeState(),this.onChangeClassName(),this.onChangeStateValue()}}(0,o._)(d,"defaultState",{className:"",autocomplete:!0,name:"",value:"",icon:"",label:"",ref:"",type:"text",placeholder:"",required:!1,validators:[]}),(0,s.__decorate)([(0,n.watch)("state.clearButton")],d.prototype,"onChangeClear",null),(0,s.__decorate)([(0,n.watch)("state.className")],d.prototype,"onChangeClassName",null),(0,s.__decorate)([(0,n.watch)(["state.name","state.type","state.label","state.placeholder","state.autocomplete","state.icon"],{immediately:!1}),(0,n.debounce)()],d.prototype,"onChangeState",null),(0,s.__decorate)([(0,n.watch)("state.value")],d.prototype,"onChangeStateValue",null),(0,s.__decorate)([n.autobind],d.prototype,"onChangeValue",null),d=(0,s.__decorate)([n.component],d)},49999:function(t,e,i){"use strict";i.d(e,{UISelect:function(){return c}});var o=i(25045),s=i(31635),n=i(91672),r=i(7909),a=i(65273),l=i(81488);class c extends a.UIInput{className(){return"UISelect"}createContainer(t){let e=super.createContainer(t),{j:i}=this,{nativeInput:o}=this;if(void 0!==t.placeholder){let e=i.create.element("option");e.value="",e.text=i.i18n(t.placeholder),o.add(e)}return t.options?.forEach(t=>{let e=i.create.element("option");e.value=t.value.toString(),e.text=i.i18n(t.text),o.add(e)}),t.size&&t.size>0&&(0,r.attr)(o,"size",t.size),t.multiple&&(0,r.attr)(o,"multiple",""),e}createNativeInput(){return this.j.create.element("select")}updateValidators(){super.updateValidators(),this.state.required&&(this.validators.delete(l.inputValidators.required),this.validators.add(l.selectValidators.required))}constructor(t,e){super(t,e),(0,o._)(this,"state",{...c.defaultState}),Object.assign(this.state,e)}}(0,o._)(c,"defaultState",{...a.UIInput.defaultState,options:[],size:1,multiple:!1}),c=(0,s.__decorate)([n.component],c)},81488:function(t,e,i){"use strict";i.d(e,{inputValidators:function(){return o},selectValidators:function(){return s}});var o=i(48776),s=i(6490)},48776:function(t,e,i){"use strict";i.r(e);var o=i(91764),s=i(4040);i.d(e,["required",0,function(t){return!!(0,s.trim)(t.value).length||(t.error="Please fill out this field",!1)},"url",0,function(t){return!!(0,o.isURL)((0,s.trim)(t.value))||(t.error="Please enter a web address",!1)}])},6490:function(t,e,i){"use strict";var o=i(4040);i.d(e,["required",0,function(t){return!!(0,o.trim)(t.value).length||(t.error="Please fill out this field",!1)}])},63468:function(t,e,i){"use strict";i.d(e,{UIGroup:function(){return u}});var o=i(25045),s=i(31635),n=i(80251),r=i(84839),a=i(23211),l=i(65946),c=i(96007);class u extends c.UIElement{className(){return"UIGroup"}getRole(){return this.options?.role||"list"}get allChildren(){let t=[],e=[...this.elements];for(;e.length;){let i=e.shift();(0,l.isArray)(i)?e.push(...i):n.Component.isInstanceOf(i,u)?e.push(...i.elements):i&&t.push(i)}return t}update(){this.elements.forEach(t=>t.update()),this.setMod("size",this.buttonSize)}append(t,e){let i;if((0,l.isArray)(t)){if("number"==typeof e)throw Error("You can not use index when append array of elements");return t.forEach(t=>this.append(t,e)),this}if("number"==typeof e?(i=Math.min(Math.max(0,e),this.elements.length),this.elements.splice(i,0,t)):this.elements.push(t),t.name&&t.container.classList.add(this.getFullElName(t.name)),e&&"string"==typeof e){let i=this.getElm(e);if(null==i)throw Error("Element does not exist");a.Dom.append(i,t.container)}else this.appendChildToContainer(t.container,i);return t.parentElement=this,this}afterSetMod(t,e){this.syncMod&&this.elements.forEach(i=>i.setMod(t,e))}appendChildToContainer(t,e){let i=void 0===e||e<0||e>this.elements.length-1?null:this.container.children[e];null==i?a.Dom.append(this.container,t):a.Dom.before(i,t)}remove(t){let e=this.elements.indexOf(t);return -1!==e&&(this.elements.splice(e,1),a.Dom.safeRemove(t.container),t.parentElement=null),this}clear(){return this.elements.forEach(t=>t.destruct()),this.elements.length=0,this}setParentView(t){return this.elements?.forEach(e=>e.setParentView(t)),super.setParentView(t)}destruct(){return this.clear(),super.destruct()}constructor(t,e,i){super(t,i),(0,o._)(this,"options",void 0),(0,o._)(this,"syncMod",void 0),(0,o._)(this,"elements",void 0),(0,o._)(this,"buttonSize",void 0),this.options=i,this.syncMod=!1,this.elements=[],this.buttonSize="middle",e?.forEach(t=>t&&this.append(t)),i?.name&&(this.name=i.name)}}(0,s.__decorate)([(0,r.watch)("buttonSize")],u.prototype,"update",null),u=(0,s.__decorate)([r.component],u)},64847:function(t,e,i){"use strict";i.d(e,{UIGroup:function(){return o.UIGroup},UIList:function(){return s.UIList},UISeparator:function(){return n.UISeparator},UISpacer:function(){return r.UISpacer}});var o=i(63468),s=i(97959),n=i(35676),r=i(27987)},97959:function(t,e,i){"use strict";i.d(e,{UIList:function(){return _}});var o=i(25045),s=i(31635),n=i(80251),r=i(91672),a=i(29200),l=i(68616),c=i(32328),u=i(53681),h=i(63468),d=i(35676),p=i(27987),m=i(2496),f=i(15982),g=i(40253);class _ extends h.UIGroup{className(){return"UIList"}getRole(){return"list"}__onChangeMode(){this.setMod("mode",this.mode)}makeGroup(t){return new h.UIGroup(this.jodit,[],t?{role:t}:void 0)}get buttons(){return this.allChildren.filter(t=>n.Component.isInstanceOf(t,u.UIButton))}getButtonsNames(){return this.buttons.map(t=>t instanceof u.UIButton&&t.state.name||"").filter(t=>""!==t)}setRemoveButtons(t){return this.removeButtons=t||[],this}build(t,e=null){let i;t=(0,c.splitArray)(t),this.clear();let o=!1,s=this.makeGroup("group");this.append(s),s.setMod("line",!0);let n=t=>{let n=null;switch(t.name){case`
|
|
24
24
|
`:(s=this.makeGroup("group")).setMod("line",!0),i=this.makeGroup(),s.append(i),this.append(s);break;case"|":o||(o=!0,n=new d.UISeparator(this.j));break;case"---":{i.setMod("before-spacer",!0);let t=new p.UISpacer(this.j);s.append(t),i=this.makeGroup(),s.append(i),o=!1;break}default:o=!1,n="select"===t.component?this.makeSelect(t,e):this.makeButton(t,e)}n&&(i||(i=this.makeGroup(),s.append(i)),i.append(n))},r=t=>!this.removeButtons.includes(t.name)&&(!t.isVisible||t.isVisible?.(this.j,t));return t.forEach(t=>{if((0,m.isButtonGroup)(t)){let e=t.buttons.filter(t=>t);e.length&&((i=this.makeGroup()).setMod("separated",!0).setMod("group",t.group),s.append(i),(0,g.getStrongControlTypes)(e,this.j.o.controls).filter(r).forEach(n))}else{i||(i=this.makeGroup(),s.append(i));let e=(0,f.getControlType)(t,this.j.o.controls);r(e)&&n(e)}}),this.update(),this}makeSelect(t,e){throw Error("Not implemented behaviour")}makeButton(t,e){return new u.UIButton(this.j,{name:t.name})}constructor(...t){super(...t),(0,o._)(this,"mode","horizontal"),(0,o._)(this,"removeButtons",[])}}(0,s.__decorate)([(0,l.watch)("mode"),(0,a.hook)("ready")],_.prototype,"__onChangeMode",null),_=(0,s.__decorate)([r.component],_)},35676:function(t,e,i){"use strict";i.d(e,{UISeparator:function(){return r}});var o=i(31635),s=i(91672),n=i(96007);class r extends n.UIElement{className(){return"UISeparator"}}r=(0,o.__decorate)([s.component],r)},27987:function(t,e,i){"use strict";i.d(e,{UISpacer:function(){return r}});var o=i(31635),s=i(91672),n=i(96007);class r extends n.UIElement{className(){return"UISpacer"}}r=(0,o.__decorate)([s.component],r)},2496:function(t,e,i){"use strict";i.d(e,{flatButtonsSet:function(){return n}});var o=i(17312);let s=t=>(0,o.isArray)(t.buttons);function n(t,e){let i=e.getRegisteredButtonGroups();return new Set(t.reduce((t,e)=>(s(e)?t=t.concat([...e.buttons,...i[e.group]??[]]):t.push(e),t),[]))}i.d(e,["isButtonGroup",0,s])},15982:function(t,e,i){"use strict";i.d(e,{findControlType:function(){return r},getControlType:function(){return n}});var o=i(65946),s=i(5266);function n(t,e){let i;return e||(e=s.Config.defaultOptions.controls),(0,o.isString)(t)?i=r(t,e)||{name:t,command:t,tooltip:t}:void 0!==e[(i={name:"empty",...(0,o.ConfigFlatten)(t)}).name]&&(i={...(0,o.ConfigFlatten)(e[i.name]),...(0,o.ConfigFlatten)(i)}),i}function r(t,e){let[i,s]=t.split(/\./),n=e;return null!=s?void 0!==e[i]&&(n=e[i]):s=i,n[s]?{name:s,...(0,o.ConfigFlatten)(n[s])}:void 0}},40253:function(t,e,i){"use strict";i.d(e,{getStrongControlTypes:function(){return a}});var o=i(17312),s=i(93640),n=i(5266),r=i(15982);function a(t,e){return((0,o.isArray)(t)?t:(0,s.keys)(t,!1).map(e=>{let i=t[e]||{};return(0,s.ConfigProto)({name:e},i)})).map(t=>(0,r.getControlType)(t,e||n.Config.defaultOptions.controls))}},29434:function(t,e,i){"use strict";i.d(e,{Icon:function(){return l}});var o=i(25045),s=i(81937),n=i(23211),r=i(65946),a=i(80991);class l{static getIcon(t){if(/<svg/i.test(t))return t;let e=l.icons[t]||l.icons[t.replace(/-/g,"_")]||l.icons[t.replace(/_/g,"-")]||l.icons[(0,r.camelCase)(t)]||l.icons[(0,r.kebabCase)(t)]||l.icons[t.toLowerCase()];return s.IS_PROD,e}static exists(t){return void 0!==this.getIcon(t)}static get(t,e="<span></span>"){return this.getIcon(t)||e}static set(t,e){return this.icons[t.replace("_","-")]=e,this}static makeIcon(t,e){let i,o;if(!e)return;let{name:s,iconURL:n,fill:r,scale:c}=e,u=s.replace(/[^a-zA-Z0-9]/g,"_");/<svg/.test(s)||(o=t.o.getIcon?.(s,u));let h=`${s}${n}${r}${c??""}${o??""}`;if(t.o.cache&&this.__cache.has(h))return this.__cache.get(h)?.cloneNode(!0);if(n)i=t.c.span(),(0,a.css)(i,"backgroundImage","url("+n.replace("{basePath}",t?.basePath||"")+")");else{let e=o||l.get(s,"")||t.o.extraIcons?.[s];e&&(i=l.toIconElement(t,e.trim()),/^<svg/i.test(s)||i.classList.add("jodit-icon_"+u))}return i&&(i.classList.add("jodit-icon"),(0,a.css)(i,"fill",r),null!=c&&(0,a.css)(i,"transform",`scale(${c})`),t.o.cache&&this.__cache.set(h,i.cloneNode(!0))),i}static toIconElement(t,e){let i=t.c.fromHTML(e);return n.Dom.isElement(i)?i:t.c.span("jodit-icon_text",i)}}(0,o._)(l,"icons",{}),(0,o._)(l,"__cache",new Map)},4099:function(t,e,i){"use strict";i.d(e,{Button:function(){return o.Button},Icon:function(){return a.Icon},Popup:function(){return l.Popup},ProgressBar:function(){return c.ProgressBar},UIBlock:function(){return n.UIBlock},UIButton:function(){return o.UIButton},UIButtonGroup:function(){return o.UIButtonGroup},UIButtonState:function(){return o.UIButtonState},UICheckbox:function(){return n.UICheckbox},UIElement:function(){return s.UIElement},UIFileInput:function(){return n.UIFileInput},UIForm:function(){return n.UIForm},UIGroup:function(){return r.UIGroup},UIInput:function(){return n.UIInput},UIList:function(){return r.UIList},UISelect:function(){return n.UISelect},UISeparator:function(){return r.UISeparator},UISpacer:function(){return r.UISpacer},UITextArea:function(){return n.UITextArea},UITooltip:function(){return o.UITooltip}});var o=i(59400),s=i(96007),n=i(5658),r=i(64847),a=i(29434),l=i(56490),c=i(34396)},56490:function(t,e,i){"use strict";i.d(e,{Popup:function(){return o.Popup}});var o=i(51116)},51116:function(t,e,i){"use strict";i.d(e,{Popup:function(){return f}});var o=i(25045),s=i(31635),n=i(80251),r=i(84839),a=i(23211),l=i(28077),c=i(65946),u=i(28712),h=i(80991),d=i(96007),p=i(63468);let m=["escape","cut","delete","backSpaceAfterDelete","beforeCommandDelete"];class f extends p.UIGroup{className(){return"Popup"}appendChildToContainer(t){let e=this.getElm("content");(0,u.assert)(e,"Content element should exist"),a.Dom.append(e,t)}updateParentElement(t){return t!==this&&n.Component.isInstanceOf(t,f)&&(this.__childrenPopups.forEach(e=>{!t.closest(e)&&e.isOpened&&e.close()}),this.__childrenPopups.has(t)||this.j.e.on(t,"beforeClose",()=>{this.__childrenPopups.delete(t)}),this.__childrenPopups.add(t)),super.updateParentElement(t)}setContent(t){if(this.allChildren.length)throw Error("Remove children");if(n.Component.isInstanceOf(t,d.UIElement))this.append(t);else{let e=(0,c.isString)(t)?this.j.c.fromHTML(t):t;this.appendChildToContainer(e)}return this.updatePosition(),this}open(t,e=!1,i){if((0,c.markOwner)(this.jodit,this.container),this.container.classList.add("jodit_theme_"+this.jodit.o.theme),this.__calculateZIndex(),this.isOpened=!0,this.__addGlobalListeners(),this.__targetBound=e?this.getKeepBound(t):t,i)a.Dom.append(i,this.container);else{let t=(0,l.getContainer)(this.jodit,f);i!==this.container.parentElement&&a.Dom.append(t,this.container)}return this.updatePosition(),this.j.e.fire(this,"afterOpen"),this.j.e.fire("afterOpenPopup",this),this}__calculateZIndex(){if((0,h.cssInline)(this.container,"zIndex"))return;let t=t=>{let e=(0,h.cssInline)(t.container,"zIndex")||t.o.zIndex;return!!e&&(this.setZIndex(1+parseInt(e.toString(),10)),!0)},{j:e}=this;if(t(e))return;let i=this.parentElement;for(;i;){if(t(i.j))return;let e=(0,h.cssInline)(i.container,"zIndex");if(e)return void this.setZIndex(1+parseInt(e.toString(),10));if(!i.parentElement&&i.container.parentElement){let t=d.UIElement.closestElement(i.container.parentElement,d.UIElement);if(t){i=t;continue}}i=i.parentElement}}getKeepBound(t){let e=t(),i=(this.j.o.shadowRoot??this.od).elementFromPoint(e.left,e.top);if(!i)return t;let o=a.Dom.isHTMLElement(i)?i:i.parentElement,s=(0,c.position)(o,this.j);return()=>{let e=t(),i=(0,c.position)(o,this.j);return{...e,top:e.top+(i.top-s.top),left:e.left+(i.left-s.left)}}}updatePosition(){if(!this.isOpened)return this;let[t,e]=this.__calculatePosition(this.__targetBound(),this.viewBound(),(0,c.position)(this.container,this.j));this.setMod("strategy",e);let i=(0,c.getFixedPositionOffset)(this.container);return(0,c.css)(this.container,{left:t.left-i.x,top:t.top-i.y}),this.__childrenPopups.forEach(t=>t.updatePosition()),this}__throttleUpdatePosition(){this.updatePosition()}__calculatePosition(t,e,i,o=this.strategy){let s={left:t.left,right:t.left-(i.width-t.width)},n={bottom:t.top+t.height,top:t.top-i.height},r=Object.keys(s).reduce((t,e)=>t.concat(Object.keys(n).map(t=>`${e}${(0,c.ucfirst)(t)}`)),[]),a=t=>{let[e,o]=(0,c.kebabCase)(t).split("-");return{left:s[e],top:n[o],width:i.width,height:i.height}},l=t=>f.boxInView(a(o),t)?o:r.find(e=>{if(f.boxInView(a(e),t))return e})||null,u=l((0,c.position)(this.j.container,this.j));return u&&f.boxInView(a(u),e)||(u=l(e)||u||o),[a(u),u]}static boxInView(t,e){return t.top-e.top>=-2&&t.left-e.left>=-2&&e.top+e.height-(t.top+t.height)>=-2&&e.left+e.width-(t.left+t.width)>=-2}close(){if(!this.isOpened)return this;this.isOpened=!1,this.__childrenPopups.forEach(t=>t.close()),this.j.e.fire(this,"beforeClose"),this.j.e.fire("beforePopupClose",this),this.__removeGlobalListeners();let{activeElement:t}=this.od;return t&&t!==this.container&&a.Dom.isOrContains(this.container,t)&&(0,c.isFunction)(t.blur)&&t.blur(),a.Dom.safeRemove(this.container),this}__closeOnOutsideClick(t){!this.isOpened||this.isOwnClick(t)||this.close()}isOwnClick(t){if(!t.target)return!1;let e=d.UIElement.closestElement(t.target,f);return!!(e&&(this===e||e.closest(this)))}__addGlobalListeners(){let t=this.__throttleUpdatePosition,e=this.ow;l.eventEmitter.on("closeAllPopups",this.close),this.smart&&this.j.e.on(m,this.close).on("mousedown touchstart",this.__closeOnOutsideClick).on(e,"mousedown touchstart",this.__closeOnOutsideClick),this.j.e.on("closeAllPopups",this.close).on("resize",t).on(this.container,"scroll mousewheel",t).on(e,"scroll",t).on(e,"resize",t),a.Dom.up(this.j.container,e=>{e&&this.j.e.on(e,"scroll mousewheel",t)})}__removeGlobalListeners(){let t=this.__throttleUpdatePosition,e=this.ow;l.eventEmitter.off("closeAllPopups",this.close),this.smart&&this.j.e.off(m,this.close).off("mousedown touchstart",this.__closeOnOutsideClick).off(e,"mousedown touchstart",this.__closeOnOutsideClick),this.j.e.off("closeAllPopups",this.close).off("resize",t).off(this.container,"scroll mousewheel",t).off(e,"scroll",t).off(e,"resize",t),this.j.container.isConnected&&a.Dom.up(this.j.container,e=>{e&&this.j.e.off(e,"scroll mousewheel",t)})}setZIndex(t){(0,c.css)(this.container,"zIndex",t.toString())}render(){return`<div>
|
|
25
25
|
<div class="&__content"></div>
|
|
26
|
-
</div>`}destruct(){return this.close(),super.destruct()}constructor(t,e=!0){super(t),(0,o._)(this,"smart",void 0),(0,o._)(this,"isOpened",void 0),(0,o._)(this,"strategy",void 0),(0,o._)(this,"viewBound",void 0),(0,o._)(this,"__targetBound",void 0),(0,o._)(this,"__childrenPopups",void 0),this.smart=e,this.isOpened=!1,this.strategy="leftBottom",this.viewBound=()=>({left:0,top:0,width:this.ow.innerWidth,height:this.ow.innerHeight}),this.__childrenPopups=new Set,(0,c.attr)(this.container,"role","popup")}}(0,s.__decorate)([r.autobind],f.prototype,"updatePosition",null),(0,s.__decorate)([(0,r.throttle)(10),r.autobind],f.prototype,"__throttleUpdatePosition",null),(0,s.__decorate)([r.autobind],f.prototype,"close",null),(0,s.__decorate)([r.autobind],f.prototype,"__closeOnOutsideClick",null)},34396:function(t,e,i){"use strict";i.d(e,{ProgressBar:function(){return u}});var o=i(25045),s=i(23211),n=i(28077),r=i(23599),a=i(80991),l=i(96007),c=i(29434);class u extends l.UIElement{className(){return"ProgressBar"}render(){return"<div><div></div></div>"}show(){let t=this.j.workplace||this.j.container;return s.Dom.append(t,this.container),this}hide(){return s.Dom.safeRemove(this.container),this}progress(t){return(0,a.css)(this.container,"width",t.toFixed(2)+"%"),this}showFileUploadAnimation(t,e){this.__cleanUpAnimation();let i=(0,n.getContainer)(this.j,u),o=(0,r.position)(this.j.container,this.j),l=this.j.c.div(this.getFullElName("file-animation")),h=c.Icon.get("file","");h&&(l.innerHTML=h);let d=t??{x:o.width/2,y:0},p=e??{x:d.x+60,y:d.y-80};(0,a.css)(l,{left:o.left+d.x,top:o.top+d.y}),s.Dom.append(i,l),this.__animationElement=l,l.offsetWidth,(0,a.css)(l,{left:o.left+p.x,top:o.top+p.y,opacity:0,transform:"scale(0.4)"});let m=()=>{l.removeEventListener("transitionend",m),this.__cleanUpAnimation()};l.addEventListener("transitionend",m)}__cleanUpAnimation(){this.__animationElement&&(s.Dom.safeRemove(this.__animationElement),this.__animationElement=null)}destruct(){return this.__cleanUpAnimation(),this.hide(),super.destruct()}constructor(...t){super(...t),(0,o._)(this,"__animationElement",null)}}},2222:function(t,e,i){"use strict";i.d(e,{ViewWithToolbar:function(){return g}});var o=i(25045),s=i(31635),n=i(69364),r=i(49574),a=i(68616),l=i(23211),c=i(45664),u=i(85932),h=i(28723),d=i(4099),p=i(2496),m=i(35099),f=i(4274);class g extends m.View{get toolbarContainer(){return!this.o.fullsize&&((0,u.isString)(this.o.toolbar)||l.Dom.isHTMLElement(this.o.toolbar))?(0,h.resolveElement)(this.o.toolbar,this.o.shadowRoot||this.od):(this.o.toolbar&&this.__appendToolbarBox(),this.__defaultToolbarContainer)}__appendToolbarBox(){let t=this.__defaultToolbarContainer,e=this.container.firstElementChild;for(;e&&e!==t&&e.hasAttribute("data-jodit-above-toolbar");)e=e.nextElementSibling;e!==t&&(e?l.Dom.before(e,t):l.Dom.append(this.container,t))}setPanel(t){this.o.toolbar=t,this.buildToolbar()}buildToolbar(){if(!this.o.toolbar)return;let t=this.o.buttons?(0,c.splitArray)(this.o.buttons):[];this.toolbar?.setRemoveButtons(this.o.removeButtons).build(t.concat(this.o.extraButtons||[])).appendTo(this.toolbarContainer)}getRegisteredButtonGroups(){return this.groupToButtons}registerButton(t){this.registeredButtons.add(t);let e=t.group??"other";return this.groupToButtons[e]||(this.groupToButtons[e]=[]),null!=t.position?this.groupToButtons[e][t.position]=t.name:this.groupToButtons[e].push(t.name),this}unregisterButton(t){this.registeredButtons.delete(t);let e=t.group??"other",i=this.groupToButtons[e];if(i){let o=i.indexOf(t.name);-1!==o&&i.splice(o,1),0===i.length&&delete this.groupToButtons[e]}return this}beforeToolbarBuild(t){if(Object.keys(this.groupToButtons).length)return t.map(t=>(0,p.isButtonGroup)(t)&&t.group&&this.groupToButtons[t.group]?{group:t.group,buttons:[...t.buttons,...this.groupToButtons[t.group]]}:t)}destruct(){this.isDestructed||(this.setStatus(n.STATUSES.beforeDestruct),this.e.off("beforeToolbarBuild",this.beforeToolbarBuild),this.__tooltip.destruct(),this.toolbar.destruct(),this.toolbar=void 0,super.destruct())}constructor(t,e=!1){super(t,e),(0,o._)(this,"toolbar",(0,f.makeCollection)(this)),(0,o._)(this,"__defaultToolbarContainer",this.c.div("jodit-toolbar__box")),(0,o._)(this,"registeredButtons",new Set),(0,o._)(this,"groupToButtons",{}),(0,o._)(this,"isJodit",!1),(0,o._)(this,"__tooltip",new d.UITooltip(this)),this.isJodit=e,this.e.on("beforeToolbarBuild",this.beforeToolbarBuild)}}(0,s.__decorate)([(0,a.watch)(":rebuildToolbar")],g.prototype,"buildToolbar",null),(0,s.__decorate)([r.autobind],g.prototype,"beforeToolbarBuild",null)},35099:function(t,e,i){"use strict";i.d(e,{View:function(){return C}});var o=i(25045),s=i(31635),n=i(16964),r=i(80251),a=i(69364),l=i(81937),c=i(76517),u=i(51676),h=i(24968),d=i(29200),p=i(27795),m=i(1496),f=i(28077),g=i(65946),_=i(8006),v=i(24475),b=i(23183),y=i(81987),w=i(34396),S=i(10081);class C extends r.Component{get basePath(){return this.o.basePath?this.o.basePath:l.BASE_PATH}get minified(){return void 0!==this.o.minified?this.o.minified:l.BASE_PATH_IS_MIN}get defaultTimeout(){return(0,g.isVoid)(this.o.defaultTimeout)?100:this.o.defaultTimeout}get buffer(){return v.Storage.makeStorage()}get message(){return this.getMessageModule(this.container)}getMessageModule(t){return new S.UIMessages(this,t)}get storage(){return v.Storage.makeStorage(!0,this.id)}get asyncStorage(){return _.AsyncStorage.makeStorage(!0,this.id,this.o.asyncStorage)}get c(){return this.create}get container(){return this.__container}set container(t){this.__container=t}get e(){return this.events}get progressbar(){return new w.ProgressBar(this)}get options(){return this.__options}set options(t){this.__options=t}get o(){return this.options}i18n(t,...e){return(0,g.i18n)(t,e,this.options)}toggleFullSize(t){void 0===t&&(t=!this.__isFullSize),t!==this.__isFullSize&&(this.__isFullSize=t,this.e.fire("toggleFullSize",t))}get isLocked(){return""!==this.__whoLocked}lock(t="any"){return!this.isLocked&&(this.__whoLocked=t,!0)}unlock(){return!!this.isLocked&&(this.__whoLocked="",!0)}get isFullSize(){return this.__isFullSize}getVersion(){return C.version}static getVersion(){return C.version}initOptions(t){this.options=(0,g.ConfigProto)(t||{},(0,g.ConfigProto)(this.options||{},C.defaultOptions))}initOwners(){this.ownerWindow=this.o.ownerWindow??window}attachEvents(t){if(!t)return;let e=t?.events;e&&Object.keys(e).forEach(t=>this.e.on(t,e[t]))}getInstance(t,e){let i=(0,g.isFunction)(t)?t.prototype.className():t,o=this.e.fire((0,g.camelCase)("getInstance_"+i),e);if(o)return o;let s=(0,g.isFunction)(t)?t:f.modules[i],r=this.__modulesInstances;if(!(0,g.isFunction)(s))throw(0,g.error)("Need real module name");if(!r.has(i)){let t=s.prototype instanceof n.ViewComponent?new s(this,e):new s(e);this.components.add(t),r.set(i,t)}return r.get(i)}addDisclaimer(t){p.Dom.append(this.container,t)}beforeDestruct(){this.e.fire(a.STATUSES.beforeDestruct,this),this.components.forEach(t=>{(0,g.isDestructable)(t)&&!t.isInDestruct&&t.destruct()}),this.components.clear()}destruct(){this.isDestructed||((0,u.cached)(this,"progressbar")?.destruct(),(0,u.cached)(this,"message")?.destruct(),(0,u.cached)(this,"asyncStorage")?.close(),this.events&&(this.events.destruct(),this.events=void 0),(0,u.cached)(this,"buffer")?.clear(),p.Dom.safeRemove(this.container),super.destruct())}constructor(t,e=!1){super(),(0,o._)(this,"isJodit",void 0),(0,o._)(this,"isView",void 0),(0,o._)(this,"parent",void 0),(0,o._)(this,"mods",void 0),(0,o._)(this,"id",void 0),(0,o._)(this,"components",void 0),(0,o._)(this,"events",void 0),(0,o._)(this,"create",void 0),(0,o._)(this,"__container",void 0),(0,o._)(this,"OPTIONS",void 0),(0,o._)(this,"__options",void 0),(0,o._)(this,"__isFullSize",void 0),(0,o._)(this,"__whoLocked",void 0),(0,o._)(this,"isLockedNotBy",void 0),(0,o._)(this,"__modulesInstances",void 0),this.isJodit=e,this.isView=!0,this.parent=null,this.mods={},this.components=new Set,this.OPTIONS=C.defaultOptions,this.__isFullSize=!1,this.__whoLocked="",this.isLockedNotBy=t=>this.isLocked&&this.__whoLocked!==t,this.__modulesInstances=new Map,this.id=new Date().getTime().toString(),this.initOptions(t),this.initOwners(),this.events=t?.eventEmmiter??new m.EventEmitter(this.od),this.create=new c.Create(this.od),this.__container=this.c.div("jodit "+this.componentName)}}(0,o._)(C,"ES",l.ES),(0,o._)(C,"version",l.APP_VERSION),(0,o._)(C,"esNext",l.IS_ES_NEXT),(0,o._)(C,"esModern",l.IS_ES_MODERN),(0,o._)(C,"defaultOptions",void 0),(0,s.__decorate)([u.cache],C.prototype,"buffer",null),(0,s.__decorate)([u.cache],C.prototype,"message",null),(0,s.__decorate)([u.cache],C.prototype,"storage",null),(0,s.__decorate)([u.cache],C.prototype,"asyncStorage",null),(0,s.__decorate)([u.cache],C.prototype,"c",null),(0,s.__decorate)([u.cache],C.prototype,"e",null),(0,s.__decorate)([u.cache],C.prototype,"progressbar",null),(0,s.__decorate)([(0,d.hook)(a.STATUSES.beforeDestruct)],C.prototype,"beforeDestruct",null),(C=(0,s.__decorate)([(0,h.derive)(y.Mods,b.Elms)],C)).defaultOptions={extraButtons:[],cache:!0,textIcons:!1,namespace:"",removeButtons:[],zIndex:100002,defaultTimeout:100,fullsize:!1,showTooltip:!0,useNativeTooltip:!1,buttons:[],globalFullSize:!0,language:"auto"}},73302:function(t,e,i){"use strict";i.d(e,{Jodit:function(){return Jodit}});var o=i(25045),s=i(31635),n=i(81937),r=i(84839),a=i(28077),l=i(65946),c=i(80991),u=i(73714),h=i(80512),d=i(5266),p=i(60936);let m="data-jodit-default-style-display",f="data-jodit-default-classes",g={contenteditable:!1};class Jodit extends p.ViewWithToolbar{className(){return"Jodit"}waitForReady(){return this.isReady?Promise.resolve(this):this.async.promise(t=>{this.hookStatus("ready",()=>t(this))})}static get ready(){return new Promise(t=>{a.eventEmitter.on("joditready",t)})}get text(){if(this.editor)return this.editor.innerText||"";let t=this.createInside.div();return t.innerHTML=this.getElementValue(),t.innerText||""}get defaultTimeout(){return(0,l.isNumber)(this.o.defaultTimeout)?this.o.defaultTimeout:d.Config.defaultOptions.defaultTimeout}static atom(t){return(0,l.markAsAtomic)(t)}static make(t,e){return new this(t,e)}static isJoditAssigned(t){return t&&(0,l.isJoditObject)(t.component)&&!t.component.isInDestruct}static get defaultOptions(){return d.Config.defaultOptions}static configure(t){(0,l.ConfigMerge)(Jodit.defaultOptions,t)}get createInside(){return new p.Create(()=>this.ed,this.o.createAttributes)}__setPlaceField(t,e){this.currentPlace||(this.currentPlace={},this.places=[this.currentPlace]),this.currentPlace[t]=e}get element(){return this.currentPlace.element}get editor(){return this.currentPlace.editor}set editor(t){this.__setPlaceField("editor",t)}get container(){return this.currentPlace.container}set container(t){this.__setPlaceField("container",t)}get workplace(){return this.currentPlace.workplace}get message(){return this.getMessageModule(this.workplace)}get statusbar(){return this.currentPlace.statusbar}get iframe(){return this.currentPlace.iframe}set iframe(t){this.__setPlaceField("iframe",t)}get history(){return this.currentPlace.history}get editorWindow(){return this.currentPlace.editorWindow}set editorWindow(t){this.__setPlaceField("editorWindow",t)}get ew(){return this.editorWindow}get editorDocument(){return this.currentPlace.editorWindow.document}get ed(){return this.editorDocument}get options(){return this.currentPlace.options}set options(t){this.__options=t,this.__setPlaceField("options",t)}get s(){return this.selection}get uploader(){return this.getInstance("Uploader",this.o.uploader)}get filebrowser(){let t=this,e=(0,l.ConfigProto)({defaultTimeout:t.defaultTimeout,uploader:t.o.uploader,language:t.o.language,license:t.o.license,theme:t.o.theme,shadowRoot:t.o.shadowRoot,defaultCallback(e){e.files&&e.files.length&&e.files.forEach((i,o)=>{let s=e.baseurl+i;e.isImages&&e.isImages[o]?t.s.insertImage(s,null,t.o.imageDefaultWidth):t.s.insertNode(t.createInside.fromHTML(`<a href='${s}' title='${s}'>${s}</a>`))})}},this.o.filebrowser);return t.getInstance("FileBrowser",e)}get mode(){return this.__mode}set mode(t){this.setMode(t)}getNativeEditorValue(){let t=this.e.fire("beforeGetNativeEditorValue");return(0,l.isString)(t)?t:this.editor?this.editor.innerHTML:this.getElementValue()}setNativeEditorValue(t){let e={value:t};!this.e.fire("beforeSetNativeEditorValue",e)&&this.editor&&(this.editor.innerHTML=e.value)}get value(){return this.getEditorValue()}set value(t){this.setEditorValue(t),this.history.__processChanges()}synchronizeValues(){this.__imdSynchronizeValues()}__imdSynchronizeValues(){this.setEditorValue()}getEditorValue(t=!0,e){let i;if(void 0!==(i=this.e.fire("beforeGetValueFromEditor",e)))return i;i=this.getNativeEditorValue().replace(n.INVISIBLE_SPACE_REG_EXP(),""),t&&(i=i.replace(/<span[^>]+id="jodit-selection_marker_[^>]+><\/span>/g,"")),"<br>"===i&&(i="");let o={value:i};return this.e.fire("afterGetValueFromEditor",o,e),o.value}setEditorValue(t){let e=this.e.fire("beforeSetValueToEditor",t);if(!1===e)return;if((0,l.isString)(e)&&(t=e),!this.editor){void 0!==t&&this.__setElementValue(t);return}if(!(0,l.isString)(t)&&!(0,l.isVoid)(t))throw(0,l.error)("value must be string");(0,l.isVoid)(t)||this.getNativeEditorValue()===t||this.setNativeEditorValue(t),this.e.fire("postProcessSetEditorValue");let i=this.getElementValue(),o=this.getEditorValue();if(!this.__isSilentChange&&i!==o&&this.__callChangeCount<n.SAFE_COUNT_CHANGE_CALL){this.__setElementValue(o),this.__callChangeCount+=1,n.IS_PROD||this.__callChangeCount;try{this.history.__upTick(),this.e.fire("change",o,i),this.e.fire(this.history,"change",o,i)}finally{this.__callChangeCount=0}}}updateElementValue(){this.__setElementValue(this.getEditorValue())}getElementValue(){return void 0!==this.element.value?this.element.value:this.element.innerHTML}__setElementValue(t){if(!(0,l.isString)(t))throw(0,l.error)("value must be string");if(this.element!==this.container&&t!==this.getElementValue()){let e={value:t},i=this.e.fire("beforeSetElementValue",e);(0,l.callPromise)(i,()=>{void 0!==this.element.value?this.element.value=e.value:this.element.innerHTML=e.value,this.e.fire("afterSetElementValue",e)})}}registerCommand(t,e,i){let o=t.toLowerCase(),s=this.commands.get(o);if(void 0===s&&(s=[],this.commands.set(o,s)),s.push(e),!(0,l.isFunction)(e)){let s=this.o.commandToHotkeys[o]||this.o.commandToHotkeys[t]||e.hotkeys;s&&this.registerHotkeyToCommand(s,o,i?.stopPropagation)}return this}registerHotkeyToCommand(t,e,i=!0){let o=(0,l.asArray)(t).map(l.normalizeKeyAliases).map(t=>t+".hotkey").join(" ");this.e.off(o).on(o,(t,o)=>(o&&(o.shouldStop=i??!0),this.execCommand(e)))}execCommand(t,e,i,...o){let s;if(this.s.isFocused()||this.s.focus(),!this.o.readonly||this.o.allowCommandsInReadOnly.includes(t)){if(t=t.toLowerCase(),!1!==(s=this.e.fire("beforeCommand"+(0,l.ucfirst)(t),e,i,...o))&&(s=this.e.fire("beforeCommand",t,e,i,...o)),!1!==s&&(s=this.__execCustomCommands(t,e,i,...o)),!1!==s){this.s.focus();try{s=this.nativeExecCommand(t,e,i)}catch(t){if(!n.IS_PROD)throw t}}return this.e.fire("afterCommand",t,e,i),this.__imdSynchronizeValues(),s}}nativeExecCommand(t,e,i){this.__isSilentChange=!0;try{return this.ed.execCommand(t,e,i)}finally{this.__isSilentChange=!1}}__execCustomCommands(t,e,i,...o){t=t.toLowerCase();let s=this.commands.get(t);if(void 0!==s){let n;return s.forEach(s=>{let r=((0,l.isFunction)(s)?s:s.exec).call(this,t,e,i,...o);void 0!==r&&(n=r)}),n}}lock(t="any"){return!!super.lock(t)&&(this.__selectionLocked=this.s.save(),this.s.clear(),this.container.classList.add("jodit_lock"),this.e.fire("lock",!0),!0)}unlock(){return!!super.unlock()&&(this.container.classList.remove("jodit_lock"),this.__selectionLocked&&this.s.restore(),this.e.fire("lock",!1),!0)}getMode(){return this.mode}isEditorMode(){return this.getRealMode()===n.MODE_WYSIWYG}getRealMode(){if(this.getMode()!==n.MODE_SPLIT)return this.getMode();let t=this.od.activeElement;return t&&(t===this.iframe||p.Dom.isOrContains(this.editor,t)||p.Dom.isOrContains(this.toolbar.container,t))?n.MODE_WYSIWYG:n.MODE_SOURCE}setMode(t){let e=this.getMode(),i={mode:parseInt(t.toString(),10)},o=["jodit-wysiwyg_mode","jodit-source__mode","jodit_split_mode"];!1!==this.e.fire("beforeSetMode",i)&&(this.__mode=[n.MODE_SOURCE,n.MODE_WYSIWYG,n.MODE_SPLIT].includes(i.mode)?i.mode:n.MODE_WYSIWYG,this.o.saveModeInStorage&&this.storage.set("jodit_default_mode",this.mode),o.forEach(t=>{this.container.classList.remove(t)}),this.container.classList.add(o[this.mode-1]),e!==this.getMode()&&this.e.fire("afterSetMode"))}toggleMode(){let t=this.getMode();[n.MODE_SOURCE,n.MODE_WYSIWYG,this.o.useSplitMode?n.MODE_SPLIT:9].includes(t+1)?t+=1:t=n.MODE_WYSIWYG,this.setMode(t)}setDisabled(t){this.o.disabled=t;let e=this.__wasReadOnly;this.setReadOnly(t||e),this.__wasReadOnly=e,this.editor&&((0,l.attr)(this.editor,"aria-disabled",t),this.container.classList.toggle("jodit_disabled",t),this.e.fire("disabled",t))}getDisabled(){return this.o.disabled}setReadOnly(t){this.__wasReadOnly!==t&&(this.__wasReadOnly=t,this.o.readonly=t,t?this.editor&&(0,l.attr)(this.editor,"contenteditable",null):this.editor&&(0,l.attr)(this.editor,"contenteditable",!0),this.e&&this.e.fire("readonly",t))}getReadOnly(){return this.o.readonly}focus(){this.getMode()!==n.MODE_SOURCE&&this.s.focus()}get isFocused(){return this.s.isFocused()}beforeInitHook(){}afterInitHook(){}initOptions(t){this.options=(0,l.ConfigProto)(t||{},d.Config.defaultOptions)}initOwners(){this.editorWindow=this.o.ownerWindow,this.ownerWindow=this.o.ownerWindow}addPlace(t,e){let i=(0,l.resolveElement)(t,this.o.shadowRoot||this.od);this.attachEvents(e),i.attributes&&(0,l.toArray)(i.attributes).forEach(t=>{let i=t.name,o=t.value;void 0===d.Config.defaultOptions[i]||e&&void 0!==e[i]||(-1!==["readonly","disabled"].indexOf(i)&&(o=""===o||"true"===o),/^[0-9]+(\.)?([0-9]+)?$/.test(o.toString())&&(o=Number(o)),this.options[i]=o)});let o=this.c.div("jodit-container");o.classList.add("jodit"),o.classList.add("jodit-container"),o.classList.add("jodit_theme_"+(this.o.theme||"default")),_(this.o.className,o),this.o.containerStyle&&(0,l.css)(o,this.o.containerStyle);let{styleValues:s}=this.o;Object.keys(s).forEach(t=>{let e=(0,l.kebabCase)(t);o.style.setProperty("--jd-"+e,s[t])}),(0,l.attr)(o,"contenteditable",!1);let n=null;if(this.o.inline&&(-1===["TEXTAREA","INPUT"].indexOf(i.nodeName)&&(o=i,(0,l.attr)(i,f,i.className.toString()),n=o.innerHTML,p.Dom.detach(o)),o.classList.add("jodit_inline"),o.classList.add("jodit-container")),i!==o){let t=(0,c.cssInline)(i,"display");t&&(0,l.attr)(i,m,t),(0,l.css)(i,"display","none")}let r="workplace-slot",a=this.c.div(this.getFullElName(r,"above"),g);(0,l.attr)(a,"data-jodit-above-toolbar",""),p.Dom.appendChildFirst(o,a);let u=this.c.div(this.getFullElName(r,"top"),g);p.Dom.append(o,u);let h=this.c.div(this.getFullElName(r,"center"),g),v=this.c.div("jodit-workplace",g),b=this.c.div(this.getFullElName(r,"left"),g),y=this.c.div(this.getFullElName(r,"right"),g);p.Dom.append(h,b),p.Dom.append(h,v),p.Dom.append(h,y),p.Dom.append(o,h);let w=this.c.div(this.getFullElName(r,"bottom"),g);p.Dom.append(o,w),i.parentNode&&i!==o&&p.Dom.before(i,o),Object.defineProperty(i,"component",{enumerable:!1,configurable:!0,value:this});let S=this.c.div("jodit-wysiwyg",{contenteditable:!0,"aria-disabled":!1,tabindex:this.o.tabIndex});p.Dom.append(v,S);let C={editor:S,element:i,container:o,workplace:v,slots:{above:a,top:u,bottom:w,center:h,left:b,right:y},statusbar:new p.StatusBar(this,o),options:this.isReady?(0,l.ConfigProto)(e||{},d.Config.defaultOptions):this.options,history:new p.History(this),editorWindow:this.ow};this.__elementToPlace.set(S,C),this.setCurrentPlace(C),this.places.push(C),this.setNativeEditorValue(this.getElementValue());let E=this.__initEditor(n),I=this.options,D=()=>{I.enableDragAndDropFileToEditor&&I.uploader&&(I.uploader.url||I.uploader.insertImageAsBase64URI)?this.uploader.bind(this.editor):I.enableDragAndDropFileToEditor||this.e.on(S,"drop",t=>{t.dataTransfer?.files?.length&&t.preventDefault()}),this.__elementToPlace.get(this.editor)||this.__elementToPlace.set(this.editor,C),this.e.fire("afterAddPlace",C)};return(0,l.callPromise)(E,D)}addDisclaimer(t){p.Dom.append(this.workplace,t)}setCurrentPlace(t){this.currentPlace!==t&&(this.isEditorMode()||this.setMode(n.MODE_WYSIWYG),this.currentPlace=t,this.buildToolbar(),this.isReady&&this.e.fire("changePlace",t))}__initEditor(t){let e=this.__createEditor();return(0,l.callPromise)(e,()=>{if(this.isInDestruct)return;if(this.element!==this.container){let t=this.getElementValue();t!==this.getEditorValue()&&this.setEditorValue(t)}else null!=t&&this.setEditorValue(t);let e=this.o.defaultMode;if(this.o.saveModeInStorage){let t=this.storage.get("jodit_default_mode");"string"==typeof t&&(e=parseInt(t,10))}this.setMode(e),this.o.readonly&&(this.__wasReadOnly=!1,this.setReadOnly(!0)),this.o.disabled&&this.setDisabled(!0);try{this.ed.execCommand("defaultParagraphSeparator",!1,this.o.enter.toLowerCase())}catch{}})}__createEditor(){let t=this.editor,e=this.e.fire("createEditor",this);return(0,l.callPromise)(e,()=>{!this.isInDestruct&&((!1===e||(0,l.isPromise)(e))&&p.Dom.safeRemove(t),_(this.o.editorClassName,this.editor),this.o.style&&(0,l.css)(this.editor,this.o.style),this.e.on("synchro",()=>{this.setEditorValue()}).on("focus",()=>{this.editorIsActive=!0}).on("blur",()=>this.editorIsActive=!1),this.__prepareWYSIWYGEditor(),this.o.triggerChangeEvent&&this.e.on("change",this.async.debounce(()=>{this.e&&this.e.fire(this.element,"change")},this.defaultTimeout)))})}__prepareWYSIWYGEditor(){let{editor:t}=this;if(this.o.direction){let t="rtl"===this.o.direction.toLowerCase()?"rtl":"ltr";(0,l.css)(this.editor,"direction",t),(0,l.attr)(this.editor,"dir",t),(0,l.css)(this.container,"direction",t),(0,l.attr)(this.container,"dir",t),this.toolbar.setDirection(t)}this.e.on(t,"mousedown touchstart focus",()=>{let e=this.__elementToPlace.get(t);e&&this.setCurrentPlace(e)}).on(t,"compositionend",this.synchronizeValues).on(t,"selectionchange selectionstart keydown keyup input keypress dblclick mousedown mouseup click copy cut dragstart drop dragover paste resize touchstart touchend focus blur",t=>{if(!this.o.readonly&&!this.__isSilentChange&&(!(t instanceof this.ew.KeyboardEvent)||!t.isComposing)&&this.e&&this.e.fire){if(!1===this.e.fire(t.type,t))return!1;this.synchronizeValues()}}).on(this.ow,"mouseup",e=>{if(this.o.readonly||this.__isSilentChange)return;let i=e.target;!(i&&(0,l.isNumber)(i.nodeType)&&t.contains(i))&&this.s.isInsideArea&&(this.e.fire("changeSelection"),this.synchronizeValues())})}fetch(t,e){let i=new u.Ajax({url:t,...e},this.o.defaultAjaxOptions),o=()=>{this.e.off("beforeDestruct",o),this.progressbar.progress(100).hide(),i.destruct()};this.e.one("beforeDestruct",o),this.progressbar.show().progress(30);let s=i.send();return s.finally(o).catch(()=>null),s}destruct(){if(this.isInDestruct)return;this.setStatus(p.STATUSES.beforeDestruct),this.__elementToPlace.clear(),(0,r.cached)(this,"storage")?.clear(),(0,r.cached)(this,"buffer")?.clear(),this.commands.clear(),this.__selectionLocked=null,this.e.off(this.ow,"resize"),this.e.off(this.ow),this.e.off(this.od),this.e.off(this.od.body);let t=this.editor?this.getEditorValue():"";this.places.forEach(({container:e,workplace:i,statusbar:o,element:s,iframe:n,editor:r,history:a})=>{if(s){if(s!==e)if(s.hasAttribute(m)){let t=(0,l.attr)(s,m);t&&((0,l.css)(s,"display",t),(0,l.attr)(s,m,null))}else(0,l.css)(s,"display","");else s.hasAttribute(f)&&(s.className=(0,l.attr)(s,f)||"",(0,l.attr)(s,f,null));s.hasAttribute("style")&&!(0,l.attr)(s,"style")&&(0,l.attr)(s,"style",null),o.destruct(),this.e.off(e),this.e.off(s),this.e.off(r),p.Dom.safeRemove(i),p.Dom.safeRemove(r),e!==s&&p.Dom.safeRemove(e),Object.defineProperty(s,"component",{enumerable:!1,configurable:!0,value:null}),p.Dom.safeRemove(n),e===s&&(s.innerHTML=t),a.destruct()}}),this.places.length=0,this.currentPlace={},delete a.instances[this.id],super.destruct()}constructor(t,e){super(e,!0),(0,o._)(this,"isJodit",!0),(0,o._)(this,"commands",new Map),(0,o._)(this,"__selectionLocked",null),(0,o._)(this,"__wasReadOnly",!1),(0,o._)(this,"editorIsActive",!1),(0,o._)(this,"selection",void 0),(0,o._)(this,"__mode",n.MODE_WYSIWYG),(0,o._)(this,"__callChangeCount",0),(0,o._)(this,"__isSilentChange",!1),(0,o._)(this,"currentPlace",{options:this.__options,container:this.__container}),(0,o._)(this,"places",[]),(0,o._)(this,"__elementToPlace",new Map);try{const e=(0,l.resolveElement)(t,this.options.shadowRoot||this.od);if(Jodit.isJoditAssigned(e))return e.component}catch(t){if(!n.IS_PROD)throw t;throw this.destruct(),t}this.setStatus(p.STATUSES.beforeInit),this.id=(0,l.attr)((0,l.resolveElement)(t,this.o.shadowRoot||this.od),"id")||new Date().getTime().toString(),a.instances[this.id]=this,this.attachEvents(e),this.e.on(this.ow,"resize",()=>{this.e&&this.e.fire("resize")}),this.e.on("prepareWYSIWYGEditor",this.__prepareWYSIWYGEditor),this.selection=new p.Selection(this);const i=this.beforeInitHook();(0,l.callPromise)(i,()=>{if(this.isInDestruct)return;this.e.fire("beforeInit",this),a.pluginSystem.__init(this),this.e.fire("afterPluginSystemInit",this),this.e.on("changePlace",()=>{this.setReadOnly(this.o.readonly),this.setDisabled(this.o.disabled)}),this.places.length=0;let i=this.addPlace(t,e);a.instances[this.id]=this;let o=()=>{this.isInDestruct||(this.e&&this.e.fire("afterInit",this),(0,l.callPromise)(this.afterInitHook()),this.setStatus(p.STATUSES.ready),this.e.fire("afterConstructor",this))};(0,l.callPromise)(i,o)})}}function _(t,e){t&&t.split(/\s+/).forEach(t=>e.classList.add(t))}(0,o._)(Jodit,"fatMode",n.FAT_MODE),(0,o._)(Jodit,"plugins",a.pluginSystem),(0,o._)(Jodit,"modules",a.modules),(0,o._)(Jodit,"ns",a.modules),(0,o._)(Jodit,"decorators",{}),(0,o._)(Jodit,"constants",n),(0,o._)(Jodit,"instances",a.instances),(0,o._)(Jodit,"lang",n.lang),(0,o._)(Jodit,"core",{Plugin:p.Plugin}),(0,s.__decorate)([r.cache],Jodit.prototype,"createInside",null),(0,s.__decorate)([r.cache],Jodit.prototype,"message",null),(0,s.__decorate)([r.cache],Jodit.prototype,"s",null),(0,s.__decorate)([r.cache],Jodit.prototype,"uploader",null),(0,s.__decorate)([r.cache],Jodit.prototype,"filebrowser",null),(0,s.__decorate)([(0,r.throttle)()],Jodit.prototype,"synchronizeValues",null),(0,s.__decorate)([(0,r.watch)(":internalChange")],Jodit.prototype,"updateElementValue",null),(0,s.__decorate)([r.autobind],Jodit.prototype,"__prepareWYSIWYGEditor",null),Jodit=(0,s.__decorate)([(0,r.derive)(h.Dlgs)],Jodit)},89317:function(t,e,i){"use strict";var o=i(17312),s=i(41324),n=i.n(s),r=i(63837),a=i(53414);let l={};l={ar:n(),cs_cz:n(),de:n(),en:r,es:n(),fa:n(),fi:n(),fr:n(),he:n(),hu:n(),id:n(),it:n(),ja:n(),ko:n(),mn:n(),nl:n(),no:n(),pl:n(),pt_br:n(),ru:n(),sk:n(),sv:n(),tr:n(),ua:n(),zh_cn:n(),zh_tw:n()};let c=t=>t?t.default||t:{},u={};(0,o.isArray)(c(a))&&c(a).forEach((t,e)=>{u[e]=t}),Object.keys(l).forEach(t=>{let e=c(l[t]);(0,o.isArray)(e)?(l[t]={},e.forEach((e,i)=>{l[t][u[i]]=e})):l[t]=e}),e.default=l},67399:function(t,e,i){"use strict";i.d(e,{ContextMenu:function(){return l}});var o=i(31635),s=i(91672),n=i(17312),r=i(53681),a=i(51116);class l extends a.Popup{className(){return"ContextMenu"}show(t,e,i){let o=this;o.clear(),(0,n.isArray)(i)&&(i.forEach(t=>{if(!t)return;let e=(0,r.Button)(this.jodit,t.icon||"empty",t.title);this.jodit&&e.setParentView(this.jodit),e.setMod("context","menu"),e.onAction(e=>(t.exec?.call(o,e),o.clear(),o.close(),!1)),this.append(e)}),this.open(()=>({left:t,top:e,width:0,height:0}),!0))}}l=(0,o.__decorate)([s.component],l)},91535:function(t,e,i){"use strict";i.d(e,{Alert:function(){return l}});var o=i(23211),s=i(78982),n=i(91565),r=i(53681),a=i(76841);function l(t,e,i,c="jodit-dialog_alert"){(0,n.isFunction)(e)&&(i=e,e=void 0);let u=this instanceof a.Dialog?this:new a.Dialog({closeOnClickOverlay:!0}),h=u.c.div(c),d=(0,r.Button)(u,"ok","Ok");return(0,s.asArray)(t).forEach(t=>{o.Dom.append(h,o.Dom.isNode(t)?t:u.c.fromHTML(t))}),d.onAction(()=>{i&&(0,n.isFunction)(i)&&!1===i(u)||u.close()}),u.setFooter([d]),u.open(h,e||" ",!0,!0),d.focus(),u}},88329:function(t,e,i){"use strict";i.d(e,{Confirm:function(){return a}});var o=i(23211),s=i(91565),n=i(53681),r=i(76841);function a(t,e,i){let a=this instanceof r.Dialog?this:new r.Dialog({closeOnClickOverlay:!0}),l=a.c.fromHTML('<form class="jodit-dialog_prompt"></form>'),c=a.c.element("label");(0,s.isFunction)(e)&&(i=e,e=void 0),o.Dom.append(c,a.c.fromHTML(t)),o.Dom.append(l,c);let u=t=>()=>{i&&!1===i(t)||a.close()},h=(0,n.Button)(a,"cancel","Cancel"),d=(0,n.Button)(a,"ok","Yes");return h.onAction(u(!1)),d.onAction(u(!0)),a.e.on(l,"submit",()=>(u(!0)(),!1)),a.setFooter([d,h]),a.open(l,e||" ",!0,!0),d.focus(),a}},76841:function(t,e,i){"use strict";i.d(e,{Dialog:function(){return v}});var o=i(25045),s=i(31635),n=i(16964),r=i(81937),a=i(84839),l=i(23211),c=i(28077),u=i(45664),h=i(28686),d=i(93640),p=i(28712),m=i(4099),f=i(35099),g=i(2222),_=i(5266);_.Config.prototype.dialog={namespace:"",extraButtons:[],resizable:!0,draggable:!0,buttons:["dialog.close"],removeButtons:[],toolbarButtonSize:"middle",zIndex:"inherit"},_.Config.prototype.controls.dialog={close:{icon:"cancel",exec(t){t.close()}}};class v extends g.ViewWithToolbar{className(){return"Dialog"}get destination(){let{popupRoot:t,shadowRoot:e}=this.o;return t||e||this.od.body}setElements(t,e){let i=[];(0,u.asArray)(e).forEach(e=>{let o;if((0,h.isArray)(e)){let o=this.c.div(this.getFullElName("column"));return i.push(o),l.Dom.append(t,o),this.setElements(o,e)}o=(0,h.isString)(e)?this.c.fromHTML(e):(0,h.hasContainer)(e)?e.container:e,i.push(o),o.parentNode!==t&&l.Dom.append(t,o)}),(0,u.toArray)(t.childNodes).forEach(t=>{-1===i.indexOf(t)&&l.Dom.safeRemove(t)})}__onMouseUp(){(this.draggable||this.resizable)&&(this.__removeGlobalResizeListeners(),this.draggable=!1,this.resizable=!1,this.unlockSelect(),this.e&&(this.__removeGlobalResizeListeners(),this.e.fire(this,"endResize endMove")))}__onHeaderMouseDown(t){let e=t.target;!(!this.o.draggable||e&&e.nodeName.match(/^(INPUT|SELECT)$/))&&(this.draggable=!0,this.startX=t.clientX,this.startY=t.clientY,this.startPoint.x=(0,d.css)(this.dialog,"left"),this.startPoint.y=(0,d.css)(this.dialog,"top"),this.setMaxZIndex(),t.cancelable&&t.preventDefault(),this.lockSelect(),this.__addGlobalResizeListeners(),this.e&&(this.e.fire(this,"startMove"),this.e.fire("closeAllPopups")))}__onMouseMove(t){this.draggable&&this.o.draggable&&(this.setPosition(this.startPoint.x+t.clientX-this.startX,this.startPoint.y+t.clientY-this.startY),this.e&&this.e.fire(this,"move",t.clientX-this.startX,t.clientY-this.startY),t.stopImmediatePropagation()),this.resizable&&this.o.resizable&&(this.setSize(Math.max(this.startPoint.w+t.clientX-this.startX,this.minSize.w),Math.max(this.startPoint.h+t.clientY-this.startY,this.minSize.h)),this.e&&this.e.fire(this,"resizeDialog",t.clientX-this.startX,t.clientY-this.startY))}__onEsc(t){if(this.o.closeOnEsc&&this.isOpened&&t.key===r.KEY_ESC&&!0!==this.getMod("static")){let e=this.getMaxZIndexDialog();e?e.close():this.close(),t.stopImmediatePropagation()}}__onResizerMouseDown(t){this.resizable=!0,this.startX=t.clientX,this.startY=t.clientY,this.startPoint.w=this.dialog.offsetWidth,this.startPoint.h=this.dialog.offsetHeight;let e=this.getElm("header"),i=this.getElm("footer"),o=this.getElm("content"),s=o&&parseFloat(this.ow.getComputedStyle(o).minHeight)||0;this.minSize.w=(0,h.isNumber)(this.o.minWidth)?this.o.minWidth:Math.max(100,i?.scrollWidth??0),this.minSize.h=(0,h.isNumber)(this.o.minHeight)?this.o.minHeight:(e?.offsetHeight??0)+(i?.offsetHeight??0)+s+this.resizer.offsetHeight,this.lockSelect(),this.__addGlobalResizeListeners(),this.e&&this.e.fire(this,"startResize")}__addGlobalResizeListeners(){this.e.on(this.ow,"pointermove touchmove",this.__onMouseMove).on(this.ow,"pointerup touchend",this.__onMouseUp)}__removeGlobalResizeListeners(){this.e.off(this.ow,"mousemove pointermove",this.__onMouseMove).off(this.ow,"mouseup pointerup",this.__onMouseUp)}setSize(t,e){return null==t&&(t=this.dialog.offsetWidth),null==e&&(e=this.dialog.offsetHeight),(0,d.css)(this.dialog,{width:t,height:e}),this}calcAutoSize(){return this.setSize("auto","auto"),this.setSize(),this}setPosition(t,e){let i=this.ow.innerWidth,o=this.ow.innerHeight,s=i/2-this.dialog.offsetWidth/2,n=o/2-this.dialog.offsetHeight/2;return s<0&&(s=0),n<0&&(n=0),void 0!==t&&void 0!==e&&(this.offsetX=t,this.offsetY=e,this.moved=Math.abs(t-s)>100||Math.abs(e-n)>100),(0,d.css)(this.dialog,{left:(t||s)+"px",top:(e||n)+"px"}),this}setHeader(t){return this.setElements(this.dialogbox_header,t),this}setContent(t){return this.setElements(this.dialogbox_content,t),this}setFooter(t){return this.setElements(this.dialogbox_footer,t),this.setMod("footer",!!t),this}__openedSiblings(){let t=[];return v.__opened.forEach(e=>{e.destination===this.destination&&t.push(e)}),t}getZIndex(){return parseInt((0,d.css)(this.container,"zIndex"),10)||0}getMaxZIndexDialog(){let t=0,e=this;return this.__openedSiblings().forEach(i=>{let o=i.getZIndex();o>t&&(e=i,t=o)}),e}setMaxZIndex(){if(this.getMod("static"))return;let t=0x1312d04;this.__openedSiblings().forEach(e=>{t=Math.max(e.getZIndex(),t)}),(0,d.css)(this.container,"zIndex",(t+1).toString())}toggleFullSize(t){(0,h.isVoid)(t)&&(t=!this.getMod("fullsize")),this.setMod("fullsize",t),super.toggleFullSize(t)}open(t,e,i,o){if(c.eventEmitter.fire("closeAllPopups hideHelpers"),!1===this.e.fire(this,"beforeOpen"))return this;(0,h.isBoolean)(t)&&(i=t),(0,h.isBoolean)(e)&&(o=e),this.destroyAfterClose=!0===i;let s=(0,h.isBoolean)(t)?void 0:t,n=(0,h.isBoolean)(e)?void 0:e;return void 0!==n&&this.setHeader(n),s&&this.setContent(s),this.setMod("active",!0),this.isOpened=!0,v.__opened.add(this),this.setModal(o),l.Dom.append(this.destination,this.container),!0!==this.getMod("static")?(this.setPosition(this.offsetX,this.offsetY),this.setMaxZIndex()):(0,d.css)(this.container,"zIndex",null),this.o.fullsize&&this.toggleFullSize(!0),this.e.fire("afterOpen",this),this}setModal(t){return this.isModal=!!t,this.setMod("modal",this.isModal),this}close(){if(this.isDestructed||!this.isOpened||!0===this.getMod("static"))return this;let{e:t}=this;return!1===t.fire(this,"beforeClose")||!1===t.fire("beforeClose",this)||(this.setMod("active",!1),this.isOpened=!1,v.__opened.delete(this),this.isFullSize&&this.toggleFullSize(!1),l.Dom.safeRemove(this.container),this.__removeGlobalResizeListeners(),t.fire(this,"afterClose"),this.isInDestruct||t.fire(this.ow,"joditCloseDialog"),this.destroyAfterClose&&this.destruct()),this}buildToolbar(){this.o.buttons&&this.toolbar.build((0,u.splitArray)(this.o.buttons)).setMod("mode","header").appendTo(this.dialogbox_toolbar)}destruct(){this.isInDestruct||(this.setStatus(n.STATUSES.beforeDestruct),this.isOpened&&this.close(),v.__opened.delete(this),this.events&&(this.__removeGlobalResizeListeners(),this.events.off(this.container,"close_dialog",self.close).off(this.ow,"keydown",this.__onEsc).off(this.ow,"resize",this.__onResize)),super.destruct())}constructor(t={}){super(t),(0,o._)(this,"resizer",void 0),(0,o._)(this,"offsetX",void 0),(0,o._)(this,"offsetY",void 0),(0,o._)(this,"destroyAfterClose",!1),(0,o._)(this,"moved",!1),(0,o._)(this,"resizable",!1),(0,o._)(this,"draggable",!1),(0,o._)(this,"startX",0),(0,o._)(this,"startY",0),(0,o._)(this,"startPoint",{x:0,y:0,w:0,h:0}),(0,o._)(this,"lockSelect",()=>{this.setMod("moved",!0)}),(0,o._)(this,"unlockSelect",()=>{this.setMod("moved",!1)}),(0,o._)(this,"__onResize",()=>{this.options&&this.o.resizable&&!this.moved&&this.isOpened&&!this.offsetX&&!this.offsetY&&this.setPosition()}),(0,o._)(this,"minSize",{w:0,h:0}),(0,o._)(this,"dialog",void 0),(0,o._)(this,"workplace",void 0),(0,o._)(this,"dialogbox_header",void 0),(0,o._)(this,"dialogbox_content",void 0),(0,o._)(this,"dialogbox_footer",void 0),(0,o._)(this,"dialogbox_toolbar",void 0),(0,o._)(this,"isModal",!1),(0,o._)(this,"isOpened",!1),this.options=(0,d.ConfigProto)(t,(0,d.ConfigProto)(_.Config.prototype.dialog,v.defaultOptions)),this.attachEvents(this.options),l.Dom.safeRemove(this.container);const e=this.getFullElName.bind(this);this.container=this.c.fromHTML(`<div class="jodit jodit-dialog ${this.componentName}">
|
|
26
|
+
</div>`}destruct(){return this.close(),super.destruct()}constructor(t,e=!0){super(t),(0,o._)(this,"smart",void 0),(0,o._)(this,"isOpened",void 0),(0,o._)(this,"strategy",void 0),(0,o._)(this,"viewBound",void 0),(0,o._)(this,"__targetBound",void 0),(0,o._)(this,"__childrenPopups",void 0),this.smart=e,this.isOpened=!1,this.strategy="leftBottom",this.viewBound=()=>({left:0,top:0,width:this.ow.innerWidth,height:this.ow.innerHeight}),this.__childrenPopups=new Set,(0,c.attr)(this.container,"role","popup")}}(0,s.__decorate)([r.autobind],f.prototype,"updatePosition",null),(0,s.__decorate)([(0,r.throttle)(10),r.autobind],f.prototype,"__throttleUpdatePosition",null),(0,s.__decorate)([r.autobind],f.prototype,"close",null),(0,s.__decorate)([r.autobind],f.prototype,"__closeOnOutsideClick",null)},34396:function(t,e,i){"use strict";i.d(e,{ProgressBar:function(){return u}});var o=i(25045),s=i(23211),n=i(28077),r=i(23599),a=i(80991),l=i(96007),c=i(29434);class u extends l.UIElement{className(){return"ProgressBar"}render(){return"<div><div></div></div>"}show(){let t=this.j.workplace||this.j.container;return s.Dom.append(t,this.container),this}hide(){return s.Dom.safeRemove(this.container),this}progress(t){return(0,a.css)(this.container,"width",t.toFixed(2)+"%"),this}showFileUploadAnimation(t,e){this.__cleanUpAnimation();let i=(0,n.getContainer)(this.j,u),o=(0,r.position)(this.j.container,this.j),l=this.j.c.div(this.getFullElName("file-animation")),h=c.Icon.get("file","");h&&(l.innerHTML=h);let d=t??{x:o.width/2,y:0},p=e??{x:d.x+60,y:d.y-80};(0,a.css)(l,{left:o.left+d.x,top:o.top+d.y}),s.Dom.append(i,l),this.__animationElement=l,l.offsetWidth,(0,a.css)(l,{left:o.left+p.x,top:o.top+p.y,opacity:0,transform:"scale(0.4)"});let m=()=>{l.removeEventListener("transitionend",m),this.__cleanUpAnimation()};l.addEventListener("transitionend",m)}__cleanUpAnimation(){this.__animationElement&&(s.Dom.safeRemove(this.__animationElement),this.__animationElement=null)}destruct(){return this.__cleanUpAnimation(),this.hide(),super.destruct()}constructor(...t){super(...t),(0,o._)(this,"__animationElement",null)}}},2222:function(t,e,i){"use strict";i.d(e,{ViewWithToolbar:function(){return g}});var o=i(25045),s=i(31635),n=i(69364),r=i(49574),a=i(68616),l=i(23211),c=i(45664),u=i(85932),h=i(28723),d=i(4099),p=i(2496),m=i(35099),f=i(4274);class g extends m.View{get toolbarContainer(){return!this.o.fullsize&&((0,u.isString)(this.o.toolbar)||l.Dom.isHTMLElement(this.o.toolbar))?(0,h.resolveElement)(this.o.toolbar,this.o.shadowRoot||this.od):(this.o.toolbar&&this.__appendToolbarBox(),this.__defaultToolbarContainer)}__appendToolbarBox(){let t=this.__defaultToolbarContainer,e=this.container.firstElementChild;for(;e&&e!==t&&e.hasAttribute("data-jodit-above-toolbar");)e=e.nextElementSibling;e!==t&&(e?l.Dom.before(e,t):l.Dom.append(this.container,t))}setPanel(t){this.o.toolbar=t,this.buildToolbar()}buildToolbar(){if(!this.o.toolbar)return;let t=this.o.buttons?(0,c.splitArray)(this.o.buttons):[];this.toolbar?.setRemoveButtons(this.o.removeButtons).build(t.concat(this.o.extraButtons||[])).appendTo(this.toolbarContainer)}getRegisteredButtonGroups(){return this.groupToButtons}registerButton(t){this.registeredButtons.add(t);let e=t.group??"other";return this.groupToButtons[e]||(this.groupToButtons[e]=[]),null!=t.position?this.groupToButtons[e][t.position]=t.name:this.groupToButtons[e].push(t.name),this}unregisterButton(t){this.registeredButtons.delete(t);let e=t.group??"other",i=this.groupToButtons[e];if(i){let o=i.indexOf(t.name);-1!==o&&i.splice(o,1),0===i.length&&delete this.groupToButtons[e]}return this}beforeToolbarBuild(t){if(Object.keys(this.groupToButtons).length)return t.map(t=>(0,p.isButtonGroup)(t)&&t.group&&this.groupToButtons[t.group]?{group:t.group,buttons:[...t.buttons,...this.groupToButtons[t.group]]}:t)}destruct(){this.isDestructed||(this.setStatus(n.STATUSES.beforeDestruct),this.e.off("beforeToolbarBuild",this.beforeToolbarBuild),this.__tooltip.destruct(),this.toolbar.destruct(),this.toolbar=void 0,super.destruct())}constructor(t,e=!1){super(t,e),(0,o._)(this,"toolbar",(0,f.makeCollection)(this)),(0,o._)(this,"__defaultToolbarContainer",this.c.div("jodit-toolbar__box")),(0,o._)(this,"registeredButtons",new Set),(0,o._)(this,"groupToButtons",{}),(0,o._)(this,"isJodit",!1),(0,o._)(this,"__tooltip",new d.UITooltip(this)),this.isJodit=e,this.e.on("beforeToolbarBuild",this.beforeToolbarBuild)}}(0,s.__decorate)([(0,a.watch)(":rebuildToolbar")],g.prototype,"buildToolbar",null),(0,s.__decorate)([r.autobind],g.prototype,"beforeToolbarBuild",null)},35099:function(t,e,i){"use strict";i.d(e,{View:function(){return C}});var o=i(25045),s=i(31635),n=i(16964),r=i(80251),a=i(69364),l=i(81937),c=i(76517),u=i(51676),h=i(24968),d=i(29200),p=i(27795),m=i(1496),f=i(28077),g=i(65946),_=i(8006),v=i(24475),b=i(23183),y=i(81987),w=i(34396),S=i(10081);class C extends r.Component{get basePath(){return this.o.basePath?this.o.basePath:l.BASE_PATH}get minified(){return void 0!==this.o.minified?this.o.minified:l.BASE_PATH_IS_MIN}get defaultTimeout(){return(0,g.isVoid)(this.o.defaultTimeout)?100:this.o.defaultTimeout}get buffer(){return v.Storage.makeStorage()}get message(){return this.getMessageModule(this.container)}getMessageModule(t){return new S.UIMessages(this,t)}get storage(){return v.Storage.makeStorage(!0,this.id)}get asyncStorage(){return _.AsyncStorage.makeStorage(!0,this.id,this.o.asyncStorage)}get c(){return this.create}get container(){return this.__container}set container(t){this.__container=t}get e(){return this.events}get progressbar(){return new w.ProgressBar(this)}get options(){return this.__options}set options(t){this.__options=t}get o(){return this.options}i18n(t,...e){return(0,g.i18n)(t,e,this.options)}toggleFullSize(t){void 0===t&&(t=!this.__isFullSize),t!==this.__isFullSize&&(this.__isFullSize=t,this.e.fire("toggleFullSize",t))}get isLocked(){return""!==this.__whoLocked}lock(t="any"){return!this.isLocked&&(this.__whoLocked=t,!0)}unlock(){return!!this.isLocked&&(this.__whoLocked="",!0)}get isFullSize(){return this.__isFullSize}getVersion(){return C.version}static getVersion(){return C.version}initOptions(t){this.options=(0,g.ConfigProto)(t||{},(0,g.ConfigProto)(this.options||{},C.defaultOptions))}initOwners(){this.ownerWindow=this.o.ownerWindow??window}attachEvents(t){if(!t)return;let e=t?.events;e&&Object.keys(e).forEach(t=>this.e.on(t,e[t]))}getInstance(t,e){let i=(0,g.isFunction)(t)?t.prototype.className():t,o=this.e.fire((0,g.camelCase)("getInstance_"+i),e);if(o)return o;let s=(0,g.isFunction)(t)?t:f.modules[i],r=this.__modulesInstances;if(!(0,g.isFunction)(s))throw(0,g.error)("Need real module name");if(!r.has(i)){let t=s.prototype instanceof n.ViewComponent?new s(this,e):new s(e);this.components.add(t),r.set(i,t)}return r.get(i)}addDisclaimer(t){p.Dom.append(this.container,t)}beforeDestruct(){this.e.fire(a.STATUSES.beforeDestruct,this),this.components.forEach(t=>{(0,g.isDestructable)(t)&&!t.isInDestruct&&t.destruct()}),this.components.clear()}destruct(){this.isDestructed||((0,u.cached)(this,"progressbar")?.destruct(),(0,u.cached)(this,"message")?.destruct(),(0,u.cached)(this,"asyncStorage")?.close(),this.events&&(this.events.destruct(),this.events=void 0),(0,u.cached)(this,"buffer")?.clear(),p.Dom.safeRemove(this.container),super.destruct())}constructor(t,e=!1){super(),(0,o._)(this,"isJodit",void 0),(0,o._)(this,"isView",void 0),(0,o._)(this,"parent",void 0),(0,o._)(this,"mods",void 0),(0,o._)(this,"id",void 0),(0,o._)(this,"components",void 0),(0,o._)(this,"events",void 0),(0,o._)(this,"create",void 0),(0,o._)(this,"__container",void 0),(0,o._)(this,"OPTIONS",void 0),(0,o._)(this,"__options",void 0),(0,o._)(this,"__isFullSize",void 0),(0,o._)(this,"__whoLocked",void 0),(0,o._)(this,"isLockedNotBy",void 0),(0,o._)(this,"__modulesInstances",void 0),this.isJodit=e,this.isView=!0,this.parent=null,this.mods={},this.components=new Set,this.OPTIONS=C.defaultOptions,this.__isFullSize=!1,this.__whoLocked="",this.isLockedNotBy=t=>this.isLocked&&this.__whoLocked!==t,this.__modulesInstances=new Map,this.id=new Date().getTime().toString(),this.initOptions(t),this.initOwners(),this.events=t?.eventEmmiter??new m.EventEmitter(this.od),this.create=new c.Create(this.od),this.__container=this.c.div("jodit "+this.componentName)}}(0,o._)(C,"ES",l.ES),(0,o._)(C,"version",l.APP_VERSION),(0,o._)(C,"esNext",l.IS_ES_NEXT),(0,o._)(C,"esModern",l.IS_ES_MODERN),(0,o._)(C,"defaultOptions",void 0),(0,s.__decorate)([u.cache],C.prototype,"buffer",null),(0,s.__decorate)([u.cache],C.prototype,"message",null),(0,s.__decorate)([u.cache],C.prototype,"storage",null),(0,s.__decorate)([u.cache],C.prototype,"asyncStorage",null),(0,s.__decorate)([u.cache],C.prototype,"c",null),(0,s.__decorate)([u.cache],C.prototype,"e",null),(0,s.__decorate)([u.cache],C.prototype,"progressbar",null),(0,s.__decorate)([(0,d.hook)(a.STATUSES.beforeDestruct)],C.prototype,"beforeDestruct",null),(C=(0,s.__decorate)([(0,h.derive)(y.Mods,b.Elms)],C)).defaultOptions={extraButtons:[],cache:!0,textIcons:!1,namespace:"",removeButtons:[],zIndex:100002,defaultTimeout:100,fullsize:!1,showTooltip:!0,useNativeTooltip:!1,buttons:[],globalFullSize:!0,language:"auto"}},73302:function(t,e,i){"use strict";i.d(e,{Jodit:function(){return Jodit}});var o=i(25045),s=i(31635),n=i(81937),r=i(84839),a=i(28077),l=i(65946),c=i(80991),u=i(73714),h=i(80512),d=i(5266),p=i(60936);let m="data-jodit-default-style-display",f="data-jodit-default-classes",g={contenteditable:!1};class Jodit extends p.ViewWithToolbar{className(){return"Jodit"}waitForReady(){return this.isReady?Promise.resolve(this):this.async.promise(t=>{this.hookStatus("ready",()=>t(this))})}static get ready(){return new Promise(t=>{a.eventEmitter.on("joditready",t)})}get text(){if(this.editor)return this.editor.innerText||"";let t=this.createInside.div();return t.innerHTML=this.getElementValue(),t.innerText||""}get defaultTimeout(){return(0,l.isNumber)(this.o.defaultTimeout)?this.o.defaultTimeout:d.Config.defaultOptions.defaultTimeout}static atom(t){return(0,l.markAsAtomic)(t)}static make(t,e){return new this(t,e)}static isJoditAssigned(t){return t&&(0,l.isJoditObject)(t.component)&&!t.component.isInDestruct}static get defaultOptions(){return d.Config.defaultOptions}static configure(t){(0,l.ConfigMerge)(Jodit.defaultOptions,t)}get createInside(){return new p.Create(()=>this.ed,this.o.createAttributes)}__setPlaceField(t,e){this.currentPlace||(this.currentPlace={},this.places=[this.currentPlace]),this.currentPlace[t]=e}get element(){return this.currentPlace.element}get editor(){return this.currentPlace.editor}set editor(t){this.__setPlaceField("editor",t)}get container(){return this.currentPlace.container}set container(t){this.__setPlaceField("container",t)}get workplace(){return this.currentPlace.workplace}get message(){return this.getMessageModule(this.workplace)}get statusbar(){return this.currentPlace.statusbar}get iframe(){return this.currentPlace.iframe}set iframe(t){this.__setPlaceField("iframe",t)}get history(){return this.currentPlace.history}get editorWindow(){return this.currentPlace.editorWindow}set editorWindow(t){this.__setPlaceField("editorWindow",t)}get ew(){return this.editorWindow}get editorDocument(){return this.currentPlace.editorWindow.document}get ed(){return this.editorDocument}get options(){return this.currentPlace.options}set options(t){this.__options=t,this.__setPlaceField("options",t)}get s(){return this.selection}get uploader(){return this.getInstance("Uploader",this.o.uploader)}get filebrowser(){let t=this,e=(0,l.ConfigProto)({defaultTimeout:t.defaultTimeout,uploader:t.o.uploader,language:t.o.language,license:t.o.license,theme:t.o.theme,shadowRoot:t.o.shadowRoot,defaultCallback(e){e.files&&e.files.length&&e.files.forEach((i,o)=>{let s=e.baseurl+i;e.isImages&&e.isImages[o]?t.s.insertImage(s,null,t.o.imageDefaultWidth):t.s.insertNode(t.createInside.fromHTML(`<a href='${s}' title='${s}'>${s}</a>`))})}},this.o.filebrowser);return t.getInstance("FileBrowser",e)}get mode(){return this.__mode}set mode(t){this.setMode(t)}getNativeEditorValue(){let t=this.e.fire("beforeGetNativeEditorValue");return(0,l.isString)(t)?t:this.editor?this.editor.innerHTML:this.getElementValue()}setNativeEditorValue(t){let e={value:t};!this.e.fire("beforeSetNativeEditorValue",e)&&this.editor&&(this.editor.innerHTML=e.value)}get value(){return this.getEditorValue()}set value(t){this.setEditorValue(t),this.history.__processChanges()}synchronizeValues(){this.__imdSynchronizeValues()}__imdSynchronizeValues(){this.setEditorValue()}getEditorValue(t=!0,e){let i;if(void 0!==(i=this.e.fire("beforeGetValueFromEditor",e)))return i;i=this.getNativeEditorValue().replace(n.INVISIBLE_SPACE_REG_EXP(),""),t&&(i=i.replace(/<span[^>]+id="jodit-selection_marker_[^>]+><\/span>/g,"")),"<br>"===i&&(i="");let o={value:i};return this.e.fire("afterGetValueFromEditor",o,e),o.value}setEditorValue(t){let e=this.e.fire("beforeSetValueToEditor",t);if(!1===e)return;if((0,l.isString)(e)&&(t=e),!this.editor){void 0!==t&&this.__setElementValue(t);return}if(!(0,l.isString)(t)&&!(0,l.isVoid)(t))throw(0,l.error)("value must be string");(0,l.isVoid)(t)||this.getNativeEditorValue()===t||this.setNativeEditorValue(t),this.e.fire("postProcessSetEditorValue");let i=this.getElementValue(),o=this.getEditorValue();if(!this.__isSilentChange&&i!==o&&this.__callChangeCount<n.SAFE_COUNT_CHANGE_CALL){this.__setElementValue(o),this.__callChangeCount+=1,n.IS_PROD||this.__callChangeCount;try{this.history.__upTick(),this.e.fire("change",o,i),this.e.fire(this.history,"change",o,i)}finally{this.__callChangeCount=0}}}updateElementValue(){this.__setElementValue(this.getEditorValue())}getElementValue(){return void 0!==this.element.value?this.element.value:this.element.innerHTML}__setElementValue(t){if(!(0,l.isString)(t))throw(0,l.error)("value must be string");if(this.element!==this.container&&t!==this.getElementValue()){let e={value:t},i=this.e.fire("beforeSetElementValue",e);(0,l.callPromise)(i,()=>{void 0!==this.element.value?this.element.value=e.value:this.element.innerHTML=e.value,this.e.fire("afterSetElementValue",e)})}}registerCommand(t,e,i){let o=t.toLowerCase(),s=this.commands.get(o);if(void 0===s&&(s=[],this.commands.set(o,s)),s.push(e),!(0,l.isFunction)(e)){let s=this.o.commandToHotkeys[o]||this.o.commandToHotkeys[t]||e.hotkeys;s&&this.registerHotkeyToCommand(s,o,i?.stopPropagation)}return this}registerHotkeyToCommand(t,e,i=!0){let o=(0,l.asArray)(t).map(l.normalizeKeyAliases).map(t=>t+".hotkey").join(" ");this.e.off(o).on(o,(t,o)=>(o&&(o.shouldStop=i??!0),this.execCommand(e)))}execCommand(t,e,i,...o){let s;if(this.s.isFocused()||this.s.focus(),!this.o.readonly||this.o.allowCommandsInReadOnly.includes(t)){if(t=t.toLowerCase(),!1!==(s=this.e.fire("beforeCommand"+(0,l.ucfirst)(t),e,i,...o))&&(s=this.e.fire("beforeCommand",t,e,i,...o)),!1!==s&&(s=this.__execCustomCommands(t,e,i,...o)),!1!==s){this.s.focus();try{s=this.nativeExecCommand(t,e,i)}catch(t){if(!n.IS_PROD)throw t}}return this.e.fire("afterCommand",t,e,i),this.__imdSynchronizeValues(),s}}nativeExecCommand(t,e,i){this.__isSilentChange=!0;try{return this.ed.execCommand(t,e,i)}finally{this.__isSilentChange=!1}}__execCustomCommands(t,e,i,...o){t=t.toLowerCase();let s=this.commands.get(t);if(void 0!==s){let n;return s.forEach(s=>{let r=((0,l.isFunction)(s)?s:s.exec).call(this,t,e,i,...o);void 0!==r&&(n=r)}),n}}lock(t="any"){return!!super.lock(t)&&(this.__selectionLocked=this.s.save(),this.s.clear(),this.container.classList.add("jodit_lock"),this.e.fire("lock",!0),!0)}unlock(){return!!super.unlock()&&(this.container.classList.remove("jodit_lock"),this.__selectionLocked&&this.s.restore(),this.e.fire("lock",!1),!0)}getMode(){return this.mode}isEditorMode(){return this.getRealMode()===n.MODE_WYSIWYG}getRealMode(){if(this.getMode()!==n.MODE_SPLIT)return this.getMode();let t=this.od.activeElement;return t&&(t===this.iframe||p.Dom.isOrContains(this.editor,t)||p.Dom.isOrContains(this.toolbar.container,t))?n.MODE_WYSIWYG:n.MODE_SOURCE}setMode(t){let e=this.getMode(),i={mode:parseInt(t.toString(),10)},o=["jodit-wysiwyg_mode","jodit-source__mode","jodit_split_mode"];!1!==this.e.fire("beforeSetMode",i)&&(this.__mode=[n.MODE_SOURCE,n.MODE_WYSIWYG,n.MODE_SPLIT].includes(i.mode)?i.mode:n.MODE_WYSIWYG,this.o.saveModeInStorage&&this.storage.set("jodit_default_mode",this.mode),o.forEach(t=>{this.container.classList.remove(t)}),this.container.classList.add(o[this.mode-1]),e!==this.getMode()&&this.e.fire("afterSetMode"))}toggleMode(){let t=this.getMode();[n.MODE_SOURCE,n.MODE_WYSIWYG,this.o.useSplitMode?n.MODE_SPLIT:9].includes(t+1)?t+=1:t=n.MODE_WYSIWYG,this.setMode(t)}setDisabled(t){this.o.disabled=t;let e=this.__wasReadOnly;this.setReadOnly(t||e),this.__wasReadOnly=e,this.editor&&((0,l.attr)(this.editor,"aria-disabled",t),this.container.classList.toggle("jodit_disabled",t),this.e.fire("disabled",t))}getDisabled(){return this.o.disabled}setReadOnly(t){this.__wasReadOnly!==t&&(this.__wasReadOnly=t,this.o.readonly=t,t?this.editor&&(0,l.attr)(this.editor,"contenteditable",null):this.editor&&(0,l.attr)(this.editor,"contenteditable",!0),this.e&&this.e.fire("readonly",t))}getReadOnly(){return this.o.readonly}focus(){this.getMode()!==n.MODE_SOURCE&&this.s.focus()}get isFocused(){return this.s.isFocused()}beforeInitHook(){}afterInitHook(){}initOptions(t){this.options=(0,l.ConfigProto)(t||{},d.Config.defaultOptions)}initOwners(){this.editorWindow=this.o.ownerWindow,this.ownerWindow=this.o.ownerWindow}addPlace(t,e){let i=(0,l.resolveElement)(t,this.o.shadowRoot||this.od);this.attachEvents(e),i.attributes&&(0,l.toArray)(i.attributes).forEach(t=>{let i=t.name,o=t.value;void 0===d.Config.defaultOptions[i]||e&&void 0!==e[i]||(-1!==["readonly","disabled"].indexOf(i)&&(o=""===o||"true"===o),/^[0-9]+(\.)?([0-9]+)?$/.test(o.toString())&&(o=Number(o)),this.options[i]=o)});let o=this.c.div("jodit-container");o.classList.add("jodit"),o.classList.add("jodit-container"),o.classList.add("jodit_theme_"+(this.o.theme||"default")),_(this.o.className,o),this.o.containerStyle&&(0,l.css)(o,this.o.containerStyle);let{styleValues:s}=this.o;Object.keys(s).forEach(t=>{let e=(0,l.kebabCase)(t);o.style.setProperty("--jd-"+e,s[t])}),(0,l.attr)(o,"contenteditable",!1);let n=null;if(this.o.inline&&(-1===["TEXTAREA","INPUT"].indexOf(i.nodeName)&&(o=i,(0,l.attr)(i,f,i.className.toString()),n=o.innerHTML,p.Dom.detach(o)),o.classList.add("jodit_inline"),o.classList.add("jodit-container")),i!==o){let t=(0,c.cssInline)(i,"display");t&&(0,l.attr)(i,m,t),(0,l.css)(i,"display","none")}let r="workplace-slot",a=this.c.div(this.getFullElName(r,"above"),g);(0,l.attr)(a,"data-jodit-above-toolbar",""),p.Dom.appendChildFirst(o,a);let u=this.c.div(this.getFullElName(r,"top"),g);p.Dom.append(o,u);let h=this.c.div(this.getFullElName(r,"center"),g),v=this.c.div("jodit-workplace",g),b=this.c.div(this.getFullElName(r,"left"),g),y=this.c.div(this.getFullElName(r,"right"),g);p.Dom.append(h,b),p.Dom.append(h,v),p.Dom.append(h,y),p.Dom.append(o,h);let w=this.c.div(this.getFullElName(r,"bottom"),g);p.Dom.append(o,w),i.parentNode&&i!==o&&p.Dom.before(i,o),Object.defineProperty(i,"component",{enumerable:!1,configurable:!0,value:this});let S=this.c.div("jodit-wysiwyg",{contenteditable:!0,"aria-disabled":!1,tabindex:this.o.tabIndex});p.Dom.append(v,S);let C={editor:S,element:i,container:o,workplace:v,slots:{above:a,top:u,bottom:w,center:h,left:b,right:y},statusbar:new p.StatusBar(this,o),options:this.isReady?(0,l.ConfigProto)(e||{},d.Config.defaultOptions):this.options,history:new p.History(this),editorWindow:this.ow};this.__elementToPlace.set(S,C),this.setCurrentPlace(C),this.places.push(C),this.setNativeEditorValue(this.getElementValue());let E=this.__initEditor(n),I=this.options,D=()=>{I.enableDragAndDropFileToEditor&&I.uploader&&(I.uploader.url||I.uploader.insertImageAsBase64URI)?this.uploader.bind(this.editor):I.enableDragAndDropFileToEditor||this.e.on(S,"drop",t=>{t.dataTransfer?.files?.length&&t.preventDefault()}),this.__elementToPlace.get(this.editor)||this.__elementToPlace.set(this.editor,C),this.e.fire("afterAddPlace",C)};return(0,l.callPromise)(E,D)}addDisclaimer(t){p.Dom.append(this.workplace,t)}setCurrentPlace(t){this.currentPlace!==t&&(this.isEditorMode()||this.setMode(n.MODE_WYSIWYG),this.currentPlace=t,this.buildToolbar(),this.isReady&&this.e.fire("changePlace",t))}__initEditor(t){let e=this.__createEditor();return(0,l.callPromise)(e,()=>{if(this.isInDestruct)return;if(this.element!==this.container){let t=this.getElementValue();t!==this.getEditorValue()&&this.setEditorValue(t)}else null!=t&&this.setEditorValue(t);let e=this.o.defaultMode;if(this.o.saveModeInStorage){let t=this.storage.get("jodit_default_mode");"string"==typeof t&&(e=parseInt(t,10))}this.setMode(e),this.o.readonly&&(this.__wasReadOnly=!1,this.setReadOnly(!0)),this.o.disabled&&this.setDisabled(!0);try{this.ed.execCommand("defaultParagraphSeparator",!1,this.o.enter.toLowerCase())}catch{}})}__createEditor(){let t=this.editor,e=this.e.fire("createEditor",this);return(0,l.callPromise)(e,()=>{!this.isInDestruct&&((!1===e||(0,l.isPromise)(e))&&p.Dom.safeRemove(t),_(this.o.editorClassName,this.editor),this.o.style&&(0,l.css)(this.editor,this.o.style),this.e.on("synchro",()=>{this.setEditorValue()}).on("focus",()=>{this.editorIsActive=!0}).on("blur",()=>this.editorIsActive=!1),this.__prepareWYSIWYGEditor(),this.o.triggerChangeEvent&&this.e.on("change",this.async.debounce(()=>{this.e&&this.e.fire(this.element,"change")},this.defaultTimeout)))})}__prepareWYSIWYGEditor(){let{editor:t}=this;if(this.o.direction){let t="rtl"===this.o.direction.toLowerCase()?"rtl":"ltr";(0,l.css)(this.editor,"direction",t),(0,l.attr)(this.editor,"dir",t),(0,l.css)(this.container,"direction",t),(0,l.attr)(this.container,"dir",t),this.toolbar.setDirection(t)}this.e.on(t,"mousedown touchstart focus",()=>{let e=this.__elementToPlace.get(t);e&&this.setCurrentPlace(e)}).on(t,"compositionend",this.synchronizeValues).on(t,"selectionchange selectionstart keydown keyup input keypress dblclick mousedown mouseup click copy cut dragstart drop dragover paste resize touchstart touchend focus blur",t=>{if(!this.o.readonly&&!this.__isSilentChange&&(!(t instanceof this.ew.KeyboardEvent)||!t.isComposing)&&this.e&&this.e.fire){if(!1===this.e.fire(t.type,t))return!1;this.synchronizeValues()}}).on(this.ow,"mouseup",e=>{if(this.o.readonly||this.__isSilentChange)return;let i=e.target;!(i&&(0,l.isNumber)(i.nodeType)&&t.contains(i))&&this.s.isInsideArea&&(this.e.fire("changeSelection"),this.synchronizeValues())})}fetch(t,e){let i=new u.Ajax({url:t,...e},this.o.defaultAjaxOptions),o=()=>{this.e.off("beforeDestruct",o),this.progressbar.progress(100).hide(),i.destruct()};this.e.one("beforeDestruct",o),this.progressbar.show().progress(30);let s=i.send();return s.finally(o).catch(()=>null),s}destruct(){if(this.isInDestruct)return;this.setStatus(p.STATUSES.beforeDestruct),this.__elementToPlace.clear(),(0,r.cached)(this,"storage")?.clear(),(0,r.cached)(this,"buffer")?.clear(),this.commands.clear(),this.__selectionLocked=null,this.e.off(this.ow,"resize"),this.e.off(this.ow),this.e.off(this.od),this.e.off(this.od.body);let t=this.editor?this.getEditorValue():"";this.places.forEach(({container:e,workplace:i,statusbar:o,element:s,iframe:n,editor:r,history:a})=>{if(s){if(s!==e)if(s.hasAttribute(m)){let t=(0,l.attr)(s,m);t&&((0,l.css)(s,"display",t),(0,l.attr)(s,m,null))}else(0,l.css)(s,"display","");else s.hasAttribute(f)&&(s.className=(0,l.attr)(s,f)||"",(0,l.attr)(s,f,null));s.hasAttribute("style")&&!(0,l.attr)(s,"style")&&(0,l.attr)(s,"style",null),o.destruct(),this.e.off(e),this.e.off(s),this.e.off(r),p.Dom.safeRemove(i),p.Dom.safeRemove(r),e!==s&&p.Dom.safeRemove(e),Object.defineProperty(s,"component",{enumerable:!1,configurable:!0,value:null}),p.Dom.safeRemove(n),e===s&&(s.innerHTML=t),a.destruct()}}),this.places.length=0,this.currentPlace={},delete a.instances[this.id],super.destruct()}constructor(t,e){super(e,!0),(0,o._)(this,"isJodit",!0),(0,o._)(this,"commands",new Map),(0,o._)(this,"__selectionLocked",null),(0,o._)(this,"__wasReadOnly",!1),(0,o._)(this,"editorIsActive",!1),(0,o._)(this,"selection",void 0),(0,o._)(this,"__mode",n.MODE_WYSIWYG),(0,o._)(this,"__callChangeCount",0),(0,o._)(this,"__isSilentChange",!1),(0,o._)(this,"currentPlace",{options:this.__options,container:this.__container}),(0,o._)(this,"places",[]),(0,o._)(this,"__elementToPlace",new Map);try{const e=(0,l.resolveElement)(t,this.options.shadowRoot||this.od);if(Jodit.isJoditAssigned(e))return e.component}catch(t){if(!n.IS_PROD)throw t;throw this.destruct(),t}this.setStatus(p.STATUSES.beforeInit),this.id=(0,l.attr)((0,l.resolveElement)(t,this.o.shadowRoot||this.od),"id")||new Date().getTime().toString(),a.instances[this.id]=this,this.attachEvents(e),this.e.on(this.ow,"resize",()=>{this.e&&this.e.fire("resize")}),this.e.on("prepareWYSIWYGEditor",this.__prepareWYSIWYGEditor),this.selection=new p.Selection(this);const i=this.beforeInitHook();(0,l.callPromise)(i,()=>{if(this.isInDestruct)return;this.e.fire("beforeInit",this),a.pluginSystem.__init(this),this.e.fire("afterPluginSystemInit",this),this.e.on("changePlace",()=>{this.setReadOnly(this.o.readonly),this.setDisabled(this.o.disabled)}),this.places.length=0;let i=this.addPlace(t,e);a.instances[this.id]=this;let o=()=>{this.isInDestruct||(this.e&&this.e.fire("afterInit",this),(0,l.callPromise)(this.afterInitHook()),this.setStatus(p.STATUSES.ready),this.e.fire("afterConstructor",this))};(0,l.callPromise)(i,o)})}}function _(t,e){t&&t.split(/\s+/).forEach(t=>e.classList.add(t))}(0,o._)(Jodit,"fatMode",n.FAT_MODE),(0,o._)(Jodit,"plugins",a.pluginSystem),(0,o._)(Jodit,"modules",a.modules),(0,o._)(Jodit,"ns",a.modules),(0,o._)(Jodit,"decorators",{}),(0,o._)(Jodit,"constants",n),(0,o._)(Jodit,"instances",a.instances),(0,o._)(Jodit,"lang",n.lang),(0,o._)(Jodit,"core",{Plugin:p.Plugin}),(0,s.__decorate)([r.cache],Jodit.prototype,"createInside",null),(0,s.__decorate)([r.cache],Jodit.prototype,"message",null),(0,s.__decorate)([r.cache],Jodit.prototype,"s",null),(0,s.__decorate)([r.cache],Jodit.prototype,"uploader",null),(0,s.__decorate)([r.cache],Jodit.prototype,"filebrowser",null),(0,s.__decorate)([(0,r.throttle)()],Jodit.prototype,"synchronizeValues",null),(0,s.__decorate)([(0,r.watch)(":internalChange")],Jodit.prototype,"updateElementValue",null),(0,s.__decorate)([r.autobind],Jodit.prototype,"__prepareWYSIWYGEditor",null),Jodit=(0,s.__decorate)([(0,r.derive)(h.Dlgs)],Jodit)},89317:function(t,e,i){"use strict";var o=i(17312),s=i(41324),n=i.n(s),r=i(63837),a=i(53414);let l={};l={ar:n(),az:n(),cs_cz:n(),de:n(),en:r,es:n(),fa:n(),fi:n(),fr:n(),he:n(),hu:n(),id:n(),it:n(),ja:n(),ko:n(),mn:n(),nl:n(),no:n(),pl:n(),pt_br:n(),ru:n(),sk:n(),sv:n(),tr:n(),ua:n(),zh_cn:n(),zh_tw:n()};let c=t=>t?t.default||t:{},u={};(0,o.isArray)(c(a))&&c(a).forEach((t,e)=>{u[e]=t}),Object.keys(l).forEach(t=>{let e=c(l[t]);(0,o.isArray)(e)?(l[t]={},e.forEach((e,i)=>{l[t][u[i]]=e})):l[t]=e}),e.default=l},67399:function(t,e,i){"use strict";i.d(e,{ContextMenu:function(){return l}});var o=i(31635),s=i(91672),n=i(17312),r=i(53681),a=i(51116);class l extends a.Popup{className(){return"ContextMenu"}show(t,e,i){let o=this;o.clear(),(0,n.isArray)(i)&&(i.forEach(t=>{if(!t)return;let e=(0,r.Button)(this.jodit,t.icon||"empty",t.title);this.jodit&&e.setParentView(this.jodit),e.setMod("context","menu"),e.onAction(e=>(t.exec?.call(o,e),o.clear(),o.close(),!1)),this.append(e)}),this.open(()=>({left:t,top:e,width:0,height:0}),!0))}}l=(0,o.__decorate)([s.component],l)},91535:function(t,e,i){"use strict";i.d(e,{Alert:function(){return l}});var o=i(23211),s=i(78982),n=i(91565),r=i(53681),a=i(76841);function l(t,e,i,c="jodit-dialog_alert"){(0,n.isFunction)(e)&&(i=e,e=void 0);let u=this instanceof a.Dialog?this:new a.Dialog({closeOnClickOverlay:!0}),h=u.c.div(c),d=(0,r.Button)(u,"ok","Ok");return(0,s.asArray)(t).forEach(t=>{o.Dom.append(h,o.Dom.isNode(t)?t:u.c.fromHTML(t))}),d.onAction(()=>{i&&(0,n.isFunction)(i)&&!1===i(u)||u.close()}),u.setFooter([d]),u.open(h,e||" ",!0,!0),d.focus(),u}},88329:function(t,e,i){"use strict";i.d(e,{Confirm:function(){return a}});var o=i(23211),s=i(91565),n=i(53681),r=i(76841);function a(t,e,i){let a=this instanceof r.Dialog?this:new r.Dialog({closeOnClickOverlay:!0}),l=a.c.fromHTML('<form class="jodit-dialog_prompt"></form>'),c=a.c.element("label");(0,s.isFunction)(e)&&(i=e,e=void 0),o.Dom.append(c,a.c.fromHTML(t)),o.Dom.append(l,c);let u=t=>()=>{i&&!1===i(t)||a.close()},h=(0,n.Button)(a,"cancel","Cancel"),d=(0,n.Button)(a,"ok","Yes");return h.onAction(u(!1)),d.onAction(u(!0)),a.e.on(l,"submit",()=>(u(!0)(),!1)),a.setFooter([d,h]),a.open(l,e||" ",!0,!0),d.focus(),a}},76841:function(t,e,i){"use strict";i.d(e,{Dialog:function(){return v}});var o=i(25045),s=i(31635),n=i(16964),r=i(81937),a=i(84839),l=i(23211),c=i(28077),u=i(45664),h=i(28686),d=i(93640),p=i(28712),m=i(4099),f=i(35099),g=i(2222),_=i(5266);_.Config.prototype.dialog={namespace:"",extraButtons:[],resizable:!0,draggable:!0,buttons:["dialog.close"],removeButtons:[],toolbarButtonSize:"middle",zIndex:"inherit"},_.Config.prototype.controls.dialog={close:{icon:"cancel",exec(t){t.close()}}};class v extends g.ViewWithToolbar{className(){return"Dialog"}get destination(){let{popupRoot:t,shadowRoot:e}=this.o;return t||e||this.od.body}setElements(t,e){let i=[];(0,u.asArray)(e).forEach(e=>{let o;if((0,h.isArray)(e)){let o=this.c.div(this.getFullElName("column"));return i.push(o),l.Dom.append(t,o),this.setElements(o,e)}o=(0,h.isString)(e)?this.c.fromHTML(e):(0,h.hasContainer)(e)?e.container:e,i.push(o),o.parentNode!==t&&l.Dom.append(t,o)}),(0,u.toArray)(t.childNodes).forEach(t=>{-1===i.indexOf(t)&&l.Dom.safeRemove(t)})}__onMouseUp(){(this.draggable||this.resizable)&&(this.__removeGlobalResizeListeners(),this.draggable=!1,this.resizable=!1,this.unlockSelect(),this.e&&(this.__removeGlobalResizeListeners(),this.e.fire(this,"endResize endMove")))}__onHeaderMouseDown(t){let e=t.target;!(!this.o.draggable||e&&e.nodeName.match(/^(INPUT|SELECT)$/))&&(this.draggable=!0,this.startX=t.clientX,this.startY=t.clientY,this.startPoint.x=(0,d.css)(this.dialog,"left"),this.startPoint.y=(0,d.css)(this.dialog,"top"),this.setMaxZIndex(),t.cancelable&&t.preventDefault(),this.lockSelect(),this.__addGlobalResizeListeners(),this.e&&(this.e.fire(this,"startMove"),this.e.fire("closeAllPopups")))}__onMouseMove(t){this.draggable&&this.o.draggable&&(this.setPosition(this.startPoint.x+t.clientX-this.startX,this.startPoint.y+t.clientY-this.startY),this.e&&this.e.fire(this,"move",t.clientX-this.startX,t.clientY-this.startY),t.stopImmediatePropagation()),this.resizable&&this.o.resizable&&(this.setSize(Math.max(this.startPoint.w+t.clientX-this.startX,this.minSize.w),Math.max(this.startPoint.h+t.clientY-this.startY,this.minSize.h)),this.e&&this.e.fire(this,"resizeDialog",t.clientX-this.startX,t.clientY-this.startY))}__onEsc(t){if(this.o.closeOnEsc&&this.isOpened&&t.key===r.KEY_ESC&&!0!==this.getMod("static")){let e=this.getMaxZIndexDialog();e?e.close():this.close(),t.stopImmediatePropagation()}}__onResizerMouseDown(t){this.resizable=!0,this.startX=t.clientX,this.startY=t.clientY,this.startPoint.w=this.dialog.offsetWidth,this.startPoint.h=this.dialog.offsetHeight;let e=this.getElm("header"),i=this.getElm("footer"),o=this.getElm("content"),s=o&&parseFloat(this.ow.getComputedStyle(o).minHeight)||0;this.minSize.w=(0,h.isNumber)(this.o.minWidth)?this.o.minWidth:Math.max(100,i?.scrollWidth??0),this.minSize.h=(0,h.isNumber)(this.o.minHeight)?this.o.minHeight:(e?.offsetHeight??0)+(i?.offsetHeight??0)+s+this.resizer.offsetHeight,this.lockSelect(),this.__addGlobalResizeListeners(),this.e&&this.e.fire(this,"startResize")}__addGlobalResizeListeners(){this.e.on(this.ow,"pointermove touchmove",this.__onMouseMove).on(this.ow,"pointerup touchend",this.__onMouseUp)}__removeGlobalResizeListeners(){this.e.off(this.ow,"mousemove pointermove",this.__onMouseMove).off(this.ow,"mouseup pointerup",this.__onMouseUp)}setSize(t,e){return null==t&&(t=this.dialog.offsetWidth),null==e&&(e=this.dialog.offsetHeight),(0,d.css)(this.dialog,{width:t,height:e}),this}calcAutoSize(){return this.setSize("auto","auto"),this.setSize(),this}setPosition(t,e){let i=this.ow.innerWidth,o=this.ow.innerHeight,s=i/2-this.dialog.offsetWidth/2,n=o/2-this.dialog.offsetHeight/2;return s<0&&(s=0),n<0&&(n=0),void 0!==t&&void 0!==e&&(this.offsetX=t,this.offsetY=e,this.moved=Math.abs(t-s)>100||Math.abs(e-n)>100),(0,d.css)(this.dialog,{left:(t||s)+"px",top:(e||n)+"px"}),this}setHeader(t){return this.setElements(this.dialogbox_header,t),this}setContent(t){return this.setElements(this.dialogbox_content,t),this}setFooter(t){return this.setElements(this.dialogbox_footer,t),this.setMod("footer",!!t),this}__openedSiblings(){let t=[];return v.__opened.forEach(e=>{e.destination===this.destination&&t.push(e)}),t}getZIndex(){return parseInt((0,d.css)(this.container,"zIndex"),10)||0}getMaxZIndexDialog(){let t=0,e=this;return this.__openedSiblings().forEach(i=>{let o=i.getZIndex();o>t&&(e=i,t=o)}),e}setMaxZIndex(){if(this.getMod("static"))return;let t=0x1312d04;this.__openedSiblings().forEach(e=>{t=Math.max(e.getZIndex(),t)}),(0,d.css)(this.container,"zIndex",(t+1).toString())}toggleFullSize(t){(0,h.isVoid)(t)&&(t=!this.getMod("fullsize")),this.setMod("fullsize",t),super.toggleFullSize(t)}open(t,e,i,o){if(c.eventEmitter.fire("closeAllPopups hideHelpers"),!1===this.e.fire(this,"beforeOpen"))return this;(0,h.isBoolean)(t)&&(i=t),(0,h.isBoolean)(e)&&(o=e),this.destroyAfterClose=!0===i;let s=(0,h.isBoolean)(t)?void 0:t,n=(0,h.isBoolean)(e)?void 0:e;return void 0!==n&&this.setHeader(n),s&&this.setContent(s),this.setMod("active",!0),this.isOpened=!0,v.__opened.add(this),this.setModal(o),l.Dom.append(this.destination,this.container),!0!==this.getMod("static")?(this.setPosition(this.offsetX,this.offsetY),this.setMaxZIndex()):(0,d.css)(this.container,"zIndex",null),this.o.fullsize&&this.toggleFullSize(!0),this.e.fire("afterOpen",this),this}setModal(t){return this.isModal=!!t,this.setMod("modal",this.isModal),this}close(){if(this.isDestructed||!this.isOpened||!0===this.getMod("static"))return this;let{e:t}=this;return!1===t.fire(this,"beforeClose")||!1===t.fire("beforeClose",this)||(this.setMod("active",!1),this.isOpened=!1,v.__opened.delete(this),this.isFullSize&&this.toggleFullSize(!1),l.Dom.safeRemove(this.container),this.__removeGlobalResizeListeners(),t.fire(this,"afterClose"),this.isInDestruct||t.fire(this.ow,"joditCloseDialog"),this.destroyAfterClose&&this.destruct()),this}buildToolbar(){this.o.buttons&&this.toolbar.build((0,u.splitArray)(this.o.buttons)).setMod("mode","header").appendTo(this.dialogbox_toolbar)}destruct(){this.isInDestruct||(this.setStatus(n.STATUSES.beforeDestruct),this.isOpened&&this.close(),v.__opened.delete(this),this.events&&(this.__removeGlobalResizeListeners(),this.events.off(this.container,"close_dialog",self.close).off(this.ow,"keydown",this.__onEsc).off(this.ow,"resize",this.__onResize)),super.destruct())}constructor(t={}){super(t),(0,o._)(this,"resizer",void 0),(0,o._)(this,"offsetX",void 0),(0,o._)(this,"offsetY",void 0),(0,o._)(this,"destroyAfterClose",!1),(0,o._)(this,"moved",!1),(0,o._)(this,"resizable",!1),(0,o._)(this,"draggable",!1),(0,o._)(this,"startX",0),(0,o._)(this,"startY",0),(0,o._)(this,"startPoint",{x:0,y:0,w:0,h:0}),(0,o._)(this,"lockSelect",()=>{this.setMod("moved",!0)}),(0,o._)(this,"unlockSelect",()=>{this.setMod("moved",!1)}),(0,o._)(this,"__onResize",()=>{this.options&&this.o.resizable&&!this.moved&&this.isOpened&&!this.offsetX&&!this.offsetY&&this.setPosition()}),(0,o._)(this,"minSize",{w:0,h:0}),(0,o._)(this,"dialog",void 0),(0,o._)(this,"workplace",void 0),(0,o._)(this,"dialogbox_header",void 0),(0,o._)(this,"dialogbox_content",void 0),(0,o._)(this,"dialogbox_footer",void 0),(0,o._)(this,"dialogbox_toolbar",void 0),(0,o._)(this,"isModal",!1),(0,o._)(this,"isOpened",!1),this.options=(0,d.ConfigProto)(t,(0,d.ConfigProto)(_.Config.prototype.dialog,v.defaultOptions)),this.attachEvents(this.options),l.Dom.safeRemove(this.container);const e=this.getFullElName.bind(this);this.container=this.c.fromHTML(`<div class="jodit jodit-dialog ${this.componentName}">
|
|
27
27
|
<div class="${e("overlay")}"></div>
|
|
28
28
|
<div class="${this.getFullElName("panel")}">
|
|
29
29
|
<div class="${e("header")}">
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
loading="lazy"
|
|
54
54
|
/>
|
|
55
55
|
${n||r||a?c:""}
|
|
56
|
-
</a>`},ajax:{...a.Config.prototype.defaultAjaxOptions,url:"",data:{},cache:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",method:"POST",processData:!0,headers:{},prepareData:t=>t,process:t=>t},create:{data:{action:"folderCreate"}},getLocalFileByUrl:{data:{action:"getLocalFileByUrl"}},resize:{data:{action:"imageResize"}},crop:{data:{action:"imageCrop"}},fileMove:{data:{action:"fileMove"}},folderMove:{data:{action:"folderMove"}},fileRename:{data:{action:"fileRename"}},folderRename:{data:{action:"folderRename"}},fileRemove:{data:{action:"fileRemove"}},folderRemove:{data:{action:"folderRemove"}},items:{data:{action:"files"}},folder:{data:{action:"folders"}},permissions:{data:{action:"permissions"}}},a.Config.prototype.controls.filebrowser={upload:{icon:"plus",tooltip:"Upload file",isInput:!0,isDisabled:t=>!t.dataProvider.canI("FileUpload"),getContent(t,e){let i=new r.UIFileInput(t,{tooltip:e.control.tooltip,onlyImages:t.state.onlyImages});return t.e.fire("bindUploader.filebrowser",i.container),i.container}},remove:{icon:"bin",tooltip:"Remove file",isDisabled:t=>!t.state.activeElements.length||!t.dataProvider.canI("FileRemove"),exec(t){t.e.fire("fileRemove.filebrowser")}},update:{tooltip:"Update file list",exec(t){t.e.fire("update.filebrowser")}},select:{tooltip:"Select file",icon:"check",isDisabled:t=>!t.state.activeElements.length,exec(t){t.e.fire("select.filebrowser")}},edit:{tooltip:"Edit image",icon:"pencil",isDisabled(t){let e=t.state.activeElements;return 1!==e.length||!e[0].isImage||!(t.dataProvider.canI("ImageCrop")||t.dataProvider.canI("ImageResize"))},exec(t){t.e.fire("edit.filebrowser")}},tiles:{tooltip:"Tiles view",icon:"th",isActive:t=>"tiles"===t.state.view,exec(t){t.e.fire("view.filebrowser","tiles")}},list:{tooltip:"List view",icon:"th-list",isActive:t=>"list"===t.state.view,exec(t){t.e.fire("view.filebrowser","list")}},filter:{isInput:!0,getContent(t,e){let i=o.Dom.first(e.container,t=>o.Dom.isHTMLElement(t)&&t.classList.contains("jodit-input"));if(i)return i;let s=t.c.element("input",{class:"jodit-input",placeholder:t.i18n("Filter")});return s.value=t.state.filterWord,t.e.on(s,"keydown mousedown",t.async.debounce(()=>{t.e.fire("filter.filebrowser",s.value)},t.defaultTimeout)),s}},sort:{isInput:!0,getContent(t){let e=t.c.fromHTML(`<select class="jodit-input jodit-select"><option value="changed-asc">${t.i18n("Sort by changed")} (⬆)</option><option value="changed-desc">${t.i18n("Sort by changed")} (⬇)</option><option value="name-asc">${t.i18n("Sort by name")} (⬆)</option><option value="name-desc">${t.i18n("Sort by name")} (⬇)</option><option value="size-asc">${t.i18n("Sort by size")} (⬆)</option><option value="size-desc">${t.i18n("Sort by size")} (⬇)</option></select>`);return e.value=t.state.sortBy,t.e.on("sort.filebrowser",t=>{e.value!==t&&(e.value=t)}).on(e,"change",()=>{t.e.fire("sort.filebrowser",e.value)}),e}}}},17780:function(t,e,i){"use strict";i.d(e,{default:function(){return f}});var o=i(25045),s=i(31635),n=i(81937),r=i(49574),a=i(91565),l=i(96340),c=i(77483),u=i(33201),h=i(52144),d=i(17338),p=i(58664);let m=new Set(["allowFiles","allowFileMove","allowFileUpload","allowFileUploadRemote","allowFileRemove","allowFileRename","allowFolders","allowFolderMove","allowFolderCreate","allowFolderRemove","allowFolderRename","allowImageResize","allowImageCrop"]);class f{get o(){return this.options}get(t){let e=this.__ajaxInstances;if(e.has(t)){let i=e.get(t);i?.abort(),e.delete(t)}let i=(0,c.ConfigProto)(void 0!==this.options[t]?this.options[t]:{},(0,c.ConfigProto)({onProgress:this.progressHandler},this.o.ajax));i.prepareData&&(i.data=i.prepareData.call(this,i.data));let o=new d.Ajax(i);e.set(t,o);let s=o.send();return s.finally(()=>{o.destruct(),e.delete(t),this.progressHandler(100)}).catch(()=>null),s.then(t=>t.json()).then(t=>{if(t&&!this.isSuccess(t))throw Error(this.getMessage(t));return t})}onProgress(t){this.progressHandler=t}async permissions(t,e){return this.o.permissions&&(this.o.permissions.data.path=t,this.o.permissions.data.source=e,this.o.permissions.url)?this.get("permissions").then(t=>{if(this.parent.isInDestruct)throw(0,u.abort)();let e=this.o.permissions.process;if(e||(e=this.o.ajax.process),e){let i=e.call(self,t);i.data.permissions&&(this.parent.events.fire(this,"changePermissions",this.__currentPermissions,i.data.permissions),this.__currentPermissions=i.data.permissions)}return this.__currentPermissions}):null}canI(t){let e="allow"+t;if(!n.IS_PROD&&!m.has(e))throw(0,u.error)("Wrong action "+t);let i=this.o.permissionsPresets[e];return void 0!==i?i:null==this.__currentPermissions||void 0===this.__currentPermissions[e]||this.__currentPermissions[e]}__items(t,e,i,o){let s=this.options;return s.items?(s.items.data.path=t,s.items.data.source=e,s.items.data.mods=i,this.get("items").then(t=>{let e=this.o.items.process;return e||(e=this.o.ajax.process),e&&(t=e.call(self,t)),o(t)})):Promise.reject(Error("Set Items api options"))}items(t,e,i={}){return this.__items(t,e,i,t=>this.__generateItemsList(t.data.sources,i))}itemsEx(t,e,i={}){return this.__items(t,e,i,t=>({items:this.__generateItemsList(t.data.sources,i),loadedTotal:t.data.sources.reduce((t,e)=>t+e.files.length,0)}))}__generateItemsList(t,e={}){let i=[],o=t=>!e.filterWord?.length||void 0===this.o.filter||this.o.filter(t,e.filterWord);return t.forEach(t=>{if(t.files&&t.files.length){let{sort:s}=this.o;(0,a.isFunction)(s)&&e.sortBy&&t.files.sort((t,i)=>s(t,i,e.sortBy)),t.files.forEach(s=>{o(s)&&("folder"===s.type||!e.onlyImages||void 0===s.isImage||s.isImage)&&i.push(p.FileBrowserItem.create({...s,sourceName:t.name,source:t}))})}}),i}async tree(t,e){return(t=(0,l.normalizeRelativePath)(t),this.o.folder)?(await this.permissions(t,e),this.o.folder.data.path=t,this.o.folder.data.source=e,this.get("folder").then(t=>{let e=this.o.folder.process;return e||(e=this.o.ajax.process),e&&(t=e.call(self,t)),t.data.sources})):Promise.reject(Error("Set Folder Api options"))}getPathByUrl(t){return(0,h.set)("options.getLocalFileByUrl.data.url",t,this),this.get("getLocalFileByUrl").then(t=>{if(this.isSuccess(t))return t.data;throw(0,u.error)(this.getMessage(t))})}createFolder(t,e,i){let{create:o}=this.o;if(!o)throw(0,u.error)("Set Create api options");return o.data.source=i,o.data.path=e,o.data.name=t,this.get("create").then(t=>{if(this.isSuccess(t))return!0;throw(0,u.error)(this.getMessage(t))})}move(t,e,i,o){let s=o?"fileMove":"folderMove",n=this.options[s];if(!n)throw(0,u.error)("Set Move api options");return n.data.from=t,n.data.path=e,n.data.source=i,this.get(s).then(t=>{if(this.isSuccess(t))return!0;throw(0,u.error)(this.getMessage(t))})}__remove(t,e,i,o){let s=this.o[t];if(!s)throw(0,u.error)(`Set "${t}" api options`);return s.data.path=e,s.data.name=i,s.data.source=o,this.get(t).then(t=>(s.process&&(t=s.process.call(this,t)),this.getMessage(t)))}fileRemove(t,e,i){return this.__remove("fileRemove",t,e,i)}folderRemove(t,e,i){return this.__remove("folderRemove",t,e,i)}__rename(t,e,i,o,s){let n=this.o[t];if(!n)throw(0,u.error)(`Set "${t}" api options`);return n.data.path=e,n.data.name=i,n.data.newname=o,n.data.source=s,this.get(t).then(t=>(n.process&&(t=n.process.call(self,t)),this.getMessage(t)))}folderRename(t,e,i,o){return this.__rename("folderRename",t,e,i,o)}fileRename(t,e,i,o){return this.__rename("fileRename",t,e,i,o)}__changeImage(t,e,i,o,s,n){this.o[t]||(this.o[t]={data:{}});let r=this.o[t];return void 0===r.data&&(r.data={action:t}),r.data.newname=s||o,n&&(r.data.box=n),r.data.path=e,r.data.name=o,r.data.source=i,this.get(t).then(t=>t.data.newPath||!0)}crop(t,e,i,o,s){return this.__changeImage("crop",t,e,i,o,s)}resize(t,e,i,o,s){return this.__changeImage("resize",t,e,i,o,s)}getMessage(t){return this.options.getMessage(t)}isSuccess(t){return this.options.isSuccess(t)}destruct(){this.__ajaxInstances.forEach(t=>t.destruct()),this.__ajaxInstances.clear()}constructor(t,e){(0,o._)(this,"parent",void 0),(0,o._)(this,"options",void 0),(0,o._)(this,"__currentPermissions",void 0),(0,o._)(this,"__ajaxInstances",void 0),(0,o._)(this,"progressHandler",void 0),this.parent=t,this.options=e,this.__currentPermissions=null,this.__ajaxInstances=new Map,this.progressHandler=t=>{}}}(0,s.__decorate)([r.autobind],f.prototype,"onProgress",null),(0,s.__decorate)([r.autobind],f.prototype,"permissions",null),(0,s.__decorate)([r.autobind],f.prototype,"canI",null),(0,s.__decorate)([r.autobind],f.prototype,"items",null),(0,s.__decorate)([r.autobind],f.prototype,"itemsEx",null),(0,s.__decorate)([r.autobind],f.prototype,"tree",null),(0,s.__decorate)([r.autobind],f.prototype,"getPathByUrl",null),(0,s.__decorate)([r.autobind],f.prototype,"createFolder",null),(0,s.__decorate)([r.autobind],f.prototype,"move",null),(0,s.__decorate)([r.autobind],f.prototype,"fileRemove",null),(0,s.__decorate)([r.autobind],f.prototype,"folderRemove",null),(0,s.__decorate)([r.autobind],f.prototype,"folderRename",null),(0,s.__decorate)([r.autobind],f.prototype,"fileRename",null),(0,s.__decorate)([r.autobind],f.prototype,"crop",null),(0,s.__decorate)([r.autobind],f.prototype,"resize",null),(0,s.__decorate)([r.autobind],f.prototype,"getMessage",null),(0,s.__decorate)([r.autobind],f.prototype,"isSuccess",null),(0,s.__decorate)([r.autobind],f.prototype,"destruct",null),i.d(e,["DEFAULT_SOURCE_NAME",0,"default"])},18272:function(t,e,i){"use strict";i.d(e,{makeContextMenu:function(){return r},makeDataProvider:function(){return n}});var o=i(67399),s=i(17780);function n(t,e){return new s.default(t,e)}function r(t){return new o.ContextMenu(t)}},1305:function(t,e,i){"use strict";function o(t,e,i){return t.dataProvider.fileRemove(t.state.currentPath,e,i).then(i=>{t.status(i||t.i18n('File "%s" was deleted',e),!0)}).catch(t.status)}i.d(e,{deleteFile:function(){return o}})},1488:function(t,e,i){"use strict";function o(t){return t.files.setMod("active",!0),t.files.setMod("loading",!0),t.dataProvider.items(t.state.currentPath,t.state.currentSource,{sortBy:t.state.sortBy,onlyImages:t.state.onlyImages,filterWord:t.state.filterWord}).then(e=>{e&&(t.state.elements=e,t.state.activeElements=[])}).catch(t.status).finally(()=>t.files.setMod("loading",!1))}i.d(e,{loadItems:function(){return o}})},53202:function(t,e,i){"use strict";i.d(e,{loadTree:function(){return n}});var o=i(27795),s=i(1488);async function n(t){t.tree.setMod("active",!0),o.Dom.detach(t.tree.container);let e=(0,s.loadItems)(t);return t.o.showFoldersPanel?(t.tree.setMod("loading",!0),Promise.all([t.dataProvider.tree(t.state.currentPath,t.state.currentSource).then(e=>{t.state.sources=e}).catch(t.status).finally(()=>t.tree.setMod("loading",!1)),e])):(t.tree.setMod("active",!1),e)}},62623:function(t,e,i){"use strict";i.d(e,{FileBrowser:function(){return I}});var o=i(25045),s=i(31635),n=i(16964),r=i(81937),a=i(84839),l=i(68616),c=i(23211),u=i(1496),h=i(65946),d=i(80991),p=i(25222),m=i(80512),f=i(2222),g=i(5266);i(68502);var _=i(1488),v=i(53202),b=i(34269),y=i(36664),w=i(74833),S=i(17780),C=i(18272),E=i(63425);class I extends f.ViewWithToolbar{className(){return"FileBrowser"}get dataProvider(){return(0,C.makeDataProvider)(this,this.options)}onSelect(t){return()=>{if(this.state.activeElements.length){let e=[],i=[];this.state.activeElements.forEach(t=>{let o=t.fileURL;o&&(e.push(o),i.push(t.isImage||!1))}),this.close(),(0,h.isFunction)(t)&&t({baseurl:"",files:e,isImages:i}),this.close()}return!1}}get _dialog(){let t=this.dlg({minWidth:Math.min(700,screen.width),minHeight:300,buttons:this.o.headerButtons??["fullsize","dialog.close"]});return["beforeClose","afterClose","beforeOpen"].forEach(e=>t.events.on(t,e,()=>this.e.fire(e))),t.setSize(this.o.width,this.o.height),t}get storage(){return p.Storage.makeStorage(!!this.o.saveStateInStorage,this.componentName)}get isOpened(){return this._dialog.isOpened&&"none"!==(0,d.cssInline)(this.browser,"display")}status(t,e){!t||(0,h.isAbortError)(t)||((0,h.isString)(t)||(t=t.message),(0,h.isString)(t)&&(0,h.trim)(t).length&&this.message.message(t,e?"success":"error",this.o.howLongShowMsg))}open(t=this.o.defaultCallback,e=!1){return this.state.onlyImages=e,this.async.promise((e,i)=>{if(!this.o.items||!this.o.items.url)throw(0,h.error)("Need set options.filebrowser.ajax.url");let o=0;this.e.off(this.files.container,"dblclick").on(this.files.container,"dblclick",this.onSelect(t)).on(this.files.container,"touchstart",()=>{let e=new Date().getTime();e-o<r.EMULATE_DBLCLICK_TIMEOUT&&this.onSelect(t)(),o=e}).off("select.filebrowser").on("select.filebrowser",this.onSelect(t));let s=this.c.div();this.toolbar?.appendTo(s),this.__updateToolbarButtons(),this._dialog.open(this.browser,s),this.e.fire("sort.filebrowser",this.state.sortBy),(0,v.loadTree)(this).then(e,i).finally(()=>{this.isInDestruct||this?.e?.fire("fileBrowserReady.filebrowser")})}).catch(t=>{if(!(0,h.isAbortError)(t)&&!r.IS_PROD)throw t})}__getButtons(){return(this.o.buttons??[]).filter(t=>{if(!(0,h.isString)(t))return!0;switch(t){case"filebrowser.upload":return this.dataProvider.canI("FileUpload");case"filebrowser.edit":return this.dataProvider.canI("ImageResize")||this.dataProvider.canI("ImageCrop");case"filebrowser.remove":return this.dataProvider.canI("FileRemove")}return!0})}initUploader(t){let e=this,i=t?.options?.uploader,o=(0,h.ConfigProto)(i||{},g.Config.defaultOptions.uploader),s=()=>(0,_.loadItems)(this);e.uploader=e.getInstance("Uploader",o),e.uploader.setPath(e.state.currentPath).setSource(e.state.currentSource).bind(e.browser,s,e.errorHandler),this.state.on(["change.currentPath","change.currentSource"],()=>{this.uploader.setPath(this.state.currentPath).setSource(this.state.currentSource)}),e.e.on("bindUploader.filebrowser",t=>{e.uploader.bind(t,s,e.errorHandler)})}destruct(){!this.isInDestruct&&((0,a.cached)(this,"_dialog")?.destruct(),super.destruct(),this.events&&this.e.off(".filebrowser"),this.uploader&&this.uploader.destruct())}__updateToolbarButtons(){let t=this.__getButtons();!function(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}(this.__prevButtons,t)&&(this.__prevButtons=t,this.toolbar?.build(t))}constructor(t){super(t),(0,o._)(this,"browser",this.c.div(this.componentName)),(0,o._)(this,"status_line",this.c.div(this.getFullElName("status"))),(0,o._)(this,"tree",new E.FileBrowserTree(this)),(0,o._)(this,"files",new E.FileBrowserFiles(this)),(0,o._)(this,"state",(0,u.observable)({currentPath:"",currentSource:S.DEFAULT_SOURCE_NAME,currentBaseUrl:"",activeElements:[],elements:[],sources:[],view:"tiles",sortBy:"changed-desc",filterWord:"",onlyImages:!1})),(0,o._)(this,"errorHandler",t=>{(0,h.isAbortError)(t)||(t instanceof Error?this.status(this.i18n(t.message)):this.status(this.dataProvider.getMessage(t)))}),(0,o._)(this,"uploader",void 0),(0,o._)(this,"close",()=>{this._dialog.close()}),(0,o._)(this,"__prevButtons",[]),this.attachEvents(t),this.options=(0,h.ConfigProto)(t||{},g.Config.defaultOptions.filebrowser),this.browser.component=this,this.container=this.browser,this.o.showFoldersPanel&&c.Dom.append(this.browser,this.tree.container),c.Dom.append(this.browser,this.files.container),c.Dom.append(this.browser,this.status_line),y.selfListeners.call(this),b.nativeListeners.call(this),w.stateListeners.call(this),["getLocalFileByUrl","crop","resize","create","fileMove","folderMove","fileRename","folderRename","fileRemove","folderRemove","folder","items","permissions"].forEach(t=>{null!=this.options[t]&&(this.options[t]=(0,h.ConfigProto)(this.options[t],this.o.ajax))});const{storeView:e,storeSortBy:i,storeLastOpenedFolder:s}=this.o.saveStateInStorage||{storeLastOpenedFolder:!1,storeView:!1,storeSortBy:!1},r=e&&this.storage.get("view");r&&null==this.o.view?this.state.view="list"===r?"list":"tiles":this.state.view="list"===this.o.view?"list":"tiles",this.files.setMod("view",this.state.view);const a=i&&this.storage.get("sortBy");if(a){const t=a.split("-");this.state.sortBy=["changed","name","size"].includes(t[0])?a:"changed-desc"}else this.state.sortBy=this.o.sortBy||"changed-desc";if(s){const t=this.storage.get("currentPath"),e=this.storage.get("currentSource");this.state.currentPath=t??"",this.state.currentSource=e??""}this.initUploader(this),this.setStatus(n.STATUSES.ready)}}(0,s.__decorate)([a.cache],I.prototype,"dataProvider",null),(0,s.__decorate)([a.cache],I.prototype,"_dialog",null),(0,s.__decorate)([a.cache],I.prototype,"storage",null),(0,s.__decorate)([a.autobind],I.prototype,"status",null),(0,s.__decorate)([a.autobind],I.prototype,"open",null),(0,s.__decorate)([(0,l.watch)("dataProvider:changePermissions")],I.prototype,"__updateToolbarButtons",null),I=(0,s.__decorate)([(0,a.derive)(m.Dlgs)],I)},17610:function(t,e,i){"use strict";i.d(e,{FileBrowser:function(){return o.FileBrowser}});var o=i(62623)},34269:function(t,e,i){"use strict";i.d(e,{nativeListeners:function(){return c}});var o=i(7909),s=i(77213),n=i(61334),r=i(31125),a=i(66206),l=i(53202);function c(){let t=!1,e=(0,r.elementsMap)(this),i=this;i.e.on(i.tree.container,"dragstart",e=>{let o=(0,a.getItem)(e.target,i.container);o&&i.o.moveFolder&&(t=o)}).on(i.tree.container,"drop",e=>{if((i.o.moveFile||i.o.moveFolder)&&t){let s=(0,o.attr)(t,"-path")||"";if(!i.o.moveFolder&&t.classList.contains(this.tree.getFullElName("item"))||t.classList.contains(this.files.getFullElName("item"))&&(s+=(0,o.attr)(t,"-name"),!i.o.moveFile))return!1;let n=(0,a.getItem)(e.target,i.container);n&&(i.dataProvider.move(s,(0,o.attr)(n,"-path")||"",(0,o.attr)(n,"-source")||"",t.classList.contains(this.files.getFullElName("item"))).then(()=>(0,l.loadTree)(this)).catch(i.status),t=!1)}}).on(i.files.container,"contextmenu",(0,n.default)(i)).on(i.files.container,"click",t=>{(0,s.ctrlKey)(t)||(this.state.activeElements=[])}).on(i.files.container,"click",t=>{let o=(0,a.getItem)(t.target,i.container);if(!o)return;let n=(0,a.elementToItem)(o,e);if(n)return(0,s.ctrlKey)(t)?i.state.activeElements=[...i.state.activeElements,n]:i.state.activeElements=[n],t.stopPropagation(),!1}).on(i.files.container,"dragstart",e=>{if(i.o.moveFile){let o=(0,a.getItem)(e.target,i.container);o&&(t=o)}}).on(i.container,"drop",t=>t.preventDefault())}},36664:function(t,e,i){"use strict";i.d(e,{selfListeners:function(){return u}});var o=i(65946),s=i(28686),n=i(17780),r=i(1305),a=i(1488),l=i(53202),c=i(43271);function u(){let t=this.state,e=this.dataProvider,i=this;i.e.on("view.filebrowser",e=>{e!==t.view&&(t.view=e)}).on("sort.filebrowser",e=>{e!==t.sortBy&&(t.sortBy=e,(0,a.loadItems)(i))}).on("filter.filebrowser",e=>{e!==t.filterWord&&(t.filterWord=e,(0,a.loadItems)(i))}).on("openFolder.filebrowser",t=>{let e;e=".."===t.name?t.path.split("/").filter(t=>t.length).slice(0,-1).join("/"):(0,o.normalizePath)(t.path,t.name),i.state.currentPath=e,i.state.currentSource="."===t.name?n.DEFAULT_SOURCE_NAME:t.source}).on("removeFolder.filebrowser",t=>{i.confirm("Are you sure?","Delete",o=>{o&&e.folderRemove(t.path,t.name,t.source).then(t=>(i.status(t,!0),(0,l.loadTree)(i))).catch(i.status)})}).on("renameFolder.filebrowser",t=>{i.prompt("Enter new name","Rename",o=>{if(!(0,s.isValidName)(o))return i.status(i.i18n("Enter new name")),!1;e.folderRename(t.path,t.name,o,t.source).then(t=>(i.state.activeElements=[],i.status(t,!0),(0,l.loadTree)(i))).catch(i.status)},"type name",t.name)}).on("addFolder.filebrowser",t=>{i.prompt("Enter Directory name","Create directory",o=>{e.createFolder(o,t.path,t.source).then(()=>(0,l.loadTree)(i)).catch(i.status)},"type dir name")}).on("fileRemove.filebrowser",()=>{i.state.activeElements.length&&i.confirm("Are you sure?","",t=>{if(t){let t=[];i.state.activeElements.forEach(e=>{t.push((0,r.deleteFile)(i,e.file||e.name||"",e.sourceName))}),i.state.activeElements=[],Promise.all(t).then(()=>(0,l.loadTree)(i).catch(i.status),i.status)}})}).on("edit.filebrowser",()=>{if(1===i.state.activeElements.length){let[t]=this.state.activeElements;c.openImageEditor.call(i,t.fileURL,t.file||"",t.path,t.sourceName)}}).on("fileRename.filebrowser",(t,o,n)=>{1===i.state.activeElements.length&&i.prompt("Enter new name","Rename",r=>{if(!(0,s.isValidName)(r))return i.status(i.i18n("Enter new name")),!1;e.fileRename(o,t,r,n).then(t=>{i.state.activeElements=[],i.status(t,!0),(0,a.loadItems)(i)}).catch(i.status)},"type name",t)}).on("update.filebrowser",()=>{(0,l.loadTree)(this).then(this.status,this.status)})}},74833:function(t,e,i){"use strict";i.d(e,{stateListeners:function(){return l}});var o=i(27795),s=i(97022),n=i(53681),r=i(31125),a=i(53202);function l(){let t=(0,r.elementsMap)(this),{state:e,files:i,create:l,options:c}=this,u=e=>{let i=e.uniqueHashKey;if(t[i])return t[i].elm;let o=l.fromHTML(c.getThumbTemplate.call(this,e,e.source,e.sourceName.toString()));return o.dataset.key=i,t[i]={item:e,elm:o},t[i].elm};e.on(["change.currentPath","change.currentSource"],this.async.debounce(()=>{this.o.saveStateInStorage&&this.o.saveStateInStorage.storeLastOpenedFolder&&this.storage.set("currentPath",this.state.currentPath).set("currentSource",this.state.currentSource),(0,a.loadTree)(this).catch(this.status)},this.defaultTimeout)).on("beforeChange.activeElements",()=>{e.activeElements.forEach(e=>{let{elm:o}=t[e.uniqueHashKey];o&&o.classList.remove(i.getFullElName("item","active",!0))})}).on("change.activeElements",()=>{this.e.fire("changeSelection"),e.activeElements.forEach(e=>{let{elm:o}=t[e.uniqueHashKey];o&&o.classList.add(i.getFullElName("item","active",!0))})}).on("change.view",()=>{i.setMod("view",e.view),this.o.saveStateInStorage&&this.o.saveStateInStorage.storeView&&this.storage.set("view",e.view)}).on("change.sortBy",()=>{this.o.saveStateInStorage&&this.o.saveStateInStorage.storeSortBy&&this.storage.set("sortBy",e.sortBy)}).on("change.elements",this.async.debounce(()=>{o.Dom.detach(i.container),e.elements.length?e.elements.forEach(t=>{o.Dom.append(this.files.container,u(t))}):o.Dom.append(i.container,l.div(this.componentName+"_no-files_true",this.i18n("There are no files")))},this.defaultTimeout)).on("change.sources",this.async.debounce(()=>{o.Dom.detach(this.tree.container),e.sources.forEach(t=>{let e=t.name;if(e&&"default"!==e&&o.Dom.append(this.tree.container,l.div(this.tree.getFullElName("source-title"),e)),t.folders.forEach(i=>{let r=l.a(this.tree.getFullElName("item"),{draggable:"draggable",href:"#","data-path":(0,s.normalizePath)(t.path,i+"/"),"data-name":i,"data-source":e,"data-source-path":t.path},l.span(this.tree.getFullElName("item-title"),i)),a=o=>n=>{this.e.fire(`${o}.filebrowser`,{name:i,path:(0,s.normalizePath)(t.path+"/"),source:e}),n.stopPropagation(),n.preventDefault()};if(this.e.on(r,"click",a("openFolder")),o.Dom.append(this.tree.container,r),".."!==i&&"."!==i){if(c.renameFolder&&this.dataProvider.canI("FolderRename")){let t=(0,n.Button)(this,{icon:{name:"pencil"},name:"rename",tooltip:"Rename",size:"tiny"});t.onAction(a("renameFolder")),o.Dom.append(r,t.container)}if(c.deleteFolder&&this.dataProvider.canI("FolderRemove")){let t=(0,n.Button)(this,{icon:{name:"cancel"},name:"remove",tooltip:"Delete",size:"tiny"});t.onAction(a("removeFolder")),o.Dom.append(r,t.container)}}}),c.createNewFolder&&this.dataProvider.canI("FolderCreate")){let i=(0,n.Button)(this,"plus","Add folder","secondary");i.onAction(()=>{this.e.fire("addFolder",{path:(0,s.normalizePath)(t.path+"/"),source:e})}),this.tree.append(i)}})},this.defaultTimeout))}},86122:function(t,e,i){"use strict";i.d(e,{FileBrowserFiles:function(){return s}});var o=i(4099);class s extends o.UIGroup{className(){return"FileBrowserFiles"}}},63425:function(t,e,i){"use strict";i.d(e,{FileBrowserFiles:function(){return o.FileBrowserFiles},FileBrowserTree:function(){return s.FileBrowserTree}});var o=i(86122),s=i(55376)},55376:function(t,e,i){"use strict";i.d(e,{FileBrowserTree:function(){return s}});var o=i(4099);class s extends o.UIGroup{className(){return"FileBrowserTree"}}},8838:function(t,e,i){"use strict";i.d(e,{Command:function(){return s}});var o=i(25045);class s{undo(){this.history.snapshot.restore(this.oldValue)}redo(){this.history.snapshot.restore(this.newValue)}constructor(t,e,i,s){(0,o._)(this,"oldValue",void 0),(0,o._)(this,"newValue",void 0),(0,o._)(this,"history",void 0),(0,o._)(this,"tick",void 0),this.oldValue=t,this.newValue=e,this.history=i,this.tick=s}}},53855:function(t,e,i){"use strict";i.d(e,{History:function(){return h}});var o=i(25045),s=i(31635),n=i(59609),r=i(55184),a=i(5266),l=i(8838),c=i(46363),u=i(33511);a.Config.prototype.history={enable:!0,maxHistoryLength:1/0,timeout:1e3};class h extends n.ViewComponent{className(){return"History"}redo(){this.__stack.redo()&&(this.startValue=this.snapshot.make(),this.fireChangeStack())}canRedo(){return this.__stack.canRedo()}undo(){this.__stack.undo()&&(this.startValue=this.snapshot.make(),this.fireChangeStack())}canUndo(){return this.__stack.canUndo()}clear(){this.startValue=this.snapshot.make(),this.__stack.clear(),this.fireChangeStack()}get length(){return this.__stack.length}get startValue(){return this.__startValue}set startValue(t){this.__startValue=t}__upTick(){this.updateTick+=1}onChange(){this.__processChanges()}__processChanges(){!this.snapshot.isBlocked&&this.j.o.history.enable&&this.updateStack()}updateStack(t=!1){let e=this.snapshot.make();if(!c.Snapshot.equal(e,this.startValue)){let i=new l.Command(this.startValue,e,this,this.updateTick);if(t){let t=this.__stack.current();t&&this.updateTick===t.tick&&this.__stack.replace(i)}else this.__stack.push(i);this.startValue=e,this.fireChangeStack()}}fireChangeStack(){this.j&&!this.j.isInDestruct&&this.j.events?.fire("changeStack")}destruct(){this.isInDestruct||(this.j.events&&this.j.e.off(".history"),this.snapshot.destruct(),super.destruct())}constructor(t,e=new u.Stack(t.o.history.maxHistoryLength),i=new c.Snapshot(t)){super(t),(0,o._)(this,"__startValue",void 0),(0,o._)(this,"__stack",void 0),(0,o._)(this,"snapshot",void 0),(0,o._)(this,"updateTick",0),this.__stack=e,this.snapshot=i,t.o.history.enable&&t.e.on("afterAddPlace.history",()=>{this.isInDestruct||(this.startValue=this.snapshot.make(),t.events.on("internalChange internalUpdate",()=>{this.startValue=this.snapshot.make()}).on(t.editor,["changeSelection","selectionstart","selectionchange","mousedown","mouseup","keydown","keyup"].map(t=>t+".history").join(" "),()=>{this.startValue.html===this.j.getNativeEditorValue()&&(this.startValue=this.snapshot.make())}).on(this,"change.history",this.onChange))})}}(0,s.__decorate)([(0,r.debounce)()],h.prototype,"onChange",null)},46363:function(t,e,i){"use strict";i.d(e,{Snapshot:function(){return a}});var o=i(25045),s=i(16964),n=i(81937),r=i(23211);class a extends s.ViewComponent{className(){return"Snapshot"}static equal(t,e){return t.html===e.html&&JSON.stringify(t.range)===JSON.stringify(e.range)}static countNodesBeforeInParent(t){if(!t.parentNode)return 0;let e=t.parentNode.childNodes,i=0,o=null;for(let s=0;s<e.length;s+=1){if(!o||this.isIgnoredNode(e[s])||r.Dom.isText(o)&&r.Dom.isText(e[s])||(i+=1),e[s]===t)return i;o=e[s]}return 0}static strokeOffset(t,e){for(;r.Dom.isText(t);)t=t.previousSibling,r.Dom.isText(t)&&t.nodeValue&&(e+=t.nodeValue.length);return e}calcHierarchyLadder(t){let e=[];if(!t||!t.parentNode||!r.Dom.isOrContains(this.j.editor,t))return[];for(;t&&t!==this.j.editor;)t&&!a.isIgnoredNode(t)&&e.push(a.countNodesBeforeInParent(t)),t=t.parentNode;return e.reverse()}getElementByLadder(t){let e=this.j.editor,i;for(i=0;e&&i<t.length;i+=1)e=e.childNodes[t[i]];return e}get isBlocked(){return this.__isBlocked}__block(t){this.__isBlocked=t}transaction(t){this.__block(!0),this.__levelOfTransaction+=1;try{t()}catch(t){if(!n.IS_PROD)throw t}finally{this.__levelOfTransaction-=1,0===this.__levelOfTransaction&&this.__block(!1)}}make(){let t={html:"",range:{startContainer:[],startOffset:0,endContainer:[],endOffset:0}};t.html=this.__getCleanedEditorValue(this.j.editor);let e=this.j.s.sel;if(e&&e.rangeCount){let i=e.getRangeAt(0),o=this.calcHierarchyLadder(i.startContainer),s=this.calcHierarchyLadder(i.endContainer),n=a.strokeOffset(i.startContainer,i.startOffset),r=a.strokeOffset(i.endContainer,i.endOffset);o.length||i.startContainer===this.j.editor||(n=0),s.length||i.endContainer===this.j.editor||(r=0),t.range={startContainer:o,startOffset:n,endContainer:s,endOffset:r}}return t}restore(t){this.transaction(()=>{let e=this.storeScrollState();this.__getCleanedEditorValue(this.j.editor)!==t.html&&(this.j.value=t.html),this.restoreOnlySelection(t),this.restoreScrollState(e)})}storeScrollState(){return[this.j.ow.scrollY,this.j.editor.scrollTop]}restoreScrollState(t){let{j:e}=this,{ow:i}=e;i.scrollTo(i.scrollX,t[0]),e.editor.scrollTop=t[1]}restoreOnlySelection(t){try{if(t.range){let e=this.j.ed.createRange();e.setStart(this.getElementByLadder(t.range.startContainer),t.range.startOffset),e.setEnd(this.getElementByLadder(t.range.endContainer),t.range.endOffset),this.j.s.selectRange(e)}}catch(t){this.j.editor.lastChild&&this.j.s.setCursorAfter(this.j.editor.lastChild),n.IS_PROD}}destruct(){this.__block(!1),super.destruct()}static isIgnoredNode(t){return r.Dom.isText(t)&&!t.nodeValue||r.Dom.isTemporary(t)}__getCleanedEditorValue(t){let e=t.cloneNode(!0);return r.Dom.temporaryList(e).forEach(r.Dom.unwrap),e.innerHTML}constructor(...t){super(...t),(0,o._)(this,"__isBlocked",!1),(0,o._)(this,"__levelOfTransaction",0)}}},33511:function(t,e,i){"use strict";i.d(e,{Stack:function(){return s}});var o=i(25045);class s{get length(){return this.commands.length}clearRedo(){this.commands.length=this.stackPosition+1}clear(){this.commands.length=0,this.stackPosition=-1}push(t){this.clearRedo(),this.commands.push(t),this.stackPosition+=1,this.commands.length>this.size&&(this.commands.shift(),this.stackPosition-=1)}replace(t){this.commands[this.stackPosition]=t}current(){return this.commands[this.stackPosition]}undo(){return!!this.canUndo()&&(this.commands[this.stackPosition]&&this.commands[this.stackPosition].undo(),this.stackPosition-=1,!0)}redo(){return!!this.canRedo()&&(this.stackPosition+=1,this.commands[this.stackPosition]&&this.commands[this.stackPosition].redo(),!0)}canUndo(){return this.stackPosition>=0}canRedo(){return this.stackPosition<this.commands.length-1}constructor(t){(0,o._)(this,"size",void 0),(0,o._)(this,"commands",void 0),(0,o._)(this,"stackPosition",void 0),this.size=t,this.commands=[],this.stackPosition=-1}}},54500:function(t,e,i){"use strict";var o=i(29434),s=i(5266),n=i(928),r=i.n(n),a=i(31230),l=i.n(a);s.Config.prototype.imageeditor={min_width:20,min_height:20,closeAfterSave:!1,width:"85%",height:"85%",crop:!0,resize:!0,resizeUseRatio:!0,resizeMinWidth:20,resizeMinHeight:20,cropUseRatio:!0,cropDefaultWidth:"70%",cropDefaultHeight:"70%"},o.Icon.set("crop",r()).set("resize",l())},43271:function(t,e,i){"use strict";i.d(e,{ImageEditor:function(){return S},openImageEditor:function(){return C}});var o=i(25045),s=i(31635),n=i(16964),r=i(84839),a=i(27795),l=i(4040),c=i(7909),u=i(80991),h=i(28723),d=i(71125),p=i(59400),m=i(5266);i(54500);var f=i(8908);let g="jodit-image-editor",_=t=>e=>e.classList.contains(t);function v(t,e){return a.Dom.first(t,t=>a.Dom.isHTMLElement(t)&&e(t))}function b(t,e){let i=[];return a.Dom.each(t,t=>{a.Dom.isHTMLElement(t)&&e(t)&&i.push(t)}),i}let y="resize",w="crop";class S extends n.ViewComponent{className(){return"ImageEditor"}get o(){return this.options}hide(){this._dialog.close()}open(t,e){return this.j.async.promise(i=>{let o=new Date().getTime();this.image=this.j.c.element("img");let s=t=>a.Dom.isTag(t,"img")||_("jodit-icon_loader")(t);b(this.resize_box,s).forEach(a.Dom.safeRemove),b(this.crop_box,s).forEach(a.Dom.safeRemove),(0,u.css)(this.cropHandler,"background","transparent"),this.onSave=e,a.Dom.append(this.resize_box,this.j.c.element("i",{class:"jodit-icon_loader"})),a.Dom.append(this.crop_box,this.j.c.element("i",{class:"jodit-icon_loader"})),/\?/.test(t)?t+="&_tst="+o:t+="?_tst="+o,(0,c.attr)(this.image,"src",t),this._dialog.open();let{widthInput:n,heightInput:r}=(0,h.refs)(this.editor),l=()=>{this.isDestructed||(this.image.removeEventListener("load",l),this.naturalWidth=this.image.naturalWidth,this.naturalHeight=this.image.naturalHeight,n.value=this.naturalWidth.toString(),r.value=this.naturalHeight.toString(),this.ratio=this.naturalWidth/this.naturalHeight,a.Dom.append(this.resize_box,this.image),this.cropImage=this.image.cloneNode(!0),a.Dom.append(this.crop_box,this.cropImage),a.Dom.safeRemove.apply(null,b(this.editor,_("jodit-icon_loader"))),this.activeTab===w&&this.showCrop(),this.j.e.fire(this.resizeHandler,"updatesize"),this.j.e.fire(this.cropHandler,"updatesize"),this._dialog.setPosition(),this.j.e.fire("afterImageEditor"),i(this._dialog))};this.image.addEventListener("load",l),this.image.complete&&l()})}onTitleModeClick(t){let e=this,i=t.target,o=i?.parentElement;if(!o)return;b(e.editor,t=>_(`${g}__slider`)(t)||_(`${g}__area`)(t)).forEach(t=>t.classList.remove(`${g}_active`)),o.classList.add(`${g}_active`),this.activeTab=(0,c.attr)(o,"-area")||y;let s=v(e.editor,t=>_(`${g}__area`)(t)&&_(`${g}__area_`+e.activeTab)(t));s&&s.classList.add(`${g}_active`),e.activeTab===w&&e.showCrop()}onChangeSizeInput(t){let e,i=t.target,{widthInput:o,heightInput:s}=(0,h.refs)(this.editor),n="widthInput"===(0,c.attr)(i,"data-ref"),r=parseInt(i.value,10),a=n?this.o.min_width:this.o.min_height,l=n?this.o.min_height:this.o.min_width;r>a&&((0,u.css)(this.image,n?"width":"height",r),this.resizeUseRatio&&(e=n?Math.round(r/this.ratio):Math.round(r*this.ratio))>l&&((0,u.css)(this.image,n?"height":"width",e),n?s.value=e.toString():o.value=e.toString())),this.j.e.fire(this.resizeHandler,"updatesize")}onResizeHandleMouseDown(t){this.target=t.target,t.preventDefault(),t.stopImmediatePropagation(),this.clicked=!0,this.start_x=t.clientX,this.start_y=t.clientY,this.activeTab===w?(this.top_x=(0,u.css)(this.cropHandler,"left"),this.top_y=(0,u.css)(this.cropHandler,"top"),this.width=this.cropHandler.offsetWidth,this.height=this.cropHandler.offsetHeight):(this.width=this.image.offsetWidth,this.height=this.image.offsetHeight),this.j.e.on(this.j.ow,"mousemove",this.onGlobalMouseMove).one(this.j.ow,"mouseup",this.onGlobalMouseUp)}onGlobalMouseUp(t){this.clicked&&(this.clicked=!1,t.stopImmediatePropagation(),this.j.e.off(this.j.ow,"mousemove",this.onGlobalMouseMove))}onGlobalMouseMove(t){if(!this.clicked)return;let{widthInput:e,heightInput:i}=(0,h.refs)(this.editor);this.diff_x=t.clientX-this.start_x,this.diff_y=t.clientY-this.start_y,this.activeTab===y&&this.resizeUseRatio||this.activeTab===w&&this.cropUseRatio?this.diff_x?(this.new_w=this.width+this.diff_x,this.new_h=Math.round(this.new_w/this.ratio)):(this.new_h=this.height+this.diff_y,this.new_w=Math.round(this.new_h*this.ratio)):(this.new_w=this.width+this.diff_x,this.new_h=this.height+this.diff_y),this.activeTab===y?(this.new_w>this.o.resizeMinWidth&&((0,u.css)(this.image,"width",this.new_w+"px"),e.value=this.new_w.toString()),this.new_h>this.o.resizeMinHeight&&((0,u.css)(this.image,"height",this.new_h+"px"),i.value=this.new_h.toString()),this.j.e.fire(this.resizeHandler,"updatesize")):(this.target!==this.cropHandler?(this.top_x+this.new_w>this.cropImage.offsetWidth&&(this.new_w=this.cropImage.offsetWidth-this.top_x),this.top_y+this.new_h>this.cropImage.offsetHeight&&(this.new_h=this.cropImage.offsetHeight-this.top_y),(0,u.css)(this.cropHandler,{width:this.new_w,height:this.new_h})):(this.top_x+this.diff_x+this.cropHandler.offsetWidth>this.cropImage.offsetWidth&&(this.diff_x=this.cropImage.offsetWidth-this.top_x-this.cropHandler.offsetWidth),(0,u.css)(this.cropHandler,"left",this.top_x+this.diff_x),this.top_y+this.diff_y+this.cropHandler.offsetHeight>this.cropImage.offsetHeight&&(this.diff_y=this.cropImage.offsetHeight-this.top_y-this.cropHandler.offsetHeight),(0,u.css)(this.cropHandler,"top",this.top_y+this.diff_y)),this.j.e.fire(this.cropHandler,"updatesize"))}destruct(){this.isDestructed||(this._dialog&&!this._dialog.isInDestruct&&this._dialog.destruct(),a.Dom.safeRemove(this.editor),this.j.e&&this.j.e.off(this.j.ow,"mousemove",this.onGlobalMouseMove).off(this.j.ow,"mouseup",this.onGlobalMouseUp).off(this.ow,"."+g).off("."+g),super.destruct())}constructor(t){super(t),(0,o._)(this,"options",void 0),(0,o._)(this,"onSave",void 0),(0,o._)(this,"resizeUseRatio",!0),(0,o._)(this,"cropUseRatio",!0),(0,o._)(this,"_dialog",void 0),(0,o._)(this,"image",void 0),(0,o._)(this,"cropImage",void 0),(0,o._)(this,"clicked",!1),(0,o._)(this,"target",void 0),(0,o._)(this,"start_x",0),(0,o._)(this,"start_y",0),(0,o._)(this,"top_x",0),(0,o._)(this,"top_y",0),(0,o._)(this,"width",0),(0,o._)(this,"height",0),(0,o._)(this,"activeTab",y),(0,o._)(this,"naturalWidth",0),(0,o._)(this,"naturalHeight",0),(0,o._)(this,"ratio",0),(0,o._)(this,"new_h",0),(0,o._)(this,"new_w",0),(0,o._)(this,"diff_x",0),(0,o._)(this,"diff_y",0),(0,o._)(this,"buttons",void 0),(0,o._)(this,"editor",void 0),(0,o._)(this,"resize_box",void 0),(0,o._)(this,"crop_box",void 0),(0,o._)(this,"sizes",void 0),(0,o._)(this,"resizeHandler",void 0),(0,o._)(this,"cropHandler",void 0),(0,o._)(this,"cropBox",{x:0,y:0,w:0,h:0}),(0,o._)(this,"resizeBox",{w:0,h:0}),(0,o._)(this,"calcCropBox",()=>{let t=this.crop_box.parentNode,e=.8*t.offsetWidth,i=.8*t.offsetHeight,o=e,s=i,{naturalWidth:n,naturalHeight:r}=this;e>n&&i>r?(o=n,s=r):this.ratio>e/i?(o=e,s=e/n*r):(o=i/r*n,s=i),(0,u.css)(this.crop_box,{width:o,height:s})}),(0,o._)(this,"showCrop",()=>{if(!this.cropImage)return;this.calcCropBox();let t=this.cropImage.offsetWidth||this.image.offsetWidth||this.image.naturalWidth;this.new_w=S.calcValueByPercent(t,this.o.cropDefaultWidth);let e=this.cropImage.offsetHeight||this.image.offsetHeight||this.image.naturalHeight;this.cropUseRatio?this.new_h=this.new_w/this.ratio:this.new_h=S.calcValueByPercent(e,this.o.cropDefaultHeight),(0,u.css)(this.cropHandler,{backgroundImage:"url("+(0,c.attr)(this.cropImage,"src")+")",width:this.new_w,height:this.new_h,left:t/2-this.new_w/2,top:e/2-this.new_h/2}),this.j.e.fire(this.cropHandler,"updatesize")}),(0,o._)(this,"updateCropBox",()=>{if(!this.cropImage)return;let t=this.cropImage.offsetWidth/this.naturalWidth,e=this.cropImage.offsetHeight/this.naturalHeight;this.cropBox.x=(0,u.css)(this.cropHandler,"left")/t,this.cropBox.y=(0,u.css)(this.cropHandler,"top")/e,this.cropBox.w=this.cropHandler.offsetWidth/t,this.cropBox.h=this.cropHandler.offsetHeight/e,this.sizes.textContent=this.cropBox.w.toFixed(0)+"x"+this.cropBox.h.toFixed(0)}),(0,o._)(this,"updateResizeBox",()=>{this.resizeBox.w=this.image.offsetWidth||this.naturalWidth,this.resizeBox.h=this.image.offsetHeight||this.naturalHeight}),(0,o._)(this,"setHandlers",()=>{let t=this,{widthInput:e,heightInput:i}=(0,h.refs)(this.editor);t.j.e.on([v(t.editor,_("jodit_bottomright")),t.cropHandler],"mousedown."+g,this.onResizeHandleMouseDown).on(this.j.ow,"resize."+g,()=>{this.j.e.fire(t.resizeHandler,"updatesize"),t.showCrop(),this.j.e.fire(t.cropHandler,"updatesize")}),t.j.e.on(b(this.editor,_(`${g}__slider-title`)),"click",this.onTitleModeClick).on([e,i],"input",this.onChangeSizeInput);let{keepAspectRatioResize:o,keepAspectRatioCrop:s}=(0,h.refs)(this.editor);o&&o.addEventListener("change",()=>{this.resizeUseRatio=o.checked}),s&&s.addEventListener("change",()=>{this.cropUseRatio=s.checked}),t.j.e.on(t.resizeHandler,"updatesize",()=>{(0,u.css)(t.resizeHandler,{top:0,left:0,width:t.image.offsetWidth||t.naturalWidth,height:t.image.offsetHeight||t.naturalHeight}),this.updateResizeBox()}).on(t.cropHandler,"updatesize",()=>{if(!t.cropImage)return;let e=(0,u.css)(t.cropHandler,"left"),i=(0,u.css)(t.cropHandler,"top"),o=t.cropHandler.offsetWidth,s=t.cropHandler.offsetHeight;e<0&&(e=0),i<0&&(i=0),e+o>t.cropImage.offsetWidth&&(o=t.cropImage.offsetWidth-e,t.cropUseRatio&&(s=o/t.ratio)),i+s>t.cropImage.offsetHeight&&(s=t.cropImage.offsetHeight-i,t.cropUseRatio&&(o=s*t.ratio)),(0,u.css)(t.cropHandler,{width:o,height:s,left:e,top:i,backgroundPosition:-e-1+"px "+(-i-1)+"px",backgroundSize:t.cropImage.offsetWidth+"px "+t.cropImage.offsetHeight+"px"}),t.updateCropBox()}),Object.values(t.buttons).forEach(o=>{o.onAction(()=>{let s={action:t.activeTab,box:t.activeTab===y?t.resizeBox:t.cropBox};switch(o){case t.buttons.saveas:t.j.prompt("Enter new name","Save in new file",e=>{if(!(0,l.trim)(e))return t.j.alert("The name should not be empty"),!1;t.j.e.fire("afterImageEditorSave",s,e),t.onSave(e,s,t.hide,e=>{t.j.alert(e.message)})});break;case t.buttons.save:t.j.e.fire("afterImageEditorSave",s),t.onSave(void 0,s,t.hide,e=>{t.j.alert(e.message)});break;case t.buttons.reset:t.activeTab===y?((0,u.css)(t.image,{width:null,height:null}),e.value=t.naturalWidth.toString(),i.value=t.naturalHeight.toString(),t.j.e.fire(t.resizeHandler,"updatesize")):t.showCrop()}})})}),this.options=t&&t.o&&t.o.imageeditor?t.o.imageeditor:m.Config.defaultOptions.imageeditor;const e=this.options;this.resizeUseRatio=e.resizeUseRatio,this.cropUseRatio=e.cropUseRatio,this.buttons={reset:(0,p.Button)(this.j,"update","Reset"),save:(0,p.Button)(this.j,"save","Save"),saveas:(0,p.Button)(this.j,{icon:{name:"save"},name:"save-as",text:"Save as ..."})},this.activeTab=e.resize?y:w,this.editor=(0,f.form)(this.j,this.options);const{resizeBox:i,cropBox:s}=(0,h.refs)(this.editor);this.resize_box=i,this.crop_box=s,this.sizes=v(this.editor,t=>_(`${g}__sizes`)(t)&&!!a.Dom.closest(t,t=>a.Dom.isHTMLElement(t)&&_(`${g}__area_crop`)(t),this.editor)),this.resizeHandler=v(this.editor,_(`${g}__resizer`)),this.cropHandler=v(this.editor,_(`${g}__croper`)),this._dialog=this.j.dlg({buttons:["fullsize","dialog.close"]}),this._dialog.setContent(this.editor),this._dialog.setSize(this.o.width,this.o.height),this._dialog.setHeader([this.buttons.reset,this.buttons.save,this.buttons.saveas]),this.setHandlers()}}function C(t,e,i,o,s,n){return this.getInstance("ImageEditor",this.o).open(t,(t,r,a,l)=>{if("saved"===r.action){a(),s&&s(r.newPath);return}(0,d.call)("resize"===r.action?this.dataProvider.resize:this.dataProvider.crop,i,o,e,t,r.box).then(t=>{t&&(a(),s&&s("string"==typeof t?t:void 0))}).catch(t=>{l(t),n&&n(t)})})}(0,o._)(S,"calcValueByPercent",(t,e)=>{let i,o=e.toString(),s=parseFloat(t.toString());return(i=/^[-+]?[0-9]+(px)?$/.exec(o))?parseInt(o,10):(i=/^([-+]?[0-9.]+)%$/.exec(o))?Math.round(s*(parseFloat(i[1])/100)):s||0}),(0,s.__decorate)([r.autobind],S.prototype,"hide",null),(0,s.__decorate)([r.autobind],S.prototype,"open",null),(0,s.__decorate)([r.autobind],S.prototype,"onTitleModeClick",null),(0,s.__decorate)([(0,r.debounce)(),r.autobind],S.prototype,"onChangeSizeInput",null),(0,s.__decorate)([r.autobind],S.prototype,"onResizeHandleMouseDown",null),(0,s.__decorate)([r.autobind],S.prototype,"onGlobalMouseUp",null),(0,s.__decorate)([(0,r.throttle)(10)],S.prototype,"onGlobalMouseMove",null),S=(0,s.__decorate)([r.component],S)},8908:function(t,e,i){"use strict";var o=i(4099);let s="jodit-image-editor",n=o.Icon.get.bind(o.Icon),r=(t,e="jodti-image-editor_active")=>t?e:"";i.d(e,["form",0,(t,e)=>{let i=t.i18n.bind(t),o=(t,e,o=!0)=>`<div class="jodit-form__group">
|
|
56
|
+
</a>`},ajax:{...a.Config.prototype.defaultAjaxOptions,url:"",data:{},cache:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",method:"POST",processData:!0,headers:{},prepareData:t=>t,process:t=>t},create:{data:{action:"folderCreate"}},getLocalFileByUrl:{data:{action:"getLocalFileByUrl"}},resize:{data:{action:"imageResize"}},crop:{data:{action:"imageCrop"}},fileMove:{data:{action:"fileMove"}},folderMove:{data:{action:"folderMove"}},fileRename:{data:{action:"fileRename"}},folderRename:{data:{action:"folderRename"}},fileRemove:{data:{action:"fileRemove"}},folderRemove:{data:{action:"folderRemove"}},items:{data:{action:"files"}},folder:{data:{action:"folders"}},permissions:{data:{action:"permissions"}}},a.Config.prototype.controls.filebrowser={upload:{icon:"plus",tooltip:"Upload file",isInput:!0,isDisabled:t=>!t.dataProvider.canI("FileUpload"),getContent(t,e){let i=new r.UIFileInput(t,{tooltip:e.control.tooltip,onlyImages:t.state.onlyImages});return t.e.fire("bindUploader.filebrowser",i.container),i.container}},remove:{icon:"bin",tooltip:"Remove file",isDisabled:t=>!t.state.activeElements.length||!t.dataProvider.canI("FileRemove"),exec(t){t.e.fire("fileRemove.filebrowser")}},update:{tooltip:"Update file list",exec(t){t.e.fire("update.filebrowser")}},select:{tooltip:"Select file",icon:"check",isDisabled:t=>!t.state.activeElements.length,exec(t){t.e.fire("select.filebrowser")}},edit:{tooltip:"Edit image",icon:"pencil",isDisabled(t){let e=t.state.activeElements;return 1!==e.length||!e[0].isImage||!(t.dataProvider.canI("ImageCrop")||t.dataProvider.canI("ImageResize"))},exec(t){t.e.fire("edit.filebrowser")}},tiles:{tooltip:"Tiles view",icon:"th",isActive:t=>"tiles"===t.state.view,exec(t){t.e.fire("view.filebrowser","tiles")}},list:{tooltip:"List view",icon:"th-list",isActive:t=>"list"===t.state.view,exec(t){t.e.fire("view.filebrowser","list")}},filter:{isInput:!0,getContent(t,e){let i=o.Dom.first(e.container,t=>o.Dom.isHTMLElement(t)&&t.classList.contains("jodit-input"));if(i)return i;let s=t.c.element("input",{class:"jodit-input",placeholder:t.i18n("Filter")});return s.value=t.state.filterWord,t.e.on(s,"keydown mousedown",t.async.debounce(()=>{t.e.fire("filter.filebrowser",s.value)},t.defaultTimeout)),s}},sort:{isInput:!0,getContent(t){let e=t.c.fromHTML(`<select class="jodit-input jodit-select"><option value="changed-asc">${t.i18n("Sort by changed")} (⬆)</option><option value="changed-desc">${t.i18n("Sort by changed")} (⬇)</option><option value="name-asc">${t.i18n("Sort by name")} (⬆)</option><option value="name-desc">${t.i18n("Sort by name")} (⬇)</option><option value="size-asc">${t.i18n("Sort by size")} (⬆)</option><option value="size-desc">${t.i18n("Sort by size")} (⬇)</option></select>`);return e.value=t.state.sortBy,t.e.on("sort.filebrowser",t=>{e.value!==t&&(e.value=t)}).on(e,"change",()=>{t.e.fire("sort.filebrowser",e.value)}),e}}}},17780:function(t,e,i){"use strict";i.d(e,{default:function(){return f}});var o=i(25045),s=i(31635),n=i(81937),r=i(49574),a=i(91565),l=i(96340),c=i(77483),u=i(33201),h=i(52144),d=i(17338),p=i(58664);let m=new Set(["allowFiles","allowFileMove","allowFileUpload","allowFileUploadRemote","allowFileRemove","allowFileRename","allowFolders","allowFolderMove","allowFolderCreate","allowFolderRemove","allowFolderRename","allowImageResize","allowImageCrop"]);class f{get o(){return this.options}get(t){let e=this.__ajaxInstances;if(e.has(t)){let i=e.get(t);i?.abort(),e.delete(t)}let i=(0,c.ConfigProto)(void 0!==this.options[t]?this.options[t]:{},(0,c.ConfigProto)({onProgress:this.progressHandler},this.o.ajax));i.prepareData&&(i.data=i.prepareData.call(this,i.data));let o=new d.Ajax(i);e.set(t,o);let s=o.send();return s.finally(()=>{o.destruct(),e.delete(t),this.progressHandler(100)}).catch(()=>null),s.then(t=>t.json()).then(t=>{if(t&&!this.isSuccess(t))throw Error(this.getMessage(t));return t})}onProgress(t){this.progressHandler=t}async permissions(t,e){return this.o.permissions&&(this.o.permissions.data.path=t,this.o.permissions.data.source=e,this.o.permissions.url)?this.get("permissions").then(t=>{if(this.parent.isInDestruct)throw(0,u.abort)();let e=this.o.permissions.process;if(e||(e=this.o.ajax.process),e){let i=e.call(self,t);i.data.permissions&&(this.parent.events.fire(this,"changePermissions",this.__currentPermissions,i.data.permissions),this.__currentPermissions=i.data.permissions)}return this.__currentPermissions}):null}canI(t){let e="allow"+t;if(!n.IS_PROD&&!m.has(e))throw(0,u.error)("Wrong action "+t);let i=this.o.permissionsPresets[e];return void 0!==i?i:null==this.__currentPermissions||void 0===this.__currentPermissions[e]||this.__currentPermissions[e]}__items(t,e,i,o){let s=this.options;return s.items?(s.items.data.path=t,s.items.data.source=e,s.items.data.mods=i,this.get("items").then(t=>{let e=this.o.items.process;return e||(e=this.o.ajax.process),e&&(t=e.call(self,t)),o(t)})):Promise.reject(Error("Set Items api options"))}items(t,e,i={}){return this.__items(t,e,i,t=>this.__generateItemsList(t.data.sources,i))}itemsEx(t,e,i={}){return this.__items(t,e,i,t=>({items:this.__generateItemsList(t.data.sources,i),loadedTotal:t.data.sources.reduce((t,e)=>t+e.files.length,0)}))}__generateItemsList(t,e={}){let i=[],o=t=>!e.filterWord?.length||void 0===this.o.filter||this.o.filter(t,e.filterWord);return t.forEach(t=>{if(t.files&&t.files.length){let{sort:s}=this.o;(0,a.isFunction)(s)&&e.sortBy&&t.files.sort((t,i)=>s(t,i,e.sortBy)),t.files.forEach(s=>{o(s)&&("folder"===s.type||!e.onlyImages||void 0===s.isImage||s.isImage)&&i.push(p.FileBrowserItem.create({...s,sourceName:t.name,source:t}))})}}),i}async tree(t,e){return(t=(0,l.normalizeRelativePath)(t),this.o.folder)?(await this.permissions(t,e),this.o.folder.data.path=t,this.o.folder.data.source=e,this.get("folder").then(t=>{let e=this.o.folder.process;return e||(e=this.o.ajax.process),e&&(t=e.call(self,t)),t.data.sources})):Promise.reject(Error("Set Folder Api options"))}getPathByUrl(t){return(0,h.set)("options.getLocalFileByUrl.data.url",t,this),this.get("getLocalFileByUrl").then(t=>{if(this.isSuccess(t))return t.data;throw(0,u.error)(this.getMessage(t))})}createFolder(t,e,i){let{create:o}=this.o;if(!o)throw(0,u.error)("Set Create api options");return o.data.source=i,o.data.path=e,o.data.name=t,this.get("create").then(t=>{if(this.isSuccess(t))return!0;throw(0,u.error)(this.getMessage(t))})}move(t,e,i,o){let s=o?"fileMove":"folderMove",n=this.options[s];if(!n)throw(0,u.error)("Set Move api options");return n.data.from=t,n.data.path=e,n.data.source=i,this.get(s).then(t=>{if(this.isSuccess(t))return!0;throw(0,u.error)(this.getMessage(t))})}__remove(t,e,i,o){let s=this.o[t];if(!s)throw(0,u.error)(`Set "${t}" api options`);return s.data.path=e,s.data.name=i,s.data.source=o,this.get(t).then(t=>(s.process&&(t=s.process.call(this,t)),this.getMessage(t)))}fileRemove(t,e,i){return this.__remove("fileRemove",t,e,i)}folderRemove(t,e,i){return this.__remove("folderRemove",t,e,i)}__rename(t,e,i,o,s){let n=this.o[t];if(!n)throw(0,u.error)(`Set "${t}" api options`);return n.data.path=e,n.data.name=i,n.data.newname=o,n.data.source=s,this.get(t).then(t=>(n.process&&(t=n.process.call(self,t)),this.getMessage(t)))}folderRename(t,e,i,o){return this.__rename("folderRename",t,e,i,o)}fileRename(t,e,i,o){return this.__rename("fileRename",t,e,i,o)}__changeImage(t,e,i,o,s,n){this.o[t]||(this.o[t]={data:{}});let r=this.o[t];return void 0===r.data&&(r.data={action:t}),r.data.newname=s||o,n&&(r.data.box=n),r.data.path=e,r.data.name=o,r.data.source=i,this.get(t).then(t=>t.data.newPath||!0)}crop(t,e,i,o,s){return this.__changeImage("crop",t,e,i,o,s)}resize(t,e,i,o,s){return this.__changeImage("resize",t,e,i,o,s)}getMessage(t){return this.options.getMessage(t)}isSuccess(t){return this.options.isSuccess(t)}destruct(){this.__ajaxInstances.forEach(t=>t.destruct()),this.__ajaxInstances.clear()}constructor(t,e){(0,o._)(this,"parent",void 0),(0,o._)(this,"options",void 0),(0,o._)(this,"__currentPermissions",void 0),(0,o._)(this,"__ajaxInstances",void 0),(0,o._)(this,"progressHandler",void 0),this.parent=t,this.options=e,this.__currentPermissions=null,this.__ajaxInstances=new Map,this.progressHandler=t=>{}}}(0,s.__decorate)([r.autobind],f.prototype,"onProgress",null),(0,s.__decorate)([r.autobind],f.prototype,"permissions",null),(0,s.__decorate)([r.autobind],f.prototype,"canI",null),(0,s.__decorate)([r.autobind],f.prototype,"items",null),(0,s.__decorate)([r.autobind],f.prototype,"itemsEx",null),(0,s.__decorate)([r.autobind],f.prototype,"tree",null),(0,s.__decorate)([r.autobind],f.prototype,"getPathByUrl",null),(0,s.__decorate)([r.autobind],f.prototype,"createFolder",null),(0,s.__decorate)([r.autobind],f.prototype,"move",null),(0,s.__decorate)([r.autobind],f.prototype,"fileRemove",null),(0,s.__decorate)([r.autobind],f.prototype,"folderRemove",null),(0,s.__decorate)([r.autobind],f.prototype,"folderRename",null),(0,s.__decorate)([r.autobind],f.prototype,"fileRename",null),(0,s.__decorate)([r.autobind],f.prototype,"crop",null),(0,s.__decorate)([r.autobind],f.prototype,"resize",null),(0,s.__decorate)([r.autobind],f.prototype,"getMessage",null),(0,s.__decorate)([r.autobind],f.prototype,"isSuccess",null),(0,s.__decorate)([r.autobind],f.prototype,"destruct",null),i.d(e,["DEFAULT_SOURCE_NAME",0,"default"])},18272:function(t,e,i){"use strict";i.d(e,{makeContextMenu:function(){return r},makeDataProvider:function(){return n}});var o=i(67399),s=i(17780);function n(t,e){return new s.default(t,e)}function r(t){return new o.ContextMenu(t)}},1305:function(t,e,i){"use strict";function o(t,e,i){return t.dataProvider.fileRemove(t.state.currentPath,e,i).then(i=>{t.status(i||t.i18n('File "%s" was deleted',e),!0)}).catch(t.status)}i.d(e,{deleteFile:function(){return o}})},1488:function(t,e,i){"use strict";function o(t){return t.files.setMod("active",!0),t.files.setMod("loading",!0),t.dataProvider.items(t.state.currentPath,t.state.currentSource,{sortBy:t.state.sortBy,onlyImages:t.state.onlyImages,filterWord:t.state.filterWord}).then(e=>{e&&(t.state.elements=e,t.state.activeElements=[])}).catch(t.status).finally(()=>t.files.setMod("loading",!1))}i.d(e,{loadItems:function(){return o}})},53202:function(t,e,i){"use strict";i.d(e,{loadTree:function(){return n}});var o=i(27795),s=i(1488);async function n(t){t.tree.setMod("active",!0),o.Dom.detach(t.tree.container);let e=(0,s.loadItems)(t);return t.o.showFoldersPanel?(t.tree.setMod("loading",!0),Promise.all([t.dataProvider.tree(t.state.currentPath,t.state.currentSource).then(e=>{t.state.sources=e}).catch(t.status).finally(()=>t.tree.setMod("loading",!1)),e])):(t.tree.setMod("active",!1),e)}},62623:function(t,e,i){"use strict";i.d(e,{FileBrowser:function(){return I}});var o=i(25045),s=i(31635),n=i(16964),r=i(81937),a=i(84839),l=i(68616),c=i(23211),u=i(1496),h=i(65946),d=i(80991),p=i(25222),m=i(80512),f=i(2222),g=i(5266);i(68502);var _=i(1488),v=i(53202),b=i(34269),y=i(36664),w=i(74833),S=i(17780),C=i(18272),E=i(63425);class I extends f.ViewWithToolbar{className(){return"FileBrowser"}get dataProvider(){return(0,C.makeDataProvider)(this,this.options)}onSelect(t){return()=>{if(this.state.activeElements.length){let e=[],i=[];this.state.activeElements.forEach(t=>{let o=t.fileURL;o&&(e.push(o),i.push(t.isImage||!1))}),this.close(),(0,h.isFunction)(t)&&t({baseurl:"",files:e,isImages:i}),this.close()}return!1}}get _dialog(){let t=this.dlg({minWidth:Math.min(700,screen.width),minHeight:300,buttons:this.o.headerButtons??["fullsize","dialog.close"]});return["beforeClose","afterClose","beforeOpen"].forEach(e=>t.events.on(t,e,()=>this.e.fire(e))),t.setSize(this.o.width,this.o.height),t}get storage(){return p.Storage.makeStorage(!!this.o.saveStateInStorage,this.componentName)}get isOpened(){return this._dialog.isOpened&&"none"!==(0,d.cssInline)(this.browser,"display")}status(t,e){!t||(0,h.isAbortError)(t)||((0,h.isString)(t)||(t=t.message),(0,h.isString)(t)&&(0,h.trim)(t).length&&this.message.message(t,e?"success":"error",this.o.howLongShowMsg))}open(t=this.o.defaultCallback,e=!1){return this.state.onlyImages=e,this.async.promise((e,i)=>{if(!this.o.items||!this.o.items.url)throw(0,h.error)("Need set options.filebrowser.ajax.url");let o=0;this.e.off(this.files.container,"dblclick").on(this.files.container,"dblclick",this.onSelect(t)).on(this.files.container,"touchstart",()=>{let e=new Date().getTime();e-o<r.EMULATE_DBLCLICK_TIMEOUT&&this.onSelect(t)(),o=e}).off("select.filebrowser").on("select.filebrowser",this.onSelect(t));let s=this.c.div();this.toolbar?.appendTo(s),this.__updateToolbarButtons(),this._dialog.open(this.browser,s),this.e.fire("sort.filebrowser",this.state.sortBy),(0,v.loadTree)(this).then(e,i).finally(()=>{this.isInDestruct||this?.e?.fire("fileBrowserReady.filebrowser")})}).catch(t=>{if(!(0,h.isAbortError)(t)&&!r.IS_PROD)throw t})}__getButtons(){return(this.o.buttons??[]).filter(t=>{if(!(0,h.isString)(t))return!0;switch(t){case"filebrowser.upload":return this.dataProvider.canI("FileUpload");case"filebrowser.edit":return this.dataProvider.canI("ImageResize")||this.dataProvider.canI("ImageCrop");case"filebrowser.remove":return this.dataProvider.canI("FileRemove")}return!0})}initUploader(t){let e=this,i=t?.options?.uploader,o=(0,h.ConfigProto)(i||{},g.Config.defaultOptions.uploader),s=()=>(0,_.loadItems)(this);e.uploader=e.getInstance("Uploader",o),e.uploader.setPath(e.state.currentPath).setSource(e.state.currentSource).bind(e.browser,s,e.errorHandler),this.state.on(["change.currentPath","change.currentSource"],()=>{this.uploader.setPath(this.state.currentPath).setSource(this.state.currentSource)}),e.e.on("bindUploader.filebrowser",t=>{e.uploader.bind(t,s,e.errorHandler)})}destruct(){!this.isInDestruct&&((0,a.cached)(this,"_dialog")?.destruct(),super.destruct(),this.events&&this.e.off(".filebrowser"),this.uploader&&this.uploader.destruct())}__updateToolbarButtons(){let t=this.__getButtons();!function(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}(this.__prevButtons,t)&&(this.__prevButtons=t,this.toolbar?.build(t))}constructor(t){super(t),(0,o._)(this,"browser",this.c.div(this.componentName)),(0,o._)(this,"status_line",this.c.div(this.getFullElName("status"))),(0,o._)(this,"tree",new E.FileBrowserTree(this)),(0,o._)(this,"files",new E.FileBrowserFiles(this)),(0,o._)(this,"state",(0,u.observable)({currentPath:"",currentSource:S.DEFAULT_SOURCE_NAME,currentBaseUrl:"",activeElements:[],elements:[],sources:[],view:"tiles",sortBy:"changed-desc",filterWord:"",onlyImages:!1})),(0,o._)(this,"errorHandler",t=>{(0,h.isAbortError)(t)||(t instanceof Error?this.status(this.i18n(t.message)):this.status(this.dataProvider.getMessage(t)))}),(0,o._)(this,"uploader",void 0),(0,o._)(this,"close",()=>{this._dialog.close()}),(0,o._)(this,"__prevButtons",[]),this.attachEvents(t),this.options=(0,h.ConfigProto)(t||{},g.Config.defaultOptions.filebrowser),this.browser.component=this,this.container=this.browser,this.o.showFoldersPanel&&c.Dom.append(this.browser,this.tree.container),c.Dom.append(this.browser,this.files.container),c.Dom.append(this.browser,this.status_line),y.selfListeners.call(this),b.nativeListeners.call(this),w.stateListeners.call(this),["getLocalFileByUrl","crop","resize","create","fileMove","folderMove","fileRename","folderRename","fileRemove","folderRemove","folder","items","permissions"].forEach(t=>{null!=this.options[t]&&(this.options[t]=(0,h.ConfigProto)(this.options[t],this.o.ajax))});const{storeView:e,storeSortBy:i,storeLastOpenedFolder:s}=this.o.saveStateInStorage||{storeLastOpenedFolder:!1,storeView:!1,storeSortBy:!1},r=e&&this.storage.get("view");r&&null==this.o.view?this.state.view="list"===r?"list":"tiles":this.state.view="list"===this.o.view?"list":"tiles",this.files.setMod("view",this.state.view);const a=i&&this.storage.get("sortBy");if(a){const t=a.split("-");this.state.sortBy=["changed","name","size"].includes(t[0])?a:"changed-desc"}else this.state.sortBy=this.o.sortBy||"changed-desc";if(s){const t=this.storage.get("currentPath"),e=this.storage.get("currentSource");this.state.currentPath=t??"",this.state.currentSource=e??""}this.initUploader(this),this.setStatus(n.STATUSES.ready)}}(0,s.__decorate)([a.cache],I.prototype,"dataProvider",null),(0,s.__decorate)([a.cache],I.prototype,"_dialog",null),(0,s.__decorate)([a.cache],I.prototype,"storage",null),(0,s.__decorate)([a.autobind],I.prototype,"status",null),(0,s.__decorate)([a.autobind],I.prototype,"open",null),(0,s.__decorate)([(0,l.watch)("dataProvider:changePermissions")],I.prototype,"__updateToolbarButtons",null),I=(0,s.__decorate)([(0,a.derive)(m.Dlgs)],I)},17610:function(t,e,i){"use strict";i.d(e,{FileBrowser:function(){return o.FileBrowser}});var o=i(62623)},34269:function(t,e,i){"use strict";i.d(e,{nativeListeners:function(){return c}});var o=i(7909),s=i(77213),n=i(61334),r=i(31125),a=i(66206),l=i(53202);function c(){let t=!1,e=(0,r.elementsMap)(this),i=this;i.e.on(i.tree.container,"dragstart",e=>{let o=(0,a.getItem)(e.target,i.container);o&&i.o.moveFolder&&(t=o)}).on(i.tree.container,"drop",e=>{if((i.o.moveFile||i.o.moveFolder)&&t){let s=(0,o.attr)(t,"-path")||"";if(!i.o.moveFolder&&t.classList.contains(this.tree.getFullElName("item"))||t.classList.contains(this.files.getFullElName("item"))&&(s+=(0,o.attr)(t,"-name"),!i.o.moveFile))return!1;let n=(0,a.getItem)(e.target,i.container);n&&(i.dataProvider.move(s,(0,o.attr)(n,"-path")||"",(0,o.attr)(n,"-source")||"",t.classList.contains(this.files.getFullElName("item"))).then(()=>(0,l.loadTree)(this)).catch(i.status),t=!1)}}).on(i.files.container,"contextmenu",(0,n.default)(i)).on(i.files.container,"click",t=>{(0,s.ctrlKey)(t)||(this.state.activeElements=[])}).on(i.files.container,"click",t=>{let o=(0,a.getItem)(t.target,i.container);if(!o)return;let n=(0,a.elementToItem)(o,e);if(n)return(0,s.ctrlKey)(t)?i.state.activeElements=[...i.state.activeElements,n]:i.state.activeElements=[n],t.stopPropagation(),!1}).on(i.files.container,"dragstart",e=>{if(i.o.moveFile){let o=(0,a.getItem)(e.target,i.container);o&&(t=o)}}).on(i.container,"drop",t=>t.preventDefault())}},36664:function(t,e,i){"use strict";i.d(e,{selfListeners:function(){return u}});var o=i(65946),s=i(28686),n=i(17780),r=i(1305),a=i(1488),l=i(53202),c=i(43271);function u(){let t=this.state,e=this.dataProvider,i=this;i.e.on("view.filebrowser",e=>{e!==t.view&&(t.view=e)}).on("sort.filebrowser",e=>{e!==t.sortBy&&(t.sortBy=e,(0,a.loadItems)(i))}).on("filter.filebrowser",e=>{e!==t.filterWord&&(t.filterWord=e,(0,a.loadItems)(i))}).on("openFolder.filebrowser",t=>{let e;e=".."===t.name?t.path.split("/").filter(t=>t.length).slice(0,-1).join("/"):(0,o.normalizePath)(t.path,t.name),i.state.currentPath=e,i.state.currentSource="."===t.name?n.DEFAULT_SOURCE_NAME:t.source}).on("removeFolder.filebrowser",t=>{i.confirm("Are you sure?","Delete",o=>{o&&e.folderRemove(t.path,t.name,t.source).then(t=>(i.status(t,!0),(0,l.loadTree)(i))).catch(i.status)})}).on("renameFolder.filebrowser",t=>{i.prompt("Enter new name","Rename",o=>{if(!(0,s.isValidName)(o))return i.status(i.i18n("Enter new name")),!1;e.folderRename(t.path,t.name,o,t.source).then(t=>(i.state.activeElements=[],i.status(t,!0),(0,l.loadTree)(i))).catch(i.status)},"type name",t.name)}).on("addFolder.filebrowser",t=>{i.prompt("Enter Directory name","Create directory",o=>{e.createFolder(o,t.path,t.source).then(()=>(0,l.loadTree)(i)).catch(i.status)},"type dir name")}).on("fileRemove.filebrowser",()=>{i.state.activeElements.length&&i.confirm("Are you sure?","",t=>{if(t){let t=[];i.state.activeElements.forEach(e=>{t.push((0,r.deleteFile)(i,e.file||e.name||"",e.sourceName))}),i.state.activeElements=[],Promise.all(t).then(()=>(0,l.loadTree)(i).catch(i.status),i.status)}})}).on("edit.filebrowser",()=>{if(1===i.state.activeElements.length){let[t]=this.state.activeElements;c.openImageEditor.call(i,t.fileURL,t.file||"",t.path,t.sourceName)}}).on("fileRename.filebrowser",(t,o,n)=>{1===i.state.activeElements.length&&i.prompt("Enter new name","Rename",r=>{if(!(0,s.isValidName)(r))return i.status(i.i18n("Enter new name")),!1;e.fileRename(o,t,r,n).then(t=>{i.state.activeElements=[],i.status(t,!0),(0,a.loadItems)(i)}).catch(i.status)},"type name",t)}).on("update.filebrowser",()=>{(0,l.loadTree)(this).then(this.status,this.status)})}},74833:function(t,e,i){"use strict";i.d(e,{stateListeners:function(){return l}});var o=i(27795),s=i(97022),n=i(53681),r=i(31125),a=i(53202);function l(){let t=(0,r.elementsMap)(this),{state:e,files:i,create:l,options:c}=this,u=e=>{let i=e.uniqueHashKey;if(t[i])return t[i].elm;let o=l.fromHTML(c.getThumbTemplate.call(this,e,e.source,e.sourceName.toString()));return o.dataset.key=i,t[i]={item:e,elm:o},t[i].elm};e.on(["change.currentPath","change.currentSource"],this.async.debounce(()=>{this.o.saveStateInStorage&&this.o.saveStateInStorage.storeLastOpenedFolder&&this.storage.set("currentPath",this.state.currentPath).set("currentSource",this.state.currentSource),(0,a.loadTree)(this).catch(this.status)},this.defaultTimeout)).on("beforeChange.activeElements",()=>{e.activeElements.forEach(e=>{let{elm:o}=t[e.uniqueHashKey];o&&o.classList.remove(i.getFullElName("item","active",!0))})}).on("change.activeElements",()=>{this.e.fire("changeSelection"),e.activeElements.forEach(e=>{let{elm:o}=t[e.uniqueHashKey];o&&o.classList.add(i.getFullElName("item","active",!0))})}).on("change.view",()=>{i.setMod("view",e.view),this.o.saveStateInStorage&&this.o.saveStateInStorage.storeView&&this.storage.set("view",e.view)}).on("change.sortBy",()=>{this.o.saveStateInStorage&&this.o.saveStateInStorage.storeSortBy&&this.storage.set("sortBy",e.sortBy)}).on("change.elements",this.async.debounce(()=>{o.Dom.detach(i.container),e.elements.length?e.elements.forEach(t=>{o.Dom.append(this.files.container,u(t))}):o.Dom.append(i.container,l.div(this.componentName+"_no-files_true",this.i18n("There are no files")))},this.defaultTimeout)).on("change.sources",this.async.debounce(()=>{o.Dom.detach(this.tree.container),e.sources.forEach(t=>{let e=t.name;if(e&&"default"!==e&&o.Dom.append(this.tree.container,l.div(this.tree.getFullElName("source-title"),e)),t.folders.forEach(i=>{let r=l.a(this.tree.getFullElName("item"),{draggable:"draggable",href:"#","data-path":(0,s.normalizePath)(t.path,i+"/"),"data-name":i,"data-source":e,"data-source-path":t.path},l.span(this.tree.getFullElName("item-title"),i)),a=o=>n=>{this.e.fire(`${o}.filebrowser`,{name:i,path:(0,s.normalizePath)(t.path+"/"),source:e}),n.stopPropagation(),n.preventDefault()};if(this.e.on(r,"click",a("openFolder")),o.Dom.append(this.tree.container,r),".."!==i&&"."!==i){if(c.renameFolder&&this.dataProvider.canI("FolderRename")){let t=(0,n.Button)(this,{icon:{name:"pencil"},name:"rename",tooltip:"Rename",size:"tiny"});t.onAction(a("renameFolder")),o.Dom.append(r,t.container)}if(c.deleteFolder&&this.dataProvider.canI("FolderRemove")){let t=(0,n.Button)(this,{icon:{name:"cancel"},name:"remove",tooltip:"Delete",size:"tiny"});t.onAction(a("removeFolder")),o.Dom.append(r,t.container)}}}),c.createNewFolder&&this.dataProvider.canI("FolderCreate")){let i=(0,n.Button)(this,"plus","Add folder","secondary");i.onAction(()=>{this.e.fire("addFolder",{path:(0,s.normalizePath)(t.path+"/"),source:e})}),this.tree.append(i)}})},this.defaultTimeout))}},86122:function(t,e,i){"use strict";i.d(e,{FileBrowserFiles:function(){return s}});var o=i(4099);class s extends o.UIGroup{className(){return"FileBrowserFiles"}}},63425:function(t,e,i){"use strict";i.d(e,{FileBrowserFiles:function(){return o.FileBrowserFiles},FileBrowserTree:function(){return s.FileBrowserTree}});var o=i(86122),s=i(55376)},55376:function(t,e,i){"use strict";i.d(e,{FileBrowserTree:function(){return s}});var o=i(4099);class s extends o.UIGroup{className(){return"FileBrowserTree"}}},8838:function(t,e,i){"use strict";i.d(e,{Command:function(){return s}});var o=i(25045);class s{undo(){this.history.snapshot.restore(this.oldValue)}redo(){this.history.snapshot.restore(this.newValue)}constructor(t,e,i,s){(0,o._)(this,"oldValue",void 0),(0,o._)(this,"newValue",void 0),(0,o._)(this,"history",void 0),(0,o._)(this,"tick",void 0),this.oldValue=t,this.newValue=e,this.history=i,this.tick=s}}},53855:function(t,e,i){"use strict";i.d(e,{History:function(){return h}});var o=i(25045),s=i(31635),n=i(59609),r=i(55184),a=i(5266),l=i(8838),c=i(46363),u=i(33511);a.Config.prototype.history={enable:!0,maxHistoryLength:1/0,timeout:1e3};class h extends n.ViewComponent{className(){return"History"}redo(){this.__stack.redo()&&(this.startValue=this.snapshot.make(),this.fireChangeStack())}canRedo(){return this.__stack.canRedo()}undo(){this.__stack.undo()&&(this.startValue=this.snapshot.make(),this.fireChangeStack())}canUndo(){return this.__stack.canUndo()}clear(){this.startValue=this.snapshot.make(),this.__stack.clear(),this.fireChangeStack()}get length(){return this.__stack.length}get startValue(){return this.__startValue}set startValue(t){this.__startValue=t}__upTick(){this.updateTick+=1}onChange(){this.__processChanges()}__processChanges(){!this.snapshot.isBlocked&&this.j.o.history.enable&&this.updateStack()}updateStack(t=!1){let e=this.snapshot.make();if(!c.Snapshot.equal(e,this.startValue)){let i=new l.Command(this.startValue,e,this,this.updateTick);if(t){let t=this.__stack.current();t&&this.updateTick===t.tick&&this.__stack.replace(i)}else this.__stack.push(i);this.startValue=e,this.fireChangeStack()}}fireChangeStack(){this.j&&!this.j.isInDestruct&&this.j.events?.fire("changeStack")}destruct(){this.isInDestruct||(this.j.events&&this.j.e.off(".history"),this.snapshot.destruct(),super.destruct())}constructor(t,e=new u.Stack(t.o.history.maxHistoryLength),i=new c.Snapshot(t)){super(t),(0,o._)(this,"__startValue",void 0),(0,o._)(this,"__stack",void 0),(0,o._)(this,"snapshot",void 0),(0,o._)(this,"updateTick",0),this.__stack=e,this.snapshot=i,t.o.history.enable&&t.e.on("afterAddPlace.history",()=>{this.isInDestruct||(this.startValue=this.snapshot.make(),t.events.on("internalChange internalUpdate",()=>{this.startValue=this.snapshot.make()}).on(t.editor,["changeSelection","selectionstart","selectionchange","mousedown","mouseup","keydown","keyup"].map(t=>t+".history").join(" "),()=>{this.startValue.html===this.j.getNativeEditorValue()&&(this.startValue=this.snapshot.make())}).on(this,"change.history",this.onChange))})}}(0,s.__decorate)([(0,r.debounce)()],h.prototype,"onChange",null)},46363:function(t,e,i){"use strict";i.d(e,{Snapshot:function(){return a}});var o=i(25045),s=i(16964),n=i(81937),r=i(23211);class a extends s.ViewComponent{className(){return"Snapshot"}static equal(t,e){return t.html===e.html&&JSON.stringify(t.range)===JSON.stringify(e.range)&&JSON.stringify(t.ranges)===JSON.stringify(e.ranges)&&!!t.backward==!!e.backward}static countNodesBeforeInParent(t){if(!t.parentNode)return 0;let e=t.parentNode.childNodes,i=0,o=null;for(let s=0;s<e.length;s+=1){if(!o||this.isIgnoredNode(e[s])||r.Dom.isText(o)&&r.Dom.isText(e[s])||(i+=1),e[s]===t)return i;o=e[s]}return 0}static strokeOffset(t,e){for(;r.Dom.isText(t);)t=t.previousSibling,r.Dom.isText(t)&&t.nodeValue&&(e+=t.nodeValue.length);return e}calcHierarchyLadder(t){let e=[];if(!t||!t.parentNode||!r.Dom.isOrContains(this.j.editor,t))return[];for(;t&&t!==this.j.editor;)t&&!a.isIgnoredNode(t)&&e.push(a.countNodesBeforeInParent(t)),t=t.parentNode;return e.reverse()}getElementByLadder(t){let e=this.j.editor,i;for(i=0;e&&i<t.length;i+=1)e=e.childNodes[t[i]];return e}get isBlocked(){return this.__isBlocked}__block(t){this.__isBlocked=t}transaction(t){this.__block(!0),this.__levelOfTransaction+=1;try{t()}catch(t){if(!n.IS_PROD)throw t}finally{this.__levelOfTransaction-=1,0===this.__levelOfTransaction&&this.__block(!1)}}make(){let t={html:"",range:{startContainer:[],startOffset:0,endContainer:[],endOffset:0}};t.html=this.__getCleanedEditorValue(this.j.editor);let e=this.j.s.sel;if(e&&e.rangeCount){let i=[];for(let t=0;t<e.rangeCount;t+=1){let o=e.getRangeAt(t),s=this.calcHierarchyLadder(o.startContainer),n=this.calcHierarchyLadder(o.endContainer),r=a.strokeOffset(o.startContainer,o.startOffset),l=a.strokeOffset(o.endContainer,o.endOffset);s.length||o.startContainer===this.j.editor||(r=0),n.length||o.endContainer===this.j.editor||(l=0),i.push({startContainer:s,startOffset:r,endContainer:n,endOffset:l})}t.range=i[0],i.length>1?t.ranges=i:e.isCollapsed||e.anchorNode!==e.getRangeAt(0).endContainer||e.anchorOffset!==e.getRangeAt(0).endOffset||(t.backward=!0)}return t}restore(t){this.transaction(()=>{let e=this.storeScrollState();this.__getCleanedEditorValue(this.j.editor)!==t.html&&(this.j.value=t.html),this.restoreOnlySelection(t),this.restoreScrollState(e)})}storeScrollState(){return[this.j.ow.scrollY,this.j.editor.scrollTop]}restoreScrollState(t){let{j:e}=this,{ow:i}=e;i.scrollTo(i.scrollX,t[0]),e.editor.scrollTop=t[1]}restoreOnlySelection(t){try{if(t.range){let e=(t.ranges??[t.range]).map(t=>{let e=this.j.ed.createRange();return e.setStart(this.getElementByLadder(t.startContainer),t.startOffset),e.setEnd(this.getElementByLadder(t.endContainer),t.endOffset),e});this.j.s.selectRange(e[0]);let i=this.j.s.sel;if(e.slice(1).forEach(t=>i?.addRange(t)),t.backward&&1===e.length){let t=e[0];i?.setBaseAndExtent(t.endContainer,t.endOffset,t.startContainer,t.startOffset)}}}catch(t){this.j.editor.lastChild&&this.j.s.setCursorAfter(this.j.editor.lastChild),n.IS_PROD}}destruct(){this.__block(!1),super.destruct()}static isIgnoredNode(t){return r.Dom.isText(t)&&!t.nodeValue||r.Dom.isTemporary(t)}__getCleanedEditorValue(t){let e=t.cloneNode(!0);return r.Dom.temporaryList(e).forEach(r.Dom.unwrap),e.innerHTML}constructor(...t){super(...t),(0,o._)(this,"__isBlocked",!1),(0,o._)(this,"__levelOfTransaction",0)}}},33511:function(t,e,i){"use strict";i.d(e,{Stack:function(){return s}});var o=i(25045);class s{get length(){return this.commands.length}clearRedo(){this.commands.length=this.stackPosition+1}clear(){this.commands.length=0,this.stackPosition=-1}push(t){this.clearRedo(),this.commands.push(t),this.stackPosition+=1,this.commands.length>this.size&&(this.commands.shift(),this.stackPosition-=1)}replace(t){this.commands[this.stackPosition]=t}current(){return this.commands[this.stackPosition]}undo(){return!!this.canUndo()&&(this.commands[this.stackPosition]&&this.commands[this.stackPosition].undo(),this.stackPosition-=1,!0)}redo(){return!!this.canRedo()&&(this.stackPosition+=1,this.commands[this.stackPosition]&&this.commands[this.stackPosition].redo(),!0)}canUndo(){return this.stackPosition>=0}canRedo(){return this.stackPosition<this.commands.length-1}constructor(t){(0,o._)(this,"size",void 0),(0,o._)(this,"commands",void 0),(0,o._)(this,"stackPosition",void 0),this.size=t,this.commands=[],this.stackPosition=-1}}},54500:function(t,e,i){"use strict";var o=i(29434),s=i(5266),n=i(928),r=i.n(n),a=i(31230),l=i.n(a);s.Config.prototype.imageeditor={min_width:20,min_height:20,closeAfterSave:!1,width:"85%",height:"85%",crop:!0,resize:!0,resizeUseRatio:!0,resizeMinWidth:20,resizeMinHeight:20,cropUseRatio:!0,cropDefaultWidth:"70%",cropDefaultHeight:"70%"},o.Icon.set("crop",r()).set("resize",l())},43271:function(t,e,i){"use strict";i.d(e,{ImageEditor:function(){return S},openImageEditor:function(){return C}});var o=i(25045),s=i(31635),n=i(16964),r=i(84839),a=i(27795),l=i(4040),c=i(7909),u=i(80991),h=i(28723),d=i(71125),p=i(59400),m=i(5266);i(54500);var f=i(8908);let g="jodit-image-editor",_=t=>e=>e.classList.contains(t);function v(t,e){return a.Dom.first(t,t=>a.Dom.isHTMLElement(t)&&e(t))}function b(t,e){let i=[];return a.Dom.each(t,t=>{a.Dom.isHTMLElement(t)&&e(t)&&i.push(t)}),i}let y="resize",w="crop";class S extends n.ViewComponent{className(){return"ImageEditor"}get o(){return this.options}hide(){this._dialog.close()}open(t,e){return this.j.async.promise(i=>{let o=new Date().getTime();this.image=this.j.c.element("img");let s=t=>a.Dom.isTag(t,"img")||_("jodit-icon_loader")(t);b(this.resize_box,s).forEach(a.Dom.safeRemove),b(this.crop_box,s).forEach(a.Dom.safeRemove),(0,u.css)(this.cropHandler,"background","transparent"),this.onSave=e,a.Dom.append(this.resize_box,this.j.c.element("i",{class:"jodit-icon_loader"})),a.Dom.append(this.crop_box,this.j.c.element("i",{class:"jodit-icon_loader"})),/\?/.test(t)?t+="&_tst="+o:t+="?_tst="+o,(0,c.attr)(this.image,"src",t),this._dialog.open();let{widthInput:n,heightInput:r}=(0,h.refs)(this.editor),l=()=>{this.isDestructed||(this.image.removeEventListener("load",l),this.naturalWidth=this.image.naturalWidth,this.naturalHeight=this.image.naturalHeight,n.value=this.naturalWidth.toString(),r.value=this.naturalHeight.toString(),this.ratio=this.naturalWidth/this.naturalHeight,a.Dom.append(this.resize_box,this.image),this.cropImage=this.image.cloneNode(!0),a.Dom.append(this.crop_box,this.cropImage),a.Dom.safeRemove.apply(null,b(this.editor,_("jodit-icon_loader"))),this.activeTab===w&&this.showCrop(),this.j.e.fire(this.resizeHandler,"updatesize"),this.j.e.fire(this.cropHandler,"updatesize"),this._dialog.setPosition(),this.j.e.fire("afterImageEditor"),i(this._dialog))};this.image.addEventListener("load",l),this.image.complete&&l()})}onTitleModeClick(t){let e=this,i=t.target,o=i?.parentElement;if(!o)return;b(e.editor,t=>_(`${g}__slider`)(t)||_(`${g}__area`)(t)).forEach(t=>t.classList.remove(`${g}_active`)),o.classList.add(`${g}_active`),this.activeTab=(0,c.attr)(o,"-area")||y;let s=v(e.editor,t=>_(`${g}__area`)(t)&&_(`${g}__area_`+e.activeTab)(t));s&&s.classList.add(`${g}_active`),e.activeTab===w&&e.showCrop()}onChangeSizeInput(t){let e,i=t.target,{widthInput:o,heightInput:s}=(0,h.refs)(this.editor),n="widthInput"===(0,c.attr)(i,"data-ref"),r=parseInt(i.value,10),a=n?this.o.min_width:this.o.min_height,l=n?this.o.min_height:this.o.min_width;r>a&&((0,u.css)(this.image,n?"width":"height",r),this.resizeUseRatio&&(e=n?Math.round(r/this.ratio):Math.round(r*this.ratio))>l&&((0,u.css)(this.image,n?"height":"width",e),n?s.value=e.toString():o.value=e.toString())),this.j.e.fire(this.resizeHandler,"updatesize")}onResizeHandleMouseDown(t){this.target=t.target,t.preventDefault(),t.stopImmediatePropagation(),this.clicked=!0,this.start_x=t.clientX,this.start_y=t.clientY,this.activeTab===w?(this.top_x=(0,u.css)(this.cropHandler,"left"),this.top_y=(0,u.css)(this.cropHandler,"top"),this.width=this.cropHandler.offsetWidth,this.height=this.cropHandler.offsetHeight):(this.width=this.image.offsetWidth,this.height=this.image.offsetHeight),this.j.e.on(this.j.ow,"mousemove",this.onGlobalMouseMove).one(this.j.ow,"mouseup",this.onGlobalMouseUp)}onGlobalMouseUp(t){this.clicked&&(this.clicked=!1,t.stopImmediatePropagation(),this.j.e.off(this.j.ow,"mousemove",this.onGlobalMouseMove))}onGlobalMouseMove(t){if(!this.clicked)return;let{widthInput:e,heightInput:i}=(0,h.refs)(this.editor);this.diff_x=t.clientX-this.start_x,this.diff_y=t.clientY-this.start_y,this.activeTab===y&&this.resizeUseRatio||this.activeTab===w&&this.cropUseRatio?this.diff_x?(this.new_w=this.width+this.diff_x,this.new_h=Math.round(this.new_w/this.ratio)):(this.new_h=this.height+this.diff_y,this.new_w=Math.round(this.new_h*this.ratio)):(this.new_w=this.width+this.diff_x,this.new_h=this.height+this.diff_y),this.activeTab===y?(this.new_w>this.o.resizeMinWidth&&((0,u.css)(this.image,"width",this.new_w+"px"),e.value=this.new_w.toString()),this.new_h>this.o.resizeMinHeight&&((0,u.css)(this.image,"height",this.new_h+"px"),i.value=this.new_h.toString()),this.j.e.fire(this.resizeHandler,"updatesize")):(this.target!==this.cropHandler?(this.top_x+this.new_w>this.cropImage.offsetWidth&&(this.new_w=this.cropImage.offsetWidth-this.top_x),this.top_y+this.new_h>this.cropImage.offsetHeight&&(this.new_h=this.cropImage.offsetHeight-this.top_y),(0,u.css)(this.cropHandler,{width:this.new_w,height:this.new_h})):(this.top_x+this.diff_x+this.cropHandler.offsetWidth>this.cropImage.offsetWidth&&(this.diff_x=this.cropImage.offsetWidth-this.top_x-this.cropHandler.offsetWidth),(0,u.css)(this.cropHandler,"left",this.top_x+this.diff_x),this.top_y+this.diff_y+this.cropHandler.offsetHeight>this.cropImage.offsetHeight&&(this.diff_y=this.cropImage.offsetHeight-this.top_y-this.cropHandler.offsetHeight),(0,u.css)(this.cropHandler,"top",this.top_y+this.diff_y)),this.j.e.fire(this.cropHandler,"updatesize"))}destruct(){this.isDestructed||(this._dialog&&!this._dialog.isInDestruct&&this._dialog.destruct(),a.Dom.safeRemove(this.editor),this.j.e&&this.j.e.off(this.j.ow,"mousemove",this.onGlobalMouseMove).off(this.j.ow,"mouseup",this.onGlobalMouseUp).off(this.ow,"."+g).off("."+g),super.destruct())}constructor(t){super(t),(0,o._)(this,"options",void 0),(0,o._)(this,"onSave",void 0),(0,o._)(this,"resizeUseRatio",!0),(0,o._)(this,"cropUseRatio",!0),(0,o._)(this,"_dialog",void 0),(0,o._)(this,"image",void 0),(0,o._)(this,"cropImage",void 0),(0,o._)(this,"clicked",!1),(0,o._)(this,"target",void 0),(0,o._)(this,"start_x",0),(0,o._)(this,"start_y",0),(0,o._)(this,"top_x",0),(0,o._)(this,"top_y",0),(0,o._)(this,"width",0),(0,o._)(this,"height",0),(0,o._)(this,"activeTab",y),(0,o._)(this,"naturalWidth",0),(0,o._)(this,"naturalHeight",0),(0,o._)(this,"ratio",0),(0,o._)(this,"new_h",0),(0,o._)(this,"new_w",0),(0,o._)(this,"diff_x",0),(0,o._)(this,"diff_y",0),(0,o._)(this,"buttons",void 0),(0,o._)(this,"editor",void 0),(0,o._)(this,"resize_box",void 0),(0,o._)(this,"crop_box",void 0),(0,o._)(this,"sizes",void 0),(0,o._)(this,"resizeHandler",void 0),(0,o._)(this,"cropHandler",void 0),(0,o._)(this,"cropBox",{x:0,y:0,w:0,h:0}),(0,o._)(this,"resizeBox",{w:0,h:0}),(0,o._)(this,"calcCropBox",()=>{let t=this.crop_box.parentNode,e=.8*t.offsetWidth,i=.8*t.offsetHeight,o=e,s=i,{naturalWidth:n,naturalHeight:r}=this;e>n&&i>r?(o=n,s=r):this.ratio>e/i?(o=e,s=e/n*r):(o=i/r*n,s=i),(0,u.css)(this.crop_box,{width:o,height:s})}),(0,o._)(this,"showCrop",()=>{if(!this.cropImage)return;this.calcCropBox();let t=this.cropImage.offsetWidth||this.image.offsetWidth||this.image.naturalWidth;this.new_w=S.calcValueByPercent(t,this.o.cropDefaultWidth);let e=this.cropImage.offsetHeight||this.image.offsetHeight||this.image.naturalHeight;this.cropUseRatio?this.new_h=this.new_w/this.ratio:this.new_h=S.calcValueByPercent(e,this.o.cropDefaultHeight),(0,u.css)(this.cropHandler,{backgroundImage:"url("+(0,c.attr)(this.cropImage,"src")+")",width:this.new_w,height:this.new_h,left:t/2-this.new_w/2,top:e/2-this.new_h/2}),this.j.e.fire(this.cropHandler,"updatesize")}),(0,o._)(this,"updateCropBox",()=>{if(!this.cropImage)return;let t=this.cropImage.offsetWidth/this.naturalWidth,e=this.cropImage.offsetHeight/this.naturalHeight;this.cropBox.x=(0,u.css)(this.cropHandler,"left")/t,this.cropBox.y=(0,u.css)(this.cropHandler,"top")/e,this.cropBox.w=this.cropHandler.offsetWidth/t,this.cropBox.h=this.cropHandler.offsetHeight/e,this.sizes.textContent=this.cropBox.w.toFixed(0)+"x"+this.cropBox.h.toFixed(0)}),(0,o._)(this,"updateResizeBox",()=>{this.resizeBox.w=this.image.offsetWidth||this.naturalWidth,this.resizeBox.h=this.image.offsetHeight||this.naturalHeight}),(0,o._)(this,"setHandlers",()=>{let t=this,{widthInput:e,heightInput:i}=(0,h.refs)(this.editor);t.j.e.on([v(t.editor,_("jodit_bottomright")),t.cropHandler],"mousedown."+g,this.onResizeHandleMouseDown).on(this.j.ow,"resize."+g,()=>{this.j.e.fire(t.resizeHandler,"updatesize"),t.showCrop(),this.j.e.fire(t.cropHandler,"updatesize")}),t.j.e.on(b(this.editor,_(`${g}__slider-title`)),"click",this.onTitleModeClick).on([e,i],"input",this.onChangeSizeInput);let{keepAspectRatioResize:o,keepAspectRatioCrop:s}=(0,h.refs)(this.editor);o&&o.addEventListener("change",()=>{this.resizeUseRatio=o.checked}),s&&s.addEventListener("change",()=>{this.cropUseRatio=s.checked}),t.j.e.on(t.resizeHandler,"updatesize",()=>{(0,u.css)(t.resizeHandler,{top:0,left:0,width:t.image.offsetWidth||t.naturalWidth,height:t.image.offsetHeight||t.naturalHeight}),this.updateResizeBox()}).on(t.cropHandler,"updatesize",()=>{if(!t.cropImage)return;let e=(0,u.css)(t.cropHandler,"left"),i=(0,u.css)(t.cropHandler,"top"),o=t.cropHandler.offsetWidth,s=t.cropHandler.offsetHeight;e<0&&(e=0),i<0&&(i=0),e+o>t.cropImage.offsetWidth&&(o=t.cropImage.offsetWidth-e,t.cropUseRatio&&(s=o/t.ratio)),i+s>t.cropImage.offsetHeight&&(s=t.cropImage.offsetHeight-i,t.cropUseRatio&&(o=s*t.ratio)),(0,u.css)(t.cropHandler,{width:o,height:s,left:e,top:i,backgroundPosition:-e-1+"px "+(-i-1)+"px",backgroundSize:t.cropImage.offsetWidth+"px "+t.cropImage.offsetHeight+"px"}),t.updateCropBox()}),Object.values(t.buttons).forEach(o=>{o.onAction(()=>{let s={action:t.activeTab,box:t.activeTab===y?t.resizeBox:t.cropBox};switch(o){case t.buttons.saveas:t.j.prompt("Enter new name","Save in new file",e=>{if(!(0,l.trim)(e))return t.j.alert("The name should not be empty"),!1;t.j.e.fire("afterImageEditorSave",s,e),t.onSave(e,s,t.hide,e=>{t.j.alert(e.message)})});break;case t.buttons.save:t.j.e.fire("afterImageEditorSave",s),t.onSave(void 0,s,t.hide,e=>{t.j.alert(e.message)});break;case t.buttons.reset:t.activeTab===y?((0,u.css)(t.image,{width:null,height:null}),e.value=t.naturalWidth.toString(),i.value=t.naturalHeight.toString(),t.j.e.fire(t.resizeHandler,"updatesize")):t.showCrop()}})})}),this.options=t&&t.o&&t.o.imageeditor?t.o.imageeditor:m.Config.defaultOptions.imageeditor;const e=this.options;this.resizeUseRatio=e.resizeUseRatio,this.cropUseRatio=e.cropUseRatio,this.buttons={reset:(0,p.Button)(this.j,"update","Reset"),save:(0,p.Button)(this.j,"save","Save"),saveas:(0,p.Button)(this.j,{icon:{name:"save"},name:"save-as",text:"Save as ..."})},this.activeTab=e.resize?y:w,this.editor=(0,f.form)(this.j,this.options);const{resizeBox:i,cropBox:s}=(0,h.refs)(this.editor);this.resize_box=i,this.crop_box=s,this.sizes=v(this.editor,t=>_(`${g}__sizes`)(t)&&!!a.Dom.closest(t,t=>a.Dom.isHTMLElement(t)&&_(`${g}__area_crop`)(t),this.editor)),this.resizeHandler=v(this.editor,_(`${g}__resizer`)),this.cropHandler=v(this.editor,_(`${g}__croper`)),this._dialog=this.j.dlg({buttons:["fullsize","dialog.close"]}),this._dialog.setContent(this.editor),this._dialog.setSize(this.o.width,this.o.height),this._dialog.setHeader([this.buttons.reset,this.buttons.save,this.buttons.saveas]),this.setHandlers()}}function C(t,e,i,o,s,n){return this.getInstance("ImageEditor",this.o).open(t,(t,r,a,l)=>{if("saved"===r.action){a(),s&&s(r.newPath);return}(0,d.call)("resize"===r.action?this.dataProvider.resize:this.dataProvider.crop,i,o,e,t,r.box).then(t=>{t&&(a(),s&&s("string"==typeof t?t:void 0))}).catch(t=>{l(t),n&&n(t)})})}(0,o._)(S,"calcValueByPercent",(t,e)=>{let i,o=e.toString(),s=parseFloat(t.toString());return(i=/^[-+]?[0-9]+(px)?$/.exec(o))?parseInt(o,10):(i=/^([-+]?[0-9.]+)%$/.exec(o))?Math.round(s*(parseFloat(i[1])/100)):s||0}),(0,s.__decorate)([r.autobind],S.prototype,"hide",null),(0,s.__decorate)([r.autobind],S.prototype,"open",null),(0,s.__decorate)([r.autobind],S.prototype,"onTitleModeClick",null),(0,s.__decorate)([(0,r.debounce)(),r.autobind],S.prototype,"onChangeSizeInput",null),(0,s.__decorate)([r.autobind],S.prototype,"onResizeHandleMouseDown",null),(0,s.__decorate)([r.autobind],S.prototype,"onGlobalMouseUp",null),(0,s.__decorate)([(0,r.throttle)(10)],S.prototype,"onGlobalMouseMove",null),S=(0,s.__decorate)([r.component],S)},8908:function(t,e,i){"use strict";var o=i(4099);let s="jodit-image-editor",n=o.Icon.get.bind(o.Icon),r=(t,e="jodti-image-editor_active")=>t?e:"";i.d(e,["form",0,(t,e)=>{let i=t.i18n.bind(t),o=(t,e,o=!0)=>`<div class="jodit-form__group">
|
|
57
57
|
<label class="jodit-switcher-wrapper">
|
|
58
58
|
<span class='jodit-switcher'>
|
|
59
59
|
<input ${r(o,"checked")} data-ref="${e}" type="checkbox"/>
|