jodit-pro
Version:
PRO Version of Jodit Editor
53 lines • 53.3 kB
JavaScript
/*!
* jodit-pro - PRO Version of Jodit Editor
* Author: Chupurnov Valerii <chupurnov@gmail.com>
* Version: v4.9.27
* Url: https://xdsoft.net/jodit/pro/
* License(s): SEE LICENSE IN LICENSE.md
*/
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var s=t();for(var i in s)("object"==typeof exports?exports:e)[i]=s[i]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[916],{4278:function(e,t,s){"use strict";s.d(t,{UIBrowserPanel:function(){return p}});var i=s(82749),o=s(31635),r=s(65478),n=s(21537),a=s(67510),h=s(8358),l=s(60062),c=s(70950),d=s(59198),u=s(17234),m=s(43778);class p extends a.UIGroup{className(){return"UIBrowserPanel"}get countInRow(){if("list"===this.state.view||!this.items.elements.length)return 1;let{container:e}=this.items.elements[0],t=(0,n.css)(e,"marginLeft");return Math.floor(this.items.container.offsetWidth/(e.offsetWidth+((0,n.isNumber)(t)?t:0)))}get countInColumn(){if(!this.items.elements.length)return 1;let{container:e}=this.items.elements[0],t=(0,n.css)(e,"marginTop");return Math.floor(this.items.container.offsetHeight/(e.offsetHeight+((0,n.isNumber)(t)?t:0)))}render(){return`<div>
<div class='&__content'></div>
<div class='&__footer'></div>
</div>`}onChangeTheme(){this.setMod("theme",this.stateManager.state.theme)}onChangeElements(){this.items.build(this.stateManager.state.elements)}onChangeActiveElements(){this.state.activeElements.length||(this.state.info="",this.state.metaInfo=null),this.items.elements.forEach(e=>{e.setMod("active",!!this.stateManager.isActive(e.item))}),this.j.e.fire("changeSelection")}onChangeFavorites(){this.items.elements.forEach(e=>{e.setMod("favorite",!!this.stateManager.isFavorite(e.item))})}onChangeSources(){this.sources.build(this.stateManager.state.tree)}onChangeLastSelectedIndex(){let e=this.items.elements[this.stateManager.state.lastSelectedIndex]?.container;e&&((0,n.scrollIntoViewIfNeeded)(e,this.items.container,this.j.od),e.focus())}onChangeInfo(){this.statusbar.value(this.state.info,"center")}onChangePathOrSource(){this.statusbar.value(this.state.currentPath?`${this.state.currentPath} (${this.state.currentSource})`:this.i18n("Home"),"left")}onChangeShowSettings(){this.settings.setMod("hidden",!this.stateManager.state.showSettings)}onChangeShowPreview(){this.preview.setMod("hidden",!this.stateManager.state.showPreview)}onChangeShowSideBar(){this.sidebar.setMod("hidden",!this.stateManager.state.showSideBar)}onChangeView(){this.items.setMod("view",this.stateManager.state.view)}onChangeTileSize(){this.items.setMod("size",this.stateManager.state.tileSize)}onChangeShowFavorites(){this.sidebar.setMod("show-favorites",this.stateManager.state.showFavorites),this.items.setMod("show-favorites",this.stateManager.state.showFavorites)}onItemDblClick(){return this.j.e.fire("select.filebrowser"),!1}onItemClick(e,t){this.stateManager.addActive(e,t)}onTogglePreview(){return this.state.showPreview=!this.state.showPreview,!1}onToggleFavoriteItem(e){this.stateManager.toggleFavorite(e)}onFolderClick(e){this.stateManager.state.currentSource=e.sourceName,this.stateManager.state.currentPath=e.path||"/",this.j.e.fire("afterOpenFolder.filebrowser")}constructor(e,t){super(e),(0,i._)(this,"stateManager",void 0),(0,i._)(this,"syncMod",void 0),(0,i._)(this,"state",void 0),(0,i._)(this,"sources",void 0),(0,i._)(this,"sidebar",void 0),(0,i._)(this,"preview",void 0),(0,i._)(this,"statusbar",void 0),(0,i._)(this,"items",void 0),(0,i._)(this,"settings",void 0),this.stateManager=t,this.syncMod=!0,this.sources=new d.UIBrowserSources(this.j),this.sidebar=new c.UISidebar(this.jodit,[this.sources],this.stateManager.state),this.preview=new h.UIPreview(this.jodit,this.stateManager.state),this.statusbar=new u.UIBrowserStatusBar(this.j),this.items=new m.UIVirtualScroll(this.j,this.stateManager),this.settings=new l.UIBrowserSettings(this.jodit,this.stateManager.state),this.state=t.state,this.append(this.sidebar,"content"),this.append(this.items,"content"),this.append(this.settings,"content"),this.append(this.preview,"content"),this.append(this.statusbar,"footer"),this.onChangeElements(),this.onChangeSources(),this.onChangeView(),this.onChangeTileSize(),this.onChangeShowFavorites(),this.onChangeActiveElements(),this.onChangeFavorites(),this.onChangeShowSideBar(),this.onChangeShowSettings(),this.onChangeShowPreview(),this.onChangeTheme()}}(0,o.__decorate)([(0,r.watch)("state.theme")],p.prototype,"onChangeTheme",null),(0,o.__decorate)([(0,r.watch)("state.elements")],p.prototype,"onChangeElements",null),(0,o.__decorate)([(0,r.watch)("state.activeElements")],p.prototype,"onChangeActiveElements",null),(0,o.__decorate)([(0,r.watch)(["state.favorites","state.elements"])],p.prototype,"onChangeFavorites",null),(0,o.__decorate)([(0,r.watch)("state.sources")],p.prototype,"onChangeSources",null),(0,o.__decorate)([(0,r.watch)("state.lastSelectedIndex")],p.prototype,"onChangeLastSelectedIndex",null),(0,o.__decorate)([(0,r.watch)("state.info")],p.prototype,"onChangeInfo",null),(0,o.__decorate)([(0,r.watch)(["state.currentPath","state.currentSource"])],p.prototype,"onChangePathOrSource",null),(0,o.__decorate)([(0,r.watch)("state.showSettings")],p.prototype,"onChangeShowSettings",null),(0,o.__decorate)([(0,r.watch)("state.showPreview")],p.prototype,"onChangeShowPreview",null),(0,o.__decorate)([(0,r.watch)("state.showSideBar")],p.prototype,"onChangeShowSideBar",null),(0,o.__decorate)([(0,r.watch)("state.view")],p.prototype,"onChangeView",null),(0,o.__decorate)([(0,r.watch)("state.tileSize")],p.prototype,"onChangeTileSize",null),(0,o.__decorate)([(0,r.watch)("state.showFavorites")],p.prototype,"onChangeShowFavorites",null),(0,o.__decorate)([(0,r.watch)(":dblclickItem.filebrowser")],p.prototype,"onItemDblClick",null),(0,o.__decorate)([(0,r.watch)(":clickItem.filebrowser")],p.prototype,"onItemClick",null),(0,o.__decorate)([(0,r.watch)(":togglePreview.filebrowser")],p.prototype,"onTogglePreview",null),(0,o.__decorate)([(0,r.watch)(":toggleFavoriteItem")],p.prototype,"onToggleFavoriteItem",null),(0,o.__decorate)([(0,r.watch)(":openFolder")],p.prototype,"onFolderClick",null),p=(0,o.__decorate)([r.component],p)},5422:function(e,t,s){"use strict";s.d(t,{FileBrowserPro:function(){return P}});var i=s(82749),o=s(31635);s(34042);var r=s(8087),n=s(77841),a=s(17578),h=s(97770),l=s(42663),c=s(55535),d=s(18250),u=s(69277),m=s(4278),p=s(95002),f=s(6441),v=s(82758),g=s(65478),w=s(21537),_=s(70231),y=s(41409),I=s(638),C=s(63399),b=s(50050),S=s(2692),x=s(21246);class P extends I.Dialog{className(){return"FileBrowserPro"}lock(e="any"){return this.container.classList.add("jodit_disabled"),super.lock(e)}unlock(){return this.container.classList.remove("jodit_disabled"),super.unlock()}status(e,t=!(e instanceof Error)){(0,w.isAbortError)(e)||(v.IS_PROD||(0,w.isString)(e),this.message.message((0,w.isString)(e)?e:e.message,t?"success":"error",this.options.howLongShowMsg))}get progressbar(){return new p.UIProgress(this,this.stateManager.state)}addDisclaimer(e){this.dialog.appendChild(e)}async open(e=this.o.defaultCallback,t){return this.state.onlyImages=!!t,this.prepareOpening(e),super.open(this.panel.container),this.e.fire("update.filebrowser")}onResizeWindow(){(0,w.css)(this.dialog,{maxWidth:screen.width,minHeight:Math.min(this.options.height,screen.height),minWidth:Math.min(this.options.width,screen.width)})}onChangePath(){let{currentPath:e,currentSource:t}=this.state;this.uploader.setPath(e),this.uploader.setSource(t)}onChangeTheme(){this.setMod("theme",this.state.theme),this.header.setMod("theme",this.state.theme),this.panel.setMod("theme",this.state.theme),this.options.theme=this.state.theme}onToggleSettings(){this.state.showSettings=!this.state.showSettings}prepareOpening(e){this.registerGlobalListeners(),e&&(this.state.onSelectCallBack=t=>{this.close(),e(t)}),this.persistent.syncWithState()}registerGlobalListeners(){this.e.on(this.ow,"keydown",this.onKeyPress)}onKeyPress(e){let{activeElement:t}=this.od;if(!this.state.activeElements.length||!t||!y.Dom.isOrContains(this.panel.items.container,t))return;let s=this.state.elements;switch(e.key){case v.KEY_ENTER:return this.onChooseItems();case v.KEY_DELETE:return this.onFileRemove();case v.KEY_RIGHT:case v.KEY_LEFT:case v.KEY_DOWN:case v.KEY_UP:{let t,i=e.key===v.KEY_RIGHT||e.key===v.KEY_DOWN,o=this.state.lastSelectedIndex;if([v.KEY_RIGHT,v.KEY_LEFT].includes(e.key))t=i?s[o+1]?o+1:0:s[o-1]?o-1:s.length-1;else{let{countInRow:e}=this.panel;t=Math.round(((o+1)/e+(i?1:-1))*e-1)}return s[t]&&this.stateManager.addActive(s[t],e.shiftKey),!1}}}removeGlobalListeners(){this.e.off(this.ow,"keydown",this.onKeyPress)}onFileRemove(){this.state.activeElements.length&&this.confirm("Are you sure?","Delete",e=>{e&&this.__itemsRemove(this.state.activeElements)}).bindDestruct(this)}__itemsRemove(e){if(!e.length)return Promise.resolve();let t=[];return e.forEach(e=>{t.push("folder"===e.type?this.__folderRemove((0,n.parentPath)(e.path),e.name??"",e.sourceName):this.__removeFile(e.file||e.name||"",e.sourceName))}),this.state.activeElements.forEach(e=>{this.stateManager.isFavorite(e)&&this.stateManager.toggleFavorite(e)}),this.state.activeElements=[],Promise.allSettled(t).then(()=>Promise.allSettled([this.loadingManager.loadItems(),this.loadingManager.loadFolders()]))}__removeFile(e,t){return this.dataProvider.fileRemove(this.state.currentPath,e,t).then(t=>{this.status(t||this.i18n('File "%s" was deleted',e),!0)}).catch(this.status)}__folderRemove(e,t,s){return this.dataProvider.folderRemove(e,t,s).then(i=>{this.status(i||this.i18n('Folder "%s" was deleted',t),!0),this.state.currentPath===e&&(this.state.currentPath=(0,n.parentPath)(e),this.state.currentSource=s)}).catch(this.status)}onFileEdit(){if(1===this.state.activeElements.length){let[e]=this.state.activeElements;b.openImageEditor.call(this,e.fileURL,e.file||"",e.path,e.sourceName,void 0,this.status)}}onFolderRename(e){this.prompt("Enter new name","Rename",t=>{if(!(0,w.isValidName)(t)||t===e.name)return this.status(this.i18n("Enter new name")),!1;this.dataProvider.folderRename((0,n.parentPath)(e.path),e.name,t,e.sourceName).then(s=>{this.state.activeElements=[],this.status(s,!0),this.state.currentPath=(0,n.parentPath)(e.path)+"/"+t,this.state.currentSource=e.sourceName,this.historyManager.updateCurrent(),this.loadingManager.loadFolders()}).catch(this.status)},this.i18n("type name"),e.name).bindDestruct(this)}onFolderRemove(e){this.confirm("Are you sure?","Delete",t=>{t&&this.__itemsRemove([{type:"folder",name:e.name,path:e.path,sourceName:e.sourceName}])}).bindDestruct(this)}onFolderCreate(e){this.prompt("Enter Directory name","Create directory",t=>{let s=e.path||"/";this.dataProvider.createFolder(t,e.path||"/",e.sourceName).then(()=>{this.state.currentSource===e.sourceName&&this.state.currentPath===s?this.e.fire("update.filebrowser"):(this.state.currentSource=e.sourceName,this.state.currentPath=s),this.historyManager.updateCurrent()},this.status)},this.i18n("type name")).bindDestruct(this)}onFileRename(e){let t=e.file||e.name||"";1===this.state.activeElements.length&&t&&this.prompt("Enter new name","Rename",e=>{if(!(0,w.isValidName)(e))return this.status(this.i18n("Enter new name")),!1;this.dataProvider.fileRename(this.state.currentPath,t,e,this.state.currentSource).then(e=>{this.state.activeElements=[],this.status(e,!0),this.loadingManager.loadItems()}).catch(this.status)},this.i18n("type name"),t).bindDestruct(this)}onChooseItems(){let e=this.stateManager.state.activeElements;if(e.length){if("folder"===e[0].type){this.state.currentPath=this.state.currentPath+"/"+e[0].name,this.state.currentSource=e[0].sourceName,this.e.fire("afterOpenFolder.filebrowser");return}this.state.onSelectCallBack?this.stateManager.callSelectHandler():this.onOpenLightBox(e[0])}}onOpenLightBox(e){u.UILightBox.open(this,e,this.state.elements)}initUploader(){let e=this,t=(0,w.ConfigProto)(e.o.uploader||{},f.Config.defaultOptions.uploader),s=()=>this.loadingManager.loadItems();e.uploader=e.getInstance("Uploader",t),e.uploader.bind(e.panel.container,s,e.status),e.e.on("bindUploader.filebrowser",t=>{e.uploader.bind(t,s,e.status)})}destruct(){this.removeGlobalListeners(),this.header.destruct(),this.panel.destruct(),super.destruct()}fullFillOptions(){["getLocalFileByUrl","crop","resize","create","fileMove","folderMove","fileRename","folderRename","fileRemove","folderRemove","folder","items","permissions"].forEach(e=>{null!=this.options[e]&&(this.options[e]=(0,w.ConfigProto)(this.options[e],this.o.ajax))})}constructor(e){super((0,w.ConfigProto)(Object.assign(e||{},{resizable:!0,draggable:!0,toolbarButtons:e?.toolbarButtons||f.Config.defaultOptions.filebrowser.buttons,buttons:S.JoditPro.atom(["filebrowser.settings","fullsize","dialog.close"])}),f.Config.defaultOptions.filebrowser)),(0,i._)(this,"dataProvider",(0,C.makeDataProvider)(this,this.options)),(0,i._)(this,"state",(0,y.observable)({onSelectCallBack:null,theme:"default",showSideBar:!0,showFavorites:!0,showSettings:!1,showPreview:!1,withFolders:!0,foldersPosition:"bottom",info:"",metaInfo:null,currentPath:"",currentSource:"",currentBaseUrl:"",tree:[],activeElements:[],favorites:[],progress:0,lastSelectedIndex:0,elements:[],messages:[],sources:[],view:"tiles",tileSize:"default",sortBy:"name-asc",filterWord:"",onlyImages:!1})),(0,i._)(this,"persistent",new l.PersistentStore(this,this.state)),(0,i._)(this,"loadingManager",new h.LoadingManager(this,this.state)),(0,i._)(this,"stateManager",new c.StateManager(this.state)),(0,i._)(this,"historyManager",new a.HistoryManager(this,this.state)),(0,i._)(this,"contextMenuManager",new r.ContextMenuManager(this)),(0,i._)(this,"header",new d.UIBrowserHeader(this,this.options,this.stateManager)),(0,i._)(this,"panel",new m.UIBrowserPanel(this,this.stateManager)),(0,i._)(this,"files",this.panel),(0,i._)(this,"tree",this.panel),(0,i._)(this,"uploader",void 0),x.license.make(this),!this.persistent.theme&&this.options.theme&&(this.persistent.theme=this.options.theme),this.panel.append(this.progressbar),this.toolbar.setMod("mode","header"),this.setSize(Math.min(this.options.width,screen.width),Math.min(this.options.height,screen.height)).setHeader(this.header),this.onResizeWindow(),this.initUploader(),this.onChangeTheme(),this.fullFillOptions(),this.dataProvider.onProgress(e=>{0===e&&(e=30),this.state.progress=e}),this.e.on("beforeClose",this.removeGlobalListeners),this.e.fire("afterInit"),S.JoditPro.prototype.afterInitHook.call(this)}}(0,o.__decorate)([g.autobind],P.prototype,"status",null),(0,o.__decorate)([g.cache],P.prototype,"progressbar",null),(0,o.__decorate)([(0,g.watch)(":resize",{context:window})],P.prototype,"onResizeWindow",null),(0,o.__decorate)([(0,g.watch)(["state.currentPath","state.currentSource"])],P.prototype,"onChangePath",null),(0,o.__decorate)([(0,g.watch)("state.theme")],P.prototype,"onChangeTheme",null),(0,o.__decorate)([(0,g.watch)(":toggleSettings.filebrowser")],P.prototype,"onToggleSettings",null),(0,o.__decorate)([g.autobind],P.prototype,"onKeyPress",null),(0,o.__decorate)([g.autobind],P.prototype,"removeGlobalListeners",null),(0,o.__decorate)([(0,g.watch)(":fileRemove.filebrowser")],P.prototype,"onFileRemove",null),(0,o.__decorate)([(0,g.watch)(":edit.filebrowser")],P.prototype,"onFileEdit",null),(0,o.__decorate)([(0,g.watch)(":folderRename.filebrowser")],P.prototype,"onFolderRename",null),(0,o.__decorate)([(0,g.watch)(":folderRemove.filebrowser")],P.prototype,"onFolderRemove",null),(0,o.__decorate)([(0,g.watch)(":folderCreate.filebrowser")],P.prototype,"onFolderCreate",null),(0,o.__decorate)([(0,g.watch)(":fileRename.filebrowser")],P.prototype,"onFileRename",null),(0,o.__decorate)([(0,g.watch)(":select.filebrowser")],P.prototype,"onChooseItems",null),(0,o.__decorate)([(0,g.watch)(":openLightBox.filebrowser")],P.prototype,"onOpenLightBox",null),P=(0,o.__decorate)([g.component,(0,g.derive)(_.Dlgs)],P),Object.defineProperty(S.JoditPro.modules,"FileBrowserPro",{value:P,writable:!1,enumerable:!0,configurable:!0})},7307:function(e){e.exports='<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"> <path d="M365.4,59.628c60.56,0,109.6,49.03,109.6,109.47c0,109.47-109.6,171.8-219.06,281.271 C146.47,340.898,37,278.568,37,169.099c0-60.44,49.04-109.47,109.47-109.47c54.73,0,82.1,27.37,109.47,82.1 C283.3,86.999,310.67,59.628,365.4,59.628z"/> </svg>'},8087:function(e,t,s){"use strict";s.d(t,{ContextMenuManager:function(){return a}});var i=s(31635),o=s(80480),r=s(65478),n=s(63399);class a extends o.ViewComponent{className(){return"ContextMenuManager"}onFolderContext(e,t){return this.buildContextItemMenu(this.getFolderContextActions(e),t),!1}onItemContext(e,t,s){return this.buildContextItemMenu(this.getItemContextActions(e),s),!1}onSourceContext(e,t){return this.buildContextItemMenu(this.getSourceContextActions(e),t),!1}buildContextItemMenu(e,t){if(!this.j.o.contextMenu)return;let s=(0,n.makeContextMenu)(this.j).setMod("theme",this.j.state.theme);s.show(t.clientX,t.clientY,e.filter(e=>e&&!1!==e.enabled)),this.j.e.on(this.j,"afterClose",()=>{s.isOpened&&s.close()})}getItemContextActions(e){if(this.j.stateManager.isActive(e)||this.j.stateManager.addActive(e,this.j.state.activeElements.length>1),"folder"===e.type)return this.getFolderContextActions({type:"directory",children:[],name:e.name||"",path:e.path,sourceName:e.sourceName});let t=this.j.options,s=this.j.dataProvider,i=1===this.j.state.activeElements.length;return[{icon:"pencil",title:"Edit",enabled:!!e.isImage&&t.editImage&&i&&(s.canI("ImageResize")||s.canI("ImageCrop")),exec:()=>{this.j.e.fire("edit.filebrowser")}},{icon:"italic",title:"Rename",enabled:s.canI("FileRename")&&i,exec:()=>this.j.e.fire("fileRename.filebrowser",e)},{icon:"bin",title:"Delete",enabled:s.canI("FileRemove"),exec:()=>this.j.e.fire("fileRemove.filebrowser",e)},{icon:"eye",title:"Preview",enabled:!!(e.isImage||"file"===e.type)&&t.preview&&i,exec:()=>this.j.e.fire("openLightBox.filebrowser",e)},{icon:"upload",title:"Download",exec:()=>{e.fileURL&&this.j.ow.open(e.fileURL)}}]}getFolderContextActions(e){let t=this.j.dataProvider;return[{icon:"pencil",title:"Rename",exec:()=>{this.j.e.fire("folderRename.filebrowser",e)},enabled:t.canI("FolderRename")},{icon:"bin",title:"Delete",exec:()=>{this.j.e.fire("folderRemove.filebrowser",e)},enabled:t.canI("FolderRemove")},{icon:"plus",title:"Add folder",exec:()=>{this.j.e.fire("folderCreate.filebrowser",e)},enabled:t.canI("FolderCreate")}]}getSourceContextActions(e){return[{icon:"plus",title:"Create folder",exec:()=>{this.j.e.fire("folderCreate.filebrowser",e)}}]}}(0,i.__decorate)([(0,r.watch)(":contextmenuFolder.filebrowser")],a.prototype,"onFolderContext",null),(0,i.__decorate)([(0,r.watch)(":contextmenuItem.filebrowser")],a.prototype,"onItemContext",null),(0,i.__decorate)([(0,r.watch)(":contextmenuSource.filebrowser")],a.prototype,"onSourceContext",null),a=(0,i.__decorate)([r.component],a)},8358:function(e,t,s){"use strict";s.d(t,{UIPreview:function(){return u}});var i=s(82749),o=s(31635),r=s(65478),n=s(2748),a=s(43555),h=s(38837),l=s(62405),c=s(21130),d=s(54747);class u extends l.UIGroup{className(){return"UIPreview"}addResize(){(0,a.css)(this.container,{width:null,height:null}),d.UIResize.remove(this),d.UIResize.install(this,screen.width>450?"left":"top")}render(){return`<div>
<div class="&__image"></div>
<div class="&__info"></div>
<div class="&__loader"></div>
<div class="&__empty-message">~Select image~</div>
</div>`}afterSetMod(e,t){"hidden"===e&&!1===t&&this.onChangeMetaInfo(),super.afterSetMod(e,t)}onChangeMetaInfo(){if(this.getMod("hidden"))return;let{metaInfo:e}=this.state;this.setMod("empty",!e);let t=this.getElm("info");(0,h.assert)(null!=t,"info element does not exists"),n.Dom.detach(t);let s=this.getElm("image");(0,h.assert)(null!=s,"image element does not exists"),(0,a.css)(s,{backgroundImage:null}),e&&(this.setMod("is-file",!1===e.isImage).setMod("type",e.type??"file"),c.UIBrowserItem.prototype.setElementValue.call(this,"name",e.file),c.UIBrowserItem.prototype.setElementValue.call(this,"time",e.time),c.UIBrowserItem.prototype.setElementValue.call(this,"filesize",e.size),this.setMod("loading",!0),this.lastLoadPromise?.rejectCallback(),this.lastLoadPromise=(0,a.loadImage)(e.isImage?e.fileURL:e.imageURL,this.j),this.lastLoadPromise.then(e=>{let t=this.getElm("image");(0,h.assert)(null!=t,"image element does not exist"),e&&(0,a.css)(t,{backgroundImage:`url(${e.src})`})}).finally(()=>{this.setMod("loading",!1)}).catch(()=>{}))}constructor(e,t){super(e),(0,i._)(this,"state",void 0),(0,i._)(this,"lastLoadPromise",void 0),this.state=t,this.lastLoadPromise=null,this.onChangeMetaInfo()}}(0,o.__decorate)([(0,r.hook)("ready"),(0,r.watch)(":resize",{context:window}),(0,r.debounce)()],u.prototype,"addResize",null),(0,o.__decorate)([(0,r.watch)("state.metaInfo")],u.prototype,"onChangeMetaInfo",null),u=(0,o.__decorate)([r.component],u)},17234:function(e,t,s){"use strict";s.d(t,{UIBrowserStatusBar:function(){return a}});var i=s(31635),o=s(65478),r=s(38837),n=s(67510);class a extends n.UIElement{className(){return"UIBrowserStatusBar"}render(){return`<div>
<div class='&__slot-left'></div>
<div class='&__slot-center'></div>
<div class='&__slot-right'></div>
</div>`}value(e,t="left"){let s=this.getElm("slot-"+t);return(0,r.assert)(null!=s,"Slot does not exists"),s.innerText=e,this}}a=(0,i.__decorate)([o.component],a)},17578:function(e,t,s){"use strict";s.d(t,{HistoryManager:function(){return h}});var i=s(82749),o=s(31635),r=s(80480),n=s(65478),a=s(97735);class h extends r.ViewComponent{className(){return"HistoryManager"}canNext(){return this.historyIndex<this.history.length-1}canPrevious(){return this.historyIndex>0}push(e){let{historyIndex:t}=this,s=this.history[t];if(s&&s.currentSource===e.currentSource&&s.currentPath===e.currentPath)return;let i=[...this.history];i.length-1!==t&&(i=i.slice(0,t+1)),i.push(e),s&&(t+=1),this.history=i,this.historyIndex=t}next(){this.canNext()&&(this.historyIndex+=1,this.updateState())}previous(){this.canPrevious()&&(this.historyIndex-=1,this.updateState())}updateCurrent(){this.history[this.historyIndex]={currentSource:this.state.currentSource,currentPath:this.state.currentPath,tree:(0,a.fastClone)(this.state.tree),elements:[...this.state.elements]}}onHome(){this.state.currentPath="",this.state.currentSource="",this.j.e.fire("afterOpenFolder.filebrowser update.filebrowser")}onOpenFolder(){this.push({tree:[],elements:[],currentPath:this.state.currentPath,currentSource:this.state.currentSource}),this.j.e.fire("changeSelection")}updateState(){let{tree:e,elements:t,currentSource:s,currentPath:i}=this.history[this.historyIndex];this.state.activeElements=[],this.state.elements=[...t],this.state.tree=[...e],this.state.currentSource=s,this.state.currentPath=i,this.j.e.fire("changeSelection")}constructor(e,t){super(e),(0,i._)(this,"state",void 0),(0,i._)(this,"history",void 0),(0,i._)(this,"historyIndex",void 0),this.state=t,this.history=[],this.historyIndex=0}}(0,o.__decorate)([(0,n.watch)(["state.elements","state.tree"])],h.prototype,"updateCurrent",null),(0,o.__decorate)([(0,n.watch)(":goHome.filebrowser")],h.prototype,"onHome",null),(0,o.__decorate)([(0,n.watch)(":afterOpenFolder.filebrowser")],h.prototype,"onOpenFolder",null),h=(0,o.__decorate)([n.component],h)},18250:function(e,t,s){"use strict";s.d(t,{UIBrowserHeader:function(){return l}});var i=s(82749),o=s(31635),r=s(65478),n=s(70799),a=s(67510),h=s(21491);class l extends a.UIGroup{className(){return"UIBrowserHeader"}__getButtons(){return(this.options.toolbarButtons??[]).filter(e=>{if(!(0,n.isString)(e))return!0;switch(e){case"filebrowser.edit":return this.j.dataProvider.canI("ImageResize")||this.j.dataProvider.canI("ImageCrop");case"filebrowser.new-folder":return this.j.dataProvider.canI("FolderCreate");case"filebrowser.upload":return this.j.dataProvider.canI("FileUpload");case"filebrowser.remove":return this.j.dataProvider.canI("FileRemove")}return!0})}constructor(e,t,s){super(e),(0,i._)(this,"options",void 0),(0,i._)(this,"stateManager",void 0),(0,i._)(this,"syncMod",void 0),(0,i._)(this,"toolbar",void 0),(0,i._)(this,"filter",void 0),this.options=t,this.stateManager=s,this.syncMod=!0,this.toolbar=(0,h.makeCollection)(this.j),this.filter=new a.UIInput(this.j,{icon:"search",placeholder:"Filter",clearButton:!0,onChange:e=>{this.stateManager.setFilter(e)}}),this.append(this.toolbar).append(this.filter),this.filter.container.classList.add(this.getFullElName("filter")),this.toolbar.setMod("mode","header").build(this.__getButtons())}}l=(0,o.__decorate)([r.component],l)},21130:function(e,t,s){"use strict";s.d(t,{UIBrowserItem:function(){return d}});var i=s(82749),o=s(31635),r=s(65478),n=s(21537),a=s(38837),h=s(67510),l=s(41409),c=s(159);class d extends h.UIElement{className(){return"UIBrowserItem"}render(){return`<div tabindex='-1'>
<div class='&__image'></div>
<div class='&__info'></div>
<div class='&__heart'>*heart*</div>
</div>`}onClickFavorite(){return this.bubble(e=>{this.jodit.e.fire(e,"toggleFavoriteItem",this.item)}),!1}onAction(e){return this.jodit.e.fire(e.type+"Item.filebrowser",this.item,(0,n.ctrlKey)(e)||e.shiftKey,e),!1}update(){let e=this.getElm("image");(0,a.assert)(null!=e,"image element does not exists"),(0,n.css)(e,"backgroundImage",`url(${encodeURI(this.item.imageURL)})`);let{type:t,file:s,time:i,size:o}=this.item;this.setMod("is-file",!1===this.item.isImage).setMod("type",t??"file").setElementValue("name",s).setElementValue("time",i).setElementValue("filesize",o),(0,n.attr)(this.container,"title","folder"!==t?`${s} ${i} ${o}`:s),super.update()}setElementValue(e,t){let s=this.getFullElName(e),i=this.getElm(e);if(!t)return i&&l.Dom.safeRemove(i),this;if(!i){let e=this.getElm("info");(0,a.assert)(null!=e,"wrapper element does not exist"),i=this.j.create.div(s),e.appendChild(i)}return i.innerText=t,this}constructor(e,t){super(e),(0,i._)(this,"item",void 0),this.item=c.FileBrowserItem.create(t),e.e.on(this.container,"click contextmenu dblclick",t=>(e.e.fire(t.type+"Item.filebrowser",this.item,(0,n.ctrlKey)(t)||t.shiftKey,t),!1)),this.update()}}(0,o.__decorate)([(0,r.watch)("heart:click")],d.prototype,"onClickFavorite",null),(0,o.__decorate)([(0,r.watch)(["container:click","container:contextmenu","container:dblclick"])],d.prototype,"onAction",null),d=(0,o.__decorate)([r.component],d)},24928:function(e){e.exports='<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"> <path d="M28.7,16.3l-12-13c-0.4-0.4-1.1-0.4-1.5,0l-12,13C3,16.6,2.9,17,3.1,17.4C3.2,17.8,3.6,18,4,18h3v10c0,0.6,0.4,1,1,1h16 c0.6,0,1-0.4,1-1V18h3c0.4,0,0.8-0.2,0.9-0.6C29.1,17,29,16.6,28.7,16.3z"/> </svg>'},34042:function(e,t,s){"use strict";var i=s(7307),o=s(24928),r=s(96910),n=s(67510);n.Icon.set("heart",i+""),n.Icon.set("home",o+""),n.Icon.set("new-folder",r+"")},36469:function(e,t,s){"use strict";s.d(t,{UISelectItems:function(){return r}});var i=s(2748),o=s(41180);class r{static remove(e){i.Dom.safeRemove(e.container.querySelector(".jodit-ui-select-items")),e.j.e.off(e.container,"mousedown.uiselectitems touchstart.uiselectitems")}static install(e){let t=e.j.c.div("jodit-ui-select-items");e.j.e.on(e.container,"mousedown.uiselectitems touchstart.uiselectitems",this.onStartSelect.bind(this,e,t))}static onStartSelect(e,t,s){if(s.target!==e.container)return;(0,o.css)(t,{width:0,height:0}),e.container.appendChild(t);let i={x:s.clientX,y:s.clientY,w:e.container.offsetWidth,h:e.container.offsetHeight},r=e.j.async.throttle(this.onSelect.bind(this,e,t,i),e.j.defaultTimeout/10);e.j.lock(),e.j.e.on(e.j.ow,"mousemove touchmove",r).one(e.j.ow,"mouseup touchend",this.onEndSelect.bind(this,e,t,r)),e.onSelectItems({left:i.x,top:i.y,width:0,height:0})}static onSelect(e,t,s,i){let r={left:s.x>i.clientX?i.clientX:s.x,top:s.y>i.clientY?i.clientY:s.y,width:Math.abs(s.x-i.clientX),height:Math.abs(s.y-i.clientY)};(0,o.css)(t,r),e.onSelectItems(r)}static onEndSelect(e,t,s,o){i.Dom.safeRemove(t),e.j.e.off(e.j.ow,"mousemove touchmove",s),e.j.unlock()}}},36704:function(e,t,s){"use strict";s.d(t,{UITree:function(){return h}});var i=s(82749),o=s(31635),r=s(87325),n=s(62405),a=s(43692);class h extends n.UIGroup{className(){return"UITree"}build(e){this.clear(),e.forEach(e=>{let t=new a.UIBrowserFolder(this.jodit,e);this.append(t),e.isActive&&t.setMod("active",!0),e.children.length&&this.append(new h(this.jodit,e.children))})}constructor(e,t){super(e),(0,i._)(this,"syncMod",!0),this.build(t)}}h=(0,o.__decorate)([r.component],h)},41950:function(e,t,s){"use strict";s.d(t,{UIBrowserSource:function(){return l}});var i=s(82749),o=s(31635),r=s(87325),n=s(38837),a=s(48538),h=s(36704);class l extends a.UIElement{className(){return"UIBrowserSource"}render(){return`<div>
<div class="&__name"></div>
<div class="&__tree"></div>
</div>`}constructor(e,t){super(e,t),(0,i._)(this,"data",void 0),(0,i._)(this,"tree",void 0),(0,i._)(this,"syncMod",void 0),this.data=t,this.tree=new h.UITree(this.j,this.data.children),this.syncMod=!0;const s=this.getElm("name");(0,n.assert)(null!=s,"name element does not exists"),s.innerText=t.title||t.name;const o=this.getElm("tree");(0,n.assert)(null!=o,"tree element does not exists"),o.appendChild(this.tree.container),e.e.on(this.container,"contextmenu",s=>e.e.fire("contextmenuSource.filebrowser",t,s))}}l=(0,o.__decorate)([r.component],l)},42663:function(e,t,s){"use strict";s.d(t,{PersistentStore:function(){return h}});var i=s(82749),o=s(31635),r=s(91907),n=s(65478),a=s(159);class h extends r.ViewComponent{className(){return"PersistentStore"}onChangeThemeSetField(){this.theme=this.state.theme}onChangeView(){this.view=this.state.view}onChangeSortBy(){this.sortBy=this.state.sortBy}onChangeTileSize(){this.tileSize=this.state.tileSize}onChangeFavorites(){this.favorites=this.state.favorites}onChangeShowSideBar(){this.showSideBar=this.state.showSideBar}onChangeShowPreview(){this.showPreview=this.state.showPreview}onChangeShowFavorites(){this.showFavorites=this.state.showFavorites}onChangeFoldersPosition(){this.foldersPosition=this.state.foldersPosition}syncWithState(){this.state.tileSize=this.tileSize,this.state.favorites=this.favorites.map(e=>e instanceof a.FileBrowserItem?e:a.FileBrowserItem.create(e)),this.state.view=this.view,this.state.theme=this.theme,this.state.showSideBar=this.showSideBar,this.state.showPreview=this.showPreview,this.state.showFavorites=this.showFavorites,this.state.sortBy=this.sortBy,this.state.foldersPosition=this.foldersPosition}constructor(e,t){super(e),(0,i._)(this,"state",void 0),(0,i._)(this,"theme",void 0),(0,i._)(this,"sortBy",void 0),(0,i._)(this,"view",void 0),(0,i._)(this,"foldersPosition",void 0),(0,i._)(this,"tileSize",void 0),(0,i._)(this,"favorites",void 0),(0,i._)(this,"showSideBar",void 0),(0,i._)(this,"showPreview",void 0),(0,i._)(this,"showFavorites",void 0),this.state=t,this.sortBy="changed-desc",this.view="tiles",this.foldersPosition="top",this.tileSize="default",this.favorites=[],this.showSideBar=!0,this.showPreview=!1,this.showFavorites=!0}}(0,o.__decorate)([n.persistent],h.prototype,"theme",void 0),(0,o.__decorate)([n.persistent],h.prototype,"sortBy",void 0),(0,o.__decorate)([n.persistent],h.prototype,"view",void 0),(0,o.__decorate)([n.persistent],h.prototype,"foldersPosition",void 0),(0,o.__decorate)([n.persistent],h.prototype,"tileSize",void 0),(0,o.__decorate)([n.persistent],h.prototype,"favorites",void 0),(0,o.__decorate)([n.persistent],h.prototype,"showSideBar",void 0),(0,o.__decorate)([n.persistent],h.prototype,"showPreview",void 0),(0,o.__decorate)([n.persistent],h.prototype,"showFavorites",void 0),(0,o.__decorate)([(0,n.watch)("state.theme")],h.prototype,"onChangeThemeSetField",null),(0,o.__decorate)([(0,n.watch)("state.view")],h.prototype,"onChangeView",null),(0,o.__decorate)([(0,n.watch)("state.sortBy")],h.prototype,"onChangeSortBy",null),(0,o.__decorate)([(0,n.watch)("state.tileSize")],h.prototype,"onChangeTileSize",null),(0,o.__decorate)([(0,n.watch)("state.favorites")],h.prototype,"onChangeFavorites",null),(0,o.__decorate)([(0,n.watch)("state.showSideBar")],h.prototype,"onChangeShowSideBar",null),(0,o.__decorate)([(0,n.watch)("state.showPreview")],h.prototype,"onChangeShowPreview",null),(0,o.__decorate)([(0,n.watch)("state.showFavorites")],h.prototype,"onChangeShowFavorites",null),(0,o.__decorate)([(0,n.watch)("state.foldersPosition")],h.prototype,"onChangeFoldersPosition",null),h=(0,o.__decorate)([n.component],h)},43692:function(e,t,s){"use strict";s.d(t,{UIBrowserFolder:function(){return h}});var i=s(82749),o=s(31635),r=s(87325),n=s(38837),a=s(67510);class h extends a.UIElement{className(){return"UIBrowserFolder"}render(){return`<div>
<div class="&__icon">
<div class='&__loader'></div>
<div class="&__icon-wrapper">
*folder*
</div>
</div>
<div class="&__name"></div>
<div class="&__arrow">*angle-right*</div>
</div>`}constructor(e,t){super(e),(0,i._)(this,"item",void 0),(0,i._)(this,"syncMod",void 0),this.item=t,this.syncMod=!0;const s=this.getElm("name");(0,n.assert)(null!=s,"name element does not exists"),s.innerText=t.name,e.e.on(this.container,"click",()=>(this.getMod("active")||this.setMod("loading",!0),e.e.fire("openFolder",t))).on(this.container,"contextmenu",s=>e.e.fire("contextmenuFolder.filebrowser",t,s))}}h=(0,o.__decorate)([r.component],h)},43778:function(e,t,s){"use strict";s.d(t,{UIVirtualScroll:function(){return d}});var i=s(82749),o=s(31635),r=s(65478),n=s(5700),a=s(62405),h=s(159),l=s(21130),c=s(36469);class d extends a.UIGroup{className(){return"UIVirtualScroll"}render(){return`<div>
<div class="&__empty-message">~There are no files~</div>
<div class='&__loader'></div>
<div class='&__drag-area'>~Drop image~</div>
</div>`}reconcile(e){let t=this.elements.findIndex((t,s)=>!e[s]||t.item.uniqueHashKey!==h.FileBrowserItem.create(e[s]).uniqueHashKey);if(t>-1){for(let e=t;e<this.elements.length;e+=1)this.elements[e].destruct();this.elements.length=t}return t}build(e){let t=this.reconcile(e);e.slice(t>-1?t:this.elements.length).forEach(e=>{let t=new l.UIBrowserItem(this.jodit,e);Object.keys(this.mods).forEach(e=>{t.setMod(e,this.mods[e])}),this.append(t)}),this.setMod("empty",!this.elements.length)}onScrollLoadChunk(){!this.stateManager.isFavoriteItems&&this.container.scrollHeight-(this.container.scrollTop+this.container.offsetHeight)<this.j.o.pixelOffsetLoadNewChunk&&this.j.loadingManager.loadItemsChunk()}onDragOver(e){e.preventDefault(),this.setMod("dragover",!0)}onDragLeave(e){e.preventDefault(),this.setMod("dragover",!1)}addItemsSelector(){c.UISelectItems.install(this)}static intersectRect(e,t){return!(t.left>e.left+e.width||t.left+t.width<e.left||t.top>e.top+e.height||t.top+t.height<e.top)}onSelectItems(e){let t=[];this.elements.forEach(s=>{let i=(0,n.position)(s.container);d.intersectRect(i,e)&&t.push(s.item)}),this.stateManager.state.activeElements=t}constructor(e,t){super(e),(0,i._)(this,"stateManager",void 0),(0,i._)(this,"syncMod",void 0),this.stateManager=t,this.syncMod=!0,this.addItemsSelector()}}(0,o.__decorate)([(0,r.watch)(":afterResize"),(0,r.watch)(":resize"),(0,r.watch)("container:scroll"),(0,r.throttle)()],d.prototype,"onScrollLoadChunk",null),(0,o.__decorate)([(0,r.watch)("container:dragover")],d.prototype,"onDragOver",null),(0,o.__decorate)([(0,r.watch)(["container:dragleave","container:drop"])],d.prototype,"onDragLeave",null),d=(0,o.__decorate)([r.component],d)},54747:function(e,t,s){"use strict";s.d(t,{UIResize:function(){return r}});var i=s(2748),o=s(41180);class r{static remove(e){e.container.classList.remove("jodit-ui-resize"),i.Dom.safeRemove(e.container.querySelector(".jodit-ui-resize__handle"))}static install(e,t,s={}){e.container.classList.add("jodit-ui-resize"),"static"===(0,o.css)(e.container,"position")&&(0,o.css)(e.container,"position","relative");let i=e.j.c.div("jodit-ui-resize__handle");i.classList.add("jodit-ui-resize__handle_type_"+t),s.handleClassName&&i.classList.add(s.handleClassName),e.container.appendChild(i),e.j.e.on(i,"mousedown touchstart",this.onStartResize.bind(this,e,t,s.onResize??(()=>void 0)))}static onStartResize(e,t,s,i){let o={x:i.clientX,y:i.clientY,w:e.container.offsetWidth,h:e.container.offsetHeight,direction:t},r=e.j.async.throttle(this.onResize.bind(this,e,o,s),e.j.defaultTimeout/10);e.j.lock(),e.j.e.on(e.j.ow,"mousemove touchmove",r).one(e.j.ow,"mouseup touchend",this.onEndResize.bind(this,e,r))}static onResize(e,t,s,i){let r,n=["left","right"].includes(t.direction),a=e.container.parentElement;a&&(r=n?t.w+(i.clientX-t.x)*("right"===t.direction?1:-1):t.h+(i.clientY-t.y)*("top"===t.direction?-1:1),!0!==s?.({newSize:r})&&(0,o.css)(e.container,n?"width":"height",r/(n?a.offsetWidth:a.offsetHeight)*100+"%"))}static onEndResize(e,t,s){e.j.e.off(e.j.ow,"mousemove touchmove",t),e.j.unlock()}}},55535:function(e,t,s){"use strict";s.d(t,{StateManager:function(){return n}});var i=s(82749),o=s(31635),r=s(65478);class n{getIndex(e,t=this.state.elements){return t.findIndex(t=>t.uniqueHashKey===e.uniqueHashKey)}isActive(e){return!!this.state.activeElements.find(t=>t.uniqueHashKey===e.uniqueHashKey)}isFavorite(e){return!!this.state.favorites.find(t=>t.uniqueHashKey===e.uniqueHashKey)}addActive(e,t){this.state.metaInfo=e,this.state.info=e.file??"",this.state.lastSelectedIndex=this.getIndex(e),this.state.activeElements=t?[...this.state.activeElements,e]:[e]}callSelectHandler(){let e=this.state.activeElements;this.state.onSelectCallBack?.call(this,{baseurl:"",files:e.map(e=>e.fileURL),isImages:e.map(e=>!!e.isImage)})}setFilter(e){this.state.filterWord=e}toggleFavorite(e){let t=this.getIndex(e,this.state.favorites),s=[...this.state.favorites];-1===t?s.push(e):s.splice(t,1),this.state.favorites=s}fillTreeForPath(e,t){if(!this.state.tree.length||!t||"/"===t){this.state.tree=e.map(l);return}this.removeActive(this.state.tree),e.forEach(e=>{var s;let i=a(this.state.tree,e.name);i||(i=l(e),this.state.tree.push(i)),i.isActive=!0;let o=(s=i,t.split("/").reduce((e,t)=>e&&a(e.children,t),s));o&&(o.isActive=!0,o.children=h(e.folders).map(s=>c(s,t+"/"+s,e.name)))}),this.state.tree=[...this.state.tree]}removeActive(e){e.forEach(e=>{e.isActive=!1,this.removeActive(e.children)})}get isFavoriteItems(){return this.state.favorites===this.state.elements}constructor(e){(0,i._)(this,"state",void 0),this.state=e}}function a(e,t){return e.find(e=>e.name===t)??null}function h(e){return e.filter(e=>"."!==e&&".."!==e)}function l(e){return{type:"source",name:e.name,title:e.title,sourceName:e.name,path:"/",children:h(e.folders).map(t=>c(t,t,e.name))}}function c(e,t,s){return{type:"directory",name:e,path:t,sourceName:s,children:[]}}(0,o.__decorate)([r.autobind],n.prototype,"getIndex",null),(0,o.__decorate)([r.autobind],n.prototype,"isActive",null),(0,o.__decorate)([r.autobind],n.prototype,"isFavorite",null)},59198:function(e,t,s){"use strict";s.d(t,{UIBrowserSources:function(){return h}});var i=s(82749),o=s(31635),r=s(65478),n=s(67510),a=s(41950);class h extends n.UIGroup{className(){return"UIBrowserSources"}build(e){this.clear(),e.forEach(e=>{this.append(new a.UIBrowserSource(this.jodit,e))})}constructor(...e){super(...e),(0,i._)(this,"syncMod",!0)}}h=(0,o.__decorate)([r.component],h)},60062:function(e,t,s){"use strict";s.d(t,{UIBrowserSettings:function(){return h}});var i=s(82749),o=s(31635),r=s(65478),n=s(38837),a=s(67510);class h extends a.UIGroup{className(){return"UIBrowserSettings"}render(){return`<div>
<div class="${this.getFullElName("close")}">${a.Icon.get("cancel")}</div>
<div class="${this.getFullElName("title")}">~Settings~</div>
<div class="${this.getFullElName("options")}"></div>
</div>`}appendChildToContainer(e){let t=this.getElm("options");(0,n.assert)(null!=t,"options element does not exists"),t.appendChild(e)}afterSetMod(e,t){"hidden"===e&&!1===t&&this.generateSettings(),super.afterSetMod(e,t)}onChangeView(){let e=this.getElm("tile-size");e&&(e.style.display="tiles"===this.state.view?"block":"none")}generateSettings(){this.clear();let{j:e}=this;this.append([new a.UIButtonGroup(e,{label:"Theme",name:"theme",value:this.state.theme,radio:!0,options:[{value:"default",text:"Light"},{value:"dark",text:"Dark"}],onChange:e=>{if("default"!==this.state.theme&&"dark"!==this.state.theme){this.state.theme="default";return}this.state.theme=e[0].value}}),new a.UIButtonGroup(e,{label:"Show favorites",name:"showFavorites",value:this.state.showFavorites,radio:!0,options:[{value:!0,text:"Show"},{value:!1,text:"Hide"}],onChange:e=>{this.state.showFavorites=e[0].value}}),new a.UIButtonGroup(e,{label:"View",name:"view",value:this.state.view,radio:!0,options:[{value:"tiles",text:"Tiles"},{value:"list",text:"List"},{value:"compact",text:"Compact"}],onChange:e=>{this.state.view=e[0].value}}),new a.UIButtonGroup(e,{label:"Folders position",name:"foldersPosition",value:this.state.foldersPosition,radio:!0,options:[{value:"top",text:"Top"},{value:"bottom",text:"Bottom"},{value:"default",text:"Default"}],onChange:e=>{this.state.foldersPosition=e[0].value}}),new a.UISelect(e,{label:"Sort by",name:"sort-by",value:this.state.sortBy,options:[{value:"changed-asc",text:e.i18n("Sort by changed")+"(⬆)"},{value:"changed-desc",text:e.i18n("Sort by changed")+"(⬇)"},{value:"name-asc",text:e.i18n("Sort by name")+"(⬆)"},{value:"name-desc",text:e.i18n("Sort by name")+"(⬇)"},{value:"size-asc",text:e.i18n("Sort by size")+"(⬆)"},{value:"size-desc",text:e.i18n("Sort by size")+"(⬇)"}],onChange:e=>{this.state.sortBy=e}}),new a.UISelect(e,{label:"Tile size",name:"tile-size",value:this.state.tileSize,options:[{value:"xsmall",text:"Extra small"},{value:"small",text:"Small"},{value:"default",text:"Default"},{value:"large",text:"Large"},{value:"xlarge",text:"Extra large"}],onChange:e=>{this.state.tileSize=e}})]),this.onChangeView()}constructor(e,t){super(e),(0,i._)(this,"state",void 0),this.state=t;const s=this.getElm("close");(0,n.assert)(null!=s,"close element does not exists"),e.e.on(s,"click",()=>{this.state.showSettings=!1})}}(0,o.__decorate)([(0,r.watch)("state.view")],h.prototype,"onChangeView",null),h=(0,o.__decorate)([r.component],h)},69277:function(e,t,s){"use strict";s.d(t,{UILightBox:function(){return c}});var i=s(82749),o=s(31635),r=s(82758),n=s(65478),a=s(21537),h=s(38837),l=s(41409);class c extends l.UIElement{className(){return"UILightBox"}render(){return`<div>
<div class='&__previous'>*angle-left*</div>
<div class='&__preview'></div>
<div class='&__loader'></div>
<div class='&__next'>*angle-right*</div>
</div>`}async onChangeCurrent(){let{current:e}=this;this.setMod("loading",!0);let t=this.getElm("preview");if((0,h.assert)(null!=t,"preview element does not exist"),l.Dom.detach(t),(0,a.css)(t,{backgroundImage:null}),e.isImage){let s=await (0,a.loadImage)(e.fileURL,this.j);this.dialog.setPosition(),(0,a.css)(t,{width:Math.min(this.jodit.ow.innerWidth,s.naturalWidth),height:Math.min(this.jodit.ow.innerHeight-100,s.naturalHeight),backgroundImage:`url(${s.src})`})}else{let s=await this.makeIframe(e.fileURL);t.appendChild(s)}this.dialog.setSize(),this.dialog.setPosition(),this.setMod("loading",!1)}makeIframe(e){let t=this.j.c.element("iframe");return t.classList.add(this.getFullElName("office-iframe")),t.src=/\.pdf/.test(e)?e:this.j.o.previewOfficeURL+encodeURIComponent(e),t}onPreviousClick(){let{current:e}=this,t=this.j.stateManager.getIndex(e,this.elements);t<=0?t=this.elements.length-1:t-=1,this.current=this.elements[t]}onNextClick(){let{current:e}=this,t=this.j.stateManager.getIndex(e,this.elements);t>=this.elements.length-1?t=0:t+=1,this.current=this.elements[t]}static open(e,t,s){return new c(e,t,s)}addGlobalListeners(){this.j.e.on(this.j.od,"keydown",this.onKeyPress)}onKeyPress(e){if(e.key===r.KEY_LEFT||e.key===r.KEY_RIGHT||e.key===r.KEY_SPACE)return e.key===r.KEY_LEFT?this.onPreviousClick():this.onNextClick(),!1}removeGlobalListeners(){this.j.e.off(this.j.od,"keydown",this.onKeyPress)}destruct(){return this.removeGlobalListeners(),this.dialog.destruct(),super.destruct()}constructor(e,t,s){super(e),(0,i._)(this,"current",void 0),(0,i._)(this,"elements",void 0),(0,i._)(this,"dialog",void 0),this.current=t,this.elements=s,this.dialog=new l.Dialog;const{dialog:o}=this;o.setMod("theme",e.state.theme).toolbar.setMod("mode","header"),o.open(this),this.elements=this.elements.filter(e=>e.isImage),o.e.on(o,"afterClose",()=>{this.destruct()}),this.addGlobalListeners(),this.onChangeCurrent(),o.toolbar.build([{icon:"check",exec:()=>{e.stateManager.addActive(this.current,!1),e.e.fire("select.filebrowser"),o.close()}},"dialog.close"])}}(0,o.__decorate)([(0,n.watch)("current")],c.prototype,"onChangeCurrent",null),(0,o.__decorate)([(0,n.watch)("previous:click")],c.prototype,"onPreviousClick",null),(0,o.__decorate)([(0,n.watch)("next:click")],c.prototype,"onNextClick",null),(0,o.__decorate)([n.autobind],c.prototype,"onKeyPress",null),c=(0,o.__decorate)([n.component],c)},70950:function(e,t,s){"use strict";s.d(t,{UISidebar:function(){return c}});var i=s(82749),o=s(31635),r=s(65478),n=s(38837),a=s(41180),h=s(62405),l=s(54747);class c extends h.UIGroup{className(){return"UISidebar"}render(){return`<div>
<div class='&__hide-btn'>*angle-left*</div>
<div class='&__favorites'>*heart* ~Favorites~</div>
<div class='&__box'></div>
</div>`}appendChildToContainer(e){let t=this.getElm("box");(0,n.assert)(null!=t,"box element does not exists"),t.appendChild(e)}addResize(){(0,a.css)(this.container,{width:null,height:null}),l.UIResize.remove(this),l.UIResize.install(this,screen.width>450?"right":"bottom")}onChangeFavorites(){this.setMod("has-favorites",!!this.state.favorites.length)}onClickHideButton(){return this.state.showSideBar=!this.state.showSideBar,!1}onClickFavorites(){return this.state.elements=this.state.favorites,!1}constructor(e,t,s){super(e,t),(0,i._)(this,"state",void 0),this.state=s,this.onChangeFavorites()}}(0,o.__decorate)([(0,r.hook)("ready"),(0,r.watch)(":resize",{context:window}),(0,r.debounce)()],c.prototype,"addResize",null),(0,o.__decorate)([(0,r.watch)("state.favorites")],c.prototype,"onChangeFavorites",null),(0,o.__decorate)([(0,r.watch)("hide-btn:click")],c.prototype,"onClickHideButton",null),(0,o.__decorate)([(0,r.watch)("favorites:click")],c.prototype,"onClickFavorites",null),c=(0,o.__decorate)([r.component],c)},76636:function(e,t,s){"use strict";s.r(t),s.d(t,{ru:function(){return o.a}});var i=s(41324),o=s.n(i)},77841:function(e,t,s){"use strict";s.d(t,{parentPath:function(){return i}});let i=e=>{let t=e.split("/").filter(e=>e.length);return t.pop(),t.join("/")||"/"}},77894:function(e,t,s){"use strict";var i=s(76636),o=s(6441),r=s(580);let n=o.Config.prototype.controls.filebrowser;n.settings={icon:"settings",tooltip:"Settings",exec(e){(e.parent??e).e.fire("toggleSettings.filebrowser")}},n.home={icon:"home",tooltip:"Home",exec(e){e.e.fire("goHome.filebrowser")}},n.preview={icon:"eye",tooltip:"Preview",isDisabled:e=>0===e.state.activeElements.length,exec(e){e.e.fire("togglePreview.filebrowser")}},n.next={icon:"angle-right",tooltip:"History next",isDisabled:e=>!e.historyManager.canNext(),exec(e){e.historyManager.next()}},n.previous={icon:"angle-left",tooltip:"History previous",isDisabled:e=>!e.historyManager.canPrevious(),exec(e){e.historyManager.previous()}},n["new-folder"]={icon:"new-folder",exec(e){e.e.fire("folderCreate.filebrowser",{path:e.state.currentPath,sourceName:e.state.currentSource})},tooltip:"New folder"},Object.assign(o.Config.prototype.filebrowser,{buttons:["filebrowser.home","filebrowser.previous","filebrowser.next","|","filebrowser.upload","filebrowser.new-folder","filebrowser.remove","filebrowser.update","filebrowser.select","filebrowser.edit","|","filebrowser.preview","about"],sort:!1,pixelOffsetLoadNewChunk:300,width:800,height:400,previewOfficeURL:"https://view.officeapps.live.com/op/view.aspx?src="}),(0,r.extendLang)(i)},95002:function(e,t,s){"use strict";s.d(t,{UIProgress:function(){return a}});var i=s(82749),o=s(31635),r=s(65478),n=s(23769);class a extends n.ProgressBar{className(){return"UIProgress"}onProgress(){this.state.progress?this.show():this.hide(),this.progress(this.state.progress)}hide(){return this.setMod("hidden",!0),this}progress(e){return this.container.style.width=e.toFixed(2)+"%",e>=98&&this.j.async.setTimeout(()=>{this.hide()},{label:"progress",timeout:300}),this}show(){return this.setMod("hidden",!1),this}constructor(e,t){super(e),(0,i._)(this,"state",void 0),this.state=t,this.onProgress()}}(0,o.__decorate)([(0,r.watch)("state.progress")],a.prototype,"onProgress",null),a=(0,o.__decorate)([r.component],a)},96910:function(e){e.exports='<svg viewBox="0 0 252 252" xmlns="http://www.w3.org/2000/svg"> <path d="M0 16C0 7.16344 7.16344 0 16 0H85.6364C86.5205 0 87.3797 0.29288 88.0796 0.832871L120.92 26.1671C121.62 26.7071 122.48 27 123.364 27H227C235.837 27 243 34.1634 243 43V132.335C243 134.779 240.234 136.198 238.25 134.772L233 131L226.5 127L220 124L212.5 122L202.5 120L189 120.5L179.5 122.5L170.5 125.5L161.5 130.5L157 133.5L153 137L146.5 144L141 152L137 160L134 168L132.5 178L132 183.5V189.5L133 197.5L135 205.5L137.5 211.5L139.524 214.996C141.068 217.663 139.144 221 136.062 221H16C7.16344 221 0 213.837 0 205V16Z"/> <circle cx="197" cy="185" r="56"/> <path d="M188.364 215.955V151.591H204.636V215.955H188.364ZM164.318 191.909V175.636H228.682V191.909H164.318Z" fill="white"/> </svg>'},97068:function(e,t,s){"use strict";s.r(t),s.d(t,{finder:function(){return a}});var i=s(82749);s(77894);var o=s(5422),r=s(50911),n=s(2692);class a extends r.Plugin{afterInit(e){e.e.on("getInstanceFileBrowser",e=>(this.__instance||(this.__instance=new o.FileBrowserPro(e)),this.__instance))}beforeDestruct(e){e.e.off("getInstanceFileBrowser"),this.__instance?.destruct()}constructor(...e){super(...e),(0,i._)(this,"hasStyle",!n.JoditPro.fatMode),(0,i._)(this,"__instance",void 0)}}(0,i._)(a,"requires",["license"]),n.JoditPro.plugins.add("finder",a)},97770:funct