PageSourceSearch

https://diariodecuba.net/cp/javascript/views/smb/file-manager/list.js?046b8f7ce71f153dd162

js diariodecuba.net collected 2026-10-03 22:36:50 UTC 126,384 bytes, 2 lines download raw bytes

1"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["views/smb/file-manager/list"],{1833(e,t,s){s.r(t),s.d(t,{default:()=>n});class i extends Ajax.Request{constructor(e,t){super(e,t),t.onProgress&&(this.onProgress=t.onProgress)}request(e){this.transport.upload.onprogress=(...e)=>this.onProgress&&this.onProgress(...e),super.request(e)}setRequestHeaders(){}}const n=i},1858(e,t,s){s.r(t),s.d(t,{default:()=>o});var i=s(1859);class n extends i.default{}const o=n},1859(e,t,s){s.r(t),s.d(t,{default:()=>a});var i=s(95),n=s(1829);class o extends n.default{_initConfiguration(e){super._initConfiguration(e),this._treeConfig=this._getConfigParam("tree"),this._cls="popup-panel popup-form-vertical"}render(){super.render(),(0,i.render)(document.getElementById(this._contentAreaId),`<form method="post" action="" enctype="application/x-www-form-urlencoded" id="${this._id}-form"><div class="form-box"><div class="box-area"><div class="content"><div class="content-area"><div class="form-row"><div class="field-name">${this.lmsg("destinationFolderHint")}</div><div class="field-value"><div class="scrollable fm-scrollable"><div class="scrollable-wrap"><div id="fm-modal-dialog-box-files-tree" class="tree"></div></div></div></div></div><div class="form-row"><div class="single-row"><div class="indent-box"><input type="checkbox" class="checkbox" value="1" id="${this._id}-overwrite"/><div class="indent-box-content"><label for="${this._id}-overwrite">${this.lmsg("overwriteExisting")}</label></div></div></div></div></div></div></div></div></form>`);const e={...this._treeConfig,onNodeClick:this.onTreeNodeClick.bind(this),showMessage:this.showMessage.bind(this)};this._tree=new i.FileManager.Tree(e),this.initOnSubmitEvent(),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("ok"),this.onSubmit,!0,!0),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("cancel"),this.hide,!1,!1),this.reset()}onTreeNodeClick(e){this.setDestinationDir(e)}onTreeRootNodeClick(){this.setDestinationDir("/")}reset(){this._selectedItems=(0,i.getComponent)("fm-content").getSelectedItems(),this._destinationDir="",this._tree.reload(),document.getElementById(`${this._id}-overwrite`).checked=!1,this.initSelectionHint(),this._clearMessages(),super.reset()}onSubmit(){if(""==this._destinationDir)return void this.showMessage("error",this.lmsg("destinationRequired"));this.hide();const e=document.getElementById(`${this._id}-overwrite`).checked;(0,i.getComponent)("fm-content").execGroupOperation({url:this.getHandlerUrl(`destinationDir=${this._destinationDir}&overwrite=${e}`),skipConfirmation:!0,onSuccess:this.onSuccess.bind(this)})}showMessage(e,t){this._clearMessages(),this._addErrorMessage(t)}setDestinationDir(e){this._destinationDir=e}onSuccess(){(0,i.getComponent)("fm-content").enable(),(0,i.getComponent)("fm-tree").reloadPath((0,i.getComponent)("fm-content").getCurrentDir()),(0,i.getComponent)("fm-tree").reloadPath(this._destinationDir)}}const a=o},1860(e,t,s){s.r(t),s.d(t,{default:()=>a});var i=s(95),n=s(1829);class o extends n.default{render(){super.render(),(0,i.render)(document.getElementById(this._contentAreaId),`<form method="post" action="" enctype="application/x-www-form-urlencoded" id="${this._id}-form"><div><div class="form-row"><div class="field-name"><label for="${this._id}-archive-name">${this.lmsg("archiveName")}</label></div><div class="field-value"><input name="archiveName" id="${this._id}-archive-name" value="" class="f-middle-size input-text" type="text">.zip<span class="field-errors" style="display: none;"></span></div></div></div></form>`),this.initOnSubmitEvent(),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("ok"),this.onSubmit,!0,!0),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("cancel"),this.hide,!1,!1),this.reset()}reset(){this.setHint(this.lmsg("hint",{folder:`<b>${(0,i.escapeHtml)((0,i.getComponent)("fm-content").getCurrentDir())}</b>`})+(0,i.getComponent)("fm-content").getReadonlyHint()),this._clearMessages(),document.getElementById(`${this._id}-archive-name`).value="",super.reset();try{document.getElementById(`${this._id}-archive-name`).focus()}catch{}}onSubmit(){const e=document.getElementById(`${this._id}-archive-name`).value,t={url:this.getHandlerUrl(`destinationDir=${this._destinationDir}`),skipConfirmation:!0,toJsonPayload:!0};
1t.submitHandler=(t,s)=>{s.archiveName=e,this.onOkHandlerCreate(),i.api.post(this.getHandlerUrl(),s).then(t=>this.onOkHandlerSuccess(t,e)).catch(e=>this.onOkHandlerException(null,e)).finally(()=>this.onOkHandlerComplete())},(0,i.getComponent)("fm-content").execGroupOperation(t)}onOkHandlerSuccess(e,t){if(this._clearMessages(),"success"===e.status){(0,i.getComponent)("fm-content").reload();const s=e.message.replace("%%archive%%",`${(0,i.escapeHtml)(t)}.zip`);(0,i.addStatusMessage)("info",s),this.hide()}else this._addErrorMessage(e.message)}}const a=o},1861(e,t,s){s.r(t),s.d(t,{default:()=>a});var i=s(95),n=s(1829);class o extends n.default{render(){super.render(),(0,i.render)(document.getElementById(this._contentAreaId),`<form method="post" action="" enctype="application/x-www-form-urlencoded" id="${this._id}-form"><div><div class="form-row"><div class="field-name"><label for="${this._id}-file-name">${this.lmsg("fileName")}</label></div><div class="field-value"><input name="fileName" id="${this._id}-file-name" value="" class="f-middle-size input-text" type="text"><span class="field-errors" style="display: none;"></span></div></div><div class="form-row"><div class="single-row"><div class="indent-box"><input type="checkbox" class="checkbox" value="1" id="${this._id}-html-template"/><div class="indent-box-content"><label for="${this._id}-html-template">${this.lmsg("htmlTemplate")}</label><span class="hint">${this.lmsg("htmlTemplateHint")}</span></div></div></div></div></div></form>`),this.initOnSubmitEvent(),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("ok"),this.onSubmit,!0,!0),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("cancel"),this.hide,!1,!1),this.reset()}reset(){this.setHint(this.lmsg("hint",{folder:`<b>${(0,i.escapeHtml)((0,i.getComponent)("fm-content").getCurrentDir())}</b>`})+(0,i.getComponent)("fm-content").getReadonlyHint()),this._clearMessages(),document.getElementById(`${this._id}-file-name`).value="",document.getElementById(`${this._id}-html-template`).checked=!1,super.reset();try{document.getElementById(`${this._id}-file-name`).focus()}catch{}}onSubmit(){const e=document.getElementById(`${this._id}-file-name`).value,t=document.getElementById(`${this._id}-html-template`).checked;this.onOkHandlerCreate(),i.api.post(this.getHandlerUrl(),{newFileName:e,htmlTemplate:t}).then(t=>this.onOkHandlerSuccess(t,e)).catch(e=>this.onOkHandlerException(null,e)).finally(()=>this.onOkHandlerComplete())}onOkHandlerSuccess(e,t){if(this._clearMessages(),"success"===e.status){(0,i.getComponent)("fm-content").reload();const s=e.message.replace("%%file%%",(0,i.escapeHtml)(t));(0,i.addStatusMessage)("info",s),this.hide()}else this._addErrorMessage(e.message)}}const a=o},1862(e,t,s){s.r(t),s.d(t,{default:()=>a});var i=s(95),n=s(1829);class o extends n.default{render(){super.render(),(0,i.render)(document.getElementById(this._contentAreaId),`<form method="post" action="" enctype="application/x-www-form-urlencoded" id="${this._id}-form"><div><div class="form-row"><div class="field-name"><label for="${this._id}-folder-name">${this.lmsg("folderName")}</label></div><div class="field-value"><input name="folderName" id="${this._id}-folder-name" value="" class="f-middle-size input-text" type="text"><span class="field-errors" style="display: none;"></span></div></div></div></form>`),this.initOnSubmitEvent(),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("ok"),this.onSubmit,!0,!0),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("cancel"),this.hide,!1,!1),this.reset()}reset(){this.setHint(this.lmsg("hint",{folder:`<b>${(0,i.escapeHtml)((0,i.getComponent)("fm-content").getCurrentDir())}</b>`})+(0,i.getComponent)("fm-content").getReadonlyHint()),this._clearMessages(),document.getElementById(`${this._id}-folder-name`).value="",super.reset();try{document.getElementById(`${this._id}-folder-name`).focus()}catch{}}onSubmit(){const e=document.getElementById(`${this._id}-folder-name`).value;this.onOkHandlerCreate(),i.api.post(this.getHandlerUrl(),{newDirectoryName:e}).then(t=>this.onOkHandlerSuccess(t,e)).catch(e=>this.onOkHandlerException(null,e)).finally(()=>this.onOkHandlerComplete())}onOkHandlerSuccess(e,t){if(this._clearMessages(),"SUCCESS"===e.status){(0,i.getComponent)("fm-content").reload(),(0,i.getComponent)("fm-tree").reloadPath((0,i.getComponent)("fm-content").getCurrentDir());const s=e.message.replace("%%folder%%",`<a href="#" id="${this._id}-success-message-link">${(0,i.escapeHtml)(t)}</a>`);(0,i.addStatusMessage)("info",s),document.getElementById(`${this._id}-success-message-link`)?.addEventListener("click",e=>{e.preventDefault(),(0,i.getComponent)("fm-content").changeDirectory(t)}),this.hide()}else this._addErrorMessage(e.message)}}const a=o},1830(e,t,s){s.r(t),s.d(t,{default:()=>a});var i=s(95),n=s(1831);
1class o extends n.default{_initConfiguration(e){super._initConfiguration(e),this._cls=this._getConfigParam("cls","popup-panel"),this._titleCls=this._getConfigParam("titleCls","pp-error"),this._errorMessage=this._getConfigParam("errorMessage",""),this._message=this._getConfigParam("message",null),this._items=this._getConfigParam("items",[])}render(){super.render(),this.setTitle(this.lmsg("errorDialogTitle")),this._addErrorMessage(this._errorMessage),this._message&&this.setHint1(this._message),this._items.forEach(e=>{this.addItem(e)}),this.addRightButton(this.lmsg("buttonClose"),this.onClose.bind(this),!0,!0),this.resizeList()}onClose(){this.hide()}addItem(e){this._itemClass="odd"===this._itemClass?"even":"odd";let t="",s="";switch(e.status){case"SUCCESS":t="ok",s=this.lmsg("statusCompleted");break;case"ERROR":t="failed",s=this.lmsg("statusFailed");break;default:t="not-started",s=this.lmsg("statusNotStarted")}const n=`<span class="hint-${t}">${s}</span>`;(0,i.render)(document.getElementById(this._itemsAreaId),`<tr class="${this._itemClass}"><td class="first"><span class="type-${(0,i.escapeHtml)(e.type)}">${(0,i.escapeHtml)(e.name)}</span></td><td class="last">${n}</td></tr>`)}}const a=o},1823(e,t,s){s.r(t),s.d(t,{default:()=>g});var i=s(1824),n=s.n(i),o=s(95),a=s(507),l=s(1825),r=s(1826),d=s(1827),c=s(1834),u=s(1835),h=s(672),m=s(1836);class p extends o.List{render(){if(!this._renderTarget)return;const e=[...this._componentElement.childNodes];(0,o.render)(this._componentElement,`<div id="${this._id}-content"></div>`),(0,o.render)(this._renderTarget,this._componentElement),this._componentElement=this._componentElement.querySelector(`#${this._id}-content`),(0,o.render)(this._componentElement,e),r.default.isAdvancedUploadSupported()&&(this._dropArea=new o.DropArea({locale:{dragAndDropArea:this.lmsg("dragAndDropArea")},onDrop:e=>{this.showPopup(d.default,{files:e,...this._uploadPopupParams})}}),this._dropArea.render()),this._renderTarget=null,setTimeout(()=>super.render())}_addResizeHandler(){}_addEvents(){super._addEvents(),window.addEventListener("resize",l.default,!1),this.debouncedResizeBlocks=n()(()=>(0,l.default)(),100),this.contentResizeObserver=new ResizeObserver(this.debouncedResizeBlocks),this.contentResizeObserver.observe(document.getElementById("main"))}remove(){super.remove(),window.removeEventListener("resize",l.default),this.contentResizeObserver.unobserve(document.getElementById("main")),this.debouncedResizeBlocks.cancel()}_registerComponent(){super._registerComponent(),(0,o.registerComponent)("fm-content",this)}_getActionBoxElement(){return document.getElementById("fm-actions-box")}addContentTableClickHandler(){this._componentElement.querySelector(`#${this._tableId}`).addEventListener("click",e=>{const t=e.target.closest("[data-dir]");if(t){const s=this.getItemByName(t.dataset.dir);return s.isUtf8?s.has4ByteChar?(e.preventDefault(),void(0,o.addStatusMessage)("error",this.lmsg("non4ByteChar"))):void this.changeDirectory(t.dataset.dir):(e.preventDefault(),void(0,o.addStatusMessage)("error",this.lmsg("nonUTF8")))}const s=e.target.closest("[data-file]");if(s){const t=this.getItemById(s.dataset.file);if(!t.isUtf8)return e.preventDefault(),void(0,o.addStatusMessage)("error",this.lmsg("nonUTF8"));if(t.has4ByteChar)return e.preventDefault(),void(0,o.addStatusMessage)("error",this.lmsg("non4ByteChar"));this.callDefaultItemAction(s.dataset.file)}})}changeDirectory(e,t){this.resetSearch(),e=t?e:`${this._state.currentDir}/${e}`,this.reload(`?currentDir=${encodeURIComponent(e)}`)}getCurrentDir(){return this._state.currentDir}isTrashEnabled(){return this._state.trashEnabled}getReadonlyHint(){return this._state.currentDirReadonly?`<div class="error-hint">${this._pathbar.locale.readonlyHint}</div>`:""}getUploadMaxFileSize(){return this._state.uploadMaxFileSize}async showPopup(e,{id:t,...s}){const i=this._getConfigParam("domainId");s={locale:await o.Locale.loadSection(`smb.controllers.file-manager.${t.replace("fm-","")}`),id:t,attrs:{"domain-id":i},...s};const n=(0,o.getComponent)(t);n&&i===n.getAttribute("domain-id")?n.reset(s):new e(s)}calculateSize(e){const t={url:e,skipConfirmation:!0,toJsonPayload:!0};t.submitHandler=(e,t)=>{this.disable(),o.api.post(e,t).then(e=>{this._componentElement.querySelector(`#${this._tableId}`).querySelectorAll("tr.selected").forEach(t=>{const s=t.querySelector("td.js-file-name a span");if(!s)return;const i=s.firstChild.nodeValue;i in e.fileSizes&&(t.querySelector("td.js-file-size").innerHTML=e.fileSizes[i])}),(0,o.clearStatusMessages)(),e.statusMessages?.forEach(({status:e,content:t})=>{(0,o.addStatusMessage)(e,t)})}).finally(()=>this.enable())},this.execGroupOperation(t)}deleteFile(e){const t=this.getSelectedItems();let s=!1;this.execGroupOperation({subtype:o.messageBox.SUBTYPE_DELETE,needAttention:this.isTrashEnabled(),needAttentionText:this.getLocale().formatMessage("deleteWithForce",{name:`<b>${(0,o.escapeHtml)(t[0]?.name)}
1</b>`,count:t.length}),needAttentionBlockSubmit:!1,needAttentionOnChange:e=>{s=e},beforeSendRequest:(e,t)=>{t.force=s?"yes":"no",e()},onSuccess:()=>{this.enable(),this._tree.reloadPath(this.isTrashEnabled()&&!s?"/":this.getCurrentDir())},...e})}purgeFile(e){this.execGroupOperation({subtype:o.messageBox.SUBTYPE_DELETE,onSuccess:()=>{this.enable(),this._tree.reloadPath(this.getCurrentDir())},...e})}purgeAll(e){this.execGroupOperation({subtype:o.messageBox.SUBTYPE_DELETE,onSuccess:()=>{this.enable(),this._tree.reloadPath("/")},...e})}processReloadError({status:e,message:t}){e?((0,o.clearStatusMessages)(),(0,o.addStatusMessage)(e,t)):(0,o.showInternalError)("Unable to load list data.")}_initConfiguration({directoriesTree:e,itemActions:t,locale:s=o.Locale.getSection("smb.components.lists.contentfiles"),...i}){const n=e=>t=>{const s={...this.getFileParams(t.name),mode:e,type:t.type};t.line&&(s.line=t.line);const n=new URLSearchParams(window.location.search);e===h.MODE_CODE&&i.isCodeEditorFullPageEnabled?(n.set("currentDir",this.getCurrentDir()),n.set("file",t.name),this._searchValue&&n.set("search",this._searchValue),this._getConfigParam("navigate")(`/smb/file-manager/code-editor/domainId/${this._getConfigParam("domainId")}?${n}`)):(n.set("modals[editor]",(0,m.btoaUnicode)(JSON.stringify(s))),this._getConfigParam("navigate")(`${window.location.pathname}?${n}`))};super._initConfiguration({id:"fm",locale:s,pageable:!1,fileManagerUrl:"/smb/file-manager/",isDisabledItem:({isSystem:e})=>e,itemActions:{...t,rename:e=>{this.showPopup(c.default,{id:"fm-rename",renderTo:"fm-modal-dialog-box-rename",cls:"popup-panel",handlerUrl:this.getFileManagerUrl("rename"),itemId:e.id,fileName:e.name})},extractArchive:e=>{this.showPopup(u.default,{id:"fm-extract-archive",renderTo:"fm-modal-dialog-box-extract-archive",cls:"popup-panel",handlerUrl:this.getFileManagerUrl("extract-archive"),titleCls:"pp-archive-extract",fileName:e.id})},download:({name:e})=>{(0,o.redirect)((0,o.addUrlParams)(this.getFileManagerUrl("download"),{...this.getFileParams(e)}))},permissions:e=>{const t={...this.getFileParams(e.name),isDirectory:e.isDirectory,icon:(0,h.getTypeIcon)(e)},s=new URLSearchParams(window.location.search);s.set("modals[permissions]",(0,m.btoaUnicode)(JSON.stringify(t))),this._getConfigParam("navigate")(`${window.location.pathname}?${s}`)},imageView:e=>{const t=this._data.filter(({type:e})=>e===h.FTYPE_IMAGE||e===h.FTYPE_VECTOR_IMAGE),s=t.map(({name:e})=>`<img class="slider__image" src="${(0,o.addUrlParams)(this.getFileManagerUrl("show-image"),{file:e})}" alt="${(0,o.escapeAttribute)(e)}" /><div class="slider__content">${(0,o.escapeHtml)(e)}</div>`);new o.PopupSlider({title:this.lmsg("imageViewer"),slides:s,current:t.indexOf(e)})},view:n(h.MODE_SHOW),textEdit:n(h.MODE_EDIT),textCodeEditor:n(h.MODE_CODE),htmlEditor:n(h.MODE_HTML)},...i}),this._additionalColumns=this._getConfigParam("additionalColumns",!1),this._dataUrl=this.getFileManagerUrl("list-data"),this._copyMoveTreeConfig={applyTo:"fm-modal-dialog-box-files-tree",data:e,dataUrl:this.getFileManagerUrl("tree-data"),rootNodeTitle:this.lmsg("rootDirectory"),waitMessage:this.lmsg("waitMessage")},this._uploadPopupParams={id:"fm-upload",renderTo:"fm-modal-dialog-box-upload",cls:"popup-panel",handlerUrl:this.getFileManagerUrl("upload"),titleCls:"pp-upload",onOpenReplaceExistingFilesDialog:this._getConfigParam("onOpenReplaceExistingFilesDialog"),onChangeUploadProgress:this._getConfigParam("onChangeUploadProgress"),onCancel:this._getConfigParam("onCancelUpload"),onClose:this._getConfigParam("onCloseUpload")},this._tree=this._getConfigParam("tree")}redraw(){super.redraw(),this._getConfigParam("onListStateChange")(this._state),this._getConfigParam("onPathbarChange")(this._pathbar),this._tree.setDirectory(this.getCurrentDir()),(0,o.render)(document.querySelector(".objects-list .objects-content-area"),this._tree,"inner"),!this._dropArea||this._state.currentDirReadonly||this._searchValue||(0,o.render)(document.getElementById("objects-details"),this._dropArea._componentElement),(0,l.default)(),this.addContentTableClickHandler()}recreate(e){this._initConfiguration(e),this.redraw()}_isColumnSelectionPresent(){return!this._searchValue}containerView(){const e=super.containerView(),t=e.children.splice(2);return e.children.push((0,o.createElement)(".objects-content",(0,o.createElement)(`#${this._id}-objects-content-area.objects-content-area`,t))),e}_getActionBox(){return null}callDefaultItemAction(e){const t=this.getItemById(e),s=t.actions.find(e=>e.default)||{name:"view"};s.href&&(0,o.redirect)(s.href),this._itemActions[s.name]&&this._itemActions[s.name](t,s)}disable(){if(!this._componentElement.querySelector(".objects-content"))return;this._componentElement.querySelector(".objects-content").style.display="none";const e=document.getElementById(`${this._id}-loading-container`);e?e.style.display="":(0,o.render)(this._componentElement,`<div class="ajax-loading" id="${this._id}-loading-container">${this.lmsg("loadingTitle")}</div>`),this._getConfigParam("onDisable")()}enable(){const e=document.getElementById(`${this._id}-loading-container`);e&&(e.style.display="none"),this._componentElement.querySelector(".objects-content").style.display="",this._getConfigParam("onEnable")()}_onReloadComplete(){super._onReloadComplete(),(0,l.default)()}_addResponsiveHtml(){}_addPathbar(){}_getPathbarHtml(){return""}_getColumns(){const e=[];return this._searchValue||e.push({...o.list.COLUMN_SELECTION,cls:"select first",headerCls:"select first",hideDisabled:!0}),e.push({header:this.lmsg("name"),dataIndex:"name",cls:"js-file-name fm-file-name",renderer(e){const t=`<i class="icon"><img src="${(0,h.getTypeIcon)(e)}" alt="" aria-hidden="true"></i> `,s=e.line?`:${e.line}`:"";return`${`<a class="i-link fm-file-name-link" ${e.isDirectory?`data-dir="${(0,o.escapeAttribute)(e.name)}"`:`data-file="${(0,o.escapeAttribute)(e.id)}"`}>`}${t}<span>${(0,o.escapeHtml)(e.name)}${s}</span></a>`},sortable:!this._searchValue},{header:this.lmsg("changeDate"),dataIndex:"modificationDate",cls:"minor number",sortable:!this._searchValue},{header:this.lmsg("size"),dataIndex:"formatedSize",cls:"t-r number js-file-size ",headerCls:this._additionalColumns?"":"last",sortable:!this._searchValue}),this._additionalColumns&&e.push({header:this.lmsg("permissions"),dataIndex:"filePerms",cls:"nowrap",renderer(e){return this.getItemActions(e).some(e=>"permissions"===e.name)?(0,o.createElement)("a",{onclick:()=>this._itemActions.permissions(e)},e.filePerms):e.filePerms},isVisible:()=>!a.default.get("fm-hidden-permissions-column"),sortable:!this._searchValue},{header:this.lmsg("user"),dataIndex:"user",cls:"fm-user-cell",isVisible:()=>!a.default.get("fm-hidden-user-column"),sortable:!this._searchValue},{header:this.lmsg("group"),dataIndex:"group",cls:"last fm-group-cell",headerCls:"last",isVisible:()=>!a.default.get("fm-hidden-group-column"),sortable:!this._searchValue}),e.push(o.list.COLUMN_ACTIONS),e}getFileManagerUrl(e){return`${this._getConfigParam("fileManagerUrl")}${e}/domainId/${this._getConfigParam("domainId")}/`}getRedirectActionUrl(e,{name:t,line:s}){return(0,o.addUrlParams)(this.getFileManagerUrl(e),{...this.getFileParam
1s(t),line:s})}getFileParams(e){let t=this.getCurrentDir();"/"!==t&&(t+="/");const s=e.lastIndexOf("/");return-1!==s&&(t+=e.slice(0,s),e=e.slice(s+1)),{currentDir:t,file:e}}onListGlobalCheckboxClick(){super.onListGlobalCheckboxClick();const e=this._getActionBoxElement().querySelector('.r-actions input[type="checkbox"]'),t=this._componentElement.querySelector('input[name="listGlobalCheckbox"]');e.checked=t.checked}resetSearch(){this._handleSearchLoadingChange(!1),this._searchValue="",this._getConfigParam("onResetSearch")(),this._searchRequest&&(this._searchRequest.abort(),this._searchRequest=null),(0,o.clearStatusMessages)()}search(e,t){o.UAT.dispatchAction("FM_SEARCH",{mode:t}),this.resetSearch(),this._searchValue=e,this._data=[],this.redraw();const s=(0,o.addUrlParams)(this.getFileManagerUrl("search-data"),{q:e,currentDir:this.getCurrentDir(),mode:t}),i=new XMLHttpRequest;this._searchRequest=i;let n=0;const a=[];let l=0;const r=()=>{this.redrawPartial("after",a.length-l),l=a.length};let d;this._handleSearchLoadingChange(!0);i.onprogress=()=>{(e=>{e.split("\n").forEach(e=>{try{const t=JSON.parse(e);if(t.id){const{line:e}=t;e&&(t.id+=`:${e}`),a.push(t)}else t.status&&"success"!==t.status&&t.message&&(d=t.message)}catch{}})})(i.responseText.slice(n)),n=i.responseText.length,this._data=a,r()},i.onload=()=>{switch(i.status){case 200:break;case 504:(0,o.clearStatusMessages)(),(0,o.addStatusMessage)("warning",this.lmsg("searchErrorTimeout"));break;default:(0,o.showInternalError)(this.lmsg("searchError"))}this._handleSearchLoadingChange(!1),d&&((0,o.clearStatusMessages)(),(0,o.addStatusMessage)("warning",(0,o.escapeHtml)(d)))},i.onerror=e=>{throw this._handleSearchLoadingChange(!1),(0,o.showInternalError)(this.lmsg("searchError")),e},i.open("GET",s),i.send()}_handleSearchLoadingChange(e){e?this.disable():this.enable(),this._getConfigParam("onSearchLoadingChange")(e)}}const g=p},1835(e,t,s){s.r(t),s.d(t,{default:()=>a});var i=s(95),n=s(1829);class o extends n.default{render(){super.render(),(0,i.render)(document.getElementById(this._contentAreaId),`<form method="post" action="" enctype="application/x-www-form-urlencoded" id="${this._id}-form"><div><div class="form-row"><div class="field-name"><label for="${this._id}-destination-folder">${this.lmsg("destinationFolderHint")}</label></div><div class="field-value"><div class="text-value"><span id="${this._id}-destination-folder"></span></div></div></div><div class="form-row"><div class="single-row"><div class="indent-box"><input type="checkbox" class="checkbox" value="1" id="${this._id}-overwrite"/><div class="indent-box-content"><label for="${this._id}-overwrite">${this.lmsg("overwriteExisting")}</label></div></div></div></div></div></form>`),this.initOnSubmitEvent(),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("ok"),this.onSubmit,!0,!0),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("cancel"),this.hide,!1,!1),this.reset(this._config)}reset(e){e.fileName?(this._fileName=e.fileName,this._selectedItems=[(0,i.getComponent)("fm-content").getItemById(this._fileName)]):(this._fileName="",this._selectedItems=(0,i.getComponent)("fm-content").getSelectedItems()),document.getElementById(`${this._id}-overwrite`).checked=!1,this.initSelectionHint(),document.getElementById(`${this._id}-destination-folder`).innerHTML=(0,i.escapeHtml)((0,i.getComponent)("fm-content").getCurrentDir());let t=(0,i.getComponent)("fm-content").getReadonlyHint();t?(t=`<span class="field-errors">${t}</span>`,(0,i.render)(document.getElementById(`${this._id}-destination-folder`),t,"after")):(t=document.getElementById(`${this._id}-destination-folder`).parentNode.querySelector(".field-errors"),t&&t.parentNode.removeChild(t)),this._clearMessages(),super.reset()}onSubmit(){this.hide();const e=document.getElementById(`${this._id}-overwrite`).checked,t={url:this.getHandlerUrl(`overwrite=${e}`),skipConfirmation:!0};this._fileName?(t.ids=this._fileName,this.onOkHandlerCreate(),i.api.post(t.url,t).then(e=>this.onOkHandlerSuccess(e)).catch(e=>this.onOkHandlerException(null,e)).finally(()=>this.onOkHandlerComplete())):(t.onSuccess=this.onGroupExtractSuccess,(0,i.getComponent)("fm-content").execGroupOperation(t))}onGroupExtractSuccess(){(0,i.getComponent)("fm-content").enable(),(0,i.getComponent)("fm-tree").reloadPath((0,i.getComponent)("fm-content").getCurrentDir())}onOkHandlerSuccess(e){this._clearMessages();const t=e.statusMessages[0];"info"===t.status?((0,i.getComponent)("fm-content").reload(),(0,i.getComponent)("fm-tree").reloadPath((0,i.getComponent)("fm-content").getCurrentDir()),(0,i.addStatusMessage)("info",t.content),this.hide()):(0,i.addStatusMessage)("error",t.content)}}const a=o},1831(e,t,s){s.r(t),s.d(t,{default:()=>o});var i=s(95);
1class n extends i.PopupForm{_initConfiguration(e){super._initConfiguration(e),this._itemsAreaId=`${this._id}-items`}_addEvents(){super._addEvents(),window.addEventListener("resize",this.resizeList.bind(this),!1)}_renderContentArea(){(0,i.render)(document.getElementById(this._contentAreaId),`<div class="list"><table width="100%" cellspacing="0"><tbody id="${this._itemsAreaId}"></tbody></table></div>`)}render(){super.render(),this._renderContentArea(),document.getElementById(this._actionButtonsId).classList.add("no-separator")}}const o=n},1863(e,t,s){s.r(t),s.d(t,{default:()=>h});var i=s(397),n=s(95),o=s(1826),a=s(1828),l=s(1827),r=s(787),d=s.n(r),c=s(396);const u=({fileInputId:e="file-upload-input",uploadPopupParams:t={},onClick:s=n.emptyFn,children:r,disabled:d=!1,...u})=>(0,c.jsxs)(i.MenuItem,{...u,disabled:d,style:{position:"relative",overflow:"hidden"},onClick:o.default.isAdvancedUploadSupported()?null:()=>{s(),(0,n.getComponent)("fm-content").showPopup(a.default,t)},children:[r,!d&&o.default.isAdvancedUploadSupported()?(0,c.jsx)("input",{type:"file",name:"file[]",id:e,multiple:!0,tabIndex:-1,onChange:e=>{s(),(0,n.getComponent)("fm-content").showPopup(l.default,{files:e.target.files,...t})},style:{position:"absolute",top:0,left:0,cursor:"pointer",opacity:0,width:"100%",height:"100%",marginTop:"-28px",paddingBottom:"28px",boxSizing:"content-box"}}):null]});u.propTypes={disabled:d().bool,fileInputId:d().string,uploadPopupParams:d().object,onClick:d().func,children:d().any};const h=u},1864(e,t,s){s.r(t),s.d(t,{default:()=>o});var i=s(1859);class n extends i.default{}const o=n},1827(e,t,s){s.r(t),s.d(t,{default:()=>l});var i=s(95),n=s(1828),o=s(1832);class a extends n.default{_initConfiguration(e){e.fileManagerUrl="/smb/file-manager/",super._initConfiguration(e),this._files=this._getConfigParam("files",null),this.resetFileInputElement=this._getConfigParam("resetFileInputElement",i.emptyFn),this._fileInputId=this._getConfigParam("fileInputId")}render(){this.onSubmit()}reset(e){e&&this._initConfiguration(e),this._uploadCanceled=!1,this.show(),this.onSubmit()}async onSubmit(){this._clearMessages(),await this.prepareUploadQueue(),this.startUploadQueue()}checkUploadQueue(){const e=super.checkUploadQueue();return e||this.hide(),e}_clearMessages(){(0,i.clearStatusMessages)()}_addErrorMessage(e){(0,i.addStatusMessage)("error",e)}async prepareUploadQueue(){this._uploadQueue=[],this._totalUploadedSize=0,this._totalSize=0,this._currentPaths=[];const e=this._files||document.getElementById(this._fileInputId).files;await Promise.all([...e].map(async(e,t)=>{let s=e;e.isFile&&(s=await this.getFile(e)),this.addUploadQueue(t,e.fullPath,s)}))}
1addUploadQueue(e,t,s){const i={progressId:`upload-progress-${e}`,status:"PENDING",type:"unknown",loaded:null};if(s.isDirectory)i.isDirectory=!0,i.fullPath=s.fullPath,i.total=0,i.savedFileName=s.fullPath,i.type="folder";else{const e=this.getFileSize(s);i.file=s,i.isFile=!0,i.savedFileName=s.name,i.total=e,i.fullPath=t?t.replace(s.name,""):null,this._totalSize+=e}this._uploadQueue.push(i)}getFile(e){return new Promise(t=>{e.file(t)})}getFileSize(e){return void 0!==e.fileSize?e.fileSize:e.size}processUploadItem(e){if("PENDING"===e.status){if(this._started=!0,this.updateUploadProgressItemStatus(e,"UPLOADING"),this._uploadCurrent=e,e.isDirectory){const t=this._handlerUrl.split("/").filter(e=>e).pop(),s=`${this._getConfigParam("fileManagerUrl")}create-directory/domainId/${t}/`;this._uploadAdapter.setHandlerUrl(s),this._uploadAdapter.upload(null,{newDirectoryName:e.fullPath,recursively:!0})}else this._uploadAdapter.setHandlerUrl(this.getHandlerUrl("recursively=1",e.fullPath)),this._uploadAdapter.upload(e.file);throw this.breakQueueException}}prepareUploadAdapter(){if(this._uploadAdapter)this._uploadAdapter.setHandlerUrl(this.getHandlerUrl());else{const e={handlerUrl:this.getHandlerUrl(),startUploadHandler:()=>{this._scheduleStartUpload&&(this._scheduleStartUpload=null,this.startNextQueueUpload())},finishUploadHandler:()=>{this.onNextQueueUploadFinished()},progressUploadHandler:e=>{this.onProgress(e)}};this._uploadAdapter=new o.default(e)}}close(){super.close(),this._files||this.resetFileInputElement(),this._files=null}onProgress(e){e.lengthComputable&&this._uploadCurrent&&(this._uploadCurrent.loaded=e.total>0?Math.round(e.loaded/e.total*this._uploadCurrent.total):0,this.renderUploadProgressDialog())}onNextQueueUploadFinished(){this._uploadCurrent&&(this._uploadCurrent.isDirectory||(this._uploadCurrent.loaded=this._uploadCurrent.total,this._totalUploadedSize+=this._uploadCurrent.total,this.renderUploadProgressDialog())),super.onNextQueueUploadFinished()}}const l=a},1829(e,t,s){s.r(t),s.d(t,{default:()=>o});var i=s(95);class n extends i.PopupForm{_initConfiguration(e){super._initConfiguration(e),this._handlerUrl=this._getConfigParam("handlerUrl","")}getHandlerUrl(e,t){let s=(0,i.getComponent)("fm-content").getCurrentDir();return t&&(s+="/"===s.charAt(0)?`${t}`:`/${t}`),s=s.replace("//","/"),(0,i.addUrlParams)(this._handlerUrl,`currentDir=${encodeURIComponent(s)}${e?`&${e}`:""}`)}render(){super.render(),this.setBoxType("form-box"),this.setTitle(this.lmsg("title"))}reset(){this.show()}onSubmitEvent(e){return this.onSubmit(),e.preventDefault(),!1}initOnSubmitEvent(){const e=document.getElementById(`${this._id}-form`);e._formSubmit=e.submit,e.submit=this.onSubmit.bind(this),e.addEventListener("submit",this.onSubmitEvent.bind(this))}disable(){document.getElementById(this._rightActionButtonsAreaId).querySelectorAll(".btn.action").forEach(e=>{this._okButtonTitle=e.innerHTML,e.innerHTML=`<span class="wait">${i.Locale.getSection("components.buttons").lmsg("wait")}</span>`}),document.getElementById(this._rightActionButtonsAreaId).querySelectorAll(".btn").forEach(e=>{e.disabled=!0,e.classList.add("disabled")})}enable(){document.getElementById(this._rightActionButtonsAreaId).querySelectorAll(".btn.action").forEach(e=>{e.innerHTML=this._okButtonTitle}),document.getElementById(this._rightActionButtonsAreaId).querySelectorAll(".btn").forEach(e=>{e.disabled=!1,e.classList.remove("disabled")})}initSelectionHint(){const e=this._selectedItems.length;1===e?this.setHint1(this.lmsg("hintFile",{file:`<b>${(0,i.escapeHtml)(this._selectedItems[0].name)}</b>`})):this.setHint1(this.lmsg("hintFiles",{number:e}))}onOkHandlerException(e,t){this._addErrorMessage(`Internal error: ${t}`)}onOkHandlerCreate(){this.disable()}onOkHandlerComplete(){this.enable()}}const o=n},1834(e,t,s){s.r(t),s.d(t,{default:()=>a});var i=s(95),n=s(1829);class o extends n.default{render(){super.render(),(0,i.render)(document.getElementById(this._contentAreaId),`<form method="post" action="" enctype="application/x-www-form-urlencoded" id="${this._id}-form"><div><div class="form-row"><div class="field-name"><label for="${this._id}-file-name">${this.lmsg("fileName")}</label></div><div class="field-value"><input name="newFileName" id="${this._id}-file-name" value="" class="f-middle-size input-text" type="text"><span class="field-errors" style="display: none;"></span></div></div></div></form>`),this.initOnSubmitEvent(),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("ok"),this.onSubmit,!0,!0),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("cancel"),this.hide,!1,!1),this.reset(this._config)}reset(e){this._itemId=e.itemId,this._fileName=e.fileName,this.setHint(this.lmsg("hint",{file:`<b>${(0,i.escapeHtml)(this._fileName)}</b>`})),this._clearMessages(),document.getElementById(`${this._id}-file-name`).value=this._fileName,super.reset();try{document.getElementById(`${this._id}-file-name`).focus()}catch{}}onSubmit(){const e=document.getElementById(`${this._id}-file-name`).value;this.onOkHandlerCreate(),i.api.post(this.getHandlerUrl(),{ids:this._itemId,newFileName:e}).then(e=>this.onOkHandlerSuccess(e)).catch(e=>this.onOkHandlerException(null,e)).finally(()=>this.onOkHandlerComplete())}onOkHandlerSuccess(e){this._clearMessages();const t=e.statusMessages[0];"info"===t.status?((0,i.getComponent)("fm-content").reload(),(0,i.getComponent)("fm-tree").reloadPath((0,i.getComponent)("fm-content").getCurrentDir()),(0,i.addStatusMessage)("info",t.content),this.hide()):this._addErrorMessage(t.content)}}const a=o},1828(e,t,s){s.r(t),s.d(t,{default:()=>r});var i=s(99),n=s(95),o=s(1829),a=s(1830);class l extends o.default{constructor(...e){super(...e),(0,i.default)(this,"breakQueueException",new Error("UploadQueue break"))}_initConfiguration(e){super._initConfiguration(e),this._selectFilesDialogId=`${this._id}-select-files-dialog`,this._selectFilesDialogItemsAreaId=`${this._selectFilesDialogId}-items`}render(){super.render(),this.setHint(this.lmsg("hint")+(0,n.getComponent)("fm-content").getReadonlyHint()),(0,n.render)(document.getElementById(this._contentAreaId),`<div id="${this._selectFilesDialogId}"><div id="${this._selectFilesDialogItemsAreaId}"></div><div class="form-row"><div class="single-row"><a href="#" class="s-btn sb-item-add"><i><i><i><span>${this.lmsg("addFileItem")}</span></i></i></i></a></div></div></div>`),this.addSelectFilesItem(),document.getElementById(this._selectFilesDialogId).querySelectorAll(".sb-item-add").forEach(e
1=>{e.addEventListener("click",e=>{this.onAddSelectFilesItemClick(e)})}),this.addRightButton(n.Locale.getSection("components.buttons").lmsg("ok"),this.onSubmit,!1,!1),this.addRightButton(n.Locale.getSection("components.buttons").lmsg("cancel"),this.onCancel,!1,!1)}reset(){this._clearMessages(),document.getElementById(this._selectFilesDialogItemsAreaId).innerHTML="",this._uploadCanceled=!1,super.reset()}onSubmit(){this._clearMessages(),this.prepareUploadQueue(),this.startUploadQueue()}startUploadQueue(){if(this.checkUploadQueue()&&!this.hasExistingDirectories()){if(this.hasExistingFilesUploadQueue())return this.hide(),void this._getConfigParam("onOpenReplaceExistingFilesDialog")({items:this._uploadExistingFilesQueue,onSkipClick:this.onSkipExistingFilesClick.bind(this),onReplaceClick:this.onReplaceExistingFilesClick.bind(this)});this.showUploadProgressDialog(),this.startNextQueueUpload()}}onCancel(){this.hide()}onAddSelectFilesItemClick(e){this.addSelectFilesItem(),e.preventDefault(),e.stopPropagation()}addSelectFilesItem(){const e=document.getElementById(this._selectFilesDialogItemsAreaId),t=e.querySelectorAll("form").length,s=`${this._selectFilesDialogId}-item-${t}`,i=`<form id="${s}" action="${this.getHandlerUrl()}" method="post" enctype="multipart/form-data" target="_uploadIFrame"><input name="forgery_protection_token" type="hidden" value="${document.getElementById("forgery_protection_token").content}"/><div class="form-row"><input name="file[]" type="file"/>`+(t?` <a href="#" class="s-btn sb-item-remove"><i><i><i><span> ${n.Locale.getSection("components.buttons").lmsg("remove")}</span></i></i></i></a>`:"")+"</div></form>";(0,n.render)(e,i),t&&document.getElementById(s).querySelectorAll(".sb-item-remove").forEach(e=>{e.addEventListener("click",e=>{this.onRemoveSelectFilesItemClick(e)})})}onRemoveSelectFilesItemClick(e){const t=e.target.closest("form");t&&t.parentNode.removeChild(t),e.preventDefault()}checkUploadQueue(){return this.hasFilesInUploadQueue()&&this.hasNormalSizeOfFilesInUploadQueue()}hasFilesInUploadQueue(){return 0!==this._uploadQueue.length||(this._addErrorMessage(this.lmsg("noFilesSelectedForUpload")),!1)}hasNormalSizeOfFilesInUploadQueue(){const e=(0,n.getComponent)("fm-content").getUploadMaxFileSize();if(!e)return!0;for(let t=0;t<this._uploadQueue.length;t++)if(this._uploadQueue[t].total>e)return this._addErrorMessage(this.lmsg("errorFileIsLarger",{filename:this._uploadQueue[t].savedFileName})),!1;return!0}hasExistingFilesUploadQueue(){this._uploadExistingFilesQueue=[];const e=this.getCurrentDirectoryFiles(),t=(0,n.getComponent)("fm-content").getCurrentDir();return this._uploadQueue.forEach(s=>{let i=(t+(s.fullPath||"/")).replace(/\/$/g,"");s.isFile&&(i+=`/${encodeURIComponent(s.savedFileName)}`),0<=e.indexOf(i)&&this._uploadExistingFilesQueue.push(s)}),0<this._uploadExistingFilesQueue.length}hasExistingDirectories(){this._uploadExistingFilesQueue=[];const e=this.getCurrentDirectoryFiles(),t=(0,n.getComponent)("fm-content").getCurrentDir();if(0===this._uploadQueue.length)return!1;const s=this._uploadQueue[0];if(s.fullPath){let i=s.fullPath.replace(/^\/|\/$/g,"").split("/");if(0===i.length)return!1;if(i=`${t}/${encodeURIComponent(i[0])}`,0<=e.indexOf(i))return this._addErrorMessage(n.Locale.getSection("smb.controllers.file-manager.create-directory").lmsg("errorDirectoryExists")),this.hide(),!0}return!1}getCurrentDirectoryFiles(){const e=[],t=(0,n.getComponent)("fm-content").getCurrentDir();return document.getElementById("fm-table").querySelectorAll("tr").forEach(s=>{const i=s.getAttribute("data-row-id");i&&e.push(`${t}/${i.replace(/\+/g,"%20")}`)}),e}prepareUploadQueue(){this._uploadQueue=[];document.getElementById(this._selectFilesDialogItemsAreaId).querySelectorAll("form").forEach(e=>{let t=e.querySelector('input[type="file"]').value;if(!t)return;t=t.replace(/\\/g,"/").replace(/.*\//,"");const s={formElement:e,inputId:e.id,progressId:`${e.id}-progress`,savedFileName:t,status:"PENDING",type:"unknown"};this._uploadQueue.push(s)})}showUploadProgressDialog(){this.hide(),this.renderUploadProgressDialog()}renderUploadProgressDialog(){let e=-1;void 0!==this._totalUploadedSize&&(e=this._totalUploadedSize,this._uploadCurrent&&this._uploadCurrent.loaded&&(e+=this._uploadCurrent.loaded),e=this.getTotalUploadPercent(e)),this._getConfigParam("onChangeUploadProgress")({status:"running",items:this._uploadQueue,onCancel:this.onCancelUploadClick.bind(this),progress:e})}onCancelUploadClick(){this._getConfigParam("onCancel")(),this._uploadCanceled=!0,this._uploadAdapter.cancel()}onSkipExistingFilesClick(){this._uploadExistingFilesQueue.forEach(e
1=>{for(let t=0;t<this._uploadQueue.length;t++)if(e.savedFileName===this._uploadQueue[t].savedFileName){this._uploadQueue.splice(t,1);break}}),this.hasFilesInUploadQueue()?(this.showUploadProgressDialog(),this.startNextQueueUpload()):this.close()}onReplaceExistingFilesClick(){this.showUploadProgressDialog(),this.startNextQueueUpload()}prepareUploadAdapter(){if(!this._uploadAdapter){const e={contentAreaId:this._contentAreaId,handlerUrl:this.getHandlerUrl(),startUploadHandler:()=>{this._scheduleStartUpload&&(this._scheduleStartUpload=null,this.startNextQueueUpload())},finishUploadHandler:this.onNextQueueUploadFinished.bind(this)};this._uploadAdapter=new n.FileManager.UploadAdapterIframe(e)}}startNextQueueUpload(){this.prepareUploadAdapter(),this._uploadAdapter.isReady()?this._uploadCurrent||(this._uploadCanceled?this.onAllQueueUploadFinished():(this._started=!1,this.processUploadQueue(),this._started?this.renderUploadProgressDialog():this.onAllQueueUploadFinished())):this._scheduleStartUpload=!0}processUploadQueue(){try{this._uploadQueue.forEach(this.processUploadItem.bind(this))}catch(e){if(e!==this.breakQueueException)throw e}}processUploadItem(e){if("PENDING"===e.status)throw this._started=!0,this.updateUploadProgressItemStatus(e,"UPLOADING"),this._uploadCurrent=e,e.formElement.querySelectorAll('input[name="fileName"]').forEach(t=>{t.value=e.savedFileName}),e.formElement.submit(),this.breakQueueException}onNextQueueUploadFinished(){if(!this._uploadCurrent)return;const e=this._uploadCurrent;this._uploadCurrent=null;const t=this.getNextQueueUploadResult();switch(t.status){case"SUCCESS":case"CANCELED":this.updateUploadProgressItemStatus(e,t.status),this.startNextQueueUpload();break;default:this.updateUploadProgressItemStatus(e,"ERROR"),this.onQueueUploadFailed(t)}}getNextQueueUploadResult(){return this._uploadCanceled?{status:"CANCELED",message:""}:this._uploadAdapter.getResult()}onAllQueueUploadFinished(){(0,n.getComponent)("fm-content").reload(),this.reportUploadFinished.bind(this).delay(.5)}onQueueUploadFailed(e){const t=[];this._uploadQueue.forEach(e=>{t.push({name:e.savedFileName,type:e.type,status:e.status})}),this.close(),new a.default({errorMessage:e.message,message:this.lmsg("failed"),locale:this.getLocale(),items:t})}reportUploadFinished(){let e=null,t=null;if((0,n.clearStatusMessages)(),this.close(),0===this._uploadQueue.length)return;const s=this.getQueueStatus();this._uploadCanceled?(t="uploadCanceled",e="warning"):s.completed>0?(t="uploadFinished",e="info"):(t="uploadFinishedNoFiles",e="warning"),(0,n.addStatusMessage)(e,this.lmsg(t,{total:s.total,pending:s.pending,uploading:s.uploading,completed:s.completed,failed:s.failed,folder:(0,n.escapeHtml)((0,n.getComponent)("fm-content").getCurrentDir())}))}updateUploadProgressItemStatus(e,t){e.status=t,this.renderUploadProgressDialog()}getQueueStatus(){const e={completed:0,pending:0,failed:0,uploading:0,canceled:0,total:this._uploadQueue.length};return this._uploadQueue.forEach(t=>{switch(t.status){case"PENDING":e.pending++;break;case"UPLOADING":e.uploading++;break;case"ERROR":e.failed++;break;case"SUCCESS":e.completed++;break;case"CANCELED":e.canceled++}}),e}close(){this._replaceExistingFilesDialog&&(this._replaceExistingFilesDialog.remove(),this._replaceExistingFilesDialog=null),this._getConfigParam("onClose")(),this.hide()}getTotalUploadPercent(e){return this._totalSize>0?Math.round(e/this._totalSize*100):100}}const r=l},1832(e,t,s){s.r(t),s.d(t,{default:()=>o});var i=s(99),n=s(1833);const o=class{constructor({handlerUrl:e,startUploadHandler:t,finishUploadHandler:s,progressUploadHandler:n}){(0,i.default)(this,"onCreate",()=>{this._startUploadHandler()}),(0,i.default)(this,"onSuccess",({responseText:e})=>{try{this._result=JSON.parse(e)}catch{this._result={status:"ERROR",message:"No upload response"}}this._finishUploadHandler()}),(0,i.default)(this,"onFailure",({statusText:e})=>{this._result={status:"ERROR",message:e},this._finishUploadHandler()}),(0,i.default)(this,"onException",(e,t)=>{this._result={status:"ERROR",message:`Internal error: ${t}`},this._finishUploadHandler()}),this._handlerUrl=e,this._startUploadHandler=t,this._finishUploadHandler=s,this._progressUploadHandler=n}setHandlerUrl(e){this._handlerUrl=e}upload(e,t){const s=new FormData;e&&s.append(encodeURIComponent(e.name),e),s.append("forgery_protection_token",document.getElementById("forgery_protection_token").content),t&&$H(t).each(({key:e,value:t})=>{s.append(e,t)}),this._request=new n.default(this._handlerUrl,{method:"post",postBody:s,onCreate:this.onCreate,onSuccess:this.onSuccess,onFailure:this.onFailure,onException:this.onException,onProgress:this._progressUploadHandler})}createFolder(e){const t=new FormData;e&&$H(e).each(({key:e,value:s})=>
1{t.append(e,s)}),this._request=new n.default(this._handlerUrl,{method:"post",postBody:t,onCreate:this.onCreate,onSuccess:this.onSuccess,onFailure:this.onFailure,onException:this.onException,onProgress:this._progressUploadHandler})}isReady(){return!0}getResult(){return this._result}cancel(){this._request.abort(),this._finishUploadHandler()}}},1826(e,t,s){s.r(t),s.d(t,{default:()=>i});const i={_isMultipleFileSupported:null,_isUploadProgressSupported:null,isAdvancedUploadSupported(){return this.isMultipleFileSupported()&&this.isFormDataSupported()&&this.isFileApiSupported()},isMultipleFileSupported(){if(null===this._isMultipleFileSupported){const e=new Element("input",{type:"file"});this._isMultipleFileSupported="multiple"in e}return this._isMultipleFileSupported},isFormDataSupported:()=>"undefined"!=typeof FormData,isFileApiSupported:()=>"undefined"!=typeof File,isUploadProgressSupported(){if(null===this._isUploadProgressSupported){const e=Ajax.getTransport();this._isUploadProgressSupported=e&&void 0!==e.upload}return this._isUploadProgressSupported}}},1865(e,t,s){s.r(t),s.d(t,{default:()=>l});var i=s(95),n=s(507),o=s(1829);class a extends o.default{_initConfiguration(e){super._initConfiguration(e),this._settings=this._getConfigParam("settings",{})}render(){super.render();let e=`<form method="post" action="" enctype="application/x-www-form-urlencoded" id="${this._id}-form">`;this._settings.folderTree&&(e+=`<div class="form-row"><div class="single-row"><div class="indent-box"><input type="checkbox" class="checkbox" value="1" id="${this._id}-folder-tree"/><div class="indent-box-content"><label for="${this._id}-folder-tree">${this.lmsg("folderTree")}</label></div></div></div></div>`),this._settings.previewPanel&&(e+=`<div class="form-row"><div class="single-row"><div class="indent-box"><input type="checkbox" class="checkbox" value="1" id="${this._id}-preview-panel"/><div class="indent-box-content"><label for="${this._id}-preview-panel">${this.lmsg("previewPanel")}</label></div></div></div></div>`),this._settings.advanced&&(e+=`<div id="${this._id}-advanced" class="form-box b-collapsible"><div id="${this._id}-advanced-content-area">`),this._settings.systemFiles&&(e+=`<div class="form-row"><div class="single-row"><div class="indent-box"><input type="checkbox" class="checkbox" value="1" id="${this._id}-system-files"/><div class="indent-box-content"><label for="${this._id}-system-files">${this.lmsg("systemFiles")}</label></div></div></div></div>`),this._settings.permissions&&(e+=`<div class="form-row"><div class="single-row"><div class="indent-box"><input type="checkbox" class="checkbox" value="1" id="${this._id}-permissions"/><div class="indent-box-content"><label for="${this._id}-permissions">${this.lmsg("permissions")}</label></div></div></div></div>`),this._settings.userAndGroup&&(e+=`<div class="form-row"><div class="single-row"><div class="indent-box"><input type="checkbox" class="checkbox" value="1" id="${this._id}-user-group"/><div class="indent-box-content"><label for="${this._id}-user-group">${this.lmsg("userAndGroup")}</label></div></div></div></div>`),this._settings.advanced&&(e+="</div></div>"),e+="</form>",(0,i.render)(document.getElementById(this._contentAreaId),e),this._settings.advanced&&new i.Panel({title:this.lmsg("showAdvanced"),hideContentTitle:this.lmsg("hideAdvanced"),applyTo:`${this._id}-advanced`,collapsed:!0}),this.initOnSubmitEvent(),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("ok"),this.onSubmit,!0,!0),this.addRightButton(i.Locale.getSection("components.buttons").lmsg("cancel"),this.hide,!1,!1),this.reset(this.initialConfig)}reset(e){this.setHint(this.lmsg("hint")),this._settings.folderTree&&(document.getElementById(`${this._id}-folder-tree`).checked=e.initialValues.folderTree),this._settings.systemFiles&&(document.getElementById(`${this._id}-system-files`).checked=!n.default.get("fm-hidden-system-files")),this._settings.permissions&&(document.getElementById(`${this._id}-permissions`).checked=!n.default.get("fm-hidden-permissions-column")),this._settings.userAndGroup&&(document.getElementById(`${this._id}-user-group`).checked=!n.default.get("fm-hidden-user-column"),document.getElementById(`${this._id}-user-group`).checked=!n.default.get("fm-hidden-group-column")),this._clearMessages(),super.reset()}onSubmit(){this._settings.folderTree&&(document.getElementById(`${this._id}-folder-tree`).checked?this._getConfigParam("showTree")():this._getConfigParam("hideTree")()),this._settings.systemFiles&&(this.updateColumnState(document.getElementById(`${this._id}-system-files`),"fm-hidden-system-files"),(0,i.getComponent)("fm-tree").reload()),this._settings.permissions&&this.updateColumnState(document.getElementById(`${this._id}-permissions`),"fm-hidden-permissions-column"),this._settings.userAndGroup&&(this.updateColumnState(document.getElementById(`${this._id}-user-group`),"fm-hidden-user-column"),this.updateColumnState(document.getElementById(`${this._id}-user-group`),"fm-hidden-group-column")),(0,i.getComponent)("fm-content").reload(),this.hide()}updateColumnState(e,t){e.checked?n.default.remove(t,"/"):n.default.set(t,!0,null,"/")}}const l=a},1825(e,t,s){s.r(t),s.d(t,{default:()=>n});const i=()=>{const e=document.querySelector(".objects-management-box");if(!e)return void window.removeEventListener("resize",i,!1);const t=Element.getLayout(e);let s=document.body.clientHeight-Element.cumulativeOffset(e)[1]-t.get("border-top")-t.get("border-bottom");const n=document.querySelector(".pul-layout__main-inner");n&&(s-=parseInt(Element.getStyle(n,"paddingBottom"))),document.querySelector(".pul-layout__footer")&&(s-=Element.getHeight(document.querySelector(".pul-layout__footer"))),s<200&&(s=200),document.getElementById("objects-details").style.height=`${s}px`,document.getElementById("objects-list-content-area").style.height=`${s}px`;const o=document.getElementById("objects-details").querySelector(".objects-content");o&&(s-=parseInt(Element.getStyle(o,"paddingTop"))||0,o.style.height=s-(Element.cumulativeOffset(o)[1]-Element.cumulativeOffset(e)[1])+"px")},n=i},1882(e,t,s){s.r(t),s.d(t,{default:()=>c});var i=s(787),n=s.n(i),o=s(95),a=s(1880),l=s(396);const r=o.Locale.getTranslate("windows-permissions"),d=({permissions:e,inheritFromParent:t,replaceOnChildren:s,fstat:i,onPermissionChange:n,onApplyTo:o})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.default,{name:"inheritFromParent",label:(0,l.jsx)(r,{content:"inheritFromParent"}),...t}),(0,l.jsx)(a.default,{name:"replaceOnChildren",label:(0,l.jsx)(r,{content:"replaceOnChildren"}),...s}),(0,l.jsx)("fieldset",{children:(0,l.jsx)("table",{width:"100%",cellSpacing:"0",cellPadding:"0",border:"0",children:(0,l.jsxs)("tbody",{children:[" ",(0,l.jsx)("tr",{children:(0,l.jsxs)("td",{children:[(0,l.jsx)("table",{className:"formFields",cellSpacing:"0",width:"100%",children:(0,l.jsxs)("tbody",{children:[(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:"2",children:(0,l.jsx)("div",{id:"permissions_userlist"})})}),(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{width:"60%",children:(0,l.jsx)("table",{className:"list",cellSpacing:"0",width:"100%",children:(0,l.jsxs)("tbody",{children:[(0,l.jsxs)("tr",{children:[(0,l.jsxs)("th",{width:"80%",children:[(0,l.jsx)(r,{content:"permissionsFor"})," ",(0,l.jsx)("span",{id:"perm_title"})]}),(0,l.jsx)("th",{children:(0,l.jsx)(r,{content:"allow"})}),(0,l.jsx)("th",{children:(0,l.jsx)(r,{content:"deny"})})]}
1),e.map(({PERMISSION_TEXT:e,PERMISSION_NAME:t,PERMISSION_DISABLED:s})=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:e}),(0,l.jsx)("td",{align:"center",children:(0,l.jsx)("input",{type:"checkbox",className:"checkbox",name:`Allow${t}`,value:"true",onClick:()=>n(`Allow${t}`),disabled:s})}),(0,l.jsx)("td",{align:"center",children:(0,l.jsx)("input",{type:"checkbox",className:"checkbox",name:`Deny${t}`,value:"true",onClick:()=>n(`Deny${t}`),disabled:s})})]},t))]})})}),i.is_dir&&(0,l.jsx)("td",{width:"40%",children:(0,l.jsx)("table",{className:"list",cellSpacing:"0",width:"100%",children:(0,l.jsxs)("tbody",{children:[(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{width:"30%",children:(0,l.jsx)("b",{children:(0,l.jsx)(r,{content:"applyTo"})})}),(0,l.jsxs)("td",{children:[(0,l.jsx)("input",{type:"checkbox",className:"checkbox",name:"applyonto_thisobject",id:"fid-applyonto_thisobject",value:"true",onClick:()=>o("applyonto_thisobject")})," ",(0,l.jsx)("label",{htmlFor:"fid-applyonto_thisobject",children:(0,l.jsx)(r,{content:"folderOnly"})})]})]}),(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{}),(0,l.jsxs)("td",{children:[(0,l.jsx)("input",{type:"checkbox",className:"checkbox",name:"applyonto_subfolders",id:"fid-applyonto_subfolders",value:"true",onClick:()=>o("applyonto_subfolders")})," ",(0,l.jsx)("label",{htmlFor:"fid-applyonto_subfolders",children:(0,l.jsx)(r,{content:"subfolderOnly"})})]})]}),(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{}),(0,l.jsxs)("td",{children:[(0,l.jsx)("input",{type:"checkbox",className:"checkbox",name:"applyonto_files",id:"fid-applyonto_files",value:"true",onClick:()=>o("applyonto_files")})," ",(0,l.jsx)("label",{htmlFor:"fid-applyonto_files",children:(0,l.jsx)(r,{content:"filesOnly"})})]})]})]})})})]})]})}),(0,l.jsx)("input",{type:"hidden",name:"data",value:""})]})})]})})})]});d.propTypes={permissions:n().array.isRequired,onPermissionChange:n().func.isRequired,onApplyTo:n().func.isRequired,inheritFromParent:n().shape({checked:n().bool.isRequired,disabled:n().bool.isRequired}).isRequired,replaceOnChildren:n().shape({checked:n().bool.isRequired,disabled:n().bool.isRequired}).isRequired,fstat:n().shape({is_dir:n().bool.isRequired}).isRequired};const c=d},1881(e,t,s){s.r(t),s.d(t,{default:()=>h});var i=s(95),n=s(1878),o=s(1882);const a=i.Locale.getSection("smb.components.forms.file-manager.windows-permissions");let l;const r=()=>["",a.lmsg("applyOnto1"),a.lmsg("applyOnto2"),a.lmsg("applyOnto3"),a.lmsg("applyOnto4"),a.lmsg("applyOnto5"),a.lmsg("applyOnto6"),a.lmsg("applyOnto7")],d=e=>{switch(e){case"User":case"Unknown":default:return l.skin.ICON_WIN_PERM_USER;case"Group":case"poolgrp":return l.skin.ICON_WIN_PERM_GROUP;case"Computer":case"Domain":return l.skin.ICON_WIN_PERM_COMPUTER}};function c(e,t){const s=document.getElementById("permissions-form").elements,i=e.getAdditionalData(t);i[1]=void 0;let n=2;if(Object.keys(l.permissions_list).forEach(e=>{null==i[1]?s[`Deny${e}`].checked?(i[1]=!1,i[n]=!0):s[`Allow${e}`].checked?(i[1]=!0,i[n]=!0):i[n]=!1:i[n]=s[(i[1]?"Allow":"Deny")+e].checked,n++}),null==i[1]&&(i[1]=!0),e.setAdditionalData(t,i),l.fstat.is_dir){let i=0;i|=s.applyonto_thisobject.checked?l.PERMISSIONS__APPLY_ONTO_THISOBJECT:0,i|=s.applyonto_subfolders.checked?l.PERMISSIONS__APPLY_ONTO_SUBFOLDERS:0,i|=s.applyonto_files.checked?l.PERMISSIONS__APPLY_ONTO_FILES:0;const n=r();e.setData(t,3,[i,n[i]])}}function u(e,t){const{perm_change:s}=l.fstat,i=e.getAdditionalData(t);if(0==i)return;const n=e.getAdditionalData(t),o=document.getElementById("permissions-form").elements;let a=2;if(Object.keys(l.permissions_list).forEach(e=>{o[(i[1]?"Allow":"Deny")+e].checked=i[a++],o[(i[1]?"Deny":"Allow")+e].checked=!1,o[`Allow${e}`].disabled=!s||n[0],o[`Deny${e}`].disabled=!s||n[0]}),l.fstat.is_dir){const i=e.getData(t,3)[0];o.applyonto_thisobject.checked=i&l.PERMISSIONS__APPLY_ONTO_THISOBJECT,o.applyonto_thisobject.disabled=!s||n[0],o.applyonto_subfolders.checked=i&l.PERMISSIONS__APPLY_ONTO_SUBFOLDERS,o.applyonto_subfolders.disabled=!s||n[0],o.applyonto_files.checked=i&l.PERMISSIONS__APPLY_ONTO_FILES,o.applyonto_files.disabled=!s||n[0]}}const h=(0,n.default)({onSelect:function(e,t,s){-1!=s&&c(e,s);let i=e.getData(t,1);i=i.replace(`${l.fstat.LocalDomain}\\`,""),i=i.replace(`${l.fstat.BuiltinDomain}\\`,""),i=i.replace(`${l.fstat.NTAuthorityDomain}\\`,""),document.getElementById("perm_title").innerHTML=i,u(e,t)},onNewElement:function(e,t){e.setAdditionalData(t,[!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1,!1])},onDeleteElement:function(e){const t=e.getSelection();-1!=t&&u(e,t)},setProps:e=>{l=e},onEditListInit:function(){const e=window.permissions_userlistEditListObj,t=e.getSelection();-1!=t&&c(e,t);const s=document.getElementById("inheritFromParent").checked,n=e.getAllData(),o=e.getAllCanDelete(),r=e.getAllAdditionalData(),u=[],h=[],m=[];
1Object.keys(l.fstat.accounts).forEach(e=>{const t=l.fstat.accounts[e];let c;Array.isArray(t.ParentAdvancedAcl)&&t.ParentAdvancedAcl.forEach(e=>{c=-1;for(let s=0;s<n.length;s++)if(""===n[s][2][0]&&n[s][1]===(t.domain?`${t.domain}\\${t.user}`:t.user)&&(!l.fstat.is_dir||n[s][3][0]===e.ApplyOnto)){let t=!0;t=t&&r[s][1]==e.Allow;let i=2;if(Object.keys(l.permissions_list).forEach(n=>{t=t&&r[s][i++]===!!e[n]}),t){c=s;break}}if(s||-1==c){const n=[[t.type,`<img src="${d(t.type)}" width="${l.skin.ICON_WIDTH}" height="${l.skin.ICON_HEIGHT}" />`],t.domain?`${t.domain}\\${t.user}`:t.user,s?[e.InheritedFrom,e.InheritedFrom?e.InheritedFrom:(0,i.escapeHtml)(a.lmsg("notInherited"))]:["",(0,i.escapeHtml)(a.lmsg("notInherited"))]];l.fstat.is_dir&&n.push([e.ApplyOnto,a.lmsg(`applyOnto${e.ApplyOnto}`)]),u.push(n),h.push(!s&&!t.permanent);const o=[!!t.permanent,!!e.Allow];Object.keys(l.permissions_list).forEach(t=>{o.push(!!e[t])}),m.push(o)}s||-1==c||(o[c]=!t.permanent),s&&(o[c]=!0)})});for(let e=0;e<n.length;e++)(s||""==n[e][2][0])&&(u.push(n[e]),h.push(o[e]),m.push(r[e]));e.setAllData(u,h),e.setAllAdditionalData(m),e._selectedId=-1,e.refresh(),e.setSelection(0)},onBeforeSubmit:function(e){const t=Object.keys(l.permissions_list).length,s=window.permissions_userlistEditListObj,i=s.getSelection();-1!=i&&c(s,i);const n=s.getAllData(),o=s.getColumns(),a=s.getAllAdditionalData();let r="";for(let e=0;e<n.length;e++){for(let t=1;t<o.length;t++)r+=`${"const"==o[t].type?n[e][t][0]:n[e][t]}:P:`;for(let s=1;s<t+2;s++)r+=`${a[e][s]}:P:`}e.data.value=r},onUsernameChange:function(e){let t="",s="";if(""!==e.value){t=Object.keys(l.fstat.accounts).reduce((e,t)=>{const s=l.fstat.accounts[t];return e[t]=s.type,e},{})[e.value]||"Unknown",s=`<img src="${d(t)}" width="${l.skin.ICON_WIDTH}" height="${l.skin.ICON_HEIGHT}">`}window.permissions_userlistEditListObj._columns[0].value=[t,s],document.getElementById("typeCell_Input").innerHTML=`${s}<input type="hidden" name="type_input" value="${t}">`},onPermissionChange:function(e){const t=document.getElementById("permissions-form")?.elements;if(!t?.[e])return;const s="A"==e.substring(0,1),i=e.substring(s?5:4);Object.keys(l.permissions_list).forEach(e=>{t[(s?"Deny":"Allow")+e].checked=!1}),t[e].checked?(t[(s?"Allow":"Deny")+"Full"].checked&&(t[(s?"Allow":"Deny")+"Read"].checked=!0,t[(s?"Allow":"Deny")+"Write"].checked=!0,t[(s?"Allow":"Deny")+"Execute"].checked=!0,l.fstat.is_dir&&(t[(s?"Allow":"Deny")+"DeleteSubfoldersandFiles"].checked=!0),t[(s?"Allow":"Deny")+"Delete"].checked=!0,t[(s?"Allow":"Deny")+"ChangePermissions"].checked=!0,t[(s?"Allow":"Deny")+"TakeOwnership"].checked=!0),t[(s?"Allow":"Deny")+"Read"].checked&&(t[(s?"Allow":"Deny")+"ListFolderOrRead"].checked=!0),t[(s?"Allow":"Deny")+"Write"].checked&&(t[(s?"Allow":"Deny")+"CreateFilesOrWrite"].checked=!0,t[(s?"Allow":"Deny")+"CreateFoldersOrAppend"].checked=!0),t[(s?"Allow":"Deny")+"Execute"].checked&&(t[(s?"Allow":"Deny")+"TraverseFolderOrExecuteFile"].checked=!0)):("Execute"!=i&&(t[(s?"Allow":"Deny")+"Execute"].checked=t[(s?"Allow":"Deny")+"TraverseFolderOrExecuteFile"].checked),"Write"!=i&&(t[(s?"Allow":"Deny")+"Write"].checked=t[(s?"Allow":"Deny")+"CreateFilesOrWrite"].checked&&t[(s?"Allow":"Deny")+"CreateFoldersOrAppend"].checked),"Read"!=i&&(t[(s?"Allow":"Deny")+"Read"].checked=t[(s?"Allow":"Deny")+"ListFolderOrRead"].checked),"Full"!=i&&(t[(s?"Allow":"Deny")+"Full"].checked=t[(s?"Allow":"Deny")+"Read"].checked&&t[(s?"Allow":"Deny")+"Write"].checked&&t[(s?"Allow":"Deny")+"Execute"].checked&&(!l.fstat.is_dir||t[(s?"Allow":"Deny")+"DeleteSubfoldersandFiles"].checked)&&t[(s?"Allow":"Deny")+"Delete"].checked&&t[(s?"Allow":"Deny")+"ChangePermissions"].checked&&t[(s?"Allow":"Deny")+"TakeOwnership"].checked))},onApplyTo:function(e){const t=document.getElementById("permissions-form").elements;t.applyonto_thisobject.checked||t.applyonto_subfolders.checked||t.applyonto_files.checked||(t[e].checked=!0);let s=0;s|=t.applyonto_thisobject.checked?l.PERMISSIONS__APPLY_ONTO_THISOBJECT:0,s|=t.applyonto_subfolders.checked?l.PERMISSIONS__APPLY_ONTO_SUBFOLDERS:0,s|=t.applyonto_files.checked?l.PERMISSIONS__APPLY_ONTO_FILES:0;const i=window.permissions_userlistEditListObj.getSelection(),n=document.getElementById(`apply_toCell_${i}`),o=r();n.innerHTML=`${o[s]}
1<input type="hidden" name="apply_to[]" value="${s}">`}})(o.default)},1880(e,t,s){s.r(t),s.d(t,{default:()=>l});var i=s(787),n=s.n(i),o=s(396);const a=({name:e,label:t,checked:s,disabled:i})=>(0,o.jsx)("div",{className:"form-row",children:(0,o.jsx)("div",{className:"single-row",children:(0,o.jsxs)("div",{className:"indent-box",children:[(0,o.jsx)("input",{type:"hidden",name:e,value:"0"}),(0,o.jsx)("input",{type:"checkbox",name:e,id:e,value:"1",defaultChecked:s,disabled:i,className:"checkbox"}),(0,o.jsx)("div",{className:"indent-box-content",children:(0,o.jsx)("label",{htmlFor:e,children:t})})]})})});a.propTypes={name:n().string.isRequired,label:n().element.isRequired,checked:n().bool.isRequired,disabled:n().bool.isRequired};const l=a},1875(e,t,s){s.r(t),s.d(t,{default:()=>y});var i=s(396),n=s(787),o=s.n(n),a=s(397),l=s(95),r=s(860),d=s(663),c=s(1876),u=s(1877),h=s(1881),m=s(806);s(1883);const p=e=>l.api.get(e),g=l.Locale.getTranslate("permissions"),f=({file:e,currentDir:t,domainId:s,icon:n,isDirectory:o,isUnix:f,onComplete:b=()=>{},isOpen:y,onClose:_,commonToaster:C=!1})=>{const[x,v]=(0,i.useState)(!1),[w,S]=(0,i.useState)(),[D,k]=(0,i.useState)(),E=(0,m.useCollector)(),I=(0,i.useRef)(),j=(0,i.useRef)(!1),A=(({domainId:e,currentDir:t,file:s,advanced:i})=>{const n=new URLSearchParams;return n.set("currentDir",t),n.set("file",s),i&&n.set("advanced",i),`/smb/file-manager/permissions/domainId/${e}/?${n}`})({domainId:s,currentDir:t,file:e,advanced:x});(0,i.useEffect)(()=>{let e=k;return y?(k(void 0),p(A).then(t=>{e(t)})):v(!1),()=>{e=()=>{}}},[A,y]);const R=f?c.default:x?h.default:u.default,F=()=>{_(),j.current&&b()};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.Drawer,{"data-type":"permissions",isOpen:y,title:(0,i.jsx)(g,{content:o?"directoryPermissions":"filePermissions"}),subtitle:(0,i.jsxs)("div",{className:"permissions__subtitle",children:[(0,i.jsxs)("span",{children:[(0,i.jsx)(a.Icon,{src:n,size:"24"})," ",e]}),!f&&!x&&(0,i.jsx)(a.Action,{icon:"sliders",outerProps:{className:"permissions__subtitle-toggle"},onClick:()=>{k(void 0),v(!x)},children:(0,i.jsx)(g,{content:"buttonAdvanced"})})]}),size:f?"xs":"md",form:{state:w,submitButton:{children:(0,i.jsx)(g,{content:"buttonSubmit"})},applyButton:{children:(0,i.jsx)(g,{content:"buttonApply"}),intent:void 0},cancelButton:{children:(0,i.jsx)(g,{content:"buttonCancel"})},id:"permissions-form",onSubmit:async(e,t)=>{S(t?"apply":"submit");const s=E.collect(),i=await((e,t)=>l.api.post(e,(0,r.toFormData)(t)))(A,s);var n;if(n={intent:"success"===i.status?i.status:"danger",message:i.message??i.statusMessages.reduce((e,t)=>e+t.content,"")},C?(0,d.addToast)(n):I.current.add(n),!f&&t){const e=await p(A);e.key=Date.now(),k(e)}S(void 0),j.current=!0,t||F()}},onClose:F,children:y&&D?(0,i.jsx)(R,{...D,collector:E}):(0,i.jsx)(a.ContentLoader,{})}),!C&&(0,i.jsx)(a.Toaster,{ref:I,"data-type":"toaster"})]})};f.propTypes={file:o().string.isRequired,currentDir:o().string.isRequired,domainId:o().number.isRequired,icon:o().string.isRequired,isDirectory:o().bool.isRequired,isUnix:o().bool.isRequired,onComplete:o().func,commonToaster:o().bool,isOpen:o().bool.isRequired,onClose:o().func.isRequired};const b={permissions:l.Locale.getSection("smb.components.forms.file-manager.permissions").messages,"unix-file-permissions":l.Locale.getSection("smb.components.forms.file-manager.unix-file-permissions").messages,"windows-permissions":l.Locale.getSection("smb.components.forms.file-manager.windows-permissions").messages},y=e=>(0,i.jsx)(a.LocaleProvider,{messages:b,children:(0,i.jsx)(f,{...e})})},1876(e,t,s){s.r(t),s.d(t,{default:()=>d});var i=s(396),n=s(787),o=s.n(n),a=s(397);const l=s(95).Locale.getTranslate("unix-file-permissions"),r=({permissions:e,collector:t,isDir:s})=>{const[n,o]=(0,i.useState)(e),[r,d]=(0,i.useState)(!1);t.setCallback(()=>({permissions:n,changeRecursive:r}));const c=e=>t=>{const s=t[e];return(0,i.jsx)(a.Checkbox,{name:s,checked:n[s],onChange:e=>{o({...n,[s]:e})}})},u=[{key:"name",title:""},{key:"r",title:(0,i.jsx)(l,{content:"readMode"}),render:c("r")},{key:"w",title:(0,i.jsx)(l,{content:"writeMode"}),render:c("w")}
1,{key:"x",title:(0,i.jsx)(l,{content:"execMode"}),render:c("x")}],h=[{key:"owner",name:(0,i.jsx)(l,{content:"owner"}),r:"ownerRead",w:"ownerWrite",x:"ownerExecute"},{key:"group",name:(0,i.jsx)(l,{content:"group"}),r:"groupRead",w:"groupWrite",x:"groupExecute"},{key:"others",name:(0,i.jsx)(l,{content:"others"}),r:"othersRead",w:"othersWrite",x:"othersExecute"}];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.List,{columns:u,data:h,name:"permissions-list"}),s?(0,i.jsx)(a.Checkbox,{name:"changeRecursive",checked:r,onChange:e=>d(e),children:(0,i.jsx)(l,{content:"changeRecursive"})}):null]})};r.propTypes={permissions:o().object.isRequired,collector:o().shape({setCallback:o().func.isRequired}).isRequired,isDir:o().bool.isRequired};const d=r},1879(e,t,s){s.r(t),s.d(t,{default:()=>u});var i=s(787),n=s.n(i),o=s(95),a=s(1880),l=s(397),r=s(396);const d=o.Locale.getTranslate("windows-permissions"),c=({permissions:e,inheritFromParent:t,replaceOnChildren:s,onPermissionChange:i})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.default,{name:"inheritFromParent",label:(0,r.jsx)(d,{content:"inheritFromParent"}),...t}),(0,r.jsx)(a.default,{name:"replaceOnChildren",label:(0,r.jsx)(d,{content:"replaceOnChildren"}),...s}),(0,r.jsxs)(l.Columns,{gap:"lg",style:{flexWrap:"wrap"},children:[(0,r.jsx)(l.Column,{ratio:1,style:{minWidth:"auto"},children:(0,r.jsx)("div",{id:"permissions_userlist"})}),(0,r.jsx)(l.Column,{ratio:1,style:{minWidth:"auto"},children:(0,r.jsx)("table",{className:"list",cellSpacing:"0",width:"100%",children:(0,r.jsxs)("tbody",{children:[(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{width:"80%",children:[(0,r.jsx)(d,{content:"permissionsFor"})," ",(0,r.jsx)("span",{id:"perm_title"})]}),(0,r.jsx)("th",{children:(0,r.jsx)(d,{content:"allow"})}),(0,r.jsx)("th",{children:(0,r.jsx)(d,{content:"deny"})})]}),e.map(({PERMISSION_TEXT:e,PERMISSION_NAME:t,PERMISSION_DISABLED:s})=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:e}),(0,r.jsx)("td",{align:"center",children:(0,r.jsx)("input",{type:"checkbox",className:"checkbox",name:`Allow${t}`,value:"true",onClick:()=>i(`Allow${t}`),disabled:s})}),(0,r.jsx)("td",{align:"center",children:(0,r.jsx)("input",{type:"checkbox",className:"checkbox",name:`Deny${t}`,value:"true",onClick:()=>i(`Deny${t}`),disabled:s})})]},t))]})})})]}),(0,r.jsx)("input",{type:"hidden",name:"data",value:""})]});c.propTypes={permissions:n().array.isRequired,onPermissionChange:n().func.isRequired,inheritFromParent:n().shape({checked:n().bool.isRequired,disabled:n().bool.isRequired}).isRequired,replaceOnChildren:n().shape({checked:n().bool.isRequired,disabled:n().bool.isRequired}).isRequired};const u=c},1877(e,t,s){s.r(t),s.d(t,{default:()=>r});var i=s(1878),n=s(1879);let o;function a(e,t){const s=document.getElementById("permissions-form").elements,i=e.getAdditionalData(t);let n=1;Object.keys(o.permissions_list).forEach(e=>{i[n++]=s[`Allow${e}`].checked}),Object.keys(o.permissions_list).forEach(e=>{i[n++]=s[`Deny${e}`].checked}),e.setAdditionalData(t,i)}function l(e,t){const s=Object.keys(o.permissions_list).length,i=o.fstat.perm_change,n=e.getAdditionalData(t);if(0==n)return;const a=e.getAdditionalData(t),l=document.getElementById("permissions-form").elements,r=document.getElementById("inheritFromParent").checked;let d=1;Object.keys(o.permissions_list).forEach(e=>{l[`Allow${e}`].checked=n[d++]}),Object.keys(o.permissions_list).forEach(e=>{l[`Deny${e}`].checked=n[d++]}),Object.keys(o.permissions_list).forEach(e=>{l[`Allow${e}`].disabled=!i||a[0],l[`Deny${e}`].disabled=!i||a[0]}),i&&r&&(d=2*s+1,Object.keys(o.permissions_list).forEach(e=>{n[d]&&(l[`Allow${e}`].checked=!0,l[`Allow${e}`].disabled=!0,l[`Deny${e}`].disabled=a[0]),n[s+d]&&(l[`Deny${e}`].checked=!0,l[`Allow${e}`].disabled=!0,l[`Deny${e}`].disabled=!0),d++}))}const r=(0,i.default)({onSelect:function(e,t,s){-1!=s&&a(e,s);let i=e.getData(t,1);i=i.replace(`${o.fstat.LocalDomain}\\`,""),i=i.replace(`${o.fstat.BuiltinDomain}\\`,""),i=i.replace(`${o.fstat.NTAuthorityDomain}\\`,""),document.getElementById("perm_title").innerHTML=i,l(e,t)},onNewElement:function(e,t){const s=[!1];
1Object.keys(o.permissions_list).forEach(e=>{s.push("ReadAndExecute"===e||"ListFolderContents"===e||"Read"===e)}),s.push(!1,!1,!1),e.setAdditionalData(t,s)},onDeleteElement:function(e){const t=e.getSelection();-1!=t&&l(e,t)},setProps:e=>{o=e},onBeforeSubmit:function(e){const t=Object.keys(o.permissions_list).length,s=window.permissions_userlistEditListObj,i=s.getSelection();-1!=i&&a(s,i);const n=s.getAllData(),l=s.getAllAdditionalData();let r="";for(let e=0;e<n.length;e++){r+=`${n[e][1]}:P:`;for(let s=1;s<2*t+1;s++)r+=`${l[e][s]}:P:`}e.data.value=r},onUsernameChange:function(e){let t="",s="";if(""!==e.value){let i;switch(t=Object.keys(o.fstat.accounts).reduce((e,t)=>{const s=o.fstat.accounts[t];return e[`${s.domain}\\${s.user}`]=s.type,e},{})[e.value]||"Unknown",t){case"User":case"Unknown":default:i=o.skin.ICON_WIN_PERM_USER;break;case"Group":case"poolgrp":i=o.skin.ICON_WIN_PERM_GROUP;break;case"Computer":case"Domain":i=o.skin.ICON_WIN_PERM_COMPUTER}s=`<img src="${i}" width="${o.skin.ICON_WIDTH}" height="${o.skin.ICON_HEIGHT}">`}window.permissions_userlistEditListObj._columns[0].value=[t,s],document.getElementById("typeCell_Input").innerHTML=`${s}<input type="hidden" name="type_input" value="${t}">`},onPermissionChange:function(e){const t=document.getElementById("permissions-form")?.elements;if(t?.[e])switch(e){case"AllowFullControl":t.AllowFullControl.checked&&(t.AllowModify.checked=!0,t.AllowReadAndExecute.checked=!0,"ListFolderContents"in o.permissions_list&&(t.AllowListFolderContents.checked=!0),t.AllowRead.checked=!0,t.AllowWrite.checked=!0,t.DenyFullControl.disabled||(t.DenyFullControl.checked=!1),t.DenyModify.disabled||(t.DenyModify.checked=!1),t.DenyReadAndExecute.disabled||(t.DenyReadAndExecute.checked=!1),"ListFolderContents"in o.permissions_list&&(t.DenyListFolderContents.disabled||(t.DenyListFolderContents.checked=!1)),t.DenyRead.disabled||(t.DenyRead.checked=!1),t.DenyWrite.disabled||(t.DenyWrite.checked=!1));break;case"DenyFullControl":t.DenyFullControl.checked&&(t.AllowFullControl.disabled||(t.AllowFullControl.checked=!1),t.AllowModify.disabled||(t.AllowModify.checked=!1),t.AllowReadAndExecute.disabled||(t.AllowReadAndExecute.checked=!1),"ListFolderContents"in o.permissions_list&&(t.AllowListFolderContents.disabled||(t.AllowListFolderContents.checked=!1)),t.AllowRead.disabled||(t.AllowRead.checked=!1),t.AllowWrite.disabled||(t.AllowWrite.checked=!1),t.DenyModify.checked=!0,t.DenyReadAndExecute.checked=!0,"ListFolderContents"in o.permissions_list&&(t.DenyListFolderContents.checked=!0),t.DenyRead.checked=!0,t.DenyWrite.checked=!0);break;case"AllowModify":t.AllowModify.checked?(t.AllowReadAndExecute.checked=!0,"ListFolderContents"in o.permissions_list&&(t.AllowListFolderContents.checked=!0),t.AllowRead.checked=!0,t.AllowWrite.checked=!0,t.DenyFullControl.disabled||(t.DenyFullControl.checked=!1),t.DenyModify.disabled||(t.DenyModify.checked=!1),t.DenyReadAndExecute.disabled||(t.DenyReadAndExecute.checked=!1),"ListFolderContents"in o.permissions_list&&(t.DenyListFolderContents.disabled||(t.DenyListFolderContents.checked=!1)),t.DenyRead.disabled||(t.DenyRead.checked=!1),t.DenyWrite.disabled||(t.DenyWrite.checked=!1)):t.AllowFullControl.checked=!1;break;case"DenyModify":t.DenyModify.checked?(t.AllowFullControl.disabled||(t.AllowFullControl.checked=!1),t.AllowModify.disabled||(t.AllowModify.checked=!1),t.AllowReadAndExecute.disabled||(t.AllowReadAndExecute.checked=!1),"ListFolderContents"in o.permissions_list&&(t.AllowListFolderContents.disabled||(t.AllowListFolderContents.checked=!1)),t.AllowRead.disabled||(t.AllowRead.checked=!1),t.AllowWrite.disabled||(t.AllowWrite.checked=!1),t.DenyReadAndExecute.checked=!0,"ListFolderContents"in o.permissions_list&&(t.DenyListFolderContents.checked=!0),t.DenyRead.checked=!0,t.DenyWrite.checked=!0):t.DenyFull
1Control.checked=!1;break;case"AllowReadAndExecute":t.AllowReadAndExecute.checked?("ListFolderContents"in o.permissions_list&&(t.AllowListFolderContents.checked=!0),t.AllowRead.checked=!0,t.DenyFullControl.disabled||(t.DenyFullControl.checked=!1),t.DenyModify.disabled||(t.DenyModify.checked=!1),t.DenyReadAndExecute.disabled||(t.DenyReadAndExecute.checked=!1),"ListFolderContents"in o.permissions_list&&(t.DenyListFolderContents.disabled||(t.DenyListFolderContents.checked=!1)),t.DenyRead.disabled||(t.DenyRead.checked=!1)):(t.AllowFullControl.checked=!1,t.AllowModify.checked=!1);break;case"DenyReadAndExecute":t.DenyReadAndExecute.checked?(t.AllowFullControl.disabled||(t.AllowFullControl.checked=!1),t.AllowModify.disabled||(t.AllowModify.checked=!1),t.AllowReadAndExecute.disabled||(t.AllowReadAndExecute.checked=!1),"ListFolderContents"in o.permissions_list&&(t.AllowListFolderContents.disabled||(t.AllowListFolderContents.checked=!1)),t.AllowRead.disabled||(t.AllowRead.checked=!1),"ListFolderContents"in o.permissions_list&&(t.DenyListFolderContents.checked=!0),t.DenyRead.checked=!0):(t.DenyFull
1Control.checked=!1,t.DenyModify.checked=!1);break;case"AllowListFolderContents":"ListFolderContents"in o.permissions_list&&(t.AllowListFolderContents.checked?(t.DenyFullControl.disabled||(t.DenyFullControl.checked=!1),t.DenyModify.disabled||(t.DenyModify.checked=!1),t.DenyReadAndExecute.disabled||(t.DenyReadAndExecute.checked=!1),t.DenyListFolderContents.disabled||(t.DenyListFolderContents.checked=!1),t.DenyRead.disabled||(t.DenyRead.checked=!1)):(t.AllowFullControl.checked=!1,t.AllowModify.checked=!1,t.AllowReadAndExecute.checked=!1));break;case"DenyListFolderContents":"ListFolderContents"in o.permissions_list&&(t.DenyListFolderContents.checked?(t.AllowFullControl.disabled||(t.AllowFullControl.checked=!1),t.AllowModify.disabled||(t.AllowModify.checked=!1),t.AllowReadAndExecute.disabled||(t.AllowReadAndExecute.checked=!1),t.AllowListFolderContents.disabled||(t.AllowListFolderContents.checked=!1),t.AllowRead.disabled||(t.AllowRead.checked=!1)):(t.DenyFullControl.checked=!1,t.DenyModify.checked=!1,t.DenyReadAndExecute.checked=!1));break;case"AllowRead":t.AllowRead.checked?(t.DenyFullControl.disabled||(t.DenyFullControl.checked=!1),t.DenyModify.disabled||(t.DenyModify.checked=!1),t.DenyReadAndExecute.disabled||(t.DenyReadAndExecute.checked=!1),"ListFolderContents"in o.permissions_list&&(t.DenyListFolderContents.disabled||(t.DenyListFolderContents.checked=!1)),t.DenyRead.disabled||(t.DenyRead.checked=!1)):(t.AllowFullControl.checked=!1,t.AllowModify.checked=!1,t.AllowReadAndExecute.checked=!1);break;case"DenyRead":t.DenyRead.checked?(t.AllowFullControl.disabled||(t.AllowFullControl.checked=!1),t.AllowModify.disabled||(t.AllowModify.checked=!1),t.AllowReadAndExecute.disabled||(t.AllowReadAndExecute.checked=!1),"ListFolderContents"in o.permissions_list&&(t.AllowListFolderContents.disabled||(t.AllowListFolderContents.checked=!1)),t.AllowRead.disabled||(t.AllowRead.checked=!1)):(t.DenyFull
1Control.checked=!1,t.DenyModify.checked=!1,t.DenyReadAndExecute.checked=!1);break;case"AllowWrite":t.AllowWrite.checked?(t.DenyFullControl.disabled||(t.DenyFullControl.checked=!1),t.DenyModify.disabled||(t.DenyModify.checked=!1),t.DenyReadAndExecute.disabled||(t.DenyWrite.checked=!1)):(t.AllowFullControl.checked=!1,t.AllowModify.checked=!1);break;case"DenyWrite":t.DenyWrite.checked?(t.AllowFullControl.disabled||(t.AllowFullControl.checked=!1),t.AllowModify.disabled||(t.AllowModify.checked=!1),t.AllowReadAndExecute.disabled||(t.AllowWrite.checked=!1)):(t.DenyFullControl.checked=!1,t.DenyModify.checked=!1)}}})(n.default)},1874(e,t,s){s.r(t),s.d(t,{default:()=>i.default});var i=s(1875)},1878(e,t,s){s.r(t),s.d(t,{default:()=>o});var i=s(396),n=s(787);const o=({onSelect:e,onNewElement:t,onDeleteElement:s,onUsernameChange:o,onBeforeSubmit:a,setProps:l,onPermissionChange:r,onApplyTo:d,onEditListInit:c=()=>{}})=>u=>{class h extends i.Component{componentDidMount(){l(this.props),Plesk.require("app/editlist",i=>{const{usersList:n}=this.props;n.columns=n.columns.map(e=>("oC_user_name"===e.onChange&&(e.onChange=o),"select"===e.type?e.value=Object.keys(e.value).reduce((t,s,i)=>(t.push([s,e.value[s],!e.additable||e.additable[i]]),t),[]):"const"===e.type&&(e.value=[e.value[0],e.value[1]]),e)),n.onSelect=e,n.onNewElement=t,n.onDeleteElement=s,window.permissions_userlistEditListObj=new i(n),window.permissions_userlistEditListObj.render("permissions_userlist"),c(),window.permissions_userlistEditListObj.setSelection(0)})}shouldComponentUpdate(){return!1}render(){const{collector:e,...t}=this.props;return e.setCallback(()=>{const e=document.getElementById("permissions-form");return a(e),new FormData(e)}),(0,i.jsx)(u,{...t,onPermissionChange:r,onApplyTo:d})}}return h.propTypes={collector:n.PropTypes.shape({setCallback:n.PropTypes.func.isRequired}).isRequired,usersList:n.PropTypes.object.isRequired},h}},1836(e,t,s){s.r(t),s.d(t,{atobUnicode:()=>n,btoaUnicode:()=>i});const i=e=>btoa((e=>{const t=new Uint16Array(e.length);for(let s=0;s<t.length;s++)t[s]=e.charCodeAt(s);return String.fromCharCode(...new Uint8Array(t.buffer))})(e)),n=e=>(e=>{const t=new Uint8Array(e.length);for(let s=0;s<t.length;s++)t[s]=e.charCodeAt(s);return String.fromCharCode(...new Uint16Array(t.buffer))})(atob(e))},1842(e,t,s){s.r(t),s.d(t,{default:()=>c});var i=s(397),n=s(787),o=s.n(n),a=s(803),l=s.n(a),r=s(396);const d=({className:e="",readonly:t=!1,autoFocus:s=!0,children:n="",onInit:o=null,onChange:a=null,onSave:d,fileName:c,...u})=>(0,r.jsx)("div",{className:l()("file-manager__code-editor",e),...u,children:(0,r.jsx)(i.CodeEditor,{fileName:c,autofocus:s,readOnly:t,onInit:o,onChange:a,onSave:d,children:n})});d.propTypes={children:o().any,className:o().string,readonly:o().bool,autoFocus:o().bool,onInit:o().func,onChange:o().func,onSave:o().func.isRequired,fileName:o().string.isRequired};const c=d},1838(e,t,s){s.r(t),s.d(t,{default:()=>C});var i=s(396),n=s(787),o=s.n(n),a=s(397),l=s(95),r=s(806),d=s(672),c=s(1839),u=s(1855),h=s(1856),m=s(1836),p=s(663);const g=(0,i.memo)(c.default),f=e=>{switch(e){case d.MODE_EDIT:return(0,i.jsx)(a.Translate,{content:"titleTextEditor"});case d.MODE_CODE:return(0,i.jsx)(a.Translate,{content:"titleCodeEditor"});case d.MODE_SHOW:return(0,i.jsx)(a.Translate,{content:"titleCodeViewer"});case d.MODE_HTML:return(0,i.jsx)(a.Translate,{content:"titleHtmlEditor"});default:return}},b=({domainId:e,currentDir:t,file:s,line:n,type:o,mode:c,isOpen:m,onClose:b,handleReload:y,commonToaster:_=!1,plainForm:C=!1,editorHeight:x,onCancel:v})=>{const[w,S]=(0,i.useState)(c),[D,k]=(0,i.useState)(),[E,I]=(0,i.useState)(),[j,A]=(0,i.useState)(),[R,F]=(0,i.useState)(!1),[P,O]=(0,i.useState)(null),U=(0,r.useCollector)(),M=(0,i.useRef)(),$=(0,i.useRef)(e=>e),T=(({mode:e,domainId:t,currentDir:s,file:i,codepage:n})=>{const o=new URLSearchParams;return o.set("currentDir",s),o.set("file",i),n&&o.set("load_codepage",n),`/smb/file-manager/${e}/domainId/${t}/?${o}`})({domainId:e,currentDir:t,file:s,mode:w,codepage:j});(0,i.useLayoutEffect)(()=>{m&&(S(c),I(void 0),A(void 0))},[m,c]),(0,i.useEffect)(()=>{let e=e=>{I(e)};return m&&(e=>l.api.get(e))(T).then(t=>{e(t)}).catch(O),()=>{e=()=>{}}},[T,m]);const L=(0,i.useCallback)(e=>{_?(0,p.addToast)(e):M.current.add(e)},[_]),B=(0,i.useCallback)(async(e,t)=>{let s;k(t?"apply":"submit"),e={...U.collect(),...e};try{s=await((e,t)=>{const s=new FormData;
1return Object.keys(t).forEach(e=>{s.append(e,t[e])}),l.api.post(e,s)})(T,e)}catch(e){return void L({intent:"danger",message:e.message})}finally{k(void 0)}const{status:n,message:o,statusMessages:a}=s;if("confirmationRequired"===n)return n;"error"===n?a.forEach(({content:e})=>{L({intent:"danger",message:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e}}),role:"alert"})}):(L({intent:n||"success",message:o,role:"status"}),t?I(t=>({...t,content:e.content})):b(),e.saveAs&&y())},[T,U,L,b,y]),N=(0,i.useCallback)(()=>{const{content:e}=U.collect()||{},{content:t}=E||{},s=$.current;s(t)!==s(e)?F(!0):b()},[U,E,b]),H=()=>{if(!E)return{submitButton:!1,applyButton:!1,cancelButton:!1};if("error"===E.status)return{submitButton:!1,applyButton:!1,cancelButton:!0};let e={submitButton:!1,applyButton:!1,cancelButton:{children:(0,i.jsx)(a.Translate,{content:"buttonCancel"}),"data-action":"cancel",onClick:v??N}};if(w===d.MODE_SHOW)E.readonly||(e={...e,additionalButtons:[(0,i.jsx)(a.Button,{onClick:()=>{I(void 0),S(d.MODE_CODE)},"data-action":"editInCodeEditor",children:(0,i.jsx)(a.Translate,{content:"buttonCodeEditor"})},"code"),(0,i.jsx)(a.Button,{onClick:()=>{I(void 0),S(d.MODE_EDIT)},"data-action":"editInTextEditor",children:(0,i.jsx)(a.Translate,{content:"buttonTextEditor"})},"text")]});else e={...e,submitButton:{children:(0,i.jsx)(a.Translate,{content:"buttonSubmit"}),"data-action":"submit"},applyButton:{children:(0,i.jsx)(a.Translate,{content:"buttonApply"}),intent:void 0,"data-action":"apply"},additionalButtons:[(0,i.jsx)(u.default,{onSubmit:B,disabled:Boolean(D)},"1")]};return e},q=(0,i.useRef)(B);(0,i.useEffect)(()=>{q.current=B},[B]);const z=(0,i.useCallback)(()=>q.current({},!0),[]),Q=(0,i.useCallback)(e=>{$.current=e},[]),W=()=>P?(0,i.jsx)(a.StatusMessage,{intent:"danger",children:P.message}):E?"error"===E.status?(0,i.jsx)(a.StatusMessage,{intent:"danger",children:E.message}):(0,i.jsx)(g,{...E,domainId:e,currentDir:t,cursor:n?{line:n}:void 0,fileName:s,onCodepageChange:A,collector:U,onSave:z,registerSanitizer:Q,handleAddToast:L,handleReload:y,editorHeight:x}):(0,i.jsx)(a.ContentLoader,{}),V=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.default,{isOpen:R,onConfirm:()=>{b(),F(!1)},onCancel:()=>F(!1)}),!_&&(0,i.jsx)(a.Toaster,{ref:M,"data-type":"toaster"})]});return C?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.Form,{state:D,...H(),onSubmit:B,onClose:N,children:W()}),V]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.Drawer,{id:`file-editor-${w}`,"data-type":"editor",isOpen:m,size:"lg",title:f(w),subtitle:(0,i.jsx)("div",{className:"permissions__subtitle",children:(0,i.jsxs)("span",{children:[(0,i.jsx)(a.Icon,{src:(0,d.getTypeIcon)({type:o,name:s,isDirectory:!1}),size:"24"})," ",s]})}),form:{state:D,...H(),onSubmit:B},onClose:N,children:W()}),V]})};b.propTypes={domainId:o().string.isRequired,currentDir:o().string.isRequired,file:o().string.isRequired,type:o().string.isRequired,line:o().string,mode:o().oneOf([d.MODE_EDIT,d.MODE_CODE,d.MODE_SHOW,d.MODE_HTML]).isRequired,isOpen:o().bool.isRequired,onClose:o().func.isRequired,handleReload:o().func.isRequired,commonToaster:o().bool,plainForm:o().bool,editorHeight:o().number,onCancel:o().func};const y=()=>{},_=({queryParams:e="",onClose:t=y,...s})=>{const{messages:n}=l.Locale.getSection("smb.components.forms.file-manager.editor"),[o,d]=(0,r.useModal)("editor");let c,u,h,p,g;try{({mode:c,currentDir:u,file:h,type:p,line:g}=JSON.parse((0,m.atobUnicode)(o??e)))}catch{}const f=(0,i.useCallback)(()=>{e?t?.(u):d(!1)},[d,e,t,u]),_=Boolean(c&&u&&h&&p);return _?(0,i.jsx)(a.LocaleBetaProvider,{messages:n,children:(0,i.jsx)(b,{isOpen:_,mode:c,currentDir:u,file:h,line:g,type:p,onClose:f,queryParams:e,...s})}):null};_.propTypes={queryParams:o().string,onClose:o().func};const C=_},1856(e,t,s){s.r(t),s.d(t,{default:()=>r});var i=s(787),n=s.n(i),o=s(397),a=s(396);const l=({isOpen:e,onConfirm:t,onCancel:s})=>(0,a.jsx)(o.Dialog,{size:"xs",isOpen:e,cancelButton:!1,onClose:s,buttons:[(0,a.jsx)(o.Button,{onClick:t,children:(0,a.jsx)(o.Translate,{content:"exitConfirmationYes"})},"yes"),(0,a.jsx)(o.Button,{intent:"primary",onClick:s,children:(0,a.jsx)(o.Translate,{content:"exitConfirmationNo"})},"no")],"data-type":"exitDialog",children:(0,a.jsx)(o.Paragraph,{children:(0,a.jsx)(o.Translate,{content:"exitConfirmation"})})});l.propTypes={isOpen:n().bool.isRequired,onConfirm:n().func.isRequired,onCancel:n().func.isRequired};const r=l},1839(e,t,s){s.r(t),s.d(t,{default:()=>g});var i=s(397),n=s(396),o=s(787),a=s.n(o),l=s(803),r=s.n(l),d=s(95),c=s(1840),u=s(1842),h=s(1843),m=s(672);s(1854);const p=({content:e,codepage:t="",eol:s,collector:o,cursor:a=null,domainId:l,currentDir:p,mode:g,readonly:f=!1,codepageList:b={}
1,eolList:y,onCodepageChange:_=null,fileName:C=null,onSave:x,registerSanitizer:v,handleAddToast:w,handleReload:S,wwwRootPath:D,editorHeight:k=null})=>{const[E,I]=(0,n.useState)(e),[j,A]=(0,n.useState)(t),[R,F]=(0,n.useState)(t),[P,O]=(0,n.useState)(s),U=(0,n.useRef)(null),M=(0,n.useRef)(()=>({}));(0,n.useEffect)(()=>{I(e)},[e]);const $=()=>{if(!U.current)return;const{parentNode:e}=U.current;if(k)U.current.style.height=`${k}px`;else{let t=U.current.closest(".pul-drawer__body").offsetHeight;t-=32,e.childNodes.forEach(e=>{if(e===U.current)return;const s=window.getComputedStyle(e);t-=e.offsetHeight+parseInt(s["margin-top"])+parseInt(s["margin-bottom"])}),U.current.style.height=`${t>300?t:300}px`}},T=(0,n.useCallback)(()=>{$()},[]);(0,n.useEffect)(()=>{$()},[k]);const L=e=>{if(U.current=e,U.current){window.addEventListener("resize",T),$();const t=e.CodeMirror;if(a&&t){const{line:e}=a,{top:s}=t.charCoords({line:e-1-2,ch:0},"local");t.scrollTo(null,s),t.setCursor(e-1,0)}t&&t.refresh()}},B=e=>{I(e)},N=(0,n.useRef)({content:E,codepage:j,saveCodepage:R,eol:P});N.current={content:E,codepage:j,saveCodepage:R,eol:P},(0,n.useEffect)(()=>{o.setCallback(()=>({...N.current,...M.current()}))},[o]),(0,n.useEffect)(()=>()=>{window.removeEventListener("resize",T)},[T]);const H=b?Object.keys(b).map(e=>({key:e,value:b[e]})):null,q=y?Object.keys(y).map(e=>({key:e,value:y[e]})):null;return(0,n.jsx)(i.LocaleBetaProvider,{messages:d.Locale.getSection("smb.controllers.file-manager.form").messages,children:(0,n.jsxs)("div",{className:r()("file-manager"),children:[(g===m.MODE_SHOW||g===m.MODE_EDIT)&&(0,n.jsxs)("fieldset",{children:[(0,n.jsx)("legend",{children:(0,n.jsx)(i.Translate,{content:"loadCodepage"})}),(0,n.jsx)("select",{value:j,onChange:e=>{A(e.target.value)},children:H.map(({key:e,value:t})=>(0,n.jsx)("option",{value:e,children:t},e))})," ",(0,n.jsx)(i.Button,{onClick:()=>_(j),children:(0,n.jsx)(i.Translate,{content:"buttonReload"})}),(0,n.jsx)("p",{className:"hint",children:(0,n.jsx)(i.Translate,{content:"loadCodepageHint"})})]}),(g===m.MODE_SHOW||g===m.MODE_EDIT)&&(0,n.jsx)(c.default,{id:"code",rows:25,cols:80,readonly:g===m.MODE_SHOW||f,onInit:L,onChange:B,onSave:x,autoFocus:g===m.MODE_EDIT,children:E}),g===m.MODE_CODE&&(0,n.jsx)(u.default,{id:"code",rows:25,cols:80,readonly:f,onInit:L,onChange:B,onSave:x,fileName:C,children:E}),g===m.MODE_HTML&&(0,n.jsx)(h.default,{domainId:l,currentDir:p,wwwRootPath:D,readonly:f,onInit:L,onChange:B,onSave:x,registerSanitizer:v,getSavingValueRef:M,handleAddToast:w,handleReload:S,children:e}),g===m.MODE_EDIT&&(0,n.jsxs)("div",{className:"form-row",children:[(0,n.jsx)("div",{className:"field-name",children:(0,n.jsx)("label",{htmlFor:"saveCodepage",children:(0,n.jsx)(i.Translate,{content:"saveCodepage"})})}),(0,n.jsx)("div",{className:"field-value",children:(0,n.jsx)("select",{id:"saveCodepage",value:R,onChange:e=>{F(e.target.value)},children:H.map(({key:e,value:t})=>(0,n.jsx)("option",{value:e,children:t},e))})})]}),g===m.MODE_EDIT&&(0,n.jsxs)("div",{className:"form-row",children:[(0,n.jsx)("div",{className:"field-name",children:(0,n.jsx)("label",{htmlFor:"eol",children:(0,n.jsx)(i.Translate,{content:"eolLabel"})})}),(0,n.jsx)("div",{className:"field-value",children:(0,n.jsx)("select",{id:"eol",value:P,onChange:e=>{O(e.target.value)},children:q.map(({key:e,value:t})=>(0,n.jsx)("option",{value:e,children:t},e))})})]})]})})};p.propTypes={domainId:a().string.isRequired,currentDir:a().string.isRequired,wwwRootPath:a().string.isRequired,mode:a().oneOf([m.MODE_SHOW,m.MODE_EDIT,m.MODE_CODE,m.MODE_HTML]).isRequired,content:a().string.isRequired,readonly:a().bool,codepage:a().string,codepageList:a().object,eol:a().string.isRequired,eolList:a().object.isRequired,cursor:a().shape({line:a().number.isRequired}),collector:a().shape({setCallback:a().func.isRequired}).isRequired,onCodepageChange:a().func,fileName:a().string,onSave:a().func.isRequired,registerSanitizer:a().func.isRequired,handleAddToast:a().func.isRequired,handleReload:a().func.isRequired,editorHeight:a().number};const g=p},1844(e,t,s){s.r(t),s.d(t,{default:()=>f});var i=s(396),n=s(462),o=s(397),a=s(1845),l=s(1846),r=s(1848),d=s(1849),c=s(1850),u=s(1851),h=s(1852),m=s(1847),p=s(95);s(1853);const g=p.Locale.getSection("smb.components.forms.file-manager.html-editor.toolbar"),f=({domainId:e,currentDir:t,wwwRootPath:p,readonly:f=!1,onInit:b,onChange:y,onSave:_,registerSanitizer:C,getSavingValueRef:x,handleAddToast:v,handleReload:w,children:S})=>{const D=(0,i.lazy)(()=>s.e("vendors").then(s.t.bind(s,3323,23)).then(e=>((0,r.initJodit)(e.Jodit,t),{default:e.default}))),k=(0,i.useRef)(null),E=(0,i.useCallback)(e=>{k.current=e},[]),I=(0,i.useRef)(null),j=document.documentElement.getAttribute("data-theme"),A="rtl"===document.documentElement.dir?"rtl":"ltr",{localeCode:R}=(0,n.usePageData)(),F=(0,i.useMemo)(()=>(0,c.getLanguage)(R),[R]),P=(0,i.useMemo)(()=>(0,u.getUploader)(e,t,v,w),[e,t,v,w]),O=(0,i.useCallback)(s=>
1new l.default({jodit:s,domainId:e,currentDir:t,wwwRootPath:p,onSave:_}),[e,t,p,_]),U=(0,i.useMemo)(()=>(0,h.getFilebrowser)(e,t,k),[e,t]),M=(0,i.useCallback)(e=>{const t=e.ctrlKey&&!e.metaKey||e.metaKey&&!e.ctrlKey;"s"!==e.key.toLowerCase()||!t||e.shiftKey||e.altKey||(e.preventDefault(),_())},[_]),$=(0,i.useCallback)(s=>{y((0,m.withOriginalImages)(s,e,t,p))},[y,e,t,p]),T=(0,i.useMemo)(()=>{const e={paste:{tooltip:g.lmsg("paste"),exec:async e=>{try{if(navigator.clipboard){const t=await navigator.clipboard.read();for(const s of t)if(s.types.includes("text/html")){const t=await s.getType("text/html"),i=await t.text();return e.selection.insertHTML(i,!1),!1}const s=await navigator.clipboard.readText();e.selection.insertHTML(s)}else e.execCommand("paste")}catch{e.execCommand("paste")}return!1}}};return{readonly:f,showPlaceholder:!1,autofocus:!0,theme:"dark"===j?"dark":void 0,language:F,direction:A,iframe:!0,editHTMLDocumentMode:!0,iframeStyle:"",iframeTitle:"",iframeDoctype:"",iframeSandbox:"allow-same-origin",tabIndex:0,allowTabNavigation:!1,height:"100%",allowResizeX:!1,allowResizeY:!1,statusbar:!1,addNewLine:!1,toolbarSticky:!0,toolbarAdaptive:!1,sourceEditor:O,spellcheck:!0,defaultActionOnPaste:"insert_as_html",askBeforePasteHTML:!1,askBeforePasteFromWord:!1,processPasteHTML:!0,cleanHTML:{fillEmptyParagraph:!1,replaceNBSP:!1,removeEmptyElements:!1,replaceOldTags:!1,allowTags:!1,denyTags:!1},beautifyHTML:!1,events:{keydown:M},buttons:a.default,uploader:P,filebrowser:U,controls:e}},[f,M,j,F,A,P,U,O]),L=(0,i.useMemo)(()=>(0,m.withPreviewImages)(S,e,t,p),[S,e,t,p]);return(0,i.useEffect)(()=>{b(I?.current)},[b]),(0,i.useEffect)(()=>{C(d.sanitizeContent)},[C]),(0,i.useImperativeHandle)(x,()=>()=>{if(!k.current)return{content:""};k.current.setReadOnly(!0);const s=k.current.getNativeEditorValue(),i=(0,m.withOriginalImages)(s,e,t,p);return k.current.setReadOnly(!1),{content:i}},[e,t,p]),(0,i.jsx)("div",{id:"html-editor",ref:I,children:(0,i.jsx)(i.Suspense,{fallback:(0,i.jsx)(o.Skeleton,{height:"100%"}),children:(0,i.jsx)(D,{editorRef:E,value:L,config:T,onChange:$})})})}},1846(e,t,s){s.r(t),s.d(t,{default:()=>r});var i=s(99),n=s(399),o=s(397),a=s(1847),l=s(396);const r=class{constructor({jodit:e,domainId:t,currentDir:s,wwwRootPath:r,onSave:d}){(0,i.default)(this,"jodit",void 0),(0,i.default)(this,"domainId",void 0),(0,i.default)(this,"currentDir",void 0),(0,i.default)(this,"wwwRootPath",void 0),(0,i.default)(this,"handleSave",void 0),(0,i.default)(this,"root",void 0),(0,i.default)(this,"init",()=>{this.root=(0,n.createRoot)(this.jodit.container.querySelector(".jodit-source"))}),(0,i.default)(this,"destruct",()=>{this.root?.unmount()}),(0,i.default)(this,"getValue",()=>this.jodit.value),(0,i.default)(this,"setValue",()=>{this.root?.render((0,l.jsx)(o.CodeEditor,{id:"html-source-editor",readOnly:this.jodit.getReadOnly(),onChange:e=>{this.jodit.value=(0,a.withPreviewImages)(e,this.domainId,this.currentDir,this.wwwRootPath)},onSave:this.handleSave,autofocus:!0,children:(0,a.withOriginalImages)(this.jodit.value,this.domainId,this.currentDir,this.wwwRootPath)}))}),(0,i.default)(this,"onReadyAlways",e=>{e()}),(0,i.default)(this,"insertRaw",()=>{}),(0,i.default)(this,"getSelectionStart",()=>{}),(0,i.default)(this,"getSelectionEnd",()=>{}),(0,i.default)(this,"setSelectionRange",()=>{}),(0,i.default)(this,"setPlaceHolder",()=>{}),(0,i.default)(this,"focus",()=>{}),(0,i.default)(this,"setReadOnly",()=>{}),(0,i.default)(this,"selectAll",()=>{}),this.jodit=e,this.domainId=t,this.currentDir=s,this.wwwRootPath=r,this.handleSave=d}}},1845(e,t,s){s.r(t),s.d(t,{default:()=>n});const i=s(95).Locale.getSection("smb.components.forms.file-manager.html-editor.toolbar"),n=["bold","italic","underline","strikethrough","|","ul","ol","|","brush","|",{text:i.lmsg("textStyle"),icon:"text_fields",tooltip:i.lmsg("textStyleDesc"),list:{font:"Font family",fontsize:"Font size",paragraph:"Insert format block",eraser:"Clear formatting",copyformat:"Copy format",lineHeight:"Line height",superscript:"Superscript",subscript:"Subscript"}},"|","hr","|","align","|","indent","outdent","|",{text:i.lmsg("insert"),icon:"add_photo_alternate",tooltip:i.lmsg("insertDesc"),list:{image:"Insert image",video:"Insert video",symbols:"Insert special character",link:"Insert link",table:"Insert table",file:"Insert file"}},"|","undo","redo","|","cut","copy",{name:"paste",icon:"paste",list:void 0},"|","find","---","source","|","print","|","fullsize","|","spellcheck","|","selectall","|"]}
1,1852(e,t,s){s.r(t),s.d(t,{getFilebrowser:()=>o});var i=s(1847),n=s(672);const o=(e,t,s)=>{const o={url:`/smb/file-manager/list-data/domainId/${e}`,successStatuses:[200],processData:!0,prepareData:({path:e})=>({currentDir:e.startsWith("/")?e:`/${e}`})};return{ajax:o,showFileName:!0,showFileSize:!0,showFileChangeTime:!0,contextMenu:!1,saveStateInStorage:{storeLastOpenedFolder:!1},getThumbTemplate(e,t,s){const i=this.files.getFullElName("item"),{name:n,isImage:o,fileURL:a,imageURL:l,path:r,size:d,time:c}=e;return`<a\n                data-jodit-file-browser-item="true"\n                data-is-file="${o?0:1}"\n                draggable="true"\n                class="${i}"\n                href="${a}"\n                data-source="${s}"\n                data-path="${r}"\n                data-name="${n}"\n                title="${n}"\n                data-url="${a}">\n                    <img\n                        data-is-file="${o?0:1}"\n                        data-src="${a}"\n                        src="${l}"\n                        alt="${n}"\n                        loading="lazy"\n                    />\n                    <div class="${i}-info">\n                        <span class="${i}-info-filename">${n}</span>\n                        <span class="${i}-info-filesize">${d}</span>\n                        <span class="${i}-info-filechanged">${c}</span>\n                    </div>\n                </a>`},permissionsPresets:{allowFileDownload:!1,allowFileMove:!1,allowFileRemove:!1,allowFileRename:!1,allowFileUpload:!1,allowFileUploadRemote:!1,allowFiles:!0,allowFolderCreate:!1,allowFolderMove:!1,allowFolderRemove:!1,allowFolderRename:!1,allowFolderTree:!1,allowFolders:!0,allowGeneratePdf:!1,allowImageCrop:!1,allowImageResize:!1},isSuccess:({status:e})=>"error"!==e,getMessage:({message:e=""})=>e,items:{...o,process:({data:o,state:{currentDir:a}})=>{const l=s?.current?.filebrowser?.state?.onlyImages;return{data:{sources:[{baseurl:"",path:(0,n.relativePath)(t,a),files:o.filter(({isDirectory:e})=>!e).map(({name:t,type:s,formatedSize:n,modificationDate:o})=>{const r="image"===s;return{name:t,type:s,isImage:r,size:n,changed:o,thumb:r?(0,i.withPreviewUrl)(t,e,a):void 0,thumbIsAbsolute:r,file:l?(0,i.withPreviewUrl)(t,e,a):void 0,fileIsAbsolute:l}}),name:"default"}]}}}},permissions:{...o,process:()=>({data:{permissions:{}}})},folder:{...o,process:({data:e,state:{currentDir:t}})=>({data:{sources:[{baseurl:"",path:t,folders:e.filter(({isDirectory:e})=>e).map(({name:e})=>e),name:"default"}]}})}}}},1850(e,t,s){s.r(t),s.d(t,{getLanguage:()=>i});const i=(e="")=>{switch(e=e.toLocaleLowerCase()){case"nb-no":case"uk-ua":return e.split("-")[1];case"cs-cz":case"pt-br":case"zh-cn":case"zh-tw":return e.replace("-","_");default:return e.split("-")[0]}}},1851(e,t,s){s.r(t),s.d(t,{getUploader:()=>o});var i=s(1847);const n=()=>document.querySelector('.jodit-drag-and-drop__file-box input[type="file"]')?.getAttribute("accept")?.includes("image"),o=(e,t,s,o)=>{const a=e=>{s({message:e,intent:"danger"})};return{url:`/smb/file-manager/upload/domainId/${e}/overwrite/false?currentDir=${encodeURIComponent(t)}`,getMessage:({message:e})=>e,isSuccess:({status:e})=>!!e,prepareData:e=>(n()&&e.set("image","true"),e),process:({status:e,message:t,files:s})=>({files:s,path:"",baseurl:"",error:"SUCCESS"===e?0:1,msg:t}),defaultHandlerSuccess({files:s,error:l,msg:r}){if(l)return void a(r);const d=n();s.forEach(s=>{d?this.s.insertImage((0,i.withPreviewUrl)(s,e,t),null,300):this.s.insertNode(this.createInside.fromHTML(`<a href="${s}" title="${s}">${s}</a>`))}),o()},error:e=>a(e)}}},1843(e,t,s){s.r(t),s.d(t,{default:()=>i.default});var i=s(1844)},1848(e,t,s){s.r(t),s.d(t,{initJodit:()=>a});const i="opensearchdialog",n="openreplacedialog",o=e=>{"Enter"===e.key&&e.preventDefault()},a=(e,t)=>{e.plugins.add("searchPreventEnter",e=>{e.events.on("afterCommand",t=>{if([i,n].includes(t)){e.container.querySelectorAll(".jodit-ui-search input").forEach(e=>{e.addEventListener("keydown",o)})}})}),e.plugins.add("filebrowserCurrentPath",e=>{e.filebrowser.events.on("beforeOpen",()=>{e.filebrowser.state.currentPath=t})}),e.defaultOptions.createAttributes={table:{style:"width: 100%; border: none; border-collapse: collapse; empty-cells: show; max-width: 100%;"},tr:{style:"border: 1px solid #ccc; padding: 2px 5px;"},td:{style:"border: 1px solid #ccc; padding: 2px 5px;"}}}}
1,1849(e,t,s){s.r(t),s.d(t,{sanitizeContent:()=>i});const i=e=>{const t=/<body[\s\S]*<\/body>/im,s=t.exec(e);if(!s)return e;const i="{%%BODY%%}";return e=e.replace(t,i).replace(i,s[0].replace(/(<body[^>]*?)\sstyle\s*=\s*(['"])([^'"]*?)min-height["'\s]*:[\s"']*[0-9]+(px|%);["']*/im,"$1").replace(/(<body[^>]*?)\scontenteditable["'\s]*=[\s"']*true["']?/im,"$1").replace(/(<body[^>]*?)\sspellcheck["'\s]*=[\s"'](?:true|false)["']?/im,"$1").replace(/(<body[^>]*?)\sdir["'\s]*=[\s"'](?:ltr|rtl)["']?/im,"$1").replace(/<(style|script|span)[^>]+jodit[^>]+>.*?<\/\1>/g,"")).replace(/(class\s*=\s*)(['"])([^"']*)(jodit-wysiwyg|jodit)([^"']*\2)/g,"$1$2$3$5")}},1847(e,t,s){s.r(t),s.d(t,{withOriginalImages:()=>h,withPreviewImages:()=>r,withPreviewUrl:()=>p});var i=s(672),n=s(95);const o=/<img[^>]*\s+src\s*=\s*["']([^"']+)["']/gi,a=/<img[^>]*\s+(srcset)\s*=/gi,l=/<link[^>]*\s+href\s*=\s*["']([^"']+)["']/gi,r=(e,t,s,i)=>e.replace(o,d(p,t,s,i)).replace(a,c).replace(l,d(g,t,s,i)),d=(e,t,s,o)=>(a,l)=>{if(["http://","https://","//","data:"].some(e=>l.startsWith(e)))return a;const r=l.startsWith("/"),d=(0,n.unescapeHtml)(l),c=(0,i.baseName)(d),u=(0,i.joinPaths)(r?o:s,(0,i.dirName)(d));return a.replace(l,(0,n.escapeHtml)(e(c,t,u,r)))},c=(e,t)=>e.replace(t,`data-plesk-ignore-attr-${t}`),u=/data-plesk-ignore-attr-/gi,h=(e,t,s,i)=>e.replace(o,m(`/smb/file-manager/show-image/domainId/${t}/`,s,i)).replace(u,"").replace(l,m(`/smb/file-manager/preview-css/domainId/${t}/`,s,i)),m=(e,t,s)=>(o,a)=>{if(!a.startsWith(e))return o;const l=new URL((0,n.unescapeHtml)(a),window.location.origin),r=l.searchParams.get("file")||"",d=l.searchParams.get("currentDir")||t,c="true"===l.searchParams.get("root"),u=(0,i.joinPaths)(c?`/${(0,i.relativePath)(s,d)}`:(0,i.relativePath)(t,d),r);return o.replace(a,(0,n.escapeHtml)(u))},p=(e,t,s,i=!1)=>`/smb/file-manager/show-image/domainId/${t}/?file=${encodeURIComponent(e)}&currentDir=${encodeURIComponent(s)}${i?"&root=true":""}`,g=(e,t,s,i=!1)=>`/smb/file-manager/preview-css/domainId/${t}/?file=${encodeURIComponent(e)}&currentDir=${encodeURIComponent(s)}${i?"&root=true":""}`},1855(e,t,s){s.r(t),s.d(t,{default:()=>r});var i=s(396),n=s(787),o=s.n(n),a=s(397);const l=({onSubmit:e,disabled:t})=>{const[s,n]=(0,i.useState)(""),[o,l]=(0,i.useState)(!1),[r,d]=(0,i.useState)(!1),c=async(t=!1)=>{l(!1);"confirmationRequired"===await e({saveAs:s,overwrite:t})&&d(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.Popover,{target:(0,i.jsx)(a.Button,{size:"lg",onClick:()=>{l(!o)},"data-action":"saveAs",disabled:t,children:(0,i.jsx)(a.Translate,{content:"buttonSaveAs"})}),visible:o,onClose:()=>l(!1),"data-type":"saveAsPopover",children:(0,i.jsxs)("div",{children:[(0,i.jsx)(a.Input,{autoFocus:!0,value:s,onChange:e=>n(e.target.value),onKeyDown:e=>{"Enter"===e.key&&c()}})," ",(0,i.jsx)(a.Button,{intent:"primary",icon:"enter","data-action":"submit",onClick:()=>c()})]})},"1"),r&&(0,i.jsxs)(a.Dialog,{isOpen:!0,size:"xs",cancelButton:!1,buttons:[(0,i.jsx)(a.Button,{onClick:()=>{d(!1),c(!0)},children:(0,i.jsx)(a.Translate,{content:"exitConfirmationYes"})},"yes"),(0,i.jsx)(a.Button,{intent:"primary",onClick:()=>{d(!1)},children:(0,i.jsx)(a.Translate,{content:"exitConfirmationNo"})},"no")],children:[(0,i.jsx)(a.Paragraph,{children:(0,i.jsx)(a.Translate,{content:"fileOverwrite"})}),(0,i.jsx)(a.Paragraph,{children:(0,i.jsx)(a.Translate,{content:"fileOverwriteDescription"})})]})]})};l.propTypes={onSubmit:o().func.isRequired,disabled:o().bool.isRequired};const r=l},1840(e,t,s){s.r(t),s.d(t,{default:()=>c});var i=s(99),n=s(396),o=s(787),a=s.n(o),l=s(803),r=s.n(l);s(1841);class d extends n.Component{constructor(...e){super(...e),(0,i.default)(this,"state",{content:this.props.value||this.props.children}),(0,i.default)(this,"handleChange",e=>{if(this.props.readonly)return;const t=e.target.value;this.setState({content:t},()=>{const{onChange:e}=this.props;e&&e(t)})}),(0,i.default)(this,"handleKeyDown",e=>{const t=e.ctrlKey&&!e.metaKey||e.metaKey&&!e.ctrlKey;"s"!==e.key.toLowerCase()||!t||e.shiftKey||e.altKey||(e.preventDefault(),this.props.onSave())})}componentDidMount(){const{onInit:e}=this.props;e&&e(this.textareaNode)}componentWillReceiveProps({value:e,children:t}){const s=e||t;this.props.onChange&&s!==this.state.content&&(this.setState({content:s}),this.textareaNode.value=s)}shouldComponentUpdate({value:e,children:t}){return(e||t)!==this.state.content}render(){const{className:e,readonly:t,...s}=this.props,{content:i}=this.state;return delete s.children,delete s.value,delete s.onChange,(0,n.jsx)("textarea",{ref:e=>this.textareaNode=e,className:r()("file-manager__text-editor",e),defaultValue:i,onChange:this.handleChange,onKeyDown:this.handleKeyDown,readOnly:t,...s})}}d.propTypes={children:a().any,value:a().string,className:a().string,readonly:a().bool,onInit:a().func,onChange:a().func,onSave:a().func.isRequired},d.defaultProps={children:"",value:"",className:"",readonly:!1,onInit:null,onChange:null};const c=d},1837(e,t,s){s.r(t),s.d(t,{default:()=>i.default});var i=s(1838)},1822(e,t,s){s.r(t),s.d(t,{default:()=>S});var i=s(396),n=s(715),o=s(787),a=s.n(o),l=s(803),r=s.n(l),d=s(507),c=s(95),u=s(1823),h=s(801),m=s(827),p=s(1837),g=s(1857),f=s(1871),b=s(1872),y=s(1870),_=s(1884);const C=c.Locale.getSection("smb.components.lists.contentfiles"),x="fm-hidden-tree",v="search",w=({domainId:e,...t})=>
1{const s=(0,n.useNavigate)(),[o,a]=(0,n.useSearchParams)(),{uploadModals:l,openReplaceExistingFilesDialog:h,updateUploadProgressDialogProps:w,handleCloseUpload:S,closeUploadProcessDialog:D}=(0,_.default)(),[k,E]=(0,i.useState)(()=>new URLSearchParams(window.location.search).get(v)||""),[I,j]=(0,i.useState)(!1),[A,R]=(0,i.useState)(t.data.state),[F,P]=(0,i.useState)(t.data.pathbar),[O,U]=(0,i.useState)(!1),[M,$]=(0,i.useState)(()=>!!localStorage.getItem(x)),[T,L]=(0,i.useState)(!1),B=()=>{L(!1),$(!1),localStorage.removeItem(x)},N=({isDisableAnimation:e=!1}={})=>{L(e),$(!0),localStorage.setItem(x,!0)},H=()=>M?B():N(),{explorer:q,tree:z}=(0,i.useMemo)(()=>{let i=null;const n=new c.FileManager.Tree({id:"fm-tree",cls:"tree",data:t.directoriesTree,dataUrl:`/smb/file-manager/tree-data/domainId/${e}`,rootNodeTitle:C.lmsg("rootDirectory"),onNodeClick:e=>i.changeDirectory(e,!0)}),o={domainId:e,tree:n,itemActions:{logBrowser:({name:t})=>{const{currentDir:s,file:n}=i.getFileParams(t);(0,c.redirect)((0,c.addUrlParams)(`/smb/log-file/browser/id/${e}/`,{returnUrl:`/smb/file-manager/list/domainId/${e}/`,custom:!0,file:s+n}))}},commonToaster:!0,onListStateChange:R,onPathbarChange:P,onSearchLoadingChange:j,onResetSearch:()=>E(""),onEnable:()=>U(!1),onDisable:()=>U(!0),navigate:s,onOpenReplaceExistingFilesDialog:h,onChangeUploadProgress:w,onCancelUpload:D,onCloseUpload:S,...t};return i=new u.default(o),{tree:n,explorer:i}},[]);(0,i.useLayoutEffect)(()=>()=>{q.remove()},[q]),(0,i.useEffect)(()=>{k&&setTimeout(()=>{q.search(k,d.default.get(y.MODE_COOKIE_NAME)||"path"),E(k)})},[]),(0,i.useEffect)(()=>{o.get("search")!==k&&(k?o.set(v,k):o.delete(v),a(o,{replace:!0,preventScrollReset:!0}))},[k,o,a]);const Q=t.additionalColumns,W=(0,i.useCallback)(()=>{q.reload(`?currentDir=${encodeURIComponent(q.getCurrentDir())}`)},[q]);return(0,i.jsxs)("div",{className:r()("fm objects-management-box objects-management-box-collapsible clearfix",{"objects-management-box-collapsed":M,"fm-hidden-tree":T}),children:[(0,i.jsx)("div",{id:"objects-list",className:"objects-list",children:(0,i.jsx)("div",{className:"objects-content",children:(0,i.jsx)(m.default,{id:"objects-list-content-area",className:"objects-content-area",children:z})})}),(0,i.jsx)("div",{id:"fm-frame-switcher",className:"frame-switcher",onClick:H,onKeyDown:e=>"Enter"===e.key&&H(),role:"button",tabIndex:0,"aria-label":C.lmsg(M?"showTree":"hideTree"),children:(0,i.jsx)("div",{className:"frame-switcher-wrap",children:(0,i.jsx)("span",{})})}),(0,i.jsxs)("div",{id:"objects-details",className:"objects-details",children:[(0,i.jsx)("div",{id:"objects-warnings",className:"warning-block",style:{display:"none"}}),(0,i.jsxs)("div",{id:"fm-actions-box",className:"actions-box",style:{position:"relative"},children:[(0,i.jsx)(g.default,{domainId:e,explorer:q,listState:A,isSearchLoading:I,searchValue:k,onSearchValueChange:E,isHiddenTree:M,showTree:B,hideTree:()=>N({isDisableAnimation:!0})}),O&&(0,i.jsx)("div",{className:"content-blocker"})]}),!O&&(0,i.jsx)(f.default,{id:"fm-pathbar",className:"fm-pathbar",items:F.items,onItemClick:e=>q.changeDirectory(e,!0)}),(0,i.jsx)(m.default,{children:q})]}),(0,i.jsx)(b.default,{domainId:e,isUnix:Q,onComplete:()=>Q&&W(),commonToaster:!0}),(0,i.jsx)(p.default,{domainId:e,handleReload:W,commonToaster:!0}),l]})};w.propTypes={domainId:a().number.isRequired,additionalColumns:a().bool.isRequired,data:a().shape({pathbar:a().shape({items:a().arrayOf(a().shape({title:a().string.isRequired,href:a().string})).isRequired}).isRequired,state:a().shape({currentDir:a().string,currentDirReadonly:a().bool,inTrashFolder:a().bool,trashEnabled:a().bool,trashRotationEnabled:a().bool}).isRequired}).isRequired,directoriesTree:a().arrayOf(a().shape({isDirectory:a().bool,name:a().string,path:a().string})).isRequired};const S=(0,h.withPageLayout)(w,({domainId:e})=>({key:e}))},1857(e,t,s){s.r(t),s.d(t,{default:()=>x});var i=s(396),n=s(787),o=s.n(n),a=s(397),l=s(95),r=s(1858),d=s(1860),c=s(1861),u=s(1862),h=s(1835),m=s(1863),p=s(1864),g=s(1865),f=s(1866),b=s(1868),y=s(1870);const _=l.Locale.getSection("smb.components.lists.contentfiles"),C=({domainId:e,explorer:t,listState:s,isSearchLoading:n,searchValue:o,onSearchValueChange:C,isHiddenTree:x,showTree:v,hideTree:w})=>{const[S,D]=(0,i.useState)(!1),[k,E]=(0,i.useState)(!1),I=s.trashEnabled&&s.inTrashFolder,j=(0,i.useCallback)(()=>{t.reload(`?currentDir=${encodeURIComponent(s.currentDir)}`)},[t,s.currentDir]);return(0,i.jsxs)(i.Fragment,{children:[S&&(0,i.jsx)(b.default,{onClose:()=>D(!1)}),(0,i.jsx)(f.default,{isOpen:k,onClose:()=>E(!1),domainId:e,currentDir:s.currentDir,onUploadComplete:j}
1),(0,i.jsxs)(a.Toolbar,{children:[!o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.ToolbarGroup,{title:_.lmsg("select"),className:"r-actions",children:(0,i.jsx)(a.Button,{component:"div",tabIndex:"-1",style:{minWidth:"auto",padding:"4px"},children:(0,i.jsx)(a.Checkbox,{onChange:t.handleSelectButtonClick})})}),(0,i.jsx)(a.ToolbarGroup,{title:_.lmsg("addNew"),children:(0,i.jsx)(a.Dropdown,{"data-id":"buttonNew",menu:(0,i.jsxs)(a.Menu,{children:[(0,i.jsx)(m.default,{id:"upload-file-button",disabled:s.currentDirReadonly,tooltip:s.currentDirReadonly?_.lmsg("tooltipReadOnly"):_.lmsg("hintUploadFiles"),uploadPopupParams:t._uploadPopupParams,children:_.lmsg("buttonUploadFiles")}),(0,i.jsx)(a.MenuItem,{"data-id":"buttonUploadDirectory",disabled:s.currentDirReadonly,tooltip:s.currentDirReadonly?_.lmsg("tooltipReadOnly"):null,onClick:()=>{t._dropArea.isButtomUploadDirectory=!0,t._dropArea.show()},children:_.lmsg("buttonUploadDirectory")}),(0,i.jsx)(a.MenuItem,{disabled:s.currentDirReadonly,tooltip:s.currentDirReadonly?_.lmsg("tooltipReadOnly"):null,"data-id":"buttonImportFileViaUrl",onClick:()=>E(!0),children:_.lmsg("buttonImportFileViaUrl")}),(0,i.jsx)(a.MenuDivider,{}),(0,i.jsx)(a.MenuItem,{"data-id":"buttonNewFile",disabled:s.currentDirReadonly,tooltip:s.currentDirReadonly?_.lmsg("tooltipReadOnly"):_.lmsg("hintNewFile"),onClick:()=>{t.showPopup(c.default,{id:"fm-create-file",renderTo:"fm-modal-dialog-box-create-file",cls:"popup-panel",handlerUrl:t.getFileManagerUrl("create-file"),titleCls:"pp-add-file"})},children:_.lmsg("buttonNewFile")}),(0,i.jsx)(a.MenuItem,{"data-id":"buttonNewDirectory",disabled:s.currentDirReadonly,tooltip:s.currentDirReadonly?_.lmsg("tooltipReadOnly"):_.lmsg("hintNewDirectory"),onClick:()=>{t.showPopup(u.default,{id:"fm-create-directory",renderTo:"fm-modal-dialog-box-create-directory",cls:"popup-panel",handlerUrl:t.getFileManagerUrl("create-directory"),titleCls:"pp-add-folder"})},children:_.lmsg("buttonNewDirectory")})]}),children:(0,i.jsx)(a.Button,{intent:"primary",icon:"plus","aria-label":_.lmsg("addNew")})})}),(0,i.jsxs)(a.ToolbarGroup,{title:_.lmsg("actions"),children:[(0,i.jsx)(a.Button,{"data-id":"buttonCopyFiles",tooltip:_.lmsg("hintCopyFiles"),onClick:()=>{t.hasSelectedItems(()=>{t.showPopup(r.default,{id:"fm-copy-files",renderTo:"fm-modal-dialog-box-copy-files",cls:"popup-panel",handlerUrl:t.getFileManagerUrl("copy-files"),titleCls:"pp-copy",tree:t._copyMoveTreeConfig})})},children:_.lmsg("buttonCopyFiles")}),(0,i.jsx)(a.Button,{"data-id":"buttonMoveFiles",tooltip:_.lmsg("hintMoveFiles"),onClick:()=>{t.hasSelectedItems(()=>{t.showPopup(p.default,{id:"fm-move-files",renderTo:"fm-modal-dialog-box-move-files",cls:"popup-panel",handlerUrl:t.getFileManagerUrl("move-files"),titleCls:"pp-move",tree:t._copyMoveTreeConfig})})},children:_.lmsg("buttonMoveFiles")}),(0,i.jsx)(a.Dropdown,{"data-id":"buttonArchive",menu:(0,i.jsxs)(a.Menu,{children:[(0,i.jsx)(a.MenuItem,{"data-id":"buttonExtractArchive",tooltip:_.lmsg("hintExtractArchive"),onClick:()=>{t.hasSelectedItems(()=>{t.showPopup(h.default,{id:"fm-extract-archive",renderTo:"fm-modal-dialog-box-extract-archive",cls:"popup-panel",handlerUrl:t.getFileManagerUrl("extract-archive"),titleCls:"pp-archive-extract"})})},children:_.lmsg("buttonExtractArchive")}),(0,i.jsx)(a.MenuItem,{"data-id":"buttonCreateArchive",tooltip:_.lmsg("hintCreateArchive"),onClick:()=>{t.hasSelectedItems(()=>{t.showPopup(d.default,{id:"fm-create-archive",renderTo:"fm-modal-dialog-box-create-archive",cls:"popup-panel",handlerUrl:t.getFileManagerUrl("create-archive"),titleCls:"pp-archive-create"})})},children:_.lmsg("buttonCreateArchive")})]}),children:_.lmsg("buttonArchiveActions")}),(0,i.jsx)(a.Dropdown,{"data-id":"buttonMore",menu:(0,i.jsxs)(a.Menu,{children:[(0,i.jsx)(a.MenuItem,{"data-id":"buttonCalculateSize",tooltip:_.lmsg("hintCalculateSize"),onClick:()=>{t.calculateSize((0,l.addUrlParams)(t.getFileManagerUrl("calculate-size"),{currentDir:t.getCurrentDir()}))},children:_.lmsg("buttonCalculateSize")}),(0,i.jsx)(a.MenuItem,{"data-id":"buttonChangeTimestamp",tooltip:_.lmsg("hintChangeTimestamp"),onClick:()=>{t.execGroupOperation({url:(0,l.addUrlParams)(t.getFileManagerUrl("touch"),{currentDir:t.getCurrentDir()}),skipConfirmation:!0})},children:_.lmsg("buttonChangeTimestamp")}),(0,i.jsx)(a.MenuDivider,{}),(0,i.jsx)(a.MenuItem,{"data-id":"buttonView",tooltip:_.lmsg("hintView"),onClick:()=>{t.showPopup(g.default,{id:"fm-view-settings",renderTo:"fm-modal-dialog-box-view-settings",cls:"popup-panel",handlerUrl:t.getFileManagerUrl("view-settings"),settings:{folderTree:!0,previewPanel:!1,systemFiles:!0,permissions:t._additionalColumns,userAndGroup:t._additionalColumns},initialValues:{folderTree:!x},showTree:v,hideTree:w})},children:_.lmsg("buttonView")})]}),children:_.lmsg("buttonMoreActions")})]})]}),!o&&!I&&(0,i.jsx)(a.ToolbarGroup,{title:_.lmsg("remove"),children:(0,i.jsx)(a.Button,{"data-id":"buttonDeleteFile",tooltip:_.lmsg("hintDeleteFile"),onClick:e=>{const i=t.getSelectedItems();t.deleteFile({url:(0,l.addUrlParams)(t.getFileManagerUrl("delete"),{currentDir:t.getCurrentDir()}),mouseEvent:e,text:_.formatMessage(s.trashEnabled?"confirmOnDeleteToTrash":"confirmOnDelete",{name:`<b>${(0,l.escapeHtml)(i[0]?.name)}
1</b>`,count:i.length})})},children:_.lmsg("buttonDeleteFile")})}),!o&&I&&(0,i.jsxs)(a.ToolbarGroup,{title:_.lmsg("remove"),children:[(0,i.jsx)(a.Button,{"data-id":"buttonPurgeFile",tooltip:_.lmsg("hintPurgeFile"),onClick:e=>{const s=t.getSelectedItems();t.purgeFile({url:(0,l.addUrlParams)(t.getFileManagerUrl("purge")),mouseEvent:e,text:_.formatMessage("confirmOnPurge",{name:`<b>${(0,l.escapeHtml)(s[0]?.name)}</b>`,count:s.length})})},children:_.lmsg("buttonPurgeFile")}),(0,i.jsx)(a.Button,{"data-id":"buttonPurgeAll",tooltip:_.lmsg("hintPurgeAll"),onClick:e=>{t.purgeAll({url:(0,l.addUrlParams)(t.getFileManagerUrl("purge-all")),checkSelection:()=>!0,mouseEvent:e,locale:{confirmOnGroupOperation:_.lmsg("confirmOnPurgeAll")}})},children:_.lmsg("buttonPurgeAll")})]}),s.trashRotationEnabled&&s.inTrashFolder&&(0,i.jsx)(a.ToolbarGroup,{title:"Rotation",children:(0,i.jsx)(a.Button,{"data-id":"buttonRotationSettings",tooltip:_.lmsg("hintRotationSettings"),onClick:()=>D(!0),children:_.lmsg("buttonRotationSettings")})}),(0,i.jsx)(a.ToolbarExpander,{}),(0,i.jsx)(y.default,{locale:_,onSubmit:(e,s)=>{e?t.search(e,s):t.changeDirectory(t.getCurrentDir(),!0),C(e)},value:o,loading:n})]},s.currentDir)]})};C.propTypes={domainId:o().number.isRequired,explorer:o().object.isRequired,listState:o().shape({currentDir:o().string,currentDirReadonly:o().bool,inTrashFolder:o().bool,trashEnabled:o().bool,trashRotationEnabled:o().bool}).isRequired,isSearchLoading:o().bool.isRequired,searchValue:o().string.isRequired,onSearchValueChange:o().func.isRequired,isHiddenTree:o().bool.isRequired,showTree:o().func.isRequired,hideTree:o().func.isRequired};const x=C},1867(e,t,s){s.r(t),s.d(t,{default:()=>u});var i=s(396),n=s(787),o=s.n(n),a=s(397),l=s(95),r=s(860);const d=({onClose:e,domainId:t,currentDir:s,onTaskReceive:n})=>{const[o,d]=(0,i.useState)(null),[c,u]=(0,i.useState)({}),h=(({domainId:e,currentDir:t})=>{const s=new URLSearchParams;return s.set("currentDir",t),`/smb/file-manager/import-file/domainId/${e}/?${s}`})({domainId:t,currentDir:s}),{messages:m}=l.Locale.getSection("smb.components.forms.file-manager.import-file");return(0,i.jsx)(a.LocaleBetaProvider,{messages:m,children:(0,i.jsx)(a.Dialog,{size:"xs",isOpen:!0,onClose:e,form:{state:o,errors:c,vertical:!0,onSubmit:async t=>{d("submit");try{const s=await l.api.post(h,(0,r.toFormData)(t));if("success"===s.status)(0,l.clearStatusMessages)(),n(s.task),e();else if(s.statusMessages)(0,l.clearStatusMessages)(),s.statusMessages.forEach(({status:e,content:t})=>{(0,l.addStatusMessage)(e,t)}),e();else{const e={url:{failure:(0,i.jsx)(a.Translate,{content:"failure"})}};s.message&&(e.url.message=s.message),u(e)}}catch(e){u({url:{failure:e.message}})}d(null)},submitButton:{children:(0,i.jsx)(a.Translate,{content:"buttonSubmit"}),"data-action":"submit","data-testid":"submit"},cancelButton:{"data-action":"cancel"}},children:(0,i.jsx)(a.FormFieldText,{name:"url",label:(0,i.jsx)(a.Translate,{content:"fieldUrl"}),description:(0,i.jsx)(a.Translate,{content:"fieldUrlDescription"}),fullDescription:(0,i.jsx)(a.Translate,{content:"fieldUrlFullDescription"}),required:!0,size:"fill",autoFocus:!0})})})};d.propTypes={onClose:o().func.isRequired,currentDir:o().string.isRequired,domainId:o().number.isRequired,onTaskReceive:o().func.isRequired};const c=({isOpen:e,onUploadComplete:t,...s})=>{const n=(0,i.useRef)({});return(0,i.useEffect)(()=>{const e=({id:e,status:s})=>{n.current[e]&&"done"===s&&(delete n.current[e],t())};return l.Observer.append(e,"plesk:taskComplete"),()=>l.Observer.remove(e,"plesk:taskComplete")},[t]),e&&(0,i.jsx)(d,{...s,onTaskReceive:e=>n.current[e.id]=!0})};c.propTypes={isOpen:o().bool.isRequired,onUploadComplete:o().func.isRequired};const u=c},1866(e,t,s){s.r(t),s.d(t,{default:()=>i.default});var i=s(1867)},1871(e,t,s){s.r(t),s.d(t,{default:()=>r});var i=s(396),n=s(787),o=s.n(n),a=s(397);const l=({items:e,onItemClick:t,...s})=>(0,i.jsx)(a.Breadcrumbs,{className:"file-manager-pathbar",...s,children:e.map(({title:e,href:s})=>s?(0,i.jsx)(a.Link,{onClick:()=>t(s),children:e},s):(0,i.jsx)(i.Fragment,{children:e},"current"))});l.propTypes={items:o().arrayOf(o().shape({title:o().string.isRequired,href:o().string})).isRequired,onItemClick:o().func.isRequired};const r=l},1873(e,t,s){s.r(t),s.d(t,{default:()=>l});var i=s(806),n=s(1836),o=s(1874),a=s(396);const l=e=>{const[t,s]=(0,i.useModal)("permissions");let l,r,d,c;try{({currentDir:l,file:r,icon:d,isDirectory:c}=JSON.parse((0,n.atobUnicode)(t)))}catch{}const u=Boolean(l&&r&&d);return u?(0,a.jsx)(o.default,{isOpen:u,currentDir:l,file:r,icon:d,isDirectory:c,onClose:()=>{s(!1)},...e}):null}}
1,1872(e,t,s){s.r(t),s.d(t,{default:()=>i.default});var i=s(1873)},1885(e,t,s){s.r(t),s.d(t,{default:()=>c});var i=s(787),n=s.n(i),o=s(397),a=s(95),l=s(396);const r=a.Locale.getSection("smb.controllers.file-manager.upload"),d=({isOpen:e,items:t,onClose:s,onReplaceClick:i,onSkipClick:n})=>(0,l.jsxs)(o.Dialog,{isOpen:e,onClose:s,cancelButton:!1,title:r.lmsg("replaceExistingFilesDialogTitle"),size:"xs",buttons:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.Button,{onClick:()=>{s(),i()},children:r.lmsg("buttonReplace")}),(0,l.jsx)(o.Button,{onClick:()=>{s(),n()},children:r.lmsg("buttonSkip")},"text")]}),children:[(0,l.jsx)(o.Paragraph,{children:r.lmsg("replaceExistingFilesDialogHint")}),(0,l.jsx)(o.List,{data:t,columns:[{key:"name",render:e=>(0,l.jsx)("span",{className:`type-${(0,a.escapeHtml)(e.type)}`,children:(0,a.escapeHtml)(e.savedFileName)})}]})]});d.propTypes={isOpen:n().bool.isRequired,items:n().arrayOf(n().shape({type:n().string,savedFileName:n().string})).isRequired,onClose:n().func.isRequired,onReplaceClick:n().func.isRequired,onSkipClick:n().func.isRequired};const c=d},1869(e,t,s){s.r(t),s.d(t,{default:()=>c});var i=s(396),n=s(787),o=s.n(n),a=s(397),l=s(95),r=s(860);const d=({onClose:e})=>{const[t,s]=(0,i.useState)({rotationBySizeEnabled:!1,rotationBySizeLimit:null,rotationByDateEnabled:!1,rotationByDateLimit:null}),[n,o]=(0,i.useState)({}),[d,c]=(0,i.useState)("apply"),u="/smb/file-manager/rotation-settings";(0,i.useEffect)(()=>{l.api.get(u).then(({editable:e,...t})=>{s(t),e&&c(null)})},[]);const{messages:h}=l.Locale.getSection("smb.components.forms.file-manager.rotation-settings");return(0,i.jsx)(a.LocaleBetaProvider,{messages:h,children:(0,i.jsxs)(a.Dialog,{size:"sm",isOpen:!0,onClose:e,title:(0,i.jsx)(a.Translate,{content:"title"}),form:{state:d,errors:n,vertical:!1,onSubmit:async()=>{(0,l.clearStatusMessages)(),c("submit");const s=await l.api.post(u,(0,r.toFormData)(t));if("success"===s.status)e(!1);else{if(c(null),s.messages){const e={rotationBySizeLimit:{},rotationByDateLimit:{}};s.messages.rotationBySizeLimit&&(e.rotationBySizeLimit.message=s.messages.rotationBySizeLimit),s.messages.rotationByDateLimit&&(e.rotationByDateLimit.message=s.messages.rotationByDateLimit),o(e)}s.message&&((0,l.addStatusMessage)("error",s.message),e())}},onFieldChange:(e,t)=>
1s(s=>(0,a.setIn)(s,e,t)),submitButton:{"data-action":"submit",children:(0,i.jsx)(a.Translate,{content:"save"})},cancelButton:{"data-action":"cancel",children:(0,i.jsx)(a.Translate,{content:"cancel"})},values:t},children:[(0,i.jsxs)(a.Columns,{gap:"xs",children:[(0,i.jsx)(a.Column,{style:{padding:10},width:170,children:(0,i.jsx)(a.FormFieldCheckbox,{"data-id":"rotationBySizeEnabled",name:"rotationBySizeEnabled",label:(0,i.jsx)(a.Translate,{content:"rotationBySize"}),style:{paddingTop:8}})}),(0,i.jsx)(a.Column,{style:{padding:10},fill:!0,children:(0,i.jsx)(a.FormField,{"data-id":"rotationBySizeLimit",name:"rotationBySizeLimit",label:null,children:({getId:e,getName:s,getValue:n,setValue:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.Input,{id:e(),name:s(),value:n(),onChange:({target:e})=>o(e.value),disabled:!t.rotationBySizeEnabled||null!==d,style:{width:70},size:null})," ",(0,i.jsx)("div",{style:{verticalAlign:"middle",display:"inline"},children:(0,i.jsx)(a.Translate,{content:"rotationBySizeUnits"})})]})})}),(0,i.jsx)(a.Column,{width:290,style:{padding:10},children:(0,i.jsx)(a.Hint,{children:(0,i.jsx)(a.Translate,{content:"rotationBySizeHint"})})})]}),(0,i.jsxs)(a.Columns,{gap:"xs",children:[(0,i.jsx)(a.Column,{width:170,style:{padding:10},children:(0,i.jsx)(a.FormFieldCheckbox,{"data-id":"rotationByDateEnabled",name:"rotationByDateEnabled",label:(0,i.jsx)(a.Translate,{content:"rotationByDate"}),style:{paddingTop:8}})}),(0,i.jsx)(a.Column,{style:{padding:10},fill:!0,children:(0,i.jsx)(a.FormField,{"data-id":"rotationByDateLimit",name:"rotationByDateLimit",label:null,children:({getId:e,getName:s,getValue:n,setValue:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.Input,{id:e(),name:s(),value:n(),onChange:({target:e})=>o(e.value),disabled:!t.rotationByDateEnabled||null!==d,style:{width:70},size:null})," ",(0,i.jsx)("div",{style:{verticalAlign:"middle",display:"inline"},children:(0,i.jsx)(a.Translate,{content:"rotationByDateUnits"})})]})})}),(0,i.jsx)(a.Column,{width:290,style:{padding:10},children:(0,i.jsx)(a.Hint,{children:(0,i.jsx)(a.Translate,{content:"rotationByDateHint"})})})]})]})})};d.propTypes={onClose:o().func.isRequired};const c=d},1868(e,t,s){s.r(t),s.d(t,{default:()=>i.default});var i=s(1869)},1870(e,t,s){s.r(t),s.d(t,{MODE_COOKIE_NAME:()=>d,default:()=>u});var i=s(99),n=s(396),o=s(507),a=s(787),l=s.n(a),r=s(397);const d="fm-search-bar-mode";class c extends n.Component{constructor(e){super(e),(0,i.default)(this,"handleSubmit",e=>{this.props.onSubmit(e,this.state.mode)}),(0,i.default)(this,"handleModeChange",e=>{const t=e.props.value;this.saveMode(t),this.setState({mode:t})}),(0,i.default)(this,"saveMode",e=>{o.default.set(d,e,null,"/")}),this.state={mode:o.default.get(d)||"path"}}render(){const{loading:e,value:t,locale:s}=this.props,{mode:i}=this.state,o=[{value:"path",name:s.lmsg("menuItemFilename"),dataId:"menuItemSearchInFilename"},{value:"both",name:s.lmsg("menuItemFilenameAndContent"),dataId:"menuItemSearchInFilenameAndContent"},{value:"content",name:s.lmsg("menuItemContent"),dataId:"menuItemSearchInContent"}],a={path:s.lmsg("searchInFilename"),both:s.lmsg("searchInFilenameAndContent"),content:s.lmsg("searchInContent")},l=(0,n.jsx)(r.Menu,{onItemClick:this.handleModeChange,children:o.map(e=>(0,n.jsx)(r.MenuSelectableItem,{selected:i===e.value,value:e.value,"data-id":e.dataId,children:e.name},e.value))});return(0,n.jsxs)(r.ToolbarGroup,{title:"Search",groupable:!1,"data-id":"toolBarSearch",children:[(0,n.jsx)(r.SearchBar,{onSearch:this.handleSubmit,inputProps:{placeholder:a[i],value:t},loading:e,"data-id":"baseSearchBar"}),(0,n.jsx)(r.Dropdown,{menu:l,menuPlacement:"bottom-end","data-id":"buttonMore",children:(0,n.jsx)(r.Button,{caret:!0,"aria-label":s.lmsg("searchModeDropdown")})})]})}}c.propTypes={loading:l().bool,value:l().string,locale:l().shape({lmsg:l().func}).isRequired,onSubmit:l().func.isRequired},c.defaultProps={loading:!1,value:""};const u=c},1821(e,t,s){s.r(t),s.d(t,{default:()=>i.default});var i=s(1822)},1884(e,t,s){s.r(t),s.d(t,{default:()=>l});var i=s(396),n=s(1826),o=s(1885);const a=(0,i.lazy)(()=>s.e("views/smb/file-manager/list/UploadProgressDialog").then(s.bind(s,3324))),l=()=>{const[e,t]=(0,i.useState)(null),[s,l]=(0,i.useState)(null),r=()=>{l(e=>e?{...e,isOpen:!1}:e)};return{uploadModals:(0,i.jsxs)(i.Suspense,{children:[e&&(0,i.jsx)(o.default,{...e,onClose:()=>{t(e=>({...e,isOpen:!1}))}}),s&&(0,i.jsx)(a,{...s,onClose:r})]}),openReplaceExistingFilesDialog:e=>{t({...e,isOpen:!0})},updateUploadProgressDialogProps:e=>{l({...e,isOpen:!0,uploadProgressSupported:n.default.isAdvancedUploadSupported()&&n.default.isUploadProgressSupported()})},handleCloseUpload:()=>
1{l(e=>e?.isOpen?{...e,status:"done"}:e)},closeUploadProcessDialog:r}}},1883(e,t,s){s.r(t)},1854(e,t,s){s.r(t)},1853(e,t,s){s.r(t)},1841(e,t,s){s.r(t)}}]);
2//# sourceMappingURL=list.js.map?046b8f7ce71f153dd162

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.